HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nanovdb::Grid< TreeT > Class Template Reference

Highest level of the data structure. Contains a tree and a world->index transform (that currently only supports uniform scaling and translation). More...

#include <NanoVDB.h>

+ Inheritance diagram for nanovdb::Grid< TreeT >:

Public Types

using TreeType = TreeT
 
using RootType = typename TreeT::RootType
 
using RootNodeType = RootType
 
using UpperNodeType = typename RootNodeType::ChildNodeType
 
using LowerNodeType = typename UpperNodeType::ChildNodeType
 
using LeafNodeType = typename RootType::LeafNodeType
 
using DataType = GridData
 
using ValueType = typename TreeT::ValueType
 
using BuildType = typename TreeT::BuildType
 
using CoordType = typename TreeT::CoordType
 
using AccessorType = DefaultReadAccessor< BuildType >
 

Public Member Functions

 Grid (const Grid &)=delete
 Disallow constructions, copy and assignment. More...
 
Gridoperator= (const Grid &)=delete
 
 ~Grid ()=delete
 
__hostdev__ Version version () const
 
__hostdev__ DataTypedata ()
 
__hostdev__ const DataTypedata () const
 
__hostdev__ uint64_t gridSize () const
 Return memory usage in bytes for this class only. More...
 
__hostdev__ uint32_t gridIndex () const
 Return index of this grid in the buffer. More...
 
__hostdev__ uint32_t gridCount () const
 Return total number of grids in the buffer. More...
 
template<typename T = BuildType>
__hostdev__ enable_if
< BuildTraits< T >::is_index,
const uint64_t & >::type 
valueCount () const
 Return the total number of values indexed by this IndexGrid. More...
 
template<typename T = BuildType>
__hostdev__ enable_if< is_same
< T, Point >::value, const
uint64_t & >::type 
pointCount () const
 Return the total number of points indexed by this PointGrid. More...
 
__hostdev__ const TreeT & tree () const
 Return a const reference to the tree. More...
 
__hostdev__ TreeT & tree ()
 Return a non-const reference to the tree. More...
 
__hostdev__ AccessorType getAccessor () const
 Return a new instance of a ReadAccessor used to access values in this grid. More...
 
__hostdev__ const Vec3dvoxelSize () const
 Return a const reference to the size of a voxel in world units. More...
 
__hostdev__ const Mapmap () const
 Return a const reference to the Map for this grid. More...
 
template<typename Vec3T >
__hostdev__ Vec3T worldToIndex (const Vec3T &xyz) const
 world to index space transformation More...
 
template<typename Vec3T >
__hostdev__ Vec3T indexToWorld (const Vec3T &xyz) const
 index to world space transformation More...
 
template<typename Vec3T >
__hostdev__ Vec3T indexToWorldDir (const Vec3T &dir) const
 transformation from index space direction to world space direction More...
 
template<typename Vec3T >
__hostdev__ Vec3T worldToIndexDir (const Vec3T &dir) const
 transformation from world space direction to index space direction More...
 
template<typename Vec3T >
__hostdev__ Vec3T indexToWorldGrad (const Vec3T &grad) const
 transform the gradient from index space to world space. More...
 
template<typename Vec3T >
__hostdev__ Vec3T worldToIndexF (const Vec3T &xyz) const
 world to index space transformation More...
 
template<typename Vec3T >
__hostdev__ Vec3T indexToWorldF (const Vec3T &xyz) const
 index to world space transformation More...
 
template<typename Vec3T >
__hostdev__ Vec3T indexToWorldDirF (const Vec3T &dir) const
 transformation from index space direction to world space direction More...
 
template<typename Vec3T >
__hostdev__ Vec3T worldToIndexDirF (const Vec3T &dir) const
 transformation from world space direction to index space direction More...
 
template<typename Vec3T >
__hostdev__ Vec3T indexToWorldGradF (const Vec3T &grad) const
 Transforms the gradient from index space to world space. More...
 
__hostdev__ uint64_t activeVoxelCount () const
 Computes a AABB of active values in world space. More...
 
__hostdev__ bool isValid () const
 Methods related to the classification of this grid. More...
 
__hostdev__ const GridTypegridType () const
 
__hostdev__ const GridClassgridClass () const
 
__hostdev__ bool isLevelSet () const
 
__hostdev__ bool isFogVolume () const
 
__hostdev__ bool isStaggered () const
 
__hostdev__ bool isPointIndex () const
 
__hostdev__ bool isGridIndex () const
 
__hostdev__ bool isPointData () const
 
__hostdev__ bool isMask () const
 
__hostdev__ bool isUnknown () const
 
__hostdev__ bool hasMinMax () const
 
__hostdev__ bool hasBBox () const
 
__hostdev__ bool hasLongGridName () const
 
__hostdev__ bool hasAverage () const
 
__hostdev__ bool hasStdDeviation () const
 
__hostdev__ bool isBreadthFirst () const
 
template<typename NodeT >
__hostdev__ bool isSequential () const
 return true if the specified node type is layed out breadth-first in memory and has a fixed size. This allows for sequential access to the nodes. More...
 
template<int LEVEL>
__hostdev__ bool isSequential () const
 return true if the specified node level is layed out breadth-first in memory and has a fixed size. This allows for sequential access to the nodes. More...
 
__hostdev__ bool isSequential () const
 return true if nodes at all levels can safely be accessed with simple linear offsets More...
 
__hostdev__ const char * gridName () const
 Return a c-string with the name of this grid. More...
 
__hostdev__ const char * shortGridName () const
 Return a c-string with the name of this grid, truncated to 255 characters. More...
 
__hostdev__ uint64_t checksum () const
 Return checksum of the grid buffer. More...
 
__hostdev__ uint32_t blindDataCount () const
 Return true if this grid is empty, i.e. contains no values or nodes. More...
 
__hostdev__ int findBlindData (const char *name) const
 Return the index of the first blind data with specified name if found, otherwise -1. More...
 
__hostdev__ int findBlindDataForSemantic (GridBlindDataSemantic semantic) const
 Return the index of the first blind data with specified semantic if found, otherwise -1. More...
 
__hostdev__ const voidblindData (uint32_t n) const
 Returns a const pointer to the blindData at the specified linear offset. More...
 
template<typename BlindDataT >
__hostdev__ const BlindDataT * getBlindData (uint32_t n) const
 
template<typename BlindDataT >
__hostdev__ BlindDataT * getBlindData (uint32_t n)
 
__hostdev__ const
GridBlindMetaData & 
blindMetaData (uint32_t n) const
 

Detailed Description

template<typename TreeT>
class nanovdb::Grid< TreeT >

Highest level of the data structure. Contains a tree and a world->index transform (that currently only supports uniform scaling and translation).

Note
This the API of this class to interface with client code

Definition at line 3685 of file NanoVDB.h.

Member Typedef Documentation

template<typename TreeT>
using nanovdb::Grid< TreeT >::AccessorType = DefaultReadAccessor<BuildType>

Definition at line 3698 of file NanoVDB.h.

template<typename TreeT>
using nanovdb::Grid< TreeT >::BuildType = typename TreeT::BuildType

Definition at line 3696 of file NanoVDB.h.

template<typename TreeT>
using nanovdb::Grid< TreeT >::CoordType = typename TreeT::CoordType

Definition at line 3697 of file NanoVDB.h.

template<typename TreeT>
using nanovdb::Grid< TreeT >::DataType = GridData

Definition at line 3694 of file NanoVDB.h.

template<typename TreeT>
using nanovdb::Grid< TreeT >::LeafNodeType = typename RootType::LeafNodeType

Definition at line 3693 of file NanoVDB.h.

template<typename TreeT>
using nanovdb::Grid< TreeT >::LowerNodeType = typename UpperNodeType::ChildNodeType

Definition at line 3692 of file NanoVDB.h.

template<typename TreeT>
using nanovdb::Grid< TreeT >::RootNodeType = RootType

Definition at line 3690 of file NanoVDB.h.

template<typename TreeT>
using nanovdb::Grid< TreeT >::RootType = typename TreeT::RootType

Definition at line 3689 of file NanoVDB.h.

template<typename TreeT>
using nanovdb::Grid< TreeT >::TreeType = TreeT

Definition at line 3688 of file NanoVDB.h.

template<typename TreeT>
using nanovdb::Grid< TreeT >::UpperNodeType = typename RootNodeType::ChildNodeType

Definition at line 3691 of file NanoVDB.h.

template<typename TreeT>
using nanovdb::Grid< TreeT >::ValueType = typename TreeT::ValueType

Definition at line 3695 of file NanoVDB.h.

Constructor & Destructor Documentation

template<typename TreeT>
nanovdb::Grid< TreeT >::Grid ( const Grid< TreeT > &  )
delete

Disallow constructions, copy and assignment.

Note
Only a Serializer, defined elsewhere, can instantiate this class
template<typename TreeT>
nanovdb::Grid< TreeT >::~Grid ( )
delete

Member Function Documentation

template<typename TreeT>
__hostdev__ uint64_t nanovdb::Grid< TreeT >::activeVoxelCount ( ) const
inline

Computes a AABB of active values in world space.

Computes a AABB of active values in index space

Note
This method is returning a floating point bounding box and not a CoordBBox. This makes it more useful for clipping rays. Return the total number of active voxels in this tree.

Definition at line 3810 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ const void* nanovdb::Grid< TreeT >::blindData ( uint32_t  n) const
inline

Returns a const pointer to the blindData at the specified linear offset.

Warning
Pointer might be NULL and the linear offset is assumed to be in the valid range

Definition at line 3869 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ uint32_t nanovdb::Grid< TreeT >::blindDataCount ( ) const
inline

Return true if this grid is empty, i.e. contains no values or nodes.

Return the count of blind-data encoded in this grid

Definition at line 3857 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ const GridBlindMetaData& nanovdb::Grid< TreeT >::blindMetaData ( uint32_t  n) const
inline

Definition at line 3890 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ uint64_t nanovdb::Grid< TreeT >::checksum ( ) const
inline

Return checksum of the grid buffer.

Definition at line 3851 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ DataType* nanovdb::Grid< TreeT >::data ( )
inline

Definition at line 3709 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ const DataType* nanovdb::Grid< TreeT >::data ( ) const
inline

Definition at line 3711 of file NanoVDB.h.

template<typename TreeT >
__hostdev__ int nanovdb::Grid< TreeT >::findBlindData ( const char *  name) const

Return the index of the first blind data with specified name if found, otherwise -1.

Definition at line 3907 of file NanoVDB.h.

template<typename TreeT >
__hostdev__ int nanovdb::Grid< TreeT >::findBlindDataForSemantic ( GridBlindDataSemantic  semantic) const

Return the index of the first blind data with specified semantic if found, otherwise -1.

Definition at line 3897 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ AccessorType nanovdb::Grid< TreeT >::getAccessor ( ) const
inline

Return a new instance of a ReadAccessor used to access values in this grid.

Definition at line 3746 of file NanoVDB.h.

template<typename TreeT>
template<typename BlindDataT >
__hostdev__ const BlindDataT* nanovdb::Grid< TreeT >::getBlindData ( uint32_t  n) const
inline

Definition at line 3877 of file NanoVDB.h.

template<typename TreeT>
template<typename BlindDataT >
__hostdev__ BlindDataT* nanovdb::Grid< TreeT >::getBlindData ( uint32_t  n)
inline

Definition at line 3884 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ const GridClass& nanovdb::Grid< TreeT >::gridClass ( ) const
inline

Definition at line 3815 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ uint32_t nanovdb::Grid< TreeT >::gridCount ( ) const
inline

Return total number of grids in the buffer.

Definition at line 3723 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ uint32_t nanovdb::Grid< TreeT >::gridIndex ( ) const
inline

Return index of this grid in the buffer.

Definition at line 3720 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ const char* nanovdb::Grid< TreeT >::gridName ( ) const
inline

Return a c-string with the name of this grid.

Definition at line 3845 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ uint64_t nanovdb::Grid< TreeT >::gridSize ( ) const
inline

Return memory usage in bytes for this class only.

Return the memory footprint of the entire grid, i.e. including all nodes and blind data

Definition at line 3717 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ const GridType& nanovdb::Grid< TreeT >::gridType ( ) const
inline

Definition at line 3814 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ bool nanovdb::Grid< TreeT >::hasAverage ( ) const
inline

Definition at line 3827 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ bool nanovdb::Grid< TreeT >::hasBBox ( ) const
inline

Definition at line 3825 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ bool nanovdb::Grid< TreeT >::hasLongGridName ( ) const
inline

Definition at line 3826 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ bool nanovdb::Grid< TreeT >::hasMinMax ( ) const
inline

Definition at line 3824 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ bool nanovdb::Grid< TreeT >::hasStdDeviation ( ) const
inline

Definition at line 3828 of file NanoVDB.h.

template<typename TreeT>
template<typename Vec3T >
__hostdev__ Vec3T nanovdb::Grid< TreeT >::indexToWorld ( const Vec3T &  xyz) const
inline

index to world space transformation

Definition at line 3760 of file NanoVDB.h.

template<typename TreeT>
template<typename Vec3T >
__hostdev__ Vec3T nanovdb::Grid< TreeT >::indexToWorldDir ( const Vec3T &  dir) const
inline

transformation from index space direction to world space direction

Warning
assumes dir to be normalized

Definition at line 3765 of file NanoVDB.h.

template<typename TreeT>
template<typename Vec3T >
__hostdev__ Vec3T nanovdb::Grid< TreeT >::indexToWorldDirF ( const Vec3T &  dir) const
inline

transformation from index space direction to world space direction

Warning
assumes dir to be normalized

Definition at line 3788 of file NanoVDB.h.

template<typename TreeT>
template<typename Vec3T >
__hostdev__ Vec3T nanovdb::Grid< TreeT >::indexToWorldF ( const Vec3T &  xyz) const
inline

index to world space transformation

Definition at line 3783 of file NanoVDB.h.

template<typename TreeT>
template<typename Vec3T >
__hostdev__ Vec3T nanovdb::Grid< TreeT >::indexToWorldGrad ( const Vec3T &  grad) const
inline

transform the gradient from index space to world space.

Applies the inverse jacobian transform map.

Definition at line 3775 of file NanoVDB.h.

template<typename TreeT>
template<typename Vec3T >
__hostdev__ Vec3T nanovdb::Grid< TreeT >::indexToWorldGradF ( const Vec3T &  grad) const
inline

Transforms the gradient from index space to world space.

Applies the inverse jacobian transform map.

Definition at line 3798 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ bool nanovdb::Grid< TreeT >::isBreadthFirst ( ) const
inline

Definition at line 3829 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ bool nanovdb::Grid< TreeT >::isFogVolume ( ) const
inline

Definition at line 3817 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ bool nanovdb::Grid< TreeT >::isGridIndex ( ) const
inline

Definition at line 3820 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ bool nanovdb::Grid< TreeT >::isLevelSet ( ) const
inline

Definition at line 3816 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ bool nanovdb::Grid< TreeT >::isMask ( ) const
inline

Definition at line 3822 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ bool nanovdb::Grid< TreeT >::isPointData ( ) const
inline

Definition at line 3821 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ bool nanovdb::Grid< TreeT >::isPointIndex ( ) const
inline

Definition at line 3819 of file NanoVDB.h.

template<typename TreeT>
template<typename NodeT >
__hostdev__ bool nanovdb::Grid< TreeT >::isSequential ( ) const
inline

return true if the specified node type is layed out breadth-first in memory and has a fixed size. This allows for sequential access to the nodes.

Definition at line 3834 of file NanoVDB.h.

template<typename TreeT>
template<int LEVEL>
__hostdev__ bool nanovdb::Grid< TreeT >::isSequential ( ) const
inline

return true if the specified node level is layed out breadth-first in memory and has a fixed size. This allows for sequential access to the nodes.

Definition at line 3839 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ bool nanovdb::Grid< TreeT >::isSequential ( ) const
inline

return true if nodes at all levels can safely be accessed with simple linear offsets

Definition at line 3842 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ bool nanovdb::Grid< TreeT >::isStaggered ( ) const
inline

Definition at line 3818 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ bool nanovdb::Grid< TreeT >::isUnknown ( ) const
inline

Definition at line 3823 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ bool nanovdb::Grid< TreeT >::isValid ( ) const
inline

Methods related to the classification of this grid.

Definition at line 3813 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ const Map& nanovdb::Grid< TreeT >::map ( ) const
inline

Return a const reference to the Map for this grid.

Definition at line 3752 of file NanoVDB.h.

template<typename TreeT>
Grid& nanovdb::Grid< TreeT >::operator= ( const Grid< TreeT > &  )
delete
template<typename TreeT>
template<typename T = BuildType>
__hostdev__ enable_if<is_same<T, Point>::value, const uint64_t&>::type nanovdb::Grid< TreeT >::pointCount ( ) const
inline

Return the total number of points indexed by this PointGrid.

Note
This method is only defined for PointGrid = NanoGrid<Point>

Definition at line 3737 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ const char* nanovdb::Grid< TreeT >::shortGridName ( ) const
inline

Return a c-string with the name of this grid, truncated to 255 characters.

Definition at line 3848 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ const TreeT& nanovdb::Grid< TreeT >::tree ( ) const
inline

Return a const reference to the tree.

Definition at line 3740 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ TreeT& nanovdb::Grid< TreeT >::tree ( )
inline

Return a non-const reference to the tree.

Definition at line 3743 of file NanoVDB.h.

template<typename TreeT>
template<typename T = BuildType>
__hostdev__ enable_if<BuildTraits<T>::is_index, const uint64_t&>::type nanovdb::Grid< TreeT >::valueCount ( ) const
inline

Return the total number of values indexed by this IndexGrid.

Note
This method is only defined for IndexGrid = NanoGrid<ValueIndex || ValueOnIndex || ValueIndexMask || ValueOnIndexMask>

Definition at line 3730 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ Version nanovdb::Grid< TreeT >::version ( ) const
inline

Definition at line 3707 of file NanoVDB.h.

template<typename TreeT>
__hostdev__ const Vec3d& nanovdb::Grid< TreeT >::voxelSize ( ) const
inline

Return a const reference to the size of a voxel in world units.

Definition at line 3749 of file NanoVDB.h.

template<typename TreeT>
template<typename Vec3T >
__hostdev__ Vec3T nanovdb::Grid< TreeT >::worldToIndex ( const Vec3T &  xyz) const
inline

world to index space transformation

Definition at line 3756 of file NanoVDB.h.

template<typename TreeT>
template<typename Vec3T >
__hostdev__ Vec3T nanovdb::Grid< TreeT >::worldToIndexDir ( const Vec3T &  dir) const
inline

transformation from world space direction to index space direction

Warning
assumes dir to be normalized

Definition at line 3770 of file NanoVDB.h.

template<typename TreeT>
template<typename Vec3T >
__hostdev__ Vec3T nanovdb::Grid< TreeT >::worldToIndexDirF ( const Vec3T &  dir) const
inline

transformation from world space direction to index space direction

Warning
assumes dir to be normalized

Definition at line 3793 of file NanoVDB.h.

template<typename TreeT>
template<typename Vec3T >
__hostdev__ Vec3T nanovdb::Grid< TreeT >::worldToIndexF ( const Vec3T &  xyz) const
inline

world to index space transformation

Definition at line 3779 of file NanoVDB.h.


The documentation for this class was generated from the following file: