EBGeometry
1.0
|
Namespace for various bounding volume hierarchy (BVH) functionality. More...
Classes | |
class | NodeT |
Forward declare the BVH node since it is needed for the polymorphic lambdas. More... | |
class | LinearNodeT |
Forward declare linear node class. More... | |
class | LinearBVH |
Forward declare linear BVH class. More... | |
Typedefs | |
template<class P > | |
using | PrimitiveListT = std::vector< std::shared_ptr< const P > > |
List of primitives. More... | |
template<class P , class BV > | |
using | PrimAndBV = std::pair< std::shared_ptr< const P >, BV > |
Alias for a list geometric primitive and BV. | |
template<class P , class BV > | |
using | PrimAndBVListT = std::vector< PrimAndBV< P, BV > > |
List of primitives and their bounding volumes. More... | |
template<class P , class BV , size_t K> | |
using | PartitionerT = std::function< std::array< PrimAndBVListT< P, BV >, K >(const PrimAndBVListT< P, BV > &a_primsAndBVs)> |
Polymorphic partitioner for splitting a list of primitives and BVs into K new subsets. More... | |
template<class T , class P , class BV , size_t K> | |
using | StopFunctionT = std::function< bool(const NodeT< T, P, BV, K > &a_node)> |
Stop function for deciding when a BVH node can't be divided into sub-volumes. More... | |
template<class P > | |
using | Updater = std::function< void(const PrimitiveListT< P > &a_primitives)> |
Updater for tree traversal. More... | |
template<class NodeType , class Meta > | |
using | Visiter = std::function< bool(const NodeType &a_node, const Meta &a_meta)> |
Visiter pattern for LinearBVH::traverse. Must return true if we should visit the node and false otherwise. More... | |
template<class NodeType , class Meta , size_t K> | |
using | Sorter = std::function< void(std::array< std::pair< std::shared_ptr< const NodeType >, Meta >, K > &a_children)> |
Sorting criterion for which child node to visit first. This takes an input list of child nodes and sorts it. When further into the sub-tree, the first node is investigated first, then the second, etc. The Meta template parameter is a door left open to the user for attaching additional data to the sorter/visiter pattern. | |
template<class NodeType , class Meta > | |
using | MetaUpdater = std::function< Meta(const NodeType &a_node)> |
Updater for when user wants to add some meta-data to his BVH traversal. | |
Enumerations | |
enum class | Build { TopDown , Morton , Nested } |
Enum for specifying whether or not the construction is top-down or bottom-up. | |
Variables | |
template<class X , size_t K> | |
auto | equalCounts |
Function for splitting a vector of some size into K almost-equal chunks. This is a utility function. More... | |
template<class T , class P , class BV , size_t K> | |
auto | PrimitiveCentroidPartitioner |
Simple partitioner which sorts the primitives based on their centroids, and then splits into K pieces. More... | |
template<class T , class P , class BV , size_t K> | |
auto | BVCentroidPartitioner |
Simple partitioner which sorts the BVs based on their bounding volume centroids, and then splits into K pieces. More... | |
template<class T , class P , class BV , size_t K> | |
auto | DefaultStopFunction |
Simple stop function which ends the recursion when there aren't enough primitives in the node. More... | |
Namespace for various bounding volume hierarchy (BVH) functionality.
using BVH::PartitionerT = typedef std::function<std::array<PrimAndBVListT<P, BV>, K>(const PrimAndBVListT<P, BV>& a_primsAndBVs)> |
Polymorphic partitioner for splitting a list of primitives and BVs into K new subsets.
P is the primitive type bound in the BVH and K is the BVH degrees. BV is the bounding volume type.
[in] | a_primsAndBVs | Vector of primitives and their bounding volumes. |
using BVH::PrimAndBVListT = typedef std::vector<PrimAndBV<P, BV> > |
List of primitives and their bounding volumes.
P is the primitive type and BV is the bounding volume enclosing the implicit surface of each P.
using BVH::PrimitiveListT = typedef std::vector<std::shared_ptr<const P> > |
List of primitives.
P is the primitive bounded by the BVH.
using BVH::StopFunctionT = typedef std::function<bool(const NodeT<T, P, BV, K>& a_node)> |
Stop function for deciding when a BVH node can't be divided into sub-volumes.
T is the precision used in the BVH computations, P is the enclosing primitive and BV is the bounding volume used in the BVH. K is the tree degree.
[in] | a_node | BVH node |
using BVH::Updater = typedef std::function<void(const PrimitiveListT<P>& a_primitives)> |
Updater for tree traversal.
[in] | a_primitives. |
using BVH::Visiter = typedef std::function<bool(const NodeType& a_node, const Meta& a_meta)> |
Visiter pattern for LinearBVH::traverse. Must return true if we should visit the node and false otherwise.
The Meta template parameter is a door left open to the user for attaching additional data to the sorter/visiter pattern.
[in] | a_node | Node to visit or not |
[in] | a_meta | Meta-data for node visit. |
auto BVH::BVCentroidPartitioner |
Simple partitioner which sorts the BVs based on their bounding volume centroids, and then splits into K pieces.
[in] | a_primsAndBVs | Input primitives and their bounding volumes |
auto BVH::DefaultStopFunction |
Simple stop function which ends the recursion when there aren't enough primitives in the node.
[in] | a_node | Input BVH node |
auto BVH::equalCounts |
Function for splitting a vector of some size into K almost-equal chunks. This is a utility function.
auto BVH::PrimitiveCentroidPartitioner |
Simple partitioner which sorts the primitives based on their centroids, and then splits into K pieces.
[in] | a_primsAndBVs | Input primitives and their bounding volumes |