Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
shamtree::CompressedLeafBVH< Tmorton, Tvec, dim > Class Template Reference

A Compressed Leaf Bounding Volume Hierarchy (CLBVH) for neighborhood queries. More...

#include <shamtree/include/shamtree/CompressedLeafBVH.hpp>

+ Collaboration diagram for shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >:

Public Member Functions

u32 get_total_cell_count ()
 Get internal cell count.
 
u32 get_internal_cell_count ()
 Get internal cell count.
 
bool is_root_leaf () const
 is the root a leaf ?
 
u32 get_leaf_cell_count ()
 Get leaf cell count.
 
 CompressedLeafBVH (MortonReducedSet< Tmorton, Tvec, dim > &&reduced_morton_set, KarrasRadixTree &&structure, KarrasRadixTreeAABB< Tvec > &&aabbs)
 Construct a new CompressedLeafBVH from a MortonReducedSet, a KarrasRadixTree, and a KarrasRadixTreeAABB.
 
bool is_empty () const
 is the BVH empty ?
 
void rebuild_from_positions (sham::DeviceBuffer< Tvec > &positions, const shammath::AABB< Tvec > &bounding_box, u32 compression_level)
 rebuild the BVH from the given positions
 
void rebuild_from_positions (sham::DeviceBuffer< Tvec > &positions, u32 obj_cnt, const shammath::AABB< Tvec > &bounding_box, u32 compression_level)
 rebuild the BVH from the given positions
 
void rebuild_from_position_range (sham::DeviceBuffer< Tvec > &min, sham::DeviceBuffer< Tvec > &max, u32 obj_cnt, shammath::AABB< Tvec > &bounding_box, u32 compression_level)
 
void rebuild_from_position_range (sham::DeviceBuffer< Tvec > &min, sham::DeviceBuffer< Tvec > &max, shammath::AABB< Tvec > &bounding_box, u32 compression_level)
 
shamtree::CLBVHTraverser< Tmorton, Tvec, dim > get_traverser () const
 
shamtree::CLBVHTraverserHost< Tmorton, Tvec, dim > get_traverser_host () const
 
shamtree::CLBVHObjectIterator< Tmorton, Tvec, dim > get_object_iterator () const
 Retrieves an iterator for traversing objects in the BVH.
 
shamtree::CLBVHObjectIteratorHost< Tmorton, Tvec, dim > get_object_iterator_host () const
 
CellIterator get_cell_iterator () const
 
CellIteratorHost get_cell_iterator_host () const
 

Static Public Member Functions

static CompressedLeafBVH make_empty (sham::DeviceScheduler_ptr dev_sched)
 make an empty BVH
 

Public Attributes

MortonReducedSet< Tmorton, Tvec, dim > reduced_morton_set
 The reduced set of Morton codes.
 
KarrasRadixTree structure
 The tree structure.
 
KarrasRadixTreeAABB< Tvec > aabbs
 The bounding box of the tree cells.
 

Detailed Description

template<class Tmorton, class Tvec, u32 dim>
class shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >

A Compressed Leaf Bounding Volume Hierarchy (CLBVH) for neighborhood queries.

A Compressed Leaf Bounding Volume Hierarchy (CLBVH) is a hierarchical data structure used for efficient collision detection. It is composed of a MortonReducedSet to store the reduced set of Morton codes (Compressed aspect of the tree), a KarrasRadixTree to represent the tree structure, and a KarrasRadixTreeAABB to store the bounding boxes of the tree cells.

Template Parameters
TmortonThe type used to represent the Morton codes.
TvecThe type used to represent the 3D vector positions.
dimThe number of dimensions (3 for 3D).

Definition at line 46 of file CompressedLeafBVH.hpp.

Constructor & Destructor Documentation

◆ CompressedLeafBVH()

template<class Tmorton , class Tvec , u32 dim>
shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::CompressedLeafBVH ( MortonReducedSet< Tmorton, Tvec, dim > &&  reduced_morton_set,
KarrasRadixTree &&  structure,
KarrasRadixTreeAABB< Tvec > &&  aabbs 
)
inline

Construct a new CompressedLeafBVH from a MortonReducedSet, a KarrasRadixTree, and a KarrasRadixTreeAABB.

Parameters
[in]reduced_morton_setthe MortonReducedSet to take ownership of
[in]structurethe KarrasRadixTree to take ownership of
[in]aabbsthe KarrasRadixTreeAABB to take ownership of

Definition at line 84 of file CompressedLeafBVH.hpp.

Member Function Documentation

◆ get_cell_iterator()

template<class Tmorton , class Tvec , u32 dim>
CellIterator shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::get_cell_iterator ( ) const
inline

Definition at line 168 of file CompressedLeafBVH.hpp.

◆ get_cell_iterator_host()

template<class Tmorton , class Tvec , u32 dim>
CellIteratorHost shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::get_cell_iterator_host ( ) const
inline

Definition at line 173 of file CompressedLeafBVH.hpp.

◆ get_internal_cell_count()

template<class Tmorton , class Tvec , u32 dim>
u32 shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::get_internal_cell_count ( )
inline

Get internal cell count.

Definition at line 59 of file CompressedLeafBVH.hpp.

+ Here is the call graph for this function:

◆ get_leaf_cell_count()

template<class Tmorton , class Tvec , u32 dim>
u32 shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::get_leaf_cell_count ( )
inline

Get leaf cell count.

Definition at line 65 of file CompressedLeafBVH.hpp.

+ Here is the call graph for this function:

◆ get_object_iterator()

template<class Tmorton , class Tvec , u32 dim>
shamtree::CLBVHObjectIterator< Tmorton, Tvec, dim > shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::get_object_iterator ( ) const
inline

Retrieves an iterator for traversing objects in the BVH.

This function returns a CLBVHObjectIterator configured to traverse the objects in the compressed leaf BVH. The iterator is initialized using the cell iterator from the reduced Morton set, the structure traverser from the Karras Radix Tree structure, and the minimum and maximum AABB buffers.

Returns
A CLBVHObjectIterator for object traversal.

Definition at line 160 of file CompressedLeafBVH.hpp.

◆ get_object_iterator_host()

template<class Tmorton , class Tvec , u32 dim>
shamtree::CLBVHObjectIteratorHost< Tmorton, Tvec, dim > shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::get_object_iterator_host ( ) const
inline

Definition at line 164 of file CompressedLeafBVH.hpp.

◆ get_total_cell_count()

template<class Tmorton , class Tvec , u32 dim>
u32 shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::get_total_cell_count ( )
inline

Get internal cell count.

Definition at line 56 of file CompressedLeafBVH.hpp.

◆ get_traverser()

template<class Tmorton , class Tvec , u32 dim>
shamtree::CLBVHTraverser< Tmorton, Tvec, dim > shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::get_traverser ( ) const
inline

Definition at line 138 of file CompressedLeafBVH.hpp.

◆ get_traverser_host()

template<class Tmorton , class Tvec , u32 dim>
shamtree::CLBVHTraverserHost< Tmorton, Tvec, dim > shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::get_traverser_host ( ) const
inline

Definition at line 142 of file CompressedLeafBVH.hpp.

◆ is_empty()

template<class Tmorton , class Tvec , u32 dim>
bool shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::is_empty ( ) const
inline

is the BVH empty ?

Definition at line 97 of file CompressedLeafBVH.hpp.

◆ is_root_leaf()

template<class Tmorton , class Tvec , u32 dim>
bool shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::is_root_leaf ( ) const
inline

is the root a leaf ?

Definition at line 62 of file CompressedLeafBVH.hpp.

+ Here is the call graph for this function:

◆ make_empty()

template<class Tmorton , class Tvec , u32 dim>
shamtree::CompressedLeafBVH< Tmorton, Tvec, dim > shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::make_empty ( sham::DeviceScheduler_ptr  dev_sched)
static

make an empty BVH

Definition at line 22 of file CompressedLeafBVH.cpp.

◆ rebuild_from_position_range() [1/2]

template<class Tmorton , class Tvec , u32 dim>
void shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::rebuild_from_position_range ( sham::DeviceBuffer< Tvec > &  min,
sham::DeviceBuffer< Tvec > &  max,
shammath::AABB< Tvec > &  bounding_box,
u32  compression_level 
)

Definition at line 126 of file CompressedLeafBVH.cpp.

◆ rebuild_from_position_range() [2/2]

template<class Tmorton , class Tvec , u32 dim>
void shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::rebuild_from_position_range ( sham::DeviceBuffer< Tvec > &  min,
sham::DeviceBuffer< Tvec > &  max,
u32  obj_cnt,
shammath::AABB< Tvec > &  bounding_box,
u32  compression_level 
)

Definition at line 98 of file CompressedLeafBVH.cpp.

◆ rebuild_from_positions() [1/2]

template<class Tmorton , class Tvec , u32 dim>
void shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::rebuild_from_positions ( sham::DeviceBuffer< Tvec > &  positions,
const shammath::AABB< Tvec > &  bounding_box,
u32  compression_level 
)

rebuild the BVH from the given positions

Parameters
[in]positionsthe positions of the particles
[in]bounding_boxthe bounding box of the particles
[in]compression_levelthe compression level of the BVH

Definition at line 118 of file CompressedLeafBVH.cpp.

+ Here is the call graph for this function:

◆ rebuild_from_positions() [2/2]

template<class Tmorton , class Tvec , u32 dim>
void shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::rebuild_from_positions ( sham::DeviceBuffer< Tvec > &  positions,
u32  obj_cnt,
const shammath::AABB< Tvec > &  bounding_box,
u32  compression_level 
)

rebuild the BVH from the given positions

Parameters
[in]positionsthe positions of the particles
[in]obj_cntthe number of particles
[in]bounding_boxthe bounding box of the particles
[in]compression_levelthe compression level of the BVH

Definition at line 79 of file CompressedLeafBVH.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ aabbs

template<class Tmorton , class Tvec , u32 dim>
KarrasRadixTreeAABB<Tvec> shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::aabbs

The bounding box of the tree cells.

Definition at line 74 of file CompressedLeafBVH.hpp.

◆ reduced_morton_set

template<class Tmorton , class Tvec , u32 dim>
MortonReducedSet<Tmorton, Tvec, dim> shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::reduced_morton_set

The reduced set of Morton codes.

Definition at line 68 of file CompressedLeafBVH.hpp.

◆ structure

template<class Tmorton , class Tvec , u32 dim>
KarrasRadixTree shamtree::CompressedLeafBVH< Tmorton, Tvec, dim >::structure

The tree structure.

Definition at line 71 of file CompressedLeafBVH.hpp.


The documentation for this class was generated from the following files: