NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkBaseController.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 niftkBaseController_h
16 #define niftkBaseController_h
17 
18 #include <niftkCoreGuiExports.h>
19 
20 #include <QObject>
21 
22 #include <mitkDataNode.h>
23 
25 
26 class QWidget;
27 
28 namespace mitk
29 {
30 class BaseRenderer;
31 class DataStorage;
32 }
33 
34 namespace niftk
35 {
36 
37 class BaseGUI;
38 class BaseControllerPrivate;
39 class IBaseView;
40 
41 
43 class NIFTKCOREGUI_EXPORT BaseController : public QObject
44 {
45 
46  Q_OBJECT
47 
48 public:
49 
52 
54  virtual ~BaseController();
55 
59 
62  int GetSliceIndex() const;
63 
66  mitk::Point3D GetSelectedPosition() const;
67 
70  virtual void SetupGUI(QWidget* parent);
71 
73  virtual void OnViewGetsActivated();
74 
76  virtual void OnViewGetsDeactivated();
77 
79  virtual void OnViewGetsVisible();
80 
82  virtual void OnViewGetsHidden();
83 
84 protected:
85 
86  mitk::DataStorage* GetDataStorage() const;
87 
88  void RequestRenderWindowUpdate() const;
89 
94  QList<mitk::DataNode::Pointer> GetDataManagerSelection() const;
95 
96  mitk::SliceNavigationController* GetSliceNavigationController() const;
97 
107  virtual void OnSelectedSliceChanged(niftk::ImageOrientation orientation, int sliceIndex);
108 
112  virtual BaseGUI* CreateGUI(QWidget* parent) = 0;
113 
115  BaseGUI* GetGUI() const;
116 
118  IBaseView* GetView() const;
119 
121  virtual void OnFocusChanged();
122 
125  virtual mitk::BaseRenderer* GetFocused2DRenderer() const;
126 
129  virtual void OnNodeAdded(const mitk::DataNode* node);
130 
133  virtual void OnNodeChanged(const mitk::DataNode* node);
134 
137  virtual void OnNodeRemoved(const mitk::DataNode* node);
138 
141  virtual void OnNodeDeleted(const mitk::DataNode* node);
142 
146  virtual void OnNodeVisibilityChanged(const mitk::DataNode* node, const mitk::BaseRenderer* renderer);
147 
149  void WaitCursorOn();
150 
152  void WaitCursorOff();
153 
155  void BusyCursorOn();
156 
158  void BusyCursorOff();
159 
160 private:
161 
163  void RestoreOverrideCursor();
164 
165  QScopedPointer<BaseControllerPrivate> d_ptr;
166 
167  Q_DECLARE_PRIVATE(BaseController);
168 
169 };
170 
171 }
172 
173 #endif
ImageOrientation
Describes the different types of orientation, axial, sagittal, coronal, that can be achieved in the D...
Definition: niftkImageOrientation.h:26
itk::SpatialOrientation::ValidCoordinateOrientationFlags GetOrientation(ImageType::Pointer image)
Definition: niftkBreastDensityFromMRIsGivenMaskAndImage.cxx:146
Definition: ReceptorMemberCommandTest.cxx:25
Public interface to QmitkBaseView.
Definition: niftkIBaseView.h:39
Base class for GUI controls on BlueBerry views.
Definition: niftkBaseGUI.h:29
Definition: niftkBaseController.h:43
Some utilities to help with MIDAS conventions on orientation.
Definition: niftkExceptionObject.h:21