Slicer  5.3
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
qMRMLSceneHierarchyModel Class Reference

#include <Libs/MRML/Widgets/qMRMLSceneHierarchyModel.h>

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

Public Types

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

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

bool canBeAChild (vtkMRMLNode *node) const override
 fast function that only check the type of the node to know if it can be a child. More...
 
bool canBeAParent (vtkMRMLNode *node) const override
 fast function that only check the type of the node to know if it can be a parent. More...
 
int expandColumn () const
 
int nodeIndex (vtkMRMLNode *node) const override
 
vtkMRMLNodeparentNode (vtkMRMLNode *node) const override
 
 qMRMLSceneHierarchyModel (QObject *parent=nullptr)
 
bool reparent (vtkMRMLNode *node, vtkMRMLNode *newParent) override
 if newParent == 0, set the node into the vtkMRMLScene More...
 
void setExpandColumn (int column)
 
Qt::DropActions supportedDropActions () const override
 
 ~qMRMLSceneHierarchyModel () override
 
- Public Member Functions inherited from qMRMLSceneModel
int checkableColumn () const
 
bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
 
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
 
QMimeData * mimeData (const QModelIndexList &indexes) const override
 
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=nullptr)
 
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)
 
Qt::DropActions supportedDropActions () const override
 
int toolTipNameColumn () const
 
int visibilityColumn () const
 
 ~qMRMLSceneModel () override
 

Protected Member Functions

int maxColumnId () const override
 Must be reimplemented in subclasses that add new column types. More...
 
QFlags< Qt::ItemFlag > nodeFlags (vtkMRMLNode *node, int column) const override
 
void observeNode (vtkMRMLNode *node) override
 
 qMRMLSceneHierarchyModel (qMRMLSceneHierarchyModelPrivate *pimpl, QObject *parent=nullptr)
 
void updateItemDataFromNode (QStandardItem *item, vtkMRMLNode *node, int column) override
 Reimplemented to add expandColumn support. More...
 
void updateNodeFromItemData (vtkMRMLNode *node, QStandardItem *item) override
 Reimplemented to add expandColumn support. More...
 
- 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=nullptr)
 
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 (vtkMRMLScene *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

Definition at line 28 of file qMRMLSceneHierarchyModel.h.

Member Typedef Documentation

◆ Superclass

Definition at line 41 of file qMRMLSceneHierarchyModel.h.

Property Documentation

◆ expandColumn

int qMRMLSceneHierarchyModel::expandColumn
readwrite

Control in which column vtkMRMLHierarchyNode is displayed (Qt::CheckStateRole) A value of -1 hides it. Hidden (-1) by default. Note that the expand column should be different than checkableColumn if not both set to -1. The Expanded property is on vtkMRMLDisplayableHierarchyNode.

Todo:
Move the Expanded property to vtkMRMLHierarchyNode.
See also
nameColumn, idColumn, checkableColumn, visibilityColumn...

Definition at line 38 of file qMRMLSceneHierarchyModel.h.

Constructor & Destructor Documentation

◆ qMRMLSceneHierarchyModel() [1/2]

qMRMLSceneHierarchyModel::qMRMLSceneHierarchyModel ( QObject *  parent = nullptr)

◆ ~qMRMLSceneHierarchyModel()

qMRMLSceneHierarchyModel::~qMRMLSceneHierarchyModel ( )
override

◆ qMRMLSceneHierarchyModel() [2/2]

qMRMLSceneHierarchyModel::qMRMLSceneHierarchyModel ( qMRMLSceneHierarchyModelPrivate *  pimpl,
QObject *  parent = nullptr 
)
protected

Member Function Documentation

◆ canBeAChild()

bool qMRMLSceneHierarchyModel::canBeAChild ( vtkMRMLNode node) const
overridevirtual

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

Reimplemented from qMRMLSceneModel.

◆ canBeAParent()

bool qMRMLSceneHierarchyModel::canBeAParent ( vtkMRMLNode node) const
overridevirtual

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

Reimplemented from qMRMLSceneModel.

Reimplemented in qMRMLSceneAnnotationModel.

◆ expandColumn()

int qMRMLSceneHierarchyModel::expandColumn ( ) const

◆ maxColumnId()

int qMRMLSceneHierarchyModel::maxColumnId ( ) const
overrideprotectedvirtual

Must be reimplemented in subclasses that add new column types.

Reimplemented from qMRMLSceneModel.

Reimplemented in qMRMLSceneAnnotationModel.

◆ nodeFlags()

QFlags<Qt::ItemFlag> qMRMLSceneHierarchyModel::nodeFlags ( vtkMRMLNode node,
int  column 
) const
overrideprotectedvirtual

Reimplemented from qMRMLSceneModel.

Reimplemented in qMRMLSceneAnnotationModel.

◆ nodeIndex()

int qMRMLSceneHierarchyModel::nodeIndex ( vtkMRMLNode node) const
overridevirtual

Returns the row model index relative to its parent node independently of any filtering or proxy model. Must be reimplemented in derived classes

Reimplemented from qMRMLSceneModel.

◆ observeNode()

void qMRMLSceneHierarchyModel::observeNode ( vtkMRMLNode node)
overrideprotectedvirtual

Observe node and update item when the node is modified.

See also
listenNodeModifiedEvent

Reimplemented from qMRMLSceneModel.

◆ parentNode()

vtkMRMLNode* qMRMLSceneHierarchyModel::parentNode ( vtkMRMLNode node) const
overridevirtual

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 qMRMLSceneModel.

Reimplemented in qMRMLSceneAnnotationModel.

◆ reparent()

bool qMRMLSceneHierarchyModel::reparent ( vtkMRMLNode node,
vtkMRMLNode newParent 
)
overridevirtual

if newParent == 0, set the node into the vtkMRMLScene

Reimplemented from qMRMLSceneModel.

◆ setExpandColumn()

void qMRMLSceneHierarchyModel::setExpandColumn ( int  column)

◆ supportedDropActions()

Qt::DropActions qMRMLSceneHierarchyModel::supportedDropActions ( ) const
override

◆ updateItemDataFromNode()

void qMRMLSceneHierarchyModel::updateItemDataFromNode ( QStandardItem *  item,
vtkMRMLNode node,
int  column 
)
overrideprotectedvirtual

Reimplemented to add expandColumn support.

Reimplemented from qMRMLSceneModel.

Reimplemented in qMRMLSceneAnnotationModel.

◆ updateNodeFromItemData()

void qMRMLSceneHierarchyModel::updateNodeFromItemData ( vtkMRMLNode node,
QStandardItem *  item 
)
overrideprotectedvirtual

Reimplemented to add expandColumn support.

Reimplemented from qMRMLSceneModel.

Reimplemented in qMRMLSceneAnnotationModel.


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