HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nanovdb::CreateNanoGrid< typename > Class Template Reference

Creates any nanovdb Grid from any source grid (certain combinations are obviously not allowed) More...

#include <CreateNanoGrid.h>

Classes

struct  BlindMetaData
 

Public Types

using SrcNodeAccT = NodeAccessor< SrcGridT >
 
using SrcBuildT = typename SrcNodeAccT::BuildType
 
using SrcValueT = typename SrcNodeAccT::ValueType
 
using SrcTreeT = typename SrcNodeAccT::TreeType
 
using SrcRootT = typename SrcNodeAccT::RootType
 
template<int LEVEL>
using SrcNodeT = typename NodeTrait< SrcRootT, LEVEL >::type
 

Public Member Functions

 CreateNanoGrid (const SrcGridT &srcGrid)
 Constructor from a source grid. More...
 
 CreateNanoGrid (const SrcNodeAccT &srcNodeAcc)
 Constructor from a source node accessor (defined above) More...
 
void setVerbose (int mode=1)
 Set the level of verbosity. More...
 
void enableDithering (bool on=true)
 Enable or disable dithering, i.e. randomization of the quantization error. More...
 
void setStats (StatsMode mode=StatsMode::Default)
 Set the mode used for computing statistics of the destination grid. More...
 
void setChecksum (ChecksumMode mode=ChecksumMode::Default)
 Set the mode used for computing checksums of the destination grid. More...
 
template<typename DstBuildT = typename MapToNano<SrcBuildT>::type, typename BufferT = HostBuffer>
disable_if< is_same< DstBuildT,
FpN >::value||BuildTraits
< DstBuildT >::is_index,
GridHandle< BufferT > >::type 
getHandle (const BufferT &buffer=BufferT())
 Converts the source grid into a nanovdb grid with the specified destination build type. More...
 
template<typename DstBuildT = typename MapToNano<SrcBuildT>::type, typename OracleT = AbsDiff, typename BufferT = HostBuffer>
enable_if< is_same< DstBuildT,
FpN >::value, GridHandle
< BufferT > >::type 
getHandle (const OracleT &oracle=OracleT(), const BufferT &buffer=BufferT())
 Converts the source grid into a nanovdb grid with variable bit quantization. More...
 
template<typename DstBuildT = typename MapToNano<SrcBuildT>::type, typename BufferT = HostBuffer>
enable_if< BuildTraits
< DstBuildT >::is_index,
GridHandle< BufferT > >::type 
getHandle (uint32_t channels=0u, bool includeStats=true, bool includeTiles=true, const BufferT &buffer=BufferT())
 Converts the source grid into a nanovdb grid with indices to external arrays of values. More...
 
uint64_t addBlindData (const std::string &name, GridBlindDataSemantic dataSemantic, GridBlindDataClass dataClass, GridType dataType, size_t count, size_t size)
 Add blind data to the destination grid. More...
 
uint64_t valueCount () const
 This method only has affect when getHandle was called with DstBuildT = ValueIndex or ValueOnIndex. More...
 
template<typename DstBuildT >
enable_if< BuildTraits
< DstBuildT >::is_index >
::type 
copyValues (SrcValueT *buffer)
 Copy values from the source grid into a provided buffer. More...
 

Detailed Description

template<typename>
class nanovdb::CreateNanoGrid< typename >

Creates any nanovdb Grid from any source grid (certain combinations are obviously not allowed)

Definition at line 105 of file CreateNanoGrid.h.

Member Typedef Documentation

template<typename >
using nanovdb::CreateNanoGrid< typename >::SrcBuildT = typename SrcNodeAccT::BuildType

Definition at line 528 of file CreateNanoGrid.h.

template<typename >
using nanovdb::CreateNanoGrid< typename >::SrcNodeAccT = NodeAccessor<SrcGridT>

Definition at line 527 of file CreateNanoGrid.h.

template<typename >
template<int LEVEL>
using nanovdb::CreateNanoGrid< typename >::SrcNodeT = typename NodeTrait<SrcRootT, LEVEL>::type

Definition at line 533 of file CreateNanoGrid.h.

template<typename >
using nanovdb::CreateNanoGrid< typename >::SrcRootT = typename SrcNodeAccT::RootType

Definition at line 531 of file CreateNanoGrid.h.

template<typename >
using nanovdb::CreateNanoGrid< typename >::SrcTreeT = typename SrcNodeAccT::TreeType

Definition at line 530 of file CreateNanoGrid.h.

template<typename >
using nanovdb::CreateNanoGrid< typename >::SrcValueT = typename SrcNodeAccT::ValueType

Definition at line 529 of file CreateNanoGrid.h.

Constructor & Destructor Documentation

template<typename SrcGridT >
nanovdb::CreateNanoGrid< SrcGridT >::CreateNanoGrid ( const SrcGridT &  srcGrid)

Constructor from a source grid.

Parameters
srcGridSource grid of type SrcGridT

Definition at line 783 of file CreateNanoGrid.h.

template<typename SrcGridT >
nanovdb::CreateNanoGrid< SrcGridT >::CreateNanoGrid ( const SrcNodeAccT srcNodeAcc)

Constructor from a source node accessor (defined above)

Parameters
srcNodeAccSource node accessor of type SrcNodeAccT

Definition at line 798 of file CreateNanoGrid.h.

Member Function Documentation

template<typename >
uint64_t nanovdb::CreateNanoGrid< typename >::addBlindData ( const std::string name,
GridBlindDataSemantic  dataSemantic,
GridBlindDataClass  dataClass,
GridType  dataType,
size_t  count,
size_t  size 
)
inline

Add blind data to the destination grid.

Parameters
nameString name of the blind data
dataSemanticSemantics of the blind data
dataClassClass of the blind data
dataTypeType of the blind data
countElement count of the blind data
sizeSize of each element of the blind data
Returns
Return the index used to access the blind data

Definition at line 607 of file CreateNanoGrid.h.

template<typename SrcGridT >
template<typename DstBuildT >
enable_if< BuildTraits< DstBuildT >::is_index >::type nanovdb::CreateNanoGrid< SrcGridT >::copyValues ( SrcValueT buffer)

Copy values from the source grid into a provided buffer.

Template Parameters
DstBuildTMust be ValueIndex or ValueOnIndex, i.e. a index grid
Parameters
bufferpoint in which to write values

Definition at line 1840 of file CreateNanoGrid.h.

template<typename >
void nanovdb::CreateNanoGrid< typename >::enableDithering ( bool  on = true)
inline

Enable or disable dithering, i.e. randomization of the quantization error.

Parameters
onenable or disable dithering
Warning
Dithering only has an affect when DstBuildT = {Fp4, Fp8, Fp16, FpN}

Definition at line 550 of file CreateNanoGrid.h.

template<typename SrcGridT >
template<typename DstBuildT , typename BufferT >
disable_if< is_same< DstBuildT, FpN >::value||BuildTraits< DstBuildT >::is_index, GridHandle< BufferT > >::type nanovdb::CreateNanoGrid< SrcGridT >::getHandle ( const BufferT &  buffer = BufferT())

Converts the source grid into a nanovdb grid with the specified destination build type.

Template Parameters
DstBuildTbuild type of the destination, output, grid
BufferTType of the buffer used for allocating the destination grid
Parameters
bufferinstance of the buffer use for allocation
Returns
Return an instance of a GridHandle (invoking move semantics)
Note
This version is when DstBuildT != {FpN, ValueIndex, ValueOnIndex}

Definition at line 896 of file CreateNanoGrid.h.

template<typename SrcGridT >
template<typename DstBuildT , typename OracleT , typename BufferT >
enable_if< is_same< DstBuildT, FpN >::value, GridHandle< BufferT > >::type nanovdb::CreateNanoGrid< SrcGridT >::getHandle ( const OracleT &  oracle = OracleT(),
const BufferT &  buffer = BufferT() 
)

Converts the source grid into a nanovdb grid with variable bit quantization.

Template Parameters
DstBuildTFpN, i.e. the destination grid uses variable bit quantization
OracleTType of oracle used to determine the N in FpN
BufferTType of the buffer used for allocating the destination grid
Parameters
oracleInstance of the oracle used to determine the N in FpN
bufferinstance of the buffer use for allocation
Returns
Return an instance of a GridHandle (invoking move semantics)
Note
This version assumes DstBuildT == FpN

Definition at line 909 of file CreateNanoGrid.h.

template<typename SrcGridT >
template<typename DstBuildT , typename BufferT >
enable_if< BuildTraits< DstBuildT >::is_index, GridHandle< BufferT > >::type nanovdb::CreateNanoGrid< SrcGridT >::getHandle ( uint32_t  channels = 0u,
bool  includeStats = true,
bool  includeTiles = true,
const BufferT &  buffer = BufferT() 
)

Converts the source grid into a nanovdb grid with indices to external arrays of values.

Template Parameters
DstBuildTValueIndex or ValueOnIndex, i.e. index all or just active values
BufferTType of the buffer used for allocating the destination grid
Parameters
channelsNumber of copies of values encoded as blind data in the destination grid
includeStatsSpecify if statics should be indexed
includeTilesSpecify if tile values, i.e. non-leaf-node-values, should be indexed
bufferinstance of the buffer use for allocation
Returns
Return an instance of a GridHandle (invoking move semantics)

Definition at line 922 of file CreateNanoGrid.h.

template<typename >
void nanovdb::CreateNanoGrid< typename >::setChecksum ( ChecksumMode  mode = ChecksumMode::Default)
inline

Set the mode used for computing checksums of the destination grid.

Parameters
modespecify the mode of checksum

Definition at line 558 of file CreateNanoGrid.h.

template<typename >
void nanovdb::CreateNanoGrid< typename >::setStats ( StatsMode  mode = StatsMode::Default)
inline

Set the mode used for computing statistics of the destination grid.

Parameters
modespecify the mode of statistics

Definition at line 554 of file CreateNanoGrid.h.

template<typename >
void nanovdb::CreateNanoGrid< typename >::setVerbose ( int  mode = 1)
inline

Set the level of verbosity.

Parameters
modelevel of verbosity, mode=0 means quiet

Definition at line 545 of file CreateNanoGrid.h.

template<typename >
uint64_t nanovdb::CreateNanoGrid< typename >::valueCount ( ) const
inline

This method only has affect when getHandle was called with DstBuildT = ValueIndex or ValueOnIndex.

Returns
Return the number of indexed values. If called before getHandle was called with DstBuildT = ValueIndex or ValueOnIndex the return value is zero. Else it is a value larger than zero.

Definition at line 621 of file CreateNanoGrid.h.


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