Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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"
26class qMRMLSceneHierarchyModelPrivate;
27
28class QMRML_WIDGETS_EXPORT qMRMLSceneHierarchyModel : public qMRMLSceneModel
29{
30 Q_OBJECT
38 Q_PROPERTY (int expandColumn READ expandColumn WRITE setExpandColumn)
39
40public:
42 qMRMLSceneHierarchyModel(QObject *parent=nullptr);
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
60protected:
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
76private:
77 Q_DECLARE_PRIVATE(qMRMLSceneHierarchyModel);
78 Q_DISABLE_COPY(qMRMLSceneHierarchyModel);
79};
80
81#endif
void observeNode(vtkMRMLNode *node) override
void setExpandColumn(int column)
qMRMLSceneHierarchyModel(qMRMLSceneHierarchyModelPrivate *pimpl, QObject *parent=nullptr)
bool canBeAParent(vtkMRMLNode *node) const override
fast function that only check the type of the node to know if it can be a parent.
~qMRMLSceneHierarchyModel() override
void updateNodeFromItemData(vtkMRMLNode *node, QStandardItem *item) override
Reimplemented to add expandColumn support.
Qt::DropActions supportedDropActions() const override
int nodeIndex(vtkMRMLNode *node) const override
void updateItemDataFromNode(QStandardItem *item, vtkMRMLNode *node, int column) override
Reimplemented to add expandColumn support.
bool canBeAChild(vtkMRMLNode *node) const override
fast function that only check the type of the node to know if it can be a child.
int maxColumnId() const override
Must be reimplemented in subclasses that add new column types.
QFlags< Qt::ItemFlag > nodeFlags(vtkMRMLNode *node, int column) const override
vtkMRMLNode * parentNode(vtkMRMLNode *node) const override
bool reparent(vtkMRMLNode *node, vtkMRMLNode *newParent) override
if newParent == 0, set the node into the vtkMRMLScene
qMRMLSceneHierarchyModel(QObject *parent=nullptr)
qMRMLSceneModel(QObject *parent=nullptr)
Abstract Superclass for all specific types of MRML nodes.