Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkDataStorageLayerStackModel.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 QmitkDataStorageLayerStackModel_h
14 #define QmitkDataStorageLayerStackModel_h
15 
16 // render window manager UI module
18 
19 // render window manager module
21 
22 // qt widgets module
24 
41 {
42  Q_OBJECT
43 
44 public:
45 
51  QmitkDataStorageLayerStackModel(QObject* parent = nullptr);
52 
56  void DataStorageChanged() override;
57 
61  void NodePredicateChanged() override;
62 
70  void NodeAdded(const mitk::DataNode* node) override;
71 
77  void NodeChanged(const mitk::DataNode* node) override;
78 
84  void NodeRemoved(const mitk::DataNode* node) override;
85 
95  void SetCurrentRenderer(const std::string& rendererName);
96 
103 
112  QModelIndex index(int row, int column, const QModelIndex& parent) const;
113 
120  QModelIndex parent(const QModelIndex& child) const;
121 
130  Qt::ItemFlags flags(const QModelIndex& index) const override;
131 
142  QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
143 
150  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
151 
158  int columnCount(const QModelIndex& parent = QModelIndex()) const override;
159 
174  QVariant data(const QModelIndex& index, int role) const override;
175 
187  bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
188 
189 private:
190 
191  void UpdateModelData();
192 
195 
196 };
197 
198 #endif
#define MITKRENDERWINDOWMANAGERUI_EXPORT
Abstract base class extending QAbstractItemModel for DataStorage-backed models.
Table model that displays the render window layer stack for a specific renderer.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Return the number of columns (always 2: visibility and node name).
void NodeAdded(const mitk::DataNode *node) override
Called when a data node has been added to the data storage.
Qt::ItemFlags flags(const QModelIndex &index) const override
Return item flags for the given index.
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Set data for the given index and role (visibility toggling).
void DataStorageChanged() override
Called when the data storage has been changed. Refreshes the model data.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Return the number of rows (layers) in the model.
QVariant data(const QModelIndex &index, int role) const override
Return data for the given index and role.
QModelIndex parent(const QModelIndex &child) const
Return the parent index (always invalid, since this is a flat table model).
void NodeChanged(const mitk::DataNode *node) override
Called when a data node has been changed. Refreshes the model data.
QmitkDataStorageLayerStackModel(QObject *parent=nullptr)
Construct the layer stack model.
QModelIndex index(int row, int column, const QModelIndex &parent) const
Create a model index for the given row and column.
void NodeRemoved(const mitk::DataNode *node) override
Called when a data node has been removed from the data storage. Refreshes the model data.
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Return header data for the table.
mitk::BaseRenderer * GetCurrentRenderer() const
Get the currently active base renderer.
void NodePredicateChanged() override
Called when the node predicate has been changed. Refreshes the model data.
void SetCurrentRenderer(const std::string &rendererName)
Set the current renderer by its name and refresh the layer stack.
Organizes the rendering process.
Central node class of the MITK data tree, associating a data object with properties and mappers.
Definition: mitkDataNode.h:72
std::map< int, DataNode::Pointer, std::greater< int > > LayerStack