OpenVDB  9.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 dependecy. More...

#include <nanovdb/util/GridBuilder.h>

Classes

struct   BuildLeaf
 
struct   BuildNode
 
struct   ValueAccessor
 

Public Member Functions

 GridBuilder (ValueT background=ValueT(), GridClass gClass=GridClass::Unknown, uint64_t blindDataSize=0)
 
ValueAccessor getAccessor ()
 
void sdfToLevelSet ()
 Performs multi-threaded bottum-up signed-distance flood-filling and changes GridClass to LevelSet. More...
 
void sdfToFog ()
 Performs multi-threaded bottum-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 dependecy.

Constructor & Destructor Documentation

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

Member Function Documentation

void enableDithering ( bool  on = true)
inline
ValueAccessor getAccessor ( )
inline
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)

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)

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 brackground 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
funcFunctor used to evaluate the grid values in the bbox
bboxCoordinate bounding-box over which the grid values will be set.
deltaSpecifies a lower threshold value for rendering (optional). Typically equals the voxel size for level sets and otherwise it's zero.
void sdfToFog ( )
inline

Performs multi-threaded bottum-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
void sdfToLevelSet ( )

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

Warning
Only call this method once this GridBuilder contains a valid signed distance field
void setChecksum ( ChecksumMode  mode = ChecksumMode::Default)
inline
void setGridClass ( GridClass  mode = GridClass::Unknown)
inline
void setStats ( StatsMode  mode = StatsMode::Default)
inline
void setVerbose ( int  mode = 1)
inline