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

OpenVDB 10.0.1

Loading...
Searching...
No Matches
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.
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.
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)
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)
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.

## 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()

template<typename ValueT , typename BuildT , typename StatsT >

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

## Member Function Documentation

## ◆ enableDithering()

template<typename ValueT , typename BuildT = ValueT, typename StatsT = Stats<ValueT>>

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

## ◆ getAccessor()

template<typename ValueT , typename BuildT = ValueT, typename StatsT = Stats<ValueT>>

ValueAccessor getAccessor | ( |  | ) |
| inline

## ◆ getHandle() [1/2]

template<typename ValueT , typename BuildT , typename StatsT >
template<typename OracleT , typename BufferT >

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]

template<typename ValueT , typename BuildT , typename StatsT >
template<typename OracleT , typename BufferT >

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()()

template<typename ValueT , typename BuildT , typename StatsT >
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.

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()

template<typename ValueT , typename BuildT , typename StatsT >

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()

template<typename ValueT , typename BuildT , typename StatsT >

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()

template<typename ValueT , typename BuildT = ValueT, typename StatsT = Stats<ValueT>>

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

## ◆ setGridClass()

template<typename ValueT , typename BuildT = ValueT, typename StatsT = Stats<ValueT>>

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

## ◆ setStats()

template<typename ValueT , typename BuildT = ValueT, typename StatsT = Stats<ValueT>>

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

## ◆ setVerbose()

template<typename ValueT , typename BuildT = ValueT, typename StatsT = Stats<ValueT>>

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