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

template<typename Node>
class bvh::v2::SweepSahBuilder< Node >

Single-threaded top-down builder that partitions primitives based on the Surface Area Heuristic (SAH).

Primitives are only sorted once along each axis.

Definition at line 18 of file sweep_sah_builder.h.

Classes

struct  Split
 

Static Public Member Functions

static BVH_ALWAYS_INLINE Bvh< Nodebuild (std::span< const BBox > bboxes, std::span< const Vec > centers, const Config &config={})
 

Protected Member Functions

BVH_ALWAYS_INLINE SweepSahBuilder (std::span< const BBox > bboxes, std::span< const Vec > centers, const Config &config)
 
void find_best_split (size_t axis, size_t begin, size_t end, Split &best_split)
 
std::vector< size_t > & get_prim_ids () override
 
BVH_ALWAYS_INLINE void mark_primitives (size_t axis, size_t begin, size_t split_pos, size_t end)
 
std::optional< size_t > try_split (const BBox &bbox, size_t begin, size_t end) override
 
- Protected Member Functions inherited from bvh::v2::TopDownSahBuilder< Node >
BVH_ALWAYS_INLINE TopDownSahBuilder (std::span< const BBox > bboxes, std::span< const Vec > centers, const Config &config)
 
Bvh< Nodebuild ()
 
BVH_ALWAYS_INLINE BBox compute_bbox (size_t begin, size_t end) const
 
BVH_ALWAYS_INLINE const std::vector< size_t > & get_prim_ids () const
 

Protected Attributes

std::vector< Scalaraccum_
 
std::vector< boolmarks_
 
std::vector< size_t > prim_ids_ [Node::dimension]
 
- Protected Attributes inherited from bvh::v2::TopDownSahBuilder< Node >
std::span< const BBoxbboxes_
 
std::span< const Veccenters_
 
const Configconfig_
 

Additional Inherited Members

- Protected Types inherited from bvh::v2::TopDownSahBuilder< Node >
using BBox = bvh::v2::BBox< Scalar, Node::dimension >
 
using Scalar = typename Node::Scalar
 
using Vec = bvh::v2::Vec< Scalar, Node::dimension >
 

#include <bvh/v2/sweep_sah_builder.h>

Inheritance diagram for bvh::v2::SweepSahBuilder< Node >:
[legend]

Constructor & Destructor Documentation

◆ SweepSahBuilder()

template<typename Node >
BVH_ALWAYS_INLINE bvh::v2::SweepSahBuilder< Node >::SweepSahBuilder ( std::span< const BBox bboxes,
std::span< const Vec centers,
const Config config 
)
inlineprotected

Definition at line 49 of file sweep_sah_builder.h.

Member Function Documentation

◆ build()

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

Definition at line 30 of file sweep_sah_builder.h.

◆ find_best_split()

template<typename Node >
void bvh::v2::SweepSahBuilder< Node >::find_best_split ( size_t  axis,
size_t  begin,
size_t  end,
Split best_split 
)
inlineprotected

Definition at line 68 of file sweep_sah_builder.h.

◆ get_prim_ids()

template<typename Node >
std::vector< size_t > & bvh::v2::SweepSahBuilder< Node >::get_prim_ids ( )
inlineoverrideprotectedvirtual

Implements bvh::v2::TopDownSahBuilder< Node >.

Definition at line 66 of file sweep_sah_builder.h.

◆ mark_primitives()

template<typename Node >
BVH_ALWAYS_INLINE void bvh::v2::SweepSahBuilder< Node >::mark_primitives ( size_t  axis,
size_t  begin,
size_t  split_pos,
size_t  end 
)
inlineprotected

Definition at line 103 of file sweep_sah_builder.h.

◆ try_split()

template<typename Node >
std::optional< size_t > bvh::v2::SweepSahBuilder< Node >::try_split ( const BBox bbox,
size_t  begin,
size_t  end 
)
inlineoverrideprotectedvirtual

Implements bvh::v2::TopDownSahBuilder< Node >.

Definition at line 108 of file sweep_sah_builder.h.

Member Data Documentation

◆ accum_

template<typename Node >
std::vector<Scalar> bvh::v2::SweepSahBuilder< Node >::accum_
protected

Definition at line 46 of file sweep_sah_builder.h.

◆ marks_

template<typename Node >
std::vector<bool> bvh::v2::SweepSahBuilder< Node >::marks_
protected

Definition at line 45 of file sweep_sah_builder.h.

◆ prim_ids_

template<typename Node >
std::vector<size_t> bvh::v2::SweepSahBuilder< Node >::prim_ids_[Node::dimension]
protected

Definition at line 47 of file sweep_sah_builder.h.

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