Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
35class qSlicerSubjectHierarchyFolderPluginPrivate;
36
38
53class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_EXPORT qSlicerSubjectHierarchyFolderPlugin : public qSlicerSubjectHierarchyAbstractPlugin
54{
55public:
56 Q_OBJECT
57 QVTK_OBJECT
58
59public:
61 qSlicerSubjectHierarchyFolderPlugin(QObject* parent = nullptr);
63
64public:
73 vtkMRMLNode* node,
74 vtkIdType parentItemID=vtkMRMLSubjectHierarchyNode::INVALID_ITEM_ID )const override;
75
77 bool addNodeToSubjectHierarchy(vtkMRMLNode* node, vtkIdType parentItemID) override;
78
85 double canOwnSubjectHierarchyItem(vtkIdType itemID)const override;
86
89 Q_INVOKABLE const QString roleForPlugin()const override;
90
93 QIcon icon(vtkIdType itemID) override;
94
96 QIcon visibilityIcon(int visible) override;
97
99 void editProperties(vtkIdType itemID) override;
100
102 void setDisplayVisibility(vtkIdType itemID, int visible) override;
103
106 int getDisplayVisibility(vtkIdType itemID)const override;
107
113 void setDisplayColor(vtkIdType itemID, QColor color, QMap<int, QVariant> terminologyMetaData) override;
114
118 QColor getDisplayColor(vtkIdType itemID, QMap<int, QVariant> &terminologyMetaData)const override;
119
122
127
130 void showContextMenuActionsForItem(vtkIdType itemID) override;
131
135
138 void showVisibilityContextMenuActionsForItem(vtkIdType itemID) override;
139
140public:
143 Q_INVOKABLE vtkIdType createFolderUnderItem(vtkIdType parentItemID);
144
146 Q_INVOKABLE QString colorItemAttributeName()const { return "Color"; };
147
151
155
156protected slots:
159
162
165
168
169protected:
173 vtkMRMLDisplayNode* displayNodeForItem(vtkIdType itemID)const;
174
176 bool isApplyColorToBranchEnabledForItem(vtkIdType itemID)const;
178 void setApplyColorToBranchEnabledForItem(vtkIdType itemID, bool enabled);
179
183
184protected:
185 QScopedPointer<qSlicerSubjectHierarchyFolderPluginPrivate> d_ptr;
186
187private:
188 Q_DECLARE_PRIVATE(qSlicerSubjectHierarchyFolderPlugin);
190};
191
192#endif
qSlicerSubjectHierarchyAbstractPlugin(QObject *parent=nullptr)
void onShowEmptyFoldersToggled(bool)
Toggle empty folder visibility (.
bool addNodeToSubjectHierarchy(vtkMRMLNode *node, vtkIdType parentItemID) override
Make sure a folder display node that is added externally shows up in the hierarchy.
void showVisibilityContextMenuActionsForItem(vtkIdType itemID) override
QList< QAction * > visibilityContextMenuActions() const override
void showContextMenuActionsForItem(vtkIdType itemID) override
Q_INVOKABLE vtkIdType createFolderUnderItem(vtkIdType parentItemID)
QIcon visibilityIcon(int visible) override
Get visibility icon for a visibility state.
double canOwnSubjectHierarchyItem(vtkIdType itemID) const override
Q_INVOKABLE QString colorItemAttributeName() const
Name of color attribute in folder subject hierarchy items.
void editProperties(vtkIdType itemID) override
Open module belonging to item and set inputs in opened module.
QIcon icon(vtkIdType itemID) override
vtkMRMLDisplayNode * createDisplayNodeForItem(vtkIdType itemID)
int getDisplayVisibility(vtkIdType itemID) const override
vtkMRMLDisplayNode * displayNodeForItem(vtkIdType itemID) const
QList< QAction * > sceneContextMenuActions() const override
void createFolderUnderScene()
Create folder node under the scene.
void emptyFolderCreatedFromTreeView(qMRMLSubjectHierarchyTreeView *treeView)
QScopedPointer< qSlicerSubjectHierarchyFolderPluginPrivate > d_ptr
QColor getDisplayColor(vtkIdType itemID, QMap< int, QVariant > &terminologyMetaData) const override
void createFolderUnderCurrentNode()
Create folder node under current node.
void setDisplayColor(vtkIdType itemID, QColor color, QMap< int, QVariant > terminologyMetaData) override
qSlicerSubjectHierarchyFolderPlugin(QObject *parent=nullptr)
qSlicerSubjectHierarchyAbstractPlugin Superclass
bool isApplyColorToBranchEnabledForItem(vtkIdType itemID) const
Determine if apply color to branch option is enabled to a given item or not.
void onApplyColorToBranchToggled(bool)
Toggle apply color to branch.
QList< QAction * > itemContextMenuActions() const override
Get item context menu item actions to add to tree view.
void setApplyColorToBranchEnabledForItem(vtkIdType itemID, bool enabled)
Determine if apply color to branch option is enabled to a given item or not.
Q_INVOKABLE const QString roleForPlugin() const override
void setDisplayVisibility(vtkIdType itemID, int visible) override
Set display visibility of an owned subject hierarchy item.
double canAddNodeToSubjectHierarchy(vtkMRMLNode *node, vtkIdType parentItemID=vtkMRMLSubjectHierarchyNode::INVALID_ITEM_ID) const override
Abstract class that contains graphical display properties for displayable nodes.
Abstract Superclass for all specific types of MRML nodes.