BVH.hpp
Go to the documentation of this file.
N-D nearest neighbor query result.
Definition: NearestNeighborQueryEngine.hpp:23
bool Intersects(const BoundingBox< double, N > &box, const BoxIntersectionTestFunc< T, N > &testFunc) const override
Returns true if given box intersects with any of the stored items.
Definition: BVH-Impl.hpp:191
const BoundingBox< double, N > & GetBoundingBox() const
Returns bounding box of every items.
Definition: BVH-Impl.hpp:560
Iterator ItemOfNode(size_t i)
Returns item of i-th node.
Definition: BVH-Impl.hpp:632
size_t NumberOfItems() const
Returns the number of items.
Definition: BVH-Impl.hpp:590
void ForEachIntersectingItem(const BoundingBox< double, N > &box, const BoxIntersectionTestFunc< T, N > &testFunc, const IntersectionVisitorFunc< T > &visitorFunc) const override
Invokes visitorFunc for every intersecting items.
Definition: BVH-Impl.hpp:334
Definition: Matrix.hpp:27
N-D closest intersection query result.
Definition: IntersectionQueryEngine.hpp:25
std::pair< size_t, size_t > Children(size_t i) const
Returns the children indices of i-th node.
Definition: BVH-Impl.hpp:608
Definition: pybind11Utils.hpp:20
Definition: Array-Impl.hpp:19
const T & Item(size_t i) const
Returns the item at i.
Definition: BVH-Impl.hpp:596
Iterator begin()
Returns the begin Iterator of the item.
Definition: BVH-Impl.hpp:566
std::function< bool(const T &, const BoundingBox< double, N > &)> BoxIntersectionTestFunc
N-D box-item intersection test function.
Definition: IntersectionQueryEngine.hpp:55
ClosestIntersectionQueryResult< T, N > ClosestIntersection(const Ray< double, N > &ray, const GetRayIntersectionFunc< T, N > &testFunc) const override
Returns the closest intersection for given ray.
Definition: BVH-Impl.hpp:476
Abstract base class for N-D intersection test query engine.
Definition: IntersectionQueryEngine.hpp:97
Abstract base class for N-D nearest neighbor query engine.
Definition: NearestNeighborQueryEngine.hpp:52
size_t NumberOfNodes() const
Returns the number of nodes.
Definition: BVH-Impl.hpp:602
typename ContainerType::ConstIterator ConstIterator
Definition: BVH.hpp:36
const T * ConstIterator
Definition: ArrayBase.hpp:29
std::function< double(const T &, const Vector< double, N > &)> NearestNeighborDistanceFunc
N-D nearest neighbor distance measure function.
Definition: NearestNeighborQueryEngine.hpp:40
std::function< bool(const T &, const Ray< double, N > &)> RayIntersectionTestFunc
N-D ray-item intersection test function.
Definition: IntersectionQueryEngine.hpp:68
std::function< double(const T &, const Ray< double, N > &)> GetRayIntersectionFunc
N-D ray-item closest intersection evaluation function.
Definition: IntersectionQueryEngine.hpp:81
void Build(const ConstArrayView1< T > &items, const ConstArrayView1< BoundingBox< double, N >> &itemsBounds)
Builds bounding volume hierarchy.
Definition: BVH-Impl.hpp:48
void Clear()
Clears all the contents of this instance.
Definition: BVH-Impl.hpp:75
std::function< void(const T &)> IntersectionVisitorFunc
Visitor function which is invoked for each intersecting item.
Definition: IntersectionQueryEngine.hpp:93
const BoundingBox< double, N > & NodeBound(size_t i) const
Returns bounding box of i-th node.
Definition: BVH-Impl.hpp:626
bool IsLeaf(size_t i) const
Returns true if i-th node is a leaf node.
Definition: BVH-Impl.hpp:620
NearestNeighborQueryResult< T, N > Nearest(const Vector< double, N > &pt, const NearestNeighborDistanceFunc< T, N > &distanceFunc) const override
Definition: BVH-Impl.hpp:84