|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Central event distribution hub for interaction events. More...
#include <mitkDispatcher.h>


Public Types | |
| typedef std::list< mitk::WeakPointer< DataInteractor > > | ListInteractorType |
| List type for storing weak pointers to DataInteractors. More... | |
| typedef std::list< itk::SmartPointer< InteractionEvent > > | ListEventsType |
| List type for storing queued InteractionEvents. More... | |
Public Member Functions | |
| mitkClassMacroItkParent (Dispatcher, itk::LightObject) | |
| mitkNewMacro1Param (Self, const std::string &) | |
| bool | ProcessEvent (InteractionEvent *event) |
| Process an interaction event by dispatching it to registered DataInteractors. More... | |
| void | QueueEvent (InteractionEvent *event) |
| Queue an event for deferred processing. More... | |
| void | AddDataInteractor (const DataNode *dataNode) |
| Register the DataInteractor associated with the given DataNode. More... | |
| void | RemoveDataInteractor (const DataNode *dataNode) |
| Remove all DataInteractors associated with the given DataNode. More... | |
| size_t | GetNumberOfInteractors () |
| Get the number of currently registered DataInteractors. More... | |
Protected Member Functions | |
| Dispatcher (const std::string &rendererName) | |
| ~Dispatcher () override | |
Central event distribution hub for interaction events.
The Dispatcher receives InteractionEvents (mouse, key, etc.) and dispatches them to registered DataInteractor objects. The order in which DataInteractors are offered an event is determined by the "layer" property of their associated DataNode – higher layers are preferred.
After all DataInteractors have been offered the event, registered InteractionEventObserver instances are notified.
The Dispatcher supports several processing modes (REGULAR, GRABINPUT, PREFERINPUT, CONNECTEDMOUSEACTION) that control how events are routed during ongoing interactions such as mouse drags.
Definition at line 54 of file mitkDispatcher.h.
| typedef std::list<itk::SmartPointer<InteractionEvent> > mitk::Dispatcher::ListEventsType |
List type for storing queued InteractionEvents.
Definition at line 63 of file mitkDispatcher.h.
| typedef std::list<mitk::WeakPointer<DataInteractor> > mitk::Dispatcher::ListInteractorType |
List type for storing weak pointers to DataInteractors.
Definition at line 61 of file mitkDispatcher.h.
|
protected |
|
overrideprotected |
| void mitk::Dispatcher::AddDataInteractor | ( | const DataNode * | dataNode | ) |
Register the DataInteractor associated with the given DataNode.
If a DataInteractor for the same DataNode already exists, it is removed first. Orphaned interactors (without valid DataNodes) are also cleaned up.
| [in] | dataNode | The DataNode whose DataInteractor should be registered. |
| size_t mitk::Dispatcher::GetNumberOfInteractors | ( | ) |
Get the number of currently registered DataInteractors.
| mitk::Dispatcher::mitkClassMacroItkParent | ( | Dispatcher | , |
| itk::LightObject | |||
| ) |
| mitk::Dispatcher::mitkNewMacro1Param | ( | Self | , |
| const std::string & | |||
| ) |
| bool mitk::Dispatcher::ProcessEvent | ( | InteractionEvent * | event | ) |
Process an interaction event by dispatching it to registered DataInteractors.
The event is offered to DataInteractors in order of descending layer. Internal events are handled separately. After dispatching, all registered InteractionEventObservers are notified. Queued events are processed after the current event is fully handled.
| [in] | event | The interaction event to process. |
| void mitk::Dispatcher::QueueEvent | ( | InteractionEvent * | event | ) |
Queue an event for deferred processing.
Queued events are processed after the currently dispatched event has been fully handled (including state transitions). This allows DataInteractors to post follow-up events without interrupting the current dispatch.
| [in] | event | The event to enqueue. |
| void mitk::Dispatcher::RemoveDataInteractor | ( | const DataNode * | dataNode | ) |