![]() |
OGS
|
|
Objects nodes for the TreeModel.
The TreeItem class provides simple items that contain several pieces of data, and which can provide information about their parent and child items
Definition at line 16 of file TreeItem.h.
#include <TreeItem.h>
Public Member Functions | |
| TreeItem (QList< QVariant > data, TreeItem *parent) | |
| virtual | ~TreeItem () |
| void | appendChild (TreeItem *item) |
| TreeItem * | child (int row) const |
| virtual int | childCount () const |
| virtual int | columnCount () const |
| virtual QVariant | data (int column) const |
| virtual bool | setData (int column, const QVariant &value) |
| int | row () const |
| TreeItem * | parentItem () const |
| bool | removeChildren (int position, int count) |
Private Attributes | |
| QList< TreeItem * > | _childItems |
| QList< QVariant > | _itemData |
| TreeItem * | _parentItem |
| TreeItem::TreeItem | ( | QList< QVariant > | data, |
| TreeItem * | parent ) |
The constructor is only used to record the item's parent and the data associated with each column.
Definition at line 12 of file TreeItem.cpp.
References TreeItem(), _itemData, _parentItem, and data().
Referenced by CondItem::CondItem(), GeoObjectListItem::GeoObjectListItem(), GeoObjectListItem::GeoObjectListItem(), GeoObjectListItem::GeoObjectListItem(), GeoTreeItem::GeoTreeItem(), MeshItem::MeshItem(), ModelTreeItem::ModelTreeItem(), ProcessVarItem::ProcessVarItem(), TreeItem(), VtkVisImageItem::VtkVisImageItem(), VtkVisImageItem::VtkVisImageItem(), VtkVisPipelineItem::VtkVisPipelineItem(), VtkVisPipelineItem::VtkVisPipelineItem(), VtkVisPointSetItem::VtkVisPointSetItem(), VtkVisPointSetItem::VtkVisPointSetItem(), appendChild(), child(), VtkVisPipelineItem::child(), parentItem(), and row().
|
virtual |
A pointer to each of the child items belonging to this item will be stored in the _childItems private member variable. When the class's destructor is called, it must delete each of these to ensure that their memory is reused.
Definition at line 23 of file TreeItem.cpp.
References _childItems.
| void TreeItem::appendChild | ( | TreeItem * | item | ) |
Add a child to the tree item
Definition at line 31 of file TreeItem.cpp.
References TreeItem(), and _childItems.
Referenced by GeoTreeModel::addChildren(), GeoTreeModel::addChildren(), VtkVisPipeline::addPipelineItem(), GeoTreeModel::addPolylineList(), GeoTreeModel::addSurfaceList(), FemConditionModel::setFemCondition(), and FemConditionModel::setProcessVariable().
| TreeItem * TreeItem::child | ( | int | row | ) | const |
Returns the child that corresponds to the specified row number in the item's list of child items Returns nullptr if that child does not exist.
Definition at line 41 of file TreeItem.cpp.
References TreeItem(), _childItems, and row().
Referenced by GeoTreeModel::addChildren(), GeoTreeModel::addChildren(), VtkVisPipelineItem::child(), StationTreeModel::index(), TreeModel::index(), TreeModelIterator::next(), ProcessModel::removeCondition(), ProcessModel::removeProcessVariable(), GeoTreeView::selectionChanged(), GeoTreeModel::setNameForItem(), and StationTreeModel::setNameForItem().
|
virtual |
Returns the number of _childItems
Definition at line 54 of file TreeItem.cpp.
References _childItems.
Referenced by VtkVisPipeline::addPipelineItem(), TreeModelIterator::next(), ProcessModel::removeCondition(), ProcessModel::removeProcessVariable(), TreeModel::rowCount(), VtkVisPipelineItem::setBackfaceCullingOnChildren(), and VtkVisPipelineItem::setScaleOnChildren().
|
virtual |
Returns the number of columns of data in the item.
Definition at line 75 of file TreeItem.cpp.
References _itemData.
Referenced by TreeModel::columnCount().
|
virtual |
Returns the data from all the columns.
Reimplemented in VtkVisPipelineItem.
Definition at line 83 of file TreeItem.cpp.
References _itemData.
Referenced by CondItem::CondItem(), GeoObjectListItem::GeoObjectListItem(), GeoObjectListItem::GeoObjectListItem(), GeoObjectListItem::GeoObjectListItem(), GeoTreeItem::GeoTreeItem(), MeshItem::MeshItem(), ModelTreeItem::ModelTreeItem(), ProcessVarItem::ProcessVarItem(), TreeItem(), GeoTreeView::connectPolylines(), GeoTreeView::convertPointsToStations(), TreeModel::data(), VtkVisPipelineItem::data(), StationTreeView::exportList(), CondItem::getName(), ProcessVarItem::getName(), GeoTreeView::loadFEMConditions(), GeoTreeView::mapGeometry(), StationTreeView::mapStations(), GeoTreeView::removeGeometry(), MeshModel::removeMesh(), StationTreeView::removeStationList(), ElementTreeView::selectionChanged(), GeoTreeView::selectionChanged(), GeoTreeView::setElementAsCondition(), GeoTreeView::setNameForElement(), StationTreeView::setNameForElement(), StationTreeModel::stationFromIndex(), GeoTreeView::writeToFile(), and StationTreeView::writeToFile().
| TreeItem * TreeItem::parentItem | ( | ) | const |
Returns the parent object of the tree item.
Definition at line 104 of file TreeItem.cpp.
References TreeItem(), and _parentItem.
Referenced by VtkVisImageItem::VtkVisImageItem(), VtkVisImageItem::VtkVisImageItem(), VtkVisPipelineItem::VtkVisPipelineItem(), VtkVisPipelineItem::VtkVisPipelineItem(), VtkVisPointSetItem::VtkVisPointSetItem(), VtkVisPointSetItem::VtkVisPointSetItem(), VtkVisPipeline::addPipelineItem(), VtkVisImageItem::Initialize(), VtkVisPointSetItem::Initialize(), TreeModelIterator::next(), TreeModel::parent(), GeoTreeView::removeGeometry(), GeoTreeView::selectionChanged(), MeshView::selectionChanged(), StationTreeView::selectionChanged(), GeoTreeView::setElementAsCondition(), GeoTreeView::setNameForElement(), StationTreeView::setNameForElement(), and StationTreeModel::stationFromIndex().
| bool TreeItem::removeChildren | ( | int | position, |
| int | count ) |
Removes a number of children of the TreeItem starting from the given position.
Definition at line 113 of file TreeItem.cpp.
References _childItems, and row().
Referenced by ProcessModel::removeCondition(), and TreeModel::removeRows().
| int TreeItem::row | ( | ) | const |
Returns the item's location within its parent's list of items.
Definition at line 62 of file TreeItem.cpp.
References TreeItem(), and _parentItem.
Referenced by child(), VtkVisPipelineItem::child(), TreeModel::parent(), removeChildren(), ProcessModel::removeProcessVariable(), GeoTreeView::selectionChanged(), MeshView::selectionChanged(), StationTreeView::selectionChanged(), GeoTreeView::setElementAsCondition(), GeoTreeView::setNameForElement(), and StationTreeView::setNameForElement().
|
virtual |
Sets the data at a given column.
Reimplemented in VtkVisPipelineItem.
Definition at line 91 of file TreeItem.cpp.
References _itemData.
Referenced by GeoTreeModel::addChildren(), GeoTreeModel::addChildren(), TreeModel::setData(), VtkVisPipelineItem::setData(), GeoTreeModel::setNameForItem(), and StationTreeModel::setNameForItem().
|
private |
Definition at line 33 of file TreeItem.h.
Referenced by ~TreeItem(), appendChild(), child(), childCount(), and removeChildren().
|
private |
Definition at line 34 of file TreeItem.h.
Referenced by TreeItem(), columnCount(), data(), and setData().
|
private |
Definition at line 35 of file TreeItem.h.
Referenced by TreeItem(), parentItem(), and row().