24 #ifndef __SHAPE_COMPOUND_H 25 #define __SHAPE_COMPOUND_H 51 const std::string
Format()
const override;
53 bool Collide(
const SEG& aSeg,
int aClearance = 0,
int* aActual =
nullptr,
54 VECTOR2I* aLocation =
nullptr )
const override;
61 bool Collide(
const SHAPE* aShape,
int aClearance = 0,
int* aActual =
nullptr,
62 VECTOR2I* aLocation =
nullptr )
const override 67 const std::vector<SHAPE*>&
Shapes()
const 72 const BOX2I BBox(
int aClearance = 0 )
const override;
83 std::vector<SHAPE*> subshapes;
86 for(
SHAPE* subshape : subshapes )
87 m_shapes.push_back( subshape->Clone() );
109 void Rotate(
double aAngle,
const VECTOR2I& aCenter = { 0, 0 } )
override;
141 #endif // __SHAPE_COMPOUND_H compound shape, consisting of multiple simple shapes
void Move(const VECTOR2I &aVector) override
virtual size_t GetIndexableSubshapeCount() const override
bool Collide(const SHAPE *aShape, int aClearance, VECTOR2I *aMTV) const override
Check if the boundary of shape (this) lies closer to the shape aShape than aClearance,...
Define a general 2D-vector/point.
bool IsSolid() const override
bool Collide(const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
BOX2 handles a 2-D bounding box, built on top of an origin point and size vector, both of templated c...
virtual bool Collide(const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const
Check if the boundary of shape (this) lies closer to the point aP than aClearance,...
void Rotate(double aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
virtual void GetIndexableSubshapes(std::vector< SHAPE * > &aSubshapes) override
int Distance(const SEG &aSeg) const
SHAPE_COMPOUND * Clone() const override
Return a dynamically allocated copy of the shape.
An abstract shape on 2D plane.
bool Collide(const SEG &aSeg, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if the boundary of shape (this) lies closer to the segment aSeg than aClearance,...
virtual void GetIndexableSubshapes(std::vector< SHAPE * > &aSubshapes)
const std::vector< SHAPE * > & Shapes() const
std::vector< SHAPE * > m_shapes
SHAPE * UniqueSubshape() const
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
const std::string Format() const override
virtual bool HasIndexableSubshapes() const
virtual bool HasIndexableSubshapes() const override
bool ConvertToSimplePolygon(SHAPE_SIMPLE *aOut) const
void AddShape(SHAPE *aShape)