OpenVDB 11.0.0
 
Loading...
Searching...
No Matches
CreateNanoGrid< SrcGridT >::BlindMetaData Struct Reference

#include <nanovdb/util/CreateNanoGrid.h>

Public Types

using SrcNodeAccT
 
using SrcBuildT
 
using SrcValueT
 
using SrcTreeT
 
using SrcRootT
 
using SrcNodeT
 

Public Member Functions

 BlindMetaData (const std::string &name, const std::string &type, GridBlindDataClass dataClass, size_t i, size_t valueCount, size_t valueSize)
 
 BlindMetaData (const std::string &name, GridBlindDataSemantic dataSemantic, GridBlindDataClass dataClass, GridType dataType, size_t i, size_t valueCount, size_t valueSize)
 
 ~BlindMetaData ()
 
bool operator< (const BlindMetaData &other) const
 
 CreateNanoGrid (const SrcGridT &srcGrid)
 Constructor from a source grid.
 
 CreateNanoGrid (const SrcNodeAccT &srcNodeAcc)
 Constructor from a source node accessor (defined above)
 
void setVerbose (int mode=1)
 Set the level of verbosity.
 
void enableDithering (bool on=true)
 Enable or disable dithering, i.e. randomization of the quantization error.
 
void setStats (StatsMode mode=StatsMode::Default)
 Set the mode used for computing statistics of the destination grid.
 
void setChecksum (ChecksumMode mode=ChecksumMode::Default)
 Set the mode used for computing checksums of the destination grid.
 
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.
 
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.
 
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.
 
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.
 
uint64_t valueCount () const
 This method only has affect when getHandle was called with DstBuildT = ValueIndex or ValueOnIndex.
 
enable_if< BuildTraits< DstBuildT >::is_index >::type copyValues (SrcValueT *buffer)
 Copy values from the source grid into a provided buffer.
 

Static Public Member Functions

static GridType mapToType (const std::string &name)
 
static GridBlindDataSemantic mapToSemantics (const std::string &name)
 

Public Attributes

GridBlindMetaDatametaData
 
const size_t order
 
const size_t size
 

Member Typedef Documentation

◆ SrcBuildT

using SrcBuildT

◆ SrcNodeAccT

using SrcNodeAccT

◆ SrcNodeT

using SrcNodeT

◆ SrcRootT

using SrcRootT

◆ SrcTreeT

using SrcTreeT

◆ SrcValueT

using SrcValueT

Constructor & Destructor Documentation

◆ BlindMetaData() [1/2]

template<typename SrcGridT>
BlindMetaData ( const std::string & name,
const std::string & type,
GridBlindDataClass dataClass,
size_t i,
size_t valueCount,
size_t valueSize )
inline

◆ BlindMetaData() [2/2]

template<typename SrcGridT>
BlindMetaData ( const std::string & name,
GridBlindDataSemantic dataSemantic,
GridBlindDataClass dataClass,
GridType dataType,
size_t i,
size_t valueCount,
size_t valueSize )
inline

◆ ~BlindMetaData()

template<typename SrcGridT>
~BlindMetaData ( )
inline

Member Function Documentation

◆ addBlindData()

uint64_t 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

◆ copyValues()

enable_if< BuildTraits< DstBuildT >::is_index >::type 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

◆ CreateNanoGrid() [1/2]

CreateNanoGrid ( const SrcGridT & srcGrid)

Constructor from a source grid.

Parameters
srcGridSource grid of type SrcGridT

◆ CreateNanoGrid() [2/2]

CreateNanoGrid ( const SrcNodeAccT & srcNodeAcc)

Constructor from a source node accessor (defined above)

Parameters
srcNodeAccSource node accessor of type SrcNodeAccT

◆ enableDithering()

void 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}

◆ getHandle() [1/3]

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.

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}

◆ getHandle() [2/3]

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.

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

◆ getHandle() [3/3]

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.

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)

◆ mapToSemantics()

template<typename SrcGridT>
static GridBlindDataSemantic mapToSemantics ( const std::string & name)
inlinestatic

◆ mapToType()

template<typename SrcGridT>
static GridType mapToType ( const std::string & name)
inlinestatic

◆ operator<()

template<typename SrcGridT>
bool operator< ( const BlindMetaData & other) const
inline

◆ setChecksum()

void setChecksum ( ChecksumMode mode = ChecksumMode::Default)
inline

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

Parameters
modespecify the mode of checksum

◆ setStats()

void setStats ( StatsMode mode = StatsMode::Default)
inline

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

Parameters
modespecify the mode of statistics

◆ setVerbose()

void setVerbose ( int mode = 1)
inline

Set the level of verbosity.

Parameters
modelevel of verbosity, mode=0 means quiet

◆ valueCount()

uint64_t 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.

Member Data Documentation

◆ metaData

template<typename SrcGridT>
GridBlindMetaData* metaData

◆ order

template<typename SrcGridT>
const size_t order

◆ size

template<typename SrcGridT>
const size_t size