X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Fscenegraph%2Fcontrolpoint%2FControlPointFactory.java;h=1b982f07ce6ac3cd84ca14fac483fe89e98a8ef5;hb=53d55c24c779745f188bdb18d32f71d20acb61b2;hp=193cdd27d16745d6483b83ee99a802185604ca06;hpb=a460e609147d064dd3da464bcf1626845e0f93b4;p=simantics%2F3d.git diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/ControlPointFactory.java b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/ControlPointFactory.java index 193cdd27..1b982f07 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/ControlPointFactory.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/ControlPointFactory.java @@ -11,7 +11,7 @@ import org.simantics.db.exception.DatabaseException; import org.simantics.db.request.Read; import org.simantics.plant3d.ontology.Plant3D; import org.simantics.plant3d.scenegraph.PipelineComponent; -import org.simantics.plant3d.scenegraph.controlpoint.PipeControlPoint.Type; +import org.simantics.plant3d.scenegraph.controlpoint.PipeControlPoint.PointType; import org.simantics.plant3d.utils.Item; import org.simantics.plant3d.utils.P3DUtil; @@ -45,6 +45,8 @@ public class ControlPointFactory { PipeControlPoint pcp = new PipeControlPoint(component); pcp.setType(inst.type); pcp.setFixed(inst.fixed); + pcp.setRotate(inst.isRotate); + pcp.setReverse(inst.isReverse); switch(inst.type) { case END: @@ -57,9 +59,11 @@ public class ControlPointFactory { sub.setType(inst.type); sub.setFixed(inst.fixed); sub.setSub(true); -// pcp.setOffset(0.0); + sub.setDeletable(false); if (inst.isOffset) pcp.setOffset(0.0); + if (inst.isSizeChange) + pcp.setSizeChange(true); } break; @@ -72,11 +76,12 @@ public class ControlPointFactory { private static class Instruction { - Type type; + PointType type; boolean fixed; boolean isOffset; boolean isSizeChange; - + boolean isRotate; + boolean isReverse; } @@ -90,15 +95,17 @@ public class ControlPointFactory { i.fixed = false; i.isOffset = false; i.isSizeChange = false; - i.type = Type.INLINE; + i.isRotate = false; + i.isReverse = false; + i.type = PointType.INLINE; if (graph.isInheritedFrom(res, p3d.Nozzle)) { i.fixed = true; i.isOffset = false; i.isSizeChange = false; - i.type = Type.END; + i.type = PointType.END; } else if (graph.isInheritedFrom(res, p3d.InlineComponent)){ - i.type = Type.INLINE; + i.type = PointType.INLINE; if (graph.hasStatement(res,p3d.VariableLengthInlineComponent)) { i.fixed = false; } else if (graph.hasStatement(res,p3d.FixedLengthInlineComponent)) { @@ -112,9 +119,16 @@ public class ControlPointFactory { if (graph.hasStatement(res,p3d.OffsetComponent)) { i.isOffset = true; } + if (graph.hasStatement(res,p3d.RotateComponent)) { + i.isRotate = true; + } + + if (graph.hasStatement(res,p3d.ReverseComponent)) { + i.isReverse = true; + } } else if (graph.isInheritedFrom(res, p3d.TurnComponent)) { - i.type = Type.TURN; + i.type = PointType.TURN; if (graph.hasStatement(res,p3d.VariableAngleTurnComponent)) { i.fixed = false; } else if (graph.hasStatement(res,p3d.FixedAngleTurnComponent)) { @@ -122,7 +136,7 @@ public class ControlPointFactory { } } else if (graph.isInheritedFrom(res, p3d.EndComponent)) { i.fixed = false; - i.type = Type.END; + i.type = PointType.END; } else { return null; }