Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerSubjectHierarchyPluginLogic.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
6  Queen's University, Kingston, ON, Canada. All Rights Reserved.
7 
8  See COPYRIGHT.txt
9  or http://www.slicer.org/copyright/copyright.txt for details.
10 
11  Unless required by applicable law or agreed to in writing, software
12  distributed under the License is distributed on an "AS IS" BASIS,
13  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  See the License for the specific language governing permissions and
15  limitations under the License.
16 
17  This file was originally developed by Csaba Pinter, PerkLab, Queen's University
18  and was supported through the Applied Cancer Research Unit program of Cancer Care
19  Ontario with funds provided by the Ontario Ministry of Health and Long-Term Care
20 
21 ==============================================================================*/
22 
23 #ifndef __qSlicerSubjectHierarchyPluginLogic_h
24 #define __qSlicerSubjectHierarchyPluginLogic_h
25 
26 // SlicerQt includes
27 #include "qSlicerObject.h"
28 
29 // CTK includes
30 #include <ctkVTKObject.h>
31 
32 // Qt includes
33 #include <QObject>
34 
35 // MRML includes
36 #include <vtkMRMLScene.h>
38 
39 #include "qSlicerSubjectHierarchyModuleWidgetsExport.h"
40 
41 class qSlicerSubjectHierarchyPluginLogicPrivate;
43 
47 class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_EXPORT qSlicerSubjectHierarchyPluginLogic :
48  public QObject, public virtual qSlicerObject
49 {
50  Q_OBJECT
51  QVTK_OBJECT
52 
53 public:
54  typedef QObject Superclass;
55  qSlicerSubjectHierarchyPluginLogic(QObject *parent=0);
57 
58 public:
60  virtual void setMRMLScene(vtkMRMLScene* scene);
61 
63  Q_INVOKABLE qSlicerSubjectHierarchyAbstractPlugin* subjectHierarchyPluginByName(QString name)const;
64 
66  Q_INVOKABLE vtkIdType currentSubjectHierarchyItem()const;
67 
70  Q_INVOKABLE void setCurrentSubjectHierarchyItem(vtkIdType itemID);
71 
75  void registerCorePlugins();
76 
77 protected:
79  void observeNode(vtkMRMLNode* node);
80 
85  void addSupportedDataNodesToSubjectHierarchy();
86 
87 protected slots:
89  void onNodeAdded(vtkObject* scene, vtkObject* nodeObject);
92  void onNodeAboutToBeRemoved(vtkObject* scene, vtkObject* nodeObject);
95  void onNodeRemoved(vtkObject* scene, vtkObject* nodeObject);
99  void onSceneImportEnded(vtkObject* sceneObject);
101  void onSceneCloseEnded(vtkObject* sceneObject);
104  void onSceneRestoreEnded(vtkObject* sceneObject);
105 
106 protected:
107  QScopedPointer<qSlicerSubjectHierarchyPluginLogicPrivate> d_ptr;
108 
109 private:
110  Q_DECLARE_PRIVATE(qSlicerSubjectHierarchyPluginLogic);
111  Q_DISABLE_COPY(qSlicerSubjectHierarchyPluginLogic);
112 };
113 
114 #endif
Abstract plugin for handling Subject Hierarchy items.
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:54
Qt-based logic class to exercise Qt-related logic functions. The Subject hierarchy plugin mechanism a...
QScopedPointer< qSlicerSubjectHierarchyPluginLogicPrivate > d_ptr
virtual void setMRMLScene(vtkMRMLScene *)
Set the current MRML scene to the widget.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135