Quadtree.h
Go to the documentation of this file.
NearestNeighborQueryResult2< T > GetNearestNeighbor(const Vector2D &pt, const NearestNeighborDistanceFunc2< T > &distanceFunc) const override
Definition: Quadtree-Impl.h:61
Abstract base class for 2-D intersection test query engine.
Definition: IntersectionQueryEngine2.h:47
Closest intersection query result.
Definition: IntersectionQueryEngine2.h:19
size_t GetNumberOfNodes() const
Returns the number of quadtree nodes.
Definition: Quadtree-Impl.h:223
size_t GetMaxDepth() const
Returns the maximum depth of the tree.
Definition: Quadtree-Impl.h:247
std::function< bool(const T &, const BoundingBox2D &)> BoxIntersectionTestFunc2
Box-item intersection test function.
Definition: IntersectionQueryEngine2.h:31
size_t GetChildIndex(size_t nodeIdx, size_t childIdx) const
Returns a child's index for given node.
Definition: Quadtree-Impl.h:235
Nearest neighbor query result.
Definition: NearestNeighborQueryEngine2.h:18
void Build(const std::vector< T > &items, const BoundingBox2D &bound, const BoxIntersectionTestFunc2< T > &testFunc, size_t maxDepth)
Definition: Quadtree-Impl.h:30
const std::vector< size_t > & GetItemsAtNode(size_t nodeIdx) const
Returns the list of the items for given noide index.
Definition: Quadtree-Impl.h:229
bool IsIntersects(const BoundingBox2D &box, const BoxIntersectionTestFunc2< T > &testFunc) const override
Returns true if given box intersects with any of the stored items.
Definition: Quadtree-Impl.h:145
void Clear()
Clears all the contents of this instance.
Definition: Quadtree-Impl.h:52
Definition: pybind11Utils.h:24
void ForEachIntersectingItem(const BoundingBox2D &box, const BoxIntersectionTestFunc2< T > &testFunc, const IntersectionVisitorFunc2< T > &visitorFunc) const override
Invokes visitorFunc for every intersecting items.
Definition: Quadtree-Impl.h:160
std::function< void(const T &)> IntersectionVisitorFunc2
Visitor function which is invoked for each intersecting item.
Definition: IntersectionQueryEngine2.h:43
Iterator begin()
Returns the begin iterator of the item.
Definition: Quadtree-Impl.h:187
size_t GetNumberOfItems() const
Returns the number of items.
Definition: Quadtree-Impl.h:211
ClosestIntersectionQueryResult2< T > GetClosestIntersection(const Ray2D &ray, const GetRayIntersectionFunc2< T > &testFunc) const override
Returns the closest intersection for given ray.
Definition: Quadtree-Impl.h:176
Iterator end()
Returns the end iterator of the item.
Definition: Quadtree-Impl.h:193
const BoundingBox2D & GetBoundingBox() const
Returns the bounding box of this quadtree.
Definition: Quadtree-Impl.h:241
Abstract base class for 2-D nearest neighbor query engine.
Definition: NearestNeighborQueryEngine2.h:30
const T & GetItem(size_t i) const
Returns the item at i.
Definition: Quadtree-Impl.h:217
std::function< double(const T &, const Ray2D &)> GetRayIntersectionFunc2
Ray-item closest intersection evaluation function.
Definition: IntersectionQueryEngine2.h:39
typename ContainerType::const_iterator ConstIterator
Definition: Quadtree.h:32
std::function< bool(const T &, const Ray2D &)> RayIntersectionTestFunc2
Ray-item intersection test function.
Definition: IntersectionQueryEngine2.h:35
std::function< double(const T &, const Vector2D &)> NearestNeighborDistanceFunc2
Nearest neighbor distance measure function.
Definition: NearestNeighborQueryEngine2.h:26