|
| 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) |
|
An abstract shape on 2D plane.
virtual bool SHAPE::Collide |
( |
const SEG & |
aSeg, |
|
|
int |
aClearance = 0 , |
|
|
int * |
aActual = nullptr , |
|
|
VECTOR2I * |
aLocation = nullptr |
|
) |
| const |
|
pure virtual |
Check if the boundary of shape (this) lies closer to the segment aSeg than aClearance, indicating a collision.
- Parameters
-
aActual | [out] an optional pointer to an int to be updated with the actual distance int the event of a collision. |
aLocation | [out] an option pointer to a point to store a nearby location in the event of a collision. |
- Returns
- true, if there is a collision.
Implemented in SHAPE_SIMPLE, SHAPE_SEGMENT, SHAPE_RECT, SHAPE_POLY_SET, SHAPE_NULL, SHAPE_LINE_CHAIN, SHAPE_COMPOUND, SHAPE_CIRCLE, SHAPE_ARC, and SHAPE_LINE_CHAIN_BASE.