Horizon
Public Member Functions | List of all members
SHAPE_SEGMENT Class Reference
Inheritance diagram for SHAPE_SEGMENT:
SHAPE

Public Member Functions

 SHAPE_SEGMENT (const VECTOR2I &aA, const VECTOR2I &aB, int aWidth=0)
 
 SHAPE_SEGMENT (const SEG &aSeg, int aWidth=0)
 
SHAPEClone () const override
 Function Clone() More...
 
const BOX2I BBox (int aClearance=0) const override
 Function BBox() More...
 
bool Collide (const SEG &aSeg, int aClearance=0) const override
 Function Collide() More...
 
bool Collide (const VECTOR2I &aP, int aClearance=0) const override
 Function Collide() More...
 
void SetSeg (const SEG &aSeg)
 
const SEGGetSeg () const
 
void SetWidth (int aWidth)
 
int GetWidth () const
 
bool IsSolid () const override
 
void Move (const VECTOR2I &aVector) override
 
 SHAPE_SEGMENT (const VECTOR2I &aA, const VECTOR2I &aB, int aWidth=0)
 
 SHAPE_SEGMENT (const SEG &aSeg, int aWidth=0)
 
SHAPEClone () const override
 Function Clone() More...
 
const BOX2I BBox (int aClearance=0) const override
 Function BBox() More...
 
bool Collide (const SEG &aSeg, int aClearance=0) const override
 Function Collide() More...
 
bool Collide (const VECTOR2I &aP, int aClearance=0) const override
 Function Collide() More...
 
void SetSeg (const SEG &aSeg)
 
const SEGGetSeg () const
 
void SetWidth (int aWidth)
 
int GetWidth () const
 
bool IsSolid () const override
 
void Move (const VECTOR2I &aVector) override
 
- Public Member Functions inherited from SHAPE
 SHAPE (SHAPE_TYPE aType)
 Constructor. More...
 
SHAPE_TYPE Type () const
 Function Type() 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 VECTOR2I Centre () const
 Function Centre() More...
 
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 bool Collide (const SHAPE *aShape, int aClearance, VECTOR2I &aMTV) const
 Function Collide() More...
 
virtual bool Collide (const SHAPE *aShape, int aClearance=0) const
 
virtual VECTOR2I Centre () const
 Function Centre() More...
 
virtual bool Parse (std::stringstream &aStream)
 
virtual const std::string Format () const
 

Additional Inherited Members

- Protected Types inherited from SHAPE
typedef VECTOR2I::extended_type ecoord
 
typedef VECTOR2I::extended_type ecoord
 
- Protected Attributes inherited from SHAPE
SHAPE_TYPE m_type
 

type of our shape


 

Member Function Documentation

◆ BBox() [1/2]

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

Function BBox()

Computes 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.

◆ BBox() [2/2]

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

Function BBox()

Computes 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() [1/2]

SHAPE* SHAPE_SEGMENT::Clone ( ) const
inlineoverridevirtual

Function Clone()

Returns a dynamically allocated copy of the shape

Return values
copyof the shape

Reimplemented from SHAPE.

◆ Clone() [2/2]

SHAPE* SHAPE_SEGMENT::Clone ( ) const
inlineoverridevirtual

Function Clone()

Returns a dynamically allocated copy of the shape

Return values
copyof the shape

Reimplemented from SHAPE.

◆ Collide() [1/4]

bool SHAPE_SEGMENT::Collide ( const SEG aSeg,
int  aClearance = 0 
) const
inlineoverridevirtual

Function Collide()

Checks if the boundary of shape (this) lies closer to the segment aSeg than aClearance, indicating a collision.

Returns
true, if there is a collision.

Implements SHAPE.

◆ Collide() [2/4]

bool SHAPE_SEGMENT::Collide ( const SEG aSeg,
int  aClearance = 0 
) const
inlineoverridevirtual

Function Collide()

Checks if the boundary of shape (this) lies closer to the segment aSeg than aClearance, indicating a collision.

Returns
true, if there is a collision.

Implements SHAPE.

◆ Collide() [3/4]

bool SHAPE_SEGMENT::Collide ( const VECTOR2I aP,
int  aClearance = 0 
) const
inlineoverridevirtual

Function Collide()

Checks if the boundary of shape (this) lies closer to the point aP than aClearance, indicating a collision.

Returns
true, if there is a collision.

Reimplemented from SHAPE.

◆ Collide() [4/4]

bool SHAPE_SEGMENT::Collide ( const VECTOR2I aP,
int  aClearance = 0 
) const
inlineoverridevirtual

Function Collide()

Checks if the boundary of shape (this) lies closer to the point aP than aClearance, indicating a collision.

Returns
true, if there is a collision.

Reimplemented from SHAPE.


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