Slicer  5.1
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=nullptr);
51  ~qMRMLAnnotationTreeView() override;
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) override;
81  bool viewportEvent(QEvent* e) override;
82 #endif
83  void mousePressEvent(QMouseEvent* event) override;
84 
85  void toggleVisibility(const QModelIndex& index) override;
86 
91  void onSelectionChanged(const QItemSelection & selected,
92  const QItemSelection & deselected) override;
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 toggleVisibility(const QModelIndex &index)
QScopedPointer< qMRMLAnnotationTreeViewPrivate > d_ptr
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57
void mousePressEvent(QMouseEvent *event) override
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
virtual void onSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)