OpenVDB  9.0.1
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
DenseGrid< ValueT > Class Template Reference

Simple dense grid class. More...

#include <nanovdb/examples/benchmark/DenseGrid.h>

Inherits DenseData.

Public Types

using ValueType = ValueT
 

Public Member Functions

__hostdev__ DenseGrid (const DenseGrid &)=delete
 
__hostdev__ ~DenseGrid ()=delete
 
__hostdev__ DenseGridoperator= (const DenseGrid &)=delete
 
__hostdev__ uint64_t size () const
 
__hostdev__ uint64_t coordToOffset (const Coord &ijk) const
 
__hostdev__ bool test (const Coord &ijk) const
 
__hostdev__ uint64_t memUsage () const
 
__hostdev__ uint64_t gridSize () const
 
__hostdev__ const Coordmin () const
 
__hostdev__ const Coordmax () const
 
__hostdev__ bool isValidType () const
 
__hostdev__ const Mapmap () const
 Return a const reference to the Map for this grid. More...
 
__hostdev__ const Vec3RvoxelSize () const
 
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
 world to index 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__ const BBox< Vec3R > & worldBBox () const
 Computes a AABB of active values in world space. More...
 
__hostdev__ bool isLevelSet () const
 
__hostdev__ bool isFogVolume () const
 
__hostdev__ const CoordBBoxindexBBox () const
 Computes a AABB of active values in index space. More...
 
__hostdev__ const GridTypegridType () const
 
__hostdev__ const GridClassgridClass () const
 
__hostdev__ DenseData * data ()
 
__hostdev__ const DenseData * data () const
 
__hostdev__ ValueT * values ()
 
__hostdev__ const ValueT * values () const
 
__hostdev__ const ValueT & getValue (const Coord &ijk) const
 
__hostdev__ void setValue (const Coord &ijk, const ValueT &v)
 

Static Public Member Functions

template<typename BufferT = HostBuffer>
static DenseGridHandle< BufferT > create (Coord min, Coord max, double dx=1.0, const Vec3d &p0=Vec3d(0.0), GridClass gridClass=GridClass::Unknown, const BufferT &allocator=BufferT())
 

Private Member Functions

__hostdev__ Coord dim () const
 
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
 

Private Attributes

Map mMap
 
CoordBBox mIndexBBox
 
BBox< Vec3RmWorldBBox
 
Vec3R mVoxelSize
 
GridClass mGridClass
 
GridType mGridType
 
uint64_t mY
 
uint64_t mX
 
uint64_t mSize
 

Detailed Description

template<typename ValueT>
class nanovdb::DenseGrid< ValueT >

Simple dense grid class.

Note
ZYX is the memory-layout in VDB. It leads to nested for-loops of the order x, y, z.

Member Typedef Documentation

using ValueType = ValueT

Constructor & Destructor Documentation

__hostdev__ DenseGrid ( const DenseGrid< ValueT > &  )
delete
__hostdev__ ~DenseGrid ( )
delete

Member Function Documentation

uint64_t coordToOffset ( const Coord ijk) const
inline
DenseGridHandle< BufferT > create ( Coord  min,
Coord  max,
double  dx = 1.0,
const Vec3d p0 = Vec3d(0.0),
GridClass  gridClass = GridClass::Unknown,
const BufferT &  allocator = BufferT() 
)
inlinestatic
__hostdev__ DenseData* data ( )
inline
__hostdev__ const DenseData* data ( ) const
inline
const ValueT & getValue ( const Coord ijk) const
inline
__hostdev__ const GridClass& gridClass ( ) const
inline
__hostdev__ uint64_t gridSize ( ) const
inline
__hostdev__ const GridType& gridType ( ) const
inline
__hostdev__ const CoordBBox& 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.
__hostdev__ Vec3T indexToWorld ( const Vec3T &  xyz) const
inline

world to index space transformation

__hostdev__ Vec3T indexToWorldDir ( const Vec3T &  dir) const
inline

transformation from index space direction to world space direction

Warning
assumes dir to be normalized
__hostdev__ Vec3T indexToWorldDirF ( const Vec3T &  dir) const
inline

transformation from index space direction to world space direction

Warning
assumes dir to be normalized
__hostdev__ Vec3T indexToWorldF ( const Vec3T &  xyz) const
inline

index to world space transformation

__hostdev__ Vec3T indexToWorldGrad ( const Vec3T &  grad) const
inline

transform the gradient from index space to world space.

Applies the inverse jacobian transform map.

__hostdev__ Vec3T indexToWorldGradF ( const Vec3T &  grad) const
inline

Transforms the gradient from index space to world space.

Applies the inverse jacobian transform map.

__hostdev__ bool isFogVolume ( ) const
inline
__hostdev__ bool isLevelSet ( ) const
inline
bool isValidType ( ) const
inline
__hostdev__ const Map& map ( ) const
inline

Return a const reference to the Map for this grid.

__hostdev__ const Coord& max ( ) const
inline
__hostdev__ uint64_t memUsage ( ) const
inline
__hostdev__ const Coord& min ( ) const
inline
__hostdev__ DenseGrid& operator= ( const DenseGrid< ValueT > &  )
delete
void setValue ( const Coord ijk,
const ValueT &  v 
)
inline
__hostdev__ uint64_t size ( ) const
inline
bool test ( const Coord ijk) const
inline
__hostdev__ ValueT* values ( )
inline
__hostdev__ const ValueT* values ( ) const
inline
__hostdev__ const Vec3R& voxelSize ( ) const
inline
__hostdev__ const BBox<Vec3R>& worldBBox ( ) const
inline

Computes a AABB of active values in world space.

__hostdev__ Vec3T worldToIndex ( const Vec3T &  xyz) const
inline

world to index space transformation

__hostdev__ Vec3T worldToIndexDir ( const Vec3T &  dir) const
inline

transformation from world space direction to index space direction

Warning
assumes dir to be normalized
__hostdev__ Vec3T worldToIndexDirF ( const Vec3T &  dir) const
inline

transformation from world space direction to index space direction

Warning
assumes dir to be normalized
__hostdev__ Vec3T worldToIndexF ( const Vec3T &  xyz) const
inline

world to index space transformation