Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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:
72 double canAddNodeToSubjectHierarchy(vtkMRMLNode* node, vtkIdType parentItemID = vtkMRMLSubjectHierarchyNode::INVALID_ITEM_ID) const override;
73
75 bool addNodeToSubjectHierarchy(vtkMRMLNode* node, vtkIdType parentItemID) override;
76
83 double canOwnSubjectHierarchyItem(vtkIdType itemID) const override;
84
87 Q_INVOKABLE const QString roleForPlugin() const override;
88
91 QIcon icon(vtkIdType itemID) override;
92
94 QIcon visibilityIcon(int visible) override;
95
97 void editProperties(vtkIdType itemID) override;
98
100 void setDisplayVisibility(vtkIdType itemID, int visible) override;
101
104 int getDisplayVisibility(vtkIdType itemID) const override;
105
111 void setDisplayColor(vtkIdType itemID, QColor color, QMap<int, QVariant> terminologyMetaData) override;
112
116 QColor getDisplayColor(vtkIdType itemID, QMap<int, QVariant>& terminologyMetaData) const override;
117
120
125
128 void showContextMenuActionsForItem(vtkIdType itemID) override;
129
133
136 void showVisibilityContextMenuActionsForItem(vtkIdType itemID) override;
137
138public:
141 Q_INVOKABLE vtkIdType createFolderUnderItem(vtkIdType parentItemID);
142
144 Q_INVOKABLE QString colorItemAttributeName() const { return "Color"; };
145
149
153
154protected slots:
157
160
163
166
167protected:
171 vtkMRMLDisplayNode* displayNodeForItem(vtkIdType itemID) const;
172
174 bool isApplyColorToBranchEnabledForItem(vtkIdType itemID) const;
176 void setApplyColorToBranchEnabledForItem(vtkIdType itemID, bool enabled);
177
181
182protected:
183 QScopedPointer<qSlicerSubjectHierarchyFolderPluginPrivate> d_ptr;
184
185private:
186 Q_DECLARE_PRIVATE(qSlicerSubjectHierarchyFolderPlugin);
188};
189
190#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.