[vtkusers] How to use CompassWidget for scene orientation

Sonya Blade sonyablade2010 at hotmail.com
Fri Jun 20 12:50:38 EDT 2014


Hi Adrian,Thanks for the entry point.
> 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

Is this totally new widget that has no relevance or anything in common with CompasWidget?If so from which VTK class should I derive the new class? 
Concisely studying your code, it outlines that you embed the AxesActor into newly derived class,the connection with renderer is established by passing vtkRenderer into constructor as reference argument. 
The key point here AFAIU is vtkOrientationMarkerWidget which is supposed to deal with applying the scene transformation to the widget, please confirm?
Regards,
> 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.
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140620/ae61ce29/attachment-0001.html>


More information about the vtkusers mailing list