Medical Imaging Interaction Toolkit  2021.10.99-1c4db16f
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>
20 
21 #include <berryIPreferences.h>
22 
23 //# mitk stuff
25 
26 #include "mitkDataNodeSelection.h"
27 #include "mitkIRenderWindowPart.h"
28 
29 #include <mitkWorkbenchUtil.h>
30 
31 #include <mitkDataStorage.h>
32 #include <mitkRenderingManager.h>
34 
35 #include <QItemSelectionModel>
36 
37 namespace mitk {
38  class DataNode;
39 }
40 
41 namespace berry {
42  struct IBerryPreferences;
43 }
44 
45 class QmitkAbstractViewPrivate;
46 class QmitkAbstractViewSelectionProvider;
47 
96 {
97 
98 public:
99 
104 
110 
114  ~QmitkAbstractView() override;
115 
116 protected:
117 
124  void FireNodeSelected(mitk::DataNode::Pointer node);
125 
132  virtual void FireNodesSelected(const QList<mitk::DataNode::Pointer>& nodes);
133 
140  QList<mitk::DataNode::Pointer> GetCurrentSelection() const;
141 
148  bool IsCurrentSelectionValid() const;
149 
156  QList<mitk::DataNode::Pointer> GetDataManagerSelection() const;
157 
164  bool IsDataManagerSelectionValid() const;
165 
172  void SetDataManagerSelection(const berry::ISelection::ConstPointer& selection,
173  QItemSelectionModel::SelectionFlags flags = QItemSelectionModel::ClearAndSelect) const;
174 
179  void SynchronizeDataManagerSelection() const;
180 
186  berry::IPreferences::Pointer GetPreferences() const;
187 
191  mitk::IDataStorageReference::Pointer GetDataStorageReference() const;
192 
196  mitk::DataStorage::Pointer GetDataStorage() const;
197 
205  mitk::IRenderWindowPart* GetRenderWindowPart(mitk::WorkbenchUtil::IRenderWindowPartStrategies strategies = mitk::WorkbenchUtil::NONE) const;
206 
212  void RequestRenderWindowUpdate(mitk::RenderingManager::RequestType requestType = mitk::RenderingManager::REQUEST_UPDATE_ALL);
213 
223  void InitializeRenderWindows(const mitk::TimeGeometry *referenceGeometry,
225  bool resetCamera);
226 
235  void HandleException( std::exception& e, QWidget* parent = nullptr, bool showDialog = true ) const;
236 
241  void HandleException( const char* str, QWidget* parent = nullptr, bool showDialog = true ) const;
242 
246  void WaitCursorOn();
247 
251  void WaitCursorOff();
252 
256  void BusyCursorOn();
257 
261  void BusyCursorOff();
262 
266  void RestoreOverrideCursor();
267 
268 private:
269 
277  virtual void SetSelectionProvider();
278 
291  virtual QItemSelectionModel* GetDataNodeSelectionModel() const;
292 
302  virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer> &nodes);
303 
309  virtual void OnNullSelection(berry::IWorkbenchPart::Pointer part);
310 
317  virtual void OnPreferencesChanged(const berry::IBerryPreferences*);
318 
323  virtual void NodeAdded(const mitk::DataNode* node);
324 
329  virtual void NodeChanged(const mitk::DataNode* node);
330 
335  virtual void NodeRemoved(const mitk::DataNode* node);
336 
343  virtual void DataStorageModified();
344 
351  virtual void DataStorageChanged(mitk::IDataStorageReference::Pointer dsRef);
352 
356  void CreatePartControl(QWidget* parent) override;
357 
362  void AfterCreateQtPartControl();
363 
364 private:
365 
366  friend class QmitkAbstractViewPrivate;
367  friend class QmitkViewCoordinator;
368 
369  Q_DISABLE_COPY(QmitkAbstractView)
370 
371  const QScopedPointer<QmitkAbstractViewPrivate> d;
372 
373 };
374 
375 #endif /*QMITKABSTRACTVIEW_H_*/
Interface for a MITK Workbench Part providing a render window.
DataCollection - Class to facilitate loading/accessing structured data.
#define berryObjectMacro(...)
Definition: berryMacros.h:33
A convenient base class for MITK related BlueBerry Views.
#define MITK_QT_COMMON
Class for nodes of the DataTree.
Definition: mitkDataNode.h:57