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

Qt-based logic class to exercise Qt-related logic functions. The Subject hierarchy plugin mechanism and those are Qt classes. More...

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

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

Public Types

typedef QObject Superclass
 

Properties

QStringList allowedViewContextMenuActionNames
 
QStringList registeredViewContextMenuActionNames
 List of all registered view context menu actions. More...
 

Public Member Functions

QStringList allowedViewContextMenuActionNames () const
 Get desired set of view menu actions. More...
 
Q_INVOKABLE QStringList allowedViewContextMenuActionNamesForItem (vtkIdType itemID)
 
Q_INVOKABLE vtkIdType currentSubjectHierarchyItem () const
 Assessor function for getting currently selected subject hierarchy item (for python) More...
 
 qSlicerSubjectHierarchyPluginLogic (QObject *parent=nullptr)
 
void registerCorePlugins ()
 
QStringList registeredViewContextMenuActionNames ()
 
void setAllowedViewContextMenuActionNames (QStringList actionObjectNames)
 
Q_INVOKABLE void setAllowedViewContextMenuActionNamesForItem (vtkIdType itemID, const QStringList &actionObjectNames)
 
Q_INVOKABLE void setCurrentSubjectHierarchyItem (vtkIdType itemID)
 
void setMRMLScene (vtkMRMLScene *scene) override
 Set the current MRML scene to the logic. More...
 
Q_INVOKABLE qSlicerSubjectHierarchyAbstractPluginsubjectHierarchyPluginByName (QString name) const
 Assessor function for getting subject hierarchy plugin by name (for python) More...
 
 ~qSlicerSubjectHierarchyPluginLogic () override
 
- Public Member Functions inherited from qSlicerObject
vtkMRMLScenemrmlScene () const
 Return a pointer on the MRML scene. More...
 
 qSlicerObject ()
 
virtual ~qSlicerObject ()
 

Static Public Member Functions

static Q_INVOKABLE QString buildMenuFromActions (QMenu *menu, QList< QAction * > actions, const QStringList &allowedActions=QStringList())
 

Protected Slots

void editProperties ()
 Called when the user clicks the Edit properties View menu action. More...
 
void onDisplayMenuEvent (vtkObject *, vtkObject *)
 Called when menu event is invoked on a display node of an owned displayable node. More...
 
void onDisplayNodeModified (vtkObject *, vtkObject *)
 Called when display node modified event is invoked on an owned displayable node. More...
 
void onNodeAboutToBeRemoved (vtkObject *scene, vtkObject *nodeObject)
 
void onNodeAdded (vtkObject *scene, vtkObject *nodeObject)
 Called when a node is added to the scene so that a plugin can create an item for it. More...
 
void onNodeRemoved (vtkObject *scene, vtkObject *nodeObject)
 
void onSceneBatchProcessEnded (vtkObject *sceneObject)
 
void onSceneCloseEnded (vtkObject *sceneObject)
 Called when scene import is finished. Hierarchy is cleared in that case. More...
 
void onSceneImportEnded (vtkObject *sceneObject)
 
void onSceneRestoreEnded (vtkObject *sceneObject)
 

Protected Member Functions

void addSupportedDataNodesToSubjectHierarchy ()
 
void observeNode (vtkMRMLNode *node)
 Add observations for node that was added to subject hierarchy. More...
 
void registerViewContextMenuAction (QAction *action)
 Add view menu action. Called by plugin handler when registering a plugin. More...
 

Protected Attributes

QScopedPointer< qSlicerSubjectHierarchyPluginLogicPrivate > d_ptr
 
- Protected Attributes inherited from qSlicerObject
QScopedPointer< qSlicerObjectPrivate > d_ptr
 

Friends

class qSlicerSubjectHierarchyPluginHandler
 

Detailed Description

Qt-based logic class to exercise Qt-related logic functions. The Subject hierarchy plugin mechanism and those are Qt classes.

Definition at line 49 of file qSlicerSubjectHierarchyPluginLogic.h.

Member Typedef Documentation

◆ Superclass

Definition at line 62 of file qSlicerSubjectHierarchyPluginLogic.h.

Property Documentation

◆ allowedViewContextMenuActionNames

QStringList qSlicerSubjectHierarchyPluginLogic::allowedViewContextMenuActionNames
readwrite

Allow-list for view context menu actions. If empty (by default) then all registered view context menu action names will be displayable. Allow-list can be further restricted for a specific node by using setAllowedViewContextMenuActionNamesForItem method.

Definition at line 57 of file qSlicerSubjectHierarchyPluginLogic.h.

◆ registeredViewContextMenuActionNames

QStringList qSlicerSubjectHierarchyPluginLogic::registeredViewContextMenuActionNames
read

List of all registered view context menu actions.

Definition at line 59 of file qSlicerSubjectHierarchyPluginLogic.h.

Constructor & Destructor Documentation

◆ qSlicerSubjectHierarchyPluginLogic()

qSlicerSubjectHierarchyPluginLogic::qSlicerSubjectHierarchyPluginLogic ( QObject *  parent = nullptr)

◆ ~qSlicerSubjectHierarchyPluginLogic()

qSlicerSubjectHierarchyPluginLogic::~qSlicerSubjectHierarchyPluginLogic ( )
override

Member Function Documentation

◆ addSupportedDataNodesToSubjectHierarchy()

void qSlicerSubjectHierarchyPluginLogic::addSupportedDataNodesToSubjectHierarchy ( )
protected

Add supported nodes to subject hierarchy. This method is called if auto-creation is enabled and a supported node is added to the scene, or if the user answers yes to the question that pops up upon entering subject hierarchy module if supported nodes are found that are not in the hierarchy.

◆ allowedViewContextMenuActionNames()

QStringList qSlicerSubjectHierarchyPluginLogic::allowedViewContextMenuActionNames ( ) const

Get desired set of view menu actions.

◆ allowedViewContextMenuActionNamesForItem()

Q_INVOKABLE QStringList qSlicerSubjectHierarchyPluginLogic::allowedViewContextMenuActionNamesForItem ( vtkIdType  itemID)

Get allowed view context menu items for a specific item.

See also
setAllowedViewContextMenuActionNamesForItem

◆ buildMenuFromActions()

static Q_INVOKABLE QString qSlicerSubjectHierarchyPluginLogic::buildMenuFromActions ( QMenu *  menu,
QList< QAction * >  actions,
const QStringList &  allowedActions = QStringList() 
)
static

Create menu from list of actions. Uses "section" property to determine position of the action in the menu: each integer section value corresponds to a section and fractional part is used for ordering actions within the section.

Parameters
menuwill be set by inserting the actions. If it is set to nullptr then a string will be returned that contains name and "section" value of each action.
allowedActionsspecifies object name of actions may be added to the menu. If the list is empty then it is ignored.

◆ currentSubjectHierarchyItem()

Q_INVOKABLE vtkIdType qSlicerSubjectHierarchyPluginLogic::currentSubjectHierarchyItem ( ) const

Assessor function for getting currently selected subject hierarchy item (for python)

◆ editProperties

void qSlicerSubjectHierarchyPluginLogic::editProperties ( )
protectedslot

Called when the user clicks the Edit properties View menu action.

◆ observeNode()

void qSlicerSubjectHierarchyPluginLogic::observeNode ( vtkMRMLNode node)
protected

Add observations for node that was added to subject hierarchy.

◆ onDisplayMenuEvent

void qSlicerSubjectHierarchyPluginLogic::onDisplayMenuEvent ( vtkObject *  ,
vtkObject *   
)
protectedslot

Called when menu event is invoked on a display node of an owned displayable node.

◆ onDisplayNodeModified

void qSlicerSubjectHierarchyPluginLogic::onDisplayNodeModified ( vtkObject *  ,
vtkObject *   
)
protectedslot

Called when display node modified event is invoked on an owned displayable node.

◆ onNodeAboutToBeRemoved

void qSlicerSubjectHierarchyPluginLogic::onNodeAboutToBeRemoved ( vtkObject *  scene,
vtkObject *  nodeObject 
)
protectedslot

Called when a node is removed from the scene so that the associated subject hierarchy item can be deleted too

◆ onNodeAdded

void qSlicerSubjectHierarchyPluginLogic::onNodeAdded ( vtkObject *  scene,
vtkObject *  nodeObject 
)
protectedslot

Called when a node is added to the scene so that a plugin can create an item for it.

◆ onNodeRemoved

void qSlicerSubjectHierarchyPluginLogic::onNodeRemoved ( vtkObject *  scene,
vtkObject *  nodeObject 
)
protectedslot

Called when a node is removed from the scene so if the subject hierarchy node is removed, it is re-created and the hierarchy rebuilt

◆ onSceneBatchProcessEnded

void qSlicerSubjectHierarchyPluginLogic::onSceneBatchProcessEnded ( vtkObject *  sceneObject)
protectedslot

Called when batch processing is ended. Subject hierarchy is updated after batch processing, when nodes may be added/removed without individual events

◆ onSceneCloseEnded

void qSlicerSubjectHierarchyPluginLogic::onSceneCloseEnded ( vtkObject *  sceneObject)
protectedslot

Called when scene import is finished. Hierarchy is cleared in that case.

◆ onSceneImportEnded

void qSlicerSubjectHierarchyPluginLogic::onSceneImportEnded ( vtkObject *  sceneObject)
protectedslot

Called when scene import is finished. Subject hierarchy items are created for supported data nodes if they have not been imported with the scene (backwards compatibility for older scenes)

◆ onSceneRestoreEnded

void qSlicerSubjectHierarchyPluginLogic::onSceneRestoreEnded ( vtkObject *  sceneObject)
protectedslot

Called when scene restore is finished. As the restored node contains only unresolved items, they need to be resolved when restoring ended

◆ registerCorePlugins()

void qSlicerSubjectHierarchyPluginLogic::registerCorePlugins ( )

Register subject hierarchy core plugins Note: Registering plugins provided by other modules is the responsibility of the module!

◆ registeredViewContextMenuActionNames()

QStringList qSlicerSubjectHierarchyPluginLogic::registeredViewContextMenuActionNames ( )

Get all view context menu actions available

Returns
List of object names of all registered view menu actions

◆ registerViewContextMenuAction()

void qSlicerSubjectHierarchyPluginLogic::registerViewContextMenuAction ( QAction *  action)
protected

Add view menu action. Called by plugin handler when registering a plugin.

◆ setAllowedViewContextMenuActionNames()

void qSlicerSubjectHierarchyPluginLogic::setAllowedViewContextMenuActionNames ( QStringList  actionObjectNames)

Set list of view context menu action names that are allowed to be displayed. Allow-list can be further restricted for a specific node by using setAllowedViewContextMenuActionNamesForItem method.

Parameters
actionObjectNamesList of view context menu actions to consider for displaying. Only actions that are chosen to be visible by the owner plugin and listed in actionObjectNames will be displayed to the user.

◆ setAllowedViewContextMenuActionNamesForItem()

Q_INVOKABLE void qSlicerSubjectHierarchyPluginLogic::setAllowedViewContextMenuActionNamesForItem ( vtkIdType  itemID,
const QStringList &  actionObjectNames 
)

Set allowed view context menu items for a specific item. Only those actions are offered for the item that are allowed overall (using allowedViewContextMenuActionNames) and using this method, too. List of allowed action names are stored in "allowedViewContextMenuActions" subject hierarchy item attribute (separated by semicolons).

See also
setAllowedViewContextMenuActionNames

◆ setCurrentSubjectHierarchyItem()

Q_INVOKABLE void qSlicerSubjectHierarchyPluginLogic::setCurrentSubjectHierarchyItem ( vtkIdType  itemID)

Utility test function to be able to set currently selected subject hierarchy node from python Only used in python tests!

◆ setMRMLScene()

void qSlicerSubjectHierarchyPluginLogic::setMRMLScene ( vtkMRMLScene scene)
overridevirtual

Set the current MRML scene to the logic.

Reimplemented from qSlicerObject.

◆ subjectHierarchyPluginByName()

Q_INVOKABLE qSlicerSubjectHierarchyAbstractPlugin* qSlicerSubjectHierarchyPluginLogic::subjectHierarchyPluginByName ( QString  name) const

Assessor function for getting subject hierarchy plugin by name (for python)

Friends And Related Function Documentation

◆ qSlicerSubjectHierarchyPluginHandler

Definition at line 166 of file qSlicerSubjectHierarchyPluginLogic.h.

Member Data Documentation

◆ d_ptr

QScopedPointer<qSlicerSubjectHierarchyPluginLogicPrivate> qSlicerSubjectHierarchyPluginLogic::d_ptr
protected

Definition at line 161 of file qSlicerSubjectHierarchyPluginLogic.h.


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