Horizon
|
#include <shape.h>
Public Member Functions | |
SHAPE (SHAPE_TYPE aType) | |
Constructor. More... | |
SHAPE_TYPE | Type () const |
Function Type() More... | |
virtual SHAPE * | Clone () const |
Function Clone() More... | |
virtual bool | Collide (const VECTOR2I &aP, int aClearance=0) const |
Function Collide() More... | |
virtual bool | Collide (const SHAPE *aShape, int aClearance, VECTOR2I &aMTV) const |
Function Collide() More... | |
virtual bool | Collide (const SHAPE *aShape, int aClearance=0) const |
virtual bool | Collide (const SEG &aSeg, int aClearance=0) const =0 |
Function Collide() More... | |
virtual const BOX2I | BBox (int aClearance=0) const =0 |
Function BBox() More... | |
virtual VECTOR2I | Centre () const |
Function Centre() More... | |
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 (SHAPE_TYPE aType) | |
Constructor. More... | |
SHAPE_TYPE | Type () const |
Function Type() More... | |
virtual SHAPE * | Clone () const |
Function Clone() More... | |
virtual bool | Collide (const VECTOR2I &aP, int aClearance=0) const |
Function Collide() More... | |
virtual bool | Collide (const SHAPE *aShape, int aClearance, VECTOR2I &aMTV) const |
Function Collide() More... | |
virtual bool | Collide (const SHAPE *aShape, int aClearance=0) const |
virtual bool | Collide (const SEG &aSeg, int aClearance=0) const =0 |
Function Collide() More... | |
virtual const BOX2I | BBox (int aClearance=0) const =0 |
Function BBox() More... | |
virtual VECTOR2I | Centre () const |
Function Centre() More... | |
virtual void | Move (const VECTOR2I &aVector)=0 |
virtual bool | IsSolid () const =0 |
virtual bool | Parse (std::stringstream &aStream) |
virtual const std::string | Format () const |
Protected Types | |
typedef VECTOR2I::extended_type | ecoord |
typedef VECTOR2I::extended_type | ecoord |
Protected Attributes | |
SHAPE_TYPE | m_type |
| |
Class SHAPE.
Represents an abstract shape on 2D plane.
|
inline |
Constructor.
Creates an empty shape of type aType
|
inline |
Constructor.
Creates an empty shape of type aType
|
pure virtual |
Function BBox()
Computes a bounding box of the shape, with a margin of aClearance a collision.
aClearance | how much the bounding box is expanded wrs to the minimum enclosing rectangle for the shape. |
Implemented in SHAPE_SIMPLE, SHAPE_SEGMENT, SHAPE_RECT, SHAPE_LINE_CHAIN, SHAPE_CIRCLE, SHAPE_ARC, SHAPE_SIMPLE, SHAPE_SEGMENT, SHAPE_RECT, SHAPE_LINE_CHAIN, SHAPE_CIRCLE, and SHAPE_ARC.
|
pure virtual |
Function BBox()
Computes a bounding box of the shape, with a margin of aClearance a collision.
aClearance | how much the bounding box is expanded wrs to the minimum enclosing rectangle for the shape. |
Implemented in SHAPE_SIMPLE, SHAPE_SEGMENT, SHAPE_RECT, SHAPE_LINE_CHAIN, SHAPE_CIRCLE, SHAPE_ARC, SHAPE_SIMPLE, SHAPE_SEGMENT, SHAPE_RECT, SHAPE_LINE_CHAIN, SHAPE_CIRCLE, and SHAPE_ARC.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Function Clone()
Returns a dynamically allocated copy of the shape
copy | of the shape |
Reimplemented in SHAPE_SIMPLE, SHAPE_SEGMENT, SHAPE_RECT, SHAPE_LINE_CHAIN, SHAPE_CIRCLE, SHAPE_ARC, SHAPE_SIMPLE, SHAPE_SEGMENT, SHAPE_RECT, SHAPE_LINE_CHAIN, SHAPE_CIRCLE, and SHAPE_ARC.
|
inlinevirtual |
Function Clone()
Returns a dynamically allocated copy of the shape
copy | of the shape |
Reimplemented in SHAPE_SIMPLE, SHAPE_SEGMENT, SHAPE_RECT, SHAPE_LINE_CHAIN, SHAPE_CIRCLE, SHAPE_ARC, SHAPE_SIMPLE, SHAPE_SEGMENT, SHAPE_RECT, SHAPE_LINE_CHAIN, SHAPE_CIRCLE, and SHAPE_ARC.
|
pure virtual |
Function Collide()
Checks if the boundary of shape (this) lies closer to the segment aSeg than aClearance, indicating a collision.
Implemented in SHAPE_SIMPLE, SHAPE_SEGMENT, SHAPE_RECT, SHAPE_LINE_CHAIN, SHAPE_CIRCLE, SHAPE_ARC, SHAPE_SIMPLE, SHAPE_SEGMENT, SHAPE_RECT, SHAPE_LINE_CHAIN, SHAPE_CIRCLE, and SHAPE_ARC.
|
pure virtual |
Function Collide()
Checks if the boundary of shape (this) lies closer to the segment aSeg than aClearance, indicating a collision.
Implemented in SHAPE_SIMPLE, SHAPE_SEGMENT, SHAPE_RECT, SHAPE_LINE_CHAIN, SHAPE_CIRCLE, SHAPE_ARC, SHAPE_SIMPLE, SHAPE_SEGMENT, SHAPE_RECT, SHAPE_LINE_CHAIN, SHAPE_CIRCLE, and SHAPE_ARC.
Function Collide()
Checks if the boundary of shape (this) lies closer to the shape aShape than aClearance, indicating a collision.
aShape | shape to check collision against |
aClearance | minimum clearance |
aMTV | minimum translation vector |
Function Collide()
Checks if the boundary of shape (this) lies closer to the shape aShape than aClearance, indicating a collision.
aShape | shape to check collision against |
aClearance | minimum clearance |
aMTV | minimum translation vector |
|
inlinevirtual |
Function Collide()
Checks if the boundary of shape (this) lies closer to the point aP than aClearance, indicating a collision.
Reimplemented in SHAPE_SEGMENT, SHAPE_LINE_CHAIN, SHAPE_ARC, SHAPE_SEGMENT, SHAPE_LINE_CHAIN, and SHAPE_ARC.
|
inlinevirtual |
Function Collide()
Checks if the boundary of shape (this) lies closer to the point aP than aClearance, indicating a collision.
Reimplemented in SHAPE_SEGMENT, SHAPE_LINE_CHAIN, SHAPE_ARC, SHAPE_SEGMENT, SHAPE_LINE_CHAIN, and SHAPE_ARC.
|
inline |
|
inline |