Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Properties | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends
qSlicerSubjectHierarchyAbstractPlugin Class Reference

Abstract plugin for handling Subject Hierarchy items. More...

#include <Modules/Loadable/SubjectHierarchy/Widgets/qSlicerSubjectHierarchyAbstractPlugin.h>

Inheritance diagram for qSlicerSubjectHierarchyAbstractPlugin:
Inheritance graph
[legend]
Collaboration diagram for qSlicerSubjectHierarchyAbstractPlugin:
Collaboration graph
[legend]

Public Types

typedef QObject Superclass
 

Properties

QString name
 

Signals

void requestExpandItem (vtkIdType itemID)
 Signal requesting expanding of the subject hierarchy tree item belonging to an item. More...
 
void requestInvalidateFilter () const
 

Public Member Functions

virtual bool addNodeToSubjectHierarchy (vtkMRMLNode *node, vtkIdType parentItemID)
 
virtual double canAddNodeToSubjectHierarchy (vtkMRMLNode *node, vtkIdType parentItemID=vtkMRMLSubjectHierarchyNode::INVALID_ITEM_ID) const
 
virtual Q_INVOKABLE double canOwnSubjectHierarchyItem (vtkIdType itemID) const
 
virtual double canReparentItemInsideSubjectHierarchy (vtkIdType itemID, vtkIdType parentItemID) const
 
virtual QString displayedItemName (vtkIdType itemID) const
 
virtual Q_INVOKABLE void editProperties (vtkIdType itemID)
 Open module belonging to item and set inputs in opened module. More...
 
virtual Q_INVOKABLE QColor getDisplayColor (vtkIdType itemID, QMap< int, QVariant > &terminologyMetaData) const
 
virtual Q_INVOKABLE int getDisplayVisibility (vtkIdType itemID) const
 
virtual const QString helpText () const
 Get help text for plugin to be added in subject hierarchy module widget help box. More...
 
virtual QIcon icon (vtkIdType itemID)
 
Q_INVOKABLE bool isThisPluginOwnerOfItem (vtkIdType itemID) const
 Determines if the item is owned by this plugin. More...
 
virtual Q_INVOKABLE QList< QAction * > itemContextMenuActions () const
 
virtual QString name () const
 Get the name of the plugin. More...
 
 qSlicerSubjectHierarchyAbstractPlugin (QObject *parent=NULL)
 
virtual bool reparentItemInsideSubjectHierarchy (vtkIdType itemID, vtkIdType parentItemID)
 
virtual Q_INVOKABLE const QString roleForPlugin () const
 
virtual Q_INVOKABLE QList< QAction * > sceneContextMenuActions () const
 
virtual Q_INVOKABLE void setDisplayColor (vtkIdType itemID, QColor color, QMap< int, QVariant > terminologyMetaData)
 
virtual Q_INVOKABLE void setDisplayVisibility (vtkIdType itemID, int visible)
 Set display visibility of an owned subject hierarchy item. More...
 
virtual void setName (QString name)
 
virtual Q_INVOKABLE void showContextMenuActionsForItem (vtkIdType itemID)
 
virtual Q_INVOKABLE void showVisibilityContextMenuActionsForItem (vtkIdType itemID)
 
virtual Q_INVOKABLE QString tooltip (vtkIdType itemID) const
 Generate tooltip for a owned subject hierarchy item. More...
 
virtual Q_INVOKABLE QList< QAction * > visibilityContextMenuActions () const
 
virtual Q_INVOKABLE QIcon visibilityIcon (int visible)
 Get visibility icon for a visibility state. More...
 
virtual ~qSlicerSubjectHierarchyAbstractPlugin ()
 

Static Public Member Functions

static Q_INVOKABLE qSlicerAbstractModuleWidgetswitchToModule (QString moduleName)
 

Protected Member Functions

void hideAllContextMenuActions () const
 

Protected Attributes

QString m_Name
 Name of the plugin. More...
 

Friends

class qMRMLSubjectHierarchyTreeView
 

Detailed Description

Abstract plugin for handling Subject Hierarchy items.

In Widgets, not Plugins because the paths and libs need to be exported to extensions This class provides an interface and some default implementations for the common operations on subject hierarchy items. To exercise the default implementations, a Default plugin

See also
qSlicerSubjectHierarchyDefaultPlugin has to be created.

Note about confidence values (

See also
canAddNodeToSubjectHierarchy,
canReparentItemInsideSubjectHierarchy,
canOwnSubjectHierarchyItem - in case of the latter two the node mentioned below is the data node associated to the item): The confidence value is a floating point number between 0.0 and 1.0. Meaning of some typical values: 0.0 = The plugin cannot handle the node in question at all 0.3 = It is likely that other plugins will be able to handle the node in question better (typical value for plugins for generic types, such as Volumes) 0.5 = The plugin has equal chance to handle this node as others (an example can be color table node) 0.7 = The plugin is likely be the only one that can handle the node in question, but there is a chance that other plugins can do that too 1.0 = The node in question can only be handled by the plugin (by node type or identifier attribute)

Plugin subclass naming convention:

Definition at line 64 of file qSlicerSubjectHierarchyAbstractPlugin.h.

Member Typedef Documentation

◆ Superclass

Definition at line 74 of file qSlicerSubjectHierarchyAbstractPlugin.h.

Property Documentation

◆ name

QString qSlicerSubjectHierarchyAbstractPlugin::name
readwrite

This property stores the name of the plugin Cannot be empty.

See also
name()

Definition at line 71 of file qSlicerSubjectHierarchyAbstractPlugin.h.

Constructor & Destructor Documentation

◆ qSlicerSubjectHierarchyAbstractPlugin()

qSlicerSubjectHierarchyAbstractPlugin::qSlicerSubjectHierarchyAbstractPlugin ( QObject *  parent = NULL)

◆ ~qSlicerSubjectHierarchyAbstractPlugin()

virtual qSlicerSubjectHierarchyAbstractPlugin::~qSlicerSubjectHierarchyAbstractPlugin ( )
virtual

Member Function Documentation

◆ addNodeToSubjectHierarchy()

virtual bool qSlicerSubjectHierarchyAbstractPlugin::addNodeToSubjectHierarchy ( vtkMRMLNode node,
vtkIdType  parentItemID 
)
virtual

Add a node to subject hierarchy under a specified parent. This is basically a convenience function to call

See also
vtkMRMLSubjectHierarchyNode::CreateItem
Parameters
nodeNode to add to subject hierarchy
parentItemIDParent item of the added node
Returns
True if added successfully, false otherwise

Reimplemented in qSlicerSubjectHierarchyFolderPlugin, and qSlicerSubjectHierarchySegmentationsPlugin.

◆ canAddNodeToSubjectHierarchy()

virtual double qSlicerSubjectHierarchyAbstractPlugin::canAddNodeToSubjectHierarchy ( vtkMRMLNode node,
vtkIdType  parentItemID = vtkMRMLSubjectHierarchyNode::INVALID_ITEM_ID 
) const
virtual

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). 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
nodeNode to be added to the hierarchy
parentItemIDProspective 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 in qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchyTransformsPlugin, qSlicerSubjectHierarchyVolumesPlugin, qSlicerSubjectHierarchyTablesPlugin, qSlicerSubjectHierarchySceneViewsPlugin, qSlicerSubjectHierarchyChartsPlugin, qSlicerSubjectHierarchyDiffusionTensorVolumesPlugin, qSlicerSubjectHierarchyLabelMapsPlugin, qSlicerSubjectHierarchyMarkupsPlugin, qSlicerSubjectHierarchyModelsPlugin, qSlicerSubjectHierarchyPlotsPlugin, and qSlicerSubjectHierarchySegmentationsPlugin.

◆ canOwnSubjectHierarchyItem()

virtual Q_INVOKABLE double qSlicerSubjectHierarchyAbstractPlugin::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
itemItem 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 in qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchyTransformsPlugin, qSlicerSubjectHierarchyVolumesPlugin, qSlicerSubjectHierarchyTablesPlugin, qSlicerSubjectHierarchySceneViewsPlugin, qSlicerSubjectHierarchyChartsPlugin, qSlicerSubjectHierarchyDiffusionTensorVolumesPlugin, qSlicerSubjectHierarchyLabelMapsPlugin, qSlicerSubjectHierarchyMarkupsPlugin, qSlicerSubjectHierarchyModelsPlugin, qSlicerSubjectHierarchyPlotsPlugin, qSlicerSubjectHierarchySegmentsPlugin, qSlicerSubjectHierarchySegmentationsPlugin, and qSlicerSubjectHierarchyDefaultPlugin.

◆ canReparentItemInsideSubjectHierarchy()

virtual double qSlicerSubjectHierarchyAbstractPlugin::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
itemIDItem to be reparented in the hierarchy
parentItemIDProspective 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 in qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchyTransformsPlugin, and qSlicerSubjectHierarchySegmentsPlugin.

◆ displayedItemName()

virtual QString qSlicerSubjectHierarchyAbstractPlugin::displayedItemName ( vtkIdType  itemID) const
virtual

Generate displayed name for the owned subject hierarchy item corresponding to its role. The default implementation returns the associated data node's name if any, otherwise the item name

Reimplemented in qSlicerSubjectHierarchyScriptedPlugin.

◆ editProperties()

virtual Q_INVOKABLE void qSlicerSubjectHierarchyAbstractPlugin::editProperties ( vtkIdType  itemID)
virtual

◆ getDisplayColor()

virtual Q_INVOKABLE QColor qSlicerSubjectHierarchyAbstractPlugin::getDisplayColor ( vtkIdType  itemID,
QMap< int, QVariant > &  terminologyMetaData 
) const
virtual

◆ getDisplayVisibility()

virtual Q_INVOKABLE int qSlicerSubjectHierarchyAbstractPlugin::getDisplayVisibility ( vtkIdType  itemID) const
virtual

◆ helpText()

virtual const QString qSlicerSubjectHierarchyAbstractPlugin::helpText ( ) const
virtual

Get help text for plugin to be added in subject hierarchy module widget help box.

Reimplemented in qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchySegmentationsPlugin, qSlicerSubjectHierarchySegmentsPlugin, and qSlicerSubjectHierarchyDefaultPlugin.

◆ hideAllContextMenuActions()

void qSlicerSubjectHierarchyAbstractPlugin::hideAllContextMenuActions ( ) const
protected

Hide all context menu actions offered by the plugin. This method must be called as a first step in

See also
showContextMenuActionsForItem before showing the actions that apply to the current situation. Calling this method prevents programming errors made in case plugin actions change.

◆ icon()

virtual QIcon qSlicerSubjectHierarchyAbstractPlugin::icon ( vtkIdType  itemID)
virtual

◆ isThisPluginOwnerOfItem()

Q_INVOKABLE bool qSlicerSubjectHierarchyAbstractPlugin::isThisPluginOwnerOfItem ( vtkIdType  itemID) const

Determines if the item is owned by this plugin.

◆ itemContextMenuActions()

virtual Q_INVOKABLE QList<QAction*> qSlicerSubjectHierarchyAbstractPlugin::itemContextMenuActions ( ) const
virtual

◆ name()

virtual QString qSlicerSubjectHierarchyAbstractPlugin::name ( ) const
virtual

Get the name of the plugin.

◆ reparentItemInsideSubjectHierarchy()

virtual bool qSlicerSubjectHierarchyAbstractPlugin::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 in qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchyTransformsPlugin, and qSlicerSubjectHierarchySegmentsPlugin.

◆ requestExpandItem

void qSlicerSubjectHierarchyAbstractPlugin::requestExpandItem ( vtkIdType  itemID)
signal

Signal requesting expanding of the subject hierarchy tree item belonging to an item.

◆ requestInvalidateFilter

void qSlicerSubjectHierarchyAbstractPlugin::requestInvalidateFilter ( ) const
signal

Signal requesting invalidating the filter model for the tree view (e.g. when an item is added or removed by the plugin)

◆ roleForPlugin()

virtual Q_INVOKABLE const QString qSlicerSubjectHierarchyAbstractPlugin::roleForPlugin ( ) const
virtual

◆ sceneContextMenuActions()

virtual Q_INVOKABLE QList<QAction*> qSlicerSubjectHierarchyAbstractPlugin::sceneContextMenuActions ( ) const
virtual

Get scene context menu item actions to add to tree view. Also provides actions for right-click on empty area These context menu actions are shown for the scene in the implementations of

See also
showContextMenuActionsForItem Separate method is needed for the scene, as its actions are set to the tree by a different method
itemContextMenuActions

Reimplemented in qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchyScriptedPlugin, and qSlicerSubjectHierarchyParseLocalDataPlugin.

◆ setDisplayColor()

virtual Q_INVOKABLE void qSlicerSubjectHierarchyAbstractPlugin::setDisplayColor ( vtkIdType  itemID,
QColor  color,
QMap< int, QVariant >  terminologyMetaData 
)
virtual

◆ setDisplayVisibility()

virtual Q_INVOKABLE void qSlicerSubjectHierarchyAbstractPlugin::setDisplayVisibility ( vtkIdType  itemID,
int  visible 
)
virtual

◆ setName()

virtual void qSlicerSubjectHierarchyAbstractPlugin::setName ( QString  name)
virtual

Set the name of the plugin NOTE: name must be defined in constructor in C++ plugins, this can only be used in python scripted ones

Reimplemented in qSlicerSubjectHierarchyScriptedPlugin.

◆ showContextMenuActionsForItem()

virtual Q_INVOKABLE void qSlicerSubjectHierarchyAbstractPlugin::showContextMenuActionsForItem ( vtkIdType  itemID)
inlinevirtual

◆ showVisibilityContextMenuActionsForItem()

virtual Q_INVOKABLE void qSlicerSubjectHierarchyAbstractPlugin::showVisibilityContextMenuActionsForItem ( vtkIdType  itemID)
inlinevirtual

Show visibility context menu actions valid for a given subject hierarchy item.

Parameters
itemIDSubject Hierarchy item to show the visibility context menu items for

Reimplemented in qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchySegmentsPlugin, qSlicerSubjectHierarchyModelsPlugin, qSlicerSubjectHierarchySegmentationsPlugin, qSlicerSubjectHierarchyLabelMapsPlugin, qSlicerSubjectHierarchyDefaultPlugin, qSlicerSubjectHierarchyVolumeRenderingPlugin, and qSlicerSubjectHierarchyOpacityPlugin.

Definition at line 159 of file qSlicerSubjectHierarchyAbstractPlugin.h.

◆ switchToModule()

static Q_INVOKABLE qSlicerAbstractModuleWidget* qSlicerSubjectHierarchyAbstractPlugin::switchToModule ( QString  moduleName)
static

Switch to module with given name

Returns
Widget representation of the module if found, NULL otherwise

◆ tooltip()

virtual Q_INVOKABLE QString qSlicerSubjectHierarchyAbstractPlugin::tooltip ( vtkIdType  itemID) const
virtual

◆ visibilityContextMenuActions()

virtual Q_INVOKABLE QList<QAction*> qSlicerSubjectHierarchyAbstractPlugin::visibilityContextMenuActions ( ) const
virtual

◆ visibilityIcon()

virtual Q_INVOKABLE QIcon qSlicerSubjectHierarchyAbstractPlugin::visibilityIcon ( int  visible)
virtual

Friends And Related Function Documentation

◆ qMRMLSubjectHierarchyTreeView

friend class qMRMLSubjectHierarchyTreeView
friend

Definition at line 235 of file qSlicerSubjectHierarchyAbstractPlugin.h.

Member Data Documentation

◆ m_Name

QString qSlicerSubjectHierarchyAbstractPlugin::m_Name
protected

Name of the plugin.

Definition at line 230 of file qSlicerSubjectHierarchyAbstractPlugin.h.


The documentation for this class was generated from the following file: