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

The flattened, device-callable bounding volume hierarchy: PackedBVH, its node layout, traversals and the types shared with the builders. More...

#include <cmath>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <memory>
#include <type_traits>
#include <utility>
#include <vector>
#include "EBGeometry_Array.hpp"
#include "EBGeometry_BVHQuery.hpp"
#include "EBGeometry_BoundingVolumes.hpp"
#include "EBGeometry_Macros.hpp"
#include "EBGeometry_Math.hpp"
#include "EBGeometry_PODVector.hpp"
#include "EBGeometry_Pool.hpp"
#include "EBGeometry_Vec.hpp"
#include "EBGeometry_PackedBVHImplem.hpp"
Include dependency graph for EBGeometry_PackedBVH.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  EBGeometry::BVH::ClusterSpec
 Configuration for the ClusterSAH direct PackedBVH construction path. More...
 
struct  EBGeometry::BVH::ConstructionOptions
 Leaf-size settings for the preset construction methods, one per family of methods. More...
 
class  EBGeometry::BVH::PackedBVH< T, P, K >
 Forward declaration of the linearised BVH, defined below. More...
 
struct  EBGeometry::BVH::PackedBVH< T, P, K >::Node
 Compact BVH node stored in the flat node array. More...
 
struct  EBGeometry::BVH::PackedBVH< T, P, K >::Layout
 The BVH's arrays as offsets into its pool, and its root box: a PackedBVH minus its location. More...
 

Namespaces

namespace  EBGeometry
 Namespace containing all of EBGeometry's functionality.
 
namespace  EBGeometry::SFC
 Namespace for space-filling curves (SFCs) used to linearly order 3D grid cells.
 
namespace  EBGeometry::BVH
 Namespace for various bounding volume hierarchy (BVH) functionalities.
 

Typedefs

template<class P >
using EBGeometry::BVH::PrimitiveList = std::vector< std::shared_ptr< const P > >
 Convenience alias for a list of shared primitive pointers.
 
template<class P , class BV >
using EBGeometry::BVH::PrimAndBV = std::pair< std::shared_ptr< const P >, BV >
 Convenience alias for a (primitive, bounding-volume) pair.
 
template<class P , class BV >
using EBGeometry::BVH::PrimAndBVList = std::vector< PrimAndBV< P, BV > >
 Convenience alias for a list of (primitive, bounding-volume) pairs.
 
template<class P , class BV , size_t K>
using EBGeometry::BVH::Partitioner = std::function< Array< PrimAndBVList< P, BV >, K >(PrimAndBVList< P, BV > a_primsAndBVs)>
 Polymorphic partitioner: splits a list of (primitive, BV) pairs into K sub-lists.
 
template<class T , class P , class BV , size_t K>
using EBGeometry::BVH::LeafPredicate = std::function< bool(const TreeBVH< T, P, BV, K > &a_node)>
 Predicate for deciding when a TreeBVH node should become a leaf (i.e., no further splitting).
 
template<class P >
using EBGeometry::BVH::LeafEvaluator = std::function< void(const PrimitiveList< P > &a_primitives)>
 Leaf-evaluation callback for TreeBVH::traverse.
 
template<class NodeType , class NodeKey >
using EBGeometry::BVH::PrunePredicate = std::function< bool(const NodeType &a_node, const NodeKey &a_nodeKey)>
 Node-visit predicate for TreeBVH::traverse().
 
template<class NodeType , class NodeKey , size_t K>
using EBGeometry::BVH::ChildOrderer = std::function< void(Array< std::pair< std::shared_ptr< const NodeType >, NodeKey >, K > &a_children)>
 Child-ordering callback for TreeBVH traversal.
 
template<class NodeType , class NodeKey >
using EBGeometry::BVH::NodeKeyFactory = std::function< NodeKey(const NodeType &a_node)>
 Node-key factory called once per node during TreeBVH::traverse().
 

Enumerations

enum class  EBGeometry::BVH::Construction {
  EBGeometry::BVH::CentroidSplit , EBGeometry::BVH::MidpointSplit , EBGeometry::BVH::SAH , EBGeometry::BVH::ClusterSAH ,
  EBGeometry::BVH::Morton , EBGeometry::BVH::Nested , EBGeometry::BVH::Hilbert
}
 The preset BVH construction methods that the library's own BVH users accept. More...
 

Functions

template<typename T >
constexpr size_t EBGeometry::BVH::DefaultBranchingRatio () noexcept
 The default branching factor K: 4, for both float and double, in every translation unit.
 
template<typename T >
constexpr size_t EBGeometry::BVH::HostBranchingRatio () noexcept
 The branching factor K that fills one SIMD register for type T under the compiler's SIMD flags.
 

Variables

constexpr size_t EBGeometry::BVH::HostTraversalDepth = 256
 Deepest tree, in node levels (the root alone is one level), that a host traversal handles.
 
constexpr size_t EBGeometry::BVH::DeviceTraversalDepth = 32
 Deepest tree, in node levels, that a device traversal handles.
 

Detailed Description

The flattened, device-callable bounding volume hierarchy: PackedBVH, its node layout, traversals and the types shared with the builders.

Device code needs only this header. The host-side builders are TreeBVH and its partitioners (EBGeometry_TreeBVH.hpp), and the PackedBVH constructors that pack a TreeBVH and the static builds that partition a primitive list (EBGeometry_BVHBuild.hpp). Both include this one.

Author
Robert Marskar