diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index b043e2800b..4046c879b7 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -3160,7 +3160,7 @@ bool TopoShape::fix() // BTW, the file attached in the issue also shows that ShapeFix_Shape may // actually make a valid input shape invalid). So, it actually change the // underlying shape data. Therefore, we try with a copy first. - auto copy = makECopy(); + auto copy = makeElementCopy(); ShapeFix_Shape fix(copy._Shape); fix.Perform(); diff --git a/src/Mod/Part/App/TopoShape.h b/src/Mod/Part/App/TopoShape.h index 5bf650c343..8cc5d0621e 100644 --- a/src/Mod/Part/App/TopoShape.h +++ b/src/Mod/Part/App/TopoShape.h @@ -771,7 +771,7 @@ public: * TopoShape itself as a self reference so that multiple operations * can be carried out for the same shape in the same line of code. */ - TopoShape &makECopy(const TopoShape &source, const char *op=nullptr, bool copyGeom=true, bool copyMesh=false); + TopoShape &makeElementCopy(const TopoShape &source, const char *op=nullptr, bool copyGeom=true, bool copyMesh=false); /** Make a deep copy of the shape * @@ -783,8 +783,8 @@ public: * @return Return a deep copy of the shape. The shape itself is not * modified */ - TopoShape makECopy(const char *op=nullptr, bool copyGeom=true, bool copyMesh=false) const { - return TopoShape(Tag,Hasher).makECopy(*this,op,copyGeom,copyMesh); + TopoShape makeElementCopy(const char *op=nullptr, bool copyGeom=true, bool copyMesh=false) const { + return TopoShape(Tag,Hasher).makeElementCopy(*this,op,copyGeom,copyMesh); } friend class TopoShapeCache; @@ -978,6 +978,20 @@ struct ShapeHasher { } }; +/** Shape mapper for generic BRepBuilderAPI_MakeShape derived class + * + * Uses BRepBuilderAPI_MakeShape::Modified/Generated() function to extract + * shape history for generating mapped element names + */ +struct PartExport MapperMaker: TopoShape::Mapper { + BRepBuilderAPI_MakeShape &maker; + MapperMaker(BRepBuilderAPI_MakeShape &maker) + :maker(maker) + {} + virtual const std::vector &modified(const TopoDS_Shape &s) const override; + virtual const std::vector &generated(const TopoDS_Shape &s) const override; +}; + } // namespace Part diff --git a/src/Mod/Part/App/TopoShapeExpansion.cpp b/src/Mod/Part/App/TopoShapeExpansion.cpp index 4d08dba521..57709a489b 100644 --- a/src/Mod/Part/App/TopoShapeExpansion.cpp +++ b/src/Mod/Part/App/TopoShapeExpansion.cpp @@ -862,7 +862,7 @@ TopoShape& TopoShape::makeElementOrderedWires(const std::vector& shap } -TopoShape &TopoShape::makECopy(const TopoShape &shape, const char *op, bool copyGeom, bool copyMesh) +TopoShape &TopoShape::makeElementCopy(const TopoShape &shape, const char *op, bool copyGeom, bool copyMesh) { if(shape.isNull()) return *this;