FreeMat

- Main Page
- Related Pages

vtkOrientationMarkerWidget

Section: Visualization Toolkit Widget Classes

# Usage

This class provides support for interactively manipulating the position, size, and apparent orientation of a prop that represents an orientation marker. This class works by adding its internal renderer to an external "parent" renderer on a different layer. The input orientation marker is rendered as an overlay on the parent renderer and, thus, appears superposed over all props in the parent's scene. The camera view of the orientation the marker is made to match that of the parent's by means of an observer mechanism, giving the illusion that the orientation of the marker reflects that of the prop(s) in the parent's scene.

The widget listens to left mouse button and mouse movement events. It will change the cursor shape based on its location. If the cursor is over the overlay renderer, it will change the cursor shape to a SIZEALL shape or to a resize corner shape (e.g., SIZENW) if the cursor is near a corner. If the left mouse button is pressed and held down while moving, the overlay renderer, and hence, the orientation marker, is resized or moved. I the case of a resize operation, releasing the left mouse button causes the widget to enforce its renderer to be square. The diagonally opposite corner to the one moved is repositioned such that all edges of the renderer have the same length: the minimum.

To use this object, there are two key steps: 1) invoke SetInteractor() with the argument of the method a vtkRenderWindowInteractor, and 2) invoke SetOrientationMarker with an instance of vtkProp (see caveats below). Specifically, vtkAxesActor and vtkAnnotatedCubeActor are two classes designed to work with this class. A composite orientation marker can be generated by adding instances of vtkAxesActor and vtkAnnotatedCubeActor to a vtkPropAssembly, which can then be set as the input orientation marker. The widget can be also be set up in a non-interactive fashion by setting Ineractive to Off and sizing/placing the overlay renderer in its parent renderer by calling the widget's SetViewport method.

To create an instance of class vtkOrientationMarkerWidget, simply invoke its constructor as follows

      obj = vtkOrientationMarkerWidget

# Methods

The class vtkOrientationMarkerWidget has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, `obj` is an instance of the vtkOrientationMarkerWidget class.

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkOrientationMarkerWidget = obj.NewInstance ()`
- `vtkOrientationMarkerWidget = obj.SafeDownCast (vtkObject o)`
- `obj.SetOrientationMarker (vtkProp prop)` - Set/get the orientation marker to be displayed in this widget.
- `vtkProp = obj.GetOrientationMarker ()` - Set/get the orientation marker to be displayed in this widget.
- `obj.SetEnabled (int )` - Enable/disable the widget. Default is 0 (disabled).
- `obj.SetInteractive (int state)` - Set/get whether to allow this widget to be interactively moved/scaled. Default is On.
- `int = obj.GetInteractive ()` - Set/get whether to allow this widget to be interactively moved/scaled. Default is On.
- `obj.InteractiveOn ()` - Set/get whether to allow this widget to be interactively moved/scaled. Default is On.
- `obj.InteractiveOff ()` - Set/get whether to allow this widget to be interactively moved/scaled. Default is On.
- `obj.SetOutlineColor (double r, double g, double b)` - Set/get the color of the outline of this widget. The outline is visible when (in interactive mode) the cursor is over this widget. Default is white (1,1,1).
- `obj.SetViewport (double minX, double minY, double maxX, double maxY)` - Set/get the viewport to position/size this widget. Default is bottom left corner (0,0,0.2,0.2).
- `obj.SetTolerance (int )` - The tolerance representing the distance to the widget (in pixels) in which the cursor is considered to be on the widget, or on a widget feature (e.g., a corner point or edge).
- `int = obj.GetToleranceMinValue ()` - The tolerance representing the distance to the widget (in pixels) in which the cursor is considered to be on the widget, or on a widget feature (e.g., a corner point or edge).
- `int = obj.GetToleranceMaxValue ()` - The tolerance representing the distance to the widget (in pixels) in which the cursor is considered to be on the widget, or on a widget feature (e.g., a corner point or edge).
- `int = obj.GetTolerance ()` - The tolerance representing the distance to the widget (in pixels) in which the cursor is considered to be on the widget, or on a widget feature (e.g., a corner point or edge).