Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
QmitkRenderWindowDataStorageListModel.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 QmitkRenderWindowDataStorageListModel_h
14 #define QmitkRenderWindowDataStorageListModel_h
15 
16 // render window manager UI model
18 
19 // render window manager module
22 
23 //mitk core
24 #include <mitkBaseRenderer.h>
25 
26 // qt widgets module
28 
29 /*
30 * @brief The 'QmitkDataStorageRenderWindowListModel' is a list model derived from the 'QmitkAbstractDataStorageModel'.
31 */
33 {
34  Q_OBJECT
35 
36 public:
37 
38  QmitkRenderWindowDataStorageListModel(QObject* parent = nullptr);
39 
40  // override from 'QmitkAbstractDataStorageModel'
44  void DataStorageChanged() override;
48  void NodePredicateChanged() override;
52  void NodeAdded(const mitk::DataNode* node) override;
56  void NodeChanged(const mitk::DataNode* node) override;
60  void NodeRemoved(const mitk::DataNode* node) override;
61 
62  // override from 'QAbstractItemModel'
63  QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
64  QModelIndex parent(const QModelIndex& child) const override;
65 
66  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
67  int columnCount(const QModelIndex& parent = QModelIndex()) const override;
68 
69  QVariant data(const QModelIndex& index, int role) const override;
70  bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
71 
72  Qt::ItemFlags flags(const QModelIndex& index) const override;
73 
74  Qt::DropActions supportedDropActions() const override;
75  Qt::DropActions supportedDragActions() const override;
76  QStringList mimeTypes() const override;
77  QMimeData* mimeData(const QModelIndexList& indexes) const override;
78 
79  bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) override;
80 
81  void SetControlledRenderer(mitk::RenderWindowLayerUtilities::RendererVector controlledRenderer);
82 
83  void SetCurrentRenderer(mitk::BaseRenderer* baseRenderer);
84  mitk::BaseRenderer::Pointer GetCurrentRenderer() const;
85 
92  void AddDataNodeToAllRenderer(mitk::DataNode* dataNode);
93 
94 private:
95 
96  void UpdateModelData();
97 
98  std::unique_ptr<mitk::RenderWindowLayerController> m_RenderWindowLayerController;
101 
102 };
103 
104 #endif
QmitkAbstractDataStorageModel::DataStorageChanged
virtual void DataStorageChanged()=0
MitkRenderWindowManagerUIExports.h
itk::SmartPointer< Self >
mitk::RenderWindowLayerUtilities::RendererVector
std::vector< BaseRenderer * > RendererVector
Definition: mitkRenderWindowLayerUtilities.h:32
MITKRENDERWINDOWMANAGERUI_EXPORT
#define MITKRENDERWINDOWMANAGERUI_EXPORT
Definition: MitkRenderWindowManagerUIExports.h:15
QmitkAbstractDataStorageModel::NodeRemoved
virtual void NodeRemoved(const mitk::DataNode *node)=0
QmitkAbstractDataStorageModel::NodeChanged
virtual void NodeChanged(const mitk::DataNode *node)=0
mitk::RenderWindowLayerUtilities::LayerStack
std::map< int, DataNode::Pointer, std::greater< int > > LayerStack
Definition: mitkRenderWindowLayerUtilities.h:33
QmitkAbstractDataStorageModel.h
QmitkAbstractDataStorageModel::NodeAdded
virtual void NodeAdded(const mitk::DataNode *node)=0
mitk::BaseRenderer
Definition: mitkBaseRenderer.h:55
mitkRenderWindowLayerController.h
QmitkRenderWindowDataStorageListModel
Definition: QmitkRenderWindowDataStorageListModel.h:32
mitkBaseRenderer.h
mitk::WeakPointer< mitk::BaseRenderer >
QmitkAbstractDataStorageModel
Definition: QmitkAbstractDataStorageModel.h:40
mitk::DataNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63
mitkRenderWindowLayerUtilities.h
QmitkAbstractDataStorageModel::NodePredicateChanged
virtual void NodePredicateChanged()=0