Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
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 
39 
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  void UpdateStatusbar(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
120 
121  bool GetBoolProperty(PropertyList::Pointer propertyList, const char* propertyName, bool defaultValue);
122 
128 
133  bool m_AlwaysReact;
134 
138  Point2D m_StartCoordinateInMM;
142  Point2D m_LastDisplayCoordinate;
146  Point2D m_LastCoordinateInMM;
150  Point2D m_CurrentDisplayCoordinate;
151 
156  bool m_AutoRepeat;
165  int m_IndexToSliceModifier;
170  std::string m_ScrollDirection;
174  bool m_InvertScrollDirection;
179  std::string m_ZoomDirection;
183  bool m_InvertZoomDirection;
187  float m_ZoomFactor;
191  bool m_InvertMoveDirection;
196  std::string m_LevelDirection;
200  bool m_InvertLevelWindowDirection;
204  bool m_LinkPlanes;
205 
206  typedef std::vector<SliceNavigationController*> SNCVector;
207  SNCVector m_RotatableSNCs;
208  SNCVector m_SNCsToBeRotated;
209 
210  Point3D m_LastCursorPosition;
211  Point3D m_CenterOfRotation;
212 
213  Point2D m_ReferenceCursor;
214 
215  Vector3D m_RotationPlaneNormal;
216  Vector3D m_RotationPlaneXVector;
217  Vector3D m_RotationPlaneYVector;
218 
219  Vector3D m_PreviousRotationAxis;
220  ScalarType m_PreviousRotationAngle;
221  };
222 } // end namespace
223 
224 #endif // MITKDISPLAYACTIONEVENTBROADCAST_H
Base class to implement InteractionEventObservers.
#define MITKCORE_EXPORT
double ScalarType
DataCollection - Class to facilitate loading/accessing structured data.
This class serves as an event state machine while simultaneously observing interaction events...
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Class for nodes of the DataTree.
Definition: mitkDataNode.h:64
Super-class that provides the functionality of a StateMachine to DataInteractors. ...