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 Member Functions | Protected Attributes | List of all members
Menge::Agents::SpatialQuery Class Referenceabstract

The base class for performing spatial queries. More...

#include <SpatialQuery.h>

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

Public Member Functions

 SpatialQuery ()
 Constructor.
 
virtual void setAgents (const std::vector< BaseAgent * > &agents)=0
 Define the set of agents on which query class will operate.
 
virtual void updateAgents ()=0
 Allows the spatial query structure to update its knowledge of the agent positions. TODO: Replace this with a task.
 
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 agentQuery (ProximityQuery *query) const =0
 performs an agent based proximity query More...
 
virtual void processObstacles ()=0
 Do the necessary pre-computation to support obstacle definitions. Now uses the internal obstacle representation.
 
virtual void obstacleQuery (ProximityQuery *query) const =0
 performs an obstacle based proximity query More...
 
virtual bool queryVisibility (const Vector2 &q1, const Vector2 &q2, float radius) const =0
 Queries the visibility between two points within a specified radius. 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 Member Functions

virtual ~SpatialQuery ()
 Virtual destructor.
 

Protected Attributes

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
 

Detailed Description

The base class for performing spatial queries.

A spatial query implementation has to support several operations:

Member Function Documentation

virtual void Menge::Agents::SpatialQuery::agentQuery ( ProximityQuery query) const
pure virtual

performs an agent based proximity query

Parameters
querya pointer for the proximity query to be performed

Implemented in Menge::Agents::BergKDTree, and Menge::Agents::NavMeshSpatialQuery.

const std::vector< Obstacle * > Menge::Agents::SpatialQuery::getObstacles ( )
inline

returns the collected obstacles of the spatial query for use in visualization

Returns
const pointer to the obstacle set
bool Menge::Agents::SpatialQuery::getTestVisibility ( ) const
inline

Reports the test visibility property of the spatial query instance.

Returns
A boolean reporting if the spatial query instance uses visibility tests when computing nearby agents and obstacles (true) or not (false).
virtual void Menge::Agents::SpatialQuery::obstacleQuery ( ProximityQuery query) const
pure virtual

performs an obstacle based proximity query

Parameters
querya pointer for the proximity query to be performed

Implemented in Menge::Agents::BergKDTree, and Menge::Agents::NavMeshSpatialQuery.

virtual bool Menge::Agents::SpatialQuery::queryVisibility ( const Vector2 q1,
const Vector2 q2,
float  radius 
) const
pure virtual

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.

Implemented in Menge::Agents::NavMeshSpatialQuery, and Menge::Agents::BergKDTree.

virtual void Menge::Agents::SpatialQuery::setNeighborVisibleTest ( bool  state)
inlinevirtual

Sets the spatial query to include visibility in finding agent neighbors.

Parameters
stateIf true, the spatial query has to consider visibility. if false, it doesn't.
void Menge::Agents::SpatialQuery::setTestVisibility ( bool  status)
inline

Sets the test visibility status of the neighbor functions.

Parameters
statusThe new stats of the test visibility property.

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