Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkMRMLCameraWidget Class Reference

Process camera manipulation events. More...

#include <Libs/MRML/DisplayableManager/vtkMRMLCameraWidget.h>

Inheritance diagram for vtkMRMLCameraWidget:
Inheritance graph
[legend]
Collaboration diagram for vtkMRMLCameraWidget:
Collaboration graph
[legend]

Public Types

enum  { WidgetStateMoveCrosshair = WidgetStateUser, WidgetStateSpin, WidgetStateTouchGesture }
 Widget states. More...
 
enum  {
  WidgetEventSpinStart = WidgetEventUser, WidgetEventSpinEnd, WidgetEventMoveCrosshairStart, WidgetEventMoveCrosshairEnd,
  WidgetEventCameraRotateToRight, WidgetEventCameraRotateToLeft, WidgetEventCameraRotateToAnterior, WidgetEventCameraRotateToPosterior,
  WidgetEventCameraRotateToSuperior, WidgetEventCameraRotateToInferior, WidgetEventCameraTranslateForwardX, WidgetEventCameraTranslateBackwardX,
  WidgetEventCameraTranslateForwardY, WidgetEventCameraTranslateBackwardY, WidgetEventCameraTranslateForwardZ, WidgetEventCameraTranslateBackwardZ,
  WidgetEventCameraRotateCcwX, WidgetEventCameraRotateCwX, WidgetEventCameraRotateCcwY, WidgetEventCameraRotateCwY,
  WidgetEventCameraRotateCcwZ, WidgetEventCameraRotateCwZ, WidgetEventCameraZoomIn, WidgetEventCameraZoomOut,
  WidgetEventCameraWheelZoomIn, WidgetEventCameraWheelZoomOut, WidgetEventToggleCameraTiltLock, WidgetEventCameraReset,
  WidgetEventCameraResetTranslation, WidgetEventCameraResetRotation, WidgetEventCameraResetFieldOfView, WidgetEventCameraRotate,
  WidgetEventCameraPan, WidgetEventTouchGestureStart, WidgetEventTouchGestureEnd, WidgetEventTouchSpinCamera,
  WidgetEventTouchPinchZoom, WidgetEventTouchPanTranslate, WidgetEventSetCrosshairPosition, WidgetEventSetCrosshairPositionBackground,
  WidgetEventMaximizeView
}
 Widget events. More...
 
- Public Types inherited from vtkMRMLAbstractWidget
enum  {
  WidgetStateAny, WidgetStateIdle, WidgetStateOnWidget, WidgetStateTranslate,
  WidgetStateRotate, WidgetStateScale, WidgetStateUser
}
 The state of the widget. More...
 
typedef vtkObject Superclass
 Standard methods for a VTK class. More...
 
enum  WidgetEvents {
  WidgetEventNone, WidgetEventMouseMove, WidgetEventTranslateStart, WidgetEventTranslateEnd,
  WidgetEventRotateStart, WidgetEventRotateEnd, WidgetEventScaleStart, WidgetEventScaleEnd,
  WidgetEventPick, WidgetEventJumpCursor, WidgetEventAction, WidgetEventCustomAction1,
  WidgetEventCustomAction2, WidgetEventCustomAction3, WidgetEventCustomAction4, WidgetEventCustomAction5,
  WidgetEventCustomAction6, WidgetEventSelect, WidgetEventUnselect, WidgetEventToggleSelect,
  WidgetEventMenu, WidgetEventReset, WidgetEventUser
}
 Widget events. More...
 

Public Member Functions

bool CanProcessInteractionEvent (vtkMRMLInteractionEventData *eventData, double &distance2) override
 Return true if the widget can process the event. More...
 
void CreateDefaultRepresentation ()
 
vtkMRMLCameraNodeGetCameraNode ()
 
virtual double GetMotionFactor ()
 Defines speed of rotation actions by mouse click-and-drag. More...
 
virtual double GetMouseWheelMotionFactor ()
 Defines step size for mouse wheel actions. More...
 
bool ProcessInteractionEvent (vtkMRMLInteractionEventData *eventData) override
 Process interaction event. More...
 
void SetCameraNode (vtkMRMLCameraNode *cameraNode)
 
virtual void SetMotionFactor (double)
 
virtual void SetMouseWheelMotionFactor (double)
 
bool GetTiltLocked ()
 
void SetTiltLocked (bool lockState)
 
- Public Member Functions inherited from vtkMRMLAbstractWidget
virtual vtkWidgetEventTranslator * GetEventTranslator (int widgetState)
 
virtual bool GetGrabFocus ()
 
vtkMRMLInteractionNodeGetInteractionNode ()
 
virtual bool GetInteractive ()
 
virtual int GetMouseCursor ()
 
vtkMRMLApplicationLogicGetMRMLApplicationLogic ()
 
virtual bool GetNeedToRender ()
 
virtual int GetNumberOfEventTranslators ()
 
vtkRenderer * GetRenderer ()
 
virtual vtkMRMLAbstractWidgetRepresentationGetRepresentation ()
 Get the representation. More...
 
virtual int GetWidgetState ()
 Convenient method to determine the state of the method. More...
 
virtual void Leave (vtkMRMLInteractionEventData *eventData)
 Called when the the widget loses the focus. More...
 
virtual void NeedToRenderOff ()
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
void SetEventTranslation (int widgetState, unsigned long interactionEvent, int modifiers, unsigned long widgetEvent)
 
void SetEventTranslation (unsigned long interactionEvent, int modifiers, unsigned long widgetEvent)
 
void SetEventTranslationClickAndDrag (int widgetState, unsigned long startInteractionEvent, int modifiers, int widgetStateDragging, unsigned long widgetStartEvent, unsigned long widgetEndEvent)
 
void SetKeyboardEventTranslation (int modifier, char keyCode, int repeatCount, const char *keySym, unsigned long widgetEvent)
 
void SetKeyboardEventTranslation (int widgetState, int modifier, char keyCode, int repeatCount, const char *keySym, unsigned long widgetEvent)
 
virtual void SetMRMLApplicationLogic (vtkMRMLApplicationLogic *applicationLogic)
 
void SetRenderer (vtkRenderer *renderer)
 
virtual void SetRepresentation (vtkMRMLAbstractWidgetRepresentation *r)
 
virtual void SetWidgetState (int)
 Convenient method to change what state the widget is in. More...
 
virtual unsigned long TranslateInteractionEventToWidgetEvent (vtkMRMLInteractionEventData *eventData)
 Get widget event from translation event. More...
 
virtual void UpdateFromMRML (vtkMRMLNode *caller, unsigned long event, void *callData=nullptr)
 Build the actors of the representation with the info stored in the MRML scene. More...
 

Static Public Member Functions

static vtkMRMLCameraWidgetNew ()
 
- Static Public Member Functions inherited from vtkMRMLAbstractWidget
static int IsTypeOf (const char *type)
 
static vtkMRMLAbstractWidgetSafeDownCast (vtkObject *o)
 

Protected Member Functions

void CameraModifyEnd (bool wasModified, bool updateClippingRange, bool updateLights)
 
bool CameraModifyStart ()
 
bool Dolly (double factor)
 
vtkCamera * GetCamera ()
 
bool ProcessEndMouseDrag (vtkMRMLInteractionEventData *eventData)
 
bool ProcessMaximizeView (vtkMRMLInteractionEventData *eventData)
 
bool ProcessMouseMove (vtkMRMLInteractionEventData *eventData)
 
bool ProcessRotate (vtkMRMLInteractionEventData *eventData)
 
bool ProcessScale (vtkMRMLInteractionEventData *eventData)
 
bool ProcessSetCrosshair (vtkMRMLInteractionEventData *eventData)
 
bool ProcessSetCrosshairBackground (vtkMRMLInteractionEventData *eventData)
 
bool ProcessSpin (vtkMRMLInteractionEventData *eventData)
 
bool ProcessStartMouseDrag (vtkMRMLInteractionEventData *eventData)
 
bool ProcessTouchCameraSpin (vtkMRMLInteractionEventData *eventData)
 
bool ProcessTouchCameraTranslate (vtkMRMLInteractionEventData *eventData)
 
bool ProcessTouchCameraZoom (vtkMRMLInteractionEventData *eventData)
 
bool ProcessTouchGestureEnd (vtkMRMLInteractionEventData *eventData)
 
bool ProcessTouchGestureStart (vtkMRMLInteractionEventData *eventData)
 
bool ProcessTranslate (vtkMRMLInteractionEventData *eventData)
 
bool ProcessWidgetMenu (vtkMRMLInteractionEventData *eventData)
 
void SaveStateForUndo ()
 
 vtkMRMLCameraWidget ()
 
 ~vtkMRMLCameraWidget () override
 
- Protected Member Functions inherited from vtkMRMLAbstractWidget
bool CanProcessButtonClickEvent (vtkMRMLInteractionEventData *eventData, double &distance2)
 Generate a button click event and checks if it can be processed with CanProcessInteractionEvent. More...
 
const char * GetAssociatedNodeID (vtkMRMLInteractionEventData *eventData)
 
virtual int ProcessButtonClickEvent (vtkMRMLInteractionEventData *eventData)
 
unsigned long TranslateInteractionEventToWidgetEvent (vtkWidgetEventTranslator *translator, vtkMRMLInteractionEventData *eventData)
 Helper function that attempts to translate an event with a specific translator only. More...
 
 vtkMRMLAbstractWidget ()
 
 ~vtkMRMLAbstractWidget () override
 

Protected Attributes

vtkWeakPointer< vtkMRMLCameraNodeCameraNode
 
bool CameraTiltLocked
 
bool ModifierKeyPressedSinceLastClickAndDrag
 
double MotionFactor
 
double MouseWheelMotionFactor
 
int PreviousEventPosition [2]
 
double StartEventPosition [2]
 
- Protected Attributes inherited from vtkMRMLAbstractWidget
vtkWeakPointer< vtkMRMLApplicationLogicApplicationLogic
 
std::vector< vtkSmartPointer< vtkWidgetEventTranslator > > EventTranslators
 
vtkWeakPointer< vtkRenderer > Renderer
 
vtkSmartPointer< vtkMRMLAbstractWidgetRepresentationWidgetRep
 
int WidgetState
 
typedef vtkMRMLAbstractWidget Superclass
 
static int IsTypeOf (const char *type)
 
static vtkMRMLCameraWidgetSafeDownCast (vtkObject *o)
 
virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 

Detailed Description

Process camera manipulation events.

This widget does not have a visible representation, only translates and processes camera manipulation (rotate, translate, etc.) events. It is implemented as a widget instead of an interactor style so that mouse and keyboard interaction events can be dynamically remapped to camera manipulation actions and to process all kinds of interaction events (camera manipulation, markups manipulation, ...) in a similar way.

Definition at line 41 of file vtkMRMLCameraWidget.h.

Member Typedef Documentation

◆ Superclass

Standard VTK class macros.

Definition at line 53 of file vtkMRMLCameraWidget.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Widget states.

Enumerator
WidgetStateMoveCrosshair 

Move crosshair position, can be used for moving the crosshair with click-and-drag.

WidgetStateSpin 
WidgetStateTouchGesture 

Definition at line 79 of file vtkMRMLCameraWidget.h.

◆ anonymous enum

anonymous enum

Widget events.

Enumerator
WidgetEventSpinStart 
WidgetEventSpinEnd 
WidgetEventMoveCrosshairStart 
WidgetEventMoveCrosshairEnd 
WidgetEventCameraRotateToRight 
WidgetEventCameraRotateToLeft 
WidgetEventCameraRotateToAnterior 
WidgetEventCameraRotateToPosterior 
WidgetEventCameraRotateToSuperior 
WidgetEventCameraRotateToInferior 
WidgetEventCameraTranslateForwardX 
WidgetEventCameraTranslateBackwardX 
WidgetEventCameraTranslateForwardY 
WidgetEventCameraTranslateBackwardY 
WidgetEventCameraTranslateForwardZ 
WidgetEventCameraTranslateBackwardZ 
WidgetEventCameraRotateCcwX 
WidgetEventCameraRotateCwX 
WidgetEventCameraRotateCcwY 
WidgetEventCameraRotateCwY 
WidgetEventCameraRotateCcwZ 
WidgetEventCameraRotateCwZ 
WidgetEventCameraZoomIn 
WidgetEventCameraZoomOut 
WidgetEventCameraWheelZoomIn 
WidgetEventCameraWheelZoomOut 
WidgetEventToggleCameraTiltLock 
WidgetEventCameraReset 
WidgetEventCameraResetTranslation 
WidgetEventCameraResetRotation 
WidgetEventCameraResetFieldOfView 
WidgetEventCameraRotate 
WidgetEventCameraPan 
WidgetEventTouchGestureStart 
WidgetEventTouchGestureEnd 
WidgetEventTouchSpinCamera 
WidgetEventTouchPinchZoom 
WidgetEventTouchPanTranslate 
WidgetEventSetCrosshairPosition 
WidgetEventSetCrosshairPositionBackground 
WidgetEventMaximizeView 

Definition at line 87 of file vtkMRMLCameraWidget.h.

Constructor & Destructor Documentation

◆ vtkMRMLCameraWidget()

vtkMRMLCameraWidget::vtkMRMLCameraWidget ( )
protected

◆ ~vtkMRMLCameraWidget()

vtkMRMLCameraWidget::~vtkMRMLCameraWidget ( )
overrideprotected

Member Function Documentation

◆ CameraModifyEnd()

void vtkMRMLCameraWidget::CameraModifyEnd ( bool  wasModified,
bool  updateClippingRange,
bool  updateLights 
)
protected

◆ CameraModifyStart()

bool vtkMRMLCameraWidget::CameraModifyStart ( )
protected

◆ CanProcessInteractionEvent()

bool vtkMRMLCameraWidget::CanProcessInteractionEvent ( vtkMRMLInteractionEventData eventData,
double &  distance2 
)
overridevirtual

Return true if the widget can process the event.

Reimplemented from vtkMRMLAbstractWidget.

◆ CreateDefaultRepresentation()

void vtkMRMLCameraWidget::CreateDefaultRepresentation ( )

Create the default widget representation if one is not set.

◆ Dolly()

bool vtkMRMLCameraWidget::Dolly ( double  factor)
protected

◆ GetCamera()

vtkCamera* vtkMRMLCameraWidget::GetCamera ( )
protected

◆ GetCameraNode()

vtkMRMLCameraNode* vtkMRMLCameraWidget::GetCameraNode ( )

◆ GetClassName()

virtual const char* vtkMRMLCameraWidget::GetClassName ( )
virtual

Reimplemented from vtkMRMLAbstractWidget.

◆ GetMotionFactor()

virtual double vtkMRMLCameraWidget::GetMotionFactor ( )
virtual

Defines speed of rotation actions by mouse click-and-drag.

◆ GetMouseWheelMotionFactor()

virtual double vtkMRMLCameraWidget::GetMouseWheelMotionFactor ( )
virtual

Defines step size for mouse wheel actions.

◆ GetTiltLocked()

bool vtkMRMLCameraWidget::GetTiltLocked ( )

Get set tilt lock. It tilt is locked then the view cannot be rotated around the horizontal axis (can only be rotated along the vertical axis).

◆ IsA()

virtual int vtkMRMLCameraWidget::IsA ( const char *  type)
virtual

Reimplemented from vtkMRMLAbstractWidget.

◆ IsTypeOf()

static int vtkMRMLCameraWidget::IsTypeOf ( const char *  type)
static

◆ New()

static vtkMRMLCameraWidget* vtkMRMLCameraWidget::New ( )
static

Instantiate this class.

◆ PrintSelf()

void vtkMRMLCameraWidget::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
override

◆ ProcessEndMouseDrag()

bool vtkMRMLCameraWidget::ProcessEndMouseDrag ( vtkMRMLInteractionEventData eventData)
protected

◆ ProcessInteractionEvent()

bool vtkMRMLCameraWidget::ProcessInteractionEvent ( vtkMRMLInteractionEventData eventData)
overridevirtual

Process interaction event.

Reimplemented from vtkMRMLAbstractWidget.

◆ ProcessMaximizeView()

bool vtkMRMLCameraWidget::ProcessMaximizeView ( vtkMRMLInteractionEventData eventData)
protected

◆ ProcessMouseMove()

bool vtkMRMLCameraWidget::ProcessMouseMove ( vtkMRMLInteractionEventData eventData)
protected

◆ ProcessRotate()

bool vtkMRMLCameraWidget::ProcessRotate ( vtkMRMLInteractionEventData eventData)
protected

◆ ProcessScale()

bool vtkMRMLCameraWidget::ProcessScale ( vtkMRMLInteractionEventData eventData)
protected

◆ ProcessSetCrosshair()

bool vtkMRMLCameraWidget::ProcessSetCrosshair ( vtkMRMLInteractionEventData eventData)
protected

◆ ProcessSetCrosshairBackground()

bool vtkMRMLCameraWidget::ProcessSetCrosshairBackground ( vtkMRMLInteractionEventData eventData)
protected

◆ ProcessSpin()

bool vtkMRMLCameraWidget::ProcessSpin ( vtkMRMLInteractionEventData eventData)
protected

◆ ProcessStartMouseDrag()

bool vtkMRMLCameraWidget::ProcessStartMouseDrag ( vtkMRMLInteractionEventData eventData)
protected

◆ ProcessTouchCameraSpin()

bool vtkMRMLCameraWidget::ProcessTouchCameraSpin ( vtkMRMLInteractionEventData eventData)
protected

◆ ProcessTouchCameraTranslate()

bool vtkMRMLCameraWidget::ProcessTouchCameraTranslate ( vtkMRMLInteractionEventData eventData)
protected

◆ ProcessTouchCameraZoom()

bool vtkMRMLCameraWidget::ProcessTouchCameraZoom ( vtkMRMLInteractionEventData eventData)
protected

◆ ProcessTouchGestureEnd()

bool vtkMRMLCameraWidget::ProcessTouchGestureEnd ( vtkMRMLInteractionEventData eventData)
protected

◆ ProcessTouchGestureStart()

bool vtkMRMLCameraWidget::ProcessTouchGestureStart ( vtkMRMLInteractionEventData eventData)
protected

◆ ProcessTranslate()

bool vtkMRMLCameraWidget::ProcessTranslate ( vtkMRMLInteractionEventData eventData)
protected

◆ ProcessWidgetMenu()

bool vtkMRMLCameraWidget::ProcessWidgetMenu ( vtkMRMLInteractionEventData eventData)
protected

◆ SafeDownCast()

static vtkMRMLCameraWidget* vtkMRMLCameraWidget::SafeDownCast ( vtkObject *  o)
static

◆ SaveStateForUndo()

void vtkMRMLCameraWidget::SaveStateForUndo ( )
protected

◆ SetCameraNode()

void vtkMRMLCameraWidget::SetCameraNode ( vtkMRMLCameraNode cameraNode)

◆ SetMotionFactor()

virtual void vtkMRMLCameraWidget::SetMotionFactor ( double  )
virtual

◆ SetMouseWheelMotionFactor()

virtual void vtkMRMLCameraWidget::SetMouseWheelMotionFactor ( double  )
virtual

◆ SetTiltLocked()

void vtkMRMLCameraWidget::SetTiltLocked ( bool  lockState)

Member Data Documentation

◆ CameraNode

vtkWeakPointer<vtkMRMLCameraNode> vtkMRMLCameraWidget::CameraNode
protected

Definition at line 187 of file vtkMRMLCameraWidget.h.

◆ CameraTiltLocked

bool vtkMRMLCameraWidget::CameraTiltLocked
protected

Definition at line 185 of file vtkMRMLCameraWidget.h.

◆ ModifierKeyPressedSinceLastClickAndDrag

bool vtkMRMLCameraWidget::ModifierKeyPressedSinceLastClickAndDrag
protected

Indicates whether the shift key was used during the previous action. This is used to require shift-up after a click-and-drag before accepting shift+mousemove.

Definition at line 194 of file vtkMRMLCameraWidget.h.

◆ MotionFactor

double vtkMRMLCameraWidget::MotionFactor
protected

Definition at line 183 of file vtkMRMLCameraWidget.h.

◆ MouseWheelMotionFactor

double vtkMRMLCameraWidget::MouseWheelMotionFactor
protected

Definition at line 184 of file vtkMRMLCameraWidget.h.

◆ PreviousEventPosition

int vtkMRMLCameraWidget::PreviousEventPosition[2]
protected

Definition at line 190 of file vtkMRMLCameraWidget.h.

◆ StartEventPosition

double vtkMRMLCameraWidget::StartEventPosition[2]
protected

Definition at line 189 of file vtkMRMLCameraWidget.h.


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