Medical Imaging Interaction Toolkit  2023.04.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 
100  void OnSliceNavigationControllerDeleted(const itk::Object* sender, const itk::EventObject& /*e*/);
101 
104  bool InitObservers();
105  void RemoveObservers(const mitk::SliceNavigationController* deletedSlicer);
107  void RemoveAllObservers(mitk::IRenderWindowPart* deletedPart = nullptr);
108 
109  bool ObserversInitialized(mitk::SliceNavigationController* controller);
110 
112 
113  // Needed for observing the events for when a slice or time step is changed.
115 
118  {
121  std::string renderWindowName;
123 
124  ObserverInfo(mitk::SliceNavigationController* controller, int observerTag,
125  const std::string& renderWindowName, mitk::IRenderWindowPart* part);
126  };
127 
128  typedef std::multimap<const mitk::SliceNavigationController*, ObserverInfo> ObserverMapType;
130 
133  };
134 
135 #endif
QmitkSliceNavigationListener::m_ObserverMap
ObserverMapType m_ObserverMap
Definition: QmitkSliceNavigationListener.h:129
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:122
QmitkSliceNavigationListener::ObserverInfo
Definition: QmitkSliceNavigationListener.h:117
QmitkSliceNavigationListener::ObserverMapType
std::multimap< const mitk::SliceNavigationController *, ObserverInfo > ObserverMapType
Definition: QmitkSliceNavigationListener.h:128
QmitkSliceNavigationListener::m_renderWindowPart
mitk::IRenderWindowPart * m_renderWindowPart
Definition: QmitkSliceNavigationListener.h:111
QmitkSliceNavigationListener::m_CurrentSelectedTimePoint
mitk::TimePointType m_CurrentSelectedTimePoint
Definition: QmitkSliceNavigationListener.h:132
QmitkSliceNavigationListener::m_PendingSliceChangedEvent
bool m_PendingSliceChangedEvent
Definition: QmitkSliceNavigationListener.h:114
mitkPoint.h
mitkTimeGeometry.h
mitk::SliceNavigationController
Controls the selection of the slice the associated BaseRenderer will display.
Definition: mitkSliceNavigationController.h:132
mitk
DataCollection - Class to facilitate loading/accessing structured data.
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:119
QmitkSliceNavigationListener::ObserverInfo::renderWindowName
std::string renderWindowName
Definition: QmitkSliceNavigationListener.h:121
mitk::Point< ScalarType, 3 >
QmitkSliceNavigationListener::m_CurrentSelectedPosition
mitk::Point3D m_CurrentSelectedPosition
Definition: QmitkSliceNavigationListener.h:131
QmitkSliceNavigationListener::ObserverInfo::observerTag
int observerTag
Definition: QmitkSliceNavigationListener.h:120
QmitkSliceNavigationListener
Helper class to allow QmitkAbstractView and derived classes to react on changes of the slice/time nav...
Definition: QmitkSliceNavigationListener.h:65
itk
SET FUNCTIONS.
Definition: itkIntelligentBinaryClosingFilter.h:30
mitk::TimePointType
mitk::ScalarType TimePointType
Definition: mitkTimeGeometry.h:26
org_mitk_gui_qt_common_Export.h