25 #ifndef __SHAPE_COMPOUND_H 26 #define __SHAPE_COMPOUND_H 52 const std::string
Format()
const override;
54 bool Collide(
const SEG& aSeg,
int aClearance = 0,
int* aActual =
nullptr,
55 VECTOR2I* aLocation =
nullptr )
const override;
62 bool Collide(
const SHAPE* aShape,
int aClearance = 0,
int* aActual =
nullptr,
63 VECTOR2I* aLocation =
nullptr )
const override 68 const std::vector<SHAPE*>&
Shapes()
const 73 const BOX2I BBox(
int aClearance = 0 )
const override;
84 std::vector<SHAPE*> subshapes;
87 for(
SHAPE* subshape : subshapes )
88 m_shapes.push_back( subshape->Clone() );
110 void Rotate(
double aAngle,
const VECTOR2I& aCenter = { 0, 0 } )
override;
142 #endif // __SHAPE_COMPOUND_H compound shape, consisting of multiple simple shapes
Represent a simple polygon consisting of a zero-thickness closed chain of connected line segments.
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
A 2D bounding box built on top of an origin point and size vector.
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)