21#ifndef GF_SPATIAL_SIMPLE_SPATIAL_INDEX_H
22#define GF_SPATIAL_SIMPLE_SPATIAL_INDEX_H
29#include "SpatialTypes.h"
32#ifndef DOXYGEN_SHOULD_SKIP_THIS
96 static constexpr std::size_t Null =
static_cast<std::size_t
>(-1);
97 static constexpr std::size_t Occupied =
static_cast<std::size_t
>(-2);
105 std::vector<Entry> m_entries;
106 std::size_t m_firstFreeEntry;
109#ifndef DOXYGEN_SHOULD_SKIP_THIS
A handle to an object or an id.
Definition: Handle.h:40
An very simple spatial index.
Definition: Spatial_SimpleSpatialIndex.h:42
SpatialId insert(Handle handle, const RectF &bounds)
Insert an object in the tree.
std::size_t query(const RectF &bounds, SpatialQueryCallback callback, SpatialQuery kind=SpatialQuery::Intersect)
Query objects in the tree.
Handle operator[](SpatialId id)
Get the handle associated to a spatial id.
SimpleSpatialIndex()
Constructor.
void clear()
Remove all the objects from the tree.
void remove(SpatialId id)
Remove an object from the tree.
void modify(SpatialId id, RectF bounds)
Modify the bounds of an object.
SpatialQuery
A kind of spatial query.
Definition: SpatialTypes.h:73
std::function< void(Handle)> SpatialQueryCallback
A callback for spatial query.
Definition: SpatialTypes.h:82
SpatialId
A spatial id.
Definition: SpatialTypes.h:42
@ Intersect
Search for all objects that intersect the given bounds.
The namespace for gf classes.