NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkSingleViewerEditor.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 niftkSingleViewerEditor_h
16 #define niftkSingleViewerEditor_h
17 
18 #include <berryQtEditorPart.h>
19 #include <berryIPartListener.h>
20 #include <berryIPreferences.h>
21 
22 #include <berryIPreferencesService.h>
23 #include <berryIBerryPreferences.h>
24 #include <berryISelection.h>
25 #include <berryISelectionProvider.h>
26 #include <berryISelectionListener.h>
27 
28 #include <mitkILinkedRenderWindowPart.h>
29 
30 #include <QmitkAbstractRenderEditor.h>
31 #include <mitkDataStorage.h>
32 #include <mitkRenderingManager.h>
33 #include <mitkIRenderingManager.h>
34 
35 #include <uk_ac_ucl_cmic_dnddisplay_Export.h>
36 
37 #include <niftkDnDDisplayEnums.h>
38 
39 namespace mitk
40 {
41 class DataNode;
42 }
43 
44 class QmitkRenderWindow;
45 
46 namespace niftk
47 {
48 
61 class SingleViewerEditorPrivate;
62 class SingleViewerWidget;
63 class SingleViewerControls;
64 
65 class DNDDISPLAY_EXPORT SingleViewerEditor :
66  public QmitkAbstractRenderEditor, public mitk::ILinkedRenderWindowPart
67 {
68  Q_OBJECT
69 
70 public:
71 
72  berryObjectMacro(SingleViewerEditor)
73 
76 
77  static const QString EDITOR_ID;
78 
80  SingleViewerWidget* GetSingleViewer();
81 
82  // ------------------- mitk::IRenderWindowPart ----------------------
83 
87  virtual QmitkRenderWindow* GetActiveQmitkRenderWindow() const;
88 
92  virtual QHash<QString,QmitkRenderWindow*> GetQmitkRenderWindows() const;
93 
97  virtual QmitkRenderWindow* GetQmitkRenderWindow(const QString& id) const;
98 
102  virtual mitk::Point3D GetSelectedPosition(const QString& id = QString()) const;
103 
107  virtual void SetSelectedPosition(const mitk::Point3D& position, const QString& id = QString());
108 
112  virtual void EnableDecorations(bool enable, const QStringList& decorations = QStringList());
113 
117  virtual bool IsDecorationEnabled(const QString& decoration) const;
118 
122  virtual QStringList GetDecorations() const;
123 
130  virtual mitk::IRenderingManager* GetRenderingManager() const;
131 
132  // ------------------- mitk::ILinkedRenderWindowPart ----------------------
133 
137  mitk::SlicesRotator* GetSlicesRotator() const;
138 
142  mitk::SlicesSwiveller* GetSlicesSwiveller() const;
143 
147  void EnableSlicingPlanes(bool enable);
148 
152  bool IsSlicingPlanesEnabled() const;
153 
157  void EnableLinkedNavigation(bool linkedNavigationEnabled);
158 
162  bool IsLinkedNavigationEnabled() const;
163 
165  virtual bool eventFilter(QObject* object, QEvent* event);
166 
168  void OnFocusChanged();
169 
170 protected:
171 
173  virtual void SetFocus();
174 
176  virtual void OnPreferencesChanged(const berry::IBerryPreferences*);
177 
179  virtual void CreateQtPartControl(QWidget* parent);
180 
181  SingleViewerControls* CreateControlPanel(QWidget* parent);
182 
183 protected slots:
184 
185  void OnTimeGeometryChanged(const mitk::TimeGeometry* timeGeometry);
186 
188  void OnPopupOpened(bool opened);
189 
191  void OnPinButtonToggled(bool checked);
192 
194  void OnSelectedSliceControlChanged(int selectedSlice);
195 
197  void OnTimeStepControlChanged(int timeStep);
198 
200  void OnMagnificationControlChanged(double magnification);
201 
203  void OnCursorVisibilityControlChanged(bool visible);
204 
206  void OnShowDirectionAnnotationsControlChanged(bool visible);
207 
209  void OnShowIntensityAnnotationControlChanged(bool visible);
210 
212  void OnShow3DWindowControlChanged(bool visible);
213 
215  void OnWindowLayoutControlChanged(niftk::WindowLayout windowLayout);
216 
218  void OnWindowCursorBindingControlChanged(bool);
219 
221  void OnWindowScaleFactorBindingControlChanged(bool);
222 
225  void OnSelectedPositionChanged(const mitk::Point3D& selectedPosition);
226 
229  void OnTimeStepChanged(int timeStep);
230 
232  void OnScaleFactorChanged(niftk::WindowOrientation orientation, double scaleFactor);
233 
235  void OnWindowLayoutChanged(niftk::WindowLayout windowLayout);
236 
238  void OnCursorVisibilityChanged(bool visible);
239 
241  void OnDirectionAnnotationsVisibilityChanged(bool visible);
242 
244  void OnIntensityAnnotationVisibilityChanged(bool visible);
245 
246 private:
247 
248  const QScopedPointer<SingleViewerEditorPrivate> d;
249 };
250 
251 }
252 
253 #endif
GLboolean enable
Definition: glew.h:2642
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
static const QString EDITOR_ID
Definition: niftkSingleViewerEditor.h:77
Control panel for the DnD display.
Definition: niftkSingleViewerControls.h:38
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
cl_event event
Definition: glew.h:3231
Definition: niftkExceptionObject.h:21
Simple image viewer that supports cursor and magnification binding.
Definition: niftkSingleViewerEditor.h:65