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

#include <ped_obstacle.h>

Public Member Functions

 Tobstacle ()
 
 Tobstacle (double ax, double ay, double bx, double by)
 
 Tobstacle (const Tvector &startIn, const Tvector &endIn)
 
virtual ~Tobstacle ()
 Destructor.
 
int getid () const
 
int gettype () const
 
double getax () const
 
double getay () const
 
double getbx () const
 
double getby () const
 
Tvector getStartPoint () const
 
Tvector getEndPoint () const
 
virtual void setPosition (double ax, double ay, double bx, double by)
 
virtual void setPosition (const Tvector &startIn, const Tvector &endIn)
 
virtual void setStartPoint (const Tvector &startIn)
 
virtual void setEndPoint (const Tvector &endIn)
 
virtual void setType (int t)
 
virtual Tvector closestPoint (double p1, double p2) const
 
virtual Tvector closestPoint (const Tvector &pointIn) const
 
virtual void rotate (double x, double y, double phi)
 

Protected Attributes

int id
 Obstacle number.
 
double ax
 Position of the obstacle.
 
double ay
 Position of the obstacle.
 
double bx
 Position of the obstacle.
 
double by
 Position of the obstacle.
 
int type
 

Detailed Description

Class that defines a Tobstacle object. An obstacle is, for now, always a wall with start and end coordinate.

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

Definition at line 34 of file ped_obstacle.h.

Constructor & Destructor Documentation

Ped::Tobstacle::Tobstacle ( )

Default constructor, places a wall from 0/0 to 1/1

Date
2012-01-07

Definition at line 15 of file ped_obstacle.cpp.

Ped::Tobstacle::Tobstacle ( double  pax,
double  pay,
double  pbx,
double  pby 
)

Constructor used to set initial values.

Date
2012-01-07
Parameters
paxx coordinate of the first corner of the obstacle.
payy coordinate of the first corner of the obstacle.
pbxx coordinate of the second corner of the obstacle.
pbyy coordinate of the second corner of the obstacle.

Definition at line 27 of file ped_obstacle.cpp.

Ped::Tobstacle::Tobstacle ( const Tvector startIn,
const Tvector endIn 
)

Constructor used to set initial values.

Date
2013-08-02
Parameters
startInThe first corner of the obstacle.
endInThe second corner of the obstacle.

Definition at line 39 of file ped_obstacle.cpp.

Member Function Documentation

Ped::Tvector Ped::Tobstacle::closestPoint ( double  p1,
double  p2 
) const
virtual

Calculates and returns the forces of the obstacle to a given point x/y. x/y can be the location of an agent, but it can also be anything else, for example a grid coordinate of the user interface, if you want to display the obstacle forces on the map.

Date
2012-01-17
Returns
Tvector forces
Parameters
doublex: The x coordinate of the point
doubley: The y coordinate of the point

Definition at line 115 of file ped_obstacle.cpp.

Referenced by Ped::Tagent::obstacleForce().

void Ped::Tobstacle::rotate ( double  x,
double  y,
double  phi 
)
virtual

rot phi around x/y

Author
chgloor
Date
2012-01-20
Warning
Due to rounding errors, this will fail after a while.

Definition at line 127 of file ped_obstacle.cpp.

void Ped::Tobstacle::setPosition ( double  pax,
double  pay,
double  pbx,
double  pby 
)
virtual

Moves the obstacle to a new position. Can be uses to simulate opening doors etc.

Date
2012-01-07
Parameters
paxx coordinate of the first corner of the obstacle.
payy coordinate of the first corner of the obstacle.
pbxx coordinate of the second corner of the obstacle.
pbyy coordinate of the second corner of the obstacle.
Examples:
examples/example05.cpp.

Definition at line 69 of file ped_obstacle.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| ]