Part: Geometry extension set with unique id (type+name) and list based getExtensions python

This commit is contained in:
Abdullah Tahiri
2019-02-11 17:42:43 +01:00
committed by wmayer
parent 8618dfd3c6
commit 331817d1b7
3 changed files with 12 additions and 10 deletions

View File

@@ -311,13 +311,15 @@ void Geometry::setExtension(std::unique_ptr<GeometryExtension> && geo)
bool hasext=false;
for( auto & ext : extensions) {
if(ext->getTypeId() == geo->getTypeId()){
// if same type and name, this modifies the existing extension.
if( ext->getTypeId() == geo->getTypeId() &&
ext->getName() == geo->getName()){
ext = std::move(geo);
hasext = true;
}
}
if(!hasext)
if(!hasext) // new type-name unique id, so add.
extensions.push_back(std::move(geo));
}