Medical Imaging Interaction Toolkit  2024.06.99-35a6d053
Medical Imaging Interaction Toolkit
mitkDisplayActionEvents.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 mitkDisplayActionEvents_h
14 #define mitkDisplayActionEvents_h
15 
16 #include <MitkCoreExports.h>
17 
18 // mitk core
19 #include "mitkInteractionEvent.h"
20 
21 // itk
22 #include <itkEventObject.h>
23 
24 #include <mitkVector.h>
25 #include <mitkPoint.h>
26 
27 namespace mitk
28 {
29  class MITKCORE_EXPORT DisplayActionEvent : public itk::AnyEvent
30  {
31  public:
33  typedef itk::AnyEvent Superclass;
34 
35  DisplayActionEvent() : m_InteractionEvent(nullptr) {}
36  DisplayActionEvent(InteractionEvent* interactionEvent) : m_InteractionEvent(interactionEvent) {}
37  ~DisplayActionEvent() override {}
38  const char* GetEventName() const override { return "DisplayActionEvent"; }
39  bool CheckEvent(const itk::EventObject* e) const override { return dynamic_cast<const Self *>(e) != nullptr; }
40  itk::EventObject* MakeObject() const override { return new Self(m_InteractionEvent); }
41  InteractionEvent* GetInteractionEvent() const { return m_InteractionEvent; }
43  {
44  return m_InteractionEvent != nullptr ? m_InteractionEvent->GetSender() : nullptr;
45  }
46  DisplayActionEvent(const Self& s) : Superclass(s), m_InteractionEvent(s.GetInteractionEvent()) {};
47 
48  private:
49  InteractionEvent* m_InteractionEvent;
50  void operator=(const Self &);
51  };
52 
54  {
55  public:
58 
60  DisplayMoveEvent(InteractionEvent* interactionEvent, const Vector2D& moveVector)
61  : Superclass(interactionEvent)
62  , m_MoveVector(moveVector)
63  {
64  }
65  ~DisplayMoveEvent() override {}
66  const char* GetEventName() const override { return "DisplayMoveEvent"; }
67  bool CheckEvent(const itk::EventObject* e) const override { return dynamic_cast<const Self *>(e) != nullptr; }
68  itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_MoveVector); }
69  const Vector2D& GetMoveVector() const { return m_MoveVector; }
70  DisplayMoveEvent(const Self& s) : Superclass(s), m_MoveVector(s.GetMoveVector()) {};
71 
72  private:
73  Vector2D m_MoveVector;
74  };
75 
77  {
78  public:
81 
83  DisplaySetCrosshairEvent(InteractionEvent* interactionEvent, const Point3D& position)
84  : Superclass(interactionEvent)
85  , m_Position(position)
86  {
87  }
89  const char* GetEventName() const override { return "DisplaySetCrosshairEvent"; }
90  bool CheckEvent(const itk::EventObject* e) const override { return dynamic_cast<const Self *>(e) != nullptr; }
91  itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_Position); }
92  const Point3D& GetPosition() const { return m_Position; }
93  DisplaySetCrosshairEvent(const Self& s) : Superclass(s), m_Position(s.GetPosition()) {};
94 
95  private:
96  Point3D m_Position;
97  };
98 
100  {
101  public:
104 
106  DisplayZoomEvent(InteractionEvent* interactionEvent, float zoomFactor, const Point2D& startCoordinate)
107  : Superclass(interactionEvent)
108  , m_ZoomFactor(zoomFactor)
109  , m_StartCoordinate(startCoordinate)
110  {
111  }
112  ~DisplayZoomEvent() override {}
113  const char* GetEventName() const override { return "DisplayZoomEvent"; }
114  bool CheckEvent(const itk::EventObject* e) const override { return dynamic_cast<const Self *>(e) != nullptr; }
115  itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_ZoomFactor, m_StartCoordinate); }
116  float GetZoomFactor() const { return m_ZoomFactor; }
117  const Point2D& GetStartCoordinate() const { return m_StartCoordinate; }
118  DisplayZoomEvent(const Self& s) : Superclass(s), m_ZoomFactor(s.GetZoomFactor()), m_StartCoordinate(s.GetStartCoordinate()) {};
119 
120  private:
121  float m_ZoomFactor;
122  Point2D m_StartCoordinate;
123  };
124 
126  {
127  public:
130 
132  DisplayScrollEvent(InteractionEvent* interactionEvent, int sliceDelta, bool autoRepeat)
133  : Superclass(interactionEvent)
134  , m_SliceDelta(sliceDelta)
135  , m_AutoRepeat(autoRepeat)
136  {
137  }
138  ~DisplayScrollEvent() override {}
139  const char* GetEventName() const override { return "DisplayScrollEvent"; }
140  bool CheckEvent(const itk::EventObject *e) const override { return dynamic_cast<const Self *>(e) != nullptr; }
141  itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_SliceDelta, m_AutoRepeat); }
142  int GetSliceDelta() const { return m_SliceDelta; }
143  bool GetAutoRepeat() const { return m_AutoRepeat; }
144  DisplayScrollEvent(const Self& s) : Superclass(s), m_SliceDelta(s.GetSliceDelta()), m_AutoRepeat(s.GetAutoRepeat()) {};
145 
146  private:
147  int m_SliceDelta;
148  bool m_AutoRepeat;
149  };
150 
152  {
153  public:
156 
159  : Superclass(interactionEvent)
160  , m_Level(level)
161  , m_Window(window)
162  {
163  }
165  const char* GetEventName() const override { return "DisplaySetLevelWindowEvent"; }
166  bool CheckEvent(const itk::EventObject *e) const override { return dynamic_cast<const Self *>(e) != nullptr; }
167  itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_Level, m_Window); }
168  ScalarType GetLevel() const { return m_Level; }
169  ScalarType GetWindow() const { return m_Window; }
170  DisplaySetLevelWindowEvent(const Self& s) : Superclass(s), m_Level(s.GetLevel()), m_Window(s.GetWindow()) {};
171 
172  private:
173  ScalarType m_Level;
174  ScalarType m_Window;
175  };
176 
177 } // end namespace
178 
179 #endif
mitk::DisplayActionEvent::DisplayActionEvent
DisplayActionEvent()
Definition: mitkDisplayActionEvents.h:35
mitk::DisplaySetCrosshairEvent::DisplaySetCrosshairEvent
DisplaySetCrosshairEvent()
Definition: mitkDisplayActionEvents.h:82
mitk::InteractionEvent
Definition: mitkInteractionEvent.h:26
mitkInteractionEvent.h
mitk::DisplaySetLevelWindowEvent::Superclass
DisplayActionEvent Superclass
Definition: mitkDisplayActionEvents.h:155
mitk::DisplayMoveEvent::MakeObject
itk::EventObject * MakeObject() const override
Definition: mitkDisplayActionEvents.h:68
mitk::DisplaySetLevelWindowEvent::~DisplaySetLevelWindowEvent
~DisplaySetLevelWindowEvent() override
Definition: mitkDisplayActionEvents.h:164
mitk::DisplayActionEvent::DisplayActionEvent
DisplayActionEvent(InteractionEvent *interactionEvent)
Definition: mitkDisplayActionEvents.h:36
mitk::DisplaySetLevelWindowEvent::GetLevel
ScalarType GetLevel() const
Definition: mitkDisplayActionEvents.h:168
mitk::DisplayMoveEvent::DisplayMoveEvent
DisplayMoveEvent(const Self &s)
Definition: mitkDisplayActionEvents.h:70
mitk::DisplayActionEvent::Self
DisplayActionEvent Self
Definition: mitkDisplayActionEvents.h:32
mitk::DisplayZoomEvent::GetZoomFactor
float GetZoomFactor() const
Definition: mitkDisplayActionEvents.h:116
mitk::DisplayMoveEvent
Definition: mitkDisplayActionEvents.h:53
mitk::DisplaySetCrosshairEvent::GetEventName
const char * GetEventName() const override
Definition: mitkDisplayActionEvents.h:89
mitk::DisplayMoveEvent::~DisplayMoveEvent
~DisplayMoveEvent() override
Definition: mitkDisplayActionEvents.h:65
mitk::DisplayZoomEvent::CheckEvent
bool CheckEvent(const itk::EventObject *e) const override
Definition: mitkDisplayActionEvents.h:114
mitk::DisplayZoomEvent::GetEventName
const char * GetEventName() const override
Definition: mitkDisplayActionEvents.h:113
mitk::DisplayZoomEvent
Definition: mitkDisplayActionEvents.h:99
mitk::DisplayMoveEvent::GetMoveVector
const Vector2D & GetMoveVector() const
Definition: mitkDisplayActionEvents.h:69
mitk::DisplayScrollEvent::Self
DisplayScrollEvent Self
Definition: mitkDisplayActionEvents.h:128
mitk::DisplaySetCrosshairEvent::GetPosition
const Point3D & GetPosition() const
Definition: mitkDisplayActionEvents.h:92
mitk::DisplayZoomEvent::~DisplayZoomEvent
~DisplayZoomEvent() override
Definition: mitkDisplayActionEvents.h:112
mitk::DisplayMoveEvent::GetEventName
const char * GetEventName() const override
Definition: mitkDisplayActionEvents.h:66
mitk::DisplayZoomEvent::DisplayZoomEvent
DisplayZoomEvent()
Definition: mitkDisplayActionEvents.h:105
mitk::DisplaySetLevelWindowEvent::CheckEvent
bool CheckEvent(const itk::EventObject *e) const override
Definition: mitkDisplayActionEvents.h:166
mitk::DisplayScrollEvent::GetEventName
const char * GetEventName() const override
Definition: mitkDisplayActionEvents.h:139
mitk::DisplaySetLevelWindowEvent::GetWindow
ScalarType GetWindow() const
Definition: mitkDisplayActionEvents.h:169
mitkPoint.h
mitk::DisplaySetCrosshairEvent::Self
DisplaySetCrosshairEvent Self
Definition: mitkDisplayActionEvents.h:79
mitk::DisplaySetLevelWindowEvent::Self
DisplaySetLevelWindowEvent Self
Definition: mitkDisplayActionEvents.h:154
mitk::DisplayMoveEvent::Self
DisplayMoveEvent Self
Definition: mitkDisplayActionEvents.h:56
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::DisplayScrollEvent::DisplayScrollEvent
DisplayScrollEvent()
Definition: mitkDisplayActionEvents.h:131
mitk::DisplayActionEvent::Superclass
itk::AnyEvent Superclass
Definition: mitkDisplayActionEvents.h:33
mitk::DisplaySetLevelWindowEvent::MakeObject
itk::EventObject * MakeObject() const override
Definition: mitkDisplayActionEvents.h:167
mitk::DisplayMoveEvent::DisplayMoveEvent
DisplayMoveEvent(InteractionEvent *interactionEvent, const Vector2D &moveVector)
Definition: mitkDisplayActionEvents.h:60
mitk::DisplaySetCrosshairEvent::DisplaySetCrosshairEvent
DisplaySetCrosshairEvent(InteractionEvent *interactionEvent, const Point3D &position)
Definition: mitkDisplayActionEvents.h:83
mitk::Vector< ScalarType, 2 >
MitkCoreExports.h
mitk::DisplayZoomEvent::Superclass
DisplayActionEvent Superclass
Definition: mitkDisplayActionEvents.h:103
mitk::DisplayZoomEvent::Self
DisplayZoomEvent Self
Definition: mitkDisplayActionEvents.h:102
mitk::DisplayScrollEvent::GetAutoRepeat
bool GetAutoRepeat() const
Definition: mitkDisplayActionEvents.h:143
mitk::DisplayActionEvent::~DisplayActionEvent
~DisplayActionEvent() override
Definition: mitkDisplayActionEvents.h:37
mitk::Point< ScalarType, 3 >
mitk::DisplaySetLevelWindowEvent::GetEventName
const char * GetEventName() const override
Definition: mitkDisplayActionEvents.h:165
mitk::DisplayActionEvent::CheckEvent
bool CheckEvent(const itk::EventObject *e) const override
Definition: mitkDisplayActionEvents.h:39
mitk::DisplayScrollEvent
Definition: mitkDisplayActionEvents.h:125
mitk::DisplayZoomEvent::MakeObject
itk::EventObject * MakeObject() const override
Definition: mitkDisplayActionEvents.h:115
mitk::DisplaySetLevelWindowEvent::DisplaySetLevelWindowEvent
DisplaySetLevelWindowEvent(const Self &s)
Definition: mitkDisplayActionEvents.h:170
mitk::DisplaySetCrosshairEvent::~DisplaySetCrosshairEvent
~DisplaySetCrosshairEvent() override
Definition: mitkDisplayActionEvents.h:88
mitk::DisplaySetCrosshairEvent::DisplaySetCrosshairEvent
DisplaySetCrosshairEvent(const Self &s)
Definition: mitkDisplayActionEvents.h:93
mitk::DisplaySetLevelWindowEvent::DisplaySetLevelWindowEvent
DisplaySetLevelWindowEvent(InteractionEvent *interactionEvent, ScalarType level, ScalarType window)
Definition: mitkDisplayActionEvents.h:158
mitk::DisplayMoveEvent::DisplayMoveEvent
DisplayMoveEvent()
Definition: mitkDisplayActionEvents.h:59
mitk::DisplayActionEvent
Definition: mitkDisplayActionEvents.h:29
mitk::DisplayScrollEvent::GetSliceDelta
int GetSliceDelta() const
Definition: mitkDisplayActionEvents.h:142
mitk::DisplayScrollEvent::DisplayScrollEvent
DisplayScrollEvent(InteractionEvent *interactionEvent, int sliceDelta, bool autoRepeat)
Definition: mitkDisplayActionEvents.h:132
mitk::DisplayScrollEvent::DisplayScrollEvent
DisplayScrollEvent(const Self &s)
Definition: mitkDisplayActionEvents.h:144
mitk::DisplaySetCrosshairEvent::Superclass
DisplayActionEvent Superclass
Definition: mitkDisplayActionEvents.h:80
mitk::BaseRenderer
Definition: mitkBaseRenderer.h:56
mitk::DisplayActionEvent::GetInteractionEvent
InteractionEvent * GetInteractionEvent() const
Definition: mitkDisplayActionEvents.h:41
mitk::DisplaySetCrosshairEvent::CheckEvent
bool CheckEvent(const itk::EventObject *e) const override
Definition: mitkDisplayActionEvents.h:90
mitk::DisplayScrollEvent::MakeObject
itk::EventObject * MakeObject() const override
Definition: mitkDisplayActionEvents.h:141
mitk::DisplayScrollEvent::CheckEvent
bool CheckEvent(const itk::EventObject *e) const override
Definition: mitkDisplayActionEvents.h:140
mitk::DisplayActionEvent::GetEventName
const char * GetEventName() const override
Definition: mitkDisplayActionEvents.h:38
mitkVector.h
mitk::DisplayMoveEvent::Superclass
DisplayActionEvent Superclass
Definition: mitkDisplayActionEvents.h:57
mitk::DisplayZoomEvent::GetStartCoordinate
const Point2D & GetStartCoordinate() const
Definition: mitkDisplayActionEvents.h:117
mitk::DisplayActionEvent::MakeObject
itk::EventObject * MakeObject() const override
Definition: mitkDisplayActionEvents.h:40
mitk::DisplayMoveEvent::CheckEvent
bool CheckEvent(const itk::EventObject *e) const override
Definition: mitkDisplayActionEvents.h:67
mitk::DisplaySetLevelWindowEvent::DisplaySetLevelWindowEvent
DisplaySetLevelWindowEvent()
Definition: mitkDisplayActionEvents.h:157
mitk::DisplayScrollEvent::Superclass
DisplayActionEvent Superclass
Definition: mitkDisplayActionEvents.h:129
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15
mitk::DisplaySetCrosshairEvent
Definition: mitkDisplayActionEvents.h:76
mitk::DisplayZoomEvent::DisplayZoomEvent
DisplayZoomEvent(const Self &s)
Definition: mitkDisplayActionEvents.h:118
mitk::DisplayActionEvent::GetSender
BaseRenderer * GetSender() const
Definition: mitkDisplayActionEvents.h:42
mitk::DisplayActionEvent::DisplayActionEvent
DisplayActionEvent(const Self &s)
Definition: mitkDisplayActionEvents.h:46
mitk::DisplaySetCrosshairEvent::MakeObject
itk::EventObject * MakeObject() const override
Definition: mitkDisplayActionEvents.h:91
mitk::ScalarType
double ScalarType
Definition: mitkNumericConstants.h:20
mitk::DisplayScrollEvent::~DisplayScrollEvent
~DisplayScrollEvent() override
Definition: mitkDisplayActionEvents.h:138
mitk::DisplaySetLevelWindowEvent
Definition: mitkDisplayActionEvents.h:151
mitk::DisplayZoomEvent::DisplayZoomEvent
DisplayZoomEvent(InteractionEvent *interactionEvent, float zoomFactor, const Point2D &startCoordinate)
Definition: mitkDisplayActionEvents.h:106