[vtkusers] How to use CompassWidget for scene orientation

Najzero adrian.gabriel at 4plus.de
Fri Jun 20 05:18:37 EDT 2014


Hi there,

I just recently used CompassWidget in my ActiViz Application, but I strongly
believe its the same in c++/py.

I think you need a vtkOrientationMarkerWidget on top of your vtkAxesActor

1) created a Class having those privates:
 private readonly vtkAxesActor _actor = vtkAxesActor.New();
 private readonly vtkOrientationMarkerWidget _widget =
vtkOrientationMarkerWidget.New();

2) constructor with vtkRenderer
public CoordinateAxes( vtkRenderer renderer )
        {
            _actor.SetScale( 0.5, 0.5, 0.5 );

            _widget.SetOrientationMarker(_actor);
           
_widget.SetInteractor(renderer.GetRenderWindow().GetInteractor());
            _widget.SetViewport(0.0, 0.0, 0.25, 0.25);
            _widget.EnabledOn();
            _widget.InteractiveOff();
        }

3) creating your class when your main vtk window is created, I just did so
upon RenderViewOnHandleCreated() event by
_orientationAxis = new CoordinateAxes( renderer );

Thats all I needed to do, updates from your interactive Widget get through
the renderer/main interactor of your renderer ( SetInteractor() )

Best Regards
Adrian



--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-use-CompassWidget-for-scene-orientation-tp5727577p5727580.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list