Horizon
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SHAPE_CIRCLE Class Reference
Inheritance diagram for SHAPE_CIRCLE:
SHAPE SHAPE_BASE

Public Member Functions

 SHAPE_CIRCLE (const VECTOR2I &aCenter, int aRadius)
 
 SHAPE_CIRCLE (const CIRCLE &aCircle)
 
 SHAPE_CIRCLE (const SHAPE_CIRCLE &aOther)
 
SHAPEClone () const override
 Return a dynamically allocated copy of the shape.
 
SHAPE_CIRCLEoperator= (const SHAPE_CIRCLE &)=default
 
const BOX2I BBox (int aClearance=0) const override
 Compute a bounding box of the shape, with a margin of aClearance a collision.
 
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 segment aSeg than aClearance, indicating a collision.
 
void SetRadius (int aRadius)
 
void SetCenter (const VECTOR2I &aCenter)
 
int GetRadius () const
 
const VECTOR2I GetCenter () const
 
const CIRCLE GetCircle () const
 
void Move (const VECTOR2I &aVector) override
 
void Rotate (double aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
 
bool IsSolid () const override
 
- Public Member Functions inherited from SHAPE
 SHAPE (SHAPE_TYPE aType)
 Create an empty shape of type aType.
 
bool IsNull () const
 Return true if the shape is a null shape.
 
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.
 
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.
 
virtual bool Collide (const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const
 
virtual VECTOR2I Centre () const
 Compute a center-of-mass of the shape.
 
virtual bool Parse (std::stringstream &aStream)
 
virtual const std::string Format () const
 
- Public Member Functions inherited from SHAPE_BASE
 SHAPE_BASE (SHAPE_TYPE aType)
 Create an empty shape of type aType.
 
SHAPE_TYPE Type () const
 Return the type of the shape.
 
virtual bool HasIndexableSubshapes () const
 
virtual size_t GetIndexableSubshapeCount () const
 
virtual void GetIndexableSubshapes (std::vector< SHAPE * > &aSubshapes)
 

Additional Inherited Members

- Static Public Attributes inherited from SHAPE
static const int MIN_PRECISION_IU = 4
 This is the minimum precision for all the points in a shape.
 
- Protected Types inherited from SHAPE
typedef VECTOR2I::extended_type ecoord
 
- Protected Attributes inherited from SHAPE_BASE
SHAPE_TYPE m_type
 < type of our shape
 

Member Function Documentation

◆ BBox()

const BOX2I SHAPE_CIRCLE::BBox ( int  aClearance = 0) const
inlineoverridevirtual

Compute a bounding box of the shape, with a margin of aClearance a collision.

Parameters
aClearancehow much the bounding box is expanded wrs to the minimum enclosing rectangle for the shape.
Returns
the bounding box.

Implements SHAPE.

◆ Clone()

SHAPE * SHAPE_CIRCLE::Clone ( ) const
inlineoverridevirtual

Return a dynamically allocated copy of the shape.

Return values
copyof the shape

Reimplemented from SHAPE.

◆ Collide()

bool SHAPE_CIRCLE::Collide ( const SEG aSeg,
int  aClearance = 0,
int *  aActual = nullptr,
VECTOR2I aLocation = nullptr 
) const
inlineoverridevirtual

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.

Implements SHAPE.

◆ IsSolid()

bool SHAPE_CIRCLE::IsSolid ( ) const
inlineoverridevirtual

Implements SHAPE.

◆ Move()

void SHAPE_CIRCLE::Move ( const VECTOR2I aVector)
inlineoverridevirtual

Implements SHAPE.

◆ Rotate()

void SHAPE_CIRCLE::Rotate ( double  aAngle,
const VECTOR2I aCenter = { 0, 0 } 
)
inlineoverridevirtual
Parameters
aCenteris the rotation center.
aAnglerotation angle in radians.

Implements SHAPE.


The documentation for this class was generated from the following file: