P3D.Plant <T G3D.RootNode <T P3D.Node
-P3D.childen <R G3D.children
+P3D.children <R G3D.children
P3D.hasGeometry <R L0.IsWeaklyRelatedTo
+P3D.GeometryProvider <T L0.Entity
P3D.LibraryComponent <T P3D.Node
P3D.Builtin : L0.Library
-P3D.Builtin.GeometryProvider <T L0.Entity
-P3D.Builtin.NozzleGeometryProvider : P3D.Builtin.GeometryProvider
-P3D.Builtin.HorizontalTankGeometryProvider : P3D.Builtin.GeometryProvider
-P3D.Builtin.VerticalTankGeometryProvider : P3D.Builtin.GeometryProvider
-P3D.Builtin.StraightGeometryProvider : P3D.Builtin.GeometryProvider
-P3D.Builtin.ElbowGeometryProvider : P3D.Builtin.GeometryProvider
-P3D.Builtin.ReducerGeometryProvider : P3D.Builtin.GeometryProvider
-P3D.Builtin.PumpGeometryProvider : P3D.Builtin.GeometryProvider
-P3D.Builtin.BallValveGeometryProvider : P3D.Builtin.GeometryProvider
-P3D.Builtin.CheckValveGeometryProvider : P3D.Builtin.GeometryProvider
-P3D.Builtin.GateValveGeometryProvider : P3D.Builtin.GeometryProvider
-P3D.Builtin.CapGeometryProvider : P3D.Builtin.GeometryProvider
+P3D.Builtin.NozzleGeometryProvider : P3D.GeometryProvider
+P3D.Builtin.HorizontalTankGeometryProvider : P3D.GeometryProvider
+P3D.Builtin.VerticalTankGeometryProvider : P3D.GeometryProvider
+P3D.Builtin.StraightGeometryProvider : P3D.GeometryProvider
+P3D.Builtin.ElbowGeometryProvider : P3D.GeometryProvider
+P3D.Builtin.ReducerGeometryProvider : P3D.GeometryProvider
+P3D.Builtin.PumpGeometryProvider : P3D.GeometryProvider
+P3D.Builtin.BallValveGeometryProvider : P3D.GeometryProvider
+P3D.Builtin.CheckValveGeometryProvider : P3D.GeometryProvider
+P3D.Builtin.GateValveGeometryProvider : P3D.GeometryProvider
+P3D.Builtin.CapGeometryProvider : P3D.GeometryProvider
P3D.Builtin.ConcentricReducer <T P3D.InlineComponent : P3D.InlineComponent
@VP.constantImageRule P3D.PipeRun IMAGES.Straight
@VP.relationChildRule PROJ.Project L0.ConsistsOf P3D.Plant
@VP.relationChildRule PROJ.Project L0.ConsistsOf CSG.Model
- @VP.relationChildRule P3D.Node P3D.childen P3D.Node
+ @VP.relationChildRule P3D.Node P3D.children P3D.Node
@VP.relationChildRule P3D.Node P3D.HasNozzle P3D.Node
Bundle-Activator: org.simantics.plant3d.Activator
Bundle-Vendor: VTT
Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.ui,
org.eclipse.ui,
org.simantics.db;bundle-version="1.1.0",
org.simantics.db.common;bundle-version="1.1.0",
org.simantics.utils.thread.swt;bundle-version="1.1.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
-Export-Package: org.simantics.plant3d.editor,
+Export-Package: org.simantics.plant3d.actions,
+ org.simantics.plant3d.browser,
+ org.simantics.plant3d.dialog,
+ org.simantics.plant3d.editor,
+ org.simantics.plant3d.geometry,
+ org.simantics.plant3d.gizmo,
+ org.simantics.plant3d.handlers,
+ org.simantics.plant3d.project,
org.simantics.plant3d.property,
- org.simantics.plant3d.scenegraph
+ org.simantics.plant3d.scenegraph,
+ org.simantics.plant3d.scenegraph.controlpoint,
+ org.simantics.plant3d.scl,
+ org.simantics.plant3d.utils
return;
}
- translateAction = new TranslateAction(panel,nodeMap);
- translateInlineAction = new TranslateInlineAction(panel, nodeMap);
- rotateAction = new RotateAction(panel,nodeMap);
- removeAction = new RemoveAction(nodeMap) {
- public void setNode(IG3DNode node) {
- super.setNode(node);
-
-
- }
- };
- routePipeAction = new RoutePipeAction(panel,rootNode);
- addComponentAction = new AddComponentAction(panel, rootNode);
+ createActions();
}
+ protected void createActions() {
+ translateAction = new TranslateAction(panel,nodeMap);
+ translateInlineAction = new TranslateInlineAction(panel, nodeMap);
+ rotateAction = new RotateAction(panel,nodeMap);
+ removeAction = new RemoveAction(nodeMap) {
+ public void setNode(IG3DNode node) {
+ super.setNode(node);
+
+
+ }
+ };
+ routePipeAction = new RoutePipeAction(panel,rootNode);
+ addComponentAction = new AddComponentAction(panel, rootNode);
+ }
+
public void populate() {
ThreadUtils.asyncExec(panel.getThreadQueue(), new Runnable() {
public class P3DRootNode extends ParentNode<INode> implements IG3DNode, NodeMapProvider<vtkProp , INode> {
- @RelatedElementsAdd(Plant3D.URIs.childen)
+ @RelatedElementsAdd(Plant3D.URIs.children)
public void addChild(INode node) {
//public void addChild(IP3DVisualNode node) {
- addNode(Plant3D.URIs.childen,node);
+ addNode(Plant3D.URIs.children,node);
}
- @RelatedElementsGet(Plant3D.URIs.childen)
+ @RelatedElementsGet(Plant3D.URIs.children)
public Collection<INode> getChild() {
- return getNodes(Plant3D.URIs.childen);
+ return getNodes(Plant3D.URIs.children);
}
- @RelatedElementsRem(Plant3D.URIs.childen)
+ @RelatedElementsRem(Plant3D.URIs.children)
public void remChild(INode node) {
//public void remChild(IP3DNode node) {
- removeNode(Plant3D.URIs.childen, node);
+ removeNode(Plant3D.URIs.children, node);
}
private P3DNodeMap nodeMap;
firePropertyChanged(Plant3D.URIs.HasPipeDiameter);
}
- @RelatedElementsAdd(Plant3D.URIs.childen)
+ @RelatedElementsAdd(Plant3D.URIs.children)
public void addChild(PipelineComponent node) {
- addNode(Plant3D.URIs.childen,node);
+ addNode(Plant3D.URIs.children,node);
}
- @RelatedElementsGet(Plant3D.URIs.childen)
+ @RelatedElementsGet(Plant3D.URIs.children)
public Collection<PipelineComponent> getChild() {
Collection<PipelineComponent> coll = new ArrayList<PipelineComponent>();
- for (IG3DNode n : getNodes(Plant3D.URIs.childen)) {
+ for (IG3DNode n : getNodes(Plant3D.URIs.children)) {
coll.add((PipelineComponent)n);
}
return coll;
}
- @RelatedElementsRem(Plant3D.URIs.childen)
+ @RelatedElementsRem(Plant3D.URIs.children)
public void remChild(PipelineComponent node) {
- removeNode(Plant3D.URIs.childen, node);
+ removeNode(Plant3D.URIs.children, node);
}
public List<PipelineComponent> getSortedChild() {
List<PipelineComponent> coll = new ArrayList<PipelineComponent>();
- for (IG3DNode n : getNodes(Plant3D.URIs.childen)) {
+ for (IG3DNode n : getNodes(Plant3D.URIs.children)) {
coll.add((PipelineComponent)n);
}
Collections.sort(coll, new ComponentComparator());
schema.addLinkType(MappingSchemas.fromAnnotations(g, P3DRootNode.class));
schema.addLinkType(MappingSchemas.fromAnnotations(g, PipeRun.class));
- schema.addLinkType(MappingSchemas.fromAdaptable(g, Plant3D.URIs.Builtin_GeometryProvider, GeometryProvider.class));
+ schema.addLinkType(MappingSchemas.fromAdaptable(g, Plant3D.URIs.GeometryProvider, GeometryProvider.class));
return schema;
} catch (IllegalAccessException e) {
throw new DatabaseException(e);
import org.simantics.plant3d.utils.Item.Type;
public class P3DUtil {
+
+ public static List<Item> getEquipments() throws DatabaseException {
+ return getEquipments(Plant3D.URIs.Builtin);
+ }
- public static List<Item> getEquipments() throws DatabaseException {
+ public static List<Item> getEquipments(final String libUri) throws DatabaseException {
return Simantics.getSession().syncRequest(new Read<List<Item>>() {
@Override
public List<Item> perform(ReadGraph graph) throws DatabaseException {
Plant3D p3d = Plant3D.getInstance(graph);
Resource project = Simantics.getProject().get();
- Resource builtins = graph.getResource(Plant3D.URIs.Builtin);
+ Resource builtins = graph.getResource(libUri);
List<Item> actions = getItems(graph, project,p3d.Equipment);
actions.addAll(getItems(graph, builtins,p3d.Equipment));
return actions;
@Override
public List<Item> perform(ReadGraph graph) throws DatabaseException {
Plant3D p3d = Plant3D.getInstance(graph);
- ItemQuery query = new ItemQuery(p3d.Nozzle);
+ ItemQuery query = new ItemQuery(p3d.Nozzle, Plant3D.URIs.Builtin);
return graph.syncRequest(query);
}
});
}
- private static class ItemQuery implements Read<List<Item>> {
+ public static class ItemQuery implements Read<List<Item>> {
private Resource type;
- public ItemQuery(Resource type) {
+ private String libUri;
+ public ItemQuery(Resource type, String libUri) {
this.type = type;
+ this.libUri = libUri;
}
@Override
public List<Item> perform(ReadGraph graph) throws DatabaseException {
Resource project = Simantics.getProject().get();
- Resource builtins = graph.getResource(Plant3D.URIs.Builtin);
+ Resource builtins = graph.getResource(libUri);
List<Item> actions = getItems(graph, project,type);
actions.addAll(getItems(graph, builtins,type));
return actions;
}
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj.getClass() != this.getClass())
+ return false;
+ ItemQuery other = (ItemQuery)obj;
+ if (!type.equals(other.type))
+ return false;
+ return libUri.equals(other.libUri);
+ }
+
+ @Override
+ public int hashCode() {
+ return type.hashCode() + libUri.hashCode();
+ }
}
public static List<Item> getEnds() throws DatabaseException {
@Override
public List<Item> perform(ReadGraph graph) throws DatabaseException {
Plant3D p3d = Plant3D.getInstance(graph);
- ItemQuery query = new ItemQuery(p3d.EndComponent);
+ ItemQuery query = new ItemQuery(p3d.EndComponent, Plant3D.URIs.Builtin);
return graph.syncRequest(query);
}
});
@Override
public List<Item> perform(ReadGraph graph) throws DatabaseException {
Plant3D p3d = Plant3D.getInstance(graph);
- ItemQuery query = new ItemQuery(p3d.TurnComponent);
+ ItemQuery query = new ItemQuery(p3d.TurnComponent, Plant3D.URIs.Builtin);
return graph.syncRequest(query);
}
});
@Override
public List<Item> perform(ReadGraph graph) throws DatabaseException {
Plant3D p3d = Plant3D.getInstance(graph);
- ItemQuery query = new ItemQuery(p3d.InlineComponent);
+ ItemQuery query = new ItemQuery(p3d.InlineComponent, Plant3D.URIs.Builtin);
return graph.syncRequest(query);
}
});