49 #ifndef __SPATIAL_QUERY_KD_TREE_H__
50 #define __SPATIAL_QUERY_KD_TREE_H__
81 virtual void setAgents(
const std::vector< BaseAgent * > & agents ) {
82 _agentTree.setAgents( agents );
90 _agentTree.buildTree();
99 _agentTree.agentQuery(query);
109 _obstTree.buildTree( _obstacles );
119 _obstTree.obstacleQuery( query);
136 return _obstTree.queryVisibility( q1, q2, radius );
168 virtual const char *
name()
const {
return "kd-tree"; }
178 return "Performs spatial queries by creating a kd-tree on the agents and a bsp " \
179 "tree on the obstacles.";
197 #endif //__SPATIAL_QUERY_KD_TREE_H__
virtual void updateAgents()
Allows the spatial query structure to update its knowledge of the agent positions.
Definition: SpatialQueryKDTree.h:89
The core namespace. All elements of Menge are contained in this namespace.
Definition: AgentGenerator.cpp:43
virtual void agentQuery(ProximityQuery *query) const
performs an agent based proximity query
Definition: SpatialQueryKDTree.h:98
Defines an obstacle kd-tree.
Definition: ObstacleKDTree.h:96
virtual const char * description() const
A description of the spatial query.
Definition: SpatialQueryKDTree.h:177
A class for parsing the xml description of a spatial query and instantiating particular instances...
Definition: SpatialQueryFactory.h:62
Spatial query object. Used to determine obstacles and agents near an agent – based on a kd-tree...
Definition: SpatialQueryKDTree.h:66
virtual void processObstacles()
Do the necessary pre-computation to support obstacle definitions.
Definition: SpatialQueryKDTree.h:108
virtual void obstacleQuery(ProximityQuery *query) const
perform an obstacle based proximity query
Definition: SpatialQueryKDTree.h:118
The base class for filtering spatial queries according to proximity.
Definition: ProximityQuery.h:72
The factory for parsing xml data and instantiating spaital query implementations. ...
virtual void setAgents(const std::vector< BaseAgent * > &agents)
Define the set of agents on which kd-tree will query.
Definition: SpatialQueryKDTree.h:81
AgentKDTree _agentTree
A kd-tree for the agent queries.
Definition: SpatialQueryKDTree.h:143
virtual bool queryVisibility(const Vector2 &q1, const Vector2 &q2, float radius) const
Queries the visibility between two points within a specified radius.
Definition: SpatialQueryKDTree.h:135
BergKDTree()
Constructor.
Definition: SpatialQueryKDTree.h:71
The base class for all objects which support agent spatial queries including: k-nearest agent neighbo...
The base class for performing spatial queries.
Definition: SpatialQuery.h:114
virtual const char * name() const
The name of the spatial query implemenation.
Definition: SpatialQueryKDTree.h:168
Contains the definition of the ObstacleKDTree class. Performs spatial queries for Obstacles...
SpatialQuery * instance() const
Create an instance of this class's spatial query implementation.
Definition: SpatialQueryKDTree.h:193
The namespace that contains the basic simulation mechanisms.
Contains the definition of the AgentKDTree class. Performs spatial queries for agents.
Factory for the BergKDTree.
Definition: SpatialQueryKDTree.h:157
A kd-tree for performing nearest-neighbor searches.
Definition: AgentKDTree.h:74
ObstacleKDTree _obstTree
A kd-tree for the obstacle queries.
Definition: SpatialQueryKDTree.h:148