EBGeometry  1.0
Public Types | Public Member Functions | Protected Attributes | List of all members
BVH::LinearBVH< T, P, BV, K > Class Template Reference

Forward declare linear BVH class. More...

#include <EBGeometry_BVH.hpp>

Public Types

using Vec3 = Vec3T< T >
 Alias for vector type.
 
using LinearNode = LinearNodeT< T, P, BV, K >
 Alias for linear node type.
 
using PrimitiveList = std::vector< std::shared_ptr< const P > >
 Alias for list of primitives.
 

Public Member Functions

 LinearBVH ()=default
 Disallowed. Use the full constructor please.
 
 LinearBVH (const LinearBVH &)=default
 Copy constructor.
 
 LinearBVH (const std::vector< std::shared_ptr< const LinearNodeT< T, P, BV, K >>> &a_linearNodes, const std::vector< std::shared_ptr< const P >> &a_primitives)
 Full constructor. Associates the nodes and primitives. More...
 
 LinearBVH (const std::vector< std::shared_ptr< LinearNodeT< T, P, BV, K >>> &a_linearNodes, const std::vector< std::shared_ptr< const P >> &a_primitives)
 Full constructor. Associates the nodes and primitives. More...
 
virtual ~LinearBVH ()
 Destructor. Does nothing.
 
const BV & getBoundingVolume () const noexcept
 Get the bounding volume for this BVH.
 
template<class Meta >
void traverse (const BVH::Updater< P > &a_updater, const BVH::Visiter< LinearNode, Meta > &a_visiter, const BVH::Sorter< LinearNode, Meta, K > &a_sorter, const BVH::MetaUpdater< LinearNode, Meta > &a_metaUpdater) const noexcept
 Recursion-less BVH traversal algorithm. The user inputs the update rule, a pruning criterion, and a criterion of who to visit first. More...
 

Protected Attributes

std::vector< std::shared_ptr< const LinearNodeT< T, P, BV, K > > > m_linearNodes
 List of linearly stored nodes.
 
std::vector< std::shared_ptr< const P > > m_primitives
 Global list of primitives. Note that this is ALL primitives, sorted so that LinearNodeT can interface into it.
 

Detailed Description

template<class T, class P, class BV, size_t K>
class BVH::LinearBVH< T, P, BV, K >

Forward declare linear BVH class.

Linear root node for BVH hierarchy.

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.

Constructor & Destructor Documentation

◆ LinearBVH() [1/2]

template<class T , class P , class BV , size_t K>
BVH::LinearBVH< T, P, BV, K >::LinearBVH ( const std::vector< std::shared_ptr< const LinearNodeT< T, P, BV, K >>> &  a_linearNodes,
const std::vector< std::shared_ptr< const P >> &  a_primitives 
)
inline

Full constructor. Associates the nodes and primitives.

Parameters
[in]a_linearNodesLinearized BVH nodes.
[in]a_primitivesPrimitives.

◆ LinearBVH() [2/2]

template<class T , class P , class BV , size_t K>
BVH::LinearBVH< T, P, BV, K >::LinearBVH ( const std::vector< std::shared_ptr< LinearNodeT< T, P, BV, K >>> &  a_linearNodes,
const std::vector< std::shared_ptr< const P >> &  a_primitives 
)
inline

Full constructor. Associates the nodes and primitives.

Parameters
[in]a_linearNodesLinearized BVH nodes.
[in]a_primitivesPrimitives.

Member Function Documentation

◆ traverse()

template<class T , class P , class BV , size_t K>
template<class Meta >
void BVH::LinearBVH< T, P, BV, K >::traverse ( const BVH::Updater< P > &  a_updater,
const BVH::Visiter< LinearNode, Meta > &  a_visiter,
const BVH::Sorter< LinearNode, Meta, K > &  a_sorter,
const BVH::MetaUpdater< LinearNode, Meta > &  a_metaUpdater 
) const
inlinenoexcept

Recursion-less BVH traversal algorithm. The user inputs the update rule, a pruning criterion, and a criterion of who to visit first.

Parameters
[in]a_updaterUpdate rule (for updating whatever the user is interested in updated)
[in]a_visiterVisiter rule. Must return true if we should visit the node.
[in]a_sorterChildren sort function for deciding which subtrees and investigated first.
[in]a_metaUpdaterUpdater for meta-information.

The documentation for this class was generated from the following file: