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

Defines a simple memory pool used to call cub functions that use dynamic temporary storage. More...

Namespaces

namespace  cuda
namespace  detail
namespace  io
namespace  math
namespace  tools
namespace  util

Classes

struct  ActiveExact
 Policy that exactly matches separate getDim and isActive calls. A skip flag still controls dim but cannot stop the active-state descent: GridStats flags value range versus render delta, not activeness. This costs a full descent through skipped InternalNodes; use it when active is read unconditionally, such as by HDDA iterators observing upper-level activeness. More...
struct  ActiveOnLeafOnly
 Policy that preserves getDim's skip-flag fast path. If an InternalNode short-circuits, active is unspecified and must be gated on dim. Otherwise the leaf-level active read is fused into the descent. Use for logic such as if (hdda.dim() > 1 || !active) continue;, where the short-circuit ensures active is read only after a leaf-level descent. More...
struct  BBox
struct  BitArray
struct  BitArray< 16 >
struct  BitArray< 32 >
struct  BitArray< 64 >
struct  BitArray< 8 >
class  BitFlags
struct  BufferHasByteElements
 Detects whether a buffer's elements are byte-sized. Buffers that expose no ElementType (e.g. HostBuffer) address raw bytes by definition, so the primary defaults to true. More...
struct  BufferHasByteElements< BufferT, std::void_t< typename BufferT::ElementType > >
struct  BufferHasDestroy
 Detects whether a buffer provides destroy(), the cuda::Buffer spelling for releasing its storage. Handle reset() dispatches to it when present and falls back to the legacy clear() otherwise. More...
struct  BufferHasDestroy< BufferT, std::void_t< decltype(std::declval< BufferT & >().destroy())> >
struct  BufferHasDeviceSingle
 Detects whether BufferTraits<BufferT> defines hasDeviceSingle, i.e. whether the buffer manages a single device-resident allocation. More...
struct  BufferHasDeviceSingle< BufferT, std::void_t< decltype(BufferTraits< BufferT >::hasDeviceSingle)> >
struct  BufferHasHostSingle
 Companion detection for BufferTraits<...>::hasHostSingle: a single-space buffer whose storage is host-accessible (e.g. a pinned-resource cuda::Buffer). More...
struct  BufferHasHostSingle< BufferT, std::void_t< decltype(BufferTraits< BufferT >::hasHostSingle)> >
struct  BufferHasStream
 Detects whether a buffer exposes a retained stream (a stream() member), i.e. whether its resource is stream-ordered. Used to pick the buffer's stream-taking constructor without naming CUDA types. More...
struct  BufferHasStream< BufferT, std::void_t< decltype(std::declval< const BufferT & >().stream())> >
struct  BufferIsDefaultConstructible
 Detects whether a buffer type is default-constructible, so consumers can name that requirement in a static_assert instead of failing wherever the default construction happens to occur. More...
struct  BufferIsDefaultConstructible< BufferT, std::void_t< decltype(BufferT())> >
struct  BufferIsDeviceOnly
 A single-space buffer whose storage the host cannot read: the device-single family minus its host-accessible members (managed or pinned resources). This is the predicate that gates the handles' host accessors off. More...
struct  BufferTraits
struct  BufferTraits< cuda::Buffer< T, R > >
 GridHandle support for the single-space cuda::Buffer: the buffer owns exactly one allocation, resident on the device, so the handle parses metadata through a device read and exposes only the device accessors. Requires byte-addressed storage. More...
struct  BufferTraits< cuda::DualDeviceBuffer >
struct  BufferTraits< cuda::DualUnifiedBuffer >
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< ValueMask >
struct  BuildToValueMap< ValueOnIndex >
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...
class  Coord
 Signed (i, j, k) 32-bit integer coordinate class, similar to openvdb::math::Coord. More...
struct  DimAndActive
 Result of a fused ReadAccessor::getDimAndActive traversal: the getDim(ijk, ray) step size and the policy-dependent active state of ijk. More...
class  DualDeviceBuffer
 Simple memory buffer using un-managed pinned host memory when compiled with NVCC. Obviously this class is making explicit used of CUDA so replace it with your own memory allocator if you are not using CUDA. More...
struct  FloatTraits
struct  FloatTraits< bool, 1 >
struct  FloatTraits< Point, 1 >
struct  FloatTraits< T, 8 >
struct  FloatTraits< ValueIndex, 1 >
struct  FloatTraits< ValueMask, 1 >
struct  FloatTraits< ValueOnIndex, 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  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...
 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< ValueMask, CoordT, MaskT, LOG2DIM >
struct  LeafData< ValueOnIndex, 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  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.
class  ReadAccessor< BuildT, LEVEL0, -1, -1 >
 Node caching at a single tree level. More...
class  ReadAccessor< BuildT, LEVEL0, LEVEL1, -1 >
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...
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  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  Version
 Bit-compacted representation of all three version numbers. More...

Typedefs

template<typename T>
using BuildToValueMapT = typename BuildToValueMap<T>::type
template<typename GridOrTreeOrRootT, int LEVEL>
using NodeTraitT = typename NodeTrait<GridOrTreeOrRootT, LEVEL>::type
template<typename BuildT>
using DefaultReadAccessor = ReadAccessor<BuildT, 0, 1, 2>
template<typename GridT>
using GridTreeT = typename GridTree<GridT>::type
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>>
template<typename BuildT, int LEVEL>
using NanoNodeT = typename NanoNode<BuildT, LEVEL>::type
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 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>
template<typename BuildT, typename ValueT>
using AccType
 Generic Accessor type that maps to either a ReadAccessor or ChannelAccessor.
using Vec3d = math::Vec3<double>
using Vec3f = math::Vec3<float>
using Vec3i = math::Vec3<int32_t>
using Vec3u = math::Vec3<uint32_t>
using Vec3u8 = math::Vec3<uint8_t>
using Vec3u16 = math::Vec3<uint16_t>
using Vec4R = math::Vec4<double>
using Vec4d = math::Vec4<double>
using Vec4f = math::Vec4<float>
using Vec4i = math::Vec4<int>
using CoordBBox = math::BBox<Coord>
using Vec3dBBox = math::BBox<Vec3d>
using Vec3d

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 , PointIndex = 23 , Vec3u8 = 24 , Vec3u16 = 25 ,
  UInt8 = 26 , End = 27 , StrLen = End + 11
}
 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 , VoxelBVH = 10 , End = 11 ,
  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 , LevelSet = 10 , FogVolume = 11 ,
  Staggered = 12 , PointOpacity = 13 , PointQuat = 14 , PointScale = 15 ,
  PointSH0 = 16 , PointSHN = 17 , LineId = 18 , TriangleId = 19 ,
  GaussianId = 20 , Range = 21 , VoxelBVH = 22 , End = 23
}
 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

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>
constexpr uint32_t strlen ()
 return the number of characters (including null termination) required to convert enum type to a string
char * toStr (char *dst, GridType gridType)
 Maps a GridType to a c-string.
char * toStr (char *dst, GridClass gridClass)
 Retuns a c-string used to describe a GridClass.
const char * toStr (char *dst, GridFlags gridFlags)
 Retuns a c-string used to describe a GridFlags.
MagicType toMagic (uint64_t magic)
 maps 64 bits of magic number to enum
char * toStr (char *dst, MagicType magic)
 print 64-bit magic number to string
GridClass toGridClass (GridBlindDataSemantic semantics, GridClass defaultClass=GridClass::Unknown)
 Maps from GridBlindDataSemantic to GridClass.
GridBlindDataSemantic toSemantic (GridClass gridClass, GridBlindDataSemantic defaultSemantic=GridBlindDataSemantic::Unknown)
 Maps from GridClass to GridBlindDataSemantic.
static bool isAligned (const void *p)
 return true if the specified pointer is 32 byte aligned
static 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 T * alignPtr (T *p)
 offset the specified pointer so it is 32 byte aligned. Works with both const and non-const pointers.
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).
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.
char * toStr (char *dst, const Version &v)
 print the verion number to a c-string
template<typename BuildT>
GridType toGridType ()
 Maps from a templated build type to a GridType enum.
template<typename BuildT>
GridType mapToGridType ()
template<typename BuildT>
GridClass toGridClass (GridClass defaultClass=GridClass::Unknown)
 Maps from a templated build type to a GridClass enum.
template<typename BuildT>
GridClass mapToGridClass (GridClass defaultClass=GridClass::Unknown)
char * toStr (char *dst, CheckMode mode)
 Prints CheckMode enum to a c-string.
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 GridT, typename ValueT>
auto getAccessor (const GridT &grid, ValueT *sideCar=nullptr)
 Generic template functions that return an Accessor to either an index grid or a regular grid.
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<int Order, typename TreeOrAccT, bool UseCache = true>
math::SampleFromVoxels< TreeOrAccT, Order, UseCache > createSampler (const TreeOrAccT &acc)
template<typename ValueT>
__hostdev__ char * checkGrid (const NanoGrid< ValueT > *grid, char *error, CheckMode mode=CheckMode::Full)
template<typename ValueT>
bool isValid (const NanoGrid< ValueT > *grid, CheckMode mode, bool verbose=false)
template<typename NanoBuildT>
tools::trait::OpenGridPtr< NanoBuildT > nanoToOpenVDB (const NanoGrid< NanoBuildT > &grid)
 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, uint32_t n=0)
 Forward declaration of free-standing function that de-serializes a NanoVDB GridHandle into an OpenVDB GridBase.
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)

Detailed Description

Defines a simple memory pool used to call cub functions that use dynamic temporary storage.

See nanovdb/tools/cuda/PointToGrid.cuh and nanovdb/tools/cuda/DistributedPointToGrid.cuh for examples. Also note that this explains the somewhat unusual API with direct access to private member data.

Typedef Documentation

◆ AccType

template<typename BuildT, typename ValueT>
using AccType
Initial value:
Class to access values in channels at a specific voxel location.
Definition NanoVDB.h:5884
ReadAccessor< BuildT, 0, 1, 2 > DefaultReadAccessor
Definition NanoVDB.h:2174
C++11 implementation of std::conditional.
Definition Util.h:403

Generic Accessor type that maps to either a ReadAccessor or ChannelAccessor.

Template Parameters
BuildTBuild type, e.g. float or ValueOnIndex
ValueTValue type, e.g. float or Vec3f

◆ BoolGrid

◆ BoolTree

using BoolTree = NanoTree<bool>

◆ BuildToValueMapT

template<typename T>
using BuildToValueMapT = typename BuildToValueMap<T>::type

◆ CoordBBox

◆ DefaultReadAccessor

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

◆ DoubleGrid

◆ DoubleTree

using DoubleTree = NanoTree<double>

◆ FloatGrid

◆ FloatTree

using FloatTree = NanoTree<float>

◆ Fp16Grid

◆ Fp16Tree

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

◆ GridTreeT

template<typename GridT>
using GridTreeT = typename GridTree<GridT>::type

◆ IndexGrid

◆ IndexTree

◆ Int32Grid

◆ Int32Tree

using Int32Tree = NanoTree<int32_t>

◆ Int64Grid

◆ Int64Tree

using Int64Tree = NanoTree<int64_t>

◆ MaskGrid

◆ MaskTree

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

◆ NanoNodeT

template<typename BuildT, int LEVEL>
using NanoNodeT = typename NanoNode<BuildT, LEVEL>::type

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

◆ NodeTraitT

template<typename GridOrTreeOrRootT, int LEVEL>
using NodeTraitT = typename NodeTrait<GridOrTreeOrRootT, LEVEL>::type

◆ OnIndexGrid

◆ OnIndexTree

◆ PointGrid

using PointGrid = Grid<Point>

◆ UInt32Grid

◆ UInt32Tree

using UInt32Tree = NanoTree<uint32_t>

◆ Vec3d [1/2]

using Vec3d = math::Vec3<double>

◆ Vec3d [2/2]

using Vec3d

◆ Vec3dBBox

◆ Vec3dGrid

◆ Vec3dTree

◆ Vec3f

using Vec3f = math::Vec3<float>

◆ Vec3fGrid

◆ Vec3fTree

◆ Vec3i

using Vec3i = math::Vec3<int32_t>

◆ Vec3IGrid

◆ Vec3ITree

◆ Vec3u

using Vec3u = math::Vec3<uint32_t>

◆ Vec3u16

using Vec3u16 = math::Vec3<uint16_t>

◆ Vec3u8

using Vec3u8 = math::Vec3<uint8_t>

◆ Vec4d

using Vec4d = math::Vec4<double>

◆ Vec4dGrid

◆ Vec4dTree

◆ Vec4f

using Vec4f = math::Vec4<float>

◆ Vec4fGrid

◆ Vec4fTree

◆ Vec4i

using Vec4i = math::Vec4<int>

◆ Vec4R

using Vec4R = math::Vec4<double>

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 
LevelSet 
FogVolume 
Staggered 
PointOpacity 
PointQuat 
PointScale 
PointSH0 
PointSHN 
LineId 
TriangleId 
GaussianId 
Range 
VoxelBVH 
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 
VoxelBVH 
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 
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()

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>
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...);
};
Struct with all the member data of the Grid (useful during serialization of an openvdb grid)
Definition NanoVDB.h:1977

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

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

Use this function, which depends on 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.

◆ checkGrid()

template<typename ValueT>
__hostdev__ char * checkGrid ( const NanoGrid< ValueT > * grid,
char * error,
CheckMode mode = CheckMode::Full )

◆ CountOn()

uint32_t CountOn ( uint64_t v)
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
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.

◆ createSampler()

template<int Order, typename TreeOrAccT, bool UseCache = true>
math::SampleFromVoxels< TreeOrAccT, Order, UseCache > createSampler ( const TreeOrAccT & acc)

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

◆ getAccessor()

template<typename GridT, typename ValueT>
auto getAccessor ( const GridT & grid,
ValueT * sideCar = nullptr )
inline

Generic template functions that return an Accessor to either an index grid or a regular grid.

◆ invoke()

template<typename Func, typename... Rest>
int invoke ( const Func & taskFunc1,
Rest... taskFuncN )

◆ isAligned()

bool isAligned ( const void * p)
inlinestatic

return true if the specified pointer is 32 byte aligned

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

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

template<typename ValueT>
bool isValid ( const NanoGrid< ValueT > * grid,
CheckMode mode,
bool verbose = false )

◆ isValid() [3/3]

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

◆ mapToGridType()

template<typename BuildT>
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
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

◆ nanoToOpenVDB() [1/2]

template<typename BufferT>
openvdb::GridBase::Ptr nanoToOpenVDB ( const GridHandle< BufferT > & handle,
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>
tools::trait::OpenGridPtr< NanoBuildT > nanoToOpenVDB ( const NanoGrid< NanoBuildT > & grid)

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

◆ 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
BufferTType of the input and output grid buffers
Parameters
handleGridHandle with grids that will be slip into individual GridHandles
otheroptional pool used for allocation of output GridHandle
Returns
Vector of GridHandles each containing a single grid

◆ strlen()

template<class EnumT>
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()

CheckMode toCheckMode ( const Checksum & checksum)
inline

Maps 64 bit checksum to CheckMode enum.

Parameters
checksum64 bit checksum with two CRC32 codes
Returns
CheckMode enum

◆ toGridClass() [1/2]

GridClass toGridClass ( GridBlindDataSemantic semantics,
GridClass defaultClass = GridClass::Unknown )
inline

Maps from GridBlindDataSemantic to GridClass.

Note
Useful when converting an IndexGrid with blind data of type T into a Grid<T>
Parameters
semanticsGridBlindDataSemantic
defaultClassDefault return type used for no match
Returns
GridClass

◆ toGridClass() [2/2]

template<typename BuildT>
GridClass toGridClass ( GridClass defaultClass = GridClass::Unknown)
inline

Maps from a templated build type to a GridClass enum.

◆ toGridType()

template<typename BuildT>
GridType toGridType ( )
inline

Maps from a templated build type to a GridType enum.

◆ toMagic()

MagicType toMagic ( uint64_t magic)
inline

maps 64 bits of magic number to enum

◆ toSemantic()

GridBlindDataSemantic toSemantic ( GridClass gridClass,
GridBlindDataSemantic defaultSemantic = GridBlindDataSemantic::Unknown )
inline

Maps from GridClass to GridBlindDataSemantic.

Note
Useful when converting a Grid<T> into an IndexGrid with blind data of type T.
Parameters
gridClassGridClass
defaultSemanticDefault return type used for no match
Returns
GridBlindDataSemantic

◆ toStr() [1/6]

char * 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

◆ toStr() [2/6]

char * 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

◆ toStr() [3/6]

char * 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

◆ toStr() [4/6]

const char * 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

◆ toStr() [5/6]

char * 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

◆ toStr() [6/6]

char * 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