Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
Observer that manages the interaction with the display. More...
#include <mitkDisplayInteractor.h>
Public Types | |
typedef DisplayInteractor | Self |
typedef EventStateMachine | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
![]() | |
typedef EventStateMachine | Self |
typedef InteractionEventHandler | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
typedef std::map< std::string, TActionFunctor * > | ActionFunctionsMapType |
typedef itk::SmartPointer< StateMachineState > | StateMachineStateType |
![]() | |
typedef InteractionEventHandler | Self |
typedef itk::Object | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
Public Member Functions | |
virtual std::vector< std::string > | GetClassHierarchy () const override |
virtual const char * | GetClassName () const |
Pointer | Clone () const |
void | Notify (InteractionEvent *interactionEvent, bool isHandled) override |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
InteractionEventObserver () | |
virtual | ~InteractionEventObserver () |
void | Disable () |
void | Enable () |
bool | IsEnabled () const |
Static Public Member Functions | |
static const char * | GetStaticNameOfClass () |
static Pointer | New () |
![]() | |
static const char * | GetStaticNameOfClass () |
![]() | |
static const char * | GetStaticNameOfClass () |
Protected Member Functions | |
DisplayInteractor () | |
~DisplayInteractor () override | |
void | ConnectActionsAndFunctions () override |
void | ConfigurationChanged () override |
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 | IncreaseTimeStep (StateMachineAction *, InteractionEvent *) |
Increases the time step in 3d+t data. More... | |
virtual void | DecreaseTimeStep (StateMachineAction *, InteractionEvent *) |
Decreases the time step in 3d+t data. 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... | |
![]() | |
EventStateMachine () | |
~EventStateMachine () override | |
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) |
StateMachineState * | GetCurrentState () 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... | |
StateMachineTransition * | GetExecutableTransition (InteractionEvent *event) |
Returns the executable transition for the given event. More... | |
![]() | |
InteractionEventHandler () | |
~InteractionEventHandler () override | |
PropertyList::Pointer | GetAttributes () const |
std::string | MapToEventVariant (InteractionEvent *interactionEvent) |
Additional Inherited Members | |
![]() | |
typedef MessageAbstractDelegate2< StateMachineAction *, InteractionEvent *, void > | ActionFunctionDelegate |
typedef MessageAbstractDelegate1< const InteractionEvent *, bool > | ConditionFunctionDelegate |
![]() | |
bool | m_IsActive |
UndoController * | m_UndoController |
bool | m_UndoEnabled |
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 33 of file mitkDisplayInteractor.h.
typedef itk::SmartPointer<const Self> mitk::DisplayInteractor::ConstPointer |
Definition at line 37 of file mitkDisplayInteractor.h.
Definition at line 37 of file mitkDisplayInteractor.h.
Definition at line 37 of file mitkDisplayInteractor.h.
Definition at line 37 of file mitkDisplayInteractor.h.
|
protected |
Definition at line 53 of file mitkDisplayInteractor.cpp.
|
overrideprotected |
Definition at line 70 of file mitkDisplayInteractor.cpp.
|
protectedvirtual |
Adjusts the level windows relative to mouse/pointer movement.
Definition at line 552 of file mitkDisplayInteractor.cpp.
References mitk::RenderingManager::GetInstance(), mitk::LevelWindow::GetLevel(), mitk::InteractionEvent::GetSender(), mitk::LevelWindow::GetWindow(), mitk::NodePredicateDataType::New(), mitk::RenderingManager::RequestUpdateAll(), and mitk::LevelWindow::SetLevelWindow().
Referenced by ConnectActionsAndFunctions().
|
protectedvirtual |
Definition at line 102 of file mitkDisplayInteractor.cpp.
Referenced by ConnectActionsAndFunctions().
|
protectedvirtual |
Definition at line 113 of file mitkDisplayInteractor.cpp.
References mitk::Line< TCoordRep, NPointDimension >::Distance(), mitk::eps, mitk::RenderingManager::GetAllRegisteredRenderWindows(), mitk::SliceNavigationController::GetCurrentPlaneGeometry(), mitk::BaseRenderer::GetCurrentWorldPlaneGeometry(), mitk::BaseRenderer::GetInstance(), mitk::RenderingManager::GetInstance(), mitk::Line< TCoordRep, NPointDimension >::GetPoint1(), mitk::BaseRenderer::GetSliceNavigationController(), mitk::BaseGeometry::GetSpacing(), mitk::PlaneGeometry::IntersectionLine(), mitk::PlaneGeometry::IntersectionPoint(), mitk::Line< TCoordRep, NPointDimension >::IsParallel(), mitk::Line< TCoordRep, NPointDimension >::Project(), and mitk::BaseRenderer::Standard3D.
Referenced by ConnectActionsAndFunctions().
|
protectedvirtual |
Definition at line 249 of file mitkDisplayInteractor.cpp.
References mitk::RenderingManager::GetAllRegisteredRenderWindows(), mitk::SliceNavigationController::GetCurrentPlaneGeometry(), mitk::BaseRenderer::GetInstance(), mitk::RenderingManager::GetInstance(), mitk::PlaneGeometry::GetNormal(), mitk::InteractionEvent::GetSender(), mitk::BaseRenderer::GetSliceNavigationController(), mitk::PlaneGeometry::IntersectionLine(), mitk::PlaneGeometry::IntersectionPoint(), line, and mitk::BaseRenderer::Standard3D.
Referenced by ConnectActionsAndFunctions().
Pointer mitk::DisplayInteractor::Clone | ( | ) | const |
|
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 829 of file mitkDisplayInteractor.cpp.
References mitk::InteractionEventHandler::GetAttributes(), and GetBoolProperty().
|
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 75 of file mitkDisplayInteractor.cpp.
References AdjustLevelWindow(), CheckPositionEvent(), CheckRotationPossible(), CheckSwivelPossible(), CONNECT_CONDITION, CONNECT_FUNCTION, DecreaseTimeStep(), EndRotation(), IncreaseTimeStep(), Init(), Move(), Rotate(), Scroll(), ScrollOneDown(), ScrollOneUp(), SetCrosshair(), StartRotation(), Swivel(), UpdateStatusbar(), and Zoom().
|
protectedvirtual |
Decreases the time step in 3d+t data.
Definition at line 404 of file mitkDisplayInteractor.cpp.
References mitk::RenderingManager::GetInstance(), mitk::BaseController::GetTime(), mitk::RenderingManager::GetTimeNavigationController(), and mitk::Stepper::SetAutoRepeat().
Referenced by ConnectActionsAndFunctions().
|
protectedvirtual |
Ends crosshair rotation.
Definition at line 620 of file mitkDisplayInteractor.cpp.
References mitk::EventStateMachine::ResetMouseCursor().
Referenced by ConnectActionsAndFunctions().
|
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 917 of file mitkDisplayInteractor.cpp.
References mitk::BaseRenderer::GetMapperID(), mitk::InteractionEvent::GetSender(), and mitk::BaseRenderer::Standard3D.
|
protected |
Method to retrieve bool-value for given property from string-property in given propertylist.
Definition at line 927 of file mitkDisplayInteractor.cpp.
Referenced by ConfigurationChanged().
|
inlineoverridevirtual |
Reimplemented from mitk::EventStateMachine.
Definition at line 37 of file mitkDisplayInteractor.h.
|
virtual |
Reimplemented from mitk::EventStateMachine.
|
inlinestatic |
Definition at line 37 of file mitkDisplayInteractor.h.
|
protectedvirtual |
Increases the time step in 3d+t data.
Definition at line 396 of file mitkDisplayInteractor.cpp.
References mitk::RenderingManager::GetInstance(), mitk::BaseController::GetTime(), mitk::RenderingManager::GetTimeNavigationController(), and mitk::Stepper::SetAutoRepeat().
Referenced by ConnectActionsAndFunctions().
|
protectedvirtual |
Initializes an interaction, saves the pointers start position for further reference.
Definition at line 351 of file mitkDisplayInteractor.cpp.
Referenced by ConnectActionsAndFunctions().
|
protectedvirtual |
Performs panning of the data set in the render window.
Definition at line 361 of file mitkDisplayInteractor.cpp.
References mitk::BaseRenderer::GetCameraController(), mitk::RenderingManager::GetInstance(), mitk::BaseRenderer::GetRenderWindow(), mitk::BaseRenderer::GetScaleFactorMMPerDisplayUnit(), mitk::InteractionEvent::GetSender(), mitk::CameraController::MoveBy(), and mitk::RenderingManager::RequestUpdate().
Referenced by ConnectActionsAndFunctions().
|
static |
Referenced by main(), and mitk::MouseModeSwitcher::~MouseModeSwitcher().
|
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 43 of file mitkDisplayInteractor.cpp.
References mitk::EventStateMachine::HandleEvent().
|
protectedvirtual |
Definition at line 625 of file mitkDisplayInteractor.cpp.
References mitk::TimeGeometry::ExecuteOperation(), mitk::RenderingManager::GetInstance(), mitk::OpROTATE, and mitk::RenderingManager::RequestUpdateAll().
Referenced by ConnectActionsAndFunctions().
|
protectedvirtual |
Performs scrolling relative to mouse/pointer movement.
Behavior is determined by
Definition at line 453 of file mitkDisplayInteractor.cpp.
References mitk::InteractionEvent::GetSender(), and mitk::BaseRenderer::GetSliceNavigationController().
Referenced by ConnectActionsAndFunctions().
|
protectedvirtual |
Scrolls one layer up.
Definition at line 522 of file mitkDisplayInteractor.cpp.
References mitk::InteractionEvent::GetSender(), mitk::BaseRenderer::GetSliceNavigationController(), mitk::Stepper::GetSteps(), and mitk::Stepper::Next().
Referenced by ConnectActionsAndFunctions().
|
protectedvirtual |
Scrolls one layer down.
Definition at line 537 of file mitkDisplayInteractor.cpp.
References mitk::InteractionEvent::GetSender(), mitk::BaseRenderer::GetSliceNavigationController(), mitk::Stepper::GetSteps(), and mitk::Stepper::Previous().
Referenced by ConnectActionsAndFunctions().
|
protectedvirtual |
Sets crosshair at clicked position*.
Definition at line 380 of file mitkDisplayInteractor.cpp.
References mitk::RenderingManager::GetAllRegisteredRenderWindows(), mitk::BaseRenderer::GetInstance(), mitk::RenderingManager::GetInstance(), mitk::InteractionEvent::GetSender(), mitk::BaseRenderer::GetSliceNavigationController(), mitk::SliceNavigationController::SelectSliceByPoint(), and mitk::BaseRenderer::Standard2D.
Referenced by ConnectActionsAndFunctions().
|
protectedvirtual |
Starts crosshair rotation.
Definition at line 615 of file mitkDisplayInteractor.cpp.
References mitk::EventStateMachine::SetMouseCursor().
Referenced by ConnectActionsAndFunctions().
|
protectedvirtual |
Definition at line 665 of file mitkDisplayInteractor.cpp.
References mitk::TimeGeometry::ExecuteOperation(), mitk::RenderingManager::GetInstance(), mitk::OpROTATE, and mitk::RenderingManager::RequestUpdateAll().
Referenced by ConnectActionsAndFunctions().
|
protectedvirtual |
Updates the Statusbar information with the information about the clicked position.
Definition at line 728 of file mitkDisplayInteractor.cpp.
References mitk::ConvertCompositePixelValueToString(), mitk::FastSinglePixelAccess(), mitk::FindTopmostVisibleNode(), mitk::StatusBar::GetInstance(), mitkPixelTypeMultiplex5, and mitk::TNodePredicateDataType< T >::New().
Referenced by ConnectActionsAndFunctions().
|
protectedvirtual |
Performs zooming relative to mouse/pointer movement.
Behavior is determined by
Definition at line 412 of file mitkDisplayInteractor.cpp.
References mitk::RenderingManager::GetInstance(), mitk::InteractionEvent::GetSender(), and mitk::RenderingManager::RequestUpdate().
Referenced by ConnectActionsAndFunctions().