Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
QmitkRenderWindowDataNodeTableModel.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 QmitkRenderWindowDataNodeTableModel_h
14 #define QmitkRenderWindowDataNodeTableModel_h
15 
16 #include <MitkQtWidgetsExports.h>
17 
18 //mitk core
19 #include <mitkBaseRenderer.h>
20 #include <mitkBaseProperty.h>
21 #include <mitkDataStorage.h>
22 #include <mitkWeakPointer.h>
23 
24 // qt widgets module
28 
29 #include <QIcon>
30 
31 /*
32 * @brief The 'QmitkRenderWindowDataNodeTableModel' is a table model that extends the 'QAbstractItemModel'.
33 */
35 {
36  Q_OBJECT
37 
38 public:
39 
40  QmitkRenderWindowDataNodeTableModel(QObject* parent = nullptr);
41 
42  void UpdateModelData();
43 
44  void SetDataStorage(mitk::DataStorage* dataStorage);
45  void SetCurrentRenderer(mitk::BaseRenderer* baseRenderer);
46  mitk::BaseRenderer::Pointer GetCurrentRenderer() const;
47 
48  using NodeList = QList<mitk::DataNode::Pointer>;
49  void SetCurrentSelection(NodeList selectedNodes);
50  NodeList GetCurrentSelection() const;
51 
52  // override from 'QAbstractItemModel'
53  QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
54  QModelIndex parent(const QModelIndex& child) const override;
55 
56  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
57  int columnCount(const QModelIndex& parent = QModelIndex()) const override;
58 
59  QVariant data(const QModelIndex& index, int role) const override;
60  bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
61 
62  Qt::ItemFlags flags(const QModelIndex& index) const override;
63 
64  Qt::DropActions supportedDropActions() const override;
65  Qt::DropActions supportedDragActions() const override;
66  QStringList mimeTypes() const override;
67  QMimeData* mimeData(const QModelIndexList& indexes) const override;
68 
69  bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) override;
70 
71 Q_SIGNALS:
72 
73  void ModelUpdated();
74 
75 private:
76 
77  std::unique_ptr<mitk::RenderWindowLayerController> m_RenderWindowLayerController;
79  NodeList m_CurrentSelection;
80 
81  QIcon m_VisibleIcon;
82  QIcon m_InvisibleIcon;
83  QIcon m_ArrowIcon;
84  QIcon m_TimesIcon;
85 };
86 
87 #endif
QmitkRenderWindowDataNodeTableModel::NodeList
QList< mitk::DataNode::Pointer > NodeList
Definition: QmitkRenderWindowDataNodeTableModel.h:48
MITKQTWIDGETS_EXPORT
#define MITKQTWIDGETS_EXPORT
Definition: MitkQtWidgetsExports.h:15
mitkDataStorage.h
itk::SmartPointer< Self >
QmitkRenderWindowDataNodeTableModel
Definition: QmitkRenderWindowDataNodeTableModel.h:34
QmitkAbstractDataStorageModel.h
MitkQtWidgetsExports.h
mitk::DataStorage
Data management class that handles 'was created by' relations.
Definition: mitkDataStorage.h:43
mitkWeakPointer.h
mitk::BaseRenderer
Definition: mitkBaseRenderer.h:56
mitkRenderWindowLayerController.h
mitkBaseRenderer.h
mitk::WeakPointer< mitk::BaseRenderer >
mitkBaseProperty.h
mitkRenderWindowLayerUtilities.h