33 #include <BRepBuilderAPI_Transform.hxx> 34 #include <TopExp_Explorer.hxx> 35 #include <TopTools_ListOfShape.hxx> 36 #include <TopoDS_Compound.hxx> 42 std::size_t numPatternShapes)
43 :
ShapeBase(center), patternShapes_(), pattern_(numPatternShapes) {}
58 const std::shared_ptr<ShapeBase> &shape) {
84 BRepBuilderAPI_Transform transformer{transformation};
85 transformer.Perform(compound);
87 static constexpr std::array<TopAbs_ShapeEnum, 4> shapeTypes{
88 TopAbs_SOLID, TopAbs_FACE, TopAbs_EDGE, TopAbs_VERTEX};
90 for (TopExp_Explorer explorer{compound,
shapeType}; explorer.More();
92 auto &oldSubshape = explorer.Current();
93 if (
auto old_metadata = geoMetadata.get(oldSubshape)) {
94 output.
insert(transformer.ModifiedShape(oldSubshape),
95 std::move(*old_metadata));
std::pair< MapType::iterator, bool > insert(const TopoDS_Shape &shape, std::shared_ptr< ShapeData > shapeData)
std::vector< decltype(patternShapes_)::size_type > pattern_
Each entry of pattern_ is an index into patternShapes_; subclasses interpret how to transform each en...
Class to manage TopoDS_Shapes along with metadata.
ShapesArray(const std::array< double, 3 > ¢er, std::size_t numPatternShapes)
std::size_t getNumPatternShapes() const
static constexpr auto shapeType
void fillPattern(std::size_t idx)
void setPatternShape(std::size_t idx, const std::shared_ptr< ShapeBase > &shape)
std::vector< std::shared_ptr< ShapeBase > > patternShapes_
A set of other ShapeBase objects, referenced by pattern_.
Abstract base class for types that create NEM::GEO::GeoManager.
TopoDS_Compound buildCompound() const
Create a compound from shapes present in the map that have same dimension as the instance.
static NEM::GEO::GeoManager basicTransformation(const gp_Trsf &transformation, NEM::GEO::GeoManager &&geoMetadata)
const ShapeBase * getPatternShape(std::size_t idx) const
std::size_t getPatternSize() const
void setPattern(std::size_t idx, std::size_t patternKey)
const std::size_t & getPattern(std::size_t idx) const