Menge Modular Pedestrian Simulation Framework for Research and Development
Menge::Math::CircleShape Class Reference

Circle shape. More...

`#include <Geometry2D.h>`

Inheritance diagram for Menge::Math::CircleShape:

## Public Member Functions

CircleShape ()
Default constructor.

CircleShape (const Vector2 &center, float radius)
Constructor. More...

CircleShape (const CircleShape &shape)
Copy constructor. More...

CircleShape (const CircleShape &shape, const Vector2 &offset)
Initializes this shape as an translated version of the input shape. More...

CircleShape operator+ (const Vector2 &pt)
Construct an offset version of this shape. More...

Sets the radius of the circle. More...

void setCenter (const Vector2 &center)
Sets the center of the circle. More...

void set (const Vector2 &center, float radius)
Sets the properties of the circle. More...

virtual bool containsPoint (const Vector2 &pt) const
Determine if the point is inside the shape based on the instance properties. More...

virtual bool containsPoint (const Vector2 &pt, const Vector2 &pos) const
Determine if the point is inside a circle, centered on the given position. More...

Public Member Functions inherited from Menge::Math::Geometry2D
Geometry2D ()
Constructor.

virtual ~Geometry2D ()
Simple destructor.

## Protected Attributes

Vector2 _center
Center of the circle.

Circle shape.

## Constructor & Destructor Documentation

 Menge::Math::CircleShape::CircleShape ( const Vector2 & center, float radius )
inline

Constructor.

Parameters
 center The position of the circle's center. radius The radius of the circle.
 Menge::Math::CircleShape::CircleShape ( const CircleShape & shape )

Copy constructor.

Parameters
 shape The shape to copy from.
 Menge::Math::CircleShape::CircleShape ( const CircleShape & shape, const Vector2 & offset )

Initializes this shape as an translated version of the input shape.

Parameters
 shape The shape to copy from. offset defines an offset from the copied CircleShape for the new CircleShape center

## Member Function Documentation

 bool Menge::Math::CircleShape::containsPoint ( const Vector2 & pt ) const
virtual

Determine if the point is inside the shape based on the instance properties.

Parameters
 pt The point to test.
Returns
True if the point is inside the shape, false otherwise.

Implements Menge::Math::Geometry2D.

Reimplemented in Menge::BFSM::CircleCondition.

 bool Menge::Math::CircleShape::containsPoint ( const Vector2 & pt, const Vector2 & pos ) const
virtual

Determine if the point is inside a circle, centered on the given position.

Parameters
 pt The point to test. pos The position of the circle's center.
Returns
True if the point is inside the shape, false otherwise.

Implements Menge::Math::Geometry2D.

 CircleShape Menge::Math::CircleShape::operator+ ( const Vector2 & pt )

Construct an offset version of this shape.

Parameters
 pt The offset value.
Returns
A new CircleShape offset from this one by the vector pt.
 void Menge::Math::CircleShape::set ( const Vector2 & center, float radius )
inline

Sets the properties of the circle.

Parameters
 void Menge::Math::CircleShape::setCenter ( const Vector2 & center )
inline

Sets the center of the circle.

Parameters
 center The circle's center.