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
qMRMLSceneDisplayableModel.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 __qMRMLSceneDisplayableModel_h
22#define __qMRMLSceneDisplayableModel_h
23
24// MRMLWidgets includes
26class qMRMLSceneDisplayableModelPrivate;
27
29class QMRML_WIDGETS_EXPORT qMRMLSceneDisplayableModel : public qMRMLSceneHierarchyModel
30{
31 Q_OBJECT
38 Q_PROPERTY (int colorColumn READ colorColumn WRITE setColorColumn)
39
40
42 Q_PROPERTY (int opacityColumn READ opacityColumn WRITE setOpacityColumn)
43
44public:
46 qMRMLSceneDisplayableModel(QObject *parent=nullptr);
48
49 int colorColumn()const;
50 void setColorColumn(int column);
51
52 int opacityColumn()const;
53 void setOpacityColumn(int column);
54
56 vtkMRMLNode* parentNode(vtkMRMLNode* node)const override;
57 //virtual int nodeIndex(vtkMRMLNode* node)const;
59 bool canBeAChild(vtkMRMLNode* node)const override;
61 bool canBeAParent(vtkMRMLNode* node)const override;
62
63protected:
64 qMRMLSceneDisplayableModel(qMRMLSceneDisplayableModelPrivate* pimpl,
65 QObject *parent=nullptr);
66
69 void observeNode(vtkMRMLNode* node) override;
70 QFlags<Qt::ItemFlag> nodeFlags(vtkMRMLNode* node, int column)const override;
71 void updateItemDataFromNode(QStandardItem* item, vtkMRMLNode* node, int column) override;
72 void updateNodeFromItemData(vtkMRMLNode* node, QStandardItem* item) override;
73
74 int maxColumnId()const override;
75private:
76 Q_DECLARE_PRIVATE(qMRMLSceneDisplayableModel);
77 Q_DISABLE_COPY(qMRMLSceneDisplayableModel);
78};
79
80#endif
bool canBeAChild(vtkMRMLNode *node) const override
fast function that only check the type of the node to know if it can be a child.
vtkMRMLNode * parentNode(vtkMRMLNode *node) const override
void observeNode(vtkMRMLNode *node) override
void setOpacityColumn(int column)
void setColorColumn(int column)
int maxColumnId() const override
Must be reimplemented in subclasses that add new column types.
QFlags< Qt::ItemFlag > nodeFlags(vtkMRMLNode *node, int column) const override
void updateItemDataFromNode(QStandardItem *item, vtkMRMLNode *node, int column) override
qMRMLSceneHierarchyModel Superclass
bool canBeAParent(vtkMRMLNode *node) const override
fast function that only check the type of the node to know if it can be a parent.
qMRMLSceneDisplayableModel(QObject *parent=nullptr)
void updateNodeFromItemData(vtkMRMLNode *node, QStandardItem *item) override
qMRMLSceneHierarchyModel(QObject *parent=nullptr)
Abstract Superclass for all specific types of MRML nodes.