Subject hierarchy folder plugin.
More...
#include <Modules/Loadable/SubjectHierarchy/Widgets/qSlicerSubjectHierarchyFolderPlugin.h>
|
QScopedPointer< qSlicerSubjectHierarchyFolderPluginPrivate > | d_ptr |
|
QString | m_Name |
| Name of the plugin. More...
|
|
Subject hierarchy folder plugin.
- Supports folder items in subject hierarchy
- Supports node hierarchies in subject hierarchy by adding folder items for the intermediate nodes. Handled cases
Scene changes
- Hierarchy node added -> Add folder item ( folderPlugin::addNodeToSubjectHierarchy )
- New parent is set to a hierarchy node (Modified event for both old and new parents) newParent.vtkMRMLHierarchyNode::ChildNodeAddedEvent(hierarchyNode) -> Set parent of item for hierarchy node to item for new parent ( folderPlugin::onMRMLHierarchyNodeChildNodeAdded )
- Scene import ends -> Add each hierarchy node to subject hierarchy and resolve hierarchy on each added item ( addSupportedDataNodesToSubjectHierarchy, folderPlugin::addNodeToSubjectHierarchy, resolveHierarchyForItem )
- Data node is associated to a hierarchy node dataNode.vtkMRMLNode::HierarchyModifiedEvent (Should only happen if building hierarchy programmaticaly from scratch) Remove hierarchy node's item from subject hierarchy ( folderPlugin::onDataNodeAssociatedToHierarchyNode )
Subject hierarchy changes
- Item is reparented under an item with node hierarchy 1a. New parent has associated hierarchy node -> Set parent item's hierarchy node as parent of reparented item's hierarchy node ( folderPlugin::reparentItemInsideSubjectHierarchy ) 1b. Otherwise -> Set scene as parent of reparented item's hierarchy node ( folderPlugin::reparentItemInsideSubjectHierarchy )
Definition at line 88 of file qSlicerSubjectHierarchyFolderPlugin.h.
◆ Superclass
◆ qSlicerSubjectHierarchyFolderPlugin()
qSlicerSubjectHierarchyFolderPlugin::qSlicerSubjectHierarchyFolderPlugin |
( |
QObject * |
parent = NULL | ) |
|
◆ ~qSlicerSubjectHierarchyFolderPlugin()
virtual qSlicerSubjectHierarchyFolderPlugin::~qSlicerSubjectHierarchyFolderPlugin |
( |
| ) |
|
|
virtual |
◆ addNodeToSubjectHierarchy()
virtual bool qSlicerSubjectHierarchyFolderPlugin::addNodeToSubjectHierarchy |
( |
vtkMRMLNode * |
node, |
|
|
vtkIdType |
parentItemID |
|
) |
| |
|
virtual |
◆ canAddNodeToSubjectHierarchy()
Determines if a data node can be placed in the hierarchy using the actual plugin, and gets a confidence value for a certain MRML node (usually the type and possibly attributes are checked).
- Parameters
-
node | Node to be added to the hierarchy |
parentItemID | Prospective parent of the node to add. Default value is invalid. In that case the parent will be ignored, the confidence numbers are got based on the to-be child node alone. |
- Returns
- Floating point confidence number between 0 and 1, where 0 means that the plugin cannot handle the node, and 1 means that the plugin is the only one that can handle the node (by node type or identifier attribute)
Reimplemented from qSlicerSubjectHierarchyAbstractPlugin.
◆ canOwnSubjectHierarchyItem()
virtual double qSlicerSubjectHierarchyFolderPlugin::canOwnSubjectHierarchyItem |
( |
vtkIdType |
itemID | ) |
const |
|
virtual |
Determines if the actual plugin can handle a subject hierarchy item. The plugin with the highest confidence number will "own" the item in the subject hierarchy (set icon, tooltip, set context menu etc.)
- Parameters
-
item | Item to handle in the subject hierarchy tree |
- Returns
- Floating point confidence number between 0 and 1, where 0 means that the plugin cannot handle the item, and 1 means that the plugin is the only one that can handle the item (by node type or identifier attribute)
Reimplemented from qSlicerSubjectHierarchyAbstractPlugin.
◆ canReparentItemInsideSubjectHierarchy()
virtual double qSlicerSubjectHierarchyFolderPlugin::canReparentItemInsideSubjectHierarchy |
( |
vtkIdType |
itemID, |
|
|
vtkIdType |
parentItemID |
|
) |
| const |
|
virtual |
Determines if a subject hierarchy item can be reparented in the hierarchy using the current plugin, and gets a confidence value for the reparented item. Most plugins do not perform steps additional to the default, so the default implementation returns a 0 confidence value, which can be overridden in plugins that do handle special cases.
- Parameters
-
itemID | Item to be reparented in the hierarchy |
parentItemID | Prospective parent of the item to reparent. |
- Returns
- Floating point confidence number between 0 and 1, where 0 means that the plugin cannot handle the item, and 1 means that the plugin is the only one that can handle the item
Reimplemented from qSlicerSubjectHierarchyAbstractPlugin.
◆ createFolderUnderCurrentNode
void qSlicerSubjectHierarchyFolderPlugin::createFolderUnderCurrentNode |
( |
| ) |
|
|
protectedslot |
Create folder node under current node.
◆ createFolderUnderItem()
Q_INVOKABLE vtkIdType qSlicerSubjectHierarchyFolderPlugin::createFolderUnderItem |
( |
vtkIdType |
parentItemID | ) |
|
Create folder under specified item
- Parameters
-
parentNode | Parent item for folder to create |
◆ createFolderUnderScene
void qSlicerSubjectHierarchyFolderPlugin::createFolderUnderScene |
( |
| ) |
|
|
protectedslot |
Create folder node under the scene.
◆ editProperties()
virtual void qSlicerSubjectHierarchyFolderPlugin::editProperties |
( |
vtkIdType |
itemID | ) |
|
|
virtual |
◆ hierarchyNodeForItem()
Q_INVOKABLE vtkMRMLHierarchyNode* qSlicerSubjectHierarchyFolderPlugin::hierarchyNodeForItem |
( |
vtkIdType |
itemID | ) |
|
Get hierarchy node for subject hierarchy item. The item can be associated directly to a hierarchy node (if it's an intermediate hierarchy node), or it can be associated to a data node that is associated to a hierarchy node.
- Returns
- The hierarchy node associated to the item either directly or indirectly. NULL otherwise
◆ icon()
virtual QIcon qSlicerSubjectHierarchyFolderPlugin::icon |
( |
vtkIdType |
itemID | ) |
|
|
virtual |
◆ itemContextMenuActions()
virtual QList<QAction*> qSlicerSubjectHierarchyFolderPlugin::itemContextMenuActions |
( |
| ) |
const |
|
virtual |
◆ itemForHierarchyNode()
Q_INVOKABLE vtkIdType qSlicerSubjectHierarchyFolderPlugin::itemForHierarchyNode |
( |
vtkMRMLHierarchyNode * |
hierarchyNode | ) |
|
Get subject hierarchy item for a hierarchy node. The item can be associated directly to a hierarchy node (if it's an intermediate hierarchy node), or it can be associated to a data node that is associated to a hierarchy node.
- Returns
- ID of the item associated to the hierarchy node directly or indirectly. Invalid ID otherwise.
◆ onDataNodeAssociatedToHierarchyNode
void qSlicerSubjectHierarchyFolderPlugin::onDataNodeAssociatedToHierarchyNode |
( |
vtkObject * |
dataNodeObject | ) |
|
|
slot |
Called when hierarchy modified event is invoked for a data node Ensures that if a hierarchy node gets associated to a data node, then the item for the hierarchy node is removed from subject hierarchy (the logic implemented in the folder plugin handles data nodes with hierarchy nodes)
◆ onHierarchyNodeChildNodeAdded
void qSlicerSubjectHierarchyFolderPlugin::onHierarchyNodeChildNodeAdded |
( |
vtkObject * |
parentNodeObject, |
|
|
vtkObject * |
childNodeObject |
|
) |
| |
|
protectedslot |
Called when child node was added to hierarchy node Ensures that the hierarchy specified by node hierarchies are mirrored in subject hierarchy
◆ reparentItemInsideSubjectHierarchy()
virtual bool qSlicerSubjectHierarchyFolderPlugin::reparentItemInsideSubjectHierarchy |
( |
vtkIdType |
itemID, |
|
|
vtkIdType |
parentItemID |
|
) |
| |
|
virtual |
Reparent an item that was already in the subject hierarchy under a new parent.
- Returns
- True if reparented successfully, false otherwise
Reimplemented from qSlicerSubjectHierarchyAbstractPlugin.
◆ resolveHierarchies()
Q_INVOKABLE bool qSlicerSubjectHierarchyFolderPlugin::resolveHierarchies |
( |
| ) |
|
Resolve all node hierarchy items in the scene. Traverses scene for hierarchy nodes, and makes sure the same parents are set in subject hierarchy
◆ resolveHierarchyForItem()
Q_INVOKABLE bool qSlicerSubjectHierarchyFolderPlugin::resolveHierarchyForItem |
( |
vtkIdType |
itemID | ) |
|
Add the item for the hierarchy node to the proper place in subject hierarchy. If the parent node hierarchy item does not exist yet, add that too, all the way to the scene
◆ roleForPlugin()
virtual Q_INVOKABLE const QString qSlicerSubjectHierarchyFolderPlugin::roleForPlugin |
( |
| ) |
const |
|
virtual |
◆ sceneContextMenuActions()
virtual QList<QAction*> qSlicerSubjectHierarchyFolderPlugin::sceneContextMenuActions |
( |
| ) |
const |
|
virtual |
◆ showContextMenuActionsForItem()
virtual void qSlicerSubjectHierarchyFolderPlugin::showContextMenuActionsForItem |
( |
vtkIdType |
itemID | ) |
|
|
virtual |
Show context menu actions valid for a given subject hierarchy item.
- Parameters
-
itemID | Subject Hierarchy item to show the context menu items for |
Reimplemented from qSlicerSubjectHierarchyAbstractPlugin.
◆ visibilityIcon()
virtual QIcon qSlicerSubjectHierarchyFolderPlugin::visibilityIcon |
( |
int |
visible | ) |
|
|
virtual |
◆ d_ptr
QScopedPointer<qSlicerSubjectHierarchyFolderPluginPrivate> qSlicerSubjectHierarchyFolderPlugin::d_ptr |
|
protected |
The documentation for this class was generated from the following file: