17 #include <QStringList> 21 m_ItemData = lesionData;
26 m_ParentItem = parent;
31 if (m_ParentItem.expired())
36 auto parentItem = m_ParentItem.lock();
37 return parentItem->GetRowOfChild(this->shared_from_this());
42 auto it = std::find(m_Children.begin(), m_Children.end(), child);
43 if (it == m_Children.end())
49 return std::distance(m_Children.begin(), it);
55 auto it = std::find(m_Children.begin(), m_Children.end(), child);
56 if (it == m_Children.end())
59 m_Children.push_back(child);
61 child->SetParent(this->shared_from_this());
67 auto it = std::find(m_Children.begin(), m_Children.end(), child);
68 if (it != m_Children.end())
76 m_ItemData = lesionData;
std::shared_ptr< const QmitkLesionTreeItem > ChildConstPointer
int GetRow() const
Get the row of this item relative to its parent item using 'GetRowOfChild'.
std::weak_ptr< QmitkLesionTreeItem > ParentPointer
void AddChild(ChildPointer child)
Add a new child to the list of children of this item if it is not already a child item...
void SetData(const mitk::LesionData &lesionData)
Set the item data of this item.
int GetRowOfChild(ChildConstPointer child) const
Get the row of the given child item relative to this item.
void RemoveChild(ChildPointer child)
Remove a child from the list of children of this item.
This class holds the data of each lesion in the lesion tree view. The data is the lesion itself with ...
QmitkLesionTreeItem(mitk::LesionData lesionData=mitk::LesionData())
void SetParent(ParentPointer parent)
Set the parent item of this item.
std::shared_ptr< QmitkLesionTreeItem > ChildPointer