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
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
void Move(const VECTOR2I &aVector) override
void SetClosed(bool aClosed)
Mark the line chain as closed (i.e.
int PointCount() const
Return the number of points (vertices) in this line chain.
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 line chain.
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
void Rotate(const EDA_ANGLE &aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
Rotate all vertices by a given angle.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
int SegmentCount() const
Return the number of segments in this line chain.
const SEG CSegment(int aIndex) const
Return a constant copy of the aIndex segment in the line chain.
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
Represent a set of closed polygons.
Represent a simple polygon consisting of a zero-thickness closed chain of connected line segments.
void Clear()
Remove all points from the polygon.
const SHAPE_LINE_CHAIN & Vertices() const
Return the list of vertices defining this simple polygon.
virtual const SEG GetSegment(int aIndex) const override
virtual const VECTOR2I GetPoint(int aIndex) const override
void Append(int aX, int aY)
Append a new point at the end of the polygon.
SHAPE * Clone() const override
Return a dynamically allocated copy of the shape.
SHAPE_LINE_CHAIN m_points
bool IsSolid() const override
void Rotate(const EDA_ANGLE &aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
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.
SHAPE_SIMPLE(const SHAPE_SIMPLE &aOther)
const VECTOR2I & CPoint(int aIndex) const
Return a const reference to a given point in the polygon.
int PointCount() const
Return the number of points (vertices) in this polygon.
void Move(const VECTOR2I &aVector) override
SHAPE_SIMPLE(const SHAPE_LINE_CHAIN &aPoly)
void Append(const VECTOR2I &aP)
Append a new point at the end of the polygon.
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,...
bool IsClosed() const override
virtual size_t GetSegmentCount() 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 size_t GetPointCount() const override
const VECTOR2D CDPoint(int aIndex) const
Return a given point as a vector with elements of type double.
SHAPE_SIMPLE()
Create an empty polygon.
An abstract shape on 2D plane.
@ SH_SIMPLE
simple polygon
VECTOR2< double > VECTOR2D