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::Agents::BergKDTree Class Reference

Spatial query object. Used to determine obstacles and agents near an agent – based on a kd-tree. More...

#include <SpatialQueryKDTree.h>

Inheritance diagram for Menge::Agents::BergKDTree:
Menge::Agents::SpatialQuery Menge::Element

Public Member Functions

 BergKDTree ()
 Constructor.
 
virtual void setAgents (const std::vector< BaseAgent * > &agents)
 Define the set of agents on which kd-tree will query. More...
 
virtual void updateAgents ()
 Allows the spatial query structure to update its knowledge of the agent positions.
 
virtual void agentQuery (ProximityQuery *query) const
 performs an agent based proximity query More...
 
virtual void processObstacles ()
 Do the necessary pre-computation to support obstacle definitions.
 
virtual void obstacleQuery (ProximityQuery *query) const
 perform an obstacle based proximity query More...
 
virtual bool queryVisibility (const Vector2 &q1, const Vector2 &q2, float radius) const
 Queries the visibility between two points within a specified radius. More...
 
- Public Member Functions inherited from Menge::Agents::SpatialQuery
 SpatialQuery ()
 Constructor.
 
virtual void addObstacle (Obstacle *obs)
 adds an obstacle to the internal list of the spatial query
 
const std::vector< Obstacle * > getObstacles ()
 returns the collected obstacles of the spatial query for use in visualization More...
 
virtual void setNeighborVisibleTest (bool state)
 Sets the spatial query to include visibility in finding agent neighbors. More...
 
void setTestVisibility (bool status)
 Sets the test visibility status of the neighbor functions. More...
 
bool getTestVisibility () const
 Reports the test visibility property of the spatial query instance. More...
 
- Public Member Functions inherited from Menge::Element
void destroy ()
 This supplants the destructor. More...
 
virtual BFSM::TaskgetTask ()
 Return an optional task associated with this element. More...
 
virtual SceneGraph::GLNodegetSGNode ()
 Returns an optional visualization element associated with the element. More...
 

Protected Attributes

AgentKDTree _agentTree
 A kd-tree for the agent queries.
 
ObstacleKDTree _obstTree
 A kd-tree for the obstacle queries.
 
- Protected Attributes inherited from Menge::Agents::SpatialQuery
bool _testVisibility
 Dictates if visibility queries should be used (true) for neighbor queries or not (false).
 
std::vector< Obstacle * > _obstacles
 an internal central list of obstacles
 

Additional Inherited Members

- Protected Member Functions inherited from Menge::Agents::SpatialQuery
virtual ~SpatialQuery ()
 Virtual destructor.
 

Detailed Description

Spatial query object. Used to determine obstacles and agents near an agent – based on a kd-tree.

Member Function Documentation

virtual void Menge::Agents::BergKDTree::agentQuery ( ProximityQuery query) const
inlinevirtual

performs an agent based proximity query

Parameters
querya pointer to the proximity query to be performed

Implements Menge::Agents::SpatialQuery.

virtual void Menge::Agents::BergKDTree::obstacleQuery ( ProximityQuery query) const
inlinevirtual

perform an obstacle based proximity query

Parameters
querya pointer to the proximity query to be performed

Implements Menge::Agents::SpatialQuery.

virtual bool Menge::Agents::BergKDTree::queryVisibility ( const Vector2 q1,
const Vector2 q2,
float  radius 
) const
inlinevirtual

Queries the visibility between two points within a specified radius.

Parameters
q1The first point between which visibility is to be tested.
q2The second point between which visibility is to be tested.
radiusThe radius within which visibility is to be tested.
Returns
True if q1 and q2 are mutually visible within the radius; false otherwise.

Implements Menge::Agents::SpatialQuery.

virtual void Menge::Agents::BergKDTree::setAgents ( const std::vector< BaseAgent * > &  agents)
inlinevirtual

Define the set of agents on which kd-tree will query.

Parameters
agentsThe set of agents in the simulator to be managed.

Implements Menge::Agents::SpatialQuery.


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