Loading...
Searching...
No Matches
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.
OracleT & | oracle ()
| return a reference to the compression oracle
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.
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()

template<typename OpenBuildT, typename NanoBuildT, typename OracleT, typename BufferT>

OpenToNanoVDB | ( |  | ) |

Default c-tor.

## Member Function Documentation

## enableDithering()

template<typename OpenBuildT, typename NanoBuildT, typename OracleT = AbsDiff, typename BufferT = HostBuffer>

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

inline

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

template<typename OpenBuildT, typename NanoBuildT, typename OracleT, typename BufferT>

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]

template<typename OpenBuildT, typename NanoBuildT, typename OracleT, typename BufferT>

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

inline

## oracle()

template<typename OpenBuildT, typename NanoBuildT, typename OracleT = AbsDiff, typename BufferT = HostBuffer>

OracleT & oracle | ( |  | ) |

inline

return a reference to the compression oracle

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

## processNodes()

template<typename OpenBuildT, typename NanoBuildT, typename OracleT = AbsDiff, typename BufferT = HostBuffer>
template<typename OpenNodeT>

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

## setChecksum()

template<typename OpenBuildT, typename NanoBuildT, typename OracleT = AbsDiff, typename BufferT = HostBuffer>

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

inline

## setStats()

template<typename OpenBuildT, typename NanoBuildT, typename OracleT = AbsDiff, typename BufferT = HostBuffer>

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

inline

## setVerbose()

template<typename OpenBuildT, typename NanoBuildT, typename OracleT = AbsDiff, typename BufferT = HostBuffer>

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

inline