EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
EBGeometry::CSGDetail Namespace Reference

Internal helpers shared by BVHUnion and BVHSmoothUnion. More...

Classes

struct  StoredAs
 How a BVH union stores a primitive of type P: as is, or, for a pool-resident handle, as the handle's layout. More...
 
struct  StoredAs< P, true >
 How a BVH union stores a pool-resident handle: as its layout. More...
 
struct  UnionParts
 What a BVH union is built into: a BVH over the primitives whose bounding box is bounded, and a single leaf (or nothing) holding those whose box is unbounded in some direction. More...
 

Typedefs

template<class P >
using Stored = typename StoredAs< P >::type
 Shorthand for the type a BVH union stores for a primitive of type P.
 

Functions

template<class P >
Stored< P > toStored (const P &a_primitive) noexcept
 Convert a primitive to the form a BVH union stores.
 
template<class P >
P fromStored (const Stored< P > &a_stored, const PoolLocation &a_location) noexcept
 The primitive a stored entry stands for, resolving against a_location.
 

Detailed Description

Internal helpers shared by BVHUnion and BVHSmoothUnion.

Typedef Documentation

◆ Stored

template<class P >
using EBGeometry::CSGDetail::Stored = typedef typename StoredAs<P>::type

Shorthand for the type a BVH union stores for a primitive of type P.

Template Parameters
PPrimitive type.

Function Documentation

◆ fromStored()

template<class P >
P EBGeometry::CSGDetail::fromStored ( const Stored< P > &  a_stored,
const PoolLocation &  a_location 
)
inlinenoexcept

The primitive a stored entry stands for, resolving against a_location.

A pool-resident primitive is rebuilt from its layout and the union's own location, so it resolves against the same pool the union does: the host pool, a host mirror or a device mirror. Any other primitive is returned as stored.

Template Parameters
PPrimitive type.
Parameters
[in]a_storedPrimitive as stored in the union's BVH.
[in]a_locationThe union's pool location.
Returns
The primitive.

◆ toStored()

template<class P >
Stored< P > EBGeometry::CSGDetail::toStored ( const P &  a_primitive)
inlinenoexcept

Convert a primitive to the form a BVH union stores.

Template Parameters
PPrimitive type.
Parameters
[in]a_primitivePrimitive.
Returns
The primitive, or its layout if it is a pool-resident handle.