Medical Imaging Interaction Toolkit  2026.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 
39 {
40  Q_OBJECT
41 
42 public:
43 
44  QmitkRenderWindowDataNodeTableModel(QObject* parent = nullptr);
45 
48 
53  void SetDataStorage(mitk::DataStorage* dataStorage);
60  mitk::BaseRenderer::Pointer GetCurrentRenderer() const;
61 
63  using NodeList = QList<mitk::DataNode::Pointer>;
68  void SetCurrentSelection(NodeList selectedNodes);
71 
72  // override from 'QAbstractItemModel'
73  QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
74  QModelIndex parent(const QModelIndex& child) const override;
75 
76  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
77  int columnCount(const QModelIndex& parent = QModelIndex()) const override;
78 
79  QVariant data(const QModelIndex& index, int role) const override;
80  bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
81 
82  Qt::ItemFlags flags(const QModelIndex& index) const override;
83 
84  Qt::DropActions supportedDropActions() const override;
85  Qt::DropActions supportedDragActions() const override;
86  QStringList mimeTypes() const override;
87  QMimeData* mimeData(const QModelIndexList& indexes) const override;
88 
89  void moveNodesLayer(QSet<mitk::DataNode*> movedNodes, int targetLayer);
90  bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) override;
91 
92 Q_SIGNALS:
93 
94  void ModelUpdated();
95  void NodesLayerMoved(QSet<mitk::DataNode*> nodes, int layer);
96 
97 private:
98 
99  std::unique_ptr<mitk::RenderWindowLayerController> m_RenderWindowLayerController;
101  NodeList m_CurrentSelection;
102 
103  QIcon m_VisibleIcon;
104  QIcon m_InvisibleIcon;
105  QIcon m_ArrowIcon;
106  QIcon m_TimesIcon;
107 };
108 
109 #endif
#define MITKQTWIDGETS_EXPORT
Table model that manages data nodes for a specific render window.
QmitkRenderWindowDataNodeTableModel(QObject *parent=nullptr)
Qt::DropActions supportedDropActions() const override
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
QVariant data(const QModelIndex &index, int role) const override
QModelIndex parent(const QModelIndex &child) const override
QList< mitk::DataNode::Pointer > NodeList
Convenience type alias for a list of data node pointers.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
void NodesLayerMoved(QSet< mitk::DataNode * > nodes, int layer)
void SetDataStorage(mitk::DataStorage *dataStorage)
Sets the data storage to use.
Qt::DropActions supportedDragActions() const override
mitk::BaseRenderer::Pointer GetCurrentRenderer() const
Returns the current renderer.
QMimeData * mimeData(const QModelIndexList &indexes) const override
void SetCurrentSelection(NodeList selectedNodes)
Sets the current selection of data nodes.
Qt::ItemFlags flags(const QModelIndex &index) const override
void moveNodesLayer(QSet< mitk::DataNode * > movedNodes, int targetLayer)
void SetCurrentRenderer(mitk::BaseRenderer *baseRenderer)
Sets the current renderer whose layer stack is displayed.
NodeList GetCurrentSelection() const
Returns the currently selected data nodes.
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
QStringList mimeTypes() const override
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
int columnCount(const QModelIndex &parent=QModelIndex()) const override
void UpdateModelData()
Updates the model data from the data storage for the current renderer.
Organizes the rendering process.
Abstract data management class that organizes DataNode objects in a directed acyclic graph.