VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
vtkOrientationMarkerWidget Class Reference

2D widget for manipulating a marker prop More...

#include <vtkOrientationMarkerWidget.h>

Inheritance diagram for vtkOrientationMarkerWidget:
[legend]
Collaboration diagram for vtkOrientationMarkerWidget:
[legend]

Public Types

typedef vtkInteractorObserver Superclass
 
- Public Types inherited from vtkInteractorObserver
typedef vtkObject Superclass
 
- Public Types inherited from vtkObject
typedef vtkObjectBase Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 
vtkOrientationMarkerWidgetNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual void SetEnabled (int)
 
void ExecuteCameraUpdateEvent (vtkObject *o, unsigned long event, void *calldata)
 
virtual void SetOrientationMarker (vtkProp *prop)
 
virtual vtkPropGetOrientationMarker ()
 
void SetInteractive (int state)
 
virtual int GetInteractive ()
 
virtual void InteractiveOn ()
 
virtual void InteractiveOff ()
 
void SetOutlineColor (double r, double g, double b)
 
doubleGetOutlineColor ()
 
void SetViewport (double minX, double minY, double maxX, double maxY)
 
void SetViewport (double viewport[4])
 
doubleGetViewport ()
 
virtual void SetTolerance (int)
 
virtual int GetTolerance ()
 
- Public Member Functions inherited from vtkInteractorObserver
vtkInteractorObserverNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual void OnChar ()
 
int GetEnabled ()
 
void EnabledOn ()
 
void EnabledOff ()
 
void On ()
 
void Off ()
 
virtual void SetInteractor (vtkRenderWindowInteractor *iren)
 
virtual vtkRenderWindowInteractorGetInteractor ()
 
virtual void SetPriority (float)
 
virtual float GetPriority ()
 
virtual void PickingManagedOn ()
 
virtual void PickingManagedOff ()
 
virtual void SetPickingManaged (bool)
 
virtual bool GetPickingManaged ()
 
virtual void SetKeyPressActivation (int)
 
virtual int GetKeyPressActivation ()
 
virtual void KeyPressActivationOn ()
 
virtual void KeyPressActivationOff ()
 
virtual void SetKeyPressActivationValue (char)
 
virtual char GetKeyPressActivationValue ()
 
virtual vtkRendererGetDefaultRenderer ()
 
virtual void SetDefaultRenderer (vtkRenderer *)
 
virtual vtkRendererGetCurrentRenderer ()
 
virtual void SetCurrentRenderer (vtkRenderer *)
 
void GrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void ReleaseFocus ()
 
- Public Member Functions inherited from vtkObject
vtkObjectNewInstance () const
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual unsigned long GetMTime ()
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 

Static Public Member Functions

static vtkOrientationMarkerWidgetNew ()
 
static int IsTypeOf (const char *type)
 
static vtkOrientationMarkerWidgetSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkInteractorObserver
static int IsTypeOf (const char *type)
 
static vtkInteractorObserverSafeDownCast (vtkObjectBase *o)
 
static void ComputeDisplayToWorld (vtkRenderer *ren, double x, double y, double z, double worldPt[4])
 
static void ComputeWorldToDisplay (vtkRenderer *ren, double x, double y, double z, double displayPt[3])
 
- Static Public Member Functions inherited from vtkObject
static int IsTypeOf (const char *type)
 
static vtkObjectSafeDownCast (vtkObjectBase *o)
 
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static int IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Types

enum  WidgetState {
  Outside = 0, Inside, Translating, AdjustingP1,
  AdjustingP2, AdjustingP3, AdjustingP4
}
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 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 ()
 
- Protected Member Functions inherited from vtkInteractorObserver
 vtkInteractorObserver ()
 
 ~vtkInteractorObserver ()
 
virtual void RegisterPickers ()
 
void UnRegisterPickers ()
 
virtual void PickersModified ()
 
vtkPickingManagerGetPickingManager ()
 
int RequestCursorShape (int requestedShape)
 
virtual void StartInteraction ()
 
virtual void EndInteraction ()
 
void ComputeDisplayToWorld (double x, double y, double z, double worldPt[4])
 
void ComputeWorldToDisplay (double x, double y, double z, double displayPt[3])
 
vtkAssemblyPathGetAssemblyPath (double X, double Y, double Z, vtkAbstractPropPicker *picker)
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
virtual void RegisterInternal (vtkObjectBase *, int check)
 
virtual void UnRegisterInternal (vtkObjectBase *, int check)
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Static Protected Member Functions

static void ProcessEvents (vtkObject *object, unsigned long event, void *clientdata, void *calldata)
 
- Static Protected Member Functions inherited from vtkInteractorObserver
static void ProcessEvents (vtkObject *object, unsigned long event, void *clientdata, void *calldata)
 

Protected Attributes

vtkRendererRenderer
 
vtkPropOrientationMarker
 
vtkPolyDataOutline
 
vtkActor2DOutlineActor
 
unsigned long StartEventObserverId
 
vtkOrientationMarkerWidgetObserver * Observer
 
int Interactive
 
int Tolerance
 
int Moving
 
int StartPosition [2]
 
int State
 
- Protected Attributes inherited from vtkInteractorObserver
int Enabled
 
vtkCallbackCommandEventCallbackCommand
 
vtkCallbackCommandKeyPressCallbackCommand
 
float Priority
 
bool PickingManaged
 
int KeyPressActivation
 
char KeyPressActivationValue
 
vtkRenderWindowInteractorInteractor
 
vtkRendererCurrentRenderer
 
vtkRendererDefaultRenderer
 
unsigned long CharObserverTag
 
unsigned long DeleteObserverTag
 
vtkObserverMediatorObserverMediator
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

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 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.

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 89 of file vtkOrientationMarkerWidget.h.

Member Typedef Documentation

Definition at line 93 of file vtkOrientationMarkerWidget.h.

Member Enumeration Documentation

Enumerator
Outside 
Inside 
Translating 
AdjustingP1 
AdjustingP2 
AdjustingP3 
AdjustingP4 

Definition at line 172 of file vtkOrientationMarkerWidget.h.

Constructor & Destructor Documentation

vtkOrientationMarkerWidget::vtkOrientationMarkerWidget ( )
protected
vtkOrientationMarkerWidget::~vtkOrientationMarkerWidget ( )
protected

Member Function Documentation

static vtkOrientationMarkerWidget* vtkOrientationMarkerWidget::New ( )
static
static int vtkOrientationMarkerWidget::IsTypeOf ( const char *  type)
static
virtual int vtkOrientationMarkerWidget::IsA ( const char *  name)
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 vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkInteractorObserver.

static vtkOrientationMarkerWidget* vtkOrientationMarkerWidget::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkOrientationMarkerWidget::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkInteractorObserver.

vtkOrientationMarkerWidget* vtkOrientationMarkerWidget::NewInstance ( ) const
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 vtkObject.

virtual void vtkOrientationMarkerWidget::SetOrientationMarker ( vtkProp prop)
virtual

Set/get the orientation marker to be displayed in this widget.

virtual vtkProp* vtkOrientationMarkerWidget::GetOrientationMarker ( )
virtual

Set/get the orientation marker to be displayed in this widget.

virtual void vtkOrientationMarkerWidget::SetEnabled ( int  )
virtual

Enable/disable the widget. Default is 0 (disabled).

Reimplemented from vtkInteractorObserver.

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. Default is On.

virtual int vtkOrientationMarkerWidget::GetInteractive ( )
virtual

Set/get whether to allow this widget to be interactively moved/scaled. Default is On.

virtual void vtkOrientationMarkerWidget::InteractiveOn ( )
virtual

Set/get whether to allow this widget to be interactively moved/scaled. Default is On.

virtual void vtkOrientationMarkerWidget::InteractiveOff ( )
virtual

Set/get whether to allow this widget to be interactively moved/scaled. Default is On.

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. Default is white (1,1,1).

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. Default is white (1,1,1).

void vtkOrientationMarkerWidget::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).

void vtkOrientationMarkerWidget::SetViewport ( double  viewport[4])

Set/get the viewport to position/size this widget. Default is bottom left corner (0,0,0.2,0.2).

double* vtkOrientationMarkerWidget::GetViewport ( )

Set/get the viewport to position/size this widget. Default is bottom left corner (0,0,0.2,0.2).

virtual void vtkOrientationMarkerWidget::SetTolerance ( int  )
virtual

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).

virtual int vtkOrientationMarkerWidget::GetTolerance ( )
virtual

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).

static void vtkOrientationMarkerWidget::ProcessEvents ( vtkObject object,
unsigned long  event,
void *  clientdata,
void *  calldata 
)
staticprotected
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

vtkRenderer* vtkOrientationMarkerWidget::Renderer
protected

Definition at line 145 of file vtkOrientationMarkerWidget.h.

vtkProp* vtkOrientationMarkerWidget::OrientationMarker
protected

Definition at line 146 of file vtkOrientationMarkerWidget.h.

vtkPolyData* vtkOrientationMarkerWidget::Outline
protected

Definition at line 147 of file vtkOrientationMarkerWidget.h.

vtkActor2D* vtkOrientationMarkerWidget::OutlineActor
protected

Definition at line 148 of file vtkOrientationMarkerWidget.h.

unsigned long vtkOrientationMarkerWidget::StartEventObserverId
protected

Definition at line 150 of file vtkOrientationMarkerWidget.h.

vtkOrientationMarkerWidgetObserver* vtkOrientationMarkerWidget::Observer
protected

Definition at line 161 of file vtkOrientationMarkerWidget.h.

int vtkOrientationMarkerWidget::Interactive
protected

Definition at line 163 of file vtkOrientationMarkerWidget.h.

int vtkOrientationMarkerWidget::Tolerance
protected

Definition at line 164 of file vtkOrientationMarkerWidget.h.

int vtkOrientationMarkerWidget::Moving
protected

Definition at line 165 of file vtkOrientationMarkerWidget.h.

int vtkOrientationMarkerWidget::StartPosition[2]
protected

Definition at line 168 of file vtkOrientationMarkerWidget.h.

int vtkOrientationMarkerWidget::State
protected

Definition at line 171 of file vtkOrientationMarkerWidget.h.


The documentation for this class was generated from the following file: