Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLSceneAnnotationModel.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 __qMRMLSceneAnnotationModel_h
22 #define __qMRMLSceneAnnotationModel_h
23 
24 // qMRML includes
26 
27 // Annotations includes
28 #include "qSlicerAnnotationsModuleWidgetsExport.h"
29 class qMRMLSceneAnnotationModelPrivate;
30 
31 // Logic includes
33 
34 // MRML includes
35 class vtkMRMLNode;
36 
39 class Q_SLICER_MODULE_ANNOTATIONS_WIDGETS_EXPORT qMRMLSceneAnnotationModel
41 {
42  Q_OBJECT
48  Q_PROPERTY(bool annotationsAreParent READ areAnnotationsParent WRITE setAnnotationsAreParent)
49 
50 
51  Q_PROPERTY (int lockColumn READ lockColumn WRITE setLockColumn)
62  Q_PROPERTY (int editColumn READ editColumn WRITE setEditColumn)
68  Q_PROPERTY (int valueColumn READ valueColumn WRITE setValueColumn)
74  Q_PROPERTY (int textColumn READ textColumn WRITE setTextColumn)
75 
76 public:
78  qMRMLSceneAnnotationModel(QObject *parent=0);
79  virtual ~qMRMLSceneAnnotationModel();
80 
81  // Register the logic
82  void setLogic(vtkSlicerAnnotationModuleLogic* logic);
83 
86  bool areAnnotationsParent()const;
89  void setAnnotationsAreParent(bool parentable);
90 
93  int lockColumn()const;
96  void setLockColumn(int column);
97 
100  int editColumn()const;
103  void setEditColumn(int column);
104 
107  int valueColumn()const;
110  void setValueColumn(int column);
111 
114  int textColumn()const;
117  void setTextColumn(int column);
118 
124  virtual vtkMRMLNode* activeHierarchyNode(vtkMRMLNode* mrmlNode)const;
125  virtual vtkMRMLNode* parentNode(vtkMRMLNode* node)const;
126  virtual bool canBeAParent(vtkMRMLNode* node)const;
127 
128 protected:
129  qMRMLSceneAnnotationModel(qMRMLSceneAnnotationModelPrivate* pimpl,
130  QObject *parent=0);
131 
132  virtual void updateItemDataFromNode(QStandardItem* item, vtkMRMLNode* node, int column);
133 
134  virtual void updateNodeFromItemData(vtkMRMLNode* node, QStandardItem* item);
135 
136  virtual QFlags<Qt::ItemFlag> nodeFlags(vtkMRMLNode* node, int column)const;
137  virtual int maxColumnId()const;
138 
139 private:
140  Q_DECLARE_PRIVATE(qMRMLSceneAnnotationModel);
141  Q_DISABLE_COPY(qMRMLSceneAnnotationModel);
142 };
143 
144 #endif
The Visibility icon is in the same column than the name by default.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135