Slicer  4.11
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  { WidgetStateFollowCursor = WidgetStateUser, WidgetStateSpin, WidgetStateTouchGesture }
 Widget states. More...
 
enum  {
  WidgetEventSpinStart = WidgetEventUser, WidgetEventSpinEnd, WidgetEventCameraRotateToRight, WidgetEventCameraRotateToLeft,
  WidgetEventCameraRotateToAnterior, WidgetEventCameraRotateToPosterior, WidgetEventCameraRotateToSuperior, WidgetEventCameraRotateToInferior,
  WidgetEventCameraTranslateForwardX, WidgetEventCameraTranslateBackwardX, WidgetEventCameraTranslateForwardY, WidgetEventCameraTranslateBackwardY,
  WidgetEventCameraTranslateForwardZ, WidgetEventCameraTranslateBackwardZ, WidgetEventCameraRotateCcwX, WidgetEventCameraRotateCwX,
  WidgetEventCameraRotateCcwY, WidgetEventCameraRotateCwY, WidgetEventCameraRotateCcwZ, WidgetEventCameraRotateCwZ,
  WidgetEventCameraZoomIn, WidgetEventCameraZoomOut, WidgetEventCameraWheelZoomIn, WidgetEventCameraWheelZoomOut,
  WidgetEventCameraReset, WidgetEventCameraResetTranslation, WidgetEventCameraResetRotation, WidgetEventCameraRotate,
  WidgetEventCameraPan, WidgetEventTouchGestureStart, WidgetEventTouchGestureEnd, WidgetEventTouchSpinCamera,
  WidgetEventTouchPinchZoom, WidgetEventTouchPanTranslate, WidgetEventSetCrosshairPosition
}
 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, 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)
 
- Public Member Functions inherited from vtkMRMLAbstractWidget
virtual bool GetGrabFocus ()
 
vtkMRMLInteractionNodeGetInteractionNode ()
 
virtual bool GetInteractive ()
 
virtual int GetMouseCursor ()
 
vtkMRMLApplicationLogicGetMRMLApplicationLogic ()
 
virtual bool GetNeedToRender ()
 
virtual 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 ProcessMouseMove (vtkMRMLInteractionEventData *eventData)
 
bool ProcessRotate (vtkMRMLInteractionEventData *eventData)
 
bool ProcessScale (vtkMRMLInteractionEventData *eventData)
 
bool ProcessSetCrosshair (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)
 
void SaveStateForUndo ()
 
 vtkMRMLCameraWidget ()
 
 ~vtkMRMLCameraWidget () override
 
- Protected Member Functions inherited from vtkMRMLAbstractWidget
const char * GetAssociatedNodeID (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 ModifierKeyPressedSinceLastMouseButtonRelease
 
double MotionFactor
 
double MouseWheelMotionFactor
 
int PreviousEventPosition [2]
 
double StartEventPosition [2]
 
- Protected Attributes inherited from vtkMRMLAbstractWidget
vtkMRMLApplicationLogicApplicationLogic
 
std::vector< vtkSmartPointer< vtkWidgetEventTranslator > > EventTranslators
 
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
WidgetStateFollowCursor 
WidgetStateSpin 
WidgetStateTouchGesture 

Definition at line 72 of file vtkMRMLCameraWidget.h.

◆ anonymous enum

anonymous enum

Widget events.

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

Definition at line 80 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.

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

◆ 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

◆ 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

◆ 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

Member Data Documentation

◆ CameraNode

vtkWeakPointer<vtkMRMLCameraNode> vtkMRMLCameraWidget::CameraNode
protected

Definition at line 166 of file vtkMRMLCameraWidget.h.

◆ ModifierKeyPressedSinceLastMouseButtonRelease

bool vtkMRMLCameraWidget::ModifierKeyPressedSinceLastMouseButtonRelease
protected

Indicates whether the shift key was used during the previous action. This is used to require shift-up before returning to default mode.

Definition at line 173 of file vtkMRMLCameraWidget.h.

◆ MotionFactor

double vtkMRMLCameraWidget::MotionFactor
protected

Definition at line 163 of file vtkMRMLCameraWidget.h.

◆ MouseWheelMotionFactor

double vtkMRMLCameraWidget::MouseWheelMotionFactor
protected

Definition at line 164 of file vtkMRMLCameraWidget.h.

◆ PreviousEventPosition

int vtkMRMLCameraWidget::PreviousEventPosition[2]
protected

Definition at line 169 of file vtkMRMLCameraWidget.h.

◆ StartEventPosition

double vtkMRMLCameraWidget::StartEventPosition[2]
protected

Definition at line 168 of file vtkMRMLCameraWidget.h.


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