Loading...
Searching...
No Matches
nanovdb Namespace Reference

Convert a base-pointer to an openvdb grid, denoted srcGrid, to a nanovdb grid of the same type, e.g. float -> float or openvdb::Vec3f -> nanovdb::Vec3f. More...

## Namespaces

namespace | build
namespace | crc32
namespace | io

## Classes

class | AbsDiff
| Compression oracle based on absolute difference. More...
struct | BaseBBox
class | BaseStencil
struct | BBox
struct | BBox< CoordT, false >
| Partial template specialization for integer coordinate types. More...
struct | BBox< Vec3T, true >
| Partial template specialization for floating point coordinate types. More...
struct | BitArray
struct | BitArray< 16 >
struct | BitArray< 32 >
struct | BitArray< 64 >
struct | BitArray< 8 >
class | BitFlags
class | BoxStencil
struct | BufferTraits
struct | BuildToValueMap
| Maps one type (e.g. the build types above) to other (actual) types. More...
struct | BuildToValueMap< Fp16 >
struct | BuildToValueMap< Fp4 >
struct | BuildToValueMap< Fp8 >
struct | BuildToValueMap< FpN >
struct | BuildToValueMap< Half >
struct | BuildToValueMap< Point >
struct | BuildToValueMap< ValueIndex >
struct | BuildToValueMap< ValueIndexMask >
struct | BuildToValueMap< ValueMask >
struct | BuildToValueMap< ValueOnIndex >
struct | BuildToValueMap< ValueOnIndexMask >
struct | BuildTraits
| Define static boolean tests for template build types. More...
class | ChannelAccessor
| Class to access values in channels at a specific voxel location. More...
class | Coord
| Signed (i, j, k) 32-bit integer coordinate class, similar to openvdb::math::Coord. More...
class | CpuTimer
class | CreateNanoGrid
| Creates any nanovdb Grid from any source grid (certain combinations are obviously not allowed) More...
class | CurvatureStencil
class | DDA
| A Digital Differential Analyzer. Unlike HDDA (defined above) this DDA uses a fixed step-size defined by the template parameter Dim! More...
struct | Delta
| Delta for small floating-point offsets. More...
struct | Delta< double >
struct | Delta< float >
struct | disable_if
struct | disable_if< true, T >
class | DitherLUT
struct | enable_if
| C++11 implementation of std::enable_if. More...
struct | enable_if< true, T >
class | Extrema
class | Extrema< ValueT, 0 >
| Template specialization of Extrema on scalar value types, i.e. rank = 0. More...
class | Extrema< VecT, 1 >
| Template specialization of Extrema on vector value types, i.e. rank = 1. More...
struct | FloatTraits
struct | FloatTraits< bool, 1 >
struct | FloatTraits< Point, 1 >
struct | FloatTraits< T, 8 >
struct | FloatTraits< ValueIndex, 1 >
struct | FloatTraits< ValueIndexMask, 1 >
struct | FloatTraits< ValueMask, 1 >
struct | FloatTraits< ValueOnIndex, 1 >
struct | FloatTraits< ValueOnIndexMask, 1 >
class | Fp16
| Dummy type for a 16bit quantization of float point values. More...
class | Fp4
| Dummy type for a 4bit quantization of float point values. More...
class | Fp8
| Dummy type for a 8bit quantization of float point values. More...
class | FpN
| Dummy type for a variable bit quantization of floating point values. More...
struct | GetDim
| Implements Tree::getDim(Coord) More...
struct | GetLeaf
| Return the pointer to the leaf node that contains Coord. Implements Tree::probeLeaf(Coord) More...
struct | GetLower
| Return point to the lower internal node where Coord maps to one of its values, i.e. terminates. More...
struct | GetNodeInfo
| Implements Tree::getNodeInfo(Coord) More...
struct | GetState
| Implements Tree::isActive(Coord) More...
struct | GetUpper
| Return point to the upper internal node where Coord maps to one of its values, i.e. terminates. More...
struct | GetValue
| Implements Tree::getValue(Coord), i.e. return the value associated with a specific coordinate `ijk`. More...
class | GradStencil
class | Grid
| Highest level of the data structure. Contains a tree and a world->index transform (that currently only supports uniform scaling and translation). More...
struct | GridBlindMetaData
class | GridChecksum
| Class that encapsulates two CRC32 checksums, one for the Grid, Tree and Root node meta data and one for the remaining grid nodes. More...
struct | GridData
| Struct with all the member data of the Grid (useful during serialization of an openvdb grid) More...
class | GridHandle
| This class serves to manage a buffer containing one or more NanoVDB Grids. More...
struct | GridHandleMetaData
class | GridMetaData
| This is a convenient class that allows for access to grid meta-data that are independent of the value type of a grid. That is, this class can be used to get information about a grid without actually knowing its ValueType. More...
class | GridStats
| Allows for the construction of NanoVDB grids without any dependency. More...
struct | GridTree
| defines a tree type from a grid type while preserving constness More...
struct | GridTree< const GridT >
class | GridValidator
| Allows for the construction of NanoVDB grids without any dependecy. More...
class | Half
| Dummy type for a 16 bit floating point values. More...
class | HDDA
| A Digital Differential Analyzer specialized for OpenVDB grids. More...
class | HostBuffer
| This is a buffer that contains a shared or private pool to either externally or internally managed host memory. More...
struct | InternalData
| Struct with all the member data of the InternalNode (useful during serialization of an openvdb InternalNode) More...
class | InternalNode
| Internal nodes of a VDB treedim(),. More...
struct | is_const
struct | is_const< const T >
struct | is_floating_point
| C++11 implementation of std::is_floating_point. More...
struct | is_pointer
| Trait used to identify template parameter that are pointers. More...
struct | is_pointer< const T * >
| Template specialization of const pointers. More...
struct | is_pointer< T * >
| Template specialization of non-const pointers. More...
struct | is_same
| C++11 implementation of std::is_same. More...
struct | is_same< T, T >
struct | is_same< T0, T1 >
struct | is_specialization
| Metafunction used to determine if the first template parameter is a specialization of the class template given in the second template parameter. More...
struct | is_specialization< TemplateType< Args... >, TemplateType >
struct | LeafData
| Stuct with all the member data of the LeafNode (useful during serialization of an openvdb LeafNode) More...
struct | LeafData< bool, CoordT, MaskT, LOG2DIM >
struct | LeafData< Fp16, CoordT, MaskT, LOG2DIM >
struct | LeafData< Fp4, CoordT, MaskT, LOG2DIM >
| Stuct with all the member data of the LeafNode (useful during serialization of an openvdb LeafNode) More...
struct | LeafData< Fp8, CoordT, MaskT, LOG2DIM >
struct | LeafData< FpN, CoordT, MaskT, LOG2DIM >
struct | LeafData< Point, CoordT, MaskT, LOG2DIM >
struct | LeafData< ValueIndex, CoordT, MaskT, LOG2DIM >
struct | LeafData< ValueIndexMask, CoordT, MaskT, LOG2DIM >
struct | LeafData< ValueMask, CoordT, MaskT, LOG2DIM >
struct | LeafData< ValueOnIndex, CoordT, MaskT, LOG2DIM >
struct | LeafData< ValueOnIndexMask, CoordT, MaskT, LOG2DIM >
struct | LeafFnBase
| Base-class for quantized float leaf nodes. More...
struct | LeafIndexBase
class | LeafNode
| Leaf nodes of the VDB tree. (defaults to 8x8x8 = 512 voxels) More...
struct | Map
| Defines an affine transform and its inverse represented as a 3x3 matrix and a vec3 translation. More...
struct | MapToNano
| Trait that maps any type to the corresponding nanovdb type. More...
class | Mask
| Bit-mask to encode active states and facilitate sequential iterators and a fast codec for I/O compression. More...
struct | match_const
| Trait used to transfer the const-ness of a reference type to another type. More...
struct | match_const< T, const ReferenceT >
| Template specialization used to transfer the const-ness of a reference type to another type. More...
struct | Maximum
| Maximum floating-point values. More...
struct | NanoNode
| Trait to map from LEVEL to node type. More...
struct | NanoNode< BuildT, 0 >
struct | NanoNode< BuildT, 1 >
struct | NanoNode< BuildT, 2 >
struct | NanoNode< BuildT, 3 >
class | NanoToOpenVDB
| This class will serialize an OpenVDB grid into a NanoVDB grid managed by a GridHandle. More...
class | NodeAccessor
| The NodeAccessor provides a uniform API for accessing nodes got NanoVDB, OpenVDB and build Grids. More...
class | NodeAccessor< NanoGrid< BuildT > >
| Template specialization for nanovdb::Grid which is special since its NodeManage uses a handle in order to support node access on the GPU! More...
class | NodeManager
| NodeManager allows for sequential access to nodes. More...
struct | NodeManagerData
class | NodeManagerHandle
| NodeManagerHandle manages the memory of a NodeManager. More...
struct | NodeTrait
| Struct to derive node type from its level in a given grid, tree or root while preserving constness. More...
struct | NodeTrait< const GridOrTreeOrRootT, 0 >
struct | NodeTrait< const GridOrTreeOrRootT, 1 >
struct | NodeTrait< const GridOrTreeOrRootT, 2 >
struct | NodeTrait< const GridOrTreeOrRootT, 3 >
struct | NodeTrait< GridOrTreeOrRootT, 0 >
struct | NodeTrait< GridOrTreeOrRootT, 1 >
struct | NodeTrait< GridOrTreeOrRootT, 2 >
struct | NodeTrait< GridOrTreeOrRootT, 3 >
struct | NoopStats
| No-op Stats class. More...
class | Point
| @dummy type for indexing points into voxels More...
class | PointAccessor
| Class to access points at a specific voxel location. More...
class | PointAccessor< AttT, Point >
class | PointTreeMarcher
| A Tree Marcher for Point Grids. More...
struct | ProbeValue
| Implements Tree::probeLeaf(Coord) More...
class | Range
class | Range< 1, T >
class | Range< 2, T >
class | Range< 3, T >
class | Ray
class | ReadAccessor
class | ReadAccessor< BuildT, -1, -1, -1 >
| A read-only value accessor with three levels of node caching. This allows for inverse tree traversal during lookup, which is on average significantly faster than calling the equivalent method on the tree (i.e. top-down traversal). More...
class | ReadAccessor< BuildT, 0, 1, 2 >
| Node caching at all (three) tree levels. More...
class | ReadAccessor< BuildT, LEVEL0, -1, -1 >
| Node caching at a single tree level. More...
class | ReadAccessor< BuildT, LEVEL0, LEVEL1, -1 >
class | RelDiff
| Compression oracle based on relative difference. More...
struct | remove_const
| Trait use to const from type. Default implementation is just a pass-through. More...
struct | remove_const< const T >
| Template specialization of trait class use to remove const qualifier type from a type. More...
struct | remove_pointer
| Trait use to remove pointer, i.e. "*", qualifier from a type. Default implementation is just a pass-through. More...
struct | remove_pointer< T * >
| Template specialization of trait class use to to remove pointer, i.e. "*", qualifier from a type. More...
struct | remove_reference
| Trait use to remove reference, i.e. "&", qualifier from a type. Default implementation is just a pass-through. More...
struct | remove_reference< T & >
| Template specialization of trait class use to remove reference, i.e. "&", qualifier from a type. More...
class | Rgba8
| 8-bit red, green, blue, alpha packed into 32 bit unsigned int More...
struct | RootData
| Struct with all the member data of the RootNode (useful during serialization of an openvdb RootNode) More...
class | RootNode
| Top-most node of the VDB tree structure. More...
class | SampleFromVoxels
class | SampleFromVoxels< TreeOrAccT, 0, false >
| Nearest neighbor, i.e. zero order, interpolator without caching. More...
class | SampleFromVoxels< TreeOrAccT, 0, true >
| Nearest neighbor, i.e. zero order, interpolator with caching. More...
class | SampleFromVoxels< TreeOrAccT, 1, false >
| Template specialization that does not use caching of stencil points. More...
class | SampleFromVoxels< TreeOrAccT, 1, true >
| Template specialization with caching of stencil values. More...
class | SampleFromVoxels< TreeOrAccT, 2, false >
| Template specialization that does not use caching of stencil points. More...
class | SampleFromVoxels< TreeOrAccT, 2, true >
| Template specialization with caching of stencil values. More...
class | SampleFromVoxels< TreeOrAccT, 3, false >
class | SampleFromVoxels< TreeOrAccT, 3, true >
struct | SetValue
struct | SetVoxel
class | Split
class | Stats
class | Stats< ValueT, 0 >
| This class computes statistics (minimum value, maximum value, mean, variance and standard deviation) of a population of floating-point values. More...
class | Stats< ValueT, 1 >
| This class computes statistics (minimum value, maximum value, mean, variance and standard deviation) of a population of floating-point values. More...
struct | TensorTraits
struct | TensorTraits< T, 0 >
struct | TensorTraits< T, 1 >
struct | Tolerance
| Tolerance for floating-point comparison. More...
struct | Tolerance< double >
struct | Tolerance< float >
class | Tree
| VDB Tree, which is a thin wrapper around a RootNode. More...
struct | TreeData
class | TreeMarcher
| A Tree Marcher for Generic Grids. More...
class | TricubicSampler
| Tri-cubic sampler, i.e. third order, interpolator. More...
class | TrilinearSampler
| Tri-linear sampler, i.e. first order, interpolator. More...
class | TriquadraticSampler
| Tri-quadratic sampler, i.e. second order, interpolator. More...
class | ValueIndex
| Dummy type for a voxel whose value equals an offset into an external value array. More...
class | ValueIndexMask
| Like `ValueIndex` but with a mutable mask. More...
class | ValueMask
| Dummy type for a voxel whose value equals its binary active state. More...
class | ValueOnIndex
| Dummy type for a voxel whose value equals an offset into an external value array of active values. More...
class | ValueOnIndexMask
| Like `ValueOnIndex` but with a mutable mask. More...
class | Vec3
| A simple vector class with three components, similar to openvdb::math::Vec3. More...
class | Vec4
| A simple vector class with four components, similar to openvdb::math::Vec4. More...
class | Version
| Bit-compacted representation of all three version numbers. More...
class | WenoStencil
| This is a special 19-point stencil that supports optimal fifth-order WENO upwinding, second-order central differencing, Laplacian, and zero-crossing test. More...

## Typedefs

using | Vec3d = Vec3< double >
using | Vec3f = Vec3< float >
using | Vec3i = Vec3< int32_t >
using | Vec3u = Vec3< uint32_t >
using | Vec3u8 = Vec3< uint8_t >
using | Vec3u16 = Vec3< uint16_t >
using | Vec4R = Vec4< double >
using | Vec4d = Vec4< double >
using | Vec4f = Vec4< float >
using | Vec4i = Vec4< int >
using | PackedRGBA8 = Rgba8
using | CoordBBox = BBox< Coord >
using | BBoxR = BBox< Vec3d >
template<typename BuildT >
using | DefaultReadAccessor = ReadAccessor< BuildT, 0, 1, 2 >
template<typename BuildT >
using | NanoLeaf = LeafNode< BuildT, Coord, Mask, 3 >
| Template specializations to the default configuration used in OpenVDB: Root -> 32^3 -> 16^3 -> 8^3.
template<typename BuildT >
using | NanoLower = InternalNode< NanoLeaf< BuildT >, 4 >
template<typename BuildT >
using | NanoUpper = InternalNode< NanoLower< BuildT >, 5 >
template<typename BuildT >
using | NanoRoot = RootNode< NanoUpper< BuildT > >
template<typename BuildT >
using | NanoTree = Tree< NanoRoot< BuildT > >
template<typename BuildT >
using | NanoGrid = Grid< NanoTree< BuildT > >
using | FloatTree = NanoTree< float >
using | Fp4Tree = NanoTree< Fp4 >
using | Fp8Tree = NanoTree< Fp8 >
using | Fp16Tree = NanoTree< Fp16 >
using | FpNTree = NanoTree< FpN >
using | DoubleTree = NanoTree< double >
using | Int32Tree = NanoTree< int32_t >
using | UInt32Tree = NanoTree< uint32_t >
using | Int64Tree = NanoTree< int64_t >
using | Vec3fTree = NanoTree< Vec3f >
using | Vec3dTree = NanoTree< Vec3d >
using | Vec4fTree = NanoTree< Vec4f >
using | Vec4dTree = NanoTree< Vec4d >
using | Vec3ITree = NanoTree< Vec3i >
using | MaskTree = NanoTree< ValueMask >
using | BoolTree = NanoTree< bool >
using | IndexTree = NanoTree< ValueIndex >
using | OnIndexTree = NanoTree< ValueOnIndex >
using | IndexMaskTree = NanoTree< ValueIndexMask >
using | OnIndexMaskTree = NanoTree< ValueOnIndexMask >
using | FloatGrid = Grid< FloatTree >
using | Fp4Grid = Grid< Fp4Tree >
using | Fp8Grid = Grid< Fp8Tree >
using | Fp16Grid = Grid< Fp16Tree >
using | FpNGrid = Grid< FpNTree >
using | DoubleGrid = Grid< DoubleTree >
using | Int32Grid = Grid< Int32Tree >
using | UInt32Grid = Grid< UInt32Tree >
using | Int64Grid = Grid< Int64Tree >
using | Vec3fGrid = Grid< Vec3fTree >
using | Vec3dGrid = Grid< Vec3dTree >
using | Vec4fGrid = Grid< Vec4fTree >
using | Vec4dGrid = Grid< Vec4dTree >
using | Vec3IGrid = Grid< Vec3ITree >
using | MaskGrid = Grid< MaskTree >
using | BoolGrid = Grid< BoolTree >
using | PointGrid = Grid< Point >
using | IndexGrid = Grid< IndexTree >
using | OnIndexGrid = Grid< OnIndexTree >
using | IndexMaskGrid = Grid< IndexMaskTree >
using | OnIndexMaskGrid = Grid< OnIndexMaskTree >
using | Range1D = Range< 1, size_t >
using | Range2D = Range< 2, size_t >
using | Range3D = Range< 3, size_t >

## Enumerations

enum class | GridType : uint32_t { Unknown = 0 , Float = 1 , Double = 2 , Int16 = 3 , Int32 = 4 , Int64 = 5 , Vec3f = 6 , Vec3d = 7 , Mask = 8 , Half = 9 , UInt32 = 10 , Boolean = 11 , RGBA8 = 12 , Fp4 = 13 , Fp8 = 14 , Fp16 = 15 , FpN = 16 , Vec4f = 17 , Vec4d = 18 , Index = 19 , OnIndex = 20 , IndexMask = 21 , OnIndexMask = 22 , PointIndex = 23 , Vec3u8 = 24 , Vec3u16 = 25 , End = 26 }
| List of types that are currently supported by NanoVDB. More...
enum class | GridClass : uint32_t { Unknown = 0 , LevelSet = 1 , FogVolume = 2 , Staggered = 3 , PointIndex = 4 , PointData = 5 , Topology = 6 , VoxelVolume = 7 , IndexGrid = 8 , TensorGrid = 9 , End = 10 }
| Classes (superset of OpenVDB) that are currently supported by NanoVDB. More...
enum class | GridFlags : uint32_t { HasLongGridName = 1 << 0 , HasBBox = 1 << 1 , HasMinMax = 1 << 2 , HasAverage = 1 << 3 , HasStdDeviation = 1 << 4 , IsBreadthFirst = 1 << 5 , End = 1 << 6 }
| Grid flags which indicate what extra information is present in the grid buffer. More...
enum class | GridBlindDataClass : uint32_t { Unknown = 0 , IndexArray = 1 , AttributeArray = 2 , GridName = 3 , ChannelArray = 4 , End = 5 }
| Blind-data Classes that are currently supported by NanoVDB. More...
enum class | GridBlindDataSemantic : uint32_t { Unknown = 0 , PointPosition = 1 , PointColor = 2 , PointNormal = 3 , PointRadius = 4 , PointVelocity = 5 , PointId = 6 , WorldCoords = 7 , GridCoords = 8 , VoxelCoords = 9 , End = 10 }
| Blind-data Semantics that are currently understood by NanoVDB. More...
enum class | ChecksumMode : uint32_t { Disable = 0 , Partial = 1 , Full = 2 , Default = 1 , End = 3 }
| List of different modes for computing for a checksum. More...
enum class | StatsMode : uint32_t { Disable = 0 , BBox = 1 , MinMax = 2 , All = 3 , Default = 3 , End = 4 }
| Grid flags which indicate what extra information is present in the grid buffer. More...

## Functions

const char * | toStr (GridType gridType)
| Maps a GridType to a c-string.
const char * | toStr (GridClass gridClass)
| Retuns a c-string used to describe a GridClass.
const char * | toStr (GridFlags gridFlags)
| Retuns a c-string used to describe a GridFlags.
static bool | isAligned (const void *p)
| return true if the specified pointer is aligned
static bool | isValid (const void *p)
| return true if the specified pointer is aligned and not NULL
static uint64_t | alignmentPadding (const void *p)
| return the smallest number of bytes that when added to the specified pointer results in an aligned pointer
template<typename T >
static T * | alignPtr (T *p)
| offset the specified pointer so it is aligned.
template<typename T >
static const T * | alignPtr (const T *p)
| offset the specified pointer so it is aligned.
template<typename T1 , typename T2 >
static int64_t | PtrDiff (const T1 *p, const T2 *q)
| Compute the distance, in bytes, between two pointers.
template<typename DstT , typename SrcT >
static DstT * | PtrAdd (SrcT *p, int64_t offset)
| Adds a byte offset of a non-const pointer to produce another non-const pointer.
template<typename DstT , typename SrcT >
static const DstT * | PtrAdd (const SrcT *p, int64_t offset)
| Adds a byte offset of a const pointer to produce another const pointer.
bool | isFloatingPoint (GridType gridType)
| return true if the GridType maps to a floating point type
bool | isFloatingPointVector (GridType gridType)
| return true if the GridType maps to a floating point vec3.
bool | isInteger (GridType gridType)
| Return true if the GridType maps to a POD integer type.
bool | isIndex (GridType gridType)
| Return true if the GridType maps to a special index type (not a POD integer type).
static void * | memcpy64 (void *dst, const void *src, size_t word_count)
| copy 64 bit words from `src` to `dst`
bool | isValid (GridType gridType, GridClass gridClass)
| return true if the combination of GridType and GridClass is valid.
bool | isValid (const GridBlindDataClass &blindClass, const GridBlindDataSemantic &blindSemantics, const GridType &blindType)
| return true if the combination of GridBlindDataClass, GridBlindDataSemantic and GridType is valid.
template<typename T >
constexpr T | pi ()
| Pi constant taken from Boost to match old behaviour.
template<>
constexpr float | pi ()
template<>
constexpr double | pi ()
template<>
constexpr long double | pi ()
template<typename Type >
bool | isApproxZero (const Type &x)
template<typename Type >
Type | Min (Type a, Type b)
int32_t | Min (int32_t a, int32_t b)
uint32_t | Min (uint32_t a, uint32_t b)
float | Min (float a, float b)
double | Min (double a, double b)
template<typename Type >
Type | Max (Type a, Type b)
int32_t | Max (int32_t a, int32_t b)
uint32_t | Max (uint32_t a, uint32_t b)
float | Max (float a, float b)
double | Max (double a, double b)
float | Clamp (float x, float a, float b)
double | Clamp (double x, double a, double b)
float | Fract (float x)
double | Fract (double x)
int32_t | Floor (float x)
int32_t | Floor (double x)
int32_t | Ceil (float x)
int32_t | Ceil (double x)
template<typename T >
T | Pow2 (T x)
template<typename T >
T | Pow3 (T x)
template<typename T >
T | Pow4 (T x)
template<typename T >
T | Abs (T x)
template<>
float | Abs (float x)
template<>
double | Abs (double x)
template<>
int | Abs (int x)
template<typename CoordT , typename RealT , template< typename > class Vec3T>
CoordT | Round (const Vec3T< RealT > &xyz)
template<typename CoordT , template< typename > class Vec3T>
CoordT | Round (const Vec3T< float > &xyz)
template<typename CoordT , template< typename > class Vec3T>
CoordT | Round (const Vec3T< double > &xyz)
template<typename CoordT , typename RealT , template< typename > class Vec3T>
CoordT | RoundDown (const Vec3T< RealT > &xyz)
float | Sqrt (float x)
| Return the square root of a floating-point value.
double | Sqrt (double x)
template<typename T >
T | Sign (const T &x)
| Return the sign of the given value as an integer (either -1, 0 or 1).
template<typename Vec3T >
int | MinIndex (const Vec3T &v)
template<typename Vec3T >
int | MaxIndex (const Vec3T &v)
template<uint64_t wordSize>
uint64_t | AlignUp (uint64_t byteCount)
| round up byteSize to the nearest wordSize, e.g. to align to machine word: AlignUp<sizeof(size_t)(n)
template<typename T1 , typename T2 >
Vec3< T2 > | operator* (T1 scalar, const Vec3< T2 > &vec)
template<typename T1 , typename T2 >
Vec3< T2 > | operator/ (T1 scalar, const Vec3< T2 > &vec)
template<typename T1 , typename T2 >
Vec4< T2 > | operator* (T1 scalar, const Vec4< T2 > &vec)
template<typename T1 , typename T2 >
Vec4< T2 > | operator/ (T1 scalar, const Vec4< T2 > &vec)
template<typename BuildT >
GridType | mapToGridType ()
| Maps from a templated build type to a GridType enum.
template<typename BuildT >
GridClass | mapToGridClass (GridClass defaultClass=GridClass::Unknown)
| Maps from a templated build type to a GridClass enum.
template<typename Vec3T >
Vec3T | matMult (const float *mat, const Vec3T &xyz)
| Multiply a 3x3 matrix and a 3d vector using 32bit floating point arithmetics.
template<typename Vec3T >
Vec3T | matMult (const double *mat, const Vec3T &xyz)
| Multiply a 3x3 matrix and a 3d vector using 64bit floating point arithmetics.
template<typename Vec3T >
Vec3T | matMult (const float *mat, const float *vec, const Vec3T &xyz)
| Multiply a 3x3 matrix to a 3d vector and add another 3d vector using 32bit floating point arithmetics.
template<typename Vec3T >
Vec3T | matMult (const double *mat, const double *vec, const Vec3T &xyz)
| Multiply a 3x3 matrix to a 3d vector and add another 3d vector using 64bit floating point arithmetics.
template<typename Vec3T >
Vec3T | matMultT (const float *mat, const Vec3T &xyz)
| Multiply the transposed of a 3x3 matrix and a 3d vector using 32bit floating point arithmetics.
template<typename Vec3T >
Vec3T | matMultT (const double *mat, const Vec3T &xyz)
| Multiply the transposed of a 3x3 matrix and a 3d vector using 64bit floating point arithmetics.
template<typename Vec3T >
Vec3T | matMultT (const float *mat, const float *vec, const Vec3T &xyz)
template<typename Vec3T >
Vec3T | matMultT (const double *mat, const double *vec, const Vec3T &xyz)
static uint32_t | FindLowestOn (uint32_t v)
| Returns the index of the lowest, i.e. least significant, on bit in the specified 32 bit word.
static uint32_t | FindHighestOn (uint32_t v)
| Returns the index of the highest, i.e. most significant, on bit in the specified 32 bit word.
static uint32_t | FindLowestOn (uint64_t v)
| Returns the index of the lowest, i.e. least significant, on bit in the specified 64 bit word.
static uint32_t | FindHighestOn (uint64_t v)
| Returns the index of the highest, i.e. most significant, on bit in the specified 64 bit word.
uint32_t | CountOn (uint64_t v)
template<int LEVEL0 = -1, int LEVEL1 = -1, int LEVEL2 = -1, typename ValueT = float>
ReadAccessor< ValueT, LEVEL0, LEVEL1, LEVEL2 > | createAccessor (const NanoGrid< ValueT > &grid)
| Free-standing function for convenient creation of a ReadAccessor with optional and customizable node caching.
template<int LEVEL0 = -1, int LEVEL1 = -1, int LEVEL2 = -1, typename ValueT = float>
ReadAccessor< ValueT, LEVEL0, LEVEL1, LEVEL2 > | createAccessor (const NanoTree< ValueT > &tree)
template<int LEVEL0 = -1, int LEVEL1 = -1, int LEVEL2 = -1, typename ValueT = float>
ReadAccessor< ValueT, LEVEL0, LEVEL1, LEVEL2 > | createAccessor (const NanoRoot< ValueT > &root)
template<typename SrcGridT , typename DstBuildT = typename MapToNano<typename SrcGridT::BuildType>::type, typename BufferT = HostBuffer>
disable_if< BuildTraits< DstBuildT >::is_index||BuildTraits< DstBuildT >::is_Fp, GridHandle< BufferT > >::type | createNanoGrid (const SrcGridT &srcGrid, StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, int verbose=0, const BufferT &buffer=BufferT())
| Freestanding function that creates a NanoGrid<T> from any source grid.
template<typename SrcGridT , typename DstBuildT = typename MapToNano<typename SrcGridT::BuildType>::type, typename BufferT = HostBuffer>
enable_if< BuildTraits< DstBuildT >::is_index, GridHandle< BufferT > >::type | createNanoGrid (const SrcGridT &srcGrid, uint32_t channels=0u, bool includeStats=true, bool includeTiles=true, int verbose=0, const BufferT &buffer=BufferT())
| Freestanding function that creates a NanoGrid<ValueIndex> or NanoGrid<ValueOnIndex> from any source grid.
template<typename SrcGridT , typename DstBuildT = typename MapToNano<typename SrcGridT::BuildType>::type, typename OracleT = AbsDiff, typename BufferT = HostBuffer>
enable_if< is_same< FpN, DstBuildT >::value, GridHandle< BufferT > >::type | createNanoGrid (const SrcGridT &srcGrid, StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, bool ditherOn=false, int verbose=0, const OracleT &oracle=OracleT(), const BufferT &buffer=BufferT())
| Freestanding function to create a NanoGrid<FpN> from any source grid.
template<typename SrcGridT , typename DstBuildT = typename MapToNano<typename SrcGridT::BuildType>::type, typename BufferT = HostBuffer>
enable_if< BuildTraits< DstBuildT >::is_FpX, GridHandle< BufferT > >::type | createNanoGrid (const SrcGridT &srcGrid, StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, bool ditherOn=false, int verbose=0, const BufferT &buffer=BufferT())
| Freestanding function to create a NanoGrid<FpX> from any source grid, X=4,8,16.
std::ostream & | operator<< (std::ostream &os, const AbsDiff &diff)
std::ostream & | operator<< (std::ostream &os, const RelDiff &diff)
template<typename RangeT , typename FuncT >
void | forEach (RangeT range, const FuncT &func)
| simple wrapper for tbb::parallel_for with a naive std fallback
template<typename FuncT >
void | forEach (size_t begin, size_t end, size_t grainSize, const FuncT &func)
| Simple wrapper for the function defined above.
template<template< typename... > class ContainerT, typename... T, typename FuncT >
void | forEach (const ContainerT< T... > &c, const FuncT &func)
| Simple wrapper for the function defined above, which works with std::containers.
template<template< typename... > class ContainerT, typename... T, typename FuncT >
void | forEach (const ContainerT< T... > &c, size_t grainSize, const FuncT &func)
| Simple wrapper for the function defined above, which works with std::containers.
template<typename BuildT >
uint64_t | checksum (const NanoGrid< BuildT > &grid, ChecksumMode mode=ChecksumMode::Default)
| Return the (2 x CRC32) checksum of the specified grid.
template<typename BuildT >
bool | validateChecksum (const NanoGrid< BuildT > &grid, ChecksumMode mode=ChecksumMode::Default)
| Return true if the checksum of the grid matches the expected value already encoded into the grid's meta data.
template<typename BuildT >
void | updateChecksum (NanoGrid< BuildT > &grid, ChecksumMode mode=ChecksumMode::Default)
| Updates the checksum of a grid.
template<typename ValueT >
uint64_t | checksum (const NanoGrid< ValueT > &grid, ChecksumMode mode)
template<typename ValueT >
bool | validateChecksum (const NanoGrid< ValueT > &grid, ChecksumMode mode)
template<typename ValueT >
void | updateChecksum (NanoGrid< ValueT > &grid, ChecksumMode mode)
bool | updateChecksum (GridData &gridData, ChecksumMode mode)
bool | updateChecksum (GridData *data)
| Preserve the existing mode of the checksum and update it if it's not disabled.
bool | updateGridCount (GridData *data, uint32_t gridIndex, uint32_t gridCount)
| Updates the ground index and count, as well as the partial checksum if needed.
template<typename BufferT , template< class, class... > class VectorT = std::vector>
VectorT< GridHandle< BufferT > > | splitGrids (const GridHandle< BufferT > &handle, const BufferT *other=nullptr)
| Split all grids in a single GridHandle into a vector of multiple GridHandles each with a single grid.
template<typename BufferT , template< class, class... > class VectorT>
GridHandle< BufferT > | mergeGrids (const VectorT< GridHandle< BufferT > > &handles, const BufferT *pool=nullptr)
| Combines (or merges) multiple GridHandles into a single GridHandle containing all grids.
template<typename BuildT >
void | gridStats (NanoGrid< BuildT > &grid, StatsMode mode=StatsMode::Default)
| Re-computes the min/max, stats and bbox information for an existing NanoVDB Grid.
template<typename BuildT >
Extrema< typename NanoGrid< BuildT >::ValueType > | getExtrema (const NanoGrid< BuildT > &grid, const CoordBBox &bbox)
| return the extrema of all the values in a grid that intersects the specified bounding box.
template<typename ValueT >
bool | isValid (const NanoGrid< ValueT > &grid, bool detailed=true, bool verbose=false)
| Return true if the specified grid passes several validation tests.
template<typename RayT , typename AccT >
__hostdev__ bool | ZeroCrossing (RayT &ray, AccT &acc, Coord &ijk, typename AccT::ValueType &v, float &t)

returns true if the ray intersects a zero-crossing at the voxel level of the grid in the accessor The empty-space ray-marching is performed at all levels of the tree using an HDDA. If an intersection is detected, then ijk is updated with the index coordinate of the closest voxel after the intersection point, v contains the grid values at ijk, and t is set to the time of the intersection along the ray.

template<typename RayT , typename NodeT >
__hostdev__ bool | ZeroCrossingNode (RayT &ray, const NodeT &node, float v0, nanovdb::Coord &ijk, float &v, float &t)
template<typename RayT , typename AccT >
__hostdev__ bool | firstActive (RayT &ray, AccT &acc, Coord &ijk, float &t)
| returns true if the ray intersects an active value at any level of the grid in the accessor. The empty-space ray-marching is performed at all levels of the tree using an HDDA. If an intersection is detected, then ijk is updated with the index coordinate of the first active voxel or tile, and t is set to the time of its intersection along the ray.
template<typename Func , typename... Rest>
int | invoke (const Func &taskFunc1, Rest... taskFuncN)
template<typename T >
std::ostream & | operator<< (std::ostream &os, const BBox< Vec3< T > > &b)
std::ostream & | operator<< (std::ostream &os, const CoordBBox &b)
std::ostream & | operator<< (std::ostream &os, const Coord &ijk)
template<typename T >
std::ostream & | operator<< (std::ostream &os, const Vec3< T > &v)
template<typename T >
std::ostream & | operator<< (std::ostream &os, const Vec4< T > &v)
template<typename NanoBuildT >
openvdb::Grid< typenameopenvdb::tree::Tree4< typenameConvertTrait< NanoBuildT >::Type >::Type >::Ptr | nanoToOpenVDB (const NanoGrid< NanoBuildT > &grid, int verbose=0)
| Forward declaration of free-standing function that de-serializes a typed NanoVDB grid into an OpenVDB Grid.
template<typename BufferT >
openvdb::GridBase::Ptr | nanoToOpenVDB (const GridHandle< BufferT > &handle, int verbose=0, uint32_t n=0)
| Forward declaration of free-standing function that de-serializes a NanoVDB GridHandle into an OpenVDB GridBase.
template<typename BuildT , typename BufferT = HostBuffer>
NodeManagerHandle< BufferT > | createNodeManager (const NanoGrid< BuildT > &grid, const BufferT &buffer=BufferT())
| brief Construct a NodeManager and return its handle
template<typename T , typename OpT = std::plus<T>>
T | prefixSum (std::vector< T > &vec, bool threaded=true, OpT op=OpT())
| Computes inclusive prefix sum of a vector.
template<typename T , typename Op >
void | inclusiveScan (T *array, size_t size, const T &identity, bool threaded, Op op)
| An inclusive scan includes in[i] when computing out[i].
template<typename BuildT = float, typename BufferT = HostBuffer>

enable_if< is_same< float, BuildT >::value||is_same< double, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetSphere (double radius=100.0, const Vec3d &center=Vec3d(0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0), const std::string &name="sphere_ls", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, const BufferT &buffer=BufferT())

| Returns a handle to a narrow-band level set of a sphere.
template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< Fp4, BuildT >::value||is_same< Fp8, BuildT >::value||is_same< Fp16, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetSphere (double radius=100.0, const Vec3d &center=Vec3d(0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0), const std::string &name="sphere_ls", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, bool ditherOn=false, const BufferT &buffer=BufferT())

template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetSphere (double radius=100.0, const Vec3d &center=Vec3d(0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0), const std::string &name="sphere_ls_FpN", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())

template<typename BuildT = float, typename BufferT = HostBuffer>
disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type | createFogVolumeSphere (double radius=100.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="sphere_fog", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, const BufferT &buffer=BufferT())
| Returns a handle to a sparse fog volume of a sphere such that the exterior is 0 and inactive, the interior is active with values varying smoothly from 0 at the surface of the sphere to 1 at the halfWidth and interior of the sphere.
template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createFogVolumeSphere (double radius=100.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="sphere_fog", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())

template<typename BuildT = float, typename BufferT = HostBuffer>
disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type | createPointSphere (int pointsPerVoxel=1, double radius=100.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="sphere_points", ChecksumMode mode=ChecksumMode::Default, const BufferT &buffer=BufferT())
| Returns a handle to a PointDataGrid containing points scattered on the surface of a sphere.
template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetTorus (double majorRadius=100.0, double minorRadius=50.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="torus_ls", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, const BufferT &buffer=BufferT())

| Returns a handle to a narrow-band level set of a torus in the xz-plane.
template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetTorus (double majorRadius=100.0, double minorRadius=50.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="torus_ls", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())

template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createFogVolumeTorus (double majorRadius=100.0, double minorRadius=50.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="torus_fog", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, const BufferT &buffer=BufferT())

| Returns a handle to a sparse fog volume of a torus in the xz-plane such that the exterior is 0 and inactive, the interior is active with values varying smoothly from 0 at the surface of the torus to 1 at the halfWidth and interior of the torus.
template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createFogVolumeTorus (double majorRadius=100.0, double minorRadius=50.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="torus_fog_FpN", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())

template<typename BuildT = float, typename BufferT = HostBuffer>
disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type | createPointTorus (int pointsPerVoxel=1, double majorRadius=100.0, double minorRadius=50.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, const Vec3d &origin=Vec3d(0.0f), const std::string &name="torus_points", ChecksumMode cMode=ChecksumMode::Default, const BufferT &buffer=BufferT())
| Returns a handle to a PointDataGrid containing points scattered on the surface of a torus.
template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetBox (double width=40.0, double height=60.0, double depth=100.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="box_ls", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, const BufferT &buffer=BufferT())

| Returns a handle to a narrow-band level set of a box.
template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetBox (double width=40.0, double height=60.0, double depth=100.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="box_ls_FpN", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())

template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createFogVolumeBox (double width=40.0, double height=60.0, double depth=100.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="box_fog", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, const BufferT &buffer=BufferT())

| Returns a handle to a sparse fog volume of a box such that the exterior is 0 and inactive, the interior is active with values varying smoothly from 0 at the surface of the box to 1 at the halfWidth and interior of the box.
template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createFogVolumeBox (double width=40.0, double height=60.0, double depth=100.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="box_fog_FpN", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())

template<typename BuildT = float, typename BufferT = HostBuffer>
disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type | createLevelSetOctahedron (double scale=100.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="octadedron_ls", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, const BufferT &buffer=BufferT())
| Returns a handle to a narrow-band level set of a octahedron.
template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetOctahedron (double scale=100.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="octadedron_ls_FpN", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())

template<typename BuildT = float, typename BufferT = HostBuffer>
disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type | createFogVolumeOctahedron (double scale=100.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="octadedron_fog", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, const BufferT &buffer=BufferT())
| Returns a handle to a sparse fog volume of an octahedron such that the exterior is 0 and inactive, the interior is active with values varying smoothly from 0 at the surface of the octahedron to 1 at the halfWidth and interior of the octahedron.
template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createFogVolumeOctahedron (double scale=100.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="octadedron_fog_FpN", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())

template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetBBox (double width=40.0, double height=60.0, double depth=100.0, double thickness=10.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="bbox_ls", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, const BufferT &buffer=BufferT())

| Returns a handle to a narrow-band level set of a bounding-box (= wireframe of a box)
template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type

createLevelSetBBox (double width=40.0, double height=60.0, double depth=100.0, double thickness=10.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, double halfWidth=3.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="bbox_ls_FpN", StatsMode sMode=StatsMode::Default, ChecksumMode cMode=ChecksumMode::Default, float tolerance=-1.0f, bool ditherOn=false, const BufferT &buffer=BufferT())

template<typename BuildT = float, typename BufferT = HostBuffer>
disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type | createPointBox (int pointsPerVoxel=1, double width=40.0, double height=60.0, double depth=100.0, const Vec3d &center=Vec3d(0.0), double voxelSize=1.0, const Vec3d &origin=Vec3d(0.0), const std::string &name="box_points", ChecksumMode mode=ChecksumMode::Default, const BufferT &buffer=BufferT())
| Returns a handle to a PointDataGrid containing points scattered on the surface of a box.
template<typename SrcBuildT = float, typename BufferT = HostBuffer>
GridHandle< BufferT > | createPointScatter (const NanoGrid< SrcBuildT > &srcGrid, int pointsPerVoxel=1, const std::string &name="point_scatter", ChecksumMode mode=ChecksumMode::Default, const BufferT &buffer=BufferT())
| Given an input NanoVDB voxel grid this methods returns a GridHandle to another NanoVDB PointDataGrid with points scattered in the active leaf voxels of in input grid. Note, the coordinates of the points are encoded as blind data in world-space.
template<typename RangeT , typename T , typename FuncT , typename JoinT >
T | reduce (RangeT range, const T &identity, const FuncT &func, const JoinT &join)
template<typename T , typename FuncT , typename JoinT >
T | reduce (size_t begin, size_t end, size_t grainSize, const T &identity, const FuncT &func, const JoinT &join)
| Simple wrapper to the function defined above.
template<template< typename... > class ContainerT, typename... ArgT, typename T , typename FuncT , typename JoinT >
T | reduce (const ContainerT< ArgT... > &c, const T &identity, const FuncT &func, const JoinT &join)
| Simple wrapper that works with std::containers.
template<template< typename... > class ContainerT, typename... ArgT, typename T , typename FuncT , typename JoinT >
T | reduce (const ContainerT< ArgT... > &c, size_t grainSize, const T &identity, const FuncT &func, const JoinT &join)
| Simple wrapper that works with std::containers.
template<int Order, typename TreeOrAccT , bool UseCache = true>
SampleFromVoxels< TreeOrAccT, Order, UseCache > | createSampler (const TreeOrAccT &acc)
| Factory free-function for a sampler of specific polynomial orders.
template<typename CoordT , typename RealT , template< typename > class Vec3T>
CoordT | Floor (Vec3T< RealT > &xyz)
| Utility function that returns the Coord of the round-down of xyz and redefined (x,&nbsp y,&nbsp z) as the fractional part, ie xyz-in = return-value + xyz-out.
template<typename CoordT , template< typename > class Vec3T>
CoordT | Floor (Vec3T< float > &xyz)
| Template specialization of Floor for Vec3<float>
template<typename CoordT , template< typename > class Vec3T>
CoordT | Floor (Vec3T< double > &xyz)
| Template specialization of Floor for Vec3<float>
template<typename ValueType , typename RealT = ValueType>
__hostdev__ ValueType | WENO5 (const ValueType &v1, const ValueType &v2, const ValueType &v3, const ValueType &v4, const ValueType &v5, RealT scale2=1.0)
| Implementation of nominally fifth-order finite-difference WENO.
template<typename RealT >
__hostdev__ RealT | GodunovsNormSqrd (bool isOutside, RealT dP_xm, RealT dP_xp, RealT dP_ym, RealT dP_yp, RealT dP_zm, RealT dP_zp)
template<typename RealT >
__hostdev__ RealT | GodunovsNormSqrd (bool isOutside, const Vec3< RealT > &gradient_m, const Vec3< RealT > &gradient_p)

## Detailed Description

Convert a base-pointer to an openvdb grid, denoted srcGrid, to a nanovdb grid of the same type, e.g. float -> float or openvdb::Vec3f -> nanovdb::Vec3f.

    \file CreateNanoGrid.h

    \author Ken Museth

    \date June 26, 2020

    \note In the examples below we assume that @c srcGrid is a exiting grid of type
          SrcGridT = @c openvdb::FloatGrid, @c openvdb::FloatGrid or @c nanovdb::build::FloatGrid.

    \brief Convert any grid to a nanovdb grid of the same type, e.g. float->float
    \code
    auto handle = nanovdb::createNanoGrid(srcGrid);
    auto *dstGrid = handle.grid<float>();
    \endcode

    \brief Convert a grid to a nanovdb grid of a different type, e.g. float->half
    \code
    auto handle = nanovdb::createNanoGrid<SrcGridT,nanovdb::Fp16>(srcGrid);
    auto *dstGrid = handle.grid<nanovdb::Fp16>();
    \endcode

    \brief Convert a grid to a nanovdb grid of the same type but using a CUDA buffer
    \code
    auto handle = nanovdb::createNanoGrid<SrcGridT, float, nanovdb::CudaDeviceBuffer>(srcGrid);
    auto *dstGrid = handle.grid<float>();
    \endcode

    \brief Create a nanovdb grid that indices values in an existing source grid of any type.
           If DstBuildT = nanovdb::ValueIndex both active and in-active values are indexed
           and if DstBuildT = nanovdb::ValueOnIndex only active values are indexed.
    \code
    using DstBuildT = nanovdb::ValueIndex;// index both active an inactive values
    auto handle = nanovdb::createNanoGridSrcGridT,DstBuildT>(srcGrid,0,false,false);//no blind data, tile values or stats
    auto *dstGrid = handle.grid<DstBuildT>();
    \endcode

    \brief Create a NanoVDB grid from scratch
    \code

#if defined(NANOVDB_USE_OPENVDB) && !defined(CUDACC) using SrcGridT = openvdb::FloatGrid; #else using SrcGridT = nanovdb::build::FloatGrid; #endif SrcGridT srcGrid(0.0f);// create an empty source grid auto srcAcc = srcGrid.getAccessor();// create an accessor srcAcc.setValue(nanovdb::Coord(1,2,3), 1.0f);// set a voxel value

auto handle = nanovdb::createNanoGrid(srcGrid);// convert source grid to a grid handle auto dstGrid = handle.grid<float>();// get a pointer to the destination grid

auto handle = nanovdb::openToNanoVDB(*srcGrid);// convert source grid to a grid handle
auto dstGrid = handle.grid<float>();// get a pointer to the destination grid

Converts any existing grid to a NanoVDB grid, for example: nanovdb::build::Grid<SrcBuildT> -> nanovdb::Grid<DstBuildT> nanovdb::Grid<SrcBuildT> -> nanovdb::Grid<DstBuildT> nanovdb::Grid<SrcBuildT> -> nanovdb::Grid<ValueIndex or ValueOnIndex> openvdb::Grid<SrcBuildT> -> nanovdb::Grid<DstBuildT> openvdb::Grid<PointIndex> -> nanovdb::Grid<PointIndex> openvdb::Grid<PointData> -> nanovdb::Grid<PointData> openvdb::Grid<SrcBuildT> -> nanovdb::Grid<ValueIndex or ValueOnIndex>

Note
  This files replaces GridBuilder.h, IndexGridBuilder.h and OpenToNanoVDB.h

    \file IO.h

    \author Ken Museth

    \date May 1, 2020

    \brief Implements I/O for NanoVDB grids. Features optional BLOSC and ZIP
           file compression, support for multiple grids per file as well as
           multiple grid types.

    \note  This file does NOT depend on OpenVDB, but optionally on ZIP and BLOSC

    \details NanoVDB files take on of two formats:
             1) multiple segments each with multiple grids (segments have easy to access metadata about its grids)
             2) starting with verion 32.6.0 nanovdb files also support a raw buffer with one or more grids (just a
             dump of a raw grid buffer, so no new metadata).

1: Segment: FileHeader, MetaData0, gridName0...MetaDataN, gridNameN, compress Grid0,...compressed GridN 2: Raw: Grid0,...GridN

## Typedef Documentation

## BBoxR

using BBoxR = BBox<Vec3d>

## BoolGrid

using BoolGrid = Grid<BoolTree>

## BoolTree

using BoolTree = NanoTree<bool>

## CoordBBox

using CoordBBox = BBox<Coord>

## DefaultReadAccessor

template<typename BuildT >

using DefaultReadAccessor = ReadAccessor<BuildT, 0, 1, 2>

## DoubleGrid

using DoubleGrid = Grid<DoubleTree>

## DoubleTree

using DoubleTree = NanoTree<double>

## FloatGrid

using FloatGrid = Grid<FloatTree>

## FloatTree

using FloatTree = NanoTree<float>

## Fp16Grid

using Fp16Grid = Grid<Fp16Tree>

## Fp16Tree

using Fp16Tree = NanoTree<Fp16>

## Fp4Grid

using Fp4Grid = Grid<Fp4Tree>

## Fp4Tree

using Fp4Tree = NanoTree<Fp4>

## Fp8Grid

using Fp8Grid = Grid<Fp8Tree>

## Fp8Tree

using Fp8Tree = NanoTree<Fp8>

## FpNGrid

using FpNGrid = Grid<FpNTree>

## FpNTree

using FpNTree = NanoTree<FpN>

## IndexGrid

using IndexGrid = Grid<IndexTree>

## IndexMaskGrid

using IndexMaskGrid = Grid<IndexMaskTree>

## IndexMaskTree

using IndexMaskTree = NanoTree<ValueIndexMask>

## IndexTree

using IndexTree = NanoTree<ValueIndex>

## Int32Grid

using Int32Grid = Grid<Int32Tree>

## Int32Tree

using Int32Tree = NanoTree<int32_t>

## Int64Grid

using Int64Grid = Grid<Int64Tree>

## Int64Tree

using Int64Tree = NanoTree<int64_t>

## MaskGrid

using MaskGrid = Grid<MaskTree>

## MaskTree

using MaskTree = NanoTree<ValueMask>

## NanoGrid

template<typename BuildT >

using NanoGrid = Grid<NanoTree<BuildT> >

## NanoLeaf

template<typename BuildT >

using NanoLeaf = LeafNode<BuildT, Coord, Mask, 3>

Template specializations to the default configuration used in OpenVDB: Root -> 32^3 -> 16^3 -> 8^3.

## NanoLower

template<typename BuildT >

using NanoLower = InternalNode<NanoLeaf<BuildT>, 4>

## NanoRoot

template<typename BuildT >

using NanoRoot = RootNode<NanoUpper<BuildT> >

## NanoTree

template<typename BuildT >

using NanoTree = Tree<NanoRoot<BuildT> >

## NanoUpper

template<typename BuildT >

using NanoUpper = InternalNode<NanoLower<BuildT>, 5>

## OnIndexGrid

using OnIndexGrid = Grid<OnIndexTree>

## OnIndexMaskGrid

using OnIndexMaskGrid = Grid<OnIndexMaskTree>

## OnIndexMaskTree

using OnIndexMaskTree = NanoTree<ValueOnIndexMask>

## OnIndexTree

using OnIndexTree = NanoTree<ValueOnIndex>

## PackedRGBA8

using PackedRGBA8 = Rgba8

## PointGrid

using PointGrid = Grid<Point>

## Range1D

using Range1D = Range<1, size_t>

## Range2D

using Range2D = Range<2, size_t>

## Range3D

using Range3D = Range<3, size_t>

## UInt32Grid

using UInt32Grid = Grid<UInt32Tree>

## UInt32Tree

using UInt32Tree = NanoTree<uint32_t>

## Vec3d

using Vec3d = Vec3<double>

## Vec3dGrid

using Vec3dGrid = Grid<Vec3dTree>

## Vec3dTree

using Vec3dTree = NanoTree<Vec3d>

## Vec3f

using Vec3f = Vec3<float>

## Vec3fGrid

using Vec3fGrid = Grid<Vec3fTree>

## Vec3fTree

using Vec3fTree = NanoTree<Vec3f>

## Vec3i

using Vec3i = Vec3<int32_t>

## Vec3IGrid

using Vec3IGrid = Grid<Vec3ITree>

## Vec3ITree

using Vec3ITree = NanoTree<Vec3i>

## Vec3u

using Vec3u = Vec3<uint32_t>

## Vec3u16

using Vec3u16 = Vec3<uint16_t>

## Vec3u8

using Vec3u8 = Vec3<uint8_t>

## Vec4d

using Vec4d = Vec4<double>

## Vec4dGrid

using Vec4dGrid = Grid<Vec4dTree>

## Vec4dTree

using Vec4dTree = NanoTree<Vec4d>

## Vec4f

using Vec4f = Vec4<float>

## Vec4fGrid

using Vec4fGrid = Grid<Vec4fTree>

## Vec4fTree

using Vec4fTree = NanoTree<Vec4f>

## Vec4i

using Vec4i = Vec4<int>

## Vec4R

using Vec4R = Vec4<double>

## Enumeration Type Documentation

## ChecksumMode

enum class ChecksumMode : uint32_t

strong

List of different modes for computing for a checksum.

Enumerator
Disable |
Partial |
Full |
Default |
End |

## GridBlindDataClass

enum class GridBlindDataClass : uint32_t

strong

Blind-data Classes that are currently supported by NanoVDB.

Enumerator
Unknown |
IndexArray |
AttributeArray |
GridName |
ChannelArray |
End |

## GridBlindDataSemantic

enum class GridBlindDataSemantic : uint32_t

strong

Blind-data Semantics that are currently understood by NanoVDB.

Enumerator
Unknown |
PointPosition |
PointColor |
PointNormal |
PointRadius |
PointVelocity |
PointId |
WorldCoords |
GridCoords |
VoxelCoords |
End |

## GridClass

enum class GridClass : uint32_t

strong

Classes (superset of OpenVDB) that are currently supported by NanoVDB.

Enumerator
Unknown |
LevelSet |
FogVolume |
Staggered |
PointIndex |
PointData |
Topology |
VoxelVolume |
IndexGrid |
TensorGrid |
End |

## GridFlags

enum class GridFlags : uint32_t

strong

Grid flags which indicate what extra information is present in the grid buffer.

Enumerator
HasLongGridName |
HasBBox |
HasMinMax |
HasAverage |
HasStdDeviation |
IsBreadthFirst |
End |

## GridType

enum class GridType : uint32_t

strong

List of types that are currently supported by NanoVDB.

Note
  To expand on this list do: 1) Add the new type between Unknown and End in the enum below 2) Add the new type to OpenToNanoVDB::processGrid that maps OpenVDB types to GridType 3) Verify that the ConvertTrait in NanoToOpenVDB.h works correctly with the new type 4) Add the new type to mapToGridType (defined below) that maps NanoVDB types to GridType 5) Add the new type to toStr (defined below)

Enumerator
Unknown |
Float |
Double |
Int16 |
Int32 |
Int64 |
Vec3f |
Vec3d |
Mask |
Half |
UInt32 |
Boolean |
RGBA8 |
Fp4 |
Fp8 |
Fp16 |
FpN |
Vec4f |
Vec4d |
Index |
OnIndex |
IndexMask |
OnIndexMask |
PointIndex |
Vec3u8 |
Vec3u16 |
End |

## StatsMode

enum class StatsMode : uint32_t

strong

Grid flags which indicate what extra information is present in the grid buffer.

Enumerator
Disable |
BBox |
MinMax |
All |
Default |
End |

## Function Documentation

## Abs() [1/4]

template<>

double Abs | ( | double | x | ) |

inline

## Abs() [2/4]

template<>

float Abs | ( | float | x | ) |

inline

## Abs() [3/4]

template<>

int Abs | ( | int | x | ) |

inline

## Abs() [4/4]

template<typename T >

T Abs | ( | T | x | ) |

inline

## alignmentPadding()

static uint64_t alignmentPadding | ( | const void * | p | ) |

inlinestatic

return the smallest number of bytes that when added to the specified pointer results in an aligned pointer

## alignPtr() [1/2]

template<typename T >

static const T * alignPtr | ( | const T * | p | ) |

inlinestatic

offset the specified pointer so it is aligned.

## alignPtr() [2/2]

template<typename T >

static T * alignPtr | ( | T * | p | ) |

inlinestatic

offset the specified pointer so it is aligned.

## AlignUp()

template<uint64_t wordSize>

uint64_t AlignUp | ( | uint64_t | byteCount | ) |

inline

round up byteSize to the nearest wordSize, e.g. to align to machine word: AlignUp<sizeof(size_t)(n)

both wordSize and byteSize are in byte units

## Ceil() [1/2]

int32_t Ceil | ( | double | x | ) |

inline

## Ceil() [2/2]

int32_t Ceil | ( | float | x | ) |

inline

## checksum() [1/2]

template<typename BuildT >

uint64_t checksum | ( | const NanoGrid< BuildT > & | grid,
|  | ChecksumMode | mode = `ChecksumMode::Default`
| ) |  |

Return the (2 x CRC32) checksum of the specified grid.

Template Parameters

  BuildT | Template parameter used to build NanoVDB grid.

Parameters

  grid | Grid from which the checksum is computed.
  mode | Defines the mode of computation for the checksum.

Returns
  Return the (2 x CRC32) checksum of the specified grid

## checksum() [2/2]

template<typename ValueT >

uint64_t checksum | ( | const NanoGrid< ValueT > & | grid,
|  | ChecksumMode | mode
| ) |  |

## Clamp() [1/2]

double Clamp | ( | double | x,
|  | double | a,
|  | double | b
| ) |  |

inline

## Clamp() [2/2]

float Clamp | ( | float | x,
|  | float | a,
|  | float | b
| ) |  |

inline

## CountOn()

uint32_t CountOn | ( | uint64_t | v | ) |

inline

Returns
  Number of bits that are on in the specified 64-bit word

## createAccessor() [1/3]

template<int LEVEL0 = -1, int LEVEL1 = -1, int LEVEL2 = -1, typename ValueT = float>

ReadAccessor< ValueT, LEVEL0, LEVEL1, LEVEL2 > createAccessor | ( | const NanoGrid< ValueT > & | grid | ) |

Free-standing function for convenient creation of a ReadAccessor with optional and customizable node caching.

createAccessor<>(grid): No caching of nodes and hence it's thread-safe but slow createAccessor<0>(grid): Caching of leaf nodes only createAccessor<1>(grid): Caching of lower internal nodes only createAccessor<2>(grid): Caching of upper internal nodes only createAccessor<0,1>(grid): Caching of leaf and lower internal nodes createAccessor<0,2>(grid): Caching of leaf and upper internal nodes createAccessor<1,2>(grid): Caching of lower and upper internal nodes createAccessor<0,1,2>(grid): Caching of all nodes at all tree levels

## createAccessor() [2/3]

template<int LEVEL0 = -1, int LEVEL1 = -1, int LEVEL2 = -1, typename ValueT = float>

ReadAccessor< ValueT, LEVEL0, LEVEL1, LEVEL2 > createAccessor | ( | const NanoRoot< ValueT > & | root | ) |

## createAccessor() [3/3]

template<int LEVEL0 = -1, int LEVEL1 = -1, int LEVEL2 = -1, typename ValueT = float>

ReadAccessor< ValueT, LEVEL0, LEVEL1, LEVEL2 > createAccessor | ( | const NanoTree< ValueT > & | tree | ) |

## createFogVolumeBox() [1/2]

template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createFogVolumeBox | ( | double | width = `40.0`,
|  | double | height = `60.0`,
|  | double | depth = `100.0`,
|  | const Vec3d & | center = `Vec3d(0.0)`,
|  | double | voxelSize = `1.0`,
|  | double | halfWidth = `3.0`,
|  | const Vec3d & | origin = `Vec3d(0.0)`,
|  | const std::string & | name = `"box_fog"`,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

Returns a handle to a sparse fog volume of a box such that the exterior is 0 and inactive, the interior is active with values varying smoothly from 0 at the surface of the box to 1 at the halfWidth and interior of the box.

Parameters

  width | Width of box in world units
  height | Height of box in world units
  depth | Depth of box in world units
  center | Center of box in world units
  voxelSize | Size of a voxel in world units
  halfWidth | Half-width of narrow band in voxel units
  origin | Origin of grid in world units
  name | Name of the grid
  sMode | Mode of computation for the statistics.
  cMode | Mode of computation for the checksum.
  tolerance | Global error tolerance use when VoxelT = FpN
  ditherOn | If true dithering will be applied when VoxelT = {Fp4,Fp8,Fp16,FpN}
  buffer | Buffer used for memory allocation by the handle

The `BuildT` template parameter must be one of the following: float (default), double, Fp4, Fp8, Fp16 or FpN. The `tolerance` argument is only used when BuildT is set to FpN.

## createFogVolumeBox() [2/2]

template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createFogVolumeBox | ( | double | width = `40.0`,
|  | double | height = `60.0`,
|  | double | depth = `100.0`,
|  | const Vec3d & | center = `Vec3d(0.0)`,
|  | double | voxelSize = `1.0`,
|  | double | halfWidth = `3.0`,
|  | const Vec3d & | origin = `Vec3d(0.0)`,
|  | const std::string & | name = `"box_fog_FpN"`,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | float | tolerance = `-1.0f`,
|  | bool | ditherOn = `false`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

## createFogVolumeOctahedron() [1/2]

template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createFogVolumeOctahedron | ( | double | scale = `100.0`,
|  | const Vec3d & | center = `Vec3d(0.0)`,
|  | double | voxelSize = `1.0`,
|  | double | halfWidth = `3.0`,
|  | const Vec3d & | origin = `Vec3d(0.0)`,
|  | const std::string & | name = `"octadedron_fog"`,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

Returns a handle to a sparse fog volume of an octahedron such that the exterior is 0 and inactive, the interior is active with values varying smoothly from 0 at the surface of the octahedron to 1 at the halfWidth and interior of the octahedron.

Parameters

  scale | Scale of octahedron in world units
  center | Center of box in world units
  voxelSize | Size of a voxel in world units
  halfWidth | Half-width of narrow band in voxel units
  origin | Origin of grid in world units
  name | Name of the grid
  sMode | Mode of computation for the statistics.
  cMode | Mode of computation for the checksum.
  tolerance | Global error tolerance use when VoxelT = FpN
  ditherOn | If true dithering will be applied when VoxelT = {Fp4,Fp8,Fp16,FpN}
  buffer | Buffer used for memory allocation by the handle

The `BuildT` template parameter must be one of the following: float (default), double, Fp4, Fp8, Fp16 or FpN. The `tolerance` argument is only used when BuildT is set to FpN.

## createFogVolumeOctahedron() [2/2]

template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createFogVolumeOctahedron | ( | double | scale = `100.0`,
|  | const Vec3d & | center = `Vec3d(0.0)`,
|  | double | voxelSize = `1.0`,
|  | double | halfWidth = `3.0`,
|  | const Vec3d & | origin = `Vec3d(0.0)`,
|  | const std::string & | name = `"octadedron_fog_FpN"`,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | float | tolerance = `-1.0f`,
|  | bool | ditherOn = `false`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

## createFogVolumeSphere() [1/2]

template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createFogVolumeSphere | ( | double | radius = `100.0`,
|  | const Vec3d & | center = `Vec3d(0.0)`,
|  | double | voxelSize = `1.0`,
|  | double | halfWidth = `3.0`,
|  | const Vec3d & | origin = `Vec3d(0.0)`,
|  | const std::string & | name = `"sphere_fog"`,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

Returns a handle to a sparse fog volume of a sphere such that the exterior is 0 and inactive, the interior is active with values varying smoothly from 0 at the surface of the sphere to 1 at the halfWidth and interior of the sphere.

Parameters

  radius | Radius of sphere in world units
  center | Center of sphere in world units
  voxelSize | Size of a voxel in world units
  halfWidth | Half-width of narrow band in voxel units
  origin | Origin of grid in world units
  name | Name of the grid
  sMode | Mode of computation for the statistics.
  cMode | Mode of computation for the checksum.
  tolerance | Global error tolerance use when VoxelT = FpN
  ditherOn | If true dithering will be applied when BuildT = {Fp4,Fp8,Fp16,FpN}
  buffer | Buffer used for memory allocation by the handle

The `BuildT` template parameter must be one of the following: float (default), double, Fp4, Fp8, Fp16 or FpN. The `tolerance` argument is only used when BuildT is set to FpN.

## createFogVolumeSphere() [2/2]

template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createFogVolumeSphere | ( | double | radius = `100.0`,
|  | const Vec3d & | center = `Vec3d(0.0)`,
|  | double | voxelSize = `1.0`,
|  | double | halfWidth = `3.0`,
|  | const Vec3d & | origin = `Vec3d(0.0)`,
|  | const std::string & | name = `"sphere_fog"`,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | float | tolerance = `-1.0f`,
|  | bool | ditherOn = `false`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

## createFogVolumeTorus() [1/2]

template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createFogVolumeTorus | ( | double | majorRadius = `100.0`,
|  | double | minorRadius = `50.0`,
|  | const Vec3d & | center = `Vec3d(0.0)`,
|  | double | voxelSize = `1.0`,
|  | double | halfWidth = `3.0`,
|  | const Vec3d & | origin = `Vec3d(0.0)`,
|  | const std::string & | name = `"torus_fog"`,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

Returns a handle to a sparse fog volume of a torus in the xz-plane such that the exterior is 0 and inactive, the interior is active with values varying smoothly from 0 at the surface of the torus to 1 at the halfWidth and interior of the torus.

Parameters

  majorRadius | Major radius of torus in world units
  minorRadius | Minor radius of torus in world units
  center | Center of torus in world units
  voxelSize | Size of a voxel in world units
  halfWidth | Half-width of narrow band in voxel units
  origin | Origin of grid in world units
  name | Name of the grid
  sMode | Mode of computation for the statistics.
  cMode | Mode of computation for the checksum.
  tolerance | Global error tolerance use when VoxelT = FpN
  ditherOn | If true dithering will be applied when VoxelT = {Fp4,Fp8,Fp16,FpN}
  buffer | Buffer used for memory allocation by the handle

The `BuildT` template parameter must be one of the following: float (default), double, Fp4, Fp8, Fp16 or FpN. The `tolerance` argument is only used when BuildT is set to FpN.

## createFogVolumeTorus() [2/2]

template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createFogVolumeTorus | ( | double | majorRadius = `100.0`,
|  | double | minorRadius = `50.0`,
|  | const Vec3d & | center = `Vec3d(0.0)`,
|  | double | voxelSize = `1.0`,
|  | double | halfWidth = `3.0`,
|  | const Vec3d & | origin = `Vec3d(0.0)`,
|  | const std::string & | name = `"torus_fog_FpN"`,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | float | tolerance = `-1.0f`,
|  | bool | ditherOn = `false`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

## createLevelSetBBox() [1/2]

template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createLevelSetBBox | ( | double | width = `40.0`,
|  | double | height = `60.0`,
|  | double | depth = `100.0`,
|  | double | thickness = `10.0`,
|  | const Vec3d & | center = `Vec3d(0.0)`,
|  | double | voxelSize = `1.0`,
|  | double | halfWidth = `3.0`,
|  | const Vec3d & | origin = `Vec3d(0.0)`,
|  | const std::string & | name = `"bbox_ls"`,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

Returns a handle to a narrow-band level set of a bounding-box (= wireframe of a box)

Parameters

  width | Width of box in world units
  height | Height of box in world units
  depth | Depth of box in world units
  thickness | Thickness of the wire in world units
  center | Center of bbox in world units
  voxelSize | Size of a voxel in world units
  halfWidth | Half-width of narrow band in voxel units
  origin | Origin of grid in world units
  name | Name of the grid
  sMode | Mode of computation for the statistics.
  cMode | Mode of computation for the checksum.
  tolerance | Global error tolerance use when VoxelT = FpN
  ditherOn | If true dithering will be applied when VoxelT = {Fp4,Fp8,Fp16,FpN}
  buffer | Buffer used for memory allocation by the handle

The `BuildT` template parameter must be one of the following: float (default), double, Fp4, Fp8, Fp16 or FpN. The `tolerance` argument is only used when BuildT is set to FpN.

## createLevelSetBBox() [2/2]

template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createLevelSetBBox | ( | double | width = `40.0`,
|  | double | height = `60.0`,
|  | double | depth = `100.0`,
|  | double | thickness = `10.0`,
|  | const Vec3d & | center = `Vec3d(0.0)`,
|  | double | voxelSize = `1.0`,
|  | double | halfWidth = `3.0`,
|  | const Vec3d & | origin = `Vec3d(0.0)`,
|  | const std::string & | name = `"bbox_ls_FpN"`,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | float | tolerance = `-1.0f`,
|  | bool | ditherOn = `false`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

## createLevelSetBox() [1/2]

template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createLevelSetBox | ( | double | width = `40.0`,
|  | double | height = `60.0`,
|  | double | depth = `100.0`,
|  | const Vec3d & | center = `Vec3d(0.0)`,
|  | double | voxelSize = `1.0`,
|  | double | halfWidth = `3.0`,
|  | const Vec3d & | origin = `Vec3d(0.0)`,
|  | const std::string & | name = `"box_ls"`,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

Returns a handle to a narrow-band level set of a box.

Parameters

  width | Width of box in world units
  height | Height of box in world units
  depth | Depth of box in world units
  center | Center of box in world units
  voxelSize | Size of a voxel in world units
  halfWidth | Half-width of narrow band in voxel units
  origin | Origin of grid in world units
  name | Name of the grid
  sMode | Mode of computation for the statistics.
  cMode | Mode of computation for the checksum.
  tolerance | Global error tolerance use when VoxelT = FpN
  ditherOn | If true dithering will be applied when VoxelT = {Fp4,Fp8,Fp16,FpN}
  buffer | Buffer used for memory allocation by the handle

The `BuildT` template parameter must be one of the following: float (default), double, Fp4, Fp8, Fp16 or FpN. The `tolerance` argument is only used when BuildT is set to FpN.

## createLevelSetBox() [2/2]

template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createLevelSetBox | ( | double | width = `40.0`,
|  | double | height = `60.0`,
|  | double | depth = `100.0`,
|  | const Vec3d & | center = `Vec3d(0.0)`,
|  | double | voxelSize = `1.0`,
|  | double | halfWidth = `3.0`,
|  | const Vec3d & | origin = `Vec3d(0.0)`,
|  | const std::string & | name = `"box_ls_FpN"`,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | float | tolerance = `-1.0f`,
|  | bool | ditherOn = `false`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

## createLevelSetOctahedron() [1/2]

template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createLevelSetOctahedron | ( | double | scale = `100.0`,
|  | const Vec3d & | center = `Vec3d(0.0)`,
|  | double | voxelSize = `1.0`,
|  | double | halfWidth = `3.0`,
|  | const Vec3d & | origin = `Vec3d(0.0)`,
|  | const std::string & | name = `"octadedron_ls"`,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

Returns a handle to a narrow-band level set of a octahedron.

Parameters

  scale | Scale of octahedron in world units
  center | Center of octahedron in world units
  voxelSize | Size of a voxel in world units
  halfWidth | Half-width of narrow band in voxel units
  origin | Origin of grid in world units
  name | Name of the grid
  sMode | Mode of computation for the statistics.
  cMode | Mode of computation for the checksum.
  tolerance | Global error tolerance use when VoxelT = FpN
  ditherOn | If true dithering will be applied when VoxelT = {Fp4,Fp8,Fp16,FpN}
  buffer | Buffer used for memory allocation by the handle

The `BuildT` template parameter must be one of the following: float (default), double, Fp4, Fp8, Fp16 or FpN. The `tolerance` argument is only used when BuildT is set to FpN.

## createLevelSetOctahedron() [2/2]

template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createLevelSetOctahedron | ( | double | scale = `100.0`,
|  | const Vec3d & | center = `Vec3d(0.0)`,
|  | double | voxelSize = `1.0`,
|  | double | halfWidth = `3.0`,
|  | const Vec3d & | origin = `Vec3d(0.0)`,
|  | const std::string & | name = `"octadedron_ls_FpN"`,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | float | tolerance = `-1.0f`,
|  | bool | ditherOn = `false`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

## createLevelSetSphere() [1/3]

template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< Fp4, BuildT >::value||is_same< Fp8, BuildT >::value||is_same< Fp16, BuildT >::value, GridHandle< BufferT > >::type createLevelSetSphere | ( | double | radius = `100.0`,
|  | const Vec3d & | center = `Vec3d(0)`,
|  | double | voxelSize = `1.0`,
|  | double | halfWidth = `3.0`,
|  | const Vec3d & | origin = `Vec3d(0)`,
|  | const std::string & | name = `"sphere_ls"`,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | bool | ditherOn = `false`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

## createLevelSetSphere() [2/3]

template<typename BuildT = float, typename BufferT = HostBuffer>

enable_if< is_same< float, BuildT >::value||is_same< double, BuildT >::value, GridHandle< BufferT > >::type createLevelSetSphere | ( | double | radius = `100.0`,
|  | const Vec3d & | center = `Vec3d(0)`,
|  | double | voxelSize = `1.0`,
|  | double | halfWidth = `3.0`,
|  | const Vec3d & | origin = `Vec3d(0)`,
|  | const std::string & | name = `"sphere_ls"`,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

Returns a handle to a narrow-band level set of a sphere.

Parameters

  radius | Radius of sphere in world units
  center | Center of sphere in world units
  voxelSize | Size of a voxel in world units
  halfWidth | Half-width of narrow band in voxel units
  origin | Origin of grid in world units
  name | Name of the grid
  sMode | Mode of computation for the statistics.
  cMode | Mode of computation for the checksum.
  tolerance | Global error tolerance use when VoxelT = FpN
  ditherOn | If true dithering will be applied when VoxelT = {Fp4,Fp8,Fp16,FpN}
  buffer | Buffer used for memory allocation by the handle

The `BuildT` template parameter must be one of the following: float (default), double, Fp4, Fp8, Fp16 or FpN. The `tolerance` argument is only used when BuildT is set to FpN.

## createLevelSetSphere() [3/3]

template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createLevelSetSphere | ( | double | radius = `100.0`,
|  | const Vec3d & | center = `Vec3d(0)`,
|  | double | voxelSize = `1.0`,
|  | double | halfWidth = `3.0`,
|  | const Vec3d & | origin = `Vec3d(0)`,
|  | const std::string & | name = `"sphere_ls_FpN"`,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | float | tolerance = `-1.0f`,
|  | bool | ditherOn = `false`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

## createLevelSetTorus() [1/2]

template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createLevelSetTorus | ( | double | majorRadius = `100.0`,
|  | double | minorRadius = `50.0`,
|  | const Vec3d & | center = `Vec3d(0.0)`,
|  | double | voxelSize = `1.0`,
|  | double | halfWidth = `3.0`,
|  | const Vec3d & | origin = `Vec3d(0.0)`,
|  | const std::string & | name = `"torus_ls"`,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

Returns a handle to a narrow-band level set of a torus in the xz-plane.

Parameters

  majorRadius | Major radius of torus in world units
  minorRadius | Minor radius of torus in world units
  center | Center of torus in world units
  voxelSize | Size of a voxel in world units
  halfWidth | Half-width of narrow band in voxel units
  origin | Origin of grid in world units
  name | Name of the grid
  sMode | Mode of computation for the statistics.
  cMode | Mode of computation for the checksum.
  tolerance | Global error tolerance use when VoxelT = FpN
  ditherOn | If true dithering will be applied when VoxelT = {Fp4,Fp8,Fp16,FpN}
  buffer | Buffer used for memory allocation by the handle

The `BuildT` template parameter must be one of the following: float (default), double, Fp4, Fp8, Fp16 or FpN. The `tolerance` argument is only used when BuildT is set to FpN.

## createLevelSetTorus() [2/2]

template<typename BuildT , typename BufferT = HostBuffer>

enable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createLevelSetTorus | ( | double | majorRadius = `100.0`,
|  | double | minorRadius = `50.0`,
|  | const Vec3d & | center = `Vec3d(0.0)`,
|  | double | voxelSize = `1.0`,
|  | double | halfWidth = `3.0`,
|  | const Vec3d & | origin = `Vec3d(0.0)`,
|  | const std::string & | name = `"torus_ls"`,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | float | tolerance = `-1.0f`,
|  | bool | ditherOn = `false`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

## createNanoGrid() [1/4]

template<typename SrcGridT , typename DstBuildT = typename MapToNano<typename SrcGridT::BuildType>::type, typename BufferT = HostBuffer>

enable_if< BuildTraits< DstBuildT >::is_FpX, GridHandle< BufferT > >::type createNanoGrid | ( | const SrcGridT & | srcGrid,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | bool | ditherOn = `false`,
|  | int | verbose = `0`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

Freestanding function to create a NanoGrid<FpX> from any source grid, X=4,8,16.

Template Parameters

  SrcGridT | Type of in input (source) grid, e.g. openvdb::Grid or nanovdb::Grid
  DstBuildT | = Fp4, Fp8 or Fp16, i.e. quantization bit-width of the output grid
  BufferT | Type of the buffer used to allocate the destination grid

Parameters

  srcGrid | Input (source) grid to be converted
  ditherOn | switch to enable or disable dithering of quantization error
  sMode | Mode for computing statistics of the destination grid
  cMode | Mode for computing checksums of the destination grid
  verbose | Mode of verbosity
  buffer | Instance of a buffer used for allocation

Returns
  Handle to the destination NanoGrid

## createNanoGrid() [2/4]

template<typename SrcGridT , typename DstBuildT = typename MapToNano<typename SrcGridT::BuildType>::type, typename OracleT = AbsDiff, typename BufferT = HostBuffer>

enable_if< is_same< FpN, DstBuildT >::value, GridHandle< BufferT > >::type createNanoGrid | ( | const SrcGridT & | srcGrid,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | bool | ditherOn = `false`,
|  | int | verbose = `0`,
|  | const OracleT & | oracle = `OracleT()`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

Freestanding function to create a NanoGrid<FpN> from any source grid.

Template Parameters

  SrcGridT | Type of in input (source) grid, e.g. openvdb::Grid or nanovdb::Grid
  DstBuildT | = FpN, i.e. variable bit-width of the output grid
  OracleT | Type of the oracle used to determine the local bit-width, i.e. N in FpN
  BufferT | Type of the buffer used to allocate the destination grid

Parameters

  srcGrid | Input (source) grid to be converted
  ditherOn | switch to enable or disable dithering of quantization error
  sMode | Mode for computing statistics of the destination grid
  cMode | Mode for computing checksums of the destination grid
  verbose | Mode of verbosity
  oracle | Instance of a oracle used to determine the local bit-width, i.e. N in FpN
  buffer | Instance of a buffer used for allocation

Returns
  Handle to the destination NanoGrid

## createNanoGrid() [3/4]

template<typename SrcGridT , typename DstBuildT = typename MapToNano<typename SrcGridT::BuildType>::type, typename BufferT = HostBuffer>

disable_if< BuildTraits< DstBuildT >::is_index||BuildTraits< DstBuildT >::is_Fp, GridHandle< BufferT > >::type createNanoGrid | ( | const SrcGridT & | srcGrid,
|  | StatsMode | sMode = `StatsMode::Default`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | int | verbose = `0`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

Freestanding function that creates a NanoGrid<T> from any source grid.

Template Parameters

  SrcGridT | Type of in input (source) grid, e.g. openvdb::Grid or nanovdb::Grid
  DstBuildT | Type of values in the output (destination) nanovdb Grid, e.g. float or nanovdb::Fp16
  BufferT | Type of the buffer used ti allocate the destination grid

Parameters

  srcGrid | Input (source) grid to be converted
  sMode | Mode for computing statistics of the destination grid
  cMode | Mode for computing checksums of the destination grid
  verbose | Mode of verbosity
  buffer | Instance of a buffer used for allocation

Returns
  Handle to the destination NanoGrid

## createNanoGrid() [4/4]

template<typename SrcGridT , typename DstBuildT = typename MapToNano<typename SrcGridT::BuildType>::type, typename BufferT = HostBuffer>

enable_if< BuildTraits< DstBuildT >::is_index, GridHandle< BufferT > >::type createNanoGrid | ( | const SrcGridT & | srcGrid,
|  | uint32_t | channels = `0u`,
|  | bool | includeStats = `true`,
|  | bool | includeTiles = `true`,
|  | int | verbose = `0`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

Freestanding function that creates a NanoGrid<ValueIndex> or NanoGrid<ValueOnIndex> from any source grid.

Template Parameters

  SrcGridT | Type of in input (source) grid, e.g. openvdb::Grid or nanovdb::Grid
  DstBuildT | If ValueIndex all (active and inactive) values are indexed and if it is ValueOnIndex only active values are indexed.
  BufferT | BufferT Type of the buffer used ti allocate the destination grid

Parameters

  channels | If non-zero the values (active or all) in `srcGrid` are encoded as blind data in the output index grid. `channels` indicates the number of copies of these blind data
  includeStats | If true all tree nodes will includes indices for stats, i.e. min/max/avg/std-div
  includeTiles | If false on values in leaf nodes are indexed
  verbose | Mode of verbosity
  buffer | Instance of a buffer used for allocation

Returns
  Handle to the destination NanoGrid<T> where T = ValueIndex or ValueOnIndex

## createNodeManager()

template<typename BuildT , typename BufferT = HostBuffer>

NodeManagerHandle< BufferT > createNodeManager | ( | const NanoGrid< BuildT > & | grid,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

brief Construct a NodeManager and return its handle

Parameters

  grid | grid whose nodes will be accessed sequentially
  buffer | buffer from which to allocate the output handle

Note
  This is the only way to create a NodeManager since it's using managed memory pointed to by a NodeManagerHandle.

## createPointBox()

template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createPointBox | ( | int | pointsPerVoxel = `1`,
|  | double | width = `40.0`,
|  | double | height = `60.0`,
|  | double | depth = `100.0`,
|  | const Vec3d & | center = `Vec3d(0.0)`,
|  | double | voxelSize = `1.0`,
|  | const Vec3d & | origin = `Vec3d(0.0)`,
|  | const std::string & | name = `"box_points"`,
|  | ChecksumMode | mode = `ChecksumMode::Default`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

Returns a handle to a PointDataGrid containing points scattered on the surface of a box.

Parameters

  pointsPerVoxel | Number of point per voxel on on the surface
  width | Width of box in world units
  height | Height of box in world units
  depth | Depth of box in world units
  center | Center of box in world units
  voxelSize | Size of a voxel in world units
  origin | Origin of grid in world units
  name | Name of the grid
  mode | Mode of computation for the checksum.
  buffer | Buffer used for memory allocation by the handle

## createPointScatter()

template<typename SrcBuildT = float, typename BufferT = HostBuffer>

GridHandle< BufferT > createPointScatter | ( | const NanoGrid< SrcBuildT > & | srcGrid,
|  | int | pointsPerVoxel = `1`,
|  | const std::string & | name = `"point_scatter"`,
|  | ChecksumMode | mode = `ChecksumMode::Default`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

inline

Given an input NanoVDB voxel grid this methods returns a GridHandle to another NanoVDB PointDataGrid with points scattered in the active leaf voxels of in input grid. Note, the coordinates of the points are encoded as blind data in world-space.

Parameters

  srcGrid | Const input grid used to determine the active voxels to scatter points into
  pointsPerVoxel | Number of point per voxel on on the surface
  name | Name of the grid
  mode | Mode of computation for the checksum.
  buffer | Buffer used for memory allocation by the handle

## createPointSphere()

template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createPointSphere | ( | int | pointsPerVoxel = `1`,
|  | double | radius = `100.0`,
|  | const Vec3d & | center = `Vec3d(0.0)`,
|  | double | voxelSize = `1.0`,
|  | const Vec3d & | origin = `Vec3d(0.0)`,
|  | const std::string & | name = `"sphere_points"`,
|  | ChecksumMode | mode = `ChecksumMode::Default`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

Returns a handle to a PointDataGrid containing points scattered on the surface of a sphere.

Parameters

  pointsPerVoxel | Number of point per voxel on on the surface
  radius | Radius of sphere in world units
  center | Center of sphere in world units
  voxelSize | Size of a voxel in world units
  origin | Origin of grid in world units
  name | Name of the grid
  mode | Mode of computation for the checksum.
  buffer | Buffer used for memory allocation by the handle

The `BuildT` template parameter must be float (default) or double.

## createPointTorus()

template<typename BuildT = float, typename BufferT = HostBuffer>

disable_if< is_same< FpN, BuildT >::value, GridHandle< BufferT > >::type createPointTorus | ( | int | pointsPerVoxel = `1`,
|  | double | majorRadius = `100.0`,
|  | double | minorRadius = `50.0`,
|  | const Vec3d & | center = `Vec3d(0.0)`,
|  | double | voxelSize = `1.0`,
|  | const Vec3d & | origin = `Vec3d(0.0f)`,
|  | const std::string & | name = `"torus_points"`,
|  | ChecksumMode | cMode = `ChecksumMode::Default`,
|  | const BufferT & | buffer = `BufferT()`
| ) |  |

Returns a handle to a PointDataGrid containing points scattered on the surface of a torus.

Parameters

  pointsPerVoxel | Number of point per voxel on on the surface
  majorRadius | Major radius of torus in world units
  minorRadius | Minor radius of torus in world units
  center | Center of torus in world units
  voxelSize | Size of a voxel in world units
  origin | Origin of grid in world units
  name | Name of the grid
  cMode | Mode of computation for the checksum.
  buffer | Buffer used for memory allocation by the handle

The `BuildT` template parameter must be float (default) or double.

## createSampler()

template<int Order, typename TreeOrAccT , bool UseCache = true>

SampleFromVoxels< TreeOrAccT, Order, UseCache > createSampler | ( | const TreeOrAccT & | acc | ) |

Factory free-function for a sampler of specific polynomial orders.

This allows for the compact syntax:

auto acc = grid.getAccessor();
auto smp = nanovdb::createSampler<1>( acc );

## FindHighestOn() [1/2]

static uint32_t FindHighestOn | ( | uint32_t | v | ) |

inlinestatic

Returns the index of the highest, i.e. most significant, on bit in the specified 32 bit word.

Warning
  Assumes that at least one bit is set in the word, i.e. v != uint32_t(0)!

## FindHighestOn() [2/2]

static uint32_t FindHighestOn | ( | uint64_t | v | ) |

inlinestatic

Returns the index of the highest, i.e. most significant, on bit in the specified 64 bit word.

Warning
  Assumes that at least one bit is set in the word, i.e. v != uint32_t(0)!

## FindLowestOn() [1/2]

static uint32_t FindLowestOn | ( | uint32_t | v | ) |

inlinestatic

Returns the index of the lowest, i.e. least significant, on bit in the specified 32 bit word.

Warning
  Assumes that at least one bit is set in the word, i.e. v != uint32_t(0)!

## FindLowestOn() [2/2]

static uint32_t FindLowestOn | ( | uint64_t | v | ) |

inlinestatic

Returns the index of the lowest, i.e. least significant, on bit in the specified 64 bit word.

Warning
  Assumes that at least one bit is set in the word, i.e. v != uint32_t(0)!

## firstActive()

template<typename RayT , typename AccT >

__hostdev__ bool firstActive | ( | RayT & | ray,
|  | AccT & | acc,
|  | Coord & | ijk,
|  | float & | t
| ) |  |

inline

returns true if the ray intersects an active value at any level of the grid in the accessor. The empty-space ray-marching is performed at all levels of the tree using an HDDA. If an intersection is detected, then ijk is updated with the index coordinate of the first active voxel or tile, and t is set to the time of its intersection along the ray.

## Floor() [1/5]

int32_t Floor | ( | double | x | ) |

inline

## Floor() [2/5]

int32_t Floor | ( | float | x | ) |

inline

## Floor() [3/5]

template<typename CoordT , template< typename > class Vec3T>

CoordT Floor | ( | Vec3T< double > & | xyz | ) |

inline

Template specialization of Floor for Vec3<float>

## Floor() [4/5]

template<typename CoordT , template< typename > class Vec3T>

CoordT Floor | ( | Vec3T< float > & | xyz | ) |

inline

Template specialization of Floor for Vec3<float>

## Floor() [5/5]

template<typename CoordT , typename RealT , template< typename > class Vec3T>

CoordT Floor | ( | Vec3T< RealT > & | xyz | ) |

inline

Utility function that returns the Coord of the round-down of xyz and redefined (x,&nbsp y,&nbsp z) as the fractional part, ie xyz-in = return-value + xyz-out.

## forEach() [1/4]

template<template< typename... > class ContainerT, typename... T, typename FuncT >

void forEach | ( | const ContainerT< T... > & | c,
|  | const FuncT & | func
| ) |  |

inline

Simple wrapper for the function defined above, which works with std::containers.

## forEach() [2/4]

template<template< typename... > class ContainerT, typename... T, typename FuncT >

void forEach | ( | const ContainerT< T... > & | c,
|  | size_t | grainSize,
|  | const FuncT & | func
| ) |  |

inline

Simple wrapper for the function defined above, which works with std::containers.

## forEach() [3/4]

template<typename RangeT , typename FuncT >

void forEach | ( | RangeT | range,
|  | const FuncT & | func
| ) |  |

inline

simple wrapper for tbb::parallel_for with a naive std fallback

Parameters

  range | Range, CoordBBox, tbb::blocked_range, blocked_range2D, or blocked_range3D.
  func | functor with the signature [](const RangeT&){...},

std::vector<int> array(100);
auto func = [&array](auto &r){for (auto i=r.begin(); i!=r.end(); ++i) array[i]=i;};
forEach(array, func);
nanovdb::forEach
void forEach(RangeT range, const FuncT &func)
simple wrapper for tbb::parallel_for with a naive std fallback
Definition ForEach.h:40

## forEach() [4/4]

template<typename FuncT >

void forEach | ( | size_t | begin,
|  | size_t | end,
|  | size_t | grainSize,
|  | const FuncT & | func
| ) |  |

inline

Simple wrapper for the function defined above.

## Fract() [1/2]

double Fract | ( | double | x | ) |

inline

## Fract() [2/2]

float Fract | ( | float | x | ) |

inline

## getExtrema()

template<typename BuildT >

Extrema< typename NanoGrid< BuildT >::ValueType > getExtrema | ( | const NanoGrid< BuildT > & | grid,
|  | const CoordBBox & | bbox
| ) |  |

return the extrema of all the values in a grid that intersects the specified bounding box.

## GodunovsNormSqrd() [1/2]

template<typename RealT >

__hostdev__ RealT GodunovsNormSqrd | ( | bool | isOutside,
|  | const Vec3< RealT > & | gradient_m,
|  | const Vec3< RealT > & | gradient_p
| ) |  |

inline

## GodunovsNormSqrd() [2/2]

template<typename RealT >

__hostdev__ RealT GodunovsNormSqrd | ( | bool | isOutside,
|  | RealT | dP_xm,
|  | RealT | dP_xp,
|  | RealT | dP_ym,
|  | RealT | dP_yp,
|  | RealT | dP_zm,
|  | RealT | dP_zp
| ) |  |

inline

## gridStats()

template<typename BuildT >

void gridStats | ( | NanoGrid< BuildT > & | grid,
|  | StatsMode | mode = `StatsMode::Default`
| ) |  |

Re-computes the min/max, stats and bbox information for an existing NanoVDB Grid.

Parameters

  grid | Grid whose stats to update
  mode | Mode of computation for the statistics.

## inclusiveScan()

template<typename T , typename Op >

void inclusiveScan | ( | T * | array,
|  | size_t | size,
|  | const T & | identity,
|  | bool | threaded,
|  | Op | op
| ) |  |

An inclusive scan includes in[i] when computing out[i].

Note
  Inclusive prefix operation: for (i=1; i<N; ++i) vec[i] = Op(vec[i],vec[i-1])

## invoke()

template<typename Func , typename... Rest>

int invoke | ( | const Func & | taskFunc1,
|  | Rest... | taskFuncN
| ) |  |

Returns
  1 for serial, 2 for tbb multi-threading, and 3 for std multi-threading

## isAligned()

static bool isAligned | ( | const void * | p | ) |

inlinestatic

return true if the specified pointer is aligned

## isApproxZero()

template<typename Type >

bool isApproxZero | ( | const Type & | x | ) |

inline

## isFloatingPoint()

bool isFloatingPoint | ( | GridType | gridType | ) |

inline

return true if the GridType maps to a floating point type

## isFloatingPointVector()

bool isFloatingPointVector | ( | GridType | gridType | ) |

inline

return true if the GridType maps to a floating point vec3.

## isIndex()

bool isIndex | ( | GridType | gridType | ) |

inline

Return true if the GridType maps to a special index type (not a POD integer type).

These types are used to index from a voxel into an external array of values, e.g. sidecar or blind data.

## isInteger()

bool isInteger | ( | GridType | gridType | ) |

inline

Return true if the GridType maps to a POD integer type.

These types are used to associate a voxel with a POD integer type

## isValid() [1/4]

bool isValid | ( | const GridBlindDataClass & | blindClass,
|  | const GridBlindDataSemantic & | blindSemantics,
|  | const GridType & | blindType
| ) |  |

inline

return true if the combination of GridBlindDataClass, GridBlindDataSemantic and GridType is valid.

## isValid() [2/4]

template<typename ValueT >

bool isValid | ( | const NanoGrid< ValueT > & | grid,
|  | bool | detailed = `true`,
|  | bool | verbose = `false`
| ) |  |

Return true if the specified grid passes several validation tests.

Parameters

  grid | Grid to validate
  detailed | If true the validation test is detailed and relatively slow.
  verbose | If true information about the first failed test is printed to std::cerr

## isValid() [3/4]

static bool isValid | ( | const void * | p | ) |

inlinestatic

return true if the specified pointer is aligned and not NULL

## isValid() [4/4]

bool isValid | ( | GridType | gridType,
|  | GridClass | gridClass
| ) |  |

inline

return true if the combination of GridType and GridClass is valid.

## mapToGridClass()

template<typename BuildT >

GridClass mapToGridClass | ( | GridClass | defaultClass = `GridClass::Unknown` | ) |

inline

Maps from a templated build type to a GridClass enum.

## mapToGridType()

template<typename BuildT >

GridType mapToGridType | ( |  | ) |

inline

Maps from a templated build type to a GridType enum.

## matMult() [1/4]

template<typename Vec3T >

Vec3T matMult | ( | const double * | mat,
|  | const double * | vec,
|  | const Vec3T & | xyz
| ) |  |

inline

Multiply a 3x3 matrix to a 3d vector and add another 3d vector using 64bit floating point arithmetics.

Note
  This corresponds to an affine transformation, i.e a linear mapping followed by a translation. e.g. scale/rotation and translation

Template Parameters

  Vec3T | Template type of the input and output 3d vectors

Parameters

  mat | pointer to an array of floats with the 3x3 matrix
  vec | 3d vector to be added AFTER the matrix multiplication
  xyz | input vector to be multiplied by the matrix and a translated by `vec`

Returns
  result of affine transformation, i.e. (mat x xyz) + vec

## matMult() [2/4]

template<typename Vec3T >

Vec3T matMult | ( | const double * | mat,
|  | const Vec3T & | xyz
| ) |  |

inline

Multiply a 3x3 matrix and a 3d vector using 64bit floating point arithmetics.

Note
  This corresponds to a linear mapping, e.g. scaling, rotation etc.

Template Parameters

  Vec3T | Template type of the input and output 3d vectors

Parameters

  mat | pointer to an array of floats with the 3x3 matrix
  xyz | input vector to be multiplied by the matrix

Returns
  result of matrix-vector multiplication, i.e. mat x xyz

## matMult() [3/4]

template<typename Vec3T >

Vec3T matMult | ( | const float * | mat,
|  | const float * | vec,
|  | const Vec3T & | xyz
| ) |  |

inline

Multiply a 3x3 matrix to a 3d vector and add another 3d vector using 32bit floating point arithmetics.

Note
  This corresponds to an affine transformation, i.e a linear mapping followed by a translation. e.g. scale/rotation and translation

Template Parameters

  Vec3T | Template type of the input and output 3d vectors

Parameters

  mat | pointer to an array of floats with the 3x3 matrix
  vec | 3d vector to be added AFTER the matrix multiplication
  xyz | input vector to be multiplied by the matrix and a translated by `vec`

Returns
  result of affine transformation, i.e. (mat x xyz) + vec

## matMult() [4/4]

template<typename Vec3T >

Vec3T matMult | ( | const float * | mat,
|  | const Vec3T & | xyz
| ) |  |

inline

Multiply a 3x3 matrix and a 3d vector using 32bit floating point arithmetics.

Note
  This corresponds to a linear mapping, e.g. scaling, rotation etc.

Template Parameters

  Vec3T | Template type of the input and output 3d vectors

Parameters

  mat | pointer to an array of floats with the 3x3 matrix
  xyz | input vector to be multiplied by the matrix

Returns
  result of matrix-vector multiplication, i.e. mat x xyz

## matMultT() [1/4]

template<typename Vec3T >

Vec3T matMultT | ( | const double * | mat,
|  | const double * | vec,
|  | const Vec3T & | xyz
| ) |  |

inline

## matMultT() [2/4]

template<typename Vec3T >

Vec3T matMultT | ( | const double * | mat,
|  | const Vec3T & | xyz
| ) |  |

inline

Multiply the transposed of a 3x3 matrix and a 3d vector using 64bit floating point arithmetics.

Note
  This corresponds to an inverse linear mapping, e.g. inverse scaling, inverse rotation etc.

Template Parameters

  Vec3T | Template type of the input and output 3d vectors

Parameters

  mat | pointer to an array of floats with the 3x3 matrix
  xyz | input vector to be multiplied by the transposed matrix

Returns
  result of matrix-vector multiplication, i.e. mat^T x xyz

## matMultT() [3/4]

template<typename Vec3T >

Vec3T matMultT | ( | const float * | mat,
|  | const float * | vec,
|  | const Vec3T & | xyz
| ) |  |

inline

## matMultT() [4/4]

template<typename Vec3T >

Vec3T matMultT | ( | const float * | mat,
|  | const Vec3T & | xyz
| ) |  |

inline

Multiply the transposed of a 3x3 matrix and a 3d vector using 32bit floating point arithmetics.

Note
  This corresponds to an inverse linear mapping, e.g. inverse scaling, inverse rotation etc.

Template Parameters

  Vec3T | Template type of the input and output 3d vectors

Parameters

  mat | pointer to an array of floats with the 3x3 matrix
  xyz | input vector to be multiplied by the transposed matrix

Returns
  result of matrix-vector multiplication, i.e. mat^T x xyz

## Max() [1/5]

double Max | ( | double | a,
|  | double | b
| ) |  |

inline

## Max() [2/5]

float Max | ( | float | a,
|  | float | b
| ) |  |

inline

## Max() [3/5]

int32_t Max | ( | int32_t | a,
|  | int32_t | b
| ) |  |

inline

## Max() [4/5]

template<typename Type >

Type Max | ( | Type | a,
|  | Type | b
| ) |  |

inline

## Max() [5/5]

uint32_t Max | ( | uint32_t | a,
|  | uint32_t | b
| ) |  |

inline

## MaxIndex()

template<typename Vec3T >

int MaxIndex | ( | const Vec3T & | v | ) |

inline

## memcpy64()

static void * memcpy64 | ( | void * | dst,
|  | const void * | src,
|  | size_t | word_count
| ) |  |

inlinestatic

copy 64 bit words from `src` to `dst`

Parameters

  dst | pointer to destination
  src | pointer to source
  word_count | number of 64 bit words to be copied

Returns
  destination pointer

Warning
  `src` and `dst` cannot overlap and should both be 64 bit aligned

## mergeGrids()

template<typename BufferT , template< class, class... > class VectorT>

GridHandle< BufferT > mergeGrids | ( | const VectorT< GridHandle< BufferT > > & | handles,
|  | const BufferT * | pool = `nullptr`
| ) |  |

inline

Combines (or merges) multiple GridHandles into a single GridHandle containing all grids.

Template Parameters

  BufferT | Type of the input and output grid buffers

Parameters

  handles | Vector of GridHandles to be combined
  pool | optional pool used for allocation of output GridHandle

Returns
  single GridHandle containing all input grids

## Min() [1/5]

double Min | ( | double | a,
|  | double | b
| ) |  |

inline

## Min() [2/5]

float Min | ( | float | a,
|  | float | b
| ) |  |

inline

## Min() [3/5]

int32_t Min | ( | int32_t | a,
|  | int32_t | b
| ) |  |

inline

## Min() [4/5]

template<typename Type >

Type Min | ( | Type | a,
|  | Type | b
| ) |  |

inline

## Min() [5/5]

uint32_t Min | ( | uint32_t | a,
|  | uint32_t | b
| ) |  |

inline

## MinIndex()

template<typename Vec3T >

int MinIndex | ( | const Vec3T & | v | ) |

inline

## nanoToOpenVDB() [1/2]

template<typename BufferT >

openvdb::GridBase::Ptr nanoToOpenVDB | ( | const GridHandle< BufferT > & | handle,
|  | int | verbose = `0`,
|  | uint32_t | n = `0`
| ) |  |

Forward declaration of free-standing function that de-serializes a NanoVDB GridHandle into an OpenVDB GridBase.

## nanoToOpenVDB() [2/2]

template<typename NanoBuildT >

openvdb::Grid< typenameopenvdb::tree::Tree4< typenameConvertTrait< NanoBuildT >::Type >::Type >::Ptr nanoToOpenVDB | ( | const NanoGrid< NanoBuildT > & | grid,
|  | int | verbose = `0`
| ) |  |

inline

Forward declaration of free-standing function that de-serializes a typed NanoVDB grid into an OpenVDB Grid.

## operator*() [1/2]

template<typename T1 , typename T2 >

Vec3< T2 > operator* | ( | T1 | scalar,
|  | const Vec3< T2 > & | vec
| ) |  |

inline

## operator*() [2/2]

template<typename T1 , typename T2 >

Vec4< T2 > operator* | ( | T1 | scalar,
|  | const Vec4< T2 > & | vec
| ) |  |

inline

## operator/() [1/2]

template<typename T1 , typename T2 >

Vec3< T2 > operator/ | ( | T1 | scalar,
|  | const Vec3< T2 > & | vec
| ) |  |

inline

## operator/() [2/2]

template<typename T1 , typename T2 >

Vec4< T2 > operator/ | ( | T1 | scalar,
|  | const Vec4< T2 > & | vec
| ) |  |

inline

## operator<<() [1/7]

std::ostream & operator<< | ( | std::ostream & | os,
|  | const AbsDiff & | diff
| ) |  |

inline

## operator<<() [2/7]

template<typename T >

std::ostream & operator<< | ( | std::ostream & | os,
|  | const BBox< Vec3< T > > & | b
| ) |  |

inline

## operator<<() [3/7]

std::ostream & operator<< | ( | std::ostream & | os,
|  | const Coord & | ijk
| ) |  |

inline

## operator<<() [4/7]

std::ostream & operator<< | ( | std::ostream & | os,
|  | const CoordBBox & | b
| ) |  |

inline

## operator<<() [5/7]

std::ostream & operator<< | ( | std::ostream & | os,
|  | const RelDiff & | diff
| ) |  |

inline

## operator<<() [6/7]

template<typename T >

std::ostream & operator<< | ( | std::ostream & | os,
|  | const Vec3< T > & | v
| ) |  |

inline

## operator<<() [7/7]

template<typename T >

std::ostream & operator<< | ( | std::ostream & | os,
|  | const Vec4< T > & | v
| ) |  |

inline

## pi() [1/4]

template<typename T >

constexpr T pi | ( |  | ) |

inlineconstexpr

Pi constant taken from Boost to match old behaviour.

## pi() [2/4]

template<>

constexpr float pi | ( |  | ) |

inlineconstexpr

## pi() [3/4]

template<>

constexpr double pi | ( |  | ) |

inlineconstexpr

## pi() [4/4]

template<>

constexpr long double pi | ( |  | ) |

inlineconstexpr

## Pow2()

template<typename T >

T Pow2 | ( | T | x | ) |

inline

## Pow3()

template<typename T >

T Pow3 | ( | T | x | ) |

inline

## Pow4()

template<typename T >

T Pow4 | ( | T | x | ) |

inline

## prefixSum()

template<typename T , typename OpT = std::plus<T>>

T prefixSum | ( | std::vector< T > & | vec,
|  | bool | threaded = `true`,
|  | OpT | op = `OpT()`
| ) |  |

Computes inclusive prefix sum of a vector.

Template Parameters

  T | Type of the elements in the input/out vector
  OpT | Type of operation performed on each element (defaults to sum)

Parameters

  vec | input and output vector
  threaded | if true multi-threading is used

Note
  Inclusive prefix sum: for (i=1; i<N; ++i) vec[i] += vec[i-1]

Returns
  sum of all input elements, which is also the last element of the inclusive prefix sum

## PtrAdd() [1/2]

template<typename DstT , typename SrcT >

static const DstT * PtrAdd | ( | const SrcT * | p,
|  | int64_t | offset
| ) |  |

inlinestatic

Adds a byte offset of a const pointer to produce another const pointer.

Template Parameters

  DstT | Type of the return pointer
  SrcT | Type of the input pointer

Parameters

  p | const input pointer, assumed to NOT be NULL
  offset | signed byte offset

Returns
  a const pointer defined as the offset of a const input pointer

## PtrAdd() [2/2]

template<typename DstT , typename SrcT >

static DstT * PtrAdd | ( | SrcT * | p,
|  | int64_t | offset
| ) |  |

inlinestatic

Adds a byte offset of a non-const pointer to produce another non-const pointer.

Template Parameters

  DstT | Type of the return pointer
  SrcT | Type of the input pointer

Parameters

  p | non-const input pointer, assumed to NOT be NULL
  offset | signed byte offset

Returns
  a non-const pointer defined as the offset of an input pointer

## PtrDiff()

template<typename T1 , typename T2 >

static int64_t PtrDiff | ( | const T1 * | p,
|  | const T2 * | q
| ) |  |

inlinestatic

Compute the distance, in bytes, between two pointers.

Template Parameters

  T1 | Type of the first pointer
  T2 | Type of the second pointer

Parameters

  p | fist pointer, assumed to NOT be NULL
  q | second pointer, assumed to NOT be NULL

Returns
  signed distance between pointer addresses in units of bytes

## reduce() [1/4]

template<template< typename... > class ContainerT, typename... ArgT, typename T , typename FuncT , typename JoinT >

T reduce | ( | const ContainerT< ArgT... > & | c,
|  | const T & | identity,
|  | const FuncT & | func,
|  | const JoinT & | join
| ) |  |

inline

Simple wrapper that works with std::containers.

## reduce() [2/4]

template<template< typename... > class ContainerT, typename... ArgT, typename T , typename FuncT , typename JoinT >

T reduce | ( | const ContainerT< ArgT... > & | c,
|  | size_t | grainSize,
|  | const T & | identity,
|  | const FuncT & | func,
|  | const JoinT & | join
| ) |  |

inline

Simple wrapper that works with std::containers.

## reduce() [3/4]

template<typename RangeT , typename T , typename FuncT , typename JoinT >

T reduce | ( | RangeT | range,
|  | const T & | identity,
|  | const FuncT & | func,
|  | const JoinT & | join
| ) |  |

inline

Returns
  reduction

Parameters

  range | RangeT can be Range<dim,T>, CoordBBox, tbb::blocked_range, blocked_range2D, or blocked_range3D.
  identity | initial value
  func | functor with signature T FuncT::operator()(const RangeT& range, const T& a) const

  join

  functor with the signature T JoinT::operator()(const T& a, const T& b) const
  std::vector<int> array(100, 1);
  auto func = [&array](auto &r, int a){for (auto i=r.begin(); i!=r.end(); ++i) a+=array[i]; return a;};
  int sum = reduce(array, 0, func, [](int a, int b){return a + b;});
  nanovdb::reduce
  T reduce(RangeT range, const T &identity, const FuncT &func, const JoinT &join)
  Definition Reduce.h:42

## reduce() [4/4]

template<typename T , typename FuncT , typename JoinT >

T reduce | ( | size_t | begin,
|  | size_t | end,
|  | size_t | grainSize,
|  | const T & | identity,
|  | const FuncT & | func,
|  | const JoinT & | join
| ) |  |

inline

Simple wrapper to the function defined above.

## Round() [1/3]

template<typename CoordT , template< typename > class Vec3T>

CoordT Round | ( | const Vec3T< double > & | xyz | ) |

inline

## Round() [2/3]

template<typename CoordT , template< typename > class Vec3T>

CoordT Round | ( | const Vec3T< float > & | xyz | ) |

inline

## Round() [3/3]

template<typename CoordT , typename RealT , template< typename > class Vec3T>

CoordT Round | ( | const Vec3T< RealT > & | xyz | ) |

inline

## RoundDown()

template<typename CoordT , typename RealT , template< typename > class Vec3T>

CoordT RoundDown | ( | const Vec3T< RealT > & | xyz | ) |

inline

## Sign()

template<typename T >

T Sign | ( | const T & | x | ) |

inline

Return the sign of the given value as an integer (either -1, 0 or 1).

## splitGrids()

template<typename BufferT , template< class, class... > class VectorT = std::vector>

VectorT< GridHandle< BufferT > > splitGrids | ( | const GridHandle< BufferT > & | handle,
|  | const BufferT * | other = `nullptr`
| ) |  |

inline

Split all grids in a single GridHandle into a vector of multiple GridHandles each with a single grid.

Template Parameters

  BufferT | Type of the input and output grid buffers

Parameters

  handle | GridHandle with grids that will be slip into individual GridHandles
  pool | optional pool used for allocation of output GridHandle

Returns
  Vector of GridHandles each containing a single grid

## Sqrt() [1/2]

double Sqrt | ( | double | x | ) |

inline

## Sqrt() [2/2]

float Sqrt | ( | float | x | ) |

inline

Return the square root of a floating-point value.

## toStr() [1/3]

const char * toStr | ( | GridClass | gridClass | ) |

inline

Retuns a c-string used to describe a GridClass.

## toStr() [2/3]

const char * toStr | ( | GridFlags | gridFlags | ) |

inline

Retuns a c-string used to describe a GridFlags.

## toStr() [3/3]

const char * toStr | ( | GridType | gridType | ) |

inline

Maps a GridType to a c-string.

Parameters

  gridType | GridType to be mapped to a string

Returns
  Retuns a c-string used to describe a GridType

## updateChecksum() [1/4]

bool updateChecksum | ( | GridData & | gridData,
|  | ChecksumMode | mode
| ) |  |

inline

## updateChecksum() [2/4]

bool updateChecksum | ( | GridData * | data | ) |

inline

Preserve the existing mode of the checksum and update it if it's not disabled.

Parameters

  data |

Returns

## updateChecksum() [3/4]

template<typename BuildT >

void updateChecksum | ( | NanoGrid< BuildT > & | grid,
|  | ChecksumMode | mode = `ChecksumMode::Default`
| ) |  |

Updates the checksum of a grid.

Parameters

  grid | Grid whose checksum will be updated.
  mode | Defines the mode of computation for the checksum.

## updateChecksum() [4/4]

template<typename ValueT >

void updateChecksum | ( | NanoGrid< ValueT > & | grid,
|  | ChecksumMode | mode
| ) |  |

## updateGridCount()

bool updateGridCount | ( | GridData * | data,
|  | uint32_t | gridIndex,
|  | uint32_t | gridCount
| ) |  |

inline

Updates the ground index and count, as well as the partial checksum if needed.

Parameters

  data | Pointer to grid data
  gridIndex | New value of the index
  gridCount | New value of the grid count

Returns
  returns true if the checksum was updated

## validateChecksum() [1/2]

template<typename BuildT >

bool validateChecksum | ( | const NanoGrid< BuildT > & | grid,
|  | ChecksumMode | mode = `ChecksumMode::Default`
| ) |  |

Return true if the checksum of the grid matches the expected value already encoded into the grid's meta data.

Template Parameters

  BuildT | Template parameter used to build NanoVDB grid.

Parameters

  grid | Grid whose checksum is validated.
  mode | Defines the mode of computation for the checksum.

## validateChecksum() [2/2]

template<typename ValueT >

bool validateChecksum | ( | const NanoGrid< ValueT > & | grid,
|  | ChecksumMode | mode
| ) |  |

## WENO5()

template<typename ValueType , typename RealT = ValueType>

__hostdev__ ValueType WENO5 | ( | const ValueType & | v1,
|  | const ValueType & | v2,
|  | const ValueType & | v3,
|  | const ValueType & | v4,
|  | const ValueType & | v5,
|  | RealT | scale2 = `1.0`
| ) |  |

inline

Implementation of nominally fifth-order finite-difference WENO.

This function returns the numerical flux. See "High Order Finite Difference and Finite Volume WENO Schemes and Discontinuous Galerkin Methods for CFD" - Chi-Wang Shu ICASE Report No 2001-11 (page 6). Also see ICASE No 97-65 for a more complete reference (Shu, 1997). Given v1 = f(x-2dx), v2 = f(x-dx), v3 = f(x), v4 = f(x+dx) and v5 = f(x+2dx), return an interpolated value f(x+dx/2) with the special property that ( f(x+dx/2) - f(x-dx/2) ) / dx = df/dx (x) + error, where the error is fifth-order in smooth regions: O(dx) <= error <=O(dx^5)

## ZeroCrossing()

template<typename RayT , typename AccT >

__hostdev__ bool ZeroCrossing | ( | RayT & | ray,
|  | AccT & | acc,
|  | Coord & | ijk,
|  | typename AccT::ValueType & | v,
|  | float & | t
| ) |  |

inline

returns true if the ray intersects a zero-crossing at the voxel level of the grid in the accessor The empty-space ray-marching is performed at all levels of the tree using an HDDA. If an intersection is detected, then ijk is updated with the index coordinate of the closest voxel after the intersection point, v contains the grid values at ijk, and t is set to the time of the intersection along the ray.

## ZeroCrossingNode()

template<typename RayT , typename NodeT >

__hostdev__ bool ZeroCrossingNode | ( | RayT & | ray,
|  | const NodeT & | node,
|  | float | v0,
|  | nanovdb::Coord & | ijk,
|  | float & | v,
|  | float & | t
| ) |  |

inline