import org.simantics.g3d.vtk.action.RotateAction;
import org.simantics.g3d.vtk.action.TranslateAction;
import org.simantics.g3d.vtk.action.vtkCameraAndSelectorAction;
+import org.simantics.g3d.vtk.common.ContextMenuListener;
import org.simantics.g3d.vtk.common.HoverHighlighter;
import org.simantics.g3d.vtk.common.InteractiveVtkPanel;
import org.simantics.g3d.vtk.common.NodeSelectionProvider2;
import org.simantics.g3d.vtk.common.SelectionHighlighter;
import org.simantics.g3d.vtk.shape.vtkShape;
+import org.simantics.g3d.vtk.utils.AxesDisplay;
import org.simantics.g3d.vtk.utils.vtkPanelUtil;
import org.simantics.objmap.graph.IMapping;
import org.simantics.objmap.graph.Mappings;
import org.simantics.plant3d.actions.AddEquipmentAction;
import org.simantics.plant3d.actions.AddNozzleAction;
import org.simantics.plant3d.actions.RoutePipeAction;
+import org.simantics.plant3d.actions.TranslateInlineAction;
import org.simantics.plant3d.scenegraph.EndComponent;
import org.simantics.plant3d.scenegraph.Equipment;
import org.simantics.plant3d.scenegraph.IP3DNode;
private vtkCameraAndSelectorAction cameraAction;
private TranslateAction translateAction;
+ private TranslateInlineAction translateInlineAction;
private RotateAction rotateAction;
private RemoveAction removeAction;
private RoutePipeAction routePipeAction;
component.syncPopulate();
- panel.addMouseListener(new java.awt.event.MouseAdapter() {
- @Override
- public void mouseClicked(final java.awt.event.MouseEvent e) {
- if (e.getButton() == java.awt.event.MouseEvent.BUTTON3) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- contextMenu.setLocation(e.getXOnScreen(), e.getYOnScreen());
- contextMenu.setVisible(true);
- }
- });
- }
- }
- });
+ new ContextMenuListener(panel, contextMenu);
-
cameraAction = new vtkCameraAndSelectorAction(panel);
panel.setDefaultAction(cameraAction);
panel.useDefaultAction();
}
translateAction = new TranslateAction(panel,nodeMap);
+ translateInlineAction = new TranslateInlineAction(panel, nodeMap);
rotateAction = new RotateAction(panel,nodeMap);
removeAction = new RemoveAction(nodeMap) {
public void setNode(IG3DNode node) {
vtkSequencePass seq = new vtkSequencePass();
seq.SetPasses(passes);
-
-
vtkCameraPass cameraPass = new vtkCameraPass();
cameraPass.SetDelegatePass(seq);
ren1.AddActor(grid);
panel.addDeletable(grid);
- {
- vtkAxesActor axes = new vtkAxesActor();
- axes.GetXAxisCaptionActor2D().GetCaptionTextProperty().SetColor(0,0,0);
- axes.GetYAxisCaptionActor2D().GetCaptionTextProperty().SetColor(0,0,0);
- axes.GetZAxisCaptionActor2D().GetCaptionTextProperty().SetColor(0,0,0);
- axes.GetXAxisCaptionActor2D().GetCaptionTextProperty().SetShadow(0);
- axes.GetYAxisCaptionActor2D().GetCaptionTextProperty().SetShadow(0);
- axes.GetZAxisCaptionActor2D().GetCaptionTextProperty().SetShadow(0);
- axes.GetXAxisCaptionActor2D().GetCaptionTextProperty().ItalicOff();
- axes.GetYAxisCaptionActor2D().GetCaptionTextProperty().ItalicOff();
- axes.GetZAxisCaptionActor2D().GetCaptionTextProperty().ItalicOff();
- axes.GetXAxisCaptionActor2D().GetCaptionTextProperty().Delete();
- axes.GetYAxisCaptionActor2D().GetCaptionTextProperty().Delete();
- axes.GetZAxisCaptionActor2D().GetCaptionTextProperty().Delete();
- axes.GetXAxisCaptionActor2D().Delete();
- axes.GetYAxisCaptionActor2D().Delete();
- axes.GetZAxisCaptionActor2D().Delete();
- vtkOrientationMarkerWidget widget = new vtkOrientationMarkerWidget();
- widget.SetOutlineColor(0.9300, 0.5700, 0.1300 );
- widget.SetOrientationMarker(axes);
- widget.SetInteractor(panel.getRenderWindowInteractor());
- //widget.SetViewport(0.8, 0.0, 1.0, 0.2); // bottom right
- //widget.SetViewport(0.0, 0.0, 0.4, 0.4);
- widget.SetViewport(0.0, 0.0, 0.2, 0.2); // bottom left
- widget.SetEnabled(1);
- widget.InteractiveOff();
- }
-
+ AxesDisplay axesDisplay = new AxesDisplay(panel);
+ axesDisplay.show();
}
} else if (node instanceof InlineComponent) {
//m.add(translateInlineAction);
InlineComponent component = (InlineComponent)node;
+ m.add(translateInlineAction);
m.add(routePipeAction);
routePipeAction.setComponent(component);
m.add(addComponentAction);
m.add(removeAction);
translateAction.setNode(node);
+ translateInlineAction.setNode(node);
rotateAction.setNode(node);
removeAction.setNode(node);