Medical Imaging Interaction Toolkit
2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
|
Manages event distribution. More...
#include <mitkDispatcher.h>
Public Types | |
typedef Dispatcher | Self |
typedef itk::LightObject | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
typedef std::list< mitk::WeakPointer< DataInteractor > > | ListInteractorType |
typedef std::list< itk::SmartPointer< InteractionEvent > > | ListEventsType |
Public Member Functions | |
virtual std::vector< std::string > | GetClassHierarchy () const |
virtual const char * | GetClassName () const |
bool | ProcessEvent (InteractionEvent *event) |
void | QueueEvent (InteractionEvent *event) |
void | AddDataInteractor (const DataNode *dataNode) |
void | RemoveDataInteractor (const DataNode *dataNode) |
size_t | GetNumberOfInteractors () |
Static Public Member Functions | |
static const char * | GetStaticNameOfClass () |
static Pointer | New (const std::string &_arg) |
Protected Member Functions | |
Dispatcher (const std::string &rendererName) | |
~Dispatcher () override | |
Manages event distribution.
Receives Events (Mouse-,Key-, ... Events) and dispatches them to the registered DataInteractor Objects. The order in which DataInteractors are offered to handle an event is determined by layer of their associated DataNode. Higher layers are preferred.
Definition at line 44 of file mitkDispatcher.h.
typedef itk::SmartPointer<const Self> mitk::Dispatcher::ConstPointer |
Definition at line 47 of file mitkDispatcher.h.
typedef std::list<itk::SmartPointer<InteractionEvent> > mitk::Dispatcher::ListEventsType |
Definition at line 51 of file mitkDispatcher.h.
typedef std::list<mitk::WeakPointer<DataInteractor> > mitk::Dispatcher::ListInteractorType |
Definition at line 48 of file mitkDispatcher.h.
Definition at line 47 of file mitkDispatcher.h.
typedef Dispatcher mitk::Dispatcher::Self |
Definition at line 47 of file mitkDispatcher.h.
typedef itk::LightObject mitk::Dispatcher::Superclass |
Definition at line 47 of file mitkDispatcher.h.
|
protected |
|
overrideprotected |
void mitk::Dispatcher::AddDataInteractor | ( | const DataNode * | dataNode | ) |
Adds the DataInteractor that is associated with the DataNode to the Dispatcher Queue. If there already exists an DataInteractor that has a reference to the same DataNode, it is removed. Note that within this method also all other DataInteractors are checked and removed if they are no longer active, and were not removed properly.
|
inlinevirtual |
Definition at line 47 of file mitkDispatcher.h.
|
virtual |
size_t mitk::Dispatcher::GetNumberOfInteractors | ( | ) |
|
inlinestatic |
Definition at line 47 of file mitkDispatcher.h.
|
inlinestatic |
Definition at line 48 of file mitkDispatcher.h.
bool mitk::Dispatcher::ProcessEvent | ( | InteractionEvent * | event | ) |
To post new Events which are to be handled by the Dispatcher.
void mitk::Dispatcher::QueueEvent | ( | InteractionEvent * | event | ) |
Adds an Event to the Dispatchers EventQueue, these events will be processed after a a regular posted event has been fully handled. This allows DataInteractors to post their own events without interrupting regular Dispatching workflow. It is important to note that the queued events will be processed AFTER the state change of a current transition (which queued the events) is performed.
void mitk::Dispatcher::RemoveDataInteractor | ( | const DataNode * | dataNode | ) |
Remove all DataInteractors related to this Node, to prevent double entries and dead references.