Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
QmitkSliceNavigationListener.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 
14 #ifndef QmitkSliceNavigationListener_h
15 #define QmitkSliceNavigationListener_h
16 
17 #include <mitkTimeGeometry.h>
18 #include <mitkPoint.h>
19 
20 #include <itkEventObject.h>
21 
22 #include <QObject>
23 
25 
26 namespace itk
27 {
28  class Object;
29 }
30 
31 namespace mitk
32 {
33  class SliceNavigationController;
34  struct IRenderWindowPart;
35 }
36 
37 
66  {
67  Q_OBJECT
68 
69  public:
71  ~QmitkSliceNavigationListener() override;
72 
73  mitk::TimePointType GetCurrentSelectedTimePoint() const;
74  mitk::Point3D GetCurrentSelectedPosition() const;
75 
76  signals:
78  void SliceChanged();
81  void SelectedTimePointChanged(const mitk::TimePointType& newTimePoint);
84  void SelectedPositionChanged(const mitk::Point3D& newPoint);
85 
86  public slots:
87  void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart);
88  void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart);
89  void RenderWindowPartInputChanged(mitk::IRenderWindowPart* renderWindowPart);
90 
91  protected slots:
93  void OnSliceChangedDelayed();
94 
95  protected:
96 
98  void OnSliceChangedInternal(const itk::EventObject& e);
99  void OnTimeChangedInternal(itk::Object* sender, const itk::EventObject& e);
100 
101  void OnSliceNavigationControllerDeleted(const itk::Object* sender, const itk::EventObject& /*e*/);
102 
105  bool InitObservers();
106  void RemoveObservers(const mitk::SliceNavigationController* deletedSlicer);
108  void RemoveAllObservers(mitk::IRenderWindowPart* deletedPart = nullptr);
109 
110  bool ObserversInitialized(mitk::SliceNavigationController* controller);
111 
113 
114  // Needed for observing the events for when a slice or time step is changed.
116 
119  {
122  std::string renderWindowName;
124 
125  ObserverInfo(mitk::SliceNavigationController* controller, int observerTag,
126  const std::string& renderWindowName, mitk::IRenderWindowPart* part);
127  };
128 
129  typedef std::multimap<const mitk::SliceNavigationController*, ObserverInfo> ObserverMapType;
132 
135  };
136 
137 #endif
QmitkSliceNavigationListener::m_ObserverMap
ObserverMapType m_ObserverMap
Definition: QmitkSliceNavigationListener.h:130
MITK_QT_COMMON
#define MITK_QT_COMMON
Definition: org_mitk_gui_qt_common_Export.h:26
QmitkSliceNavigationListener::ObserverInfo::renderWindowPart
mitk::IRenderWindowPart * renderWindowPart
Definition: QmitkSliceNavigationListener.h:123
QmitkSliceNavigationListener::ObserverInfo
Definition: QmitkSliceNavigationListener.h:118
QmitkSliceNavigationListener::ObserverMapType
std::multimap< const mitk::SliceNavigationController *, ObserverInfo > ObserverMapType
Definition: QmitkSliceNavigationListener.h:129
QmitkSliceNavigationListener::m_renderWindowPart
mitk::IRenderWindowPart * m_renderWindowPart
Definition: QmitkSliceNavigationListener.h:112
QmitkSliceNavigationListener::m_CurrentSelectedTimePoint
mitk::TimePointType m_CurrentSelectedTimePoint
Definition: QmitkSliceNavigationListener.h:134
QmitkSliceNavigationListener::m_PendingSliceChangedEvent
bool m_PendingSliceChangedEvent
Definition: QmitkSliceNavigationListener.h:115
mitkPoint.h
mitkTimeGeometry.h
mitk::SliceNavigationController
Controls the selection of the slice the associated BaseRenderer will display.
Definition: mitkSliceNavigationController.h:130
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::IRenderWindowPart
Interface for a MITK Workbench Part providing a render window.
Definition: mitkIRenderWindowPart.h:54
QmitkSliceNavigationListener::ObserverInfo::controller
mitk::SliceNavigationController * controller
Definition: QmitkSliceNavigationListener.h:120
QmitkSliceNavigationListener::ObserverInfo::renderWindowName
std::string renderWindowName
Definition: QmitkSliceNavigationListener.h:122
mitk::Point< ScalarType, 3 >
QmitkSliceNavigationListener::m_CurrentSelectedPosition
mitk::Point3D m_CurrentSelectedPosition
Definition: QmitkSliceNavigationListener.h:133
QmitkSliceNavigationListener::ObserverInfo::observerTag
int observerTag
Definition: QmitkSliceNavigationListener.h:121
QmitkSliceNavigationListener
Helper class to allow QmitkAbstractView and derived classes to react on changes of the slice/time nav...
Definition: QmitkSliceNavigationListener.h:65
QmitkSliceNavigationListener::m_ControllerToTimeObserverTag
unsigned int m_ControllerToTimeObserverTag
Definition: QmitkSliceNavigationListener.h:131
itk
SET FUNCTIONS.
Definition: itkIntelligentBinaryClosingFilter.h:30
mitk::TimePointType
mitk::ScalarType TimePointType
Definition: mitkTimeGeometry.h:26
org_mitk_gui_qt_common_Export.h