[vtkusers] Creating Axes

Michael Rice marice at knology.net
Sun May 28 13:19:57 EDT 2006


There is, you can use the vtkAxesActor and  
vtkOrientationMarkerWidget. Here's a snippet; look at the docs to see  
the available options.

   vtkAxesActor* axesActor = vtkAxesActor::New();
   axesActor->AxisLabelsOn();
   axesActor->SetShaftTypeToLine();
   axesActor->SetTipTypeToCone();
   axesActor->GetXAxisCaptionActor2D()->GetCaptionTextProperty()- 
 >ShadowOff();
   axesActor->GetYAxisCaptionActor2D()->GetCaptionTextProperty()- 
 >ShadowOff();
   axesActor->GetZAxisCaptionActor2D()->GetCaptionTextProperty()- 
 >ShadowOff();
   _axes = vtkOrientationMarkerWidget::New();
   _axes->SetOrientationMarker(axesActor);
   _axes->SetInteractor(GetInteractor());
   _axes->EnabledOn();
   _axes->InteractiveOff();

This leaves the axes in the lower-left corner, but you can control  
the position and size.

On May 28, 2006, at 9:23 AM, Bob Palank wrote:

> Creating x,y,z axes using three vtkLineSource actors seems straight  
> forward,
> but is there a more elegant approach in C++ ?
> BR
>   Bob
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/ 
> Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list