Slicer  4.8
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=0);
43  virtual ~qMRMLSceneHierarchyModel();
44 
45  int expandColumn()const;
46  void setExpandColumn(int column);
47 
48  virtual Qt::DropActions supportedDropActions()const;
49 
51  virtual vtkMRMLNode* parentNode(vtkMRMLNode* node)const;
52  virtual int nodeIndex(vtkMRMLNode* node)const;
54  virtual bool canBeAChild(vtkMRMLNode* node)const;
56  virtual bool canBeAParent(vtkMRMLNode* node)const;
58  virtual bool reparent(vtkMRMLNode* node, vtkMRMLNode* newParent);
59 
60 protected:
61  qMRMLSceneHierarchyModel(qMRMLSceneHierarchyModelPrivate* pimpl,
62  QObject *parent=0);
63  virtual QFlags<Qt::ItemFlag> nodeFlags(vtkMRMLNode* node, int column)const;
64 
65  virtual void observeNode(vtkMRMLNode* node);
66 
68  void updateItemDataFromNode(QStandardItem* item, vtkMRMLNode* node, int column);
69 
71  void updateNodeFromItemData(vtkMRMLNode* node, QStandardItem* item);
72 
74  virtual int maxColumnId()const;
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 Qt::DropActions supportedDropActions() const
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
virtual QFlags< Qt::ItemFlag > nodeFlags(vtkMRMLNode *node, int column) const
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135
virtual void observeNode(vtkMRMLNode *node)
virtual void updateNodeFromItemData(vtkMRMLNode *node, QStandardItem *item)