OpenVDB: Grid< TreeT > Class Template Reference

OpenVDB 10.0.1

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public 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>`

Inheritance diagram for Grid< TreeT >:

## 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.
Grid & | operator= (const Grid &)=delete
| ~Grid ()=delete
Version | version () const
DataType * | data ()
const DataType * | data () const
uint64_t | gridSize () const
| Return the memory footprint of the entire grid, i.e. including all nodes and blind data.
uint32_t | gridIndex () const
| Return index of this grid in the buffer.
uint32_t | gridCount () const
| Return total number of grids in the buffer.
template<typename T = BuildType>
enable_if< is_same< T, ValueIndex >::value, uint64_t >::type | valueCount () const
| Return the total number of values indexed by this IndexGrid.
const TreeT & | tree () const
| Return a const reference to the tree.
TreeT & | tree ()
| Return a non-const reference to the tree.
AccessorType | getAccessor () const
| Return a new instance of a ReadAccessor used to access values in this grid.
const Vec3R & | voxelSize () const
| Return a const reference to the size of a voxel in world units.
const Map & | map () const
| Return a const reference to the Map for this grid.
template<typename Vec3T >
Vec3T | worldToIndex (const Vec3T &xyz) const
| world to index space transformation
template<typename Vec3T >
Vec3T | indexToWorld (const Vec3T &xyz) const
| index to world space transformation
template<typename Vec3T >
Vec3T | indexToWorldDir (const Vec3T &dir) const
| transformation from index space direction to world space direction
template<typename Vec3T >
Vec3T | worldToIndexDir (const Vec3T &dir) const
| transformation from world space direction to index space direction
template<typename Vec3T >
Vec3T | indexToWorldGrad (const Vec3T &grad) const
| transform the gradient from index space to world space.
template<typename Vec3T >
Vec3T | worldToIndexF (const Vec3T &xyz) const
| world to index space transformation
template<typename Vec3T >
Vec3T | indexToWorldF (const Vec3T &xyz) const
| index to world space transformation
template<typename Vec3T >
Vec3T | indexToWorldDirF (const Vec3T &dir) const
| transformation from index space direction to world space direction
template<typename Vec3T >
Vec3T | worldToIndexDirF (const Vec3T &dir) const
| transformation from world space direction to index space direction
template<typename Vec3T >
Vec3T | indexToWorldGradF (const Vec3T &grad) const
| Transforms the gradient from index space to world space.
const BBox< Vec3R > & | worldBBox () const
| Computes a AABB of active values in world space.
const BBox< CoordType > & | indexBBox () const
| Computes a AABB of active values in index space.
uint64_t | activeVoxelCount () const
| Return the total number of active voxels in this tree.
bool | isValid () const
| Methods related to the classification of this grid.
const GridType & | gridType () const
const GridClass & | gridClass () const
bool | isLevelSet () const
bool | isFogVolume () const
bool | isStaggered () const
bool | isPointIndex () const
bool | isGridIndex () 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.
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.
const char * | gridName () const
| Return a c-string with the name of this grid.
const char * | shortGridName () const
| Return a c-string with the name of this grid, truncated to 255 characters.
uint64_t | checksum () const
| Return checksum of the grid buffer.
bool | isEmpty () const
| Return true if this grid is empty, i.e. contains no values or nodes.
uint32_t | blindDataCount () const
| Return the count of blind-data encoded in this grid.
int | findBlindDataForSemantic (GridBlindDataSemantic semantic) const
| Return the index of the blind data with specified semantic if found, otherwise -1.
const void * | blindData (uint32_t n) const
| Returns a const pointer to the blindData at the specified linear offset.
const GridBlindMetaData & | blindMetaData (uint32_t n) const

## Static Public Member Functions
static uint64_t | memUsage ()
| Return memory usage in bytes for this class only.

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

template<typename TreeT >

using AccessorType = DefaultReadAccessor<BuildType>

## ◆ BuildType

template<typename TreeT >

using BuildType = typename TreeT::BuildType

## ◆ CoordType

template<typename TreeT >

using CoordType = typename TreeT::CoordType

## ◆ DataType

template<typename TreeT >

using DataType = GridData

## ◆ RootType

template<typename TreeT >

using RootType = typename TreeT::RootType

## ◆ TreeType

template<typename TreeT >

using TreeType = TreeT

## ◆ ValueType

template<typename TreeT >

using ValueType = typename TreeT::ValueType

## Constructor & Destructor Documentation

## ◆ Grid()

template<typename TreeT >

Grid | ( | const Grid< TreeT > & |  | ) |
| delete

Disallow constructions, copy and assignment.

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

## ◆ ~Grid()

template<typename TreeT >

~Grid | ( |  | ) |
| delete

## Member Function Documentation

## ◆ activeVoxelCount()

template<typename TreeT >

uint64_t activeVoxelCount | ( |  | ) | const
| inline

Return the total number of active voxels in this tree.

## ◆ blindData()

template<typename TreeT >

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

template<typename TreeT >

uint32_t blindDataCount | ( |  | ) | const
| inline

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

## ◆ blindMetaData()

template<typename TreeT >

const GridBlindMetaData & blindMetaData | ( | uint32_t | n | ) | const
| inline

## ◆ checksum()

template<typename TreeT >

uint64_t checksum | ( |  | ) | const
| inline

Return checksum of the grid buffer.

## ◆ data() [1/2]

template<typename TreeT >

DataType * data | ( |  | ) |
| inline

## ◆ data() [2/2]

template<typename TreeT >

const DataType * data | ( |  | ) | const
| inline

## ◆ findBlindDataForSemantic()

template<typename TreeT >

int findBlindDataForSemantic | ( | GridBlindDataSemantic | semantic | ) | const

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

## ◆ getAccessor()

template<typename TreeT >

AccessorType getAccessor | ( |  | ) | const
| inline

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

## ◆ gridClass()

template<typename TreeT >

const GridClass & gridClass | ( |  | ) | const
| inline

## ◆ gridCount()

template<typename TreeT >

uint32_t gridCount | ( |  | ) | const
| inline

Return total number of grids in the buffer.

## ◆ gridIndex()

template<typename TreeT >

uint32_t gridIndex | ( |  | ) | const
| inline

Return index of this grid in the buffer.

## ◆ gridName()

template<typename TreeT >

const char * gridName | ( |  | ) | const
| inline

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

## ◆ gridSize()

template<typename TreeT >

uint64_t gridSize | ( |  | ) | const
| inline

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

## ◆ gridType()

template<typename TreeT >

const GridType & gridType | ( |  | ) | const
| inline

## ◆ hasAverage()

template<typename TreeT >

bool hasAverage | ( |  | ) | const
| inline

## ◆ hasBBox()

template<typename TreeT >

bool hasBBox | ( |  | ) | const
| inline

## ◆ hasLongGridName()

template<typename TreeT >

bool hasLongGridName | ( |  | ) | const
| inline

## ◆ hasMinMax()

template<typename TreeT >

bool hasMinMax | ( |  | ) | const
| inline

## ◆ hasStdDeviation()

template<typename TreeT >

bool hasStdDeviation | ( |  | ) | const
| inline

## ◆ indexBBox()

template<typename TreeT >

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

template<typename TreeT >
template<typename Vec3T >

Vec3T indexToWorld | ( | const Vec3T & | xyz | ) | const
| inline

index to world space transformation

## ◆ indexToWorldDir()

template<typename TreeT >
template<typename Vec3T >

Vec3T indexToWorldDir | ( | const Vec3T & | dir | ) | const
| inline

transformation from index space direction to world space direction

Warning
  assumes dir to be normalized

## ◆ indexToWorldDirF()

template<typename TreeT >
template<typename Vec3T >

Vec3T indexToWorldDirF | ( | const Vec3T & | dir | ) | const
| inline

transformation from index space direction to world space direction

Warning
  assumes dir to be normalized

## ◆ indexToWorldF()

template<typename TreeT >
template<typename Vec3T >

Vec3T indexToWorldF | ( | const Vec3T & | xyz | ) | const
| inline

index to world space transformation

## ◆ indexToWorldGrad()

template<typename TreeT >
template<typename Vec3T >

Vec3T indexToWorldGrad | ( | const Vec3T & | grad | ) | const
| inline

transform the gradient from index space to world space.

Applies the inverse jacobian transform map.

## ◆ indexToWorldGradF()

template<typename TreeT >
template<typename Vec3T >

Vec3T indexToWorldGradF | ( | const Vec3T & | grad | ) | const
| inline

Transforms the gradient from index space to world space.

Applies the inverse jacobian transform map.

## ◆ isBreadthFirst()

template<typename TreeT >

bool isBreadthFirst | ( |  | ) | const
| inline

## ◆ isEmpty()

template<typename TreeT >

bool isEmpty | ( |  | ) | const
| inline

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

## ◆ isFogVolume()

template<typename TreeT >

bool isFogVolume | ( |  | ) | const
| inline

## ◆ isGridIndex()

template<typename TreeT >

bool isGridIndex | ( |  | ) | const
| inline

## ◆ isLevelSet()

template<typename TreeT >

bool isLevelSet | ( |  | ) | const
| inline

## ◆ isMask()

template<typename TreeT >

bool isMask | ( |  | ) | const
| inline

## ◆ isPointData()

template<typename TreeT >

bool isPointData | ( |  | ) | const
| inline

## ◆ isPointIndex()

template<typename TreeT >

bool isPointIndex | ( |  | ) | const
| inline

## ◆ isSequential() [1/2]

template<typename TreeT >
template<typename NodeT >

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]

template<typename TreeT >
template<int LEVEL>

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

template<typename TreeT >

bool isStaggered | ( |  | ) | const
| inline

## ◆ isUnknown()

template<typename TreeT >

bool isUnknown | ( |  | ) | const
| inline

## ◆ isValid()

template<typename TreeT >

bool isValid | ( |  | ) | const
| inline

Methods related to the classification of this grid.

## ◆ map()

template<typename TreeT >

const Map & map | ( |  | ) | const
| inline

Return a const reference to the Map for this grid.

## ◆ memUsage()

template<typename TreeT >

static uint64_t memUsage | ( |  | ) |
| inlinestatic

Return memory usage in bytes for this class only.

## ◆ operator=()

template<typename TreeT >

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

## ◆ shortGridName()

template<typename TreeT >

const char * shortGridName | ( |  | ) | const
| inline

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

## ◆ tree() [1/2]

template<typename TreeT >

TreeT & tree | ( |  | ) |
| inline

Return a non-const reference to the tree.

## ◆ tree() [2/2]

template<typename TreeT >

const TreeT & tree | ( |  | ) | const
| inline

Return a const reference to the tree.

## ◆ valueCount()

template<typename TreeT >
template<typename T = BuildType>

enable_if< is_same< T, ValueIndex >::value, uint64_t >::type valueCount | ( |  | ) | const
| inline

Return the total number of values indexed by this IndexGrid.

Note
  This method is only defined for IndexGrid = NanoGrid<ValueIndex>

## ◆ version()

template<typename TreeT >

Version version | ( |  | ) | const
| inline

## ◆ voxelSize()

template<typename TreeT >

const Vec3R & voxelSize | ( |  | ) | const
| inline

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

## ◆ worldBBox()

template<typename TreeT >

const BBox< Vec3R > & worldBBox | ( |  | ) | const
| inline

Computes a AABB of active values in world space.

## ◆ worldToIndex()

template<typename TreeT >
template<typename Vec3T >

Vec3T worldToIndex | ( | const Vec3T & | xyz | ) | const
| inline

world to index space transformation

## ◆ worldToIndexDir()

template<typename TreeT >
template<typename Vec3T >

Vec3T worldToIndexDir | ( | const Vec3T & | dir | ) | const
| inline

transformation from world space direction to index space direction

Warning
  assumes dir to be normalized

## ◆ worldToIndexDirF()

template<typename TreeT >
template<typename Vec3T >

Vec3T worldToIndexDirF | ( | const Vec3T & | dir | ) | const
| inline

transformation from world space direction to index space direction

Warning
  assumes dir to be normalized

## ◆ worldToIndexF()

template<typename TreeT >
template<typename Vec3T >

Vec3T worldToIndexF | ( | const Vec3T & | xyz | ) | const
| inline

world to index space transformation