vtkOrientationMarkerWidget Class Reference
#include <vtkOrientationMarkerWidget.h>
Inheritance diagram for vtkOrientationMarkerWidget:
[legend]Collaboration diagram for vtkOrientationMarkerWidget:
[legend]List of all members.
Detailed Description
2D widget for manipulating a marker prop
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 relfects 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 vtkAnnoatedCubeActor are two classes designed to work with this class. A composite orientation marker can be generated by adding instances of vtkAxesActor and vtkAnnoatedCubeActor 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.
- Thanks:
- This class was based originally on Paraview's vtkPVAxesWidget.
- Warning:
- The input orientation marker prop should calculate its bounds as though they are symmetric about it's origin. This must currently be done to correctly implement the camera synchronization between the ivar renderer and the renderer associated with the set interactor. Importantly, the InteractorStyle associated with the interactor must be of the type vtkInteractorStyle*Camera. Where desirable, the parent renderer should be set by the SetDefaultRenderer method. The parent renderer's number of layers is modified to 2 where required.
- See also:
- vtkInteractorObserver vtkXYPlotWidget vtkScalarBarWidget vtkAxesActor vtkAnnotatedCubeActor
- Events:
- vtkCommand::DisableEvent vtkCommand::EndInteractionEvent vtkCommand::InteractionEvent vtkCommand::StartInteractionEvent vtkCommand::EnableEvent
- Examples:
- vtkOrientationMarkerWidget (Examples)
- Tests:
- vtkOrientationMarkerWidget (Tests)
Definition at line 88 of file vtkOrientationMarkerWidget.h.
|
Public Types |
typedef vtkInteractorObserver | Superclass |
Public Member Functions |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
virtual void | SetEnabled (int) |
|
void | PrintSelf (ostream &os, vtkIndent indent) |
virtual void | SetOrientationMarker (vtkProp *prop) |
virtual vtkProp * | GetOrientationMarker () |
|
void | ExecuteCameraUpdateEvent (vtkObject *o, unsigned long event, void *calldata) |
void | SetInteractive (int state) |
virtual int | GetInteractive () |
virtual void | InteractiveOn () |
virtual void | InteractiveOff () |
|
void | SetOutlineColor (double r, double g, double b) |
double * | GetOutlineColor () |
|
void | SetViewport (double minX, double minY, double maxX, double maxY) |
double * | GetViewport () |
Static Public Member Functions |
static vtkOrientationMarkerWidget * | New () |
static int | IsTypeOf (const char *type) |
static vtkOrientationMarkerWidget * | SafeDownCast (vtkObject *o) |
Protected Types |
enum | WidgetState {
Outside = 0,
Inside,
Moving,
AdjustingP1,
AdjustingP2,
AdjustingP3,
AdjustingP4
} |
Protected Member Functions |
| vtkOrientationMarkerWidget () |
| ~vtkOrientationMarkerWidget () |
void | OnLeftButtonDown () |
void | OnLeftButtonUp () |
void | OnMouseMove () |
int | ComputeStateBasedOnPosition (int X, int Y, int *pos1, int *pos2) |
void | SetCursor (int state) |
void | MoveWidget (int X, int Y) |
void | ResizeTopLeft (int X, int Y) |
void | ResizeTopRight (int X, int Y) |
void | ResizeBottomLeft (int X, int Y) |
void | ResizeBottomRight (int X, int Y) |
void | SquareRenderer () |
void | UpdateOutline () |
Static Protected Member Functions |
static void | ProcessEvents (vtkObject *object, unsigned long event, void *clientdata, void *calldata) |
Protected Attributes |
vtkRenderer * | Renderer |
vtkProp * | OrientationMarker |
vtkPolyData * | Outline |
vtkActor2D * | OutlineActor |
unsigned long | StartEventObserverId |
vtkOrientationMarkerWidgetObserver * | Observer |
int | Interactive |
int | StartPosition [2] |
int | State |
Member Typedef Documentation
Member Enumeration Documentation
Constructor & Destructor Documentation
vtkOrientationMarkerWidget::vtkOrientationMarkerWidget |
( |
|
) |
[protected] |
|
vtkOrientationMarkerWidget::~vtkOrientationMarkerWidget |
( |
|
) |
[protected] |
|
Member Function Documentation
|
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkObject. |
virtual const char* vtkOrientationMarkerWidget::GetClassName |
( |
|
) |
[virtual] |
|
static int vtkOrientationMarkerWidget::IsTypeOf |
( |
const char * |
type |
) |
[static] |
|
|
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.
Reimplemented from vtkInteractorObserver. |
virtual int vtkOrientationMarkerWidget::IsA |
( |
const char * |
type |
) |
[virtual] |
|
|
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.
Reimplemented from vtkInteractorObserver. |
void vtkOrientationMarkerWidget::PrintSelf |
( |
ostream & |
os, |
|
|
vtkIndent |
indent |
|
) |
[virtual] |
|
|
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkInteractorObserver. |
virtual void vtkOrientationMarkerWidget::SetOrientationMarker |
( |
vtkProp * |
prop |
) |
[virtual] |
|
|
Set/get the orientation marker to be displayed in this widget. |
virtual vtkProp* vtkOrientationMarkerWidget::GetOrientationMarker |
( |
|
) |
[virtual] |
|
virtual void vtkOrientationMarkerWidget::SetEnabled |
( |
int |
|
) |
[virtual] |
|
void vtkOrientationMarkerWidget::ExecuteCameraUpdateEvent |
( |
vtkObject * |
o, |
|
|
unsigned long |
event, |
|
|
void * |
calldata |
|
) |
|
|
|
Callback to keep the camera for the orientation marker up to date with the camera in the parent renderer. |
void vtkOrientationMarkerWidget::SetInteractive |
( |
int |
state |
) |
|
|
|
Set/get whether to allow this widget to be interactively moved/scaled. |
virtual int vtkOrientationMarkerWidget::GetInteractive |
( |
|
) |
[virtual] |
|
|
Callback to keep the camera for the orientation marker up to date with the camera in the parent renderer. |
virtual void vtkOrientationMarkerWidget::InteractiveOn |
( |
|
) |
[virtual] |
|
|
Callback to keep the camera for the orientation marker up to date with the camera in the parent renderer. |
virtual void vtkOrientationMarkerWidget::InteractiveOff |
( |
|
) |
[virtual] |
|
|
Callback to keep the camera for the orientation marker up to date with the camera in the parent renderer. |
void vtkOrientationMarkerWidget::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. |
double* vtkOrientationMarkerWidget::GetOutlineColor |
( |
|
) |
|
|
|
Set/get the color of the outline of this widget. The outline is visible when (in interactive mode) the cursor is over this widget. |
void vtkOrientationMarkerWidget::SetViewport |
( |
double |
minX, |
|
|
double |
minY, |
|
|
double |
maxX, |
|
|
double |
maxY |
|
) |
|
|
|
Set/get the viewport to position/size this widget. |
double* vtkOrientationMarkerWidget::GetViewport |
( |
|
) |
|
|
|
Set/get the viewport to position/size this widget. |
static void vtkOrientationMarkerWidget::ProcessEvents |
( |
vtkObject * |
object, |
|
|
unsigned long |
event, |
|
|
void * |
clientdata, |
|
|
void * |
calldata |
|
) |
[static, protected] |
|
|
Handles the char widget activation event. Also handles the delete event.
Reimplemented from vtkInteractorObserver. |
void vtkOrientationMarkerWidget::OnLeftButtonDown |
( |
|
) |
[protected] |
|
void vtkOrientationMarkerWidget::OnLeftButtonUp |
( |
|
) |
[protected] |
|
void vtkOrientationMarkerWidget::OnMouseMove |
( |
|
) |
[protected] |
|
int vtkOrientationMarkerWidget::ComputeStateBasedOnPosition |
( |
int |
X, |
|
|
int |
Y, |
|
|
int * |
pos1, |
|
|
int * |
pos2 |
|
) |
[protected] |
|
void vtkOrientationMarkerWidget::SetCursor |
( |
int |
state |
) |
[protected] |
|
void vtkOrientationMarkerWidget::MoveWidget |
( |
int |
X, |
|
|
int |
Y |
|
) |
[protected] |
|
void vtkOrientationMarkerWidget::ResizeTopLeft |
( |
int |
X, |
|
|
int |
Y |
|
) |
[protected] |
|
void vtkOrientationMarkerWidget::ResizeTopRight |
( |
int |
X, |
|
|
int |
Y |
|
) |
[protected] |
|
void vtkOrientationMarkerWidget::ResizeBottomLeft |
( |
int |
X, |
|
|
int |
Y |
|
) |
[protected] |
|
void vtkOrientationMarkerWidget::ResizeBottomRight |
( |
int |
X, |
|
|
int |
Y |
|
) |
[protected] |
|
void vtkOrientationMarkerWidget::SquareRenderer |
( |
|
) |
[protected] |
|
void vtkOrientationMarkerWidget::UpdateOutline |
( |
|
) |
[protected] |
|
Member Data Documentation
The documentation for this class was generated from the following file:
Generated on Tue Jan 22 00:04:40 2008 for VTK by
1.4.3-20050530