Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerSubjectHierarchyFolderPlugin.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 __qSlicerSubjectHierarchyFolderPlugin_h
24 #define __qSlicerSubjectHierarchyFolderPlugin_h
25 
26 // SubjectHierarchy Plugins includes
28 
29 #include "qSlicerSubjectHierarchyModuleWidgetsExport.h"
30 
31 // CTK includes
32 #include <ctkVTKObject.h>
33 
34 // MRML includes
35 #include <vtkMRMLHierarchyNode.h>
36 
37 class qSlicerSubjectHierarchyFolderPluginPrivate;
38 
39 // Due to some reason the Python wrapping of this class fails, therefore
40 // put everything between BTX/ETX to exclude from wrapping.
41 // TODO investigate why the wrapping fails:
42 // https://www.assembla.com/spaces/slicerrt/tickets/210-python-wrapping-error-when-starting-up-slicer-with-slicerrt
43 //BTX
44 
88 class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_EXPORT qSlicerSubjectHierarchyFolderPlugin : public qSlicerSubjectHierarchyAbstractPlugin
89 {
90 public:
91  Q_OBJECT
92  QVTK_OBJECT
93 
94 public:
96  qSlicerSubjectHierarchyFolderPlugin(QObject* parent = NULL);
98 
99 public:
106  virtual double canOwnSubjectHierarchyItem(vtkIdType itemID)const;
107 
110  Q_INVOKABLE virtual const QString roleForPlugin()const;
111 
114  virtual QIcon icon(vtkIdType itemID);
115 
117  virtual QIcon visibilityIcon(int visible);
118 
120  virtual void editProperties(vtkIdType itemID);
121 
124 
129 
132  virtual void showContextMenuActionsForItem(vtkIdType itemID);
133 
134 public:
142  virtual double canAddNodeToSubjectHierarchy(
143  vtkMRMLNode* node,
144  vtkIdType parentItemID=vtkMRMLSubjectHierarchyNode::INVALID_ITEM_ID )const;
145 
151  virtual bool addNodeToSubjectHierarchy(vtkMRMLNode* node, vtkIdType parentItemID);
152 
161  virtual double canReparentItemInsideSubjectHierarchy(vtkIdType itemID, vtkIdType parentItemID)const;
162 
165  virtual bool reparentItemInsideSubjectHierarchy(vtkIdType itemID, vtkIdType parentItemID);
166 
167 public:
170  Q_INVOKABLE vtkIdType createFolderUnderItem(vtkIdType parentItemID);
171 
176  Q_INVOKABLE vtkMRMLHierarchyNode* hierarchyNodeForItem(vtkIdType itemID);
177 
182  Q_INVOKABLE vtkIdType itemForHierarchyNode(vtkMRMLHierarchyNode* hierarchyNode);
183 
186  Q_INVOKABLE bool resolveHierarchyForItem(vtkIdType itemID);
187 
190  Q_INVOKABLE bool resolveHierarchies();
191 
192 public slots:
197  void onDataNodeAssociatedToHierarchyNode(vtkObject* dataNodeObject);
198 
199 protected slots:
201  void createFolderUnderScene();
202 
204  void createFolderUnderCurrentNode();
205 
208  void onHierarchyNodeChildNodeAdded(vtkObject* parentNodeObject, vtkObject* childNodeObject);
209 
210 protected:
211  QScopedPointer<qSlicerSubjectHierarchyFolderPluginPrivate> d_ptr;
212 
213 private:
214  Q_DECLARE_PRIVATE(qSlicerSubjectHierarchyFolderPlugin);
215  Q_DISABLE_COPY(qSlicerSubjectHierarchyFolderPlugin);
216 };
217 
218 //ETX
219 
220 #endif
QScopedPointer< qSlicerSubjectHierarchyFolderPluginPrivate > d_ptr
virtual QIcon icon(vtkIdType itemID)
virtual Q_INVOKABLE const QString roleForPlugin() const
virtual double canAddNodeToSubjectHierarchy(vtkMRMLNode *node, vtkIdType parentItemID=vtkMRMLSubjectHierarchyNode::INVALID_ITEM_ID) const
qSlicerSubjectHierarchyAbstractPlugin Superclass
Abstract plugin for handling Subject Hierarchy items.
virtual Q_INVOKABLE void editProperties(vtkIdType itemID)
Open module belonging to item and set inputs in opened module.
Abstract class representing a hierarchy member.
virtual double canReparentItemInsideSubjectHierarchy(vtkIdType itemID, vtkIdType parentItemID) const
virtual bool addNodeToSubjectHierarchy(vtkMRMLNode *node, vtkIdType parentItemID)
virtual Q_INVOKABLE void showContextMenuActionsForItem(vtkIdType itemID)
virtual Q_INVOKABLE QList< QAction * > sceneContextMenuActions() const
virtual Q_INVOKABLE QIcon visibilityIcon(int visible)
Get visibility icon for a visibility state.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135
virtual Q_INVOKABLE double canOwnSubjectHierarchyItem(vtkIdType itemID) const
virtual bool reparentItemInsideSubjectHierarchy(vtkIdType itemID, vtkIdType parentItemID)
virtual Q_INVOKABLE QList< QAction * > itemContextMenuActions() const