Slicer  4.8
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 | Protected Member Functions
qMRMLSceneAnnotationModel Class Reference

#include <Modules/Loadable/Annotations/Widgets/qMRMLSceneAnnotationModel.h>

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

Public Types

typedef qMRMLSceneDisplayableModel Superclass
 
- Public Types inherited from qMRMLSceneDisplayableModel
typedef qMRMLSceneHierarchyModel Superclass
 
- Public Types inherited from qMRMLSceneHierarchyModel
typedef qMRMLSceneModel Superclass
 
- Public Types inherited from qMRMLSceneModel
enum  ItemDataRole {
  UIDRole = Qt::UserRole + 1, PointerRole, ExtraItemsRole, VisibilityRole,
  LastRole
}
 
enum  NodeTypes { NoNodes = 0, AllNodes, OnlyVisibleNodes }
 
typedef QStandardItemModel Superclass
 

Properties

bool annotationsAreParent
 
int editColumn
 
int lockColumn
 
int textColumn
 
int valueColumn
 
- Properties inherited from qMRMLSceneDisplayableModel
int colorColumn
 
int opacityColumn
 
- Properties inherited from qMRMLSceneHierarchyModel
int expandColumn
 
- Properties inherited from qMRMLSceneModel
int checkableColumn
 
int extraItemColumn
 
int idColumn
 
bool lazyUpdate
 
NodeTypes listenNodeModifiedEvent
 
int nameColumn
 
int toolTipNameColumn
 
int visibilityColumn
 

Public Member Functions

virtual vtkMRMLNodeactiveHierarchyNode (vtkMRMLNode *mrmlNode) const
 
bool areAnnotationsParent () const
 
virtual bool canBeAParent (vtkMRMLNode *node) const
 fast function that only check the type of the node to know if it can be a parent. More...
 
int editColumn () const
 
int lockColumn () const
 
virtual vtkMRMLNodeparentNode (vtkMRMLNode *node) const
 
 qMRMLSceneAnnotationModel (QObject *parent=0)
 
void setAnnotationsAreParent (bool parentable)
 
void setEditColumn (int column)
 
void setLockColumn (int column)
 
void setLogic (vtkSlicerAnnotationModuleLogic *logic)
 
void setTextColumn (int column)
 
void setValueColumn (int column)
 
int textColumn () const
 
int valueColumn () const
 
virtual ~qMRMLSceneAnnotationModel ()
 
- Public Member Functions inherited from qMRMLSceneDisplayableModel
virtual bool canBeAChild (vtkMRMLNode *node) const
 fast function that only check the type of the node to know if it can be a child. More...
 
int colorColumn () const
 
int opacityColumn () const
 
 qMRMLSceneDisplayableModel (QObject *parent=0)
 
void setColorColumn (int column)
 
void setOpacityColumn (int column)
 
virtual ~qMRMLSceneDisplayableModel ()
 
- Public Member Functions inherited from qMRMLSceneHierarchyModel
int expandColumn () const
 
virtual int nodeIndex (vtkMRMLNode *node) const
 
 qMRMLSceneHierarchyModel (QObject *parent=0)
 
virtual bool reparent (vtkMRMLNode *node, vtkMRMLNode *newParent)
 if newParent == 0, set the node into the vtkMRMLScene More...
 
void setExpandColumn (int column)
 
virtual Qt::DropActions supportedDropActions () const
 
virtual ~qMRMLSceneHierarchyModel ()
 
- Public Member Functions inherited from qMRMLSceneModel
int checkableColumn () const
 
virtual bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
 
int extraItemColumn () const
 
int idColumn () const
 
QModelIndexList indexes (vtkMRMLNode *node) const
 
QModelIndex indexFromNode (vtkMRMLNode *node, int column=0) const
 
bool isAffiliatedNode (vtkMRMLNode *nodeA, vtkMRMLNode *nodeB) const
 
bool isParentNode (vtkMRMLNode *child, vtkMRMLNode *parent) const
 
QStandardItem * itemFromNode (vtkMRMLNode *node, int column=0) const
 
bool lazyUpdate () const
 
NodeTypes listenNodeModifiedEvent () const
 
virtual QMimeData * mimeData (const QModelIndexList &indexes) const
 
vtkMRMLNodemrmlNodeFromIndex (const QModelIndex &nodeIndex) const
 
vtkMRMLNodemrmlNodeFromItem (QStandardItem *nodeItem) const
 
Q_INVOKABLE vtkMRMLScenemrmlScene () const
 
QModelIndex mrmlSceneIndex () const
 invalid until a valid scene is set More...
 
QStandardItem * mrmlSceneItem () const
 0 until a valid scene is set More...
 
int nameColumn () const
 
QStringList postItems (QStandardItem *parent) const
 
QStringList preItems (QStandardItem *parent) const
 
 qMRMLSceneModel (QObject *parent=0)
 
void setCheckableColumn (int column)
 
void setExtraItemColumn (int column)
 
void setIDColumn (int column)
 
void setLazyUpdate (bool lazy)
 
void setListenNodeModifiedEvent (NodeTypes nodesToListen)
 
virtual Q_INVOKABLE void setMRMLScene (vtkMRMLScene *scene)
 0 by default More...
 
void setNameColumn (int column)
 
void setPostItems (const QStringList &extraItems, QStandardItem *parent)
 
void setPreItems (const QStringList &extraItems, QStandardItem *parent)
 
void setToolTipNameColumn (int column)
 
void setVisibilityColumn (int column)
 
int toolTipNameColumn () const
 
int visibilityColumn () const
 
virtual ~qMRMLSceneModel ()
 

Protected Member Functions

virtual int maxColumnId () const
 Must be reimplemented in subclasses that add new column types. More...
 
virtual QFlags< Qt::ItemFlag > nodeFlags (vtkMRMLNode *node, int column) const
 
 qMRMLSceneAnnotationModel (qMRMLSceneAnnotationModelPrivate *pimpl, QObject *parent=0)
 
virtual void updateItemDataFromNode (QStandardItem *item, vtkMRMLNode *node, int column)
 
virtual void updateNodeFromItemData (vtkMRMLNode *node, QStandardItem *item)
 
- Protected Member Functions inherited from qMRMLSceneDisplayableModel
virtual void observeNode (vtkMRMLNode *node)
 
 qMRMLSceneDisplayableModel (qMRMLSceneDisplayableModelPrivate *pimpl, QObject *parent=0)
 
- Protected Member Functions inherited from qMRMLSceneHierarchyModel
 qMRMLSceneHierarchyModel (qMRMLSceneHierarchyModelPrivate *pimpl, QObject *parent=0)
 
- Protected Member Functions inherited from qMRMLSceneModel
virtual QStandardItem * insertNode (vtkMRMLNode *node)
 
virtual QStandardItem * insertNode (vtkMRMLNode *node, QStandardItem *parent, int row=-1)
 
virtual bool isANode (const QStandardItem *item) const
 
virtual void populateScene ()
 
 qMRMLSceneModel (qMRMLSceneModelPrivate *pimpl, QObject *parent=0)
 
virtual void updateItemFromNode (QStandardItem *item, vtkMRMLNode *node, int column)
 
virtual void updateNodeFromItem (vtkMRMLNode *node, QStandardItem *item)
 
void updateNodeItems ()
 You shouldn't need to call this function. More...
 
void updateNodeItems (vtkMRMLNode *node, const QString &uid)
 Update the items associated with the node and uid. More...
 
virtual void updateScene ()
 

Additional Inherited Members

- Signals inherited from qMRMLSceneModel
void aboutToReparentByDragAndDrop (vtkMRMLNode *node, vtkMRMLNode *newParent)
 
void reparentedByDragAndDrop (vtkMRMLNode *node, vtkMRMLNode *newParent)
 
void sceneAboutToBeUpdated ()
 This signal is sent when the scene is about to be updated. More...
 
void sceneUpdated ()
 This signal is sent after the scene is updated. More...
 
- Protected Slots inherited from qMRMLSceneModel
virtual void delayedItemChanged ()
 
virtual void onItemChanged (QStandardItem *item)
 
void onMRMLNodeIDChanged (vtkObject *node, void *callData)
 
void onMRMLNodeModified (vtkObject *node)
 
virtual void onMRMLSceneAboutToBeClosed (vtkMRMLScene *scene)
 
virtual void onMRMLSceneAboutToBeImported (vtkMRMLScene *scene)
 
virtual void onMRMLSceneClosed (vtkMRMLScene *scene)
 
void onMRMLSceneDeleted (vtkObject *scene)
 
virtual void onMRMLSceneEndBatchProcess (vtkMRMLScene *scene)
 
virtual void onMRMLSceneImported (vtkMRMLScene *scene)
 
virtual void onMRMLSceneNodeAboutToBeAdded (vtkMRMLScene *scene, vtkMRMLNode *node)
 
virtual void onMRMLSceneNodeAboutToBeRemoved (vtkMRMLScene *scene, vtkMRMLNode *node)
 
virtual void onMRMLSceneNodeAdded (vtkMRMLScene *scene, vtkMRMLNode *node)
 
virtual void onMRMLSceneNodeRemoved (vtkMRMLScene *scene, vtkMRMLNode *node)
 
virtual void onMRMLSceneStartBatchProcess (vtkMRMLScene *scene)
 
void updateColumnCount ()
 
- Static Protected Member Functions inherited from qMRMLSceneModel
static void onMRMLSceneEvent (vtkObject *vtk_obj, unsigned long event, void *client_data, void *call_data)
 
- Protected Attributes inherited from qMRMLSceneModel
QScopedPointer< qMRMLSceneModelPrivate > d_ptr
 

Detailed Description

See also
vtkMRMLAnnotationNode, vtkSlicerAnnotationLogic

Definition at line 39 of file qMRMLSceneAnnotationModel.h.

Member Typedef Documentation

◆ Superclass

Definition at line 77 of file qMRMLSceneAnnotationModel.h.

Property Documentation

◆ annotationsAreParent

bool qMRMLSceneAnnotationModel::annotationsAreParent
readwrite

This property controls whether annotations can have children or not. This is used when setting the active hierarchy node. False by default.

See also
indexHierarchyNode(), vtkSlicerAnnotationModuleLogic::SetActiveHierarchyNodeID()

Definition at line 48 of file qMRMLSceneAnnotationModel.h.

◆ editColumn

int qMRMLSceneAnnotationModel::editColumn
readwrite

This property holds the column index where the button to edit annotation node advanced property is displayed. 3 by default.

See also
editColumn(), setEditColumn(), lockColumn, valueColumn, textColumn

Definition at line 62 of file qMRMLSceneAnnotationModel.h.

◆ lockColumn

int qMRMLSceneAnnotationModel::lockColumn
readwrite

This property holds the column index where the annotation lock property is controlled. 2 by default.

See also
lockColumn(), setLockColumn(), editColumn, valueColumn, textColumn, vtkMRMLAnnotationNode::Locked

Definition at line 56 of file qMRMLSceneAnnotationModel.h.

◆ textColumn

int qMRMLSceneAnnotationModel::textColumn
readwrite

This property holds the column index where the annotation description is displayed. 6 by default.

See also
textColumn(), setTextColumn(), lockColumn, editColumn, valueColumn

Definition at line 74 of file qMRMLSceneAnnotationModel.h.

◆ valueColumn

int qMRMLSceneAnnotationModel::valueColumn
readwrite

This property holds the column index where the annotation measurement is displayed. 4 by default.

See also
valueColumn(), setValueColumn(), lockColumn, editColumn, textColumn

Definition at line 68 of file qMRMLSceneAnnotationModel.h.

Constructor & Destructor Documentation

◆ qMRMLSceneAnnotationModel() [1/2]

qMRMLSceneAnnotationModel::qMRMLSceneAnnotationModel ( QObject *  parent = 0)

◆ ~qMRMLSceneAnnotationModel()

virtual qMRMLSceneAnnotationModel::~qMRMLSceneAnnotationModel ( )
virtual

◆ qMRMLSceneAnnotationModel() [2/2]

qMRMLSceneAnnotationModel::qMRMLSceneAnnotationModel ( qMRMLSceneAnnotationModelPrivate *  pimpl,
QObject *  parent = 0 
)
protected

Member Function Documentation

◆ activeHierarchyNode()

virtual vtkMRMLNode* qMRMLSceneAnnotationModel::activeHierarchyNode ( vtkMRMLNode mrmlNode) const
virtual

Return the best active hierarchy node for a given node. If the node is an annotation node and annotationsAreParent is true, then it returns the associated hierarchy node instead of the parent hierarchy node.

See also
annotationsAreParent

◆ areAnnotationsParent()

bool qMRMLSceneAnnotationModel::areAnnotationsParent ( ) const

Return true if the annotations can have children, false otherwise.

See also
annotationsAreParent, setAnnotationsAreParent()

◆ canBeAParent()

virtual bool qMRMLSceneAnnotationModel::canBeAParent ( vtkMRMLNode node) const
virtual

fast function that only check the type of the node to know if it can be a parent.

Reimplemented from qMRMLSceneDisplayableModel.

◆ editColumn()

int qMRMLSceneAnnotationModel::editColumn ( ) const

Return the edit column.

See also
editColumn, setEditColumn

◆ lockColumn()

int qMRMLSceneAnnotationModel::lockColumn ( ) const

Return the lock column.

See also
lockColumn, setLockColumn

◆ maxColumnId()

virtual int qMRMLSceneAnnotationModel::maxColumnId ( ) const
protectedvirtual

Must be reimplemented in subclasses that add new column types.

Reimplemented from qMRMLSceneDisplayableModel.

◆ nodeFlags()

virtual QFlags<Qt::ItemFlag> qMRMLSceneAnnotationModel::nodeFlags ( vtkMRMLNode node,
int  column 
) const
protectedvirtual

Reimplemented from qMRMLSceneDisplayableModel.

◆ parentNode()

virtual vtkMRMLNode* qMRMLSceneAnnotationModel::parentNode ( vtkMRMLNode node) const
virtual

Returns the parent node of the node, 0 otherwise (the parent is the scene). Must be reimplemented in derived classes. If reimplemented, you might have to reimplement nodeIndex() as well. Returns 0 by default.

See also
nodeIndex(), canBeAChild(), canBeAParent()

Reimplemented from qMRMLSceneDisplayableModel.

◆ setAnnotationsAreParent()

void qMRMLSceneAnnotationModel::setAnnotationsAreParent ( bool  parentable)

Set whether annotations can have children or not.

See also
annotationsAreParent, areAnnotationsParent()

◆ setEditColumn()

void qMRMLSceneAnnotationModel::setEditColumn ( int  column)

Set the edit column. Resizes the number of columns if needed.

See also
editColumn, editColumn()

◆ setLockColumn()

void qMRMLSceneAnnotationModel::setLockColumn ( int  column)

Set the lock column. Resizes the number of columns if needed.

See also
lockColumn, lockColumn()

◆ setLogic()

void qMRMLSceneAnnotationModel::setLogic ( vtkSlicerAnnotationModuleLogic logic)

◆ setTextColumn()

void qMRMLSceneAnnotationModel::setTextColumn ( int  column)

Set the text column. Resizes the number of columns if needed.

See also
textColumn, textColumn()

◆ setValueColumn()

void qMRMLSceneAnnotationModel::setValueColumn ( int  column)

Set the value column. Resizes the number of columns if needed.

See also
valueColumn, valueColumn()

◆ textColumn()

int qMRMLSceneAnnotationModel::textColumn ( ) const

Return the text column.

See also
textColumn, setTextColumn

◆ updateItemDataFromNode()

virtual void qMRMLSceneAnnotationModel::updateItemDataFromNode ( QStandardItem *  item,
vtkMRMLNode node,
int  column 
)
protectedvirtual

To reimplement if you want custom display of the QStandardItem from the MRML node. Example:

void MySceneModel::updateItemDataFromNode(QStandardItem* item, vtkMRMLNode* node, int column)
if (column == 3)
{
item->setText(node->GetFoo());
return;
}
this->Superclass::updateItemDataFromNode(item, node, column);
}
See also
updateNodeFromItemData, updateNodeFromItem, updateItemFromNode, nodeFlags

Reimplemented from qMRMLSceneDisplayableModel.

◆ updateNodeFromItemData()

virtual void qMRMLSceneAnnotationModel::updateNodeFromItemData ( vtkMRMLNode node,
QStandardItem *  item 
)
protectedvirtual

To reimplement if you want to propagate user changes on QStandardItem into the MRML node. Example: void MySceneModel::updateNodeFromItemData(vtkMRMLNode* node, QStandardItem* item) if (column == 3) { node->SetFoo(item->text()); return; } this->Superclass::updateNodeFromItemData(node, item); }

See also
updateItemFromNode, updateNodeFromItemData, updateItemFromNode, nodeFlags

Reimplemented from qMRMLSceneDisplayableModel.

◆ valueColumn()

int qMRMLSceneAnnotationModel::valueColumn ( ) const

Return the value column.

See also
valueColumn, setValueColumn

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