Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
Menge::Math::CircleShape Class Reference

Circle shape. More...

#include <Geometry2D.h>

Inheritance diagram for Menge::Math::CircleShape:
Menge::Math::Geometry2D Menge::BFSM::CircleCondition

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...
 
void setRadius (float radius)
 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.
 
float _radSqd
 Squared radius of the circle.
 

Detailed Description

Circle shape.

Constructor & Destructor Documentation

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

Constructor.

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

Copy constructor.

Parameters
shapeThe 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
shapeThe shape to copy from.
offsetdefines 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
ptThe 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
ptThe point to test.
posThe 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
ptThe 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
centerThe circle's center.
radiusThe circle's radius.
void Menge::Math::CircleShape::setCenter ( const Vector2 center)
inline

Sets the center of the circle.

Parameters
centerThe circle's center.
void Menge::Math::CircleShape::setRadius ( float  radius)
inline

Sets the radius of the circle.

Parameters
radiusThe circle's radius.

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