OpenVDB 9.0.0
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
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/NanoVDB.h>

Inherits GridData.

Public Types

using TreeType = TreeT
 
using RootType = typename TreeT::RootType
 
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
 
Version version () const
 
DataTypedata ()
 
const DataTypedata () const
 
uint64_t gridSize () const
 Return the memory footprint of the entire grid, i.e. including all nodes and blind data. More...
 
uint32_t gridIndex () const
 Return index of this grid in the buffer. More...
 
uint32_t gridCount () const
 Return total number of grids in the buffer. More...
 
const TreeT & tree () const
 Return a const reference to the tree. More...
 
TreeT & tree ()
 Return a non-const reference to the tree. More...
 
AccessorType getAccessor () const
 Return a new instance of a ReadAccessor used to access values in this grid. More...
 
const Vec3RvoxelSize () const
 Return a const reference to the size of a voxel in world units. More...
 
const Mapmap () const
 Return a const reference to the Map for this grid. More...
 
template<typename Vec3T >
Vec3T worldToIndex (const Vec3T &xyz) const
 world to index space transformation More...
 
template<typename Vec3T >
Vec3T indexToWorld (const Vec3T &xyz) const
 index to world space transformation More...
 
template<typename Vec3T >
Vec3T indexToWorldDir (const Vec3T &dir) const
 transformation from index space direction to world space direction More...
 
template<typename Vec3T >
Vec3T worldToIndexDir (const Vec3T &dir) const
 transformation from world space direction to index space direction More...
 
template<typename Vec3T >
Vec3T indexToWorldGrad (const Vec3T &grad) const
 transform the gradient from index space to world space. More...
 
template<typename Vec3T >
Vec3T worldToIndexF (const Vec3T &xyz) const
 world to index space transformation More...
 
template<typename Vec3T >
Vec3T indexToWorldF (const Vec3T &xyz) const
 index to world space transformation More...
 
template<typename Vec3T >
Vec3T indexToWorldDirF (const Vec3T &dir) const
 transformation from index space direction to world space direction More...
 
template<typename Vec3T >
Vec3T worldToIndexDirF (const Vec3T &dir) const
 transformation from world space direction to index space direction More...
 
template<typename Vec3T >
Vec3T indexToWorldGradF (const Vec3T &grad) const
 Transforms the gradient from index space to world space. More...
 
const BBox< Vec3R > & worldBBox () const
 Computes a AABB of active values in world space. More...
 
const BBox< CoordType > & indexBBox () const
 Computes a AABB of active values in index space. More...
 
uint64_t activeVoxelCount () const
 Return the total number of active voxels in this tree. More...
 
bool isValid () const
 Methods related to the classification of this grid. More...
 
const GridTypegridType () const
 
const GridClassgridClass () const
 
bool isLevelSet () const
 
bool isFogVolume () const
 
bool isStaggered () const
 
bool isPointIndex () const
 
bool isPointData () const
 
bool isMask () const
 
bool isUnknown () const
 
bool hasMinMax () const
 
bool hasBBox () const
 
bool hasLongGridName () const
 
bool hasAverage () const
 
bool hasStdDeviation () const
 
bool isBreadthFirst () const
 
template<typename NodeT >
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>
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...
 
const char * gridName () const
 Return a c-string with the name of this grid. More...
 
const char * shortGridName () const
 Return a c-string with the name of this grid, truncated to 255 characters. More...
 
uint64_t checksum () const
 Return checksum of the grid buffer. More...
 
bool isEmpty () const
 Return true if this grid is empty, i.e. contains no values or nodes. More...
 
int blindDataCount () const
 Return the count of blind-data encoded in this grid. More...
 
int findBlindDataForSemantic (GridBlindDataSemantic semantic) const
 Return the index of the blind data with specified semantic if found, otherwise -1. More...
 
const void * blindData (uint32_t n) const
 Returns a const pointer to the blindData at the specified linear offset. More...
 
const GridBlindMetaDatablindMetaData (int n) const
 

Static Public Member Functions

static uint64_t memUsage ()
 Return memory usage in bytes for this class only. More...
 

Private Member Functions

const GridBlindMetaDatablindMetaData (uint32_t n) const
 Returns a const reference to the blindMetaData at the specified linear offset. More...
 

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

Member Typedef Documentation

◆ AccessorType

◆ BuildType

using BuildType = typename TreeT::BuildType

◆ CoordType

using CoordType = typename TreeT::CoordType

◆ DataType

using DataType = GridData

◆ RootType

using RootType = typename TreeT::RootType

◆ TreeType

using TreeType = TreeT

◆ ValueType

using ValueType = typename TreeT::ValueType

Constructor & Destructor Documentation

◆ Grid()

Grid ( const Grid< TreeT > &  )
delete

Disallow constructions, copy and assignment.

Note
Only a Serializer, defined elsewhere, can instantiate this class

◆ ~Grid()

~Grid ( )
delete

Member Function Documentation

◆ activeVoxelCount()

uint64_t activeVoxelCount ( ) const
inline

Return the total number of active voxels in this tree.

◆ blindData()

const void * blindData ( uint32_t  n) const
inline

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

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

◆ blindDataCount()

int blindDataCount ( ) const
inline

Return the count of blind-data encoded in this grid.

◆ blindMetaData()

const GridBlindMetaData & blindMetaData ( int  n) const
inline

◆ checksum()

uint64_t checksum ( ) const
inline

Return checksum of the grid buffer.

◆ data() [1/2]

DataType * data ( )
inline

◆ data() [2/2]

const DataType * data ( ) const
inline

◆ findBlindDataForSemantic()

int findBlindDataForSemantic ( GridBlindDataSemantic  semantic) const

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

◆ getAccessor()

AccessorType getAccessor ( ) const
inline

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

◆ gridClass()

const GridClass & gridClass ( ) const
inline

◆ gridCount()

uint32_t gridCount ( ) const
inline

Return total number of grids in the buffer.

◆ gridIndex()

uint32_t gridIndex ( ) const
inline

Return index of this grid in the buffer.

◆ gridName()

const char * gridName ( ) const
inline

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

◆ gridSize()

uint64_t gridSize ( ) const
inline

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

◆ gridType()

const GridType & gridType ( ) const
inline

◆ hasAverage()

bool hasAverage ( ) const
inline

◆ hasBBox()

bool hasBBox ( ) const
inline

◆ hasLongGridName()

bool hasLongGridName ( ) const
inline

◆ hasMinMax()

bool hasMinMax ( ) const
inline

◆ hasStdDeviation()

bool hasStdDeviation ( ) const
inline

◆ indexBBox()

const BBox< CoordType > & indexBBox ( ) const
inline

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.

◆ indexToWorld()

Vec3T indexToWorld ( const Vec3T &  xyz) const
inline

index to world space transformation

◆ indexToWorldDir()

Vec3T indexToWorldDir ( const Vec3T &  dir) const
inline

transformation from index space direction to world space direction

Warning
assumes dir to be normalized

◆ indexToWorldDirF()

Vec3T indexToWorldDirF ( const Vec3T &  dir) const
inline

transformation from index space direction to world space direction

Warning
assumes dir to be normalized

◆ indexToWorldF()

Vec3T indexToWorldF ( const Vec3T &  xyz) const
inline

index to world space transformation

◆ indexToWorldGrad()

Vec3T indexToWorldGrad ( const Vec3T &  grad) const
inline

transform the gradient from index space to world space.

Applies the inverse jacobian transform map.

◆ indexToWorldGradF()

Vec3T indexToWorldGradF ( const Vec3T &  grad) const
inline

Transforms the gradient from index space to world space.

Applies the inverse jacobian transform map.

◆ isBreadthFirst()

bool isBreadthFirst ( ) const
inline

◆ isEmpty()

bool isEmpty ( ) const
inline

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

◆ isFogVolume()

bool isFogVolume ( ) const
inline

◆ isLevelSet()

bool isLevelSet ( ) const
inline

◆ isMask()

bool isMask ( ) const
inline

◆ isPointData()

bool isPointData ( ) const
inline

◆ isPointIndex()

bool isPointIndex ( ) const
inline

◆ isSequential() [1/2]

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

◆ isSequential() [2/2]

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

◆ isStaggered()

bool isStaggered ( ) const
inline

◆ isUnknown()

bool isUnknown ( ) const
inline

◆ isValid()

bool isValid ( ) const
inline

Methods related to the classification of this grid.

◆ map()

const Map & map ( ) const
inline

Return a const reference to the Map for this grid.

◆ memUsage()

static uint64_t memUsage ( )
inlinestatic

Return memory usage in bytes for this class only.

◆ operator=()

Grid & operator= ( const Grid< TreeT > &  )
delete

◆ shortGridName()

const char * shortGridName ( ) const
inline

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

◆ tree() [1/2]

TreeT & tree ( )
inline

Return a non-const reference to the tree.

◆ tree() [2/2]

const TreeT & tree ( ) const
inline

Return a const reference to the tree.

◆ version()

Version version ( ) const
inline

◆ voxelSize()

const Vec3R & voxelSize ( ) const
inline

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

◆ worldBBox()

const BBox< Vec3R > & worldBBox ( ) const
inline

Computes a AABB of active values in world space.

◆ worldToIndex()

Vec3T worldToIndex ( const Vec3T &  xyz) const
inline

world to index space transformation

◆ worldToIndexDir()

Vec3T worldToIndexDir ( const Vec3T &  dir) const
inline

transformation from world space direction to index space direction

Warning
assumes dir to be normalized

◆ worldToIndexDirF()

Vec3T worldToIndexDirF ( const Vec3T &  dir) const
inline

transformation from world space direction to index space direction

Warning
assumes dir to be normalized

◆ worldToIndexF()

Vec3T worldToIndexF ( const Vec3T &  xyz) const
inline

world to index space transformation