21 #ifndef GF_SPATIAL_QUAD_TREE_H 22 #define GF_SPATIAL_QUAD_TREE_H 27 #include <gf/Handle.h> 28 #include <gf/Portability.h> 31 #include "BlockAllocator.h" 35 #ifndef DOXYGEN_SHOULD_SKIP_THIS 100 std::size_t allocateEntry();
101 void disposeEntry(std::size_t index);
103 std::size_t allocateNode();
104 void disposeNode(std::size_t index);
106 bool doInsert(std::size_t entryIndex, std::size_t nodeIndex);
108 void doRemove(std::size_t entryIndex);
110 void subdivide(std::size_t nodeIndex);
111 void sanitize(std::size_t nodeIndex);
114 static constexpr std::size_t Size = 16;
115 static constexpr std::size_t Null = -1;
127 std::vector<std::size_t> entries;
129 std::size_t children[4];
132 return children[0] == Null;
141 #ifndef DOXYGEN_SHOULD_SKIP_THIS 146 #endif // GF_SPATIAL_QUAD_TREE_H The structure represents an internal node.
std::function< void(Handle)> SpatialQueryCallback
A callback for spatial query.
Definition: spatial/Types.h:81
SpatialId
A spatial id.
Definition: spatial/Types.h:41
Search for all objects that intersect the given bounds.
The namespace for gf classes.
Definition: Action.h:35
An implementation of quadtree.
Definition: QuadTree.h:46
SpatialQuery
A kind of spatial query.
Definition: spatial/Types.h:72