OpenVDB: OpenToNanoVDB< OpenBuildT, NanoBuildT, OracleT, BufferT > Class Template Reference

OpenVDB 9.0.0

Classes | Public Member Functions | List of all members
OpenToNanoVDB< OpenBuildT, NanoBuildT, OracleT, BufferT > Class Template Reference

This class will convert an OpenVDB grid into a NanoVDB grid managed by a GridHandle. More...

`#include <nanovdb/util/OpenToNanoVDB.h>`

## Classes
struct | BlindMetaData

## Public Member Functions
| OpenToNanoVDB ()
| Default c-tor. More...
OracleT & | oracle ()
| return a reference to the compression oracle More...
void | setVerbose (int mode=1)
void | enableDithering (bool on=true)
void | setStats (StatsMode mode=StatsMode::Default)
void | setChecksum (ChecksumMode mode=ChecksumMode::Default)
GridHandle< BufferT > | operator() (const OpenGridT &grid, const BufferT &allocator=BufferT())
| Return a shared pointer to a NanoVDB grid handle constructed from the specified OpenVDB grid. More...
GridHandle< BufferT > | operator() (const OpenGridT &grid, StatsMode sMode, ChecksumMode cMode, int verbose, const BufferT &allocator=BufferT())
template<typename OpenNodeT >
void | processNodes (std::vector< NodePair< OpenNodeT > > &openNodes)

## Detailed Description

template<typename OpenBuildT, typename NanoBuildT, typename OracleT = AbsDiff, typename BufferT = HostBuffer>
class nanovdb::OpenToNanoVDB< OpenBuildT, NanoBuildT, OracleT, BufferT >

This class will convert an OpenVDB grid into a NanoVDB grid managed by a GridHandle.

Note
  Note that this converter assumes a 5,4,3 tree configuration of BOTH the OpenVDB and NanoVDB grids. This is a consequence of the fact that the OpenVDB tree is defined in OpenGridType and that all NanoVDB trees are by design always 5,4,3!

While NanoVDB allows root, internal and leaf nodes to reside anywhere in the memory buffer this conversion tool uses the following memory layout:

Grid | Tree Root... Node2... Node1... Leaf... BlindMetaData... BlindData... where "..." means size may vary and "|" means "no gap"

## Constructor & Destructor Documentation

## ◆ OpenToNanoVDB()

OpenToNanoVDB

Default c-tor.

## Member Function Documentation

## ◆ enableDithering()

void enableDithering | ( | bool | on = `true` | ) |
| inline

## ◆ operator()() [1/2]

GridHandle< BufferT > operator() | ( | const OpenGridT & | grid,
|  | const BufferT & | allocator = `BufferT()`
| ) |  |
| inline

Return a shared pointer to a NanoVDB grid handle constructed from the specified OpenVDB grid.

## ◆ operator()() [2/2]

GridHandle< BufferT > operator() | ( | const OpenGridT & | grid,
|  | StatsMode | sMode,
|  | ChecksumMode | cMode,
|  | int | verbose,
|  | const BufferT & | allocator = `BufferT()`
| ) |  |
| inline

## ◆ oracle()

OracleT & oracle | ( |  | ) |
| inline

return a reference to the compression oracle

Note
  Note, the oracle is only used when NanoBuildT = nanovdb::FpN!

## ◆ processNodes()

void processNodes | ( | std::vector< NodePair< OpenNodeT > > & | openNodes | ) |

## ◆ setChecksum()

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

## ◆ setStats()

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

## ◆ setVerbose()

void setVerbose | ( | int | mode = `1` | ) |
| inline