OpenVDB: GridData Struct Reference

OpenVDB 13.0.0

Loading...
Searching...
No Matches
GridData Struct Reference

Struct with all the member data of the Grid (useful during serialization of an openvdb grid). More...

`#include <nanovdb/NanoVDB.h>`

Inheritance diagram for GridData:

## Public Member Functions
GridData & | operator= (const GridData &)=default
| Use this method to initiate most member data.
__hostdev__ void | init (std::initializer_list< GridFlags > list={GridFlags::IsBreadthFirst}, uint64_t gridSize=0u, const Map &map=Map(), GridType gridType=GridType::Unknown, GridClass gridClass=GridClass::Unknown)
__hostdev__ bool | isValid () const
| return true if the magic number and the version are both valid
__hostdev__ void | setMinMaxOn (bool on=true)
__hostdev__ void | setBBoxOn (bool on=true)
__hostdev__ void | setLongGridNameOn (bool on=true)
__hostdev__ void | setAverageOn (bool on=true)
__hostdev__ void | setStdDeviationOn (bool on=true)
__hostdev__ bool | setGridName (const char *src)
template<typename Vec3T>
__hostdev__ Vec3T | applyMap (const Vec3T &xyz) const
template<typename Vec3T>
__hostdev__ Vec3T | applyInverseMap (const Vec3T &xyz) const
template<typename Vec3T>
__hostdev__ Vec3T | applyJacobian (const Vec3T &xyz) const
template<typename Vec3T>
__hostdev__ Vec3T | applyInverseJacobian (const Vec3T &xyz) const
template<typename Vec3T>
__hostdev__ Vec3T | applyIJT (const Vec3T &xyz) const
template<typename Vec3T>
__hostdev__ Vec3T | applyMapF (const Vec3T &xyz) const
template<typename Vec3T>
__hostdev__ Vec3T | applyInverseMapF (const Vec3T &xyz) const
template<typename Vec3T>
__hostdev__ Vec3T | applyJacobianF (const Vec3T &xyz) const
template<typename Vec3T>
__hostdev__ Vec3T | applyInverseJacobianF (const Vec3T &xyz) const
template<typename Vec3T>
__hostdev__ Vec3T | applyIJTF (const Vec3T &xyz) const
__hostdev__ void * | treePtr ()
__hostdev__ const void * | treePtr () const
template<uint32_t LEVEL>
__hostdev__ const void * | nodePtr () const
| Return a non-const void pointer to the first node at `LEVEL`.
template<uint32_t LEVEL>
__hostdev__ void * | nodePtr ()
| Return a non-const void pointer to the first node at `LEVEL`.
template<uint32_t LEVEL>
__hostdev__ uint32_t | nodeCount () const
| Return number of nodes at `LEVEL`.
__hostdev__ const GridBlindMetaData * | blindMetaData (uint32_t n) const
| Returns a const reference to the blindMetaData at the specified linear offset.
__hostdev__ const char * | gridName () const
__hostdev__ const Vec3dBBox & | worldBBox () const
| return AABB of active values in world space
__hostdev__ const CoordBBox & | indexBBox () const
| return AABB of active values in index space
__hostdev__ uint32_t | rootTableSize () const
| return the root table has size
__hostdev__ bool | isEmpty () const
| test if the grid is empty, e.i the root table has size 0
__hostdev__ bool | isRootConnected () const
| return true if RootData follows TreeData in memory without any extra padding

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

## Public Attributes
uint64_t | mMagic
Checksum | mChecksum
Version | mVersion
BitFlags< 32 > | mFlags
uint32_t | mGridIndex
uint32_t | mGridCount
uint64_t | mGridSize
char | mGridName [MaxNameSize]
Map | mMap
Vec3dBBox | mWorldBBox
Vec3d | mVoxelSize
GridClass | mGridClass
GridType | mGridType
int64_t | mBlindMetadataOffset
uint32_t | mBlindMetadataCount
uint32_t | mData0
uint64_t | mData1
uint64_t | mData2

## Static Public Attributes
static const int | MaxNameSize = 256

## Detailed Description

Struct with all the member data of the Grid (useful during serialization of an openvdb grid).

Note
  The transform is assumed to be affine (so linear) and have uniform scale! So frustum transforms and non-uniform scaling are not supported (primarily because they complicate ray-tracing in index space)
  No client code should (or can) interface with this struct so it can safely be ignored!

## Member Function Documentation

## ◆ applyIJT()

template<typename Vec3T>

__hostdev__ Vec3T applyIJT | ( | const Vec3T & | xyz | ) | const
| inline

## ◆ applyIJTF()

template<typename Vec3T>

__hostdev__ Vec3T applyIJTF | ( | const Vec3T & | xyz | ) | const
| inline

## ◆ applyInverseJacobian()

template<typename Vec3T>

__hostdev__ Vec3T applyInverseJacobian | ( | const Vec3T & | xyz | ) | const
| inline

## ◆ applyInverseJacobianF()

template<typename Vec3T>

__hostdev__ Vec3T applyInverseJacobianF | ( | const Vec3T & | xyz | ) | const
| inline

## ◆ applyInverseMap()

template<typename Vec3T>

__hostdev__ Vec3T applyInverseMap | ( | const Vec3T & | xyz | ) | const
| inline

## ◆ applyInverseMapF()

template<typename Vec3T>

__hostdev__ Vec3T applyInverseMapF | ( | const Vec3T & | xyz | ) | const
| inline

## ◆ applyJacobian()

template<typename Vec3T>

__hostdev__ Vec3T applyJacobian | ( | const Vec3T & | xyz | ) | const
| inline

## ◆ applyJacobianF()

template<typename Vec3T>

__hostdev__ Vec3T applyJacobianF | ( | const Vec3T & | xyz | ) | const
| inline

## ◆ applyMap()

template<typename Vec3T>

__hostdev__ Vec3T applyMap | ( | const Vec3T & | xyz | ) | const
| inline

## ◆ applyMapF()

template<typename Vec3T>

__hostdev__ Vec3T applyMapF | ( | const Vec3T & | xyz | ) | const
| inline

## ◆ blindMetaData()

__hostdev__ const GridBlindMetaData * blindMetaData | ( | uint32_t | n | ) | const
| inline

Returns a const reference to the blindMetaData at the specified linear offset.

Warning
  The linear offset is assumed to be in the valid range

## ◆ gridName()

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

## ◆ indexBBox()

__hostdev__ const CoordBBox & indexBBox | ( |  | ) | const
| inline

return AABB of active values in index space

## ◆ init()

__hostdev__ void init | ( | std::initializer_list< GridFlags > | list = {GridFlags::IsBreadthFirst},
|  | uint64_t | gridSize = 0u,
|  | const Map & | map = Map(),
|  | GridType | gridType = GridType::Unknown,
|  | GridClass | gridClass = GridClass::Unknown )
| inline

## ◆ isEmpty()

__hostdev__ bool isEmpty | ( |  | ) | const
| inline

test if the grid is empty, e.i the root table has size 0

Returns
  true if this grid contains not data whatsoever

## ◆ isRootConnected()

__hostdev__ bool isRootConnected | ( |  | ) | const
| inline

return true if RootData follows TreeData in memory without any extra padding

TreeData is always following right after GridData, but the same might not be true for RootData

## ◆ isValid()

__hostdev__ bool isValid | ( |  | ) | const
| inline

return true if the magic number and the version are both valid

## ◆ memUsage()

__hostdev__ uint64_t memUsage | ( |  | ) |
| inlinestatic

Return memory usage in bytes for this class only.

## ◆ nodeCount()

template<uint32_t LEVEL>

__hostdev__ uint32_t nodeCount | ( |  | ) | const
| inline

Return number of nodes at `LEVEL`.

Template Parameters

  Level | of the node. LEVEL 0 means leaf node and LEVEL 2 means upper node

## ◆ nodePtr() [1/2]

template<uint32_t LEVEL>

__hostdev__ void * nodePtr | ( |  | ) |
| inline

Return a non-const void pointer to the first node at `LEVEL`.

Template Parameters

  LEVEL | of the node. LEVEL 0 means leaf node and LEVEL 3 means root node

Warning
  If not nodes exist at `LEVEL` NULL is returned

## ◆ nodePtr() [2/2]

template<uint32_t LEVEL>

__hostdev__ const void * nodePtr | ( |  | ) | const
| inline

Return a non-const void pointer to the first node at `LEVEL`.

Template Parameters

  LEVEL | Level of the node. LEVEL 0 means leaf node and LEVEL 3 means root node

## ◆ operator=()

GridData & operator= | ( | const GridData & |  | ) |
| default

Use this method to initiate most member data.

## ◆ rootTableSize()

__hostdev__ uint32_t rootTableSize | ( |  | ) | const
| inline

return the root table has size

## ◆ setAverageOn()

__hostdev__ void setAverageOn | ( | bool | on = true | ) |
| inline

## ◆ setBBoxOn()

__hostdev__ void setBBoxOn | ( | bool | on = true | ) |
| inline

## ◆ setGridName()

__hostdev__ bool setGridName | ( | const char * | src | ) |
| inline

## ◆ setLongGridNameOn()

__hostdev__ void setLongGridNameOn | ( | bool | on = true | ) |
| inline

## ◆ setMinMaxOn()

__hostdev__ void setMinMaxOn | ( | bool | on = true | ) |
| inline

## ◆ setStdDeviationOn()

__hostdev__ void setStdDeviationOn | ( | bool | on = true | ) |
| inline

## ◆ treePtr() [1/2]

__hostdev__ void * treePtr | ( |  | ) |
| inline

## ◆ treePtr() [2/2]

__hostdev__ const void * treePtr | ( |  | ) | const
| inline

## ◆ worldBBox()

__hostdev__ const Vec3dBBox & worldBBox | ( |  | ) | const
| inline

return AABB of active values in world space

## Member Data Documentation

## ◆ MaxNameSize

const int MaxNameSize = 256
| static

## ◆ mBlindMetadataCount

uint32_t mBlindMetadataCount

## ◆ mBlindMetadataOffset

int64_t mBlindMetadataOffset

## ◆ mChecksum

Checksum mChecksum

## ◆ mData0

uint32_t mData0

## ◆ mData1

uint64_t mData1

## ◆ mData2

uint64_t mData2

## ◆ mFlags

BitFlags<32> mFlags

## ◆ mGridClass

GridClass mGridClass

## ◆ mGridCount

uint32_t mGridCount

## ◆ mGridIndex

uint32_t mGridIndex

## ◆ mGridName

char mGridName[MaxNameSize]

## ◆ mGridSize

uint64_t mGridSize

## ◆ mGridType

GridType mGridType

## ◆ mMagic

uint64_t mMagic

## ◆ mMap

Map mMap

## ◆ mVersion

Version mVersion

## ◆ mVoxelSize

Vec3d mVoxelSize

## ◆ mWorldBBox

Vec3dBBox mWorldBBox