]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java
Disable in-line translate for variable length components
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / scenegraph / controlpoint / PipingRules.java
index e1d9ae2d3971a57548a8821f9c118acb4c4934ff..3fc0488105fe8a24a8bd7197a188fb448ec3bfe7 100644 (file)
@@ -475,14 +475,19 @@ public class PipingRules {
                if (DEBUG)
                        System.out.println("PipingRules.updateInlineControlPoints() " + u);
 
+               Vector3d start = new Vector3d(u.startPoint);
+               Vector3d end = new Vector3d(u.endPoint);
+               
+               if (checkSizes) {
+                       // create offsets for leg ends.
+                       MathTools.mad(start, u.dir, u.start.getInlineLength());
+                       MathTools.mad(end, u.dir, -u.end.getInlineLength());
+               }
+               
                boolean recalcline = false;
                if (!u.hasOffsets) {
                        
-                       Vector3d start = new Vector3d(u.startPoint);
-                       Vector3d end = new Vector3d(u.endPoint);
-                       // create offsets.
-                       MathTools.mad(start, u.dir, u.start.getInlineLength());
-                       MathTools.mad(end, u.dir, -u.end.getInlineLength());
+                       
                        for (PipeControlPoint icp : u.list) {
                                updateInlineControlPoint(icp, start, end, u.dir);
                                
@@ -537,8 +542,8 @@ public class PipingRules {
                                }
                        }
                } else { // with offset
-                       Vector3d sp = new Vector3d(u.startPoint);
-                       Vector3d ep = new Vector3d(u.endPoint);
+                       Vector3d sp = new Vector3d(start);
+                       Vector3d ep = new Vector3d(end);
                        ep.sub(u.offset);
                        
                        ArrayList<PipeControlPoint> pathLegPoints = new ArrayList<PipeControlPoint>();
@@ -1471,8 +1476,11 @@ public class PipingRules {
                double angle = 0.0;
                if (angleO != null)
                        angle = angleO;
-
-               Quat4d q = pcp.getControlPointOrientationQuat(angle);
+               Boolean reversedO = pcp.getReversed();
+               boolean reversed = false;
+               if (reversedO != null)
+                       reversed = reversedO;
+               Quat4d q = pcp.getControlPointOrientationQuat(angle, reversed);
                pcp.setWorldOrientation(q);
        }