Medical Imaging Interaction Toolkit
2016.11.0
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) |
vcl_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) | |
virtual | ~Dispatcher () |
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 48 of file mitkDispatcher.h.
typedef itk::SmartPointer<const Self> mitk::Dispatcher::ConstPointer |
Definition at line 51 of file mitkDispatcher.h.
typedef std::list<itk::SmartPointer<InteractionEvent> > mitk::Dispatcher::ListEventsType |
Definition at line 55 of file mitkDispatcher.h.
typedef std::list<mitk::WeakPointer<DataInteractor> > mitk::Dispatcher::ListInteractorType |
Definition at line 52 of file mitkDispatcher.h.
Definition at line 51 of file mitkDispatcher.h.
typedef Dispatcher mitk::Dispatcher::Self |
Definition at line 51 of file mitkDispatcher.h.
typedef itk::LightObject mitk::Dispatcher::Superclass |
Definition at line 51 of file mitkDispatcher.h.
|
protected |
Definition at line 31 of file mitkDispatcher.cpp.
References us::GetModuleContext(), and us::ServiceConstants::OBJECTCLASS().
|
protectedvirtual |
Definition at line 93 of file mitkDispatcher.cpp.
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.
Definition at line 54 of file mitkDispatcher.cpp.
References mitk::DataNode::GetDataInteractor().
|
inlinevirtual |
Definition at line 51 of file mitkDispatcher.h.
|
virtual |
vcl_size_t mitk::Dispatcher::GetNumberOfInteractors | ( | ) |
Definition at line 88 of file mitkDispatcher.cpp.
|
inlinestatic |
Definition at line 51 of file mitkDispatcher.h.
|
inlinestatic |
Definition at line 52 of file mitkDispatcher.h.
Referenced by mitk::BindDispatcherInteractor::BindDispatcherInteractor().
bool mitk::Dispatcher::ProcessEvent | ( | InteractionEvent * | event | ) |
To post new Events which are to be handled by the Dispatcher.
Definition at line 101 of file mitkDispatcher.cpp.
References mitk::BaseRenderer::GetRenderWindow(), mitk::InteractionEvent::GetSender(), mitk::InteractionEventObserver::IsEnabled(), and mitk::InteractionEventObserver::Notify().
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.
Definition at line 255 of file mitkDispatcher.cpp.
void mitk::Dispatcher::RemoveDataInteractor | ( | const DataNode * | dataNode | ) |
Remove all DataInteractors related to this Node, to prevent double entries and dead references.
Definition at line 73 of file mitkDispatcher.cpp.