24 #ifndef __SHAPE_SIMPLE_H 25 #define __SHAPE_SIMPLE_H 78 const BOX2I BBox(
int aClearance = 0 )
const override 152 bool Collide(
const SEG& aSeg,
int aClearance = 0,
int* aActual =
nullptr,
153 VECTOR2I* aLocation =
nullptr )
const override 188 #endif // __SHAPE_SIMPLE_H virtual const SEG GetSegment(int aIndex) const override
bool IsClosed() 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 point aP than aClearance,...
Represent a simple polygon consisting of a zero-thickness closed chain of connected line segments.
const VECTOR2I & CPoint(int aIndex) const
Return a const reference to a given point in the polygon.
virtual const VECTOR2I GetPoint(int aIndex) const override
void Move(const VECTOR2I &aVector) override
virtual size_t GetPointCount() const override
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
int PointCount() const
Return the number of points (vertices) in this line chain.
void Append(const VECTOR2I &aP)
Append a new point at the end of the polygon.
SHAPE * Clone() const override
Return a dynamically allocated copy of the shape.
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
void SetClosed(bool aClosed)
Mark the line chain as closed (i.e.
const VECTOR2D CDPoint(int aIndex) const
Return a given point as a vector with elements of type double.
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
VECTOR2< double > VECTOR2D
SHAPE_SIMPLE(const SHAPE_SIMPLE &aOther)
void Rotate(double aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
const SHAPE_LINE_CHAIN & Vertices() const
Return the list of vertices defining this simple polygon.
SHAPE_SIMPLE()
Create an empty polygon.
An abstract shape on 2D plane.
int SegmentCount() const
Return the number of segments in this line chain.
bool IsSolid() const override
virtual bool Collide(const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if point aP lies closer to us than aClearance.
void Clear()
Remove all points from the polygon.
void Rotate(double aAngle, const VECTOR2I &aCenter=VECTOR2I(0, 0)) override
Rotate all vertices by a given angle.
virtual size_t GetSegmentCount() const override
SHAPE_LINE_CHAIN m_points
const SEG CSegment(int aIndex) const
Return a constant copy of the aIndex segment in the line chain.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
int PointCount() const
Return the number of points (vertices) in this polygon.
void Clear()
Remove all points from the line chain.
SHAPE_SIMPLE(const SHAPE_LINE_CHAIN &aPoly)
void Append(int aX, int aY)
Append a new point at the end of the polygon.
void Move(const VECTOR2I &aVector) override