29 #ifndef NEMOSYS_SHAPESARRAY_H_ 30 #define NEMOSYS_SHAPESARRAY_H_ 32 #include "nemosys_export.h" 37 #include <type_traits> 54 std::size_t getNumPatternShapes()
const;
56 const ShapeBase *getPatternShape(std::size_t idx)
const;
58 void setPatternShape(std::size_t idx,
59 const std::shared_ptr<ShapeBase> &shape);
61 template <
typename Shape>
63 this->setPatternShape(idx,
64 std::make_shared<
typename std::decay<Shape>::type>(
65 std::forward<Shape>(shape)));
68 template <
typename Shape,
typename... Args>
70 this->setPatternShape(idx,
71 std::make_shared<Shape>(std::forward<Args>(args)...));
74 void fillPattern(std::size_t idx);
78 std::size_t numPatternShapes);
80 std::size_t getPatternSize()
const;
82 const std::size_t &getPattern(std::size_t idx)
const;
84 void setPattern(std::size_t idx, std::size_t patternKey);
86 template <
typename Modifier>
89 for (
auto &patternId : pattern_) {
90 auto shape = patternId < patternShapes_.size()
91 ? patternShapes_.at(patternId).get()
94 auto subShapeOut = shape->createGeo();
95 modifier(&subShapeOut);
116 std::vector<decltype(patternShapes_)::size_type>
pattern_;
122 #endif // NEMOSYS_SHAPESARRAY_H_ 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.
void insertPatternShape(std::size_t idx, Shape &&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.
NEM::GEO::GeoManager createGeoImpl(Modifier &&modifier) const
static void mergeGeo(NEM::GEO::GeoManager &keepGeo, NEM::GEO::GeoManager &&removeGeo)
Merge two 2d NEM::GEO::GeoManager objects by cutting shapes in removeGeo from shapes in keepGeo and s...
void makePatternShape(std::size_t idx, Args &&...args)
Abstract base class representing a set of other ShapeBase objects, with a transformation applied to e...