EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
EBGeometry::BVHUnionIF< T, P, BV, K > Class Template Reference

BVH-accelerated union of implicit functions. More...

#include <EBGeometry_CSG.hpp>

Inheritance diagram for EBGeometry::BVHUnionIF< T, P, BV, K >:
Inheritance graph
[legend]
Collaboration diagram for EBGeometry::BVHUnionIF< T, P, BV, K >:
Collaboration graph
[legend]

Public Types

using Root = EBGeometry::BVH::PackedBVH< T, P, K >
 Alias for the flat BVH type.
 
using Node = typename Root::Node
 Alias for a BVH node.
 

Public Member Functions

 BVHUnionIF ()=delete
 Disallowed, use the full constructor.
 
 BVHUnionIF (const std::vector< std::pair< std::shared_ptr< const P >, BV > > &a_primsAndBVs)
 Constructs the BVH-accelerated union from pre-paired primitives and bounding volumes.
 
 BVHUnionIF (const std::vector< std::shared_ptr< P > > &a_primitives, const std::vector< BV > &a_boundingVolumes)
 Constructs the BVH-accelerated union from separate primitive and bounding-volume lists.
 
 ~BVHUnionIF () override=default
 Destructor.
 
value (const Vec3T< T > &a_point) const noexcept override
 Evaluates the signed distance at a_point using BVH traversal.
 
const EBGeometry::BoundingVolumes::AABBT< T > & getBoundingVolume () const noexcept
 Returns the axis-aligned bounding box enclosing all primitives.
 
- Public Member Functions inherited from EBGeometry::ImplicitFunction< T >
 ImplicitFunction ()=default
 Default constructor.
 
virtual ~ImplicitFunction ()=default
 Default destructor.
 
operator() (const Vec3T< T > &a_point) const noexcept
 Call operator — alternative signature for the value function.
 
template<class BV >
BV approximateBoundingVolumeOctree (const Vec3T< T > &a_initialLowCorner, const Vec3T< T > &a_initialHighCorner, const unsigned int a_maxTreeDepth, const T &a_safety=0.0) const
 Compute an approximation to the bounding volume for the implicit surface using octree subdivision.
 

Protected Member Functions

void buildTree (const std::vector< std::pair< std::shared_ptr< const P >, BV > > &a_primsAndBVs, const BVH::Build a_build=BVH::Build::SAH) noexcept
 Builds the internal BVH from primitive/BV pairs.
 

Protected Attributes

std::shared_ptr< EBGeometry::BVH::PackedBVH< T, P, K > > m_bvh
 Flat BVH over all input primitives.
 

Detailed Description

template<class T, class P, class BV, size_t K>
class EBGeometry::BVHUnionIF< T, P, BV, K >

BVH-accelerated union of implicit functions.

Wraps a PackedBVH over the input primitives. At query time the BVH culls primitives whose bounding volume lies further than the current best distance, giving sub-linear cost on large scenes. Interior semantics are identical to UnionIF.

Template Parameters
TFloating-point precision.
PPrimitive type; must derive from ImplicitFunction<T>.
BVBounding volume type (e.g. AABBT<T>).
KBVH branching factor.

Constructor & Destructor Documentation

◆ BVHUnionIF() [1/2]

template<class T , class P , class BV , size_t K>
EBGeometry::BVHUnionIF< T, P, BV, K >::BVHUnionIF ( const std::vector< std::pair< std::shared_ptr< const P >, BV > > &  a_primsAndBVs)

Constructs the BVH-accelerated union from pre-paired primitives and bounding volumes.

Parameters
[in]a_primsAndBVsPrimitives and their bounding volumes (must be non-empty; no null primitives).

◆ BVHUnionIF() [2/2]

template<class T , class P , class BV , size_t K>
EBGeometry::BVHUnionIF< T, P, BV, K >::BVHUnionIF ( const std::vector< std::shared_ptr< P > > &  a_primitives,
const std::vector< BV > &  a_boundingVolumes 
)

Constructs the BVH-accelerated union from separate primitive and bounding-volume lists.

Parameters
[in]a_primitivesInput primitives (must be non-empty; same length as a_boundingVolumes; no nulls).
[in]a_boundingVolumesBounding volumes for each primitive.

Member Function Documentation

◆ buildTree()

template<class T , class P , class BV , size_t K>
void EBGeometry::BVHUnionIF< T, P, BV, K >::buildTree ( const std::vector< std::pair< std::shared_ptr< const P >, BV > > &  a_primsAndBVs,
const BVH::Build  a_build = BVH::Build::SAH 
)
inlineprotectednoexcept

Builds the internal BVH from primitive/BV pairs.

Parameters
[in]a_primsAndBVsPrimitives and their bounding volumes.
[in]a_buildBVH construction strategy.

◆ getBoundingVolume()

template<class T , class P , class BV , size_t K>
const EBGeometry::BoundingVolumes::AABBT< T > & EBGeometry::BVHUnionIF< T, P, BV, K >::getBoundingVolume ( ) const
noexcept

Returns the axis-aligned bounding box enclosing all primitives.

Returns
Const reference to the root bounding volume of the BVH.

◆ value()

template<class T , class P , class BV , size_t K>
T EBGeometry::BVHUnionIF< T, P, BV, K >::value ( const Vec3T< T > &  a_point) const
overridevirtualnoexcept

Evaluates the signed distance at a_point using BVH traversal.

Returns the minimum value over all primitives not pruned by the BVH. Negative when inside the union.

Parameters
[in]a_point3D query point.
Returns
Minimum signed distance among all non-culled primitives.

Implements EBGeometry::ImplicitFunction< T >.


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