]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/ControlPointFactory.java
Support for reversible in-line components
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / scenegraph / controlpoint / ControlPointFactory.java
index 824f74d6741e9e07643fdc197b10b63b9d03e190..71602dcc0ff163220a36b741a78ec9c4d082111d 100644 (file)
@@ -46,6 +46,7 @@ public class ControlPointFactory {
                pcp.setType(inst.type);
                pcp.setFixed(inst.fixed);
                pcp.setRotate(inst.isRotate);
+               pcp.setReverse(inst.isReverse);
                switch(inst.type) {
                case END:
                        
@@ -59,7 +60,6 @@ public class ControlPointFactory {
                                sub.setFixed(inst.fixed);
                                sub.setSub(true);
                                sub.setDeletable(false);
-//                             pcp.setOffset(0.0);
                                if (inst.isOffset)
                                        pcp.setOffset(0.0);
                        }
@@ -79,6 +79,7 @@ public class ControlPointFactory {
                boolean isOffset;
                boolean isSizeChange;
                boolean isRotate;
+               boolean isReverse;
                
        }
        
@@ -93,6 +94,7 @@ public class ControlPointFactory {
                                i.isOffset = false;
                                i.isSizeChange = false;
                                i.isRotate = false;
+                               i.isReverse = false;
                                i.type = Type.INLINE;
                                if (graph.isInheritedFrom(res, p3d.Nozzle)) {
                                        i.fixed = true;
@@ -119,6 +121,10 @@ public class ControlPointFactory {
                                                i.isRotate = true;
                                        }
                                        
+                                       if (graph.hasStatement(res,p3d.ReverseComponent)) {
+                                               i.isReverse = true;
+                                       }
+                                       
                                } else if (graph.isInheritedFrom(res, p3d.TurnComponent)) {
                                        i.type = Type.TURN;
                                        if (graph.hasStatement(res,p3d.VariableAngleTurnComponent)) {