EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Functions | Variables
EBGeometry_BVHUnion.hpp File Reference

BVH-accelerated unions of many primitives of one or more types: BVHUnion and BVHSmoothUnion. More...

#include <cstddef>
#include <cstdint>
#include <optional>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>
#include "EBGeometry_BVH.hpp"
#include "EBGeometry_Blend.hpp"
#include "EBGeometry_DistanceQuality.hpp"
#include "EBGeometry_GPU.hpp"
#include "EBGeometry_Macros.hpp"
#include "EBGeometry_Math.hpp"
#include "EBGeometry_PODVector.hpp"
#include "EBGeometry_Pool.hpp"
#include "EBGeometry_SurfaceRef.hpp"
#include "EBGeometry_Vec.hpp"
#include "EBGeometry_BVHUnionImplem.hpp"
#include "EBGeometry_Fused.hpp"
Include dependency graph for EBGeometry_BVHUnion.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  EBGeometry::BVH::BuildSettings
 How a BVH union is built: the construction method and, optionally, its leaf sizes. More...
 
struct  EBGeometry::CSGDetail::StoredAs< P, bool >
 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  EBGeometry::CSGDetail::StoredAs< P, true >
 How a BVH union stores a pool-resident handle: as its layout. More...
 
struct  EBGeometry::CSGDetail::UnionParts< T, P, K >
 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...
 
struct  EBGeometry::CSGDetail::MemberRef
 A leaf of a union of several primitive types: the primitive's type, and its index in that type's array. More...
 
struct  EBGeometry::CSGDetail::UnionArrays< Ps >
 The arrays of a union of several primitive types, one per type in the order given: a recursive list, so that it stays trivially copyable and device-visible. More...
 
struct  EBGeometry::CSGDetail::UnionArrays< P, Ps... >
 The arrays of a union of several primitive types: the first type's, and the rest. More...
 
struct  EBGeometry::CSGDetail::ArraysOf< Ps >
 What a union of several types adds to the one-type layout: its per-type arrays. Empty for one type, whose leaves hold the primitives themselves, so that a union of one type holds nothing but its two BVHs. More...
 
struct  EBGeometry::CSGDetail::ArraysOf< P >
 A union of one type has no per-type arrays. More...
 
struct  EBGeometry::CSGDetail::LeafOf< Ps >
 What a union's BVH leaves hold: the primitive itself for one type, a MemberRef for several. More...
 
struct  EBGeometry::CSGDetail::LeafOf< P >
 What a union of one type's BVH leaves hold: the primitive, as stored. More...
 
struct  EBGeometry::CSGDetail::BoxPrecision< BoundingVolumes::AABBT< T > >
 The precision of an AABBT<T>. More...
 
class  EBGeometry::BVHUnion< T, K, Ps >
 BVH-accelerated union of many primitives of one or more types. More...
 
struct  EBGeometry::BVHUnion< T, K, Ps >::Layout
 The union's arrays as offsets into its pool, with no location: what an outer union stores when this union is its primitive (see PoolHandle). With several types it also holds the per-type arrays (its base). More...
 
class  EBGeometry::BVHSmoothUnion< T, K, Blend, Ps >
 BVH-accelerated smooth union of many primitives of one or more types. More...
 
struct  EBGeometry::BVHSmoothUnion< T, K, Blend, Ps >::Layout
 The smooth union's arrays and parameters, with no location: what an outer union stores when this one is its primitive (see PoolHandle). With several types it also holds the per-type arrays (its base). More...
 

Namespaces

namespace  EBGeometry
 Namespace containing all of EBGeometry's functionality.
 
namespace  EBGeometry::BVH
 Namespace for various bounding volume hierarchy (BVH) functionalities.
 
namespace  EBGeometry::CSGDetail
 Internal helpers shared by BVHUnion and BVHSmoothUnion.
 

Typedefs

template<class P >
using EBGeometry::CSGDetail::Stored = typename StoredAs< P >::type
 Shorthand for the type a BVH union stores for a primitive of type P.
 
template<class... Ps>
using EBGeometry::CSGDetail::Leaf = typename LeafOf< Ps... >::type
 Shorthand for what a union's BVH leaves hold.
 
template<class P >
using EBGeometry::CSGDetail::PrimitivePrecision = typename BoxPrecision< std::decay_t< decltype(std::declval< const P & >().computeBoundingVolume())> >::type
 The precision of primitive type P, for the unions' deduction guides.
 

Functions

template<class P >
Stored< P > EBGeometry::CSGDetail::toStored (const P &a_primitive) noexcept
 Convert a primitive to the form a BVH union stores.
 
template<class P >
P EBGeometry::CSGDetail::fromStored (const Stored< P > &a_stored, const PoolLocation &a_location) noexcept
 The primitive a stored entry stands for, resolving against a_location.
 
template<class F , class P , class... Ps>
auto EBGeometry::CSGDetail::visitArrays (const UnionArrays< P, Ps... > &a_arrays, const uint32_t a_type, const uint32_t a_index, const PoolLocation &a_location, F &&a_f) noexcept
 Call a_f with the primitive a MemberRef stands for, testing its type against the arrays' types in order (the last is taken without a test).
 
template<class P , class... Ps, std::enable_if_t<!(CSGDetail::isBox< Ps >||...), int > = 0>
 EBGeometry::BVHUnion (Pool &a_pool, const std::vector< P > &a_first, const std::vector< Ps > &... a_primitives) -> BVHUnion< CSGDetail::PrimitivePrecision< P >, BVH::DefaultBranchingRatio< CSGDetail::PrimitivePrecision< P > >(), P, Ps... >
 A union of the given arrays' types, of the first type's precision and the default branching factor.
 
template<class P , class... Ps>
 EBGeometry::BVHUnion (Pool &a_pool, const BVH::BuildSettings &a_settings, const std::vector< P > &a_first, const std::vector< Ps > &... a_primitives) -> BVHUnion< CSGDetail::PrimitivePrecision< P >, BVH::DefaultBranchingRatio< CSGDetail::PrimitivePrecision< P > >(), P, Ps... >
 A union of the given arrays' types, built with settings.
 
template<class P , class B , std::enable_if_t< CSGDetail::isBox< B >, int > = 0>
 EBGeometry::BVHUnion (Pool &a_pool, const std::vector< P > &a_first, const std::vector< B > &a_boxes) -> BVHUnion< CSGDetail::PrimitivePrecision< P >, BVH::DefaultBranchingRatio< CSGDetail::PrimitivePrecision< P > >(), P >
 A union of one type with the caller's boxes.
 
template<class P , class B , class... Rest, std::enable_if_t< CSGDetail::isBox< B >, int > = 0>
 EBGeometry::BVHUnion (Pool &a_pool, const std::vector< P > &a_first, const std::vector< B > &a_boxes, BVH::Construction a_construction, const Rest &... a_rest) -> BVHUnion< CSGDetail::PrimitivePrecision< P >, BVH::DefaultBranchingRatio< CSGDetail::PrimitivePrecision< P > >(), P >
 A union of one type with the caller's boxes and a construction method.
 
template<class P , class... Ps, std::enable_if_t<!(CSGDetail::isBox< Ps >||...), int > = 0>
 EBGeometry::BVHSmoothUnion (Pool &a_pool, CSGDetail::PrimitivePrecision< P > a_smoothLen, const std::vector< P > &a_first, const std::vector< Ps > &... a_primitives) -> BVHSmoothUnion< CSGDetail::PrimitivePrecision< P >, BVH::DefaultBranchingRatio< CSGDetail::PrimitivePrecision< P > >(), SmoothMinOp< CSGDetail::PrimitivePrecision< P > >, P, Ps... >
 A smooth union of the given arrays' types with the default blend.
 
template<class B , class P , class... Ps, std::enable_if_t<!CSGDetail::isVector< B >, int > = 0>
 EBGeometry::BVHSmoothUnion (Pool &a_pool, CSGDetail::PrimitivePrecision< P > a_smoothLen, B a_blend, const std::vector< P > &a_first, const std::vector< Ps > &... a_primitives) -> BVHSmoothUnion< CSGDetail::PrimitivePrecision< P >, BVH::DefaultBranchingRatio< CSGDetail::PrimitivePrecision< P > >(), B, P, Ps... >
 A smooth union of the given arrays' types with a blend.
 
template<class B , class P , class... Ps, std::enable_if_t<!CSGDetail::isVector< B >, int > = 0>
 EBGeometry::BVHSmoothUnion (Pool &a_pool, const BVH::BuildSettings &a_settings, CSGDetail::PrimitivePrecision< P > a_smoothLen, B a_blend, const std::vector< P > &a_first, const std::vector< Ps > &... a_primitives) -> BVHSmoothUnion< CSGDetail::PrimitivePrecision< P >, BVH::DefaultBranchingRatio< CSGDetail::PrimitivePrecision< P > >(), B, P, Ps... >
 A smooth union of the given arrays' types with settings and a blend.
 
template<class P , class V , std::enable_if_t< CSGDetail::isBox< V >, int > = 0>
 EBGeometry::BVHSmoothUnion (Pool &a_pool, const std::vector< P > &a_first, const std::vector< V > &a_boxes, CSGDetail::PrimitivePrecision< P > a_smoothLen) -> BVHSmoothUnion< CSGDetail::PrimitivePrecision< P >, BVH::DefaultBranchingRatio< CSGDetail::PrimitivePrecision< P > >(), SmoothMinOp< CSGDetail::PrimitivePrecision< P > >, P >
 A smooth union of one type with the caller's boxes and the default blend.
 
template<class P , class V , class B , class... Rest, std::enable_if_t< CSGDetail::isBox< V >, int > = 0>
 EBGeometry::BVHSmoothUnion (Pool &a_pool, const std::vector< P > &a_first, const std::vector< V > &a_boxes, CSGDetail::PrimitivePrecision< P > a_smoothLen, B a_blend, const Rest &... a_rest) -> BVHSmoothUnion< CSGDetail::PrimitivePrecision< P >, BVH::DefaultBranchingRatio< CSGDetail::PrimitivePrecision< P > >(), B, P >
 A smooth union of one type with the caller's boxes and a blend.
 

Variables

template<class T , class... Ps>
constexpr bool EBGeometry::CSGDetail::hasContainers = (hasSurfaces<Ps, T> || ...)
 Whether a union holds members that are containers themselves (see hasSurfaces), whose surfaces it numbers through a table of first surfaces.
 
template<class P , class T , class = void>
constexpr bool EBGeometry::CSGDetail::hasPrecision = true
 Whether a primitive type is of precision T: true if its computeBoundingVolume() returns an AABBT<T>, and for a type without one (a one-type union given the caller's boxes), which says nothing.
 
template<class X >
constexpr bool EBGeometry::CSGDetail::isBox = false
 Whether X is a box, which an array of primitives never holds: keeps the deduction guide for several types from taking a one-type union's box array for a second type.
 
template<class X >
constexpr bool EBGeometry::CSGDetail::isVector = false
 Whether X is a std::vector: keeps the smooth unions' deduction guides that take a blend from taking the first array for one.
 
template<class... Ps>
constexpr DistanceQuality EBGeometry::CSGDetail::unionQuality
 The weakest distance quality among primitive types: not a distance if any is not, else a bound.
 

Detailed Description

BVH-accelerated unions of many primitives of one or more types: BVHUnion and BVHSmoothUnion.

Device-callable value types. They need the BVH builders and the blend operators, but not the expression builder, the Tape or the fused operations that EBGeometry_CSG.hpp also includes.

Author
Robert Marskar