OpenVDB: GridBuilder< ValueT, BuildT, StatsT > Class Template Reference

OpenVDB 10.0.1

Classes | Public Member Functions | List of all members
GridBuilder< ValueT, BuildT, StatsT > Class Template Reference

Allows for the construction of NanoVDB grids without any dependency. More...

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

## Classes
struct | BuildLeaf
struct | ValueAccessor

## Public Member Functions
| GridBuilder (ValueT background=ValueT(), GridClass gClass=GridClass::Unknown, uint64_t blindDataSize=0)
ValueAccessor | getAccessor ()
void | sdfToLevelSet ()
| Performs multi-threaded bottom-up signed-distance flood-filling and changes GridClass to LevelSet. More...
void | sdfToFog ()
| Performs multi-threaded bottom-up signed-distance flood-filling followed by level-set -> FOG volume conversion. It also changes the GridClass to FogVolume. More...
void | setVerbose (int mode=1)
void | enableDithering (bool on=true)
void | setStats (StatsMode mode=StatsMode::Default)
void | setChecksum (ChecksumMode mode=ChecksumMode::Default)
void | setGridClass (GridClass mode=GridClass::Unknown)
template<typename OracleT = AbsDiff, typename BufferT = HostBuffer>
GridHandle< BufferT > | getHandle (double voxelSize=1.0, const Vec3d &gridOrigin=Vec3d(0), const std::string &name="", const OracleT &oracle=OracleT(), const BufferT &buffer=BufferT())
| Return an instance of a GridHandle (invoking move semantics) More...
template<typename OracleT = AbsDiff, typename BufferT = HostBuffer>
GridHandle< BufferT > | getHandle (const Map &map, const std::string &name="", const OracleT &oracle=OracleT(), const BufferT &buffer=BufferT())
| Return an instance of a GridHandle (invoking move semantics) More...
template<typename Func >
void | operator() (const Func &func, const CoordBBox &bbox, ValueT delta=ValueT(0))
| Sets grids values in domain of the bbox to those returned by the specified func with the expected signature [](const Coord&)->ValueT. More...

## Detailed Description

template<typename ValueT, typename BuildT = ValueT, typename StatsT = Stats<ValueT>>
class nanovdb::GridBuilder< ValueT, BuildT, StatsT >

Allows for the construction of NanoVDB grids without any dependency.

## Constructor & Destructor Documentation

## ◆ GridBuilder()

GridBuilder | ( | ValueT | background = `ValueT()`,
|  | GridClass | gClass = `GridClass::Unknown`,
|  | uint64_t | blindDataSize = `0`
| ) |  |

## Member Function Documentation

## ◆ enableDithering()

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

## ◆ getAccessor()

ValueAccessor getAccessor | ( |  | ) |
| inline

## ◆ getHandle() [1/2]

GridHandle< BufferT > getHandle | ( | const Map & | map,
|  | const std::string & | name = `""`,
|  | const OracleT & | oracle = `OracleT()`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

Return an instance of a GridHandle (invoking move semantics)

## ◆ getHandle() [2/2]

GridHandle< BufferT > getHandle | ( | double | voxelSize = `1.0`,
|  | const Vec3d & | gridOrigin = `Vec3d(0)`,
|  | const std::string & | name = `""`,
|  | const OracleT & | oracle = `OracleT()`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

Return an instance of a GridHandle (invoking move semantics)

## ◆ operator()()

void operator() | ( | const Func & | func,
|  | const CoordBBox & | bbox,
|  | ValueT | delta = `ValueT(0)`
| ) |  |

Sets grids values in domain of the bbox to those returned by the specified func with the expected signature [](const Coord&)->ValueT.

Note
  If func returns a value equal to the background value (specified in the constructor) at a specific voxel coordinate, then the active state of that coordinate is left off! Else the value value is set and the active state is on. This is done to allow for sparse grids to be generated.

Parameters

  func | Functor used to evaluate the grid values in the bbox
  bbox | Coordinate bounding-box over which the grid values will be set.
  delta | Specifies a lower threshold value for rendering (optional). Typically equals the voxel size for level sets and otherwise it's zero.

## ◆ sdfToFog()

void sdfToFog
| inline

Performs multi-threaded bottom-up signed-distance flood-filling followed by level-set -> FOG volume conversion. It also changes the GridClass to FogVolume.

Warning
  Only call this method once this GridBuilder contains a valid signed distance field

## ◆ sdfToLevelSet()

void sdfToLevelSet

Performs multi-threaded bottom-up signed-distance flood-filling and changes GridClass to LevelSet.

Warning
  Only call this method once this GridBuilder contains a valid signed distance field

## ◆ setChecksum()

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

## ◆ setGridClass()

void setGridClass | ( | GridClass | mode = `GridClass::Unknown` | ) |
| inline

## ◆ setStats()

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

## ◆ setVerbose()

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