25#ifndef __SHAPE_COMPOUND_H
26#define __SHAPE_COMPOUND_H
54 const std::string
Format(
bool aCplusPlus =
true )
const override;
56 bool Collide(
const SEG& aSeg,
int aClearance = 0,
int* aActual =
nullptr,
57 VECTOR2I* aLocation =
nullptr )
const override;
64 bool Collide(
const SHAPE* aShape,
int aClearance = 0,
int* aActual =
nullptr,
65 VECTOR2I* aLocation =
nullptr )
const override
70 const std::vector<SHAPE*>&
Shapes()
const
75 const BOX2I BBox(
int aClearance = 0 )
const override;
88 std::vector<const SHAPE*> subshapes;
91 for(
const SHAPE* subshape : subshapes )
92 m_shapes.push_back( subshape->Clone() );
109 std::vector<const SHAPE*> subshapes;
110 aShape->GetIndexableSubshapes( subshapes );
112 for(
const SHAPE* subshape : subshapes )
113 m_shapes.push_back( subshape->Clone() );
117 m_shapes.push_back( aShape->Clone() );
155 aSubshapes.reserve(
m_shapes.size() );
156 std::copy(
m_shapes.begin(),
m_shapes.end(), std::back_inserter( aSubshapes ) );
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
virtual void GetIndexableSubshapes(std::vector< const SHAPE * > &aSubshapes) const
bool IsSolid() const override
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
virtual void GetIndexableSubshapes(std::vector< const SHAPE * > &aSubshapes) 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,...
bool Collide(const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
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,...
const std::vector< SHAPE * > & Shapes() const
void TransformToPolygon(SHAPE_POLY_SET &aBuffer, int aError, ERROR_LOC aErrorLoc) const override
Fills a SHAPE_POLY_SET with a polygon representation of this shape.
virtual bool HasIndexableSubshapes() const override
virtual size_t GetIndexableSubshapeCount() const override
std::vector< SHAPE * > m_shapes
const std::string Format(bool aCplusPlus=true) const override
SHAPE_COMPOUND * Clone() const override
Return a dynamically allocated copy of the shape.
void Rotate(const EDA_ANGLE &aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
SHAPE * UniqueSubshape() const
void AddShape(std::shared_ptr< SHAPE > aShape)
int Distance(const SEG &aSeg) const
void Move(const VECTOR2I &aVector) override
void AddShape(SHAPE *aShape)
Represent a set of closed polygons.
Represent a simple polygon consisting of a zero-thickness closed chain of connected line segments.
An abstract shape on 2D plane.
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,...
virtual int Distance(const VECTOR2I &aP) const
Returns the minimum distance from a given point to this shape.
@ SH_COMPOUND
compound shape, consisting of multiple simple shapes