Medical Imaging Interaction Toolkit  2016.11.0
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 37 of file mitkInteractionEventObserver.h.

Constructor & Destructor Documentation

mitk::InteractionEventObserver::InteractionEventObserver ( )

Definition at line 19 of file mitkInteractionEventObserver.cpp.

mitk::InteractionEventObserver::~InteractionEventObserver ( )
virtual

Definition at line 23 of file mitkInteractionEventObserver.cpp.

Member Function Documentation

void mitk::InteractionEventObserver::Disable ( )

Definition at line 27 of file mitkInteractionEventObserver.cpp.

void mitk::InteractionEventObserver::Enable ( )

Definition at line 32 of file mitkInteractionEventObserver.cpp.

bool mitk::InteractionEventObserver::IsEnabled ( ) const

Definition at line 37 of file mitkInteractionEventObserver.cpp.

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

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, NULL);
}
}

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, QmitkFreeSurferParcellationHandler, mitk::EventRecorder, and mitk::DisplayInteractor.

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


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