diff --git a/src/App/ComplexGeoData.cpp b/src/App/ComplexGeoData.cpp index 32ece65915..8cd035e829 100644 --- a/src/App/ComplexGeoData.cpp +++ b/src/App/ComplexGeoData.cpp @@ -184,6 +184,11 @@ bool ComplexGeoData::getCenterOfGravity(Base::Vector3d& unused) const return false; } +const std::string &ComplexGeoData::elementMapPrefix() { + static std::string prefix(";"); + return prefix; +} + size_t ComplexGeoData::getElementMapSize(bool flush) const { if (flush) { @@ -621,6 +626,25 @@ unsigned int ComplexGeoData::getMemSize() const return 0; } + +void ComplexGeoData::setMappedChildElements(const std::vector & children) +{ + // DO NOT reset element map if there is one. Because we allow mixing child + // mapping and normal mapping + if (!_elementMap) { + resetElementMap(std::make_shared()); + } + _elementMap->addChildElements(Tag, children); +} + +std::vector ComplexGeoData::getMappedChildElements() const +{ + if (!_elementMap) { + return {}; + } + return _elementMap->getChildElements(); +} + void ComplexGeoData::beforeSave() const { flushElementMap(); diff --git a/src/App/ComplexGeoData.h b/src/App/ComplexGeoData.h index 8364dde4cd..7bf68b3bea 100644 --- a/src/App/ComplexGeoData.h +++ b/src/App/ComplexGeoData.h @@ -176,6 +176,7 @@ public: virtual bool getCenterOfGravity(Base::Vector3d& center) const; //@} + static const std::string &elementMapPrefix(); /** @name Element name mapping */ //@{ @@ -247,6 +248,9 @@ public: // NOTE: getElementHistory is now in ElementMap + void setMappedChildElements(const std::vector & children); + std::vector getMappedChildElements() const; + char elementType(const Data::MappedName &) const; char elementType(const Data::IndexedName &) const; char elementType(const char *name) const; diff --git a/tests/src/Mod/Part/App/TopoShapeExpansion.cpp b/tests/src/Mod/Part/App/TopoShapeExpansion.cpp new file mode 100644 index 0000000000..702f97331d --- /dev/null +++ b/tests/src/Mod/Part/App/TopoShapeExpansion.cpp @@ -0,0 +1,3 @@ +// +// Created by Chris Hennes on 1/11/24. +//