Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLSceneHierarchyModel.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Kitware Inc.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  This file was originally developed by Julien Finet, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qMRMLSceneHierarchyModel_h
22 #define __qMRMLSceneHierarchyModel_h
23 
24 // MRMLWidgets includes
25 #include "qMRMLSceneModel.h"
26 class qMRMLSceneHierarchyModelPrivate;
27 
28 class QMRML_WIDGETS_EXPORT qMRMLSceneHierarchyModel : public qMRMLSceneModel
29 {
30  Q_OBJECT
38  Q_PROPERTY (int expandColumn READ expandColumn WRITE setExpandColumn)
39 
40 public:
42  qMRMLSceneHierarchyModel(QObject *parent=nullptr);
43  ~qMRMLSceneHierarchyModel() override;
44 
45  int expandColumn()const;
46  void setExpandColumn(int column);
47 
48  Qt::DropActions supportedDropActions()const override;
49 
51  vtkMRMLNode* parentNode(vtkMRMLNode* node)const override;
52  int nodeIndex(vtkMRMLNode* node)const override;
54  bool canBeAChild(vtkMRMLNode* node)const override;
56  bool canBeAParent(vtkMRMLNode* node)const override;
58  bool reparent(vtkMRMLNode* node, vtkMRMLNode* newParent) override;
59 
60 protected:
61  qMRMLSceneHierarchyModel(qMRMLSceneHierarchyModelPrivate* pimpl,
62  QObject *parent=nullptr);
63  QFlags<Qt::ItemFlag> nodeFlags(vtkMRMLNode* node, int column)const override;
64 
65  void observeNode(vtkMRMLNode* node) override;
66 
68  void updateItemDataFromNode(QStandardItem* item, vtkMRMLNode* node, int column) override;
69 
71  void updateNodeFromItemData(vtkMRMLNode* node, QStandardItem* item) override;
72 
74  int maxColumnId()const override;
75 
76 private:
77  Q_DECLARE_PRIVATE(qMRMLSceneHierarchyModel);
78  Q_DISABLE_COPY(qMRMLSceneHierarchyModel);
79 };
80 
81 #endif
virtual int nodeIndex(vtkMRMLNode *node) const
virtual vtkMRMLNode * parentNode(vtkMRMLNode *node) const
virtual bool reparent(vtkMRMLNode *node, vtkMRMLNode *newParent)
virtual void updateItemDataFromNode(QStandardItem *item, vtkMRMLNode *node, int column)
virtual int maxColumnId() const
Must be reimplemented in subclasses that add new column types.
virtual bool canBeAChild(vtkMRMLNode *node) const
fast function that only check the type of the node to know if it can be a child.
virtual bool canBeAParent(vtkMRMLNode *node) const
Qt::DropActions supportedDropActions() const override
virtual QFlags< Qt::ItemFlag > nodeFlags(vtkMRMLNode *node, int column) const
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
virtual void observeNode(vtkMRMLNode *node)
virtual void updateNodeFromItemData(vtkMRMLNode *node, QStandardItem *item)