Medical Imaging Interaction Toolkit  2018.4.99-4c24e3cb
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 ( )

Definition at line 15 of file mitkInteractionEventObserver.cpp.

◆ ~InteractionEventObserver()

mitk::InteractionEventObserver::~InteractionEventObserver ( )
virtual

Definition at line 19 of file mitkInteractionEventObserver.cpp.

Member Function Documentation

◆ Disable()

void mitk::InteractionEventObserver::Disable ( )

Definition at line 23 of file mitkInteractionEventObserver.cpp.

◆ Enable()

void mitk::InteractionEventObserver::Enable ( )

Definition at line 28 of file mitkInteractionEventObserver.cpp.

◆ IsEnabled()

bool mitk::InteractionEventObserver::IsEnabled ( ) const

Definition at line 33 of file mitkInteractionEventObserver.cpp.

Referenced by mitk::Dispatcher::ProcessEvent().

◆ 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::Tool, mitk::EventRecorder, mitk::DisplayActionEventBroadcast, and mitk::DisplayInteractor.

Referenced by mitk::Dispatcher::ProcessEvent().


The documentation for this class was generated from the following files: