21 #ifndef GF_SPATIAL_QUAD_TREE_H 22 #define GF_SPATIAL_QUAD_TREE_H 27 #include "BlockAllocator.h" 31 #include "SpatialTypes.h" 34 #ifndef DOXYGEN_SHOULD_SKIP_THIS 99 std::size_t allocateEntry();
100 void disposeEntry(std::size_t index);
102 std::size_t allocateNode();
103 void disposeNode(std::size_t index);
105 bool doInsert(std::size_t entryIndex, std::size_t nodeIndex);
107 void doRemove(std::size_t entryIndex);
109 void subdivide(std::size_t nodeIndex);
110 void sanitize(std::size_t nodeIndex);
113 static constexpr std::size_t Size = 16;
114 static constexpr std::size_t Null =
static_cast<std::size_t
>(-1);
126 std::vector<std::size_t> entries;
128 std::size_t children[4];
131 return children[0] == Null;
140 #ifndef DOXYGEN_SHOULD_SKIP_THIS 145 #endif // GF_SPATIAL_QUAD_TREE_H The structure represents an internal node.
SpatialQuery
A kind of spatial query.
Definition: SpatialTypes.h:73
SpatialId
A spatial id.
Definition: SpatialTypes.h:42
Search for all objects that intersect the given bounds.
The namespace for gf classes.
Definition: Action.h:35
An implementation of quadtree.
Definition: Spatial_Quadtree.h:45
std::function< void(Handle)> SpatialQueryCallback
A callback for spatial query.
Definition: SpatialTypes.h:82
A handle to an object or an id.
Definition: Handle.h:40