Slicer  4.11
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 | Protected Slots | Protected Member Functions | Static Protected Member Functions | Protected Attributes
qMRMLSceneModel Class Reference

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

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

Public Types

enum  ItemDataRole {
  UIDRole = Qt::UserRole + 1, PointerRole, ExtraItemsRole, VisibilityRole,
  LastRole
}
 
enum  NodeTypes { NoNodes = 0, AllNodes, OnlyVisibleNodes }
 
typedef QStandardItemModel Superclass
 

Properties

int checkableColumn
 
int extraItemColumn
 
int idColumn
 
bool lazyUpdate
 
NodeTypes listenNodeModifiedEvent
 
int nameColumn
 
int toolTipNameColumn
 
int visibilityColumn
 

Signals

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

Public Member Functions

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...
 
virtual bool canBeAParent (vtkMRMLNode *node) const
 
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
 
virtual int nodeIndex (vtkMRMLNode *node) const
 
virtual void observeNode (vtkMRMLNode *node)
 
virtual vtkMRMLNodeparentNode (vtkMRMLNode *node) const
 
QStringList postItems (QStandardItem *parent) const
 
QStringList preItems (QStandardItem *parent) const
 
 qMRMLSceneModel (QObject *parent=nullptr)
 
virtual bool reparent (vtkMRMLNode *node, vtkMRMLNode *newParent)
 
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 Slots

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 ()
 

Protected Member Functions

virtual QStandardItem * insertNode (vtkMRMLNode *node)
 
virtual QStandardItem * insertNode (vtkMRMLNode *node, QStandardItem *parent, int row=-1)
 
virtual bool isANode (const QStandardItem *item) const
 
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
 
virtual void populateScene ()
 
 qMRMLSceneModel (qMRMLSceneModelPrivate *pimpl, QObject *parent=nullptr)
 
virtual void updateItemDataFromNode (QStandardItem *item, vtkMRMLNode *node, int column)
 
virtual void updateItemFromNode (QStandardItem *item, vtkMRMLNode *node, int column)
 
virtual void updateNodeFromItem (vtkMRMLNode *node, QStandardItem *item)
 
virtual void updateNodeFromItemData (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 ()
 

Static Protected Member Functions

static void onMRMLSceneEvent (vtkObject *vtk_obj, unsigned long event, void *client_data, void *call_data)
 

Protected Attributes

QScopedPointer< qMRMLSceneModelPrivate > d_ptr
 

Detailed Description

qMRMLSceneModel has at least 1 column with the scene as a top level item. See below an example of model when nameColumn = 0 (default) and idColumn = 1 with 1 postItem ("Add new node"):

///    Column 0           Column 1
///
///  - Scene
///    |- ViewNode        vtkMRMLViewNode1
///    |- CameraNode      vtkMRMLCameraNode1
///    ...
///    |- my_volume.nrrd  vtkMRMLScalarVolumeNode1
///    |- Add new node
/// 

More columns can be added by setting the column index of the different columns: name, id, checkable, visibility, toolTip, extraItem and the ones defined in subclasses. Subclasses must reimplement maxColumnId if they add new column properties

Definition at line 57 of file qMRMLSceneModel.h.

Member Typedef Documentation

◆ Superclass

typedef QStandardItemModel qMRMLSceneModel::Superclass

Definition at line 97 of file qMRMLSceneModel.h.

Member Enumeration Documentation

◆ ItemDataRole

Enumerator
UIDRole 

Unique ID of the item. For nodes, it is the node ID.

PointerRole 

Pointer (as long long) of the item if it is a scene or a node.

ExtraItemsRole 

Map (QMap<QString, QVariant>) for parent items of extra items.

VisibilityRole 

Integer that contains the visibility property of a node. It is closely related to the item icon.

LastRole 

Must stay the last enum in the list.

Definition at line 107 of file qMRMLSceneModel.h.

◆ NodeTypes

Enumerator
NoNodes 
AllNodes 
OnlyVisibleNodes 

Definition at line 101 of file qMRMLSceneModel.h.

Property Documentation

◆ checkableColumn

int qMRMLSceneModel::checkableColumn
readwrite

Control in which column vtkMRMLNode::Selected are displayed (Qt::CheckStateRole). A value of -1 hides it. Hidden by default (value of -1).

Definition at line 86 of file qMRMLSceneModel.h.

◆ extraItemColumn

int qMRMLSceneModel::extraItemColumn
readwrite

Control in which column the extra items are displayed A value of -1 hides it (not tested). 0 by default

Definition at line 95 of file qMRMLSceneModel.h.

◆ idColumn

int qMRMLSceneModel::idColumn
readwrite

Control in which column vtkMRMLNode IDs are displayed (Qt::DisplayRole). A value of -1 hides it. Hidden by default (value of -1)

Definition at line 83 of file qMRMLSceneModel.h.

◆ lazyUpdate

bool qMRMLSceneModel::lazyUpdate
readwrite

Control whether the model actively listens to the scene. If LazyUpdate is true, the model ignores added node events when the scene is importing/restoring, but synchronize with the scene once its imported/restored.

Definition at line 75 of file qMRMLSceneModel.h.

◆ listenNodeModifiedEvent

NodeTypes qMRMLSceneModel::listenNodeModifiedEvent
readwrite

This property controls whether to observe or not the modified event of the node and update the node item data accordingly. It can be useful when the modified property is displayed (name, id, visibility...) OnlyVisibleNodes by default

Definition at line 69 of file qMRMLSceneModel.h.

◆ nameColumn

int qMRMLSceneModel::nameColumn
readwrite

Control in which column vtkMRMLNode names are displayed (Qt::DisplayRole). A value of -1 hides it. First column (0) by default. If no property is set in a column, nothing is displayed.

Definition at line 80 of file qMRMLSceneModel.h.

◆ toolTipNameColumn

int qMRMLSceneModel::toolTipNameColumn
readwrite

Control in which column tooltips are displayed (Qt::ToolTipRole). A value of -1 hides it. Hidden by default (value of -1).

Definition at line 92 of file qMRMLSceneModel.h.

◆ visibilityColumn

int qMRMLSceneModel::visibilityColumn
readwrite

Control in which column vtkMRMLNode::Visibility are displayed (Qt::DecorationRole). A value of -1 hides it. Hidden by default (value of -1).

Definition at line 89 of file qMRMLSceneModel.h.

Constructor & Destructor Documentation

◆ qMRMLSceneModel() [1/2]

qMRMLSceneModel::qMRMLSceneModel ( QObject *  parent = nullptr)

◆ ~qMRMLSceneModel()

qMRMLSceneModel::~qMRMLSceneModel ( )
override

◆ qMRMLSceneModel() [2/2]

qMRMLSceneModel::qMRMLSceneModel ( qMRMLSceneModelPrivate *  pimpl,
QObject *  parent = nullptr 
)
protected

Member Function Documentation

◆ aboutToReparentByDragAndDrop

void qMRMLSceneModel::aboutToReparentByDragAndDrop ( vtkMRMLNode node,
vtkMRMLNode newParent 
)
signal

This signal is sent when a user is about to reparent a Node by a drag and drop

◆ canBeAChild()

virtual bool qMRMLSceneModel::canBeAChild ( vtkMRMLNode node) const
virtual

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

Reimplemented in qMRMLSceneDisplayableModel, qMRMLSceneHierarchyModel, and qMRMLSceneTransformModel.

◆ canBeAParent()

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

Must be reimplemented in derived classes Returns false in qMRMLSceneModel

Reimplemented in qMRMLSceneAnnotationModel, qMRMLSceneDisplayableModel, qMRMLSceneHierarchyModel, and qMRMLSceneTransformModel.

◆ checkableColumn()

int qMRMLSceneModel::checkableColumn ( ) const

◆ delayedItemChanged

virtual void qMRMLSceneModel::delayedItemChanged ( )
protectedvirtualslot

◆ dropMimeData()

bool qMRMLSceneModel::dropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  row,
int  column,
const QModelIndex &  parent 
)
override

◆ extraItemColumn()

int qMRMLSceneModel::extraItemColumn ( ) const

◆ idColumn()

int qMRMLSceneModel::idColumn ( ) const

◆ indexes()

QModelIndexList qMRMLSceneModel::indexes ( vtkMRMLNode node) const

◆ indexFromNode()

QModelIndex qMRMLSceneModel::indexFromNode ( vtkMRMLNode node,
int  column = 0 
) const

◆ insertNode() [1/2]

virtual QStandardItem* qMRMLSceneModel::insertNode ( vtkMRMLNode node)
protectedvirtual

Reimplemented in qMRMLSceneCategoryModel.

◆ insertNode() [2/2]

virtual QStandardItem* qMRMLSceneModel::insertNode ( vtkMRMLNode node,
QStandardItem *  parent,
int  row = -1 
)
protectedvirtual

◆ isAffiliatedNode()

bool qMRMLSceneModel::isAffiliatedNode ( vtkMRMLNode nodeA,
vtkMRMLNode nodeB 
) const

Utility method that returns true if 2 nodes are child/parent for each other. It can be grandchild, great grand child...

See also
isParentNode()

◆ isANode()

virtual bool qMRMLSceneModel::isANode ( const QStandardItem *  item) const
protectedvirtual

Reimplemented in qMRMLSceneCategoryModel.

◆ isParentNode()

bool qMRMLSceneModel::isParentNode ( vtkMRMLNode child,
vtkMRMLNode parent 
) const

Utility method that returns true if child has parent as parent, grandparent, great grandparent etc...

See also
isAffiliatedNode()

◆ itemFromNode()

QStandardItem* qMRMLSceneModel::itemFromNode ( vtkMRMLNode node,
int  column = 0 
) const

◆ lazyUpdate()

bool qMRMLSceneModel::lazyUpdate ( ) const

◆ listenNodeModifiedEvent()

NodeTypes qMRMLSceneModel::listenNodeModifiedEvent ( ) const

Get the types of nodes that are observed.

See also
listenNodeModifiedEvent, setListenNodeModifiedEvent()

◆ maxColumnId()

virtual int qMRMLSceneModel::maxColumnId ( ) const
protectedvirtual

Must be reimplemented in subclasses that add new column types.

Reimplemented in qMRMLSceneAnnotationModel, qMRMLSceneDisplayableModel, and qMRMLSceneHierarchyModel.

◆ mimeData()

QMimeData* qMRMLSceneModel::mimeData ( const QModelIndexList &  indexes) const
override

◆ mrmlNodeFromIndex()

vtkMRMLNode * qMRMLSceneModel::mrmlNodeFromIndex ( const QModelIndex &  nodeIndex) const
inline

Return the vtkMRMLNode associated to the node index. 0 if the node index is not a MRML node (i.e. vtkMRMLScene, extra item...)

Definition at line 341 of file qMRMLSceneModel.h.

◆ mrmlNodeFromItem()

vtkMRMLNode* qMRMLSceneModel::mrmlNodeFromItem ( QStandardItem *  nodeItem) const

◆ mrmlScene()

Q_INVOKABLE vtkMRMLScene* qMRMLSceneModel::mrmlScene ( ) const

◆ mrmlSceneIndex()

QModelIndex qMRMLSceneModel::mrmlSceneIndex ( ) const

invalid until a valid scene is set

◆ mrmlSceneItem()

QStandardItem* qMRMLSceneModel::mrmlSceneItem ( ) const

0 until a valid scene is set

◆ nameColumn()

int qMRMLSceneModel::nameColumn ( ) const

◆ nodeFlags()

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

◆ nodeIndex()

virtual int qMRMLSceneModel::nodeIndex ( vtkMRMLNode node) const
virtual

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

Reimplemented in qMRMLSceneHierarchyModel.

◆ observeNode()

virtual void qMRMLSceneModel::observeNode ( vtkMRMLNode node)
virtual

Observe node and update item when the node is modified.

See also
listenNodeModifiedEvent

Reimplemented in qMRMLSceneDisplayableModel, and qMRMLSceneHierarchyModel.

◆ onItemChanged

virtual void qMRMLSceneModel::onItemChanged ( QStandardItem *  item)
protectedvirtualslot

◆ onMRMLNodeIDChanged

void qMRMLSceneModel::onMRMLNodeIDChanged ( vtkObject *  node,
void *  callData 
)
protectedslot

The node has its ID changed. The scene model needs to update the UIDRole associated with the node in order to keep being in sync.

◆ onMRMLNodeModified

void qMRMLSceneModel::onMRMLNodeModified ( vtkObject *  node)
protectedslot

◆ onMRMLSceneAboutToBeClosed

virtual void qMRMLSceneModel::onMRMLSceneAboutToBeClosed ( vtkMRMLScene scene)
protectedvirtualslot

◆ onMRMLSceneAboutToBeImported

virtual void qMRMLSceneModel::onMRMLSceneAboutToBeImported ( vtkMRMLScene scene)
protectedvirtualslot

◆ onMRMLSceneClosed

virtual void qMRMLSceneModel::onMRMLSceneClosed ( vtkMRMLScene scene)
protectedvirtualslot

◆ onMRMLSceneDeleted

void qMRMLSceneModel::onMRMLSceneDeleted ( vtkObject *  scene)
protectedslot

◆ onMRMLSceneEndBatchProcess

virtual void qMRMLSceneModel::onMRMLSceneEndBatchProcess ( vtkMRMLScene scene)
protectedvirtualslot

◆ onMRMLSceneEvent()

static void qMRMLSceneModel::onMRMLSceneEvent ( vtkObject *  vtk_obj,
unsigned long  event,
void *  client_data,
void *  call_data 
)
staticprotected

◆ onMRMLSceneImported

virtual void qMRMLSceneModel::onMRMLSceneImported ( vtkMRMLScene scene)
protectedvirtualslot

◆ onMRMLSceneNodeAboutToBeAdded

virtual void qMRMLSceneModel::onMRMLSceneNodeAboutToBeAdded ( vtkMRMLScene scene,
vtkMRMLNode node 
)
protectedvirtualslot

◆ onMRMLSceneNodeAboutToBeRemoved

virtual void qMRMLSceneModel::onMRMLSceneNodeAboutToBeRemoved ( vtkMRMLScene scene,
vtkMRMLNode node 
)
protectedvirtualslot

◆ onMRMLSceneNodeAdded

virtual void qMRMLSceneModel::onMRMLSceneNodeAdded ( vtkMRMLScene scene,
vtkMRMLNode node 
)
protectedvirtualslot

◆ onMRMLSceneNodeRemoved

virtual void qMRMLSceneModel::onMRMLSceneNodeRemoved ( vtkMRMLScene scene,
vtkMRMLNode node 
)
protectedvirtualslot

◆ onMRMLSceneStartBatchProcess

virtual void qMRMLSceneModel::onMRMLSceneStartBatchProcess ( vtkMRMLScene scene)
protectedvirtualslot

◆ parentNode()

virtual vtkMRMLNode* qMRMLSceneModel::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 in qMRMLSceneAnnotationModel, qMRMLSceneDisplayableModel, qMRMLSceneHierarchyModel, and qMRMLSceneTransformModel.

◆ populateScene()

virtual void qMRMLSceneModel::populateScene ( )
protectedvirtual

◆ postItems()

QStringList qMRMLSceneModel::postItems ( QStandardItem *  parent) const

◆ preItems()

QStringList qMRMLSceneModel::preItems ( QStandardItem *  parent) const

◆ reparent()

virtual bool qMRMLSceneModel::reparent ( vtkMRMLNode node,
vtkMRMLNode newParent 
)
virtual

Must be reimplemented in derived classes. Doesn't reparent and returns false by qMRMLSceneModel

Reimplemented in qMRMLSceneHierarchyModel, and qMRMLSceneTransformModel.

◆ reparentedByDragAndDrop

void qMRMLSceneModel::reparentedByDragAndDrop ( vtkMRMLNode node,
vtkMRMLNode newParent 
)
signal

This signal is sent after a user dragged and dropped a Node in the qMRMLTreeView

◆ sceneAboutToBeUpdated

void qMRMLSceneModel::sceneAboutToBeUpdated ( )
signal

This signal is sent when the scene is about to be updated.

◆ sceneUpdated

void qMRMLSceneModel::sceneUpdated ( )
signal

This signal is sent after the scene is updated.

◆ setCheckableColumn()

void qMRMLSceneModel::setCheckableColumn ( int  column)

◆ setExtraItemColumn()

void qMRMLSceneModel::setExtraItemColumn ( int  column)

◆ setIDColumn()

void qMRMLSceneModel::setIDColumn ( int  column)

◆ setLazyUpdate()

void qMRMLSceneModel::setLazyUpdate ( bool  lazy)

◆ setListenNodeModifiedEvent()

void qMRMLSceneModel::setListenNodeModifiedEvent ( NodeTypes  nodesToListen)

Option that activates the expensive listening of the vtkMRMLNode Modified events. When listening, the signal itemDataChanged() is fired when a vtkMRMLNode is modified.

See also
listenNodeModifiedEvent, listenNodeModifiedEvent()

◆ setMRMLScene()

virtual Q_INVOKABLE void qMRMLSceneModel::setMRMLScene ( vtkMRMLScene scene)
virtual

0 by default

◆ setNameColumn()

void qMRMLSceneModel::setNameColumn ( int  column)

◆ setPostItems()

void qMRMLSceneModel::setPostItems ( const QStringList &  extraItems,
QStandardItem *  parent 
)

Extra items that are appended to the node list Warning, setPostItems() resets the model, the currently selected item is lost

◆ setPreItems()

void qMRMLSceneModel::setPreItems ( const QStringList &  extraItems,
QStandardItem *  parent 
)

Extra items that are prepended to the node list Warning, setPreItems() resets the model, the currently selected item is lost

◆ setToolTipNameColumn()

void qMRMLSceneModel::setToolTipNameColumn ( int  column)

◆ setVisibilityColumn()

void qMRMLSceneModel::setVisibilityColumn ( int  column)

◆ supportedDropActions()

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

Doesn't support drop actions, scene model subclasses can support drop actions though.

◆ toolTipNameColumn()

int qMRMLSceneModel::toolTipNameColumn ( ) const

◆ updateColumnCount

void qMRMLSceneModel::updateColumnCount ( )
protectedslot

Recompute the number of columns in the model. To be called when a XXXColumn is set. Needs maxColumnId() to be reimplemented in subclasses

◆ updateItemDataFromNode()

virtual void qMRMLSceneModel::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 in qMRMLSceneAnnotationModel, qMRMLSceneDisplayableModel, and qMRMLSceneHierarchyModel.

◆ updateItemFromNode()

virtual void qMRMLSceneModel::updateItemFromNode ( QStandardItem *  item,
vtkMRMLNode node,
int  column 
)
protectedvirtual

Generic function that updates the item data and flags from the node. You probably want to reimplement updateItemDataFromNode() instead.

See also
updateNodeFromItemData, updateNodeFromItem, updateItemDataFromNode, nodeFlags

Reimplemented in qMRMLSceneCategoryModel, and qMRMLSceneColorTableModel.

◆ updateNodeFromItem()

virtual void qMRMLSceneModel::updateNodeFromItem ( vtkMRMLNode node,
QStandardItem *  item 
)
protectedvirtual

Generic function that updates the node from the item data and flags. You probably want to reimplement updateNodeFromItemData() instead.

See also
updateItemDataFromNode, updateNodeFromItemData, updateItemFromNode, nodeFlags

Reimplemented in qMRMLSceneCategoryModel.

◆ updateNodeFromItemData()

virtual void qMRMLSceneModel::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 in qMRMLSceneAnnotationModel, qMRMLSceneDisplayableModel, and qMRMLSceneHierarchyModel.

◆ updateNodeItems() [1/2]

void qMRMLSceneModel::updateNodeItems ( )
protected

You shouldn't need to call this function.

◆ updateNodeItems() [2/2]

void qMRMLSceneModel::updateNodeItems ( vtkMRMLNode node,
const QString &  uid 
)
protected

Update the items associated with the node and uid.

◆ updateScene()

virtual void qMRMLSceneModel::updateScene ( )
protectedvirtual

◆ visibilityColumn()

int qMRMLSceneModel::visibilityColumn ( ) const

Member Data Documentation

◆ d_ptr

QScopedPointer<qMRMLSceneModelPrivate> qMRMLSceneModel::d_ptr
protected

Definition at line 330 of file qMRMLSceneModel.h.


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