Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkNodeDescriptor Class Reference

QmitkNodeQmitkNodeDescriptor is Decorator class for the mitk::DataNode which enhances certain mitk::DataNode by additional infos needed by the GUI (Icon, ...) More...

#include <QmitkNodeDescriptor.h>

Inheritance diagram for QmitkNodeDescriptor:
Collaboration diagram for QmitkNodeDescriptor:

Public Slots

void ActionDestroyed (QObject *obj=nullptr)
 Called when an action was destroyed. More...
 

Public Member Functions

 QmitkNodeDescriptor (const QString &_ClassName, const QString &_PathToIcon, mitk::NodePredicateBase *_Predicate, QObject *parent)
 
virtual ~QmitkNodeDescriptor ()
 
virtual QString GetNameOfClass () const
 
virtual QIcon GetIcon () const
 
virtual QAction * GetSeparator () const
 
virtual bool CheckNode (const mitk::DataNode *node) const
 
virtual void AddAction (QAction *action, bool isBatchAction=true)
 
virtual void RemoveAction (QAction *_Action)
 
virtual QList< QAction * > GetActions () const
 
virtual QList< QAction * > GetBatchActions () const
 

Protected Attributes

QString m_ClassName
 
QString m_PathToIcon
 
mitk::NodePredicateBase::Pointer m_Predicate
 
QList< QAction * > m_Actions
 
QList< QAction * > m_BatchActions
 
QAction * m_Separator
 

Detailed Description

QmitkNodeQmitkNodeDescriptor is Decorator class for the mitk::DataNode which enhances certain mitk::DataNode by additional infos needed by the GUI (Icon, ...)

Moreover, QmitkNodeQmitkNodeDescriptor stores a Menu for actions that can be taken for a certain DataNode, e.g. for DataNodes containing images this menu can be filled with Image Filter Actions, etc.

See also
QmitkDataNodeQmitkNodeDescriptorManager

Definition at line 43 of file QmitkNodeDescriptor.h.

Constructor & Destructor Documentation

QmitkNodeDescriptor::QmitkNodeDescriptor ( const QString &  _ClassName,
const QString &  _PathToIcon,
mitk::NodePredicateBase _Predicate,
QObject *  parent 
)

Creates a new QmitkNodeQmitkNodeDescriptor

Definition at line 24 of file QmitkNodeDescriptor.cpp.

References m_Separator.

QmitkNodeDescriptor::~QmitkNodeDescriptor ( )
virtual

Deletes all actions

Definition at line 91 of file QmitkNodeDescriptor.cpp.

Member Function Documentation

void QmitkNodeDescriptor::ActionDestroyed ( QObject *  obj = nullptr)
slot

Called when an action was destroyed.

Definition at line 106 of file QmitkNodeDescriptor.cpp.

References RemoveAction().

Referenced by AddAction(), and RemoveAction().

void QmitkNodeDescriptor::AddAction ( QAction *  action,
bool  isBatchAction = true 
)
virtual

Create and return an action with this descriptor as owner

Definition at line 59 of file QmitkNodeDescriptor.cpp.

References ActionDestroyed(), m_Actions, and m_BatchActions.

Referenced by QmitkDataManagerView::CreateQtPartControl().

bool QmitkNodeDescriptor::CheckNode ( const mitk::DataNode node) const
virtual

Check if this class describes the given node

Definition at line 52 of file QmitkNodeDescriptor.cpp.

References m_Predicate.

QList< QAction * > QmitkNodeDescriptor::GetActions ( ) const
virtual

Get all actions associated with this class of nodes

Definition at line 47 of file QmitkNodeDescriptor.cpp.

References m_Actions.

Referenced by QmitkNodeDescriptorManager::GetActions().

QList< QAction * > QmitkNodeDescriptor::GetBatchActions ( ) const
virtual

Get all actions for this descriptor class that can be executed on multiple nodes (no priot knowledge abpout the node is required)

Definition at line 101 of file QmitkNodeDescriptor.cpp.

References m_BatchActions.

Referenced by QmitkNodeDescriptorManager::GetActions().

QIcon QmitkNodeDescriptor::GetIcon ( ) const
virtual

Returns an Icon for this class of DataNodes

Definition at line 42 of file QmitkNodeDescriptor.cpp.

References m_PathToIcon.

Referenced by QmitkDataStorageTreeModel::data(), and QmitkDataStorageTableModel::data().

QString QmitkNodeDescriptor::GetNameOfClass ( ) const
virtual

Returns a name for this class of DataNodes (e.g. "Image", "Image Mask", etc.)

Definition at line 37 of file QmitkNodeDescriptor.cpp.

References m_ClassName.

Referenced by QmitkDataStorageTableModel::data().

QAction * QmitkNodeDescriptor::GetSeparator ( ) const
virtual

Returns an Icon for this class of DataNodes

Definition at line 96 of file QmitkNodeDescriptor.cpp.

References m_Separator.

Referenced by QmitkNodeDescriptorManager::GetActions().

void QmitkNodeDescriptor::RemoveAction ( QAction *  _Action)
virtual

Remove and delete (!) an action

Definition at line 71 of file QmitkNodeDescriptor.cpp.

References ActionDestroyed(), m_Actions, and m_BatchActions.

Referenced by ActionDestroyed().

Member Data Documentation

QList<QAction *> QmitkNodeDescriptor::m_Actions
protected

Definition at line 100 of file QmitkNodeDescriptor.h.

Referenced by AddAction(), GetActions(), and RemoveAction().

QList<QAction *> QmitkNodeDescriptor::m_BatchActions
protected

Definition at line 101 of file QmitkNodeDescriptor.h.

Referenced by AddAction(), GetBatchActions(), and RemoveAction().

QString QmitkNodeDescriptor::m_ClassName
protected

Definition at line 97 of file QmitkNodeDescriptor.h.

Referenced by GetNameOfClass().

QString QmitkNodeDescriptor::m_PathToIcon
protected

Definition at line 98 of file QmitkNodeDescriptor.h.

Referenced by GetIcon().

mitk::NodePredicateBase::Pointer QmitkNodeDescriptor::m_Predicate
protected

Definition at line 99 of file QmitkNodeDescriptor.h.

Referenced by CheckNode().

QAction* QmitkNodeDescriptor::m_Separator
protected

Definition at line 102 of file QmitkNodeDescriptor.h.

Referenced by GetSeparator(), and QmitkNodeDescriptor().


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