]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/PipelineComponent.java
SCL bindings to some G3D and Plant3D Java classes
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / scenegraph / PipelineComponent.java
index 06944b53517343420418461e68148103aaaaa476..e200af6b2c852419ffbae9f3334ce2744cbf256b 100644 (file)
@@ -31,6 +31,10 @@ public abstract class PipelineComponent extends GeometryNode {
        private PipelineComponent next;
        private PipelineComponent previous;
        
+       public PipeRun getPipeRun() {
+        return pipeRun;
+    }
+       
        /**
         * Sets the pipe run.
         * 
@@ -322,6 +326,8 @@ public abstract class PipelineComponent extends GeometryNode {
                        if (branch0 != null) {
                                if (branch0.getControlPoint() != null) {
                                        PipeControlPoint branchPoint = getBranchPoint();
+                                       if (branchPoint == null)
+                                           return false;
                                        PipeControlPoint pcp = branch0.getControlPoint();
                                        // TODO, relying that the other direction is connected.
                                        boolean next = branch0.getPrevious() == this; // this --> branch0
@@ -368,10 +374,6 @@ public abstract class PipelineComponent extends GeometryNode {
                return Collections.EMPTY_MAP;
        }
        
-       public PipeRun getPipeRun() {
-               return pipeRun;
-       }
-       
        public abstract String getType();
        public abstract PipeControlPoint getControlPoint();
        
@@ -461,14 +463,8 @@ public abstract class PipelineComponent extends GeometryNode {
                }
        }
        
-       public void getControlPointEnds(Tuple3d p1, Tuple3d p2) {
+       public void getEnds(Tuple3d p1, Tuple3d p2) {
                getControlPoint().getControlPointEnds(p1, p2);
        }
        
-       public Vector3d getNormal() {
-               Vector3d v = new Vector3d();
-               MathTools.rotate(getWorldOrientation(), MathTools.Z_AXIS, v);
-               return v;
-       }
-       
 }