Medical Imaging Interaction Toolkit  2024.06.99-b3904305
Medical Imaging Interaction Toolkit
QmitkAbstractView.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 #ifndef QmitkAbstractView_h
14 #define QmitkAbstractView_h
15 
16 //# blueberry stuff
17 #include <berryQtViewPart.h>
19 
20 //# mitk stuff
22 
23 #include "mitkDataNodeSelection.h"
24 #include "mitkIRenderWindowPart.h"
25 
26 #include <mitkWorkbenchUtil.h>
27 
28 #include <mitkDataStorage.h>
29 #include <mitkRenderingManager.h>
31 
32 #include <QItemSelectionModel>
33 
34 namespace mitk {
35  class DataNode;
36  class IPreferences;
37 }
38 
39 class QmitkAbstractViewPrivate;
40 class QmitkAbstractViewSelectionProvider;
41 
90 {
91 
92 public:
93 
98 
104 
108  ~QmitkAbstractView() override;
109 
110 protected:
111 
118  void FireNodeSelected(mitk::DataNode::Pointer node);
119 
126  virtual void FireNodesSelected(const QList<mitk::DataNode::Pointer>& nodes);
127 
134  QList<mitk::DataNode::Pointer> GetCurrentSelection() const;
135 
142  bool IsCurrentSelectionValid() const;
143 
150  QList<mitk::DataNode::Pointer> GetDataManagerSelection() const;
151 
158  bool IsDataManagerSelectionValid() const;
159 
166  void SetDataManagerSelection(const berry::ISelection::ConstPointer& selection,
167  QItemSelectionModel::SelectionFlags flags = QItemSelectionModel::ClearAndSelect) const;
168 
173  void SynchronizeDataManagerSelection() const;
174 
180  virtual mitk::IPreferences* GetPreferences() const;
181 
185  mitk::IDataStorageReference::Pointer GetDataStorageReference() const;
186 
190  mitk::DataStorage::Pointer GetDataStorage() const;
191 
199  mitk::IRenderWindowPart* GetRenderWindowPart(mitk::WorkbenchUtil::IRenderWindowPartStrategies strategies = mitk::WorkbenchUtil::NONE) const;
200 
206  void RequestRenderWindowUpdate(mitk::RenderingManager::RequestType requestType = mitk::RenderingManager::REQUEST_UPDATE_ALL);
207 
216  void HandleException( std::exception& e, QWidget* parent = nullptr, bool showDialog = true ) const;
217 
222  void HandleException( const char* str, QWidget* parent = nullptr, bool showDialog = true ) const;
223 
227  void WaitCursorOn();
228 
232  void WaitCursorOff();
233 
237  void BusyCursorOn();
238 
242  void BusyCursorOff();
243 
247  void RestoreOverrideCursor();
248 
249 private:
250 
258  virtual void SetSelectionProvider();
259 
272  virtual QItemSelectionModel* GetDataNodeSelectionModel() const;
273 
283  virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer> &nodes);
284 
290  virtual void OnNullSelection(berry::IWorkbenchPart::Pointer part);
291 
298  virtual void OnPreferencesChanged(const mitk::IPreferences*);
299 
304  virtual void NodeAdded(const mitk::DataNode* node);
305 
310  virtual void NodeChanged(const mitk::DataNode* node);
311 
316  virtual void NodeRemoved(const mitk::DataNode* node);
317 
324  virtual void DataStorageModified();
325 
332  virtual void DataStorageChanged(mitk::IDataStorageReference::Pointer dsRef);
333 
337  void CreatePartControl(QWidget* parent) override;
338 
343  void AfterCreateQtPartControl();
344 
345 private:
346 
347  friend class QmitkAbstractViewPrivate;
348  friend class QmitkViewCoordinator;
349 
350  Q_DISABLE_COPY(QmitkAbstractView)
351 
352  const QScopedPointer<QmitkAbstractViewPrivate> d;
353 
354 };
355 
356 #endif
MITK_QT_COMMON
#define MITK_QT_COMMON
Definition: org_mitk_gui_qt_common_Export.h:26
berry::QtViewPart::CreatePartControl
void CreatePartControl(QWidget *parent) override
mitkDataNodeSelection.h
mitk::WorkbenchUtil::NONE
@ NONE
Definition: mitkWorkbenchUtil.h:45
mitkDataStorage.h
berry::SmartPointer
Implements transparent reference counting.
Definition: berryICommandCategoryListener.h:21
QmitkAbstractView
A convenient base class for MITK related BlueBerry Views.
Definition: QmitkAbstractView.h:89
itk::SmartPointer< Self >
berryQtViewPart.h
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::IRenderWindowPart
Interface for a MITK Workbench Part providing a render window.
Definition: mitkIRenderWindowPart.h:54
mitkIRenderWindowPart.h
mitkWorkbenchUtil.h
berry::QtViewPart::berryObjectMacro
berryObjectMacro(QtViewPart)
berry::QtViewPart
Definition: berryQtViewPart.h:25
berryISelectionListener.h
mitk::RenderingManager::RequestType
RequestType
Definition: mitkRenderingManager.h:85
mitk::RenderingManager::REQUEST_UPDATE_ALL
@ REQUEST_UPDATE_ALL
Definition: mitkRenderingManager.h:87
mitkRenderingManager.h
mitk::IPreferences
Interface to application preferences.
Definition: mitkIPreferences.h:50
mitkIDataStorageReference.h
mitk::DataNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63
org_mitk_gui_qt_common_Export.h