Quadtree.hpp
Go to the documentation of this file.
N-D nearest neighbor query result.
Definition: NearestNeighborQueryEngine.hpp:23
size_t GetNumberOfNodes() const
Returns the number of quadtree nodes.
Definition: Quadtree-Impl.hpp:222
size_t GetMaxDepth() const
Returns the maximum depth of the tree.
Definition: Quadtree-Impl.hpp:246
size_t GetChildIndex(size_t nodeIdx, size_t childIdx) const
Returns a child's index for given node.
Definition: Quadtree-Impl.hpp:234
NearestNeighborQueryResult2< T > Nearest(const Vector2D &pt, const NearestNeighborDistanceFunc2< T > &distanceFunc) const override
Definition: Quadtree-Impl.hpp:59
void ForEachIntersectingItem(const BoundingBox2D &box, const BoxIntersectionTestFunc2< T > &testFunc, const IntersectionVisitorFunc< T > &visitorFunc) const override
Invokes visitorFunc for every intersecting items.
Definition: Quadtree-Impl.hpp:159
void Build(const std::vector< T > &items, const BoundingBox2D &bound, const BoxIntersectionTestFunc2< T > &testFunc, size_t maxDepth)
Definition: Quadtree-Impl.hpp:26
bool Intersects(const BoundingBox2D &box, const BoxIntersectionTestFunc2< T > &testFunc) const override
Returns true if given box intersects with any of the stored items.
Definition: Quadtree-Impl.hpp:145
const std::vector< size_t > & GetItemsAtNode(size_t nodeIdx) const
Returns the list of the items for given node index.
Definition: Quadtree-Impl.hpp:228
Definition: Matrix.hpp:27
void Clear()
Clears all the contents of this instance.
Definition: Quadtree-Impl.hpp:50
N-D closest intersection query result.
Definition: IntersectionQueryEngine.hpp:25
Definition: pybind11Utils.hpp:20
GetRayIntersectionFunc< T, 2 > GetRayIntersectionFunc2
2-D ray-item closest intersection evaluation function.
Definition: IntersectionQueryEngine.hpp:85
Abstract base class for N-D intersection test query engine.
Definition: IntersectionQueryEngine.hpp:97
Iterator begin()
Returns the begin iterator of the item.
Definition: Quadtree-Impl.hpp:186
size_t GetNumberOfItems() const
Returns the number of items.
Definition: Quadtree-Impl.hpp:210
BoxIntersectionTestFunc< T, 2 > BoxIntersectionTestFunc2
2-D box-item intersection test function.
Definition: IntersectionQueryEngine.hpp:59
Iterator end()
Returns the end iterator of the item.
Definition: Quadtree-Impl.hpp:192
const BoundingBox2D & GetBoundingBox() const
Returns the bounding box of this quadtree.
Definition: Quadtree-Impl.hpp:240
RayIntersectionTestFunc< T, 2 > RayIntersectionTestFunc2
2-D ray-item intersection test function.
Definition: IntersectionQueryEngine.hpp:72
Abstract base class for N-D nearest neighbor query engine.
Definition: NearestNeighborQueryEngine.hpp:52
ClosestIntersectionQueryResult2< T > ClosestIntersection(const Ray2D &ray, const GetRayIntersectionFunc2< T > &testFunc) const override
Returns the closest intersection for given ray.
Definition: Quadtree-Impl.hpp:175
const T & GetItem(size_t i) const
Returns the item at i.
Definition: Quadtree-Impl.hpp:216
typename ContainerType::const_iterator ConstIterator
Definition: Quadtree.hpp:35
std::function< void(const T &)> IntersectionVisitorFunc
Visitor function which is invoked for each intersecting item.
Definition: IntersectionQueryEngine.hpp:93
NearestNeighborDistanceFunc< T, 2 > NearestNeighborDistanceFunc2
2-D nearest neighbor distance measure function.
Definition: NearestNeighborQueryEngine.hpp:44