Medical Imaging Interaction Toolkit  2023.04.99-980ed1b6
Medical Imaging Interaction Toolkit
mitk::InteractionEventObserver Class Referenceabstract

Base class to implement InteractionEventObservers. More...

#include <mitkInteractionEventObserver.h>

Inheritance diagram for mitk::InteractionEventObserver:

Public Member Functions

 InteractionEventObserver ()
virtual ~InteractionEventObserver ()
virtual void Notify (InteractionEvent *interactionEvent, bool isHandled)=0
void Disable ()
void Enable ()
bool IsEnabled () const

Detailed Description

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.

Constructor & Destructor Documentation

◆ InteractionEventObserver()

mitk::InteractionEventObserver::InteractionEventObserver ( )

◆ ~InteractionEventObserver()

virtual mitk::InteractionEventObserver::~InteractionEventObserver ( )

Member Function Documentation

◆ Disable()

void mitk::InteractionEventObserver::Disable ( )

◆ Enable()

void mitk::InteractionEventObserver::Enable ( )

◆ IsEnabled()

bool mitk::InteractionEventObserver::IsEnabled ( ) const

◆ Notify()

virtual void mitk::InteractionEventObserver::Notify ( InteractionEvent interactionEvent,
bool  isHandled 
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.

if (!isHandled) {
this->HandleEvent(interactionEvent, nullptr);

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.

The documentation for this class was generated from the following file:
itk::SmartPointer< Self > Pointer
Definition: mitkInteractionEvent.h:29
virtual void Notify(InteractionEvent *interactionEvent, bool isHandled)=0