Medical Imaging Interaction Toolkit  2023.12.99-63768887
Medical Imaging Interaction Toolkit
mitkDisplayActionEventBroadcast.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkDisplayActionEventBroadcast_h
14 #define mitkDisplayActionEventBroadcast_h
15 
17 #include <MitkCoreExports.h>
18 
19 namespace mitk
20 {
33  {
34  public:
36  itkFactorylessNewMacro(Self);
37  itkCloneMacro(Self);
38 
47  void Notify(InteractionEvent* interactionEvent, bool isHandled) override;
48 
49  protected:
50 
52  ~DisplayActionEventBroadcast() override;
53 
57  void ConnectActionsAndFunctions() override;
62  void ConfigurationChanged() override;
71  bool FilterEvents(InteractionEvent* interactionEvent, DataNode* dataNode) override;
72 
74  // Functions to react to interaction events (actions)
76 
83  bool CheckPositionEvent(const InteractionEvent* interactionEvent);
84 
85  bool CheckRotationPossible(const InteractionEvent* interactionEvent);
86 
87  bool CheckSwivelPossible(const InteractionEvent* interactionEvent);
88 
89  void Init(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
90 
91  void Move(StateMachineAction* stateMachineAction , InteractionEvent* interactionEvent);
92 
93  void SetCrosshair(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
94 
95  void Zoom(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
96 
97  void Scroll(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
98 
99  void ScrollOneUp(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
100 
101  void ScrollOneDown(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
102 
103  void AdjustLevelWindow(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
104 
105  void StartRotation(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
106 
107  void EndRotation(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
108 
109  void Rotate(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
110 
111  void Swivel(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
112 
113  void IncreaseTimeStep(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
114 
115  void DecreaseTimeStep(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
116 
117  private:
118 
119  bool GetBoolProperty(PropertyList::Pointer propertyList, const char* propertyName, bool defaultValue);
120 
126 
131  bool m_AlwaysReact;
132 
136  Point2D m_StartCoordinateInMM;
140  Point2D m_LastDisplayCoordinate;
144  Point2D m_CurrentDisplayCoordinate;
145 
150  bool m_AutoRepeat;
159  int m_IndexToSliceModifier;
164  std::string m_ScrollDirection;
168  bool m_InvertScrollDirection;
173  std::string m_ZoomDirection;
177  bool m_InvertZoomDirection;
181  float m_ZoomFactor;
185  bool m_InvertMoveDirection;
190  std::string m_LevelDirection;
194  bool m_InvertLevelWindowDirection;
198  bool m_LinkPlanes;
199 
200  typedef std::vector<SliceNavigationController*> SNCVector;
201  SNCVector m_RotatableSNCs;
202  SNCVector m_SNCsToBeRotated;
203 
204  Point3D m_LastCursorPosition;
205  Point3D m_CenterOfRotation;
206 
207  Point2D m_ReferenceCursor;
208 
209  Vector3D m_RotationPlaneNormal;
210  Vector3D m_RotationPlaneXVector;
211  Vector3D m_RotationPlaneYVector;
212 
213  Vector3D m_PreviousRotationAxis;
214  ScalarType m_PreviousRotationAngle;
215  };
216 } // end namespace
217 
218 #endif
mitk::InteractionEvent
Definition: mitkInteractionEvent.h:26
mitk::InteractionEventObserver
Base class to implement InteractionEventObservers.
Definition: mitkInteractionEventObserver.h:33
itk::SmartPointer< Self >
mitkInteractionEventObserver.h
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::DisplayActionEventBroadcast
This class serves as an event state machine while simultaneously observing interaction events....
Definition: mitkDisplayActionEventBroadcast.h:32
mitk::EventStateMachine
‍**
Definition: mitkEventStateMachine.h:111
mitk::Vector< ScalarType, 3 >
MitkCoreExports.h
mitk::Point< ScalarType, 2 >
mitk::StateMachineAction
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
Definition: mitkStateMachineAction.h:30
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
us::ServiceRegistration
Definition: usServiceRegistration.h:48
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15
mitk::DataNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63
mitk::ScalarType
double ScalarType
Definition: mitkNumericConstants.h:20