61 case SH_RECT:
return wxT(
"SH_RECT" );
64 case SH_CIRCLE:
return wxT(
"SH_CIRCLE" );
65 case SH_SIMPLE:
return wxT(
"SH_SIMPLE" );
68 case SH_ARC:
return wxT(
"SH_ARC" );
69 case SH_NULL:
return wxT(
"SH_NULL" );
180 VECTOR2I* aLocation =
nullptr )
const
182 return Collide(
SEG( aP, aP ), aClearance, aActual, aLocation );
200 virtual bool Collide(
const SHAPE* aShape,
int aClearance = 0,
int* aActual =
nullptr,
201 VECTOR2I* aLocation =
nullptr )
const;
213 virtual bool Collide(
const SEG& aSeg,
int aClearance = 0,
int* aActual =
nullptr,
214 VECTOR2I* aLocation =
nullptr )
const = 0;
223 virtual const BOX2I BBox(
int aClearance = 0 )
const = 0;
245 virtual bool Parse( std::stringstream& aStream );
247 virtual const std::string
Format(
bool aCplusPlus =
true )
const;
275 virtual bool Collide(
const VECTOR2I& aP,
int aClearance = 0,
int* aActual =
nullptr,
276 VECTOR2I* aLocation =
nullptr )
const override;
288 virtual bool Collide(
const SEG& aSeg,
int aClearance = 0,
int* aActual =
nullptr,
289 VECTOR2I* aLocation =
nullptr )
const override;
302 bool PointInside(
const VECTOR2I& aPt,
int aAccuracy = 0,
bool aUseBBoxCache =
false )
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.
bool PointInside(const VECTOR2I &aPt, int aAccuracy=0, bool aUseBBoxCache=false) const
Check if point aP lies inside a polygon (any type) defined by the 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.
SEG::ecoord SquaredDistance(const VECTOR2I &aP, bool aOutlineOnly=false) const
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
virtual bool IsClosed() const =0
virtual const SEG GetSegment(int aIndex) const =0
virtual ~SHAPE_LINE_CHAIN_BASE()
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
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.
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)
SHAPE(SHAPE_TYPE aType)
Create an empty shape of type aType.
virtual const std::string Format(bool aCplusPlus=true) const
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.
VECTOR2_TRAITS< int >::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)