OpenVDB 13.1.0
Loading...
Searching...
No Matches
VoxelBlockManagerHandle< BufferT > Class Template Reference

Move-only owner of the two raw metadata buffers that back a VoxelBlockManager: the per-block firstLeafID array (uint32_t[blockCount]) and the per-block jumpMap array (uint64_t[blockCount * JumpMapLength]). More...

#include <nanovdb/tools/VoxelBlockManager.h>

Public Member Functions

 VoxelBlockManagerHandle (BufferT &&firstLeafID, BufferT &&jumpMap, uint64_t blockCount, uint64_t firstOffset, uint64_t lastOffset)
 Constructor from metadata buffers (used by buildVoxelBlockManager)
 VoxelBlockManagerHandle ()=default
 VoxelBlockManagerHandle (const VoxelBlockManagerHandle &)=delete
VoxelBlockManagerHandleoperator= (const VoxelBlockManagerHandle &)=delete
VoxelBlockManagerHandleoperator= (VoxelBlockManagerHandle &&other) noexcept
 VoxelBlockManagerHandle (VoxelBlockManagerHandle &&other) noexcept
 ~VoxelBlockManagerHandle ()
void reset ()
 clear the buffer
template<typename U = BufferT>
util::enable_if< BufferTraits< U >::hasDeviceDual, uint32_t * >::type deviceFirstLeafID ()
 Returns a non-const pointer to the firstLeafID device-hosted data.
template<typename U = BufferT>
util::enable_if< BufferTraits< U >::hasDeviceDual, constuint32_t * >::type deviceFirstLeafID () const
 Returns a const pointer to the firstLeafID device-hosted data.
template<typename U = BufferT>
util::enable_if< BufferTraits< U >::hasDeviceDual, uint64_t * >::type deviceJumpMap ()
 Returns a non-const pointer to the jumpMap device-hosted data.
template<typename U = BufferT>
util::enable_if< BufferTraits< U >::hasDeviceDual, constuint64_t * >::type deviceJumpMap () const
 Returns a const pointer to the jumpMap device-hosted data.
template<typename U = BufferT>
util::enable_if< BufferHasDeviceSingle< U >::value, uint32_t * >::type deviceFirstLeafID ()
 For a single-space buffer the device data is the buffer itself.
template<typename U = BufferT>
util::enable_if< BufferHasDeviceSingle< U >::value, constuint32_t * >::type deviceFirstLeafID () const
template<typename U = BufferT>
util::enable_if< BufferHasDeviceSingle< U >::value, uint64_t * >::type deviceJumpMap ()
template<typename U = BufferT>
util::enable_if< BufferHasDeviceSingle< U >::value, constuint64_t * >::type deviceJumpMap () const
uint64_t blockCount () const
 Returns the number of voxel blocks in the VoxelBlockManager.
uint64_t firstOffset () const
 Returns the first voxel index (linear offset) associated with this VoxelBlockManager.
uint64_t lastOffset () const
 Returns the last voxel index (linear offset) associated with this VoxelBlockManager.
uint32_t * hostFirstLeafID ()
 Returns a non-const pointer to the firstLeafID host-side data.
const uint32_t * hostFirstLeafID () const
 Returns a const pointer to the firstLeafID host-side data.
uint64_t * hostJumpMap ()
 Returns a non-const pointer to the jumpMap host-side data.
const uint64_t * hostJumpMap () const
 Returns a const pointer to the jumpMap host-side data.

Detailed Description

template<typename BufferT>
class nanovdb::tools::VoxelBlockManagerHandle< BufferT >

Move-only owner of the two raw metadata buffers that back a VoxelBlockManager: the per-block firstLeafID array (uint32_t[blockCount]) and the per-block jumpMap array (uint64_t[blockCount * JumpMapLength]).

Template Parameters
BufferTBuffer type that owns a contiguous allocation. Must satisfy the NanoVDB BufferTraits concept: provide data(), clear(), and — when device memory is needed — deviceData() (gated by BufferTraits<BufferT>::hasDeviceDual).

Constructor & Destructor Documentation

◆ VoxelBlockManagerHandle() [1/4]

template<typename BufferT>
VoxelBlockManagerHandle ( BufferT && firstLeafID,
BufferT && jumpMap,
uint64_t blockCount,
uint64_t firstOffset,
uint64_t lastOffset )
inline

Constructor from metadata buffers (used by buildVoxelBlockManager)

Parameters
firstLeafIDAllocated buffer holding the firstLeafID array
jumpMapAllocated buffer holding the jumpMap array
blockCountNumber of voxel blocks (allocated capacity of the buffers)
firstOffsetSequential index of the first voxel covered by this VBM
lastOffsetSequential index of the last voxel covered by this VBM

◆ VoxelBlockManagerHandle() [2/4]

template<typename BufferT>
VoxelBlockManagerHandle ( )
default

◆ VoxelBlockManagerHandle() [3/4]

template<typename BufferT>
VoxelBlockManagerHandle ( const VoxelBlockManagerHandle< BufferT > & )
delete

◆ VoxelBlockManagerHandle() [4/4]

template<typename BufferT>
VoxelBlockManagerHandle ( VoxelBlockManagerHandle< BufferT > && other)
inlinenoexcept

◆ ~VoxelBlockManagerHandle()

template<typename BufferT>
~VoxelBlockManagerHandle ( )
inline

Member Function Documentation

◆ blockCount()

template<typename BufferT>
uint64_t blockCount ( ) const
inline

Returns the number of voxel blocks in the VoxelBlockManager.

◆ deviceFirstLeafID() [1/4]

template<typename BufferT>
template<typename U = BufferT>
util::enable_if< BufferTraits< U >::hasDeviceDual, uint32_t * >::type deviceFirstLeafID ( )
inline

Returns a non-const pointer to the firstLeafID device-hosted data.

Warning
Note that the return pointer can be NULL if the VoxelBlockManagerHandle was not initialized

◆ deviceFirstLeafID() [2/4]

template<typename BufferT>
template<typename U = BufferT>
util::enable_if< BufferHasDeviceSingle< U >::value, uint32_t * >::type deviceFirstLeafID ( )
inline

For a single-space buffer the device data is the buffer itself.

Warning
Note that the return pointer can be NULL if the VoxelBlockManagerHandle was not initialized

◆ deviceFirstLeafID() [3/4]

template<typename BufferT>
template<typename U = BufferT>
util::enable_if< BufferTraits< U >::hasDeviceDual, constuint32_t * >::type deviceFirstLeafID ( ) const
inline

Returns a const pointer to the firstLeafID device-hosted data.

Warning
Note that the return pointer can be NULL if the VoxelBlockManagerHandle was not initialized

◆ deviceFirstLeafID() [4/4]

template<typename BufferT>
template<typename U = BufferT>
util::enable_if< BufferHasDeviceSingle< U >::value, constuint32_t * >::type deviceFirstLeafID ( ) const
inline

◆ deviceJumpMap() [1/4]

template<typename BufferT>
template<typename U = BufferT>
util::enable_if< BufferTraits< U >::hasDeviceDual, uint64_t * >::type deviceJumpMap ( )
inline

Returns a non-const pointer to the jumpMap device-hosted data.

Warning
Note that the return pointer can be NULL if the VoxelBlockManagerHandle was not initialized

◆ deviceJumpMap() [2/4]

template<typename BufferT>
template<typename U = BufferT>
util::enable_if< BufferHasDeviceSingle< U >::value, uint64_t * >::type deviceJumpMap ( )
inline

◆ deviceJumpMap() [3/4]

template<typename BufferT>
template<typename U = BufferT>
util::enable_if< BufferTraits< U >::hasDeviceDual, constuint64_t * >::type deviceJumpMap ( ) const
inline

Returns a const pointer to the jumpMap device-hosted data.

Warning
Note that the return pointer can be NULL if the VoxelBlockManagerHandle was not initialized

◆ deviceJumpMap() [4/4]

template<typename BufferT>
template<typename U = BufferT>
util::enable_if< BufferHasDeviceSingle< U >::value, constuint64_t * >::type deviceJumpMap ( ) const
inline

◆ firstOffset()

template<typename BufferT>
uint64_t firstOffset ( ) const
inline

Returns the first voxel index (linear offset) associated with this VoxelBlockManager.

◆ hostFirstLeafID() [1/2]

template<typename BufferT>
uint32_t * hostFirstLeafID ( )
inline

Returns a non-const pointer to the firstLeafID host-side data.

◆ hostFirstLeafID() [2/2]

template<typename BufferT>
const uint32_t * hostFirstLeafID ( ) const
inline

Returns a const pointer to the firstLeafID host-side data.

◆ hostJumpMap() [1/2]

template<typename BufferT>
uint64_t * hostJumpMap ( )
inline

Returns a non-const pointer to the jumpMap host-side data.

◆ hostJumpMap() [2/2]

template<typename BufferT>
const uint64_t * hostJumpMap ( ) const
inline

Returns a const pointer to the jumpMap host-side data.

◆ lastOffset()

template<typename BufferT>
uint64_t lastOffset ( ) const
inline

Returns the last voxel index (linear offset) associated with this VoxelBlockManager.

◆ operator=() [1/2]

template<typename BufferT>
VoxelBlockManagerHandle & operator= ( const VoxelBlockManagerHandle< BufferT > & )
delete

◆ operator=() [2/2]

template<typename BufferT>
VoxelBlockManagerHandle & operator= ( VoxelBlockManagerHandle< BufferT > && other)
inlinenoexcept

◆ reset()

template<typename BufferT>
void reset ( )
inline

clear the buffer