Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLAnnotationTreeView.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 __qMRMLAnnotationTreeView_h
22 #define __qMRMLAnnotationTreeView_h
23 
24 // qMRML includes
25 #include "qMRMLTreeView.h"
26 
27 // Annotations includes
28 #include "qSlicerAnnotationsModuleWidgetsExport.h"
29 class qMRMLAnnotationTreeViewPrivate;
31 
32 // Logic includes
34 
35 // MRML includes
36 class vtkMRMLNode;
37 class vtkMRMLScene;
38 
39 // VTK includes
40 class vtkCollection;
41 
43 class Q_SLICER_MODULE_ANNOTATIONS_WIDGETS_EXPORT qMRMLAnnotationTreeView
44  : public qMRMLTreeView
45 {
46  Q_OBJECT
47 
48 public:
50  qMRMLAnnotationTreeView(QWidget *parent=0);
51  virtual ~qMRMLAnnotationTreeView();
52 
53  void hideScene();
54 
55  const char* firstSelectedNode();
56 
57  // Register the logic
58  void setLogic(vtkSlicerAnnotationModuleLogic* logic);
59 
60 
61  void toggleLockForSelected();
62 
63  void toggleVisibilityForSelected();
64 
65  void deleteSelected();
66 
67  void selectedAsCollection(vtkCollection* collection);
68 
69  qMRMLSceneAnnotationModel* annotationModel()const;
70 
71 signals:
72  void onPropertyEditButtonClicked(QString id);
73 
74 protected slots:
75  void onClicked(const QModelIndex& index);
76 
77 protected:
78  QScopedPointer<qMRMLAnnotationTreeViewPrivate> d_ptr;
79 #ifndef QT_NO_CURSOR
80  void mouseMoveEvent(QMouseEvent* e);
81  bool viewportEvent(QEvent* e);
82 #endif
83  virtual void mousePressEvent(QMouseEvent* event);
84 
85  virtual void toggleVisibility(const QModelIndex& index);
86 
91  virtual void onSelectionChanged(const QItemSelection & selected,
92  const QItemSelection & deselected);
93 
94 private:
95  Q_DECLARE_PRIVATE(qMRMLAnnotationTreeView);
96  Q_DISABLE_COPY(qMRMLAnnotationTreeView);
97 
99 
100  // toggle un-/lock of an annotation
101  void onLockColumnClicked(vtkMRMLNode* node);
102 
103 };
104 
105 #endif
virtual void mousePressEvent(QMouseEvent *event)
virtual void toggleVisibility(const QModelIndex &index)
QScopedPointer< qMRMLAnnotationTreeViewPrivate > d_ptr
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:54
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135
virtual void onSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)