]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/PipeRun.java
Use generics type variable for mapping db object.
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / scenegraph / PipeRun.java
index 2932f1d2b1bc16a59d1e01d6d2e8d5791003c32e..748141a586ed7438a3e4d6a329be3a51756dc420 100644 (file)
@@ -11,6 +11,7 @@ import org.simantics.g3d.property.annotations.GetPropertyValue;
 import org.simantics.g3d.property.annotations.PropertyTabBlacklist;
 import org.simantics.g3d.property.annotations.SetPropertyValue;
 import org.simantics.g3d.scenegraph.IG3DNode;
+import org.simantics.g3d.vtk.common.VtkView;
 import org.simantics.objmap.graph.annotations.GraphType;
 import org.simantics.objmap.graph.annotations.RelatedElementsAdd;
 import org.simantics.objmap.graph.annotations.RelatedElementsGet;
@@ -20,7 +21,6 @@ import org.simantics.objmap.graph.annotations.RelatedSetValue;
 import org.simantics.plant3d.ontology.Plant3D;
 import org.simantics.plant3d.scenegraph.controlpoint.PipeControlPoint;
 
-import vtk.vtkPanel;
 import vtk.vtkProp3D;
 import vtk.vtkRenderer;
 
@@ -37,7 +37,7 @@ public class PipeRun extends P3DParentNode<IP3DNode> {
        }
        
        @Override
-       public void visualize(vtkPanel panel) {
+       public void visualize(VtkView panel) {
                
        }
        
@@ -77,54 +77,57 @@ public class PipeRun extends P3DParentNode<IP3DNode> {
                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());
                return coll;
        }
+       private static String PIPECP = "pipecp";
+       
        public void addChild(PipeControlPoint node) {
-               addNode("pipecp",node);
+               addNode(PIPECP,node);
        }
        
        public void remChild(PipeControlPoint node) {
-               removeNode("pipecp", node);
+               removeNode(PIPECP, node);
        }
        
        public void deattachChild(PipeControlPoint node) {
-               deattachNode("pipecp", node);
+               deattachNode(PIPECP, node);
        }
        
        public Collection<PipeControlPoint> getControlPoints() {
                Collection<PipeControlPoint> coll = new ArrayList<PipeControlPoint>();
-               for (IG3DNode n : getNodes("pipecp")) {
+               for (IG3DNode n : getNodes(PIPECP)) {
                        coll.add((PipeControlPoint)n);
                }
                return coll;
        }
        
+       
        public boolean equalSpecs(PipeRun other) {
                if (!MathTools.equals(pipeDiameter,other.pipeDiameter))
                        return false;
@@ -158,4 +161,5 @@ public class PipeRun extends P3DParentNode<IP3DNode> {
                        
                }
        }
+       
 }