Part Geometry: get an extension from type or name, also from python

This commit is contained in:
Abdullah Tahiri
2019-02-11 17:04:30 +01:00
committed by wmayer
parent afbe1df322
commit 11793ba0b2
4 changed files with 63 additions and 16 deletions

View File

@@ -296,6 +296,16 @@ const std::weak_ptr<GeometryExtension> Geometry::getExtension(Base::Type type) c
throw Base::ValueError("No geometry extension of the requested type.");
}
const std::weak_ptr<GeometryExtension> Geometry::getExtension(std::string name) const
{
for( auto ext : extensions) {
if(ext->getName() == name)
return ext;
}
throw Base::ValueError("No geometry extension with the requested name.");
}
void Geometry::setExtension(std::unique_ptr<GeometryExtension> && geo)
{
bool hasext=false;