Medical Imaging Interaction Toolkit  2022.04.99-3f7a773b
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 __Q_MITK_SLICE_NAVIGATION_LISTENER_H
15 #define __Q_MITK_SLICE_NAVIGATION_LISTENER_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 
90  protected slots:
92  void OnSliceChangedDelayed();
93 
94  protected:
95 
97  void OnSliceChangedInternal(const itk::EventObject& e);
98 
99  void OnSliceNavigationControllerDeleted(const itk::Object* sender, const itk::EventObject& /*e*/);
100 
103  bool InitObservers();
104  void RemoveObservers(const mitk::SliceNavigationController* deletedSlicer);
106  void RemoveAllObservers(mitk::IRenderWindowPart* deletedPart = nullptr);
107 
109 
110  // Needed for observing the events for when a slice or time step is changed.
112 
115  {
118  std::string renderWindowName;
120 
121  ObserverInfo(mitk::SliceNavigationController* controller, int observerTag,
122  const std::string& renderWindowName, mitk::IRenderWindowPart* part);
123  };
124 
125  typedef std::multimap<const mitk::SliceNavigationController*, ObserverInfo> ObserverMapType;
126  ObserverMapType m_ObserverMap;
127 
130  };
131 
132 #endif
133 
Interface for a MITK Workbench Part providing a render window.
DataCollection - Class to facilitate loading/accessing structured data.
Controls the selection of the slice the associated BaseRenderer will display.
Helper class to allow QmitkAbstractView and derived classes to react on changes of the slice/time nav...
mitk::IRenderWindowPart * m_renderWindowPart
mitk::ScalarType TimePointType
std::multimap< const mitk::SliceNavigationController *, ObserverInfo > ObserverMapType
#define MITK_QT_COMMON