Represent a simple polygon consisting of a zero-thickness closed chain of connected line segments.
More...
|
|
| SHAPE_SIMPLE () |
| | Create an empty polygon.
|
| |
|
| SHAPE_SIMPLE (const SHAPE_LINE_CHAIN &aPoly) |
| |
|
| SHAPE_SIMPLE (const SHAPE_SIMPLE &aOther) |
| |
| SHAPE * | Clone () const override |
| | Return a dynamically allocated copy of the shape. More...
|
| |
|
void | Clear () |
| | Remove all points from the polygon.
|
| |
| const BOX2I | BBox (int aClearance=0) const override |
| | Compute a bounding box of the shape, with a margin of aClearance a collision. More...
|
| |
| int | PointCount () const |
| | Return the number of points (vertices) in this polygon. More...
|
| |
| const VECTOR2I & | CPoint (int aIndex) const |
| | Return a const reference to a given point in the polygon. More...
|
| |
| const VECTOR2D | CDPoint (int aIndex) const |
| | Return a given point as a vector with elements of type double. More...
|
| |
| const SHAPE_LINE_CHAIN & | Vertices () const |
| | Return the list of vertices defining this simple polygon. More...
|
| |
| void | Append (int aX, int aY) |
| | Append a new point at the end of the polygon. More...
|
| |
| void | Append (const VECTOR2I &aP) |
| | Append a new point at the end of the polygon. More...
|
| |
| 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, indicating a collision. More...
|
| |
| void | Rotate (double aAngle, const VECTOR2I &aCenter={ 0, 0 }) override |
| |
| void | Move (const VECTOR2I &aVector) override |
| |
| bool | IsSolid () const override |
| |
| virtual const VECTOR2I | GetPoint (int aIndex) const override |
| |
| virtual const SEG | GetSegment (int aIndex) const override |
| |
| virtual size_t | GetPointCount () const override |
| |
| virtual size_t | GetSegmentCount () const override |
| |
| bool | IsClosed () const override |
| |
|
| SHAPE_LINE_CHAIN_BASE (SHAPE_TYPE aType) |
| |
| 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. More...
|
| |
| virtual bool | Collide (const SEG &aSeg, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override |
| | Check if segment aSeg lies closer to us than aClearance. More...
|
| |
|
SEG::ecoord | SquaredDistance (const VECTOR2I &aP, bool aOutlineOnly=false) const |
| |
| 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. More...
|
| |
| bool | PointOnEdge (const VECTOR2I &aP, int aAccuracy=0) const |
| | Check if point aP lies on an edge or vertex of the line chain. More...
|
| |
| int | EdgeContainingPoint (const VECTOR2I &aP, int aAccuracy=0) const |
| | Check if point aP lies on an edge or vertex of the line chain. More...
|
| |
|
virtual const VECTOR2I | GetPoint (int aIndex) const =0 |
| |
|
virtual const SEG | GetSegment (int aIndex) const =0 |
| |
|
virtual size_t | GetPointCount () const =0 |
| |
|
virtual size_t | GetSegmentCount () const =0 |
| |
| virtual bool | IsClosed () const =0 |
| |
|
virtual BOX2I * | GetCachedBBox () const |
| |
|
| SHAPE (SHAPE_TYPE aType) |
| | Create an empty shape of type aType.
|
| |
| virtual SHAPE * | Clone () const |
| | Return a dynamically allocated copy of the shape. More...
|
| |
| bool | IsNull () const |
| | Return true if the shape is a null shape. More...
|
| |
| 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, indicating a collision. More...
|
| |
| virtual bool | Collide (const SHAPE *aShape, int aClearance, VECTOR2I *aMTV) const |
| | Check if the boundary of shape (this) lies closer to the shape aShape than aClearance, indicating a collision. More...
|
| |
| virtual bool | Collide (const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const |
| |
| 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, indicating a collision. More...
|
| |
| virtual const BOX2I | BBox (int aClearance=0) const =0 |
| | Compute a bounding box of the shape, with a margin of aClearance a collision. More...
|
| |
| virtual VECTOR2I | Centre () const |
| | Compute a center-of-mass of the shape. More...
|
| |
| virtual void | Rotate (double aAngle, const VECTOR2I &aCenter={ 0, 0 })=0 |
| |
| virtual void | Move (const VECTOR2I &aVector)=0 |
| |
| virtual bool | IsSolid () const =0 |
| |
| virtual bool | Parse (std::stringstream &aStream) |
| |
| virtual const std::string | Format () const |
| |
|
| SHAPE_BASE (SHAPE_TYPE aType) |
| | Create an empty shape of type aType.
|
| |
| SHAPE_TYPE | Type () const |
| | Return the type of the shape. More...
|
| |
|
virtual bool | HasIndexableSubshapes () const |
| |
|
virtual size_t | GetIndexableSubshapeCount () const |
| |
|
virtual void | GetIndexableSubshapes (std::vector< SHAPE * > &aSubshapes) |
| |
Represent a simple polygon consisting of a zero-thickness closed chain of connected line segments.
Internally the vertices are held in a SHAPE_LINE_CHAIN, please note that there is a "virtual" line segment between the last and first vertex.