OpenVDB  12.0.0
Namespaces | Classes | Typedefs | Enumerations | Functions
nanovdb Namespace Reference

Namespaces

 io
 
 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  GetUpper
 Return point to the upper internal node where math::Coord maps to one of its values, i.e. terminates. More...
 
struct  GetValue
 Implements Tree::getValue(math::Coord), i.e. return the value associated with a specific coordinate ijk. 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  ReadAccessor
 
class  ReadAccessor< BuildT, 0, 1, 2 >
 Node caching at all (three) tree levels. More...
 
class  ReadAccessor< BuildT, LEVEL0, LEVEL1,-1 >
 
class  ReadAccessor< BuildT, LEVEL0,-1,-1 >
 Node caching at a single tree level. More...
 
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...
 
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  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. More...
 
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 instead = util::Range< 1, size_t >
 

Enumerations

enum  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  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  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  MagicType : uint32_t {
  Unknown = 0, OpenVDB = 1, NanoVDB = 2, NanoGrid = 3,
  NanoFile = 4, NanoNode = 5, NanoFrag = 6, End = 7,
  StrLen = End + 25
}
 Enums used to identify magic numbers recognized by NanoVDB. More...
 
enum  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  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  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  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

__hostdev__ 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. More...
 
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. More...
 
template<class EnumT >
__hostdev__ constexpr uint32_t strlen ()
 return the number of characters (including null termination) required to convert enum type to a string More...
 
__hostdev__ char * toStr (char *dst, GridType gridType)
 Maps a GridType to a c-string. More...
 
__hostdev__ char * toStr (char *dst, GridClass gridClass)
 Retuns a c-string used to describe a GridClass. More...
 
__hostdev__ const char * toStr (char *dst, GridFlags gridFlags)
 Retuns a c-string used to describe a GridFlags. More...
 
__hostdev__ MagicType toMagic (uint64_t magic)
 maps 64 bits of magic number to enum More...
 
__hostdev__ char * toStr (char *dst, MagicType magic)
 print 64-bit magic number to string More...
 
static __hostdev__ bool isAligned (const void *p)
 return true if the specified pointer is 32 byte aligned More...
 
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. More...
 
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. More...
 
__hostdev__ bool isFloatingPoint (GridType gridType)
 return true if the GridType maps to a floating point type More...
 
__hostdev__ bool isFloatingPointVector (GridType gridType)
 return true if the GridType maps to a floating point vec3. More...
 
__hostdev__ bool isInteger (GridType gridType)
 Return true if the GridType maps to a POD integer type. More...
 
__hostdev__ bool isIndex (GridType gridType)
 Return true if the GridType maps to a special index type (not a POD integer type). More...
 
__hostdev__ bool isValid (GridType gridType, GridClass gridClass)
 return true if the combination of GridType and GridClass is valid. More...
 
__hostdev__ bool isValid (const GridBlindDataClass &blindClass, const GridBlindDataSemantic &blindSemantics, const GridType &blindType)
 return true if the combination of GridBlindDataClass, GridBlindDataSemantic and GridType is valid. More...
 
__hostdev__ char * toStr (char *dst, const Version &v)
 print the verion number to a c-string More...
 
template<typename BuildT >
__hostdev__ GridType toGridType ()
 Maps from a templated build type to a GridType enum. More...
 
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. More...
 
template<typename BuildT >
__hostdev__ GridClass mapToGridClass (GridClass defaultClass=GridClass::Unknown)
 
__hostdev__ char * toStr (char *dst, CheckMode mode)
 Prints CheckMode enum to a c-string. More...
 
__hostdev__ CheckMode toCheckMode (const Checksum &checksum)
 Maps 64 bit checksum to CheckMode enum. More...
 
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. More...
 
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. More...
 
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 More...
 
template<typename FuncT >
void forEach (size_t begin, size_t end, size_t grainSize, const FuncT &func)
 Simple wrapper for the function defined above. More...
 
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. More...
 
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. More...
 
template<typename Func , typename... Rest>
int invoke (const Func &taskFunc1, Rest...taskFuncN)
 
template<typename T , typename OpT = std::plus<T>>
prefixSum (std::vector< T > &vec, bool threaded=true, OpT op=OpT())
 
template<typename T , typename FuncT , typename JoinT >
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. More...
 
template<template< typename... > class ContainerT, typename... ArgT, typename T , typename FuncT , typename JoinT >
reduce (const ContainerT< ArgT... > &c, const T &identity, const FuncT &func, const JoinT &join)
 Simple wrapper that works with std::containers. More...
 
template<template< typename... > class ContainerT, typename... ArgT, typename T , typename FuncT , typename JoinT >
reduce (const ContainerT< ArgT... > &c, size_t grainSize, const T &identity, const FuncT &func, const JoinT &join)
 Simple wrapper that works with std::containers. More...
 
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

using BoolTree = NanoTree<bool>
using DefaultReadAccessor = ReadAccessor<BuildT, 0, 1, 2>
using DoubleTree = NanoTree<double>
using FloatTree = NanoTree<float>
using Fp4Grid = Grid<Fp4Tree>
using Fp4Tree = NanoTree<Fp4>
using Fp8Grid = Grid<Fp8Tree>
using Fp8Tree = NanoTree<Fp8>
using FpNGrid = Grid<FpNTree>
using FpNTree = NanoTree<FpN>
using Int32Tree = NanoTree<int32_t>
using Int64Tree = NanoTree<int64_t>
using NanoGrid = Grid<NanoTree<BuildT>>
using NanoLeaf = LeafNode<BuildT, Coord, Mask, 3>

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

using NanoLower = InternalNode<NanoLeaf<BuildT>, 4>
using NanoRoot = RootNode<NanoUpper<BuildT>>
using NanoTree = Tree<NanoRoot<BuildT>>
using NanoUpper = InternalNode<NanoLower<BuildT>, 5>
using PointGrid = Grid<Point>
using UInt32Tree = NanoTree<uint32_t>
using Vec3dTree = NanoTree<Vec3d>
using Vec3fTree = NanoTree<Vec3f>
using Vec3ITree = NanoTree<Vec3i>
using Vec4dTree = NanoTree<Vec4d>
using Vec4fTree = NanoTree<Vec4f>

Enumeration Type Documentation

enum CheckMode : uint32_t
strong

List of different modes for computing for a checksum.

Enumerator
Disable 
Empty 
Half 
Partial 
Default 
Full 
End 
StrLen 
enum GridBlindDataClass : uint32_t
strong

Blind-data Classes that are currently supported by NanoVDB.

Enumerator
Unknown 
IndexArray 
AttributeArray 
GridName 
ChannelArray 
End 
enum 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 
enum 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 
enum 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 
enum 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 
enum MagicType : uint32_t
strong

Enums used to identify magic numbers recognized by NanoVDB.

Enumerator
Unknown 
OpenVDB 
NanoVDB 
NanoGrid 
NanoFile 
NanoNode 
NanoFrag 
End 
StrLen 
enum PointType : uint32_t
strong
Enumerator
Disable 
PointID 
World64 
World32 
Grid64 
Grid32 
Voxel32 
Voxel16 
Voxel8 
Default 
End 

Function Documentation

static __hostdev__ uint64_t nanovdb::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.

static __hostdev__ T* nanovdb::alignPtr ( T *  p)
inlinestatic

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

auto nanovdb::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...);
};

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

return callNanoGrid<OpT>(gridData, args...);

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.

uint32_t nanovdb::CountOn ( uint64_t  v)
inline
__hostdev__ void nanovdb::cpyGridHandleMeta ( const GridData data,
GridHandleMetaData meta 
)
inline
ReadAccessor<ValueT, LEVEL0, LEVEL1, LEVEL2> nanovdb::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

ReadAccessor<ValueT, LEVEL0, LEVEL1, LEVEL2> nanovdb::createAccessor ( const NanoTree< ValueT > &  tree)
ReadAccessor<ValueT, LEVEL0, LEVEL1, LEVEL2> nanovdb::createAccessor ( const NanoRoot< ValueT > &  root)
NodeManagerHandle< BufferT > createNodeManager ( const NanoGrid< BuildT > &  grid,
const BufferT &  buffer = BufferT() 
)

brief Construct a NodeManager and return its handle

Parameters
gridgrid whose nodes will be accessed sequentially
bufferbuffer 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.
uint32_t nanovdb::FindHighestOn ( uint32_t  v)
inline
uint32_t nanovdb::FindHighestOn ( uint64_t  v)
inline
uint32_t nanovdb::FindLowestOn ( uint32_t  v)
inline
uint32_t nanovdb::FindLowestOn ( uint64_t  v)
inline
void nanovdb::forEach ( size_t  begin,
size_t  end,
size_t  grainSize,
const FuncT &  func 
)
inline

Simple wrapper for the function defined above.

void nanovdb::forEach ( const ContainerT< T... > &  c,
const FuncT &  func 
)
inline

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

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

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

int nanovdb::invoke ( const Func &  taskFunc1,
Rest...  taskFuncN 
)
static __hostdev__ bool nanovdb::isAligned ( const void *  p)
inlinestatic

return true if the specified pointer is 32 byte aligned

__hostdev__ bool nanovdb::isFloatingPoint ( GridType  gridType)
inline

return true if the GridType maps to a floating point type

__hostdev__ bool nanovdb::isFloatingPointVector ( GridType  gridType)
inline

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

__hostdev__ bool nanovdb::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.

__hostdev__ bool nanovdb::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

__hostdev__ bool nanovdb::isValid ( GridType  gridType,
GridClass  gridClass 
)
inline

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

__hostdev__ bool nanovdb::isValid ( const GridBlindDataClass blindClass,
const GridBlindDataSemantic blindSemantics,
const GridType blindType 
)
inline

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

__hostdev__ GridClass nanovdb::mapToGridClass ( GridClass  defaultClass = GridClass::Unknown)
inline
__hostdev__ GridType nanovdb::mapToGridType ( )
inline
GridHandle<BufferT> nanovdb::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
BufferTType of the input and output grid buffers
Parameters
handlesVector of GridHandles to be combined
pooloptional pool used for allocation of output GridHandle
Returns
single GridHandle containing all input grids
T nanovdb::prefixSum ( std::vector< T > &  vec,
bool  threaded = true,
OpT  op = OpT() 
)
T nanovdb::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.

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

Simple wrapper that works with std::containers.

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

Simple wrapper that works with std::containers.

VectorT<GridHandle<BufferT> > nanovdb::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
BufferTType of the input and output grid buffers
Parameters
handleGridHandle with grids that will be slip into individual GridHandles
pooloptional pool used for allocation of output GridHandle
Returns
Vector of GridHandles each containing a single grid
__hostdev__ constexpr uint32_t nanovdb::strlen ( )
inline

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

__hostdev__ CheckMode nanovdb::toCheckMode ( const Checksum checksum)
inline

Maps 64 bit checksum to CheckMode enum.

Parameters
checksum64 bit checksum with two CRC32 codes
Returns
CheckMode enum
__hostdev__ GridClass nanovdb::toGridClass ( GridClass  defaultClass = GridClass::Unknown)
inline

Maps from a templated build type to a GridClass enum.

__hostdev__ GridType nanovdb::toGridType ( )
inline

Maps from a templated build type to a GridType enum.

__hostdev__ MagicType nanovdb::toMagic ( uint64_t  magic)
inline

maps 64 bits of magic number to enum

__hostdev__ char* nanovdb::toStr ( char *  dst,
GridType  gridType 
)
inline

Maps a GridType to a c-string.

Parameters
dstdestination string of size 12 or larger
gridTypeGridType enum to be mapped to a string
Returns
Retuns a c-string used to describe a GridType
__hostdev__ char* nanovdb::toStr ( char *  dst,
GridClass  gridClass 
)
inline

Retuns a c-string used to describe a GridClass.

Parameters
dstdestination string of size 7 or larger
gridClassGridClass enum to be converted to a string
__hostdev__ const char* nanovdb::toStr ( char *  dst,
GridFlags  gridFlags 
)
inline

Retuns a c-string used to describe a GridFlags.

Parameters
dstdestination string of size 23 or larger
gridFlagsGridFlags enum to be converted to a string
__hostdev__ char* nanovdb::toStr ( char *  dst,
MagicType  magic 
)
inline

print 64-bit magic number to string

Parameters
dstdestination string of size 25 or larger
magic64 bit magic number to be printed
Returns
return destination string dst
__hostdev__ char* nanovdb::toStr ( char *  dst,
const Version v 
)
inline

print the verion number to a c-string

Parameters
dstdestination string of size 8 or more
vversion to be printed
Returns
returns destination string dst
__hostdev__ char* nanovdb::toStr ( char *  dst,
CheckMode  mode 
)
inline

Prints CheckMode enum to a c-string.

Parameters
dstDestination c-string
modeCheckMode enum to be converted to string
Returns
destinations string dst