]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/actions/AddComponentAction.java
Editor internal toolbar for Plant3D editor
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / actions / AddComponentAction.java
index d4cf03073d20214baafd5303d8ac06dfdb963a9f..56b0443eb203b71a16300387d7e8c7e292e3c53d 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;
@@ -41,7 +42,9 @@ public class AddComponentAction extends vtkSwtAction {
        
        private Item toAdd = null;
        private PositionType insertPosition;
+       @SuppressWarnings("unused")
        private boolean insertAdjustable;
+       @SuppressWarnings("unused")
        private boolean lengthAdjustable;
        
        private String libUri;
@@ -71,7 +74,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 +172,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;