Medical Imaging Interaction Toolkit
2024.06.00
Medical Imaging Interaction Toolkit
|
#include <QmitkDataStorageTreeModel.h>
Signals | |
void | nodeVisibilityChanged () |
Public Member Functions | |
QmitkDataStorageTreeModel (mitk::DataStorage *_DataStorage, bool _PlaceNewNodesOnTop=false, QObject *parent=nullptr) | |
~QmitkDataStorageTreeModel () override | |
mitk::DataNode::Pointer | GetNode (const QModelIndex &index) const |
virtual QList< mitk::DataNode::Pointer > | GetNodeSet () const |
const mitk::DataStorage::Pointer | GetDataStorage () const |
bool | GetPlaceNewNodesOnTopFlag () |
void | SetPlaceNewNodesOnTop (bool _PlaceNewNodesOnTop) |
Qt::ItemFlags | flags (const QModelIndex &index) const override |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
QModelIndex | parent (const QModelIndex &index) const override |
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
bool | setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole) override |
bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override |
Qt::DropActions | supportedDropActions () const override |
Qt::DropActions | supportedDragActions () const override |
QStringList | mimeTypes () const override |
QMimeData * | mimeData (const QModelIndexList &indexes) const override |
void | SetDataStorage (mitk::DataStorage *_DataStorage) |
void | SetDataStorageDeleted () |
virtual void | AddNode (const mitk::DataNode *node) |
virtual void | RemoveNode (const mitk::DataNode *node) |
virtual void | SetNodeModified (const mitk::DataNode *node) |
QModelIndex | GetIndex (const mitk::DataNode *) const |
void | SetAllowHierarchyChange (bool allowHierarchyChange) |
Set whether to allow hierarchy changes by dragging and dropping. More... | |
Static Public Member Functions | |
static QMimeData * | mimeDataFromModelIndexList (const QModelIndexList &indexes) |
Static Public Attributes | |
static const std::string | COLUMN_NAME |
static const std::string | COLUMN_TYPE |
static const std::string | COLUMN_VISIBILITY |
Protected Types | |
using | TreeItem = QmitkDataStorageTreeModelInternalItem |
Protected Member Functions | |
QList< TreeItem * > | ToTreeItemPtrList (const QMimeData *mimeData) |
QList< TreeItem * > | ToTreeItemPtrList (const QByteArray &ba) |
void | AdjustLayerProperty () |
TreeItem * | TreeItemFromIndex (const QModelIndex &index) const |
QModelIndex | IndexFromTreeItem (TreeItem *) const |
mitk::DataNode * | GetParentNode (const mitk::DataNode *node) const |
void | TreeToVector (TreeItem *parent, std::vector< TreeItem * > &vec) const |
void | TreeToNodeSet (TreeItem *parent, QList< mitk::DataNode::Pointer > &vec) const |
void | Update () |
Protected Attributes | |
mitk::WeakPointer< mitk::DataStorage > | m_DataStorage |
mitk::NodePredicateBase::Pointer | m_Predicate |
bool | m_PlaceNewNodesOnTop |
TreeItem * | m_Root |
bool | m_BlockDataStorageEvents |
Flag to block the data storage events if nodes are added/removed by this class. More... | |
bool | m_AllowHierarchyChange |
Definition at line 39 of file QmitkDataStorageTreeModel.h.
|
protected |
Definition at line 147 of file QmitkDataStorageTreeModel.h.
QmitkDataStorageTreeModel::QmitkDataStorageTreeModel | ( | mitk::DataStorage * | _DataStorage, |
bool | _PlaceNewNodesOnTop = false , |
||
QObject * | parent = nullptr |
||
) |
|
override |
|
virtual |
Adds a node to this model. If a predicate is set (not null) the node will be checked against it.The node has to have a data object (no one wants to see empty nodes).
|
protected |
Adjusts the LayerProperty according to the nodes position
|
override |
|
override |
|
override |
|
override |
const mitk::DataStorage::Pointer QmitkDataStorageTreeModel::GetDataStorage | ( | ) | const |
Get the DataStorage.
QModelIndex QmitkDataStorageTreeModel::GetIndex | ( | const mitk::DataNode * | ) | const |
mitk::DataNode::Pointer QmitkDataStorageTreeModel::GetNode | ( | const QModelIndex & | index | ) | const |
Get node at a specific model index. This function is used to get a node from a QModelIndex
|
virtual |
Returns a copy of the node-vector that is shown by this model
|
protected |
Returns the first element in the nodes sources list (if available) or 0
|
inline |
Get the top placement flag
Definition at line 73 of file QmitkDataStorageTreeModel.h.
|
override |
|
override |
called whenever the model or the view needs to create a QModelIndex for a particular child item (or a top-level item if parent is an invalid QModelIndex)
|
protected |
Gives a ModelIndex for the Tree Item
|
override |
|
static |
|
override |
|
signal |
|
override |
|
virtual |
Removes a node from this model. Also removes any event listener from the node.
|
override |
void QmitkDataStorageTreeModel::SetAllowHierarchyChange | ( | bool | allowHierarchyChange | ) |
Set whether to allow hierarchy changes by dragging and dropping.
|
override |
void QmitkDataStorageTreeModel::SetDataStorage | ( | mitk::DataStorage * | _DataStorage | ) |
Sets the DataStorage. The whole model will be reset.
void QmitkDataStorageTreeModel::SetDataStorageDeleted | ( | ) |
Notify that the DataStorage was deleted. The whole model will be reset.
|
override |
|
virtual |
Sets a node to modified. Called by the DataStorage
void QmitkDataStorageTreeModel::SetPlaceNewNodesOnTop | ( | bool | _PlaceNewNodesOnTop | ) |
Set the top placement flag
|
override |
|
override |
|
protected |
|
protected |
|
protected |
invoked after m_DataStorage or m_Predicate changed
|
protected |
Adds all Childs in parent to vec. Before a child is added the function is called recursively
|
protected |
Adds all Childs in parent to vec. Before a child is added the function is called recursively
|
protected |
Update Tree Model
|
static |
Definition at line 45 of file QmitkDataStorageTreeModel.h.
|
static |
Definition at line 46 of file QmitkDataStorageTreeModel.h.
|
static |
Definition at line 47 of file QmitkDataStorageTreeModel.h.
|
protected |
This decides whether or not it is allowed to assign a different parent to a node If it is false, it is not possible to change the hierarchy of nodes by dragging and dropping. If it is true, dragging nodes on another node will replace all of their parents with that one.
Definition at line 196 of file QmitkDataStorageTreeModel.h.
|
protected |
Flag to block the data storage events if nodes are added/removed by this class.
Definition at line 189 of file QmitkDataStorageTreeModel.h.
|
protected |
Definition at line 183 of file QmitkDataStorageTreeModel.h.
|
protected |
Definition at line 185 of file QmitkDataStorageTreeModel.h.
|
protected |
Definition at line 184 of file QmitkDataStorageTreeModel.h.
|
protected |
Definition at line 186 of file QmitkDataStorageTreeModel.h.