NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkSideViewerWidget.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef niftkSideViewerWidget_h
16 #define niftkSideViewerWidget_h
17 
18 #include <uk_ac_ucl_cmic_sideviewer_Export.h>
19 
20 #include <berryIPartListener.h>
21 
22 #include <QMap>
23 #include <QWidget>
24 
27 #include <niftkDnDDisplayEnums.h>
28 
29 namespace mitk
30 {
31 class BaseRenderer;
32 class DataStorage;
33 class IRenderWindowPart;
34 class RenderingManager;
35 class SliceNavigationController;
36 }
37 
38 class QmitkRenderWindow;
39 
40 class QComboBox;
41 class QDoubleSpinBox;
42 class QLabel;
43 class QRadioButton;
44 class QSpinBox;
45 
46 
47 namespace niftk
48 {
49 class BaseView;
50 class SingleViewerWidget;
51 
52 
67 class SIDEVIEWER_EXPORT SideViewerWidget : public QWidget
68 {
69  Q_OBJECT
70 
71 public:
72 
80  SideViewerWidget(BaseView* view, QWidget* parent, mitk::RenderingManager* renderingManager);
81 
83  virtual ~SideViewerWidget();
84 
85  void SetFocused();
86 
88  void SetGeometry(const itk::EventObject& geometrySendEvent);
89 
95  void OnMainWindowChanged(mitk::IRenderWindowPart* renderWindowPart, QmitkRenderWindow* mainWindow);
96 
97 protected slots:
98 
100  void OnAxialWindowRadioButtonToggled(bool checked);
101 
103  void OnSagittalWindowRadioButtonToggled(bool checked);
104 
106  void OnCoronalWindowRadioButtonToggled(bool checked);
107 
109  void OnMultiWindowRadioButtonToggled(bool checked);
110 
112  void OnMultiWindowComboBoxIndexChanged();
113 
115  void OnSliceSpinBoxValueChanged(int slice);
116 
118  void OnMagnificationSpinBoxValueChanged(double magnification);
119 
121  void OnSelectedPositionChanged(const mitk::Point3D& selectedPosition);
122 
124  void OnScaleFactorChanged(WindowOrientation orientation, double scaleFactor);
125 
127  void OnWindowLayoutChanged(WindowLayout windowLayout);
128 
129 private:
130 
132  void OnFocusChanged();
133 
135  WindowLayout GetMultiWindowLayoutForOrientation(WindowOrientation mainWindowOrientation);
136 
139  mitk::IRenderWindowPart* GetSelectedEditor();
140 
142  void OnViewerWindowChanged();
143 
145  void OnMainWindowOrientationChanged(WindowOrientation orientation);
146 
147 private slots:
148 
150  virtual void OnAMainWindowDestroyed(QObject* mainWindow);
151 
153  void FitToDisplay();
154 
155 private:
156 
157  void SetupUi(QWidget* parent);
158 
160  BaseView* m_ContainingView;
161 
163  unsigned long m_FocusManagerObserverTag;
164 
166  WindowLayout m_WindowLayout;
167 
172  mitk::RenderingManager* m_MainRenderingManager;
173 
175  QmitkRenderWindow* m_MainWindow;
176 
178  QmitkRenderWindow* m_MainAxialWindow;
179 
181  QmitkRenderWindow* m_MainSagittalWindow;
182 
184  QmitkRenderWindow* m_MainCoronalWindow;
185 
187  mitk::SliceNavigationController* m_MainWindowSnc;
188 
190  mitk::SliceNavigationController* m_MainAxialSnc;
191 
193  mitk::SliceNavigationController* m_MainSagittalSnc;
194 
196  mitk::SliceNavigationController* m_MainCoronalSnc;
197 
198  DataNodeVisibilityTracker::Pointer m_VisibilityTracker;
199 
201  DataNodeStringPropertyFilter::Pointer m_ToolNodeNameFilter;
202 
206  double m_Magnification;
207 
209  WindowOrientation m_MainWindowOrientation;
210 
213  QMap<WindowOrientation, WindowLayout> m_SingleWindowLayouts;
214 
218  const mitk::TimeGeometry* m_TimeGeometry;
219 
221  QScopedPointer<berry::IPartListener> m_EditorLifeCycleListener;
222 
223  SingleViewerWidget* m_Viewer;
224  QWidget* m_ControlsWidget;
225  QWidget* m_LayoutWidget;
226  QRadioButton* m_CoronalWindowRadioButton;
227  QRadioButton* m_SagittalWindowRadioButton;
228  QRadioButton* m_AxialWindowRadioButton;
229  QRadioButton* m_MultiWindowRadioButton;
230  QComboBox* m_MultiWindowComboBox;
231  QLabel* m_SliceLabel;
232  QSpinBox* m_SliceSpinBox;
233  QLabel* m_MagnificationLabel;
234  QDoubleSpinBox* m_MagnificationSpinBox;
235 
236  mitk::RenderingManager* m_RenderingManager;
237 };
238 
239 }
240 
241 #endif
WindowOrientation
Describes the different types of orientation, axial, sagittal, coronal, that can be achieved in the D...
Definition: niftkDnDDisplayEnums.h:29
Definition: ReceptorMemberCommandTest.cxx:25
WindowLayout
Describes the different render window layouts. So one WindowLayout could have multiple windows of dif...
Definition: niftkDnDDisplayEnums.h:49
A widget to wrap a single MultiWindowWidget, providing methods for switching the render window layout...
Definition: niftkSingleViewerWidget.h:78
Base view component for plugins listening to visibility change events, focus changed events and so on...
Definition: niftkBaseView.h:47
Definition: niftkExceptionObject.h:21
Qt Widget to provide a single SingleViewerWidget, and some associated buttons controlling 2/3 view...
Definition: niftkSideViewerWidget.h:67