Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::InteractionEvent Class Reference

Base class for all interaction events in MITK. More...

#include <mitkInteractionEvent.h>

Inheritance diagram for mitk::InteractionEvent:
Collaboration diagram for mitk::InteractionEvent:

Public Types

enum  MouseButtons { NoButton , LeftMouseButton , RightMouseButton , MiddleMouseButton }
 Enumeration of mouse button states. More...
 
enum  ModifierKeys { NoKey , ShiftKey , ControlKey , AltKey }
 Enumeration of keyboard modifier keys. More...
 

Public Member Functions

 mitkClassMacroItkParent (InteractionEvent, itk::LightObject)
 
 mitkNewMacro1Param (Self, BaseRenderer *)
 
void SetSender (BaseRenderer *sender)
 Set the BaseRenderer that sent this event. More...
 
BaseRenderer * GetSender () const
 Get the BaseRenderer that sent this event. More...
 
virtual bool IsSuperClassOf (const InteractionEvent::Pointer &baseClass) const
 Check if the provided event is an instance of this class or a derived class. More...
 

Static Public Attributes

static const std::string KeyEsc
 String constants for special keys used in key events and state machine patterns. More...
 
static const std::string KeyEnter
 "Enter" key constant. More...
 
static const std::string KeyReturn
 "Return" key constant. More...
 
static const std::string KeyDelete
 "Delete" key constant. More...
 
static const std::string KeyArrowUp
 "ArrowUp" key constant. More...
 
static const std::string KeyArrowDown
 "ArrowDown" key constant. More...
 
static const std::string KeyArrowLeft
 "ArrowLeft" key constant. More...
 
static const std::string KeyArrowRight
 "ArrowRight" key constant. More...
 
static const std::string KeyF1
 "F1" key constant. More...
 
static const std::string KeyF2
 "F2" key constant. More...
 
static const std::string KeyF3
 "F3" key constant. More...
 
static const std::string KeyF4
 "F4" key constant. More...
 
static const std::string KeyF5
 "F5" key constant. More...
 
static const std::string KeyF6
 "F6" key constant. More...
 
static const std::string KeyF7
 "F7" key constant. More...
 
static const std::string KeyF8
 "F8" key constant. More...
 
static const std::string KeyF9
 "F9" key constant. More...
 
static const std::string KeyF10
 "F10" key constant. More...
 
static const std::string KeyF11
 "F11" key constant. More...
 
static const std::string KeyF12
 "F12" key constant. More...
 
static const std::string KeyPos1
 "Pos1" (Home) key constant. More...
 
static const std::string KeyEnd
 "End" key constant. More...
 
static const std::string KeyInsert
 "Insert" key constant. More...
 
static const std::string KeyPageUp
 "PageUp" key constant. More...
 
static const std::string KeyPageDown
 "PageDown" key constant. More...
 
static const std::string KeySpace
 "Space" key constant. More...
 

Protected Member Functions

 InteractionEvent (BaseRenderer *)
 
 ~InteractionEvent () override
 
virtual bool IsEqual (const InteractionEvent &other) const
 

Detailed Description

Base class for all interaction events in MITK.

InteractionEvent is the root of the interaction event hierarchy. Every interaction event carries a reference to the BaseRenderer that generated it (the "sender"). Subclasses add position information (InteractionPositionEvent), keyboard information (InteractionKeyEvent), or mouse button/wheel details.

Equality between events is checked via operator== which delegates to IsEqual(). Two events match if they agree on all attributes relevant for state machine transitions (e.g. mouse button, modifiers) while ignoring attributes like the exact pointer position.

See also
InteractionPositionEvent
InteractionKeyEvent
EventStateMachine
Dispatcher

Definition at line 45 of file mitkInteractionEvent.h.

Member Enumeration Documentation

◆ ModifierKeys

Enumeration of keyboard modifier keys.

Values can be combined with bitwise OR to represent multiple held modifiers.

Enumerator
NoKey 

No modifier key.

ShiftKey 

Shift key.

ControlKey 

Control (Ctrl) key.

AltKey 

Alt key.

Definition at line 92 of file mitkInteractionEvent.h.

◆ MouseButtons

Enumeration of mouse button states.

Values can be combined with bitwise OR to represent multiple pressed buttons.

Enumerator
NoButton 

No mouse button.

LeftMouseButton 

Left mouse button.

RightMouseButton 

Right mouse button.

MiddleMouseButton 

Middle mouse button.

Definition at line 79 of file mitkInteractionEvent.h.

Constructor & Destructor Documentation

◆ InteractionEvent()

mitk::InteractionEvent::InteractionEvent ( BaseRenderer *  )
protected

◆ ~InteractionEvent()

mitk::InteractionEvent::~InteractionEvent ( )
overrideprotected

Member Function Documentation

◆ GetSender()

BaseRenderer* mitk::InteractionEvent::GetSender ( ) const

Get the BaseRenderer that sent this event.

Returns
Pointer to the sending BaseRenderer.

◆ IsEqual()

◆ IsSuperClassOf()

virtual bool mitk::InteractionEvent::IsSuperClassOf ( const InteractionEvent::Pointer &  baseClass) const
virtual

Check if the provided event is an instance of this class or a derived class.

This up-cast check supports polymorphism at the state machine pattern (XML) level, allowing transitions to match on base event types.

Parameters
[in]baseClassThe event to check.
Returns
true if baseClass is an InteractionEvent or derived from it.

Reimplemented in mitk::MouseWheelEvent, mitk::MouseReleaseEvent, mitk::MousePressEvent, mitk::MouseMoveEvent, mitk::MouseDoubleClickEvent, mitk::InternalEvent, mitk::InteractionPositionEvent, and mitk::InteractionKeyEvent.

◆ mitkClassMacroItkParent()

mitk::InteractionEvent::mitkClassMacroItkParent ( InteractionEvent  ,
itk::LightObject   
)

◆ mitkNewMacro1Param()

mitk::InteractionEvent::mitkNewMacro1Param ( Self  ,
BaseRenderer *   
)

◆ SetSender()

void mitk::InteractionEvent::SetSender ( BaseRenderer *  sender)

Set the BaseRenderer that sent this event.

Parameters
[in]senderPointer to the sending BaseRenderer.

Member Data Documentation

◆ KeyArrowDown

const std::string mitk::InteractionEvent::KeyArrowDown
static

"ArrowDown" key constant.

Definition at line 107 of file mitkInteractionEvent.h.

◆ KeyArrowLeft

const std::string mitk::InteractionEvent::KeyArrowLeft
static

"ArrowLeft" key constant.

Definition at line 108 of file mitkInteractionEvent.h.

◆ KeyArrowRight

const std::string mitk::InteractionEvent::KeyArrowRight
static

"ArrowRight" key constant.

Definition at line 109 of file mitkInteractionEvent.h.

◆ KeyArrowUp

const std::string mitk::InteractionEvent::KeyArrowUp
static

"ArrowUp" key constant.

Definition at line 106 of file mitkInteractionEvent.h.

◆ KeyDelete

const std::string mitk::InteractionEvent::KeyDelete
static

"Delete" key constant.

Definition at line 105 of file mitkInteractionEvent.h.

◆ KeyEnd

const std::string mitk::InteractionEvent::KeyEnd
static

"End" key constant.

Definition at line 125 of file mitkInteractionEvent.h.

◆ KeyEnter

const std::string mitk::InteractionEvent::KeyEnter
static

"Enter" key constant.

Definition at line 103 of file mitkInteractionEvent.h.

◆ KeyEsc

const std::string mitk::InteractionEvent::KeyEsc
static

String constants for special keys used in key events and state machine patterns.

"Escape" key constant.

Definition at line 102 of file mitkInteractionEvent.h.

◆ KeyF1

const std::string mitk::InteractionEvent::KeyF1
static

"F1" key constant.

Definition at line 111 of file mitkInteractionEvent.h.

◆ KeyF10

const std::string mitk::InteractionEvent::KeyF10
static

"F10" key constant.

Definition at line 120 of file mitkInteractionEvent.h.

◆ KeyF11

const std::string mitk::InteractionEvent::KeyF11
static

"F11" key constant.

Definition at line 121 of file mitkInteractionEvent.h.

◆ KeyF12

const std::string mitk::InteractionEvent::KeyF12
static

"F12" key constant.

Definition at line 122 of file mitkInteractionEvent.h.

◆ KeyF2

const std::string mitk::InteractionEvent::KeyF2
static

"F2" key constant.

Definition at line 112 of file mitkInteractionEvent.h.

◆ KeyF3

const std::string mitk::InteractionEvent::KeyF3
static

"F3" key constant.

Definition at line 113 of file mitkInteractionEvent.h.

◆ KeyF4

const std::string mitk::InteractionEvent::KeyF4
static

"F4" key constant.

Definition at line 114 of file mitkInteractionEvent.h.

◆ KeyF5

const std::string mitk::InteractionEvent::KeyF5
static

"F5" key constant.

Definition at line 115 of file mitkInteractionEvent.h.

◆ KeyF6

const std::string mitk::InteractionEvent::KeyF6
static

"F6" key constant.

Definition at line 116 of file mitkInteractionEvent.h.

◆ KeyF7

const std::string mitk::InteractionEvent::KeyF7
static

"F7" key constant.

Definition at line 117 of file mitkInteractionEvent.h.

◆ KeyF8

const std::string mitk::InteractionEvent::KeyF8
static

"F8" key constant.

Definition at line 118 of file mitkInteractionEvent.h.

◆ KeyF9

const std::string mitk::InteractionEvent::KeyF9
static

"F9" key constant.

Definition at line 119 of file mitkInteractionEvent.h.

◆ KeyInsert

const std::string mitk::InteractionEvent::KeyInsert
static

"Insert" key constant.

Definition at line 126 of file mitkInteractionEvent.h.

◆ KeyPageDown

const std::string mitk::InteractionEvent::KeyPageDown
static

"PageDown" key constant.

Definition at line 128 of file mitkInteractionEvent.h.

◆ KeyPageUp

const std::string mitk::InteractionEvent::KeyPageUp
static

"PageUp" key constant.

Definition at line 127 of file mitkInteractionEvent.h.

◆ KeyPos1

const std::string mitk::InteractionEvent::KeyPos1
static

"Pos1" (Home) key constant.

Definition at line 124 of file mitkInteractionEvent.h.

◆ KeyReturn

const std::string mitk::InteractionEvent::KeyReturn
static

"Return" key constant.

Definition at line 104 of file mitkInteractionEvent.h.

◆ KeySpace

const std::string mitk::InteractionEvent::KeySpace
static

"Space" key constant.

Definition at line 129 of file mitkInteractionEvent.h.


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