An implementation of quadtree.
More...
#include <gf/Spatial.h>
template<typename T, typename U = float, std::size_t Size = 16>
class gf::QuadTree< T, U, Size >
An implementation of quadtree.
- See also
- gf::RStarTree
-
Quadtree - Wikipedia
◆ QuadTree()
template<typename T , typename U = float, std::size_t Size = 16>
Constructor.
- Parameters
-
bounds | The global bounds for objects in the tree |
◆ clear()
template<typename T , typename U = float, std::size_t Size = 16>
Remove all the objects from the tree.
◆ insert()
template<typename T , typename U = float, std::size_t Size = 16>
Insert an object in the tree.
- Parameters
-
value | The object to insert |
bounds | The bounds of the object |
- Returns
- True if the object has been inserted
◆ query()
template<typename T , typename U = float, std::size_t Size = 16>
Query objects in the tree.
- Parameters
-
bounds | The bounds of the query |
callback | The callback to apply to found objects |
kind | The kind of spatial query |
- Returns
- The number of objects found