![]() |
Slicer
4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
Process interaction events to update state of MRML widget nodes. More...
#include <Libs/MRML/DisplayableManager/vtkMRMLAbstractWidget.h>
Public Types | |
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 | |
virtual bool | CanProcessInteractionEvent (vtkMRMLInteractionEventData *eventData, double &distance2) |
virtual const char * | GetClassName () |
virtual vtkWidgetEventTranslator * | GetEventTranslator (int widgetState) |
virtual bool | GetGrabFocus () |
vtkMRMLInteractionNode * | GetInteractionNode () |
virtual bool | GetInteractive () |
virtual int | GetMouseCursor () |
vtkMRMLApplicationLogic * | GetMRMLApplicationLogic () |
virtual bool | GetNeedToRender () |
virtual int | GetNumberOfEventTranslators () |
vtkRenderer * | GetRenderer () |
virtual vtkMRMLAbstractWidgetRepresentation * | GetRepresentation () |
Get the representation. More... | |
virtual int | GetWidgetState () |
Convenient method to determine the state of the method. More... | |
virtual int | IsA (const char *type) |
virtual void | Leave (vtkMRMLInteractionEventData *eventData) |
Called when the the widget loses the focus. More... | |
virtual void | NeedToRenderOff () |
void | PrintSelf (ostream &os, vtkIndent indent) override |
virtual bool | ProcessInteractionEvent (vtkMRMLInteractionEventData *eventData) |
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 vtkMRMLAbstractWidget * | SafeDownCast (vtkObject *o) |
Protected Member Functions | |
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< vtkMRMLApplicationLogic > | ApplicationLogic |
std::vector< vtkSmartPointer< vtkWidgetEventTranslator > > | EventTranslators |
vtkWeakPointer< vtkRenderer > | Renderer |
vtkSmartPointer< vtkMRMLAbstractWidgetRepresentation > | WidgetRep |
int | WidgetState |
Process interaction events to update state of MRML widget nodes.
vtkMRMLAbstractWidget is the abstract class that handles interaction events received from the displayable manager. To decide which widget gets the chance to process an interaction event, this class does not use VTK picking manager, but interactor style class queries displayable managers about what events they can process, displayable manager queries its widgets, and based on the returned information, interactor style selects a displayable manager and the displayable manager selects a widget.
vtkAbstractWidget uses vtkSlicerWidgetEventTranslator to translate VTK interaction events (defined in vtkCommand.h) into widget events (defined in vtkMRMLAbstractWidget.h and subclasses). This class allows modification of event bindings.
Definition at line 59 of file vtkMRMLAbstractWidget.h.
typedef vtkObject vtkMRMLAbstractWidget::Superclass |
Standard methods for a VTK class.
Definition at line 63 of file vtkMRMLAbstractWidget.h.
anonymous enum |
The state of the widget.
Enumerator | |
---|---|
WidgetStateAny | |
WidgetStateIdle | |
WidgetStateOnWidget | |
WidgetStateTranslate | |
WidgetStateRotate | |
WidgetStateScale | |
WidgetStateUser |
Definition at line 86 of file vtkMRMLAbstractWidget.h.
Widget events.
Definition at line 98 of file vtkMRMLAbstractWidget.h.
|
protected |
|
overrideprotected |
|
virtual |
Return true if the widget can process the event. Distance2 is the squared distance in display coordinates from the closest interaction position. The displayable manager with the closest distance will get the chance to process the interaction event.
Reimplemented in vtkSlicerMarkupsWidget, vtkMRMLWindowLevelWidget, vtkSlicerROIWidget, vtkMRMLSliceIntersectionWidget, vtkSlicerPlaneWidget, and vtkMRMLCameraWidget.
|
protected |
Get ID of the node at the specified event position. Returns nullptr if nothing can be found.
|
virtual |
|
virtual |
|
virtual |
vtkMRMLInteractionNode* vtkMRMLAbstractWidget::GetInteractionNode | ( | ) |
|
virtual |
Reimplemented in vtkSlicerMarkupsWidget.
|
virtual |
Reimplemented in vtkSlicerMarkupsWidget.
vtkMRMLApplicationLogic* vtkMRMLAbstractWidget::GetMRMLApplicationLogic | ( | ) |
|
virtual |
|
virtual |
vtkRenderer* vtkMRMLAbstractWidget::GetRenderer | ( | ) |
|
virtual |
Get the representation.
|
virtual |
Convenient method to determine the state of the method.
|
virtual |
|
static |
|
virtual |
Called when the the widget loses the focus.
Reimplemented in vtkSlicerMarkupsWidget, vtkMRMLWindowLevelWidget, and vtkMRMLSliceIntersectionWidget.
|
virtual |
|
override |
|
virtual |
Allows injecting interaction events for processing, without directly observing window interactor events. Return true if the widget processed the event.
Reimplemented in vtkSlicerMarkupsWidget, vtkMRMLWindowLevelWidget, vtkMRMLSliceIntersectionWidget, vtkSlicerROIWidget, vtkSlicerPlaneWidget, and vtkMRMLCameraWidget.
|
static |
void vtkMRMLAbstractWidget::SetEventTranslation | ( | int | widgetState, |
unsigned long | interactionEvent, | ||
int | modifiers, | ||
unsigned long | widgetEvent | ||
) |
Define interaction event to widget event translation for mouse and other controller events Used in the specified widget state only.
void vtkMRMLAbstractWidget::SetEventTranslation | ( | unsigned long | interactionEvent, |
int | modifiers, | ||
unsigned long | widgetEvent | ||
) |
Define interaction event to widget event translation for mouse and other controller events. Used in any widget state.
void vtkMRMLAbstractWidget::SetEventTranslationClickAndDrag | ( | int | widgetState, |
unsigned long | startInteractionEvent, | ||
int | modifiers, | ||
int | widgetStateDragging, | ||
unsigned long | widgetStartEvent, | ||
unsigned long | widgetEndEvent | ||
) |
void vtkMRMLAbstractWidget::SetKeyboardEventTranslation | ( | int | modifier, |
char | keyCode, | ||
int | repeatCount, | ||
const char * | keySym, | ||
unsigned long | widgetEvent | ||
) |
Define interaction event to widget event translation for keyboard events. Used in any widget state.
void vtkMRMLAbstractWidget::SetKeyboardEventTranslation | ( | int | widgetState, |
int | modifier, | ||
char | keyCode, | ||
int | repeatCount, | ||
const char * | keySym, | ||
unsigned long | widgetEvent | ||
) |
Define interaction event to widget event translation for keyboard events. Used in the specified widget state only.
|
virtual |
Reimplemented in vtkMRMLWindowLevelWidget, and vtkMRMLSliceIntersectionWidget.
void vtkMRMLAbstractWidget::SetRenderer | ( | vtkRenderer * | renderer | ) |
|
virtual |
Set the representation. The widget takes over the ownership of this actor.
|
virtual |
Convenient method to change what state the widget is in.
|
virtual |
Get widget event from translation event.
|
protected |
Helper function that attempts to translate an event with a specific translator only.
|
virtual |
Build the actors of the representation with the info stored in the MRML scene.
|
protected |
Definition at line 196 of file vtkMRMLAbstractWidget.h.
|
protected |
Definition at line 202 of file vtkMRMLAbstractWidget.h.
|
protected |
Definition at line 194 of file vtkMRMLAbstractWidget.h.
|
protected |
Definition at line 206 of file vtkMRMLAbstractWidget.h.
|
protected |
Definition at line 204 of file vtkMRMLAbstractWidget.h.