]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/actions/AddComponentAction.java
Fixed variable angle turns when they are not connected
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / actions / AddComponentAction.java
index d4cf03073d20214baafd5303d8ac06dfdb963a9f..88ab98383633de72e05bfb8b380528c1b8f5eaab 100644 (file)
@@ -8,6 +8,7 @@ import java.util.Set;
 
 import org.eclipse.swt.widgets.Display;
 import org.simantics.db.Resource;
+import org.simantics.g3d.math.MathTools;
 import org.simantics.g3d.scenegraph.NodeMap;
 import org.simantics.g3d.scenegraph.base.INode;
 import org.simantics.g3d.vtk.swt.InteractiveVtkComposite;
@@ -71,7 +72,7 @@ public class AddComponentAction extends vtkSwtAction {
                        if (component.getPrevious() == null) {
                                allowed.add(PositionType.PREVIOUS);
                        }
-                       if (component instanceof InlineComponent && !component.getControlPoint().isFixed()){
+                       if (component instanceof InlineComponent && !component.getControlPoint().isFixedLength()){
                                allowed.add(PositionType.SPLIT);
                        }
                }
@@ -169,7 +170,7 @@ public class AddComponentAction extends vtkSwtAction {
                try  {
                        InsertInstruction inst = new InsertInstruction();
                        inst.typeUri = toAdd.getUri();
-                       inst.angle = angle;
+                       inst.angle = angle != null ? MathTools.degToRad(angle) : null;
                        inst.diameter = diameter;
                        inst.length = length;
                        inst.turnRadius = turnRadius;