OpenVDB  11.0.0
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
GridData Struct Reference

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

#include <nanovdb/NanoVDB.h>

Inherited by Grid< BuildT >, Grid< IndexT >, Grid< nanovdb::Point >, and Grid< TreeT >.

Public Member Functions

GridDataoperator= (const GridData &other)
 Use this method to initiate most member dat. More...
 
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)
 
bool isValid () const
 return true if the magic number and the version are both valid More...
 
void setMinMaxOn (bool on=true)
 
void setBBoxOn (bool on=true)
 
void setLongGridNameOn (bool on=true)
 
void setAverageOn (bool on=true)
 
void setStdDeviationOn (bool on=true)
 
bool setGridName (const char *src)
 
template<typename Vec3T >
Vec3T applyMap (const Vec3T &xyz) const
 
template<typename Vec3T >
Vec3T applyInverseMap (const Vec3T &xyz) const
 
template<typename Vec3T >
Vec3T applyJacobian (const Vec3T &xyz) const
 
template<typename Vec3T >
Vec3T applyInverseJacobian (const Vec3T &xyz) const
 
template<typename Vec3T >
Vec3T applyIJT (const Vec3T &xyz) const
 
template<typename Vec3T >
Vec3T applyMapF (const Vec3T &xyz) const
 
template<typename Vec3T >
Vec3T applyInverseMapF (const Vec3T &xyz) const
 
template<typename Vec3T >
Vec3T applyJacobianF (const Vec3T &xyz) const
 
template<typename Vec3T >
Vec3T applyInverseJacobianF (const Vec3T &xyz) const
 
template<typename Vec3T >
Vec3T applyIJTF (const Vec3T &xyz) const
 
uint8_t * treePtr ()
 
const uint8_t * treePtr () const
 
template<uint32_t LEVEL>
const uint8_t * nodePtr () const
 Return a non-const uint8_t pointer to the first node at LEVEL. More...
 
template<uint32_t LEVEL>
uint8_t * nodePtr ()
 Return a non-const uint8_t pointer to the first node at LEVEL. More...
 
const GridBlindMetaDatablindMetaData (uint32_t n) const
 Returns a const reference to the blindMetaData at the specified linear offset. More...
 
const char * gridName () const
 
const BBox< Vec3d > & worldBBox () const
 return AABB of active values in world space More...
 
const CoordBBoxindexBBox () const
 return AABB of active values in index space More...
 
uint32_t rootTableSize () const
 return the root table has size More...
 
bool isEmpty () const
 test if the grid is empty, e.i the root table has size 0 More...
 
bool isRootConnected () const
 return true if RootData follows TreeData in memory without any extra padding More...
 

Static Public Member Functions

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

Public Attributes

uint64_t mMagic
 
uint64_t mChecksum
 
Version mVersion
 
BitFlags< 32 > mFlags
 
uint32_t mGridIndex
 
uint32_t mGridCount
 
uint64_t mGridSize
 
char mGridName [MaxNameSize]
 
Map mMap
 
BBox< Vec3dmWorldBBox
 
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

Vec3T applyIJT ( const Vec3T &  xyz) const
inline
Vec3T applyIJTF ( const Vec3T &  xyz) const
inline
Vec3T applyInverseJacobian ( const Vec3T &  xyz) const
inline
Vec3T applyInverseJacobianF ( const Vec3T &  xyz) const
inline
Vec3T applyInverseMap ( const Vec3T &  xyz) const
inline
Vec3T applyInverseMapF ( const Vec3T &  xyz) const
inline
Vec3T applyJacobian ( const Vec3T &  xyz) const
inline
Vec3T applyJacobianF ( const Vec3T &  xyz) const
inline
Vec3T applyMap ( const Vec3T &  xyz) const
inline
Vec3T applyMapF ( const Vec3T &  xyz) const
inline
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
const char* gridName ( ) const
inline
const CoordBBox& indexBBox ( ) const
inline

return AABB of active values in index space

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

bool isValid ( ) const
inline

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

static uint64_t memUsage ( )
inlinestatic

Return memory usage in bytes for this class only.

const uint8_t* nodePtr ( ) const
inline

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

Template Parameters
LEVELof the node. LEVEL 0 means leaf node and LEVEL 3 means root node
Warning
If not nodes exist at LEVEL NULL is returned
uint8_t* nodePtr ( )
inline

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

Template Parameters
LEVELof the node. LEVEL 0 means leaf node and LEVEL 3 means root node
Warning
If not nodes exist at LEVEL NULL is returned
GridData& operator= ( const GridData other)
inline

Use this method to initiate most member dat.

uint32_t rootTableSize ( ) const
inline

return the root table has size

void setAverageOn ( bool  on = true)
inline
void setBBoxOn ( bool  on = true)
inline
bool setGridName ( const char *  src)
inline
void setLongGridNameOn ( bool  on = true)
inline
void setMinMaxOn ( bool  on = true)
inline
void setStdDeviationOn ( bool  on = true)
inline
uint8_t* treePtr ( )
inline
const uint8_t* treePtr ( ) const
inline
const BBox<Vec3d>& worldBBox ( ) const
inline

return AABB of active values in world space

Member Data Documentation

const int MaxNameSize = 256
static
uint32_t mBlindMetadataCount
int64_t mBlindMetadataOffset
uint64_t mChecksum
uint32_t mData0
uint64_t mData1
uint64_t mData2
BitFlags<32> mFlags
GridClass mGridClass
uint32_t mGridCount
uint32_t mGridIndex
char mGridName[MaxNameSize]
uint64_t mGridSize
GridType mGridType
uint64_t mMagic
Map mMap
Version mVersion
Vec3d mVoxelSize
BBox<Vec3d> mWorldBBox