|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Binary tree-based space subdivision container, Z-ordered using morton codes, optimized for intersection queries between axis-aligned boxes. More...
#include <GREM/core/data/LinearBoundingVolumeHierarchy.hpp>
Public Types | |
| using | value_type = Pair<Box<N, Scalar>, T> |
| Value type of the container. | |
| using | reference = Pair<const Box<N, Scalar>, T>& |
| Reference type of the container. | |
| using | const_reference = const Pair<const Box<N, Scalar>, T>& |
| Const reference type of the container. | |
| using | pointer = Pair<const Box<N, Scalar>, T>* |
| Pointer type of the container. | |
| using | const_pointer = const Pair<const Box<N, Scalar>, T>* |
| Const pointer type of the container. | |
| using | size_type = size_t |
| Size type of the container. | |
| using | difference_type = ptrdiff_t |
| Difference type of the container. | |
| using | iterator = pointer |
| Iterator type of the container. | |
| using | const_iterator = const_pointer |
| Const iterator type of the container. | |
Public Member Functions | |
| LinearBoundingVolumeHierarchy () noexcept=default | |
| Construct an empty tree. | |
| void | clear () noexcept |
| Erase all inserted elements from the tree. | |
| iterator | begin () noexcept |
| Get the begin iterator of the elements in the tree. | |
| const_iterator | begin () const noexcept |
| Get the begin iterator of the elements in the tree. | |
| const_iterator | cbegin () const noexcept |
| Get the begin iterator of the elements in the tree. | |
| iterator | end () noexcept |
| Get the end iterator of the elements in the tree. | |
| const_iterator | end () const noexcept |
| Get the end iterator of the elements in the tree. | |
| const_iterator | cend () const noexcept |
| Get the end iterator of the elements in the tree. | |
| size_type | size () const noexcept |
| Get the number of elements in the tree. | |
| bool | empty () const noexcept |
| Check whether the tree is empty or not. | |
| template<typename... Args> | |
| iterator | emplace (const Box< N, Scalar > &elementBoundingBox, Args &&... args) |
| Construct a new element in the tree. | |
| iterator | insert (const Box< N, Scalar > &elementBoundingBox, const T &value) |
| Copy an element into the tree. | |
| iterator | insert (const Box< N, Scalar > &elementBoundingBox, T &&value) |
| Move an element into the tree. | |
| void | erase (const_iterator pos) |
| Remove an element from the tree. | |
| template<typename Callback, typename Predicate> | |
| auto | traverseNodes (Callback &&callback, Predicate &&predicate) const |
| Execute a callback function for each active node of the tree, including empty internal nodes without an element. | |
| template<typename Callback> | |
| auto | traverseNodes (Callback &&callback) const |
| Execute a callback function for each active node of the tree, including empty internal nodes without an element. | |
| template<typename Callback, typename Predicate> | |
| auto | traverseElements (Callback &&callback, Predicate &&predicate) const |
| Execute a callback function for each element in the tree. | |
| template<typename Callback> | |
| auto | traverseElements (Callback &&callback) const |
| Execute a callback function for each element in the tree. | |
| template<typename Callback> | |
| auto | test (Point< N, Scalar > point, Callback &&callback) const |
| Execute a callback function for each element in the tree that might contain a given point. | |
| bool | test (Point< N, Scalar > point) const noexcept |
| Check if it is possible that some element in the tree contains a given point. | |
| template<typename Callback> | |
| auto | test (const Box< N, Scalar > &box, Callback &&callback) const |
| Execute a callback function for each element in the tree that might be intersecting with a given axis-aligned box. | |
| bool | test (const Box< N, Scalar > &box) const noexcept |
| Check if it is possible that some element in the tree is intersecting with a given axis-aligned box. | |
Binary tree-based space subdivision container, Z-ordered using morton codes, optimized for intersection queries between axis-aligned boxes.
| N | number of vector dimensions (must be 2 or 3). |
| T | type of element to store in the tree. |
| Scalar | scalar type of the axis-aligned boxes stored in the tree. |
| using grem::LinearBoundingVolumeHierarchy< N, Scalar, T >::value_type = Pair<Box<N, Scalar>, T> |
Value type of the container.
| using grem::LinearBoundingVolumeHierarchy< N, Scalar, T >::reference = Pair<const Box<N, Scalar>, T>& |
Reference type of the container.
| using grem::LinearBoundingVolumeHierarchy< N, Scalar, T >::const_reference = const Pair<const Box<N, Scalar>, T>& |
Const reference type of the container.
| using grem::LinearBoundingVolumeHierarchy< N, Scalar, T >::pointer = Pair<const Box<N, Scalar>, T>* |
Pointer type of the container.
| using grem::LinearBoundingVolumeHierarchy< N, Scalar, T >::const_pointer = const Pair<const Box<N, Scalar>, T>* |
Const pointer type of the container.
| using grem::LinearBoundingVolumeHierarchy< N, Scalar, T >::size_type = size_t |
Size type of the container.
| using grem::LinearBoundingVolumeHierarchy< N, Scalar, T >::difference_type = ptrdiff_t |
Difference type of the container.
| using grem::LinearBoundingVolumeHierarchy< N, Scalar, T >::iterator = pointer |
Iterator type of the container.
| using grem::LinearBoundingVolumeHierarchy< N, Scalar, T >::const_iterator = const_pointer |
Const iterator type of the container.
|
defaultnoexcept |
Construct an empty tree.
|
inlinenoexcept |
Erase all inserted elements from the tree.
|
inlinenodiscardnoexcept |
Get the begin iterator of the elements in the tree.
|
inlinenodiscardnoexcept |
Get the begin iterator of the elements in the tree.
|
inlinenodiscardnoexcept |
Get the begin iterator of the elements in the tree.
|
inlinenodiscardnoexcept |
Get the end iterator of the elements in the tree.
|
inlinenodiscardnoexcept |
Get the end iterator of the elements in the tree.
|
inlinenodiscardnoexcept |
Get the end iterator of the elements in the tree.
|
inlinenodiscardnoexcept |
Get the number of elements in the tree.
|
inlinenodiscardnoexcept |
Check whether the tree is empty or not.
|
inline |
Construct a new element in the tree.
| elementBoundingBox | axis-aligned bounding box of the element. |
| args | constructor arguments for the new element. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the element constructor. |
|
inline |
Copy an element into the tree.
| elementBoundingBox | axis-aligned bounding box of the element. |
| value | value to be copied into the tree. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the element copy constructor. |
|
inline |
Move an element into the tree.
| elementBoundingBox | axis-aligned bounding box of the element. |
| value | value to be moved into the tree. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the element move constructor. |
|
inline |
Remove an element from the tree.
| pos | iterator to the element to remove. Must be valid. |
|
inline |
Execute a callback function for each active node of the tree, including empty internal nodes without an element.
| callback | function to execute, which should accept the following parameters (though they don't need to be used):
|
| predicate | condition that must be met in order to traverse deeper into the tree. Must return bool and accept the following parameter:
|
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the callback or predicate functions. |
|
inline |
Execute a callback function for each active node of the tree, including empty internal nodes without an element.
| callback | function to execute, which should accept the following parameters (though they don't need to be used):
|
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the callback function. |
|
inline |
Execute a callback function for each element in the tree.
| callback | function to execute, which should accept the following parameter:
|
| predicate | condition that must be met in order to traverse deeper into the tree. Must return bool and accept the following parameter:
|
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the callback or predicate functions. |
|
inline |
Execute a callback function for each element in the tree.
| callback | function to execute, which should accept the following parameter:
|
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the callback function. |
|
inline |
Execute a callback function for each element in the tree that might contain a given point.
| point | point to test. |
| callback | function to execute, which should accept the following parameter:
|
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the callback function. |
|
inlinenodiscardnoexcept |
Check if it is possible that some element in the tree contains a given point.
| point | point to test. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Execute a callback function for each element in the tree that might be intersecting with a given axis-aligned box.
| box | box to test. |
| callback | function to execute, which should accept the following parameter:
|
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the callback function. |
|
inlinenodiscardnoexcept |
Check if it is possible that some element in the tree is intersecting with a given axis-aligned box.
| box | box to test. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |