Bounding Volume Hierarchy (BVH) in N-D. More...
#include <Core/Geometry/BVH.hpp>
Public Types | |
using | ContainerType = Array1< T > |
using | Iterator = typename ContainerType::Iterator |
using | ConstIterator = typename ContainerType::ConstIterator |
Public Member Functions | |
void | Build (const ConstArrayView1< T > &items, const ConstArrayView1< BoundingBox< double, N >> &itemsBounds) |
Builds bounding volume hierarchy. More... | |
void | Clear () |
Clears all the contents of this instance. More... | |
NearestNeighborQueryResult< T, N > | Nearest (const Vector< double, N > &pt, const NearestNeighborDistanceFunc< T, N > &distanceFunc) const override |
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. More... | |
bool | Intersects (const Ray< double, N > &ray, const RayIntersectionTestFunc< T, N > &testFunc) const override |
Returns true if given ray intersects with any of the stored items. More... | |
void | ForEachIntersectingItem (const BoundingBox< double, N > &box, const BoxIntersectionTestFunc< T, N > &testFunc, const IntersectionVisitorFunc< T > &visitorFunc) const override |
Invokes visitorFunc for every intersecting items. More... | |
void | ForEachIntersectingItem (const Ray< double, N > &ray, const RayIntersectionTestFunc< T, N > &testFunc, const IntersectionVisitorFunc< T > &visitorFunc) const override |
Invokes visitorFunc for every intersecting items. More... | |
ClosestIntersectionQueryResult< T, N > | ClosestIntersection (const Ray< double, N > &ray, const GetRayIntersectionFunc< T, N > &testFunc) const override |
Returns the closest intersection for given ray . More... | |
const BoundingBox< double, N > & | GetBoundingBox () const |
Returns bounding box of every items. More... | |
Iterator | begin () |
Returns the begin Iterator of the item. More... | |
Iterator | end () |
Returns the end Iterator of the item. More... | |
ConstIterator | begin () const |
Returns the immutable begin Iterator of the item. More... | |
ConstIterator | end () const |
Returns the immutable end Iterator of the item. More... | |
size_t | NumberOfItems () const |
Returns the number of items. More... | |
const T & | Item (size_t i) const |
Returns the item at i . More... | |
size_t | NumberOfNodes () const |
Returns the number of nodes. More... | |
std::pair< size_t, size_t > | Children (size_t i) const |
Returns the children indices of i-th node. More... | |
bool | IsLeaf (size_t i) const |
Returns true if i-th node is a leaf node. More... | |
const BoundingBox< double, N > & | NodeBound (size_t i) const |
Returns bounding box of i-th node. More... | |
Iterator | ItemOfNode (size_t i) |
Returns item of i-th node. More... | |
ConstIterator | ItemOfNode (size_t i) const |
Returns item of i-th node. More... | |
Public Member Functions inherited from CubbyFlow::IntersectionQueryEngine< T, N > | |
IntersectionQueryEngine ()=default | |
Default constructor. More... | |
virtual | ~IntersectionQueryEngine ()=default |
Default virtual destructor. More... | |
IntersectionQueryEngine (const IntersectionQueryEngine &other)=default | |
Default copy constructor. More... | |
IntersectionQueryEngine (IntersectionQueryEngine &&other) noexcept=default | |
Default move constructor. More... | |
IntersectionQueryEngine & | operator= (const IntersectionQueryEngine &other)=default |
Default copy assignment operator. More... | |
IntersectionQueryEngine & | operator= (IntersectionQueryEngine &&other) noexcept=default |
Default move assignment operator. More... | |
Public Member Functions inherited from CubbyFlow::NearestNeighborQueryEngine< T, N > | |
NearestNeighborQueryEngine ()=default | |
Default constructor. More... | |
virtual | ~NearestNeighborQueryEngine ()=default |
Default virtual destructor. More... | |
NearestNeighborQueryEngine (const NearestNeighborQueryEngine &other)=default | |
Default copy constructor. More... | |
NearestNeighborQueryEngine (NearestNeighborQueryEngine &&other) noexcept=default | |
Default move constructor. More... | |
NearestNeighborQueryEngine & | operator= (const NearestNeighborQueryEngine &other)=default |
Default copy assignment operator. More... | |
NearestNeighborQueryEngine & | operator= (NearestNeighborQueryEngine &&other) noexcept=default |
Default move assignment operator. More... | |
Detailed Description
template<typename T, size_t N>
class CubbyFlow::BVH< T, N >
Bounding Volume Hierarchy (BVH) in N-D.
This class implements the classic bounding volume hierarchy structure in N-D. It implements IntersectionQueryEngine in order to support box/ray intersection tests. Also, NearestNeighborQueryEngine is implemented to provide nearest neighbor query.
Member Typedef Documentation
◆ ConstIterator
using CubbyFlow::BVH< T, N >::ConstIterator = typename ContainerType::ConstIterator |
◆ ContainerType
using CubbyFlow::BVH< T, N >::ContainerType = Array1<T> |
◆ Iterator
using CubbyFlow::BVH< T, N >::Iterator = typename ContainerType::Iterator |
Member Function Documentation
◆ begin() [1/2]
BVH< T, N >::Iterator CubbyFlow::BVH< T, N >::begin | ( | ) |
Returns the begin Iterator of the item.
◆ begin() [2/2]
BVH< T, N >::ConstIterator CubbyFlow::BVH< T, N >::begin | ( | ) | const |
Returns the immutable begin Iterator of the item.
◆ Build()
void CubbyFlow::BVH< T, N >::Build | ( | const ConstArrayView1< T > & | items, |
const ConstArrayView1< BoundingBox< double, N >> & | itemsBounds | ||
) |
Builds bounding volume hierarchy.
◆ Children()
std::pair< size_t, size_t > CubbyFlow::BVH< T, N >::Children | ( | size_t | i | ) | const |
Returns the children indices of i-th
node.
◆ Clear()
void CubbyFlow::BVH< T, N >::Clear | ( | ) |
Clears all the contents of this instance.
◆ ClosestIntersection()
|
overridevirtual |
Returns the closest intersection for given ray
.
Implements CubbyFlow::IntersectionQueryEngine< T, N >.
◆ end() [1/2]
BVH< T, N >::Iterator CubbyFlow::BVH< T, N >::end | ( | ) |
Returns the end Iterator of the item.
◆ end() [2/2]
BVH< T, N >::ConstIterator CubbyFlow::BVH< T, N >::end | ( | ) | const |
Returns the immutable end Iterator of the item.
◆ ForEachIntersectingItem() [1/2]
|
overridevirtual |
Invokes visitorFunc
for every intersecting items.
Implements CubbyFlow::IntersectionQueryEngine< T, N >.
◆ ForEachIntersectingItem() [2/2]
|
overridevirtual |
Invokes visitorFunc
for every intersecting items.
Implements CubbyFlow::IntersectionQueryEngine< T, N >.
◆ GetBoundingBox()
const BoundingBox< double, N > & CubbyFlow::BVH< T, N >::GetBoundingBox | ( | ) | const |
Returns bounding box of every items.
◆ Intersects() [1/2]
|
overridevirtual |
Returns true if given box
intersects with any of the stored items.
Implements CubbyFlow::IntersectionQueryEngine< T, N >.
◆ Intersects() [2/2]
|
overridevirtual |
Returns true if given ray
intersects with any of the stored items.
Implements CubbyFlow::IntersectionQueryEngine< T, N >.
◆ IsLeaf()
bool CubbyFlow::BVH< T, N >::IsLeaf | ( | size_t | i | ) | const |
Returns true if i-th
node is a leaf node.
◆ Item()
const T & CubbyFlow::BVH< T, N >::Item | ( | size_t | i | ) | const |
Returns the item at i
.
◆ ItemOfNode() [1/2]
BVH< T, N >::Iterator CubbyFlow::BVH< T, N >::ItemOfNode | ( | size_t | i | ) |
Returns item of i-th
node.
◆ ItemOfNode() [2/2]
BVH< T, N >::ConstIterator CubbyFlow::BVH< T, N >::ItemOfNode | ( | size_t | i | ) | const |
Returns item of i-th
node.
◆ Nearest()
|
inlineoverridevirtual |
Returns the nearest neighbor for given point and distance measure function.
Implements CubbyFlow::NearestNeighborQueryEngine< T, N >.
◆ NodeBound()
const BoundingBox< double, N > & CubbyFlow::BVH< T, N >::NodeBound | ( | size_t | i | ) | const |
Returns bounding box of i-th
node.
◆ NumberOfItems()
size_t CubbyFlow::BVH< T, N >::NumberOfItems | ( | ) | const |
Returns the number of items.
◆ NumberOfNodes()
size_t CubbyFlow::BVH< T, N >::NumberOfNodes | ( | ) | const |
Returns the number of nodes.
The documentation for this class was generated from the following files:
- Core/Geometry/BVH.hpp
- Core/Geometry/BVH-Impl.hpp