Skip to content

Commit

Permalink
Part/Toponaming: Refactor makeElementCompound
Browse files Browse the repository at this point in the history
Refactor to address linter issues, breaking up large methods, renaming variables, etc.
  • Loading branch information
chennes committed Jan 15, 2024
1 parent ab6055a commit 778c3ea
Show file tree
Hide file tree
Showing 4 changed files with 345 additions and 147 deletions.
2 changes: 1 addition & 1 deletion src/App/ComplexGeoData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ bool ComplexGeoData::getCenterOfGravity(Base::Vector3d& unused) const
}

const std::string &ComplexGeoData::elementMapPrefix() {
static std::string prefix(";");
static std::string prefix(ELEMENT_MAP_PREFIX);
return prefix;
}

Expand Down
22 changes: 21 additions & 1 deletion src/Mod/Part/App/TopoShape.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ class PartExport TopoShape : public Data::ComplexGeoData
// double tol=1e-7, double atol=1e-12) const;
//@}

void copyElementMap(const TopoShape &other, const char *op=nullptr);
void copyElementMap(const TopoShape & topoShape, const char *op=nullptr);
bool canMapElement(const TopoShape &other) const;
void mapSubElement(const TopoShape &other,const char *op=nullptr, bool forceHasher=false);
void mapSubElement(const std::vector<TopoShape> &shapes, const char *op);
Expand Down Expand Up @@ -484,6 +484,26 @@ class PartExport TopoShape : public Data::ComplexGeoData

private:
TopoDS_Shape _Shape;

private:
// Helper methods
static std::vector<Data::ElementMap::MappedChildElements>
createChildMap(size_t count, const std::vector<TopoShape>& shapes, const char* op);

void setupChild(Data::ElementMap::MappedChildElements& child,
TopAbs_ShapeEnum elementType,
const TopoShape& topoShape,
size_t shapeCount,
const char* op);
void mapSubElementForShape(const TopoShape& other, const char* op);
void mapSubElementTypeForShape(const TopoShape& other,
TopAbs_ShapeEnum type,
const char* op,
int count,
bool forward,
bool& warned);
void mapCompoundSubElements(const std::vector<TopoShape>& shapes, const char* op);

};

} //namespace Part
Expand Down
Loading

0 comments on commit 778c3ea

Please sign in to comment.