OpenVDB: nanovdb Namespace Reference

OpenVDB 12.1.0

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

## Namespaces
namespace | io
namespace | util

## Classes
struct | BitArray
struct | BitArray< 16 >
struct | BitArray< 32 >
struct | BitArray< 64 >
struct | BitArray< 8 >
class | BitFlags
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 | Checksum
| 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 | 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(math::Coord) More...
struct | GetLeaf
| Return the pointer to the leaf node that contains math::Coord. Implements Tree::probeLeaf(math::Coord) More...
struct | GetLower
| Return point to the lower internal node where math::Coord maps to one of its values, i.e. terminates. More...
struct | GetNodeInfo
| Implements Tree::getNodeInfo(math::Coord) More...
struct | GetState
| Implements Tree::isActive(math::Coord) More...
struct | GetTile
| Return point to the root Tile where math::Coord maps to one of its values, i.e. terminates. More...
struct | GetUpper
| Return point to the upper internal node where math::Coord maps to one of its values, i.e. terminates. More...
struct | GetValue
| Below is an example of a struct used for random get methods. More...
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
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...
struct | GridTree
| defines a tree type from a grid type while preserving constness More...
struct | GridTree< const GridT >
class | Half
| Dummy type for a 16 bit floating point values (placeholder for IEEE 754 Half) 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 tree. More...
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...
class | Mask
| Bit-mask to encode active states and facilitate sequential iterators and a fast codec for I/O compression. 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 | 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 >
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 >
struct | ProbeValue
| Implements Tree::probeLeaf(math::Coord) More...
class | Range
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.
class | ReadAccessor< BuildT, LEVEL0, -1, -1 >
| Node caching at a single tree level. More...
class | ReadAccessor< BuildT, LEVEL0, LEVEL1, -1 >
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...
struct | SetValue
struct | SetVoxel
struct | TensorTraits
struct | TensorTraits< T, 0 >
struct | TensorTraits< T, 1 >
class | Timer
class | Tree
| VDB Tree, which is a thin wrapper around a RootNode. More...
struct | TreeData
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 | Version
| Bit-compacted representation of all three version numbers. More...

## Typedefs
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>

## 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 , UInt8 = 26 , End = 27 , StrLen = End + 12 }
| 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 , StrLen = End + 7 }
| 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 , StrLen = End + 23 }
| Grid flags which indicate what extra information is present in the grid buffer. More...
enum class | MagicType : uint32_t { Unknown = 0 , OpenVDB = 1 , NanoVDB = 2 , NanoGrid = 3 , NanoFile = 4 , End = 5 , StrLen = End + 14 }
| Enums used to identify magic numbers recognized by NanoVDB. More...
enum class | PointType : uint32_t { Disable = 0 , PointID = 1 , World64 = 2 , World32 = 3 , Grid64 = 4 , Grid32 = 5 , Voxel32 = 6 , Voxel16 = 7 , Voxel8 = 8 , Default = 9 , End =10 }
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 | CheckMode : uint32_t { Disable = 0 , Empty = 0 , Half = 1 , Partial = 1 , Default = 1 , Full = 2 , End = 3 , StrLen = 9 + End }
| List of different modes for computing for a checksum. More...

## Functions
void | cpyGridHandleMeta (const GridData *data, GridHandleMetaData *meta)
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<class EnumT>
__hostdev__ constexpr uint32_t | strlen ()
| return the number of characters (including null termination) required to convert enum type to a string
__hostdev__ char * | toStr (char *dst, GridType gridType)
| Maps a GridType to a c-string.
__hostdev__ char * | toStr (char *dst, GridClass gridClass)
| Retuns a c-string used to describe a GridClass.
__hostdev__ const char * | toStr (char *dst, GridFlags gridFlags)
| Retuns a c-string used to describe a GridFlags.
__hostdev__ MagicType | toMagic (uint64_t magic)
| maps 64 bits of magic number to enum
__hostdev__ char * | toStr (char *dst, MagicType magic)
| print 64-bit magic number to string
static __hostdev__ bool | isAligned (const void *p)
| return true if the specified pointer is 32 byte aligned
static __hostdev__ uint64_t | alignmentPadding (const void *p)
| return the smallest number of bytes that when added to the specified pointer results in a 32 byte aligned pointer.
template<typename T>
static __hostdev__ T * | alignPtr (T *p)
| offset the specified pointer so it is 32 byte aligned. Works with both const and non-const pointers.
__hostdev__ bool | isFloatingPoint (GridType gridType)
| return true if the GridType maps to a floating point type
__hostdev__ bool | isFloatingPointVector (GridType gridType)
| return true if the GridType maps to a floating point vec3.
__hostdev__ bool | isInteger (GridType gridType)
| Return true if the GridType maps to a POD integer type.
__hostdev__ bool | isIndex (GridType gridType)
| Return true if the GridType maps to a special index type (not a POD integer type).
__hostdev__ bool | isValid (GridType gridType, GridClass gridClass)
| return true if the combination of GridType and GridClass is valid.
__hostdev__ bool | isValid (const GridBlindDataClass &blindClass, const GridBlindDataSemantic &blindSemantics, const GridType &blindType)
| return true if the combination of GridBlindDataClass, GridBlindDataSemantic and GridType is valid.
__hostdev__ char * | toStr (char *dst, const Version &v)
| print the verion number to a c-string
template<typename BuildT>
__hostdev__ GridType | toGridType ()
| Maps from a templated build type to a GridType enum.
template<typename BuildT>
__hostdev__ GridType | mapToGridType ()
template<typename BuildT>
__hostdev__ GridClass | toGridClass (GridClass defaultClass=GridClass::Unknown)
| Maps from a templated build type to a GridClass enum.
template<typename BuildT>
__hostdev__ GridClass | mapToGridClass (GridClass defaultClass=GridClass::Unknown)
__hostdev__ char * | toStr (char *dst, CheckMode mode)
| Prints CheckMode enum to a c-string.
__hostdev__ CheckMode | toCheckMode (const Checksum &checksum)
| Maps 64 bit checksum to CheckMode enum.
template<typename OpT, typename GridDataT, typename... ArgsT>
auto | callNanoGrid (GridDataT *gridData, ArgsT &&... args)
| Below is an example of the struct used for generic programming with callNanoGrid.
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 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 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 Func, typename... Rest>
int | invoke (const Func &taskFunc1, Rest... taskFuncN)
template<typename T, typename OpT = std::plus<T>>
T | prefixSum (std::vector< T > &vec, bool threaded=true, OpT op=OpT())
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.
uint32_t | FindLowestOn (uint32_t v)
uint32_t | FindLowestOn (uint64_t v)
uint32_t | FindHighestOn (uint32_t v)
uint32_t | FindHighestOn (uint64_t v)
uint32_t | CountOn (uint64_t v)

## Typedef Documentation

## ◆ BoolGrid

using BoolGrid = Grid<BoolTree>

## ◆ BoolTree

using BoolTree = NanoTree<bool>

## ◆ 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>

## ◆ PointGrid

using PointGrid = Grid<Point>

## ◆ UInt32Grid

using UInt32Grid = Grid<UInt32Tree>

## ◆ UInt32Tree

using UInt32Tree = NanoTree<uint32_t>

## ◆ Vec3dGrid

using Vec3dGrid = Grid<Vec3dTree>

## ◆ Vec3dTree

using Vec3dTree = NanoTree<Vec3d>

## ◆ Vec3fGrid

using Vec3fGrid = Grid<Vec3fTree>

## ◆ Vec3fTree

using Vec3fTree = NanoTree<Vec3f>

## ◆ Vec3IGrid

using Vec3IGrid = Grid<Vec3ITree>

## ◆ Vec3ITree

using Vec3ITree = NanoTree<Vec3i>

## ◆ Vec4dGrid

using Vec4dGrid = Grid<Vec4dTree>

## ◆ Vec4dTree

using Vec4dTree = NanoTree<Vec4d>

## ◆ Vec4fGrid

using Vec4fGrid = Grid<Vec4fTree>

## ◆ Vec4fTree

using Vec4fTree = NanoTree<Vec4f>

## Enumeration Type Documentation

## ◆ CheckMode

enum class CheckMode : uint32_t
| strong

List of different modes for computing for a checksum.

Enumerator
Disable |
Empty |
Half |
Partial |
Default |
Full |
End |
StrLen |

## ◆ 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 |
StrLen |

## ◆ 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 |
StrLen |

## ◆ 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 toGridType (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 |
UInt8 |
End |
StrLen |

## ◆ MagicType

enum class MagicType : uint32_t
| strong

Enums used to identify magic numbers recognized by NanoVDB.

Enumerator
Unknown |
OpenVDB |
NanoVDB |
NanoGrid |
NanoFile |
End |
StrLen |

## ◆ PointType

enum class PointType : uint32_t
| strong

Enumerator
Disable |
PointID |
World64 |
World32 |
Grid64 |
Grid32 |
Voxel32 |
Voxel16 |
Voxel8 |
Default |
End |

## Function Documentation

## ◆ alignmentPadding()

__hostdev__ uint64_t alignmentPadding | ( | const void * | p | ) |
| inlinestatic

return the smallest number of bytes that when added to the specified pointer results in a 32 byte aligned pointer.

## ◆ alignPtr()

template<typename T>

__hostdev__ T * alignPtr | ( | T * | p | ) |
| inlinestatic

offset the specified pointer so it is 32 byte aligned. Works with both const and non-const pointers.

## ◆ callNanoGrid()

template<typename OpT, typename GridDataT, typename... ArgsT>

auto callNanoGrid | ( | GridDataT * | gridData,
|  | ArgsT &&... | args )

Below is an example of the struct used for generic programming with callNanoGrid.

For an example see "struct Crc32TailOld" in nanovdb/tools/GridChecksum.h or "struct IsNanoGridValid" in nanovdb/tools/GridValidator.h

struct OpT {
// define these two static functions with non-const GridData
template <typename BuildT>
static auto known( GridData *gridData, args...);
static auto unknown( GridData *gridData, args...);
// or alternatively these two static functions with const GridData
template <typename BuildT>
static auto known(const GridData *gridData, args...);
static auto unknown(const GridData *gridData, args...);
};
nanovdb::GridData
Struct with all the member data of the Grid (useful during serialization of an openvdb grid)
Definition NanoVDB.h:1895

Here is an example of how to use callNanoGrid in client code

return callNanoGrid<OpT>(gridData, args...);
nanovdb::callNanoGrid
auto callNanoGrid(GridDataT *gridData, ArgsT &&... args)
Below is an example of the struct used for generic programming with callNanoGrid.
Definition NanoVDB.h:4719

Use this function, which depends a pointer to GridData, to call other functions that depend on a NanoGrid of a known ValueType.

This function allows for generic programming by converting GridData to a NanoGrid of the type encoded in GridData::mGridType.

## ◆ CountOn()

uint32_t CountOn | ( | uint64_t | v | ) |
| inline

## ◆ cpyGridHandleMeta()

void cpyGridHandleMeta | ( | const GridData * | data,
|  | GridHandleMetaData * | meta )
| inline

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

## ◆ 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.

## ◆ FindHighestOn() [1/2]

uint32_t FindHighestOn | ( | uint32_t | v | ) |
| inline

## ◆ FindHighestOn() [2/2]

uint32_t FindHighestOn | ( | uint64_t | v | ) |
| inline

## ◆ FindLowestOn() [1/2]

uint32_t FindLowestOn | ( | uint32_t | v | ) |
| inline

## ◆ FindLowestOn() [2/2]

uint32_t FindLowestOn | ( | uint64_t | v | ) |
| inline

## ◆ forEach() [1/3]

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/3]

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/3]

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.

## ◆ invoke()

template<typename Func, typename... Rest>

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

## ◆ isAligned()

__hostdev__ bool isAligned | ( | const void * | p | ) |
| inlinestatic

return true if the specified pointer is 32 byte aligned

## ◆ isFloatingPoint()

__hostdev__ bool isFloatingPoint | ( | GridType | gridType | ) |
| inline

return true if the GridType maps to a floating point type

## ◆ isFloatingPointVector()

__hostdev__ bool isFloatingPointVector | ( | GridType | gridType | ) |
| inline

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

## ◆ isIndex()

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

__hostdev__ 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/2]

__hostdev__ 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/2]

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

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

## ◆ mapToGridClass()

template<typename BuildT>

__hostdev__ GridClass mapToGridClass | ( | GridClass | defaultClass = GridClass::Unknown | ) |
| inline

## ◆ mapToGridType()

template<typename BuildT>

__hostdev__ GridType mapToGridType | ( |  | ) |
| inline

## ◆ 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

## ◆ prefixSum()

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

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

## ◆ reduce() [1/3]

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/3]

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.

## ◆ reduce() [3/3]

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.

## ◆ 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

## ◆ strlen()

template<class EnumT>

__hostdev__ constexpr uint32_t strlen | ( |  | ) |
| inlineconstexpr

return the number of characters (including null termination) required to convert enum type to a string

Note
  This curious implementation, which subtracts End from StrLen, avoids duplicate values in the enum!

## ◆ toCheckMode()

__hostdev__ CheckMode toCheckMode | ( | const Checksum & | checksum | ) |
| inline

Maps 64 bit checksum to CheckMode enum.

Parameters

  checksum | 64 bit checksum with two CRC32 codes

Returns
  CheckMode enum

## ◆ toGridClass()

template<typename BuildT>

__hostdev__ GridClass toGridClass | ( | GridClass | defaultClass = GridClass::Unknown | ) |
| inline

Maps from a templated build type to a GridClass enum.

## ◆ toGridType()

template<typename BuildT>

__hostdev__ GridType toGridType | ( |  | ) |
| inline

Maps from a templated build type to a GridType enum.

## ◆ toMagic()

__hostdev__ MagicType toMagic | ( | uint64_t | magic | ) |
| inline

maps 64 bits of magic number to enum

## ◆ toStr() [1/6]

__hostdev__ char * toStr | ( | char * | dst,
|  | CheckMode | mode )
| inline

Prints CheckMode enum to a c-string.

Parameters

  dst | Destination c-string
  mode | CheckMode enum to be converted to string

Returns
  destinations string `dst`

## ◆ toStr() [2/6]

__hostdev__ char * toStr | ( | char * | dst,
|  | const Version & | v )
| inline

print the verion number to a c-string

Parameters

  dst | destination string of size 8 or more
  v | version to be printed

Returns
  returns destination string `dst`

## ◆ toStr() [3/6]

__hostdev__ char * toStr | ( | char * | dst,
|  | GridClass | gridClass )
| inline

Retuns a c-string used to describe a GridClass.

Parameters

  dst | destination string of size 7 or larger
  gridClass | GridClass enum to be converted to a string

## ◆ toStr() [4/6]

__hostdev__ const char * toStr | ( | char * | dst,
|  | GridFlags | gridFlags )
| inline

Retuns a c-string used to describe a GridFlags.

Parameters

  dst | destination string of size 23 or larger
  gridFlags | GridFlags enum to be converted to a string

## ◆ toStr() [5/6]

__hostdev__ char * toStr | ( | char * | dst,
|  | GridType | gridType )
| inline

Maps a GridType to a c-string.

Parameters

  dst | destination string of size 12 or larger
  gridType | GridType enum to be mapped to a string

Returns
  Retuns a c-string used to describe a GridType

## ◆ toStr() [6/6]

__hostdev__ char * toStr | ( | char * | dst,
|  | MagicType | magic )
| inline

print 64-bit magic number to string

Parameters

  dst | destination string of size 25 or larger
  magic | 64 bit magic number to be printed

Returns
  return destination string `dst`