Medical Imaging Interaction Toolkit
2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
|
Base class to implement InteractionEventObservers. More...
#include <mitkInteractionEventObserver.h>
Public Member Functions | |
InteractionEventObserver () | |
virtual | ~InteractionEventObserver () |
virtual void | Notify (InteractionEvent *interactionEvent, bool isHandled)=0 |
void | Disable () |
void | Enable () |
bool | IsEnabled () const |
Base class to implement InteractionEventObservers.
This class also provides state machine infrastructure, but usage thereof is optional. See the Notify method for more information.
Definition at line 33 of file mitkInteractionEventObserver.h.
mitk::InteractionEventObserver::InteractionEventObserver | ( | ) |
|
virtual |
void mitk::InteractionEventObserver::Disable | ( | ) |
void mitk::InteractionEventObserver::Enable | ( | ) |
bool mitk::InteractionEventObserver::IsEnabled | ( | ) | const |
|
pure virtual |
By this method all registered EventObersers are notified about every InteractionEvent, the isHandled flag indicates if a DataInteractor has already handled that event. InteractionEventObserver that trigger an action when observing an event may consider this in order to not confuse the user by, triggering several independent action with one single user event (such as a mouse click)
If you want to use the InteractionEventObserver as a state machine give the event to the state machine by implementing, e.g.
This overwrites the FilterEvents function of the EventStateMachine to ignore the DataNode, since InteractionEventObservers are not associated with one. virtual bool FilterEvents(InteractionEvent* interactionEvent, DataNode* dataNode);
Implemented in mitk::EventRecorder, mitk::Tool, and mitk::DisplayActionEventBroadcast.