21 #ifndef GF_SPATIAL_R_STAR_TREE_H 22 #define GF_SPATIAL_R_STAR_TREE_H 27 #include <boost/container/static_vector.hpp> 29 #include "BlockAllocator.h" 33 #include "SpatialTypes.h" 36 #ifndef DOXYGEN_SHOULD_SKIP_THIS 51 static constexpr std::size_t MaxSize = 16;
52 static constexpr std::size_t MinSize = 4;
106 std::size_t allocateEntry();
107 void disposeEntry(std::size_t index);
109 std::size_t allocateNode();
110 void disposeNode(std::size_t index);
112 RectF computeBounds(std::size_t nodeIndex);
113 void updateBoundsForChild(std::size_t parentIndex,
const RectF& bounds, std::size_t childIndex);
115 void doInsert(std::size_t entryIndex,
const RectF& bounds);
117 std::size_t chooseSubtree(std::size_t nodeIndex,
const RectF& bounds);
118 std::size_t chooseNode(std::size_t nodeIndex,
const RectF& bounds);
119 std::size_t searchForCoveringNode(std::size_t nodeIndex,
const RectF& bounds);
120 bool existsEmptyVolumeExtension(std::size_t nodeIndex,
const RectF& bounds);
128 template<
typename OverlapEnlargement>
129 std::size_t findCandidates(std::size_t nodeIndex, std::size_t t, std::size_t p,
const RectF& bounds, std::vector<Candidate>& candidates);
131 std::size_t doInsertInLeaf(std::size_t nodeIndex, std::size_t entryIndex,
const RectF& entryBounds);
132 std::size_t doInsertInBranch(std::size_t nodeIndex, std::size_t childIndex,
const RectF& childBounds);
136 void getEntriesAndDispose(std::size_t nodeIndex, std::vector<std::size_t>& eliminated);
137 void doRemove(std::size_t entryIndex);
139 void validate()
const;
140 std::size_t validateNode(std::size_t nodeIndex)
const;
143 static constexpr std::size_t Size = MaxSize + 1;
167 boost::container::static_vector<Member, Size> members;
174 #ifndef DOXYGEN_SHOULD_SKIP_THIS 179 #endif // GF_SPATIAL_R_STAR_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
std::function< void(Handle)> SpatialQueryCallback
A callback for spatial query.
Definition: SpatialTypes.h:82
An implemntation of a R* tree.
Definition: Spatial_RStarTree.h:49
A handle to an object or an id.
Definition: Handle.h:40