1 package org.simantics.g3d.vtk.utils;
3 import org.simantics.g3d.vtk.common.VtkView;
5 import vtk.vtkAxesActor;
6 import vtk.vtkOrientationMarkerWidget;
8 public class AxesDisplay {
11 private VtkView panel;
13 public AxesDisplay(VtkView panel) {
18 vtkAxesActor axes = new vtkAxesActor();
19 axes.GetXAxisCaptionActor2D().GetCaptionTextProperty().SetColor(0,0,0);
20 axes.GetYAxisCaptionActor2D().GetCaptionTextProperty().SetColor(0,0,0);
21 axes.GetZAxisCaptionActor2D().GetCaptionTextProperty().SetColor(0,0,0);
22 axes.GetXAxisCaptionActor2D().GetCaptionTextProperty().SetShadow(0);
23 axes.GetYAxisCaptionActor2D().GetCaptionTextProperty().SetShadow(0);
24 axes.GetZAxisCaptionActor2D().GetCaptionTextProperty().SetShadow(0);
25 axes.GetXAxisCaptionActor2D().GetCaptionTextProperty().ItalicOff();
26 axes.GetYAxisCaptionActor2D().GetCaptionTextProperty().ItalicOff();
27 axes.GetZAxisCaptionActor2D().GetCaptionTextProperty().ItalicOff();
28 axes.GetXAxisCaptionActor2D().GetCaptionTextProperty().Delete();
29 axes.GetYAxisCaptionActor2D().GetCaptionTextProperty().Delete();
30 axes.GetZAxisCaptionActor2D().GetCaptionTextProperty().Delete();
31 axes.GetXAxisCaptionActor2D().Delete();
32 axes.GetYAxisCaptionActor2D().Delete();
33 axes.GetZAxisCaptionActor2D().Delete();
34 vtkOrientationMarkerWidget widget = new vtkOrientationMarkerWidget();
35 widget.SetOutlineColor(0.9300, 0.5700, 0.1300 );
36 widget.SetOrientationMarker(axes);
37 widget.SetInteractor(panel.getRenderWindowInteractor());
38 //widget.SetViewport(0.8, 0.0, 1.0, 0.2); // bottom right
39 //widget.SetViewport(0.0, 0.0, 0.4, 0.4);
40 widget.SetViewport(0.0, 0.0, 0.2, 0.2); // bottom left
42 widget.InteractiveOff();
44 panel.addDeletable(widget);
45 panel.addDeletable(axes);