O --- O
libPEDSIM Documentation
[HOME] [EXAMPLES] [ECOSYSTEM] [DOCUMENTATION] [DOWNLOAD]
O --- O
Public Types | Public Member Functions | Protected Attributes | List of all members
Ped::Twaypoint Class Reference

#include <ped_waypoint.h>

Public Types

enum  WaypointType { TYPE_NORMAL = 0, TYPE_POINT = 1 }
 

Public Member Functions

 Twaypoint ()
 
 Twaypoint (double x, double y, double r)
 
virtual ~Twaypoint ()
 
virtual Tvector getForce (double myx, double myy, double fromx, double fromy, bool *reached=NULL) const
 
virtual Tvector normalpoint (const Tvector &p, const Tvector &obstacleStart, const Tvector &obstacleEnd) const
 
virtual Tvector normalpoint (double p1, double p2, double oc11, double oc12, double oc21, double oc22) const
 
void setx (double px)
 
void sety (double py)
 
void setr (double pr)
 
void settype (WaypointType t)
 
int getid () const
 
int gettype () const
 
double getx () const
 
double gety () const
 
double getr () const
 

Protected Attributes

int id
 waypoint number
 
double x
 position of the waypoint
 
double y
 position of the waypoint
 
double r
 position of the waypoint
 
WaypointType type
 type of the waypoint
 

Detailed Description

The waypoint classs

Author
chgloor
Date
2012-01-07
Examples:
examples/example01.cpp, examples/example02.cpp, examples/example04.cpp, and examples/example05.cpp.

Definition at line 37 of file ped_waypoint.h.

Constructor & Destructor Documentation

Ped::Twaypoint::Twaypoint ( )

Constructor - sets the most basic parameters.

Date
2012-01-07

Definition at line 25 of file ped_waypoint.cpp.

Ped::Twaypoint::Twaypoint ( double  px,
double  py,
double  pr 
)

Constructor: Sets some intial values. The agent has to pass within the given radius.

Date
2012-01-07
Parameters
pxThe x coordinate of the waypoint
pyThe y coordinate of the waypoint
prThe radius of the waypoint

Definition at line 16 of file ped_waypoint.cpp.

Ped::Twaypoint::~Twaypoint ( )
virtual

Default Destructor

Author
chgloor
Date
2012-02-04

Definition at line 34 of file ped_waypoint.cpp.

Member Function Documentation

Ped::Tvector Ped::Twaypoint::getForce ( double  agentX,
double  agentY,
double  fromx,
double  fromy,
bool *  reached = NULL 
) const
virtual

Returns the force into the direction of the waypoint

Date
2012-01-10
Parameters
agentXThe x coordinate of the current position of the agent
agentYThe y coordinate of the current position of the agent
fromxThe x coordinate of the last assigned waypoint, i.e. where the agent is coming from
fromyThe y coordinate of the last assigned waypoint, i.e. where the agent is coming from
*reachedSet to true if the agent has reached the waypoint in this call.
Returns
Tvector The calculated force

Definition at line 81 of file ped_waypoint.cpp.

Ped::Tvector Ped::Twaypoint::normalpoint ( const Tvector p,
const Tvector obstacleStart,
const Tvector obstacleEnd 
) const
virtual

Calculates the point that is on the given line and normal to the given position. If it is not inside the line, the start or end point of the line is returned.

Date
2012-01-10
Parameters
pThe point outside the obstacle
normalLineStartThe first corner of the normal line
normalLineEndThe second corner of the normal line
Returns
Tvector The calculated point

Definition at line 44 of file ped_waypoint.cpp.

Ped::Tvector Ped::Twaypoint::normalpoint ( double  p1,
double  p2,
double  oc11,
double  oc12,
double  oc21,
double  oc22 
) const
virtual

Calculates the point that is on the given line and normal to the given position. If it is not inside the line, the start or end point of the line is returned.

Date
2012-01-10
Parameters
p1The x coordinate of the point outside the obstacle
p2The y coordinate of the point outside the obstacle
oc11The x coordinate of the first corner of the obstacle
oc12The y coordinate of the first corner of the obstacle
oc21The x coordinate of the second corner of the obstacle
oc22The y coordinate of the second corner of the obstacle
Returns
Tvector The calculated point

Definition at line 68 of file ped_waypoint.cpp.


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

⁠(c) Christian Gloor [ c|h|g|l|o|o|r|@|s|i|l|m|a|r|i|l|.|o|r|g| ]