void GeoTreeModel::appendSurfaces(const std::string &name, GeoLib::SurfaceVec const& surfaceVec) { for (size_t i = 0; i < _lists.size(); i++) { if ( name.compare( _lists[i]->data(0).toString().toStdString() ) == 0 ) { int nChildren = _lists[i]->childCount(); for (int j = 0; j < nChildren; j++) { GeoObjectListItem* parent = static_cast<GeoObjectListItem*>(_lists[i]->child(j)); if (GeoLib::GEOTYPE::SURFACE == parent->getType()) { this->addChildren(parent, surfaceVec, parent->childCount(), surfaceVec.getVector()->size()); parent->vtkSource()->Modified(); reset(); return; } } } } OGSError::box("Error adding surface to geometry."); }
vtkPolyDataAlgorithm* GeoTreeModel::vtkSource(const std::string &name, GeoLib::GEOTYPE type) const { size_t nLists = _lists.size(); for (size_t i = 0; i < nLists; i++) { if ( name.compare( _lists[i]->data(0).toString().toStdString() ) == 0 ) for (int j = 0; j < _lists[i]->childCount(); j++) { GeoObjectListItem* item = dynamic_cast<GeoObjectListItem*>(_lists[i]->child(j)); if (item->getType() == type) return item->vtkSource(); } } return NULL; }
void GeoTreeModel::appendPolylines(const std::string &name, const GeoLib::PolylineVec* polylineVec) { for (size_t i = 0; i < _lists.size(); i++) { if ( name.compare( _lists[i]->data(0).toString().toStdString() ) == 0 ) for (int j = 0; j < _lists[i]->childCount(); j++) { GeoObjectListItem* parent = static_cast<GeoObjectListItem*>(_lists[i]->child(j)); if (GeoLib::POLYLINE == parent->getType()) { this->addChildren(parent, polylineVec, parent->childCount(), polylineVec->getVector()->size()); reset(); parent->vtkSource()->Modified(); return; } } } OGSError::box("Error adding polyline to geometry."); }