+ /**
+ * Load a read-only Java object representation of a Plant3d model.
+ *
+ * This method can be called from SCL either as a <Proc> or a <ReadGraph> function.
+ */
+ public static <Root extends P3DRootNode> Root loadReadOnly(final Resource root, SchemaProvider schemaProvider)
+ throws DatabaseException {
+ return loadReadOnly(getRequestProcessor(), root, schemaProvider);
+ }
+
+ public static RequestProcessor getRequestProcessor() {
+ RequestProcessor rp = (RequestProcessor) SCLContext.getCurrent().get("graph");
+ return rp != null ? rp : Simantics.getSession();
+ }
+