X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Fscenegraph%2Fcontrolpoint%2FPipingRules.java;h=393dc85e1ab005bae0e56c515e5ebc238cc99835;hb=a1e1faa6915445e786f482170576b9c9d0f5d982;hp=727cf1a882e8d513fa1ab583ef2584a692054954;hpb=7a6193c2806c1755ad127eb479e871b2008df856;p=simantics%2F3d.git diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java index 727cf1a8..393dc85e 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java @@ -461,7 +461,7 @@ public class PipingRules { private static boolean asDirected(PipeControlPoint pcp, Direction direction) { if (pcp.isDirected()) return true; - if (pcp.isTurn() && pcp.isFixed()) { + if (pcp.asFixedAngle()) { if (!pcp._getReversed()) return direction == Direction.NEXT; else @@ -498,7 +498,7 @@ public class PipingRules { if (DEBUG) System.out.println("PipingRules.updateFreePipeRun " + u + " " + lengthChange); checkExpandPathLeg(u, lengthChange); - if (u.start.isInline() || u.end.isInline() || u.start.isFixed() || u.end.isFixed()) + if (u.start.isInline() || u.end.isInline() || u.start.asFixedAngle()|| u.end.asFixedAngle()) processPathLeg(u, true, false); } @@ -873,7 +873,7 @@ public class PipingRules { double distance = t.length(); boolean aligned = (distance < ALLOWED_OFFSET); if (aligned) { - if (u.start.isInline() || u.end.isInline() || u.start.isFixed() || u.end.isFixed()) + if (u.start.isInline() || u.end.isInline() || u.start.asFixedAngle() || u.end.asFixedAngle()) processPathLeg(u, true, false); checkExpandPathLeg(u, lengthChange, inlineEnd); @@ -1486,24 +1486,9 @@ public class PipingRules { private static void updateEndComponentControlPoint(PipeControlPoint ecp, Vector3d start, Vector3d end) throws Exception { if (DEBUG) System.out.println("PipingRules.updateEndComponentControlPoint() " + ecp); - // PipeControlPoint next = ecp.getNext(); - // PipeControlPoint prev = ecp.getPrevious(); - // if (next != null) { - // end = G3DTools.getPoint(next.getLocalPosition()); - // start = G3DTools.getPoint(ecp.getLocalPosition()); - // } else if (prev != null) { - // end = G3DTools.getPoint(ecp.getLocalPosition()); - // start = G3DTools.getPoint(prev.getLocalPosition()); - // } else { - // // TODO : warning? - // return; - // } - // Vector3d dir = new Vector3d (end); - // dir.sub(start); - // dir.normalize(); - // G3DTools.setTuple(ecp.getDirection(), dir); - if (!ecp.isFixed()) - updateControlPointOrientation(ecp); + //FIXME : end control point cannot be fixed! + //if (!ecp.isFixed()) + updateControlPointOrientation(ecp); for (PipeControlPoint pcp : ecp.getSubPoint()) { // TODO update position @@ -1564,7 +1549,7 @@ public class PipingRules { } } - if (!tcp.isFixed()) { + if (!tcp.asFixedAngle()) { if (next == null || prev == null) { @@ -1768,7 +1753,8 @@ public class PipingRules { } } - if (current.isTurn() && current.isFixed()) { + //if (current.isTurn() && current.isFixed()) { + if (current.asFixedAngle()) { current.setReversed(!current._getReversed()); } if (current.isInline() && current.isReverse()) { @@ -1856,8 +1842,8 @@ public class PipingRules { } public static void splitVariableLengthComponent(PipelineComponent newComponent, InlineComponent splittingComponent, boolean assignPos) throws Exception{ - assert(!splittingComponent.getControlPoint().isFixed()); - assert(!(newComponent instanceof InlineComponent && !newComponent.getControlPoint().isFixed())); + assert(!splittingComponent.getControlPoint().isFixedLength()); + assert(!(newComponent instanceof InlineComponent && !newComponent.getControlPoint().isFixedLength())); PipeControlPoint newCP = newComponent.getControlPoint(); PipeControlPoint splittingCP = splittingComponent.getControlPoint(); PipeControlPoint nextCP = splittingCP.getNext();