]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipeControlPoint.java
Fix error in inserting dual inline components
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / scenegraph / controlpoint / PipeControlPoint.java
index fdb413ee39316b1cbc0652a4e2360c0ceb105b39..cd4f407b22b6f65e3e80a91c2bc4cc5fae2df9a6 100644 (file)
@@ -750,9 +750,6 @@ public class PipeControlPoint extends G3DNode implements IP3DNode {
                        if (pcp.isDualSub()) {
                                pcp.getParentPoint().setNext(this);
                        }
-                       if (isDualInline()) {
-                           getDualSub().setPrevious(this);
-                       }
                } else {
                        // if direction is previous, user must have given sizechange
                        if (pcp.isDualSub())
@@ -791,9 +788,15 @@ public class PipeControlPoint extends G3DNode implements IP3DNode {
        }
        
        /**
-        * Returns direction vector. 
+        * Returns direction vector pointing towards an adjacent component for
+        * directed control points or turn control points with one open end. 
+        * 
+        * Always returns an outwards pointing vector.
+        * 
+        * For any other type of component, the return value is null.
         * 
-        * For directed control points, always returns outwards pointing vector.
+        * For turn components this only return a non-null value for the unconnected
+        * end of the component. 
         * 
         * @param direction
         * @return normalized vector, or null
@@ -837,6 +840,7 @@ public class PipeControlPoint extends G3DNode implements IP3DNode {
                     Vector3d offset = new Vector3d();
                     MathTools.rotate(q2, v, offset);
                     MathTools.rotate(q, offset, dir);
+                    dir.negate();
                     dir.normalize();
                     return dir;
                 }