Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
bvh::v2::MiniTreeBuilder< Node, MortonCode > Class Template Reference

template<typename Node, typename MortonCode = uint32_t>
class bvh::v2::MiniTreeBuilder< Node, MortonCode >

Multi-threaded top-down builder that partitions primitives using a grid.

Multiple instances of a single-threaded builder are run in parallel on that partition, generating many small trees. Finally, a top-level tree is built on these smaller trees to form the final BVH. This builder is inspired by "Rapid Bounding Volume Hierarchy Generation using Mini Trees", by P. Ganestam et al.

Definition at line 24 of file mini_tree_builder.h.

Classes

struct  Bin
 
struct  BuildTask
 
struct  Config
 
struct  LocalBins
 

Static Public Member Functions

static BVH_ALWAYS_INLINE Bvh< Nodebuild (ThreadPool &thread_pool, std::span< const BBox > bboxes, std::span< const Vec > centers, const Config &config={})
 Starts building a BVH with the given primitive data.
 

Private Types

using BBox = bvh::v2::BBox< Scalar, Node::dimension >
 
using Scalar = typename Node::Scalar
 
using Vec = bvh::v2::Vec< Scalar, Node::dimension >
 

Private Member Functions

BVH_ALWAYS_INLINE MiniTreeBuilder (ThreadPool &thread_pool, std::span< const BBox > bboxes, std::span< const Vec > centers, const Config &config)
 
std::vector< Bvh< Node > > build_mini_trees ()
 
Bvh< Nodebuild_top_bvh (std::vector< Bvh< Node > > &mini_trees)
 
std::vector< Bvh< Node > > prune_mini_trees (std::vector< Bvh< Node > > &&mini_trees)
 

Private Attributes

std::span< const BBoxbboxes_
 
std::span< const Veccenters_
 
const Configconfig_
 
ParallelExecutor executor_
 

Friends

struct BuildTask
 

#include <bvh/v2/mini_tree_builder.h>

Member Typedef Documentation

◆ BBox

template<typename Node , typename MortonCode = uint32_t>
using bvh::v2::MiniTreeBuilder< Node, MortonCode >::BBox = bvh::v2::BBox<Scalar, Node::dimension>
private

Definition at line 27 of file mini_tree_builder.h.

◆ Scalar

template<typename Node , typename MortonCode = uint32_t>
using bvh::v2::MiniTreeBuilder< Node, MortonCode >::Scalar = typename Node::Scalar
private

Definition at line 25 of file mini_tree_builder.h.

◆ Vec

template<typename Node , typename MortonCode = uint32_t>
using bvh::v2::MiniTreeBuilder< Node, MortonCode >::Vec = bvh::v2::Vec<Scalar, Node::dimension>
private

Definition at line 26 of file mini_tree_builder.h.

Constructor & Destructor Documentation

◆ MiniTreeBuilder()

template<typename Node , typename MortonCode = uint32_t>
BVH_ALWAYS_INLINE bvh::v2::MiniTreeBuilder< Node, MortonCode >::MiniTreeBuilder ( ThreadPool thread_pool,
std::span< const BBox bboxes,
std::span< const Vec centers,
const Config config 
)
inlineprivate

Definition at line 147 of file mini_tree_builder.h.

Member Function Documentation

◆ build()

template<typename Node , typename MortonCode = uint32_t>
static BVH_ALWAYS_INLINE Bvh< Node > bvh::v2::MiniTreeBuilder< Node, MortonCode >::build ( ThreadPool thread_pool,
std::span< const BBox bboxes,
std::span< const Vec centers,
const Config config = {} 
)
inlinestatic

Starts building a BVH with the given primitive data.

The build algorithm is multi-threaded, and runs on the given thread pool.

Definition at line 47 of file mini_tree_builder.h.

◆ build_mini_trees()

template<typename Node , typename MortonCode = uint32_t>
std::vector< Bvh< Node > > bvh::v2::MiniTreeBuilder< Node, MortonCode >::build_mini_trees ( )
inlineprivate

Definition at line 160 of file mini_tree_builder.h.

◆ build_top_bvh()

template<typename Node , typename MortonCode = uint32_t>
Bvh< Node > bvh::v2::MiniTreeBuilder< Node, MortonCode >::build_top_bvh ( std::vector< Bvh< Node > > &  mini_trees)
inlineprivate

Definition at line 249 of file mini_tree_builder.h.

◆ prune_mini_trees()

template<typename Node , typename MortonCode = uint32_t>
std::vector< Bvh< Node > > bvh::v2::MiniTreeBuilder< Node, MortonCode >::prune_mini_trees ( std::vector< Bvh< Node > > &&  mini_trees)
inlineprivate

Definition at line 207 of file mini_tree_builder.h.

Friends And Related Symbol Documentation

◆ BuildTask

template<typename Node , typename MortonCode = uint32_t>
friend struct BuildTask
friend

Definition at line 61 of file mini_tree_builder.h.

Member Data Documentation

◆ bboxes_

template<typename Node , typename MortonCode = uint32_t>
std::span<const BBox> bvh::v2::MiniTreeBuilder< Node, MortonCode >::bboxes_
private

Definition at line 143 of file mini_tree_builder.h.

◆ centers_

template<typename Node , typename MortonCode = uint32_t>
std::span<const Vec> bvh::v2::MiniTreeBuilder< Node, MortonCode >::centers_
private

Definition at line 144 of file mini_tree_builder.h.

◆ config_

template<typename Node , typename MortonCode = uint32_t>
const Config& bvh::v2::MiniTreeBuilder< Node, MortonCode >::config_
private

Definition at line 145 of file mini_tree_builder.h.

◆ executor_

template<typename Node , typename MortonCode = uint32_t>
ParallelExecutor bvh::v2::MiniTreeBuilder< Node, MortonCode >::executor_
private

Definition at line 142 of file mini_tree_builder.h.

  • geom/geom/inc/bvh/v2/mini_tree_builder.h