import org.simantics.g3d.math.MathTools;
import org.simantics.g3d.math.Ray;
import org.simantics.g3d.scenegraph.IG3DNode;
+import org.simantics.g3d.scenegraph.base.INode;
+import org.simantics.g3d.toolbar.ToolComposite;
import org.simantics.g3d.vtk.common.VTKNodeMap;
import org.simantics.g3d.vtk.swt.InteractiveVtkComposite;
import org.simantics.g3d.vtk.swt.TranslateAction;
private Vector3d e;
private Vector3d dir;
- public TranslateInlineAction(InteractiveVtkComposite panel, VTKNodeMap nodeMap) {
- super(panel, nodeMap);
+ public TranslateInlineAction(InteractiveVtkComposite panel, VTKNodeMap<?, ? extends INode> nodeMap, ToolComposite toolComposite) {
+ super(panel, nodeMap, toolComposite);
setImageDescriptor(Activator.imageDescriptorFromPlugin("com.famfamfam.silk", "icons/arrow_refresh.png"));
}
} 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);
setEnabled(false);
return;
}
- if (prev.getControlPoint().isInline() && !prev.getControlPoint().isFixed() && prev.getPrevious() != null)
+ if (prev.getControlPoint().isInline() && !prev.getControlPoint().isFixedLength() && prev.getPrevious() != null)
prev = prev.getPrevious();
- if (next.getControlPoint().isInline() && !next.getControlPoint().isFixed() && next.getNext() != null) {
+ if (next.getControlPoint().isInline() && !next.getControlPoint().isFixedLength() && next.getNext() != null) {
next = next.getNext();
}
Point3d ns = new Point3d();
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())
}
}
+ @Override
+ protected void createTools(ToolComposite toolComposite) {
+
+ }
+
@Override
public boolean keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ESCAPE)
//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);