Menge
Modular Pedestrian Simulation Framework for Research and Development
|
The base class for performing spatial queries. More...
#include <SpatialQuery.h>
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::Task * | getTask () |
Return an optional task associated with this element. More... | |
virtual SceneGraph::GLNode * | getSGNode () |
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 | |
The base class for performing spatial queries.
A spatial query implementation has to support several operations:
|
pure virtual |
performs an agent based proximity query
query | a pointer for the proximity query to be performed |
Implemented in Menge::Agents::BergKDTree, and Menge::Agents::NavMeshSpatialQuery.
|
inline |
returns the collected obstacles of the spatial query for use in visualization
|
inline |
Reports the test visibility property of the spatial query instance.
|
pure virtual |
performs an obstacle based proximity query
query | a pointer for the proximity query to be performed |
Implemented in Menge::Agents::BergKDTree, and Menge::Agents::NavMeshSpatialQuery.
|
pure virtual |
Queries the visibility between two points within a specified radius.
q1 | The first point between which visibility is to be tested. |
q2 | The second point between which visibility is to be tested. |
radius | The radius within which visibility is to be tested. |
Implemented in Menge::Agents::NavMeshSpatialQuery, and Menge::Agents::BergKDTree.
|
inlinevirtual |
Sets the spatial query to include visibility in finding agent neighbors.
state | If true, the spatial query has to consider visibility. if false, it doesn't. |
|
inline |
Sets the test visibility status of the neighbor functions.
status | The new stats of the test visibility property. |