Slicer  5.0
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
vtkSlicerMarkupsWidget Class Referenceabstract

Process interaction events to update state of markup widget nodes. More...

#include <Modules/Loadable/Markups/VTKWidgets/vtkSlicerMarkupsWidget.h>

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

Public Types

enum  {
  WidgetStateDefine = WidgetStateUser, WidgetStateTranslateControlPoint, WidgetStateOnTranslationHandle, WidgetStateOnRotationHandle,
  WidgetStateOnScaleHandle, WidgetStateMarkups_Last
}
 Widget states. More...
 
enum  {
  WidgetEventControlPointPlace = WidgetEventUser, WidgetEventClickAndDragStart, WidgetEventClickAndDragEnd, WidgetEventStopPlace,
  WidgetEventControlPointMoveStart, WidgetEventControlPointMoveEnd, WidgetEventControlPointDelete, WidgetEventControlPointInsert,
  WidgetEventControlPointSnapToSlice, WidgetEventReserved, WidgetEventMarkups_Last
}
 Widget events. More...
 
typedef vtkMRMLAbstractWidget Superclass
 Standard methods for a VTK class. 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

virtual int AddNodeOnWidget (const int displayPos[2])
 
virtual int AddPointFromWorldCoordinate (const double worldCoordinates[3])
 Add a point to the current active Markup at input World coordinates. More...
 
bool CanProcessInteractionEvent (vtkMRMLInteractionEventData *eventData, double &distance2) override
 Return true if the widget can process the event. More...
 
virtual void CreateDefaultRepresentation (vtkMRMLMarkupsDisplayNode *markupsDisplayNode, vtkMRMLAbstractViewNode *viewNode, vtkRenderer *renderer)=0
 Create the default widget representation and initializes the widget and representation. More...
 
virtual vtkSlicerMarkupsWidgetCreateInstance () const =0
 Create instance of the markups widget. More...
 
int GetActiveComponentIndex ()
 
int GetActiveComponentType ()
 
int GetActiveControlPoint ()
 
virtual const char * GetClassName ()
 
bool GetInteractive () override
 
vtkMRMLMarkupsDisplayNodeGetMarkupsDisplayNode ()
 
vtkMRMLMarkupsNodeGetMarkupsNode ()
 
vtkSlicerMarkupsWidgetRepresentationGetMarkupsRepresentation ()
 
int GetMouseCursor () override
 
virtual int IsA (const char *type)
 
bool IsPointPreviewed ()
 
void Leave (vtkMRMLInteractionEventData *eventData) override
 Called when the the widget loses the focus. More...
 
virtual bool PlacePoint (vtkMRMLInteractionEventData *eventData)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
bool ProcessInteractionEvent (vtkMRMLInteractionEventData *eventData) override
 Process interaction event. More...
 
bool RemovePreviewPoint ()
 
vtkMRMLSelectionNodeselectionNode ()
 
void UpdatePreviewPoint (vtkMRMLInteractionEventData *eventData, const char *associatedNodeID, int positionStatus)
 Add/update a point preview to the current active Markup at the specified position. More...
 
void UpdatePreviewPointIndex (vtkMRMLInteractionEventData *eventData)
 Update a the current index of the point preview being previewed. More...
 
- Public Member Functions inherited from vtkMRMLAbstractWidget
virtual vtkWidgetEventTranslator * GetEventTranslator (int widgetState)
 
virtual bool GetGrabFocus ()
 
vtkMRMLInteractionNodeGetInteractionNode ()
 
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 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 int IsTypeOf (const char *type)
 
static vtkSlicerMarkupsWidgetSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkMRMLAbstractWidget
static int IsTypeOf (const char *type)
 
static vtkMRMLAbstractWidgetSafeDownCast (vtkObject *o)
 

Protected Member Functions

bool ConvertDisplayPositionToWorld (const int displayPos[2], double worldPos[3], double worldOrientationMatrix[9], double *refWorldPos=nullptr)
 
void EndWidgetInteraction ()
 
virtual bool GetClosestPointOnInteractionAxis (int type, int index, const double inputDisplay[2], double outputIntersectionWorld[3])
 
virtual bool GetIntersectionOnAxisPlane (int type, int index, const double inputDisplay[2], double outputIntersectionWorld[3])
 
bool IsAnyControlPointLocked ()
 
virtual bool ProcessControlPointDelete (vtkMRMLInteractionEventData *eventData)
 
virtual bool ProcessControlPointInsert (vtkMRMLInteractionEventData *eventData)
 
virtual bool ProcessControlPointMoveStart (vtkMRMLInteractionEventData *eventData)
 
virtual bool ProcessControlPointSnapToSlice (vtkMRMLInteractionEventData *eventData)
 
virtual bool ProcessEndMouseDrag (vtkMRMLInteractionEventData *eventData)
 
virtual bool ProcessMouseMove (vtkMRMLInteractionEventData *eventData)
 
virtual bool ProcessWidgetAction (vtkMRMLInteractionEventData *eventData)
 
virtual bool ProcessWidgetJumpCursor (vtkMRMLInteractionEventData *eventData)
 
virtual bool ProcessWidgetMenu (vtkMRMLInteractionEventData *eventData)
 
virtual bool ProcessWidgetReset (vtkMRMLInteractionEventData *eventData)
 
virtual bool ProcessWidgetRotateStart (vtkMRMLInteractionEventData *eventData)
 
virtual bool ProcessWidgetScaleStart (vtkMRMLInteractionEventData *eventData)
 
virtual bool ProcessWidgetStopPlace (vtkMRMLInteractionEventData *eventData)
 
virtual bool ProcessWidgetTranslateStart (vtkMRMLInteractionEventData *eventData)
 
virtual void RotateWidget (double eventPos[2])
 
virtual void ScaleWidget (double eventPos[2])
 
void StartWidgetInteraction (vtkMRMLInteractionEventData *eventData)
 
virtual void TranslatePoint (double eventPos[2], bool snapToSlice=false)
 
virtual void TranslateWidget (double eventPos[2])
 
 vtkSlicerMarkupsWidget ()
 
 ~vtkSlicerMarkupsWidget () 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

double LastEventPosition [2]
 
int PreviewPointIndex
 
double StartEventOffsetPosition [2]
 
- Protected Attributes inherited from vtkMRMLAbstractWidget
vtkWeakPointer< vtkMRMLApplicationLogicApplicationLogic
 
std::vector< vtkSmartPointer< vtkWidgetEventTranslator > > EventTranslators
 
vtkWeakPointer< vtkRenderer > Renderer
 
vtkSmartPointer< vtkMRMLAbstractWidgetRepresentationWidgetRep
 
int WidgetState
 

Detailed Description

Process interaction events to update state of markup widget nodes.

See also
vtkMRMLAbstractWidget vtkSlicerWidgetRepresentation vtkSlicerWidgetEventTranslator

Definition at line 45 of file vtkSlicerMarkupsWidget.h.

Member Typedef Documentation

◆ Superclass

Standard methods for a VTK class.

Definition at line 49 of file vtkSlicerMarkupsWidget.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Widget states.

Enumerator
WidgetStateDefine 
WidgetStateTranslateControlPoint 
WidgetStateOnTranslationHandle 
WidgetStateOnRotationHandle 
WidgetStateOnScaleHandle 
WidgetStateMarkups_Last 

Definition at line 59 of file vtkSlicerMarkupsWidget.h.

◆ anonymous enum

anonymous enum

Widget events.

Enumerator
WidgetEventControlPointPlace 
WidgetEventClickAndDragStart 
WidgetEventClickAndDragEnd 
WidgetEventStopPlace 
WidgetEventControlPointMoveStart 
WidgetEventControlPointMoveEnd 
WidgetEventControlPointDelete 
WidgetEventControlPointInsert 
WidgetEventControlPointSnapToSlice 
WidgetEventReserved 
WidgetEventMarkups_Last 

Definition at line 70 of file vtkSlicerMarkupsWidget.h.

Constructor & Destructor Documentation

◆ vtkSlicerMarkupsWidget()

vtkSlicerMarkupsWidget::vtkSlicerMarkupsWidget ( )
protected

◆ ~vtkSlicerMarkupsWidget()

vtkSlicerMarkupsWidget::~vtkSlicerMarkupsWidget ( )
overrideprotected

Member Function Documentation

◆ AddNodeOnWidget()

virtual int vtkSlicerMarkupsWidget::AddNodeOnWidget ( const int  displayPos[2])
virtual

Given a specific X, Y pixel location, add a new node on the widget at this location.

◆ AddPointFromWorldCoordinate()

virtual int vtkSlicerMarkupsWidget::AddPointFromWorldCoordinate ( const double  worldCoordinates[3])
virtual

Add a point to the current active Markup at input World coordinates.

◆ CanProcessInteractionEvent()

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

Return true if the widget can process the event.

Reimplemented from vtkMRMLAbstractWidget.

Reimplemented in vtkSlicerPlaneWidget, and vtkSlicerROIWidget.

◆ ConvertDisplayPositionToWorld()

bool vtkSlicerMarkupsWidget::ConvertDisplayPositionToWorld ( const int  displayPos[2],
double  worldPos[3],
double  worldOrientationMatrix[9],
double *  refWorldPos = nullptr 
)
protected

◆ CreateDefaultRepresentation()

virtual void vtkSlicerMarkupsWidget::CreateDefaultRepresentation ( vtkMRMLMarkupsDisplayNode markupsDisplayNode,
vtkMRMLAbstractViewNode viewNode,
vtkRenderer *  renderer 
)
pure virtual

Create the default widget representation and initializes the widget and representation.

Implemented in vtkSlicerPlaneWidget, vtkSlicerROIWidget, vtkSlicerAngleWidget, vtkSlicerCurveWidget, vtkSlicerLineWidget, and vtkSlicerPointsWidget.

◆ CreateInstance()

virtual vtkSlicerMarkupsWidget* vtkSlicerMarkupsWidget::CreateInstance ( ) const
pure virtual

Create instance of the markups widget.

◆ EndWidgetInteraction()

void vtkSlicerMarkupsWidget::EndWidgetInteraction ( )
protected

◆ GetActiveComponentIndex()

int vtkSlicerMarkupsWidget::GetActiveComponentIndex ( )

◆ GetActiveComponentType()

int vtkSlicerMarkupsWidget::GetActiveComponentType ( )

◆ GetActiveControlPoint()

int vtkSlicerMarkupsWidget::GetActiveControlPoint ( )

◆ GetClassName()

virtual const char* vtkSlicerMarkupsWidget::GetClassName ( )
virtual

◆ GetClosestPointOnInteractionAxis()

virtual bool vtkSlicerMarkupsWidget::GetClosestPointOnInteractionAxis ( int  type,
int  index,
const double  inputDisplay[2],
double  outputIntersectionWorld[3] 
)
protectedvirtual

◆ GetInteractive()

bool vtkSlicerMarkupsWidget::GetInteractive ( )
overridevirtual

Reimplemented from vtkMRMLAbstractWidget.

◆ GetIntersectionOnAxisPlane()

virtual bool vtkSlicerMarkupsWidget::GetIntersectionOnAxisPlane ( int  type,
int  index,
const double  inputDisplay[2],
double  outputIntersectionWorld[3] 
)
protectedvirtual

◆ GetMarkupsDisplayNode()

vtkMRMLMarkupsDisplayNode* vtkSlicerMarkupsWidget::GetMarkupsDisplayNode ( )

◆ GetMarkupsNode()

vtkMRMLMarkupsNode* vtkSlicerMarkupsWidget::GetMarkupsNode ( )

◆ GetMarkupsRepresentation()

vtkSlicerMarkupsWidgetRepresentation* vtkSlicerMarkupsWidget::GetMarkupsRepresentation ( )

◆ GetMouseCursor()

int vtkSlicerMarkupsWidget::GetMouseCursor ( )
overridevirtual

Reimplemented from vtkMRMLAbstractWidget.

◆ IsA()

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

◆ IsAnyControlPointLocked()

bool vtkSlicerMarkupsWidget::IsAnyControlPointLocked ( )
protected

◆ IsPointPreviewed()

bool vtkSlicerMarkupsWidget::IsPointPreviewed ( )

◆ IsTypeOf()

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

◆ Leave()

void vtkSlicerMarkupsWidget::Leave ( vtkMRMLInteractionEventData eventData)
overridevirtual

Called when the the widget loses the focus.

Reimplemented from vtkMRMLAbstractWidget.

◆ PlacePoint()

virtual bool vtkSlicerMarkupsWidget::PlacePoint ( vtkMRMLInteractionEventData eventData)
virtual

Reimplemented in vtkSlicerPlaneWidget.

◆ PrintSelf()

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

◆ ProcessControlPointDelete()

virtual bool vtkSlicerMarkupsWidget::ProcessControlPointDelete ( vtkMRMLInteractionEventData eventData)
protectedvirtual

◆ ProcessControlPointInsert()

virtual bool vtkSlicerMarkupsWidget::ProcessControlPointInsert ( vtkMRMLInteractionEventData eventData)
protectedvirtual

Reimplemented in vtkSlicerCurveWidget.

◆ ProcessControlPointMoveStart()

virtual bool vtkSlicerMarkupsWidget::ProcessControlPointMoveStart ( vtkMRMLInteractionEventData eventData)
protectedvirtual

◆ ProcessControlPointSnapToSlice()

virtual bool vtkSlicerMarkupsWidget::ProcessControlPointSnapToSlice ( vtkMRMLInteractionEventData eventData)
protectedvirtual

◆ ProcessEndMouseDrag()

virtual bool vtkSlicerMarkupsWidget::ProcessEndMouseDrag ( vtkMRMLInteractionEventData eventData)
protectedvirtual

Reimplemented in vtkSlicerPlaneWidget, and vtkSlicerROIWidget.

◆ ProcessInteractionEvent()

bool vtkSlicerMarkupsWidget::ProcessInteractionEvent ( vtkMRMLInteractionEventData eventData)
overridevirtual

Process interaction event.

Reimplemented from vtkMRMLAbstractWidget.

Reimplemented in vtkSlicerPlaneWidget, and vtkSlicerROIWidget.

◆ ProcessMouseMove()

virtual bool vtkSlicerMarkupsWidget::ProcessMouseMove ( vtkMRMLInteractionEventData eventData)
protectedvirtual

Reimplemented in vtkSlicerPlaneWidget, and vtkSlicerROIWidget.

◆ ProcessWidgetAction()

virtual bool vtkSlicerMarkupsWidget::ProcessWidgetAction ( vtkMRMLInteractionEventData eventData)
protectedvirtual

◆ ProcessWidgetJumpCursor()

virtual bool vtkSlicerMarkupsWidget::ProcessWidgetJumpCursor ( vtkMRMLInteractionEventData eventData)
protectedvirtual

◆ ProcessWidgetMenu()

virtual bool vtkSlicerMarkupsWidget::ProcessWidgetMenu ( vtkMRMLInteractionEventData eventData)
protectedvirtual

◆ ProcessWidgetReset()

virtual bool vtkSlicerMarkupsWidget::ProcessWidgetReset ( vtkMRMLInteractionEventData eventData)
protectedvirtual

◆ ProcessWidgetRotateStart()

virtual bool vtkSlicerMarkupsWidget::ProcessWidgetRotateStart ( vtkMRMLInteractionEventData eventData)
protectedvirtual

◆ ProcessWidgetScaleStart()

virtual bool vtkSlicerMarkupsWidget::ProcessWidgetScaleStart ( vtkMRMLInteractionEventData eventData)
protectedvirtual

◆ ProcessWidgetStopPlace()

virtual bool vtkSlicerMarkupsWidget::ProcessWidgetStopPlace ( vtkMRMLInteractionEventData eventData)
protectedvirtual

Reimplemented in vtkSlicerPlaneWidget.

◆ ProcessWidgetTranslateStart()

virtual bool vtkSlicerMarkupsWidget::ProcessWidgetTranslateStart ( vtkMRMLInteractionEventData eventData)
protectedvirtual

◆ RemovePreviewPoint()

bool vtkSlicerMarkupsWidget::RemovePreviewPoint ( )

Remove the point preview to the current active Markup. Returns true is preview point existed and now it is removed.

◆ RotateWidget()

virtual void vtkSlicerMarkupsWidget::RotateWidget ( double  eventPos[2])
protectedvirtual

Reimplemented in vtkSlicerPlaneWidget.

◆ SafeDownCast()

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

◆ ScaleWidget()

virtual void vtkSlicerMarkupsWidget::ScaleWidget ( double  eventPos[2])
protectedvirtual

Reimplemented in vtkSlicerPlaneWidget, and vtkSlicerROIWidget.

◆ selectionNode()

vtkMRMLSelectionNode* vtkSlicerMarkupsWidget::selectionNode ( )

◆ StartWidgetInteraction()

void vtkSlicerMarkupsWidget::StartWidgetInteraction ( vtkMRMLInteractionEventData eventData)
protected

◆ TranslatePoint()

virtual void vtkSlicerMarkupsWidget::TranslatePoint ( double  eventPos[2],
bool  snapToSlice = false 
)
protectedvirtual

◆ TranslateWidget()

virtual void vtkSlicerMarkupsWidget::TranslateWidget ( double  eventPos[2])
protectedvirtual

◆ UpdatePreviewPoint()

void vtkSlicerMarkupsWidget::UpdatePreviewPoint ( vtkMRMLInteractionEventData eventData,
const char *  associatedNodeID,
int  positionStatus 
)

Add/update a point preview to the current active Markup at the specified position.

◆ UpdatePreviewPointIndex()

void vtkSlicerMarkupsWidget::UpdatePreviewPointIndex ( vtkMRMLInteractionEventData eventData)

Update a the current index of the point preview being previewed.

Member Data Documentation

◆ LastEventPosition

double vtkSlicerMarkupsWidget::LastEventPosition[2]
protected

Definition at line 188 of file vtkSlicerMarkupsWidget.h.

◆ PreviewPointIndex

int vtkSlicerMarkupsWidget::PreviewPointIndex
protected

Index of the control point that is currently being previewed (follows the mouse pointer). If <0 it means that there is currently no point being previewed.

Definition at line 159 of file vtkSlicerMarkupsWidget.h.

◆ StartEventOffsetPosition

double vtkSlicerMarkupsWidget::StartEventOffsetPosition[2]
protected

Definition at line 189 of file vtkSlicerMarkupsWidget.h.


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