63 case SH_RECT:
return wxT(
"SH_RECT" );
66 case SH_CIRCLE:
return wxT(
"SH_CIRCLE" );
67 case SH_SIMPLE:
return wxT(
"SH_SIMPLE" );
70 case SH_ARC:
return wxT(
"SH_ARC" );
71 case SH_NULL:
return wxT(
"SH_NULL" );
182 VECTOR2I* aLocation =
nullptr )
const
184 return Collide(
SEG( aP, aP ), aClearance, aActual, aLocation );
202 virtual bool Collide(
const SHAPE* aShape,
int aClearance = 0,
int* aActual =
nullptr,
203 VECTOR2I* aLocation =
nullptr )
const;
215 virtual bool Collide(
const SEG& aSeg,
int aClearance = 0,
int* aActual =
nullptr,
216 VECTOR2I* aLocation =
nullptr )
const = 0;
225 virtual const BOX2I BBox(
int aClearance = 0 )
const = 0;
259 virtual bool PointInside(
const VECTOR2I& aPt,
int aAccuracy = 0,
bool aUseBBoxCache =
false )
const;
279 virtual bool Parse( std::stringstream& aStream );
281 virtual const std::string
Format(
bool aCplusPlus =
true )
const;
309 virtual bool Collide(
const VECTOR2I& aP,
int aClearance = 0,
int* aActual =
nullptr,
310 VECTOR2I* aLocation =
nullptr )
const override;
322 virtual bool Collide(
const SEG& aSeg,
int aClearance = 0,
int* aActual =
nullptr,
323 VECTOR2I* aLocation =
nullptr )
const override;
327 bool PointInside(
const VECTOR2I& aPt,
int aAccuracy = 0,
bool aUseBBoxCache =
false )
const override;
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
constexpr Vec Centre() const
VECTOR2I::extended_type ecoord
virtual size_t GetIndexableSubshapeCount() const
SHAPE_BASE(SHAPE_TYPE aType)
Create an empty shape of type aType.
wxString TypeName() const
SHAPE_TYPE m_type
< type of our shape
virtual void GetIndexableSubshapes(std::vector< const SHAPE * > &aSubshapes) const
virtual bool HasIndexableSubshapes() const
SHAPE_TYPE Type() const
Return the type of the shape.
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.
bool PointOnEdge(const VECTOR2I &aP, int aAccuracy=0) const
Check if point aP lies on an edge or vertex of the line chain.
int EdgeContainingPoint(const VECTOR2I &aP, int aAccuracy=0) const
Check if point aP lies on an edge or vertex of the line chain.
virtual size_t GetPointCount() const =0
SHAPE_LINE_CHAIN_BASE(SHAPE_TYPE aType)
virtual size_t GetSegmentCount() const =0
virtual const VECTOR2I GetPoint(int aIndex) const =0
virtual BOX2I * GetCachedBBox() 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.
bool PointInside(const VECTOR2I &aPt, int aAccuracy=0, bool aUseBBoxCache=false) const override
Check if point aP lies inside a closed shape.
virtual bool IsClosed() const =0
virtual const SEG GetSegment(int aIndex) const =0
SEG::ecoord SquaredDistance(const VECTOR2I &aP, bool aOutlineOnly=false) const override
virtual ~SHAPE_LINE_CHAIN_BASE()
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Represent a set of closed polygons.
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,...
int GetClearance(const SHAPE *aOther) const
Return the actual minimum distance between two shapes.
virtual void TransformToPolygon(SHAPE_POLY_SET &aBuffer, int aError, ERROR_LOC aErrorLoc) const =0
Fills a SHAPE_POLY_SET with a polygon representation of this shape.
VECTOR2I::extended_type ecoord
virtual VECTOR2I Centre() const
Compute a center-of-mass of the shape.
virtual void Move(const VECTOR2I &aVector)=0
virtual bool Parse(std::stringstream &aStream)
virtual bool PointInside(const VECTOR2I &aPt, int aAccuracy=0, bool aUseBBoxCache=false) const
Check if point aP lies inside a closed shape.
SHAPE(SHAPE_TYPE aType)
Create an empty shape of type aType.
virtual const std::string Format(bool aCplusPlus=true) const
virtual int Distance(const VECTOR2I &aP) const
Returns the minimum distance from a given point to this shape.
static const int MIN_PRECISION_IU
This is the minimum precision for all the points in a shape.
bool IsNull() const
Return true if the shape is a null shape.
virtual SHAPE * Clone() const
Return a dynamically allocated copy of the shape.
virtual void Rotate(const EDA_ANGLE &aAngle, const VECTOR2I &aCenter={ 0, 0 })=0
virtual bool IsSolid() const =0
virtual bool Collide(const SEG &aSeg, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const =0
Check if the boundary of shape (this) lies closer to the segment aSeg than aClearance,...
virtual const BOX2I BBox(int aClearance=0) const =0
Compute a bounding box of the shape, with a margin of aClearance a collision.
virtual SEG::ecoord SquaredDistance(const VECTOR2I &aP, bool aOutlineOnly=false) const
VECTOR2_TRAITS< int32_t >::extended_type extended_type
SHAPE_TYPE
Lists all supported shapes.
@ SH_POLY_SET
set of polygons (with holes, etc.)
@ SH_RECT
axis-aligned rectangle
@ SH_SIMPLE
simple polygon
@ SH_NULL
empty shape (no shape...),
@ SH_POLY_SET_TRIANGLE
a single triangle belonging to a POLY_SET triangulation
@ SH_LINE_CHAIN
line chain (polyline)
@ SH_COMPOUND
compound shape, consisting of multiple simple shapes
static wxString SHAPE_TYPE_asString(SHAPE_TYPE a)