]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/actions/TranslateInlineAction.java
Allow insertion of components at the ends of straight segments
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / actions / TranslateInlineAction.java
index 9001d0a7124011fb20567fdd18249a443548f6d2..91cc3ceae233e2c68f2f300ed2a612f158ba5620 100644 (file)
@@ -43,7 +43,7 @@ public class TranslateInlineAction extends TranslateAction{
                        } else if (comp.getNext() == null || comp.getPrevious() == null) {
                 setEnabled(true);
                 inline = false;
-                dir = comp.getControlPoint().getPathLegDirection(Direction.NEXT);
+                dir = comp.getControlPoint().getInlineDir();
                 dir.normalize();
             } else {
                                setEnabled(true);
@@ -66,8 +66,7 @@ public class TranslateInlineAction extends TranslateAction{
                                Point3d pe = new Point3d();
                                next.getEnds(ns, ne);
                                prev.getEnds(ps, pe);
-                               dir = comp.getControlPoint().getPathLegDirection(Direction.NEXT);
-                               dir.normalize();
+                               dir = comp.getControlPoint().getInlineDir();
                                // We may have offsets in the path leg, hence we have to project the coordinates.
                                Vector3d wp = node.getWorldPosition();
                                if (prev.getControlPoint().isVariableLength())
@@ -127,7 +126,7 @@ public class TranslateInlineAction extends TranslateAction{
                        //boolean step = ((e.getModifiers() & MouseEvent.CTRL_MASK) > 0);
                        Vector3d pos = new Vector3d(node.getWorldPosition());
                        
-                       System.out.println(pos + " " + translate);
+//                     System.out.println(pos + " " + translate);
                        //pos.add(translate);
                        pos.set(translate);
                        //pos = constaints(pos, step);