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::RoadMapPath Class Reference

A path on a roadmap between vertices. More...

#include <RoadMapPath.h>

Public Member Functions

 RoadMapPath (size_t pointCount)
 Constructor. More...
 
 ~RoadMapPath ()
 Destructor.
 
void setWayPoint (size_t i, const Vector2 &pos)
 Sets the position of the ith waypoint. More...
 
void setGoalPos (const BFSM::Goal *goal)
 Sets the ultimate goal. More...
 
void setPrefDirection (const Agents::BaseAgent *agent, Agents::PrefVelocity &pVel)
 Sets the direction of the preferred velocity (and target). More...
 
size_t getWayPointCount () const
 Reports the number of waypoints in the path. More...
 
Vector2 getWayPoint (size_t i) const
 Returns the position of the ith waypoint. More...
 
const BFSM::GoalgetGoal () const
 Returns the ultimate goal. More...
 
size_t getTargetID () const
 Returns the current target waypoint index. More...
 

Protected Attributes

const BFSM::Goal_goal
 The ultimate goal.
 
Vector2 _validPos
 The last valid position – validity means the target goal was visible.
 
size_t _targetID
 The index of the current target.
 
size_t _wayPointCount
 The number of way points in the path.
 
Vector2_wayPoints
 The way points along the path.
 

Detailed Description

A path on a roadmap between vertices.

Constructor & Destructor Documentation

Menge::RoadMapPath::RoadMapPath ( size_t  pointCount)

Constructor.

Parameters
pointCountThe number of waypoints in the path.

Member Function Documentation

const BFSM::Goal* Menge::RoadMapPath::getGoal ( ) const
inline

Returns the ultimate goal.

Returns
A pointer to the ultimate goal.
size_t Menge::RoadMapPath::getTargetID ( ) const
inline

Returns the current target waypoint index.

Returns
The index of the target waypoint.
Vector2 Menge::RoadMapPath::getWayPoint ( size_t  i) const

Returns the position of the ith waypoint.

The index i is only validated in debug mode with an assertion. The ultimate goal is not included in the count.

Parameters
iThe index of the desired waypoint.
Returns
The position of the ith waypoint.
size_t Menge::RoadMapPath::getWayPointCount ( ) const
inline

Reports the number of waypoints in the path.

Returns
The number of way points. This does not include the final goal point. So, at its simplest, this could be zero.
void Menge::RoadMapPath::setGoalPos ( const BFSM::Goal goal)
inline

Sets the ultimate goal.

Parameters
goalThe ultimate goal
void Menge::RoadMapPath::setPrefDirection ( const Agents::BaseAgent agent,
Agents::PrefVelocity pVel 
)

Sets the direction of the preferred velocity (and target).

Parameters
agentThe agent to compute the preferred direciton for.
pVelThe preferred velocity to set.
void Menge::RoadMapPath::setWayPoint ( size_t  i,
const Vector2 pos 
)

Sets the position of the ith waypoint.

Parameters
iThe index of the waypoint.
posThe location of the ith waypoint.

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