X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Factions%2FAddComponentAction.java;h=dae8c629b4335a7bfacb88503086d7d34285311b;hb=57ee576455c42f22303efc600964426474ab6110;hp=9b3d90835e14a3961f5c9af0c48fd7ead86417dc;hpb=3f41b7ad6b1bf03b8e7b27a6c6d5809c0ae495c8;p=simantics%2F3d.git diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/actions/AddComponentAction.java b/org.simantics.plant3d/src/org/simantics/plant3d/actions/AddComponentAction.java index 9b3d9083..dae8c629 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/actions/AddComponentAction.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/actions/AddComponentAction.java @@ -76,13 +76,13 @@ public class AddComponentAction extends vtkSwtAction { allowed.add(PositionType.NEXT); } } else { - if (component.getNext() == null) { + if (component.getNext() == null || component.getControlPoint().isVariableLength()) { allowed.add(PositionType.NEXT); } - if (component.getPrevious() == null) { + if (component.getPrevious() == null || component.getControlPoint().isVariableLength()) { allowed.add(PositionType.PREVIOUS); } - if (component instanceof InlineComponent && !component.getControlPoint().isFixedLength()){ + if (component instanceof InlineComponent && component.getControlPoint().isVariableLength()){ allowed.add(PositionType.SPLIT); } } @@ -95,6 +95,7 @@ public class AddComponentAction extends vtkSwtAction { private Double angle; private Double rotationAngle; private Double diameter; + private Double thickness; private Double turnRadius; @Override @@ -119,6 +120,7 @@ public class AddComponentAction extends vtkSwtAction { this.angle = dialog.getAngle(); this.rotationAngle = dialog.getRotationAngle(); this.diameter = dialog.getDiameter(); + this.thickness = dialog.getThickness(); this.turnRadius = dialog.getTurnRadius(); allowed = dialog.filterAllowed(); gizmo.setComponent(component, allowed); @@ -198,6 +200,7 @@ public class AddComponentAction extends vtkSwtAction { inst.name = name; inst.angle = angle != null ? MathTools.degToRad(angle) : null; inst.diameter = diameter; + inst.thickness = thickness; inst.length = length; inst.turnRadius = turnRadius; inst.insertPosition = insertPosition;