Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
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
26 class qMRMLSceneDisplayableModelPrivate;
27 
29 class QMRML_WIDGETS_EXPORT qMRMLSceneDisplayableModel : public qMRMLSceneHierarchyModel
30 {
31  Q_OBJECT
38  Q_PROPERTY (int colorColumn READ colorColumn WRITE setColorColumn)
39 
40 
41  Q_PROPERTY (int opacityColumn READ opacityColumn WRITE setOpacityColumn)
43 
44 public:
46  qMRMLSceneDisplayableModel(QObject *parent=nullptr);
47  ~qMRMLSceneDisplayableModel() override;
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 
63 protected:
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;
75 private:
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.
void updateNodeFromItemData(vtkMRMLNode *node, QStandardItem *item) override
Reimplemented to add expandColumn support.
qMRMLSceneHierarchyModel Superclass
int maxColumnId() const override
Must be reimplemented in subclasses that add new column types.
bool canBeAParent(vtkMRMLNode *node) const override
fast function that only check the type of the node to know if it can be a parent. ...
The Visibility icon is in the same column than the name by default.
void updateItemDataFromNode(QStandardItem *item, vtkMRMLNode *node, int column) override
Reimplemented to add expandColumn support.
void observeNode(vtkMRMLNode *node) override
vtkMRMLNode * parentNode(vtkMRMLNode *node) const override
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
QFlags< Qt::ItemFlag > nodeFlags(vtkMRMLNode *node, int column) const override