Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkDataStorageTreeModel::TreeItem Class Reference

#include <QmitkDataStorageTreeModel.h>

Collaboration diagram for QmitkDataStorageTreeModel::TreeItem:

Public Member Functions

 TreeItem (mitk::DataNode *_DataNode, TreeItem *_Parent=0)
 
virtual ~TreeItem ()
 
int IndexOfChild (const TreeItem *item) const
 
TreeItemGetChild (int index) const
 
TreeItemFind (const mitk::DataNode *_DataNode) const
 
int GetChildCount () const
 
int GetIndex () const
 
TreeItemGetParent () const
 
mitk::DataNode::Pointer GetDataNode () const
 
std::vector< TreeItem * > GetChildren () const
 
void AddChild (TreeItem *item)
 
void RemoveChild (TreeItem *item)
 
void InsertChild (TreeItem *item, int index=-1)
 
void SetParent (TreeItem *_Parent)
 Sets the parent on the treeitem. More...
 
void Delete ()
 

Protected Attributes

TreeItemm_Parent
 
std::vector< TreeItem * > m_Children
 
mitk::DataNode::Pointer m_DataNode
 

Detailed Description

Helper class to represent a tree structure of DataNodes

Definition at line 140 of file QmitkDataStorageTreeModel.h.

Constructor & Destructor Documentation

QmitkDataStorageTreeModel::TreeItem::TreeItem ( mitk::DataNode _DataNode,
TreeItem _Parent = 0 
)

Constructs a new TreeItem with the given DataNode (must not be 0)

Definition at line 868 of file QmitkDataStorageTreeModel.cpp.

References AddChild(), and m_Parent.

QmitkDataStorageTreeModel::TreeItem::~TreeItem ( )
virtual

Removes itself as child from its parent-> Does not delete its children

See also
Delete()

Definition at line 875 of file QmitkDataStorageTreeModel.cpp.

Member Function Documentation

void QmitkDataStorageTreeModel::TreeItem::AddChild ( TreeItem item)

add another item as a child of this (only if not already in that list)

Definition at line 920 of file QmitkDataStorageTreeModel.cpp.

Referenced by SetParent(), and TreeItem().

void QmitkDataStorageTreeModel::TreeItem::Delete ( )
QmitkDataStorageTreeModel::TreeItem * QmitkDataStorageTreeModel::TreeItem::Find ( const mitk::DataNode _DataNode) const

Find the TreeItem containing a special tree node (recursive tree function)

Definition at line 889 of file QmitkDataStorageTreeModel.cpp.

References Find().

Referenced by QmitkDataStorageTreeModel::AddNode(), Find(), QmitkDataStorageTreeModel::GetIndex(), and QmitkDataStorageTreeModel::SetNodeModified().

QmitkDataStorageTreeModel::TreeItem * QmitkDataStorageTreeModel::TreeItem::GetChild ( int  index) const
Returns
The child at pos index or 0 if it not exists

Definition at line 915 of file QmitkDataStorageTreeModel.cpp.

Referenced by QmitkDataStorageTreeModel::index(), QmitkDataStorageTreeModel::TreeToNodeSet(), and QmitkDataStorageTreeModel::TreeToVector().

int QmitkDataStorageTreeModel::TreeItem::GetChildCount ( ) const
std::vector< QmitkDataStorageTreeModel::TreeItem * > QmitkDataStorageTreeModel::TreeItem::GetChildren ( ) const

Get all children as vector

Definition at line 978 of file QmitkDataStorageTreeModel.cpp.

int QmitkDataStorageTreeModel::TreeItem::GetIndex ( ) const
QmitkDataStorageTreeModel::TreeItem * QmitkDataStorageTreeModel::TreeItem::GetParent ( ) const
int QmitkDataStorageTreeModel::TreeItem::IndexOfChild ( const TreeItem item) const

Find the index of an item

Definition at line 909 of file QmitkDataStorageTreeModel.cpp.

void QmitkDataStorageTreeModel::TreeItem::InsertChild ( TreeItem item,
int  index = -1 
)

inserts a child at the given position. if pos is not in range the element is added at the end

Definition at line 958 of file QmitkDataStorageTreeModel.cpp.

References GetParent(), and SetParent().

Referenced by QmitkDataStorageTreeModel::dropMimeData().

void QmitkDataStorageTreeModel::TreeItem::RemoveChild ( TreeItem item)

remove another item as child from this

Definition at line 925 of file QmitkDataStorageTreeModel.cpp.

References SetParent().

Referenced by QmitkDataStorageTreeModel::dropMimeData().

void QmitkDataStorageTreeModel::TreeItem::SetParent ( TreeItem _Parent)

Sets the parent on the treeitem.

Definition at line 983 of file QmitkDataStorageTreeModel.cpp.

References AddChild().

Referenced by InsertChild(), and RemoveChild().

Member Data Documentation

std::vector<TreeItem *> QmitkDataStorageTreeModel::TreeItem::m_Children
protected

Definition at line 207 of file QmitkDataStorageTreeModel.h.

mitk::DataNode::Pointer QmitkDataStorageTreeModel::TreeItem::m_DataNode
protected

Definition at line 208 of file QmitkDataStorageTreeModel.h.

TreeItem* QmitkDataStorageTreeModel::TreeItem::m_Parent
protected

Definition at line 206 of file QmitkDataStorageTreeModel.h.

Referenced by TreeItem().


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