Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::DisplayInteractor Class Reference

Observer that manages the interaction with the display. More...

#include <mitkDisplayInteractor.h>

Inheritance diagram for mitk::DisplayInteractor:
Collaboration diagram for mitk::DisplayInteractor:

Public Types

typedef DisplayInteractor Self
 
typedef EventStateMachine Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
- Public Types inherited from mitk::EventStateMachine
typedef EventStateMachine Self
 
typedef InteractionEventHandler Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef std::map< std::string, TActionFunctor * > ActionFunctionsMapType
 
typedef itk::SmartPointer< StateMachineStateStateMachineStateType
 
- Public Types inherited from mitk::InteractionEventHandler
typedef InteractionEventHandler Self
 
typedef itk::Object Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 

Public Member Functions

virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
virtual void Notify (InteractionEvent *interactionEvent, bool isHandled) override
 
- Public Member Functions inherited from mitk::EventStateMachine
bool LoadStateMachine (const std::string &filename, const us::Module *module=nullptr)
 Loads XML resource. More...
 
bool HandleEvent (InteractionEvent *event, DataNode *dataNode)
 
void EnableUndo (bool enable)
 Enables or disabled Undo. More...
 
void EnableInteraction (bool enable)
 Enables/disables the state machine. In un-enabled state it won't react to any events. More...
 
- Public Member Functions inherited from mitk::InteractionEventHandler
bool SetEventConfig (const std::string &filename, const us::Module *module=nullptr)
 Loads a configuration from an XML resource. More...
 
bool SetEventConfig (const EventConfig &config)
 Loads a configuration from an EventConfig object. More...
 
EventConfig GetEventConfig () const
 Returns the current configuration. More...
 
bool AddEventConfig (const std::string &filename, const us::Module *module=nullptr)
 This method extends the configuration. More...
 
bool AddEventConfig (const EventConfig &config)
 This method extends the configuration. The configuration from the EventConfig object is loaded and only the ones conflicting are replaced by the new one. This way several configurations can be combined. More...
 
- Public Member Functions inherited from mitk::InteractionEventObserver
 InteractionEventObserver ()
 
virtual ~InteractionEventObserver ()
 
void Disable ()
 
void Enable ()
 
bool IsEnabled () const
 

Static Public Member Functions

static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 
- Static Public Member Functions inherited from mitk::EventStateMachine
static const char * GetStaticNameOfClass ()
 
- Static Public Member Functions inherited from mitk::InteractionEventHandler
static const char * GetStaticNameOfClass ()
 

Protected Types

typedef std::vector< SliceNavigationController * > SNCVector
 
- Protected Types inherited from mitk::EventStateMachine
typedef MessageAbstractDelegate2< StateMachineAction *, InteractionEvent *, void > ActionFunctionDelegate
 
typedef MessageAbstractDelegate1< const InteractionEvent *, bool > ConditionFunctionDelegate
 

Protected Member Functions

 DisplayInteractor ()
 
virtual ~DisplayInteractor ()
 
void ConnectActionsAndFunctions () override
 
virtual void ConfigurationChanged () override
 
virtual bool FilterEvents (InteractionEvent *interactionEvent, DataNode *dataNode) override
 
virtual bool CheckPositionEvent (const InteractionEvent *interactionEvent)
 
virtual bool CheckRotationPossible (const InteractionEvent *interactionEvent)
 
virtual bool CheckSwivelPossible (const InteractionEvent *interactionEvent)
 
virtual void Init (StateMachineAction *, InteractionEvent *)
 Initializes an interaction, saves the pointers start position for further reference. More...
 
virtual void Move (StateMachineAction *, InteractionEvent *)
 Performs panning of the data set in the render window. More...
 
virtual void SetCrosshair (StateMachineAction *, InteractionEvent *)
 Sets crosshair at clicked position*. More...
 
virtual void Zoom (StateMachineAction *, InteractionEvent *)
 Performs zooming relative to mouse/pointer movement. More...
 
virtual void Scroll (StateMachineAction *, InteractionEvent *)
 Performs scrolling relative to mouse/pointer movement. More...
 
virtual void ScrollOneDown (StateMachineAction *, InteractionEvent *)
 Scrolls one layer up. More...
 
virtual void ScrollOneUp (StateMachineAction *, InteractionEvent *)
 Scrolls one layer down. More...
 
virtual void AdjustLevelWindow (StateMachineAction *, InteractionEvent *)
 Adjusts the level windows relative to mouse/pointer movement. More...
 
virtual void StartRotation (StateMachineAction *, InteractionEvent *)
 Starts crosshair rotation. More...
 
virtual void EndRotation (StateMachineAction *, InteractionEvent *)
 Ends crosshair rotation. More...
 
virtual void Rotate (StateMachineAction *, InteractionEvent *event)
 
virtual void Swivel (StateMachineAction *, InteractionEvent *event)
 
virtual void UpdateStatusbar (StateMachineAction *, InteractionEvent *event)
 Updates the Statusbar information with the information about the clicked position. More...
 
bool GetBoolProperty (mitk::PropertyList::Pointer propertyList, const char *propertyName, bool defaultValue)
 Method to retrieve bool-value for given property from string-property in given propertylist. More...
 
- Protected Member Functions inherited from mitk::EventStateMachine
 EventStateMachine ()
 
virtual ~EventStateMachine ()
 
void AddActionFunction (const std::string &action, TActionFunctor *functor)
 
void AddActionFunction (const std::string &action, const ActionFunctionDelegate &delegate)
 
void AddConditionFunction (const std::string &condition, const ConditionFunctionDelegate &delegate)
 
StateMachineStateGetCurrentState () const
 
void ResetToStartState ()
 ResetToStartState Reset state machine to it initial starting state. More...
 
virtual bool CheckCondition (const StateMachineCondition &condition, const InteractionEvent *interactionEvent)
 
virtual void ExecuteAction (StateMachineAction *action, InteractionEvent *interactionEvent)
 
void SetMouseCursor (const char *xpm[], int hotspotX, int hotspotY)
 Sets the specified mouse cursor. More...
 
void ResetMouseCursor ()
 Resets the mouse cursor (if modified by the SlicesCoordinator) to its original state. More...
 
StateMachineTransitionGetExecutableTransition (InteractionEvent *event)
 Returns the executable transition for the given event. More...
 
- Protected Member Functions inherited from mitk::InteractionEventHandler
 InteractionEventHandler ()
 
virtual ~InteractionEventHandler ()
 
PropertyList::Pointer GetAttributes () const
 
std::string MapToEventVariant (InteractionEvent *interactionEvent)
 

Additional Inherited Members

- Protected Attributes inherited from mitk::EventStateMachine
bool m_IsActive
 
UndoControllerm_UndoController
 
bool m_UndoEnabled
 

Detailed Description

Observer that manages the interaction with the display.

Inherits from mitk::InteractionEventObserver since it doesn't alter any data (only their representation), and its actions cannot be associated with a DataNode. Also inherits from EventStateMachine

This includes the interaction of Zooming, Panning, Scrolling and adjusting the LevelWindow.

Definition at line 37 of file mitkDisplayInteractor.h.

Member Typedef Documentation

Definition at line 150 of file mitkDisplayInteractor.h.

Constructor & Destructor Documentation

mitk::DisplayInteractor::DisplayInteractor ( )
protected

Definition at line 80 of file mitkDisplayInteractor.cpp.

mitk::DisplayInteractor::~DisplayInteractor ( )
protectedvirtual

Definition at line 97 of file mitkDisplayInteractor.cpp.

Member Function Documentation

void mitk::DisplayInteractor::AdjustLevelWindow ( StateMachineAction ,
InteractionEvent interactionEvent 
)
protectedvirtual
bool mitk::DisplayInteractor::CheckPositionEvent ( const InteractionEvent interactionEvent)
protectedvirtual

Definition at line 101 of file mitkDisplayInteractor.cpp.

Pointer mitk::DisplayInteractor::Clone ( ) const
void mitk::DisplayInteractor::ConfigurationChanged ( )
overrideprotectedvirtual

Derived function. Is executed when config object is set / changed. Here it is used to read out the parameters set in the configuration file, and set the member variables accordingly.

Reimplemented from mitk::InteractionEventHandler.

Definition at line 801 of file mitkDisplayInteractor.cpp.

void mitk::DisplayInteractor::ConnectActionsAndFunctions ( )
overrideprotectedvirtual

Derived function. Connects the action names used in the state machine pattern with functions implemented within this InteractionEventObserver. This is only necessary here because the events are processed by the state machine.

Reimplemented from mitk::EventStateMachine.

Reimplemented in mitk::SegmentationInteractor.

Definition at line 56 of file mitkDisplayInteractor.cpp.

References CONNECT_CONDITION, and CONNECT_FUNCTION.

void mitk::DisplayInteractor::EndRotation ( mitk::StateMachineAction ,
mitk::InteractionEvent  
)
protectedvirtual

Ends crosshair rotation.

Definition at line 600 of file mitkDisplayInteractor.cpp.

bool mitk::DisplayInteractor::FilterEvents ( InteractionEvent interactionEvent,
DataNode dataNode 
)
overrideprotectedvirtual

Derived function. Is executed when config object is set / changed. Here it is used to read out the parameters set in the configuration file, and set the member variables accordingly.

Reimplemented from mitk::EventStateMachine.

Definition at line 889 of file mitkDisplayInteractor.cpp.

References mitk::BaseRenderer::GetMapperID(), mitk::InteractionEvent::GetSender(), and mitk::BaseRenderer::Standard3D.

bool mitk::DisplayInteractor::GetBoolProperty ( mitk::PropertyList::Pointer  propertyList,
const char *  propertyName,
bool  defaultValue 
)
protected

Method to retrieve bool-value for given property from string-property in given propertylist.

Definition at line 899 of file mitkDisplayInteractor.cpp.

virtual std::vector<std::string> mitk::DisplayInteractor::GetClassHierarchy ( ) const
inlineoverridevirtual

Reimplemented from mitk::EventStateMachine.

Definition at line 40 of file mitkDisplayInteractor.h.

virtual const char* mitk::DisplayInteractor::GetClassName ( ) const
virtual

Reimplemented from mitk::EventStateMachine.

static const char* mitk::DisplayInteractor::GetStaticNameOfClass ( )
inlinestatic

Definition at line 40 of file mitkDisplayInteractor.h.

void mitk::DisplayInteractor::Init ( StateMachineAction ,
InteractionEvent interactionEvent 
)
protectedvirtual

Initializes an interaction, saves the pointers start position for further reference.

Definition at line 348 of file mitkDisplayInteractor.cpp.

References mitk::BaseRenderer::DisplayToPlane(), mitk::InteractionPositionEvent::GetPointerPositionOnScreen(), and mitk::InteractionEvent::GetSender().

static Pointer mitk::DisplayInteractor::New ( )
static

Referenced by main().

void mitk::DisplayInteractor::Notify ( InteractionEvent interactionEvent,
bool  isHandled 
)
overridevirtual

By this function the Observer gets notified about new events. Here it is adapted to pass the events to the state machine in order to use its infrastructure. It also checks if event is to be accepted when it already has been processed by a DataInteractor.

Implements mitk::InteractionEventObserver.

Definition at line 46 of file mitkDisplayInteractor.cpp.

References mitk::EventStateMachine::HandleEvent().

void mitk::DisplayInteractor::Scroll ( StateMachineAction ,
InteractionEvent interactionEvent 
)
protectedvirtual

Performs scrolling relative to mouse/pointer movement.

Behavior is determined by

See also
m_ScrollDirection and
m_AutoRepeat.

Definition at line 433 of file mitkDisplayInteractor.cpp.

References mitk::InteractionPositionEvent::GetPointerPositionOnScreen(), mitk::InteractionEvent::GetSender(), and mitk::BaseRenderer::GetSliceNavigationController().

void mitk::DisplayInteractor::ScrollOneDown ( StateMachineAction ,
InteractionEvent interactionEvent 
)
protectedvirtual
void mitk::DisplayInteractor::ScrollOneUp ( StateMachineAction ,
InteractionEvent interactionEvent 
)
protectedvirtual
void mitk::DisplayInteractor::StartRotation ( mitk::StateMachineAction ,
mitk::InteractionEvent  
)
protectedvirtual

Starts crosshair rotation.

Definition at line 595 of file mitkDisplayInteractor.cpp.

void mitk::DisplayInteractor::Zoom ( StateMachineAction ,
InteractionEvent interactionEvent 
)
protectedvirtual

Performs zooming relative to mouse/pointer movement.

Behavior is determined by

See also
m_ZoomDirection and
m_ZoomFactor.

Definition at line 391 of file mitkDisplayInteractor.cpp.

References mitk::InteractionPositionEvent::GetPointerPositionOnScreen(), and mitk::InteractionEvent::GetSender().


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