--- /dev/null
+import "Plant3d/Scenegraph/PipelineComponent"
+import "Plant3d/Scenegraph/Equipment"
+import "Plant3d/Scenegraph/Nozzle"
+import "Plant3d/Scenegraph/P3DRootNode"
+import "./P3DUtil"
+
+importJava "org.simantics.plant3d.utils.ComponentUtils" where
+
+ @JavaName createComponent
+ createComponentWithURI :: P3DRootNode -> String -> <Proc> PipelineComponent
+ @JavaName createEquipment
+ createEquipmentWithURI :: P3DRootNode -> String -> <Proc> Equipment
+
+ createStraight :: P3DRootNode -> <Proc> PipelineComponent
+ createTurn :: P3DRootNode -> <Proc> PipelineComponent
+ createReducer :: P3DRootNode -> <Proc> PipelineComponent
+ createBranchSplit :: P3DRootNode -> <Proc> PipelineComponent
+ createEquipment :: P3DRootNode -> Item -> <Proc> Equipment
+ createDefaultNozzle :: P3DRootNode -> Equipment -> <Proc> Nozzle
+
\ No newline at end of file
+import "G3D/Scenegraph/Node"
+
importJava "org.simantics.plant3d.scl.P3DScriptNodeMap" where
- data P3DScriptNodeMap
\ No newline at end of file
+ data P3DScriptNodeMap
+
+ commit :: P3DScriptNodeMap -> String -> <Proc>()
+ update :: P3DScriptNodeMap -> <Proc> ()
+
+ populate :: P3DScriptNodeMap -> <Proc> ()
+ getRootNode :: P3DScriptNodeMap -> ParentNode
+
+ isChangeTracking :: P3DScriptNodeMap -> Boolean
+ setChangeTracking :: P3DScriptNodeMap -> Boolean -> <Proc> ()
+
+
+
\ No newline at end of file
GeometryProvider provider = getProvider(graph, type);
if (provider != null || graph.hasStatement(type,p3d.NonVisibleComponent)) {
providers.put(typeURI, provider);
- clazzes.put(typeURI,getClazz(graph, type));
+ if (graph.isInheritedFrom(type, p3d.PipelineComponent))
+ clazzes.put(typeURI,getClazz(graph, type));
return;
}
throw new DatabaseException("Cannot find component for " + typeURI);
});
}
+ /**
+ * Creates a component
+ *
+ * Does not set the name or add the component to a piperun.
+ * @param root
+ * @param typeURI
+ * @return
+ * @throws Exception
+ */
public static PipelineComponent createComponent(P3DRootNode root, String typeURI) throws Exception {
Class<? extends PipelineComponent> type = clazzes.get(typeURI);
GeometryProvider provider = providers.get(typeURI);
return component;
}
+ /**
+ * Creates a equipment
+ *
+ * Does not set the name
+ *
+ * @param root
+ * @param typeURI
+ * @return
+ * @throws Exception
+ */
+
+ public static Equipment createEquipment(P3DRootNode root, String typeURI) throws Exception {
+ GeometryProvider provider = providers.get(typeURI);
+ if (provider == null) {
+ load(typeURI);
+ provider = providers.get(typeURI);
+ }
+ Equipment equipment = root.createEquipment();
+ equipment.setType(typeURI);
+ equipment.setGeometry(provider);
+ root.addChild(equipment);
+ return equipment;
+ }
+
public static InlineComponent createStraight(P3DRootNode root) throws Exception{
InlineComponent component = root.createInline();
component.setType(Plant3D.URIs.Builtin_Straight);
return equipment;
}
+
+
public static Nozzle createDefaultNozzle(P3DRootNode root, Equipment equipment) throws Exception {
return createNozzle(root, equipment, new Item(Plant3D.URIs.Builtin_Nozzle, "Nozzle"));
}