]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/TurnComponent.java
Refuse attempts to set turn radius index to a negative value.
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / scenegraph / TurnComponent.java
index 1bf674410cbf1be7aaebc6fe20ad082b1cf06519..794c53294a0197210674e6bb416aefa5b70401e2 100644 (file)
@@ -42,6 +42,9 @@ public class TurnComponent extends PipelineComponent {
        public void setType(String type) throws Exception{
                this.type = type;
                controlPoint = ControlPointFactory.create(this);
+               syncNext();
+        syncPrevious();
+        syncBranch0();
        }
        
        @Override
@@ -137,7 +140,7 @@ public class TurnComponent extends PipelineComponent {
     public void setTurnRadiusIndex(Integer turnRadiusIndex) {
            if (this.turnRadiusIndex == turnRadiusIndex)
                return;
-           if (turnRadiusIndex == null)
+           if (turnRadiusIndex == null || turnRadiusIndex < 0)
                return;
            if (turnRadiusIndex != null && getPipeRun() != null) {
                if (getPipeRun().getTurnRadiusArray().length <= turnRadiusIndex)