Slicer  4.8
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=0);
47  virtual ~qMRMLSceneDisplayableModel();
48 
49  int colorColumn()const;
50  void setColorColumn(int column);
51 
52  int opacityColumn()const;
53  void setOpacityColumn(int column);
54 
56  virtual vtkMRMLNode* parentNode(vtkMRMLNode* node)const;
57  //virtual int nodeIndex(vtkMRMLNode* node)const;
59  virtual bool canBeAChild(vtkMRMLNode* node)const;
61  virtual bool canBeAParent(vtkMRMLNode* node)const;
62 
63 protected:
64  qMRMLSceneDisplayableModel(qMRMLSceneDisplayableModelPrivate* pimpl,
65  QObject *parent=0);
66 
69  virtual void observeNode(vtkMRMLNode* node);
70  virtual QFlags<Qt::ItemFlag> nodeFlags(vtkMRMLNode* node, int column)const;
71  virtual void updateItemDataFromNode(QStandardItem* item, vtkMRMLNode* node, int column);
72  virtual void updateNodeFromItemData(vtkMRMLNode* node, QStandardItem* item);
73 
74  virtual int maxColumnId()const;
75 private:
76  Q_DECLARE_PRIVATE(qMRMLSceneDisplayableModel);
77  Q_DISABLE_COPY(qMRMLSceneDisplayableModel);
78 };
79 
80 #endif
virtual bool canBeAParent(vtkMRMLNode *node) const
fast function that only check the type of the node to know if it can be a parent. ...
qMRMLSceneHierarchyModel Superclass
virtual bool canBeAChild(vtkMRMLNode *node) const
fast function that only check the type of the node to know if it can be a child.
void updateItemDataFromNode(QStandardItem *item, vtkMRMLNode *node, int column)
Reimplemented to add expandColumn support.
virtual int maxColumnId() const
Must be reimplemented in subclasses that add new column types.
The Visibility icon is in the same column than the name by default.
virtual QFlags< Qt::ItemFlag > nodeFlags(vtkMRMLNode *node, int column) const
void updateNodeFromItemData(vtkMRMLNode *node, QStandardItem *item)
Reimplemented to add expandColumn support.
virtual vtkMRMLNode * parentNode(vtkMRMLNode *node) const
virtual void observeNode(vtkMRMLNode *node)
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135