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 27 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 23 of file TreeItem.cpp.
|
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 34 of file TreeItem.cpp.
References _childItems.
void TreeItem::appendChild | ( | TreeItem * | item | ) |
Add a child to the tree item
Definition at line 42 of file TreeItem.cpp.
References _childItems.
Referenced by GeoTreeModel::addChildren(), MeshModel::addMeshObject(), VtkVisPipeline::addPipelineItem(), GeoTreeModel::addPointList(), GeoTreeModel::addPolylineList(), ProcessModel::addProcessVar(), StationTreeModel::addStationList(), GeoTreeModel::addSurfaceList(), ElementTreeModel::setElement(), FemConditionModel::setFemCondition(), ElementTreeModel::setMesh(), 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 52 of file TreeItem.cpp.
References _childItems, and row().
Referenced by GeoTreeModel::addChildren(), GeoTreeModel::addPolylineList(), GeoTreeModel::addSurfaceList(), VtkVisPipelineItem::child(), ProcessModel::clearModel(), MeshModel::getMesh(), ProcessModel::getProcessVarItem(), VtkVisPipeline::highlightGeoObject(), VtkVisPipeline::highlightMeshComponent(), StationTreeModel::index(), TreeModel::index(), TreeModelIterator::next(), ProcessModel::removeCondition(), MeshModel::removeMesh(), ProcessModel::removeProcessVariable(), GeoTreeView::selectionChanged(), VtkVisPipeline::setGlobalBackfaceCulling(), VtkVisPipeline::setGlobalSuperelevation(), GeoTreeModel::setNameForItem(), StationTreeModel::setNameForItem(), VtkVisPipeline::showMeshElementQuality(), MeshModel::updateMesh(), and MeshModel::vtkSource().
|
virtual |
Returns the number of _childItems
Definition at line 65 of file TreeItem.cpp.
References _childItems.
Referenced by TreeModelIterator::TreeModelIterator(), MeshModel::addMeshObject(), VtkVisPipeline::addPipelineItem(), GeoTreeModel::addPolylineList(), GeoTreeModel::addSurfaceList(), ProcessModel::clearModel(), ElementTreeModel::clearView(), FemConditionModel::clearView(), MeshModel::getMesh(), ProcessModel::getProcessVarItem(), VtkVisPipeline::highlightGeoObject(), VtkVisPipeline::highlightMeshComponent(), TreeModelIterator::next(), VtkVisTabWidget::on_scaleZ_textChanged(), ProcessModel::removeCondition(), MeshModel::removeMesh(), ProcessModel::removeProcessVariable(), VtkVisPipeline::removeSourceItem(), VtkVisPipeline::removeSourceItem(), VtkVisPipeline::removeSourceItem(), TreeModel::rowCount(), VtkVisPipelineItem::setBackfaceCullingOnChildren(), VtkVisPipeline::setGlobalBackfaceCulling(), VtkVisPipeline::setGlobalSuperelevation(), VtkVisPipelineItem::setScaleOnChildren(), VtkVisPipeline::showMeshElementQuality(), MeshModel::updateMesh(), and MeshModel::vtkSource().
|
virtual |
Returns the number of columns of data in the item.
Definition at line 86 of file TreeItem.cpp.
References _itemData.
Referenced by TreeModel::columnCount().
|
virtual |
Returns the data from all the columns.
Reimplemented in VtkVisPipelineItem.
Definition at line 94 of file TreeItem.cpp.
References _itemData.
Referenced by GeoObjectListItem::GeoObjectListItem(), GeoObjectListItem::GeoObjectListItem(), GeoObjectListItem::GeoObjectListItem(), GeoTreeModel::addPolylineList(), GeoTreeModel::addSurfaceList(), GeoTreeView::connectPolylines(), GeoTreeView::convertPointsToStations(), TreeModel::data(), VtkVisPipelineItem::data(), StationTreeView::exportList(), CondItem::getName(), ProcessVarItem::getName(), TreeModel::headerData(), 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 115 of file TreeItem.cpp.
References _parentItem.
Referenced by VtkVisPipelineItem::VtkVisPipelineItem(), 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 124 of file TreeItem.cpp.
References _childItems, and row().
Referenced by ElementTreeModel::clearView(), FemConditionModel::clearView(), ProcessModel::removeCondition(), MeshModel::removeMesh(), ProcessModel::removeProcessVariable(), TreeModel::removeRows(), and MeshModel::updateMesh().
int TreeItem::row | ( | ) | const |
Returns the item's location within its parent's list of items.
Definition at line 73 of file TreeItem.cpp.
References _childItems, 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 102 of file TreeItem.cpp.
References _itemData.
Referenced by GeoTreeModel::addChildren(), TreeModel::setData(), VtkVisPipelineItem::setData(), GeoTreeModel::setNameForItem(), and StationTreeModel::setNameForItem().
|
private |
Definition at line 44 of file TreeItem.h.
Referenced by ~TreeItem(), appendChild(), child(), childCount(), removeChildren(), and row().
|
private |
Definition at line 45 of file TreeItem.h.
Referenced by columnCount(), data(), and setData().
|
private |
Definition at line 46 of file TreeItem.h.
Referenced by parentItem(), and row().