HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CE_VDBGrid Class Reference

#include <CE_VDBGrid.h>

Public Member Functions

 CE_VDBGrid ()
 
 ~CE_VDBGrid ()
 
const cl::Bufferbuffer () const
 
exint bufferSize () const
 
exint getDeviceMemoryUsage () const
 
void copy (const CE_VDBGrid &src, bool readsrc=true)
 
UT_VDBType storageType () const
 
bool hasBuffer () const
 If the current OpenCL buffer is valid. More...
 
bool isValid () const
 
void initFromVDB (const openvdb::GridBase &grid)
 Initialize the CE_VDBGrid from the supplied VDB grid. More...
 
void initFromDeviceBuffers (cl::Buffer gridbuffer, exint gridsize, UT_VDBType storagetype)
 Initialize the CE_VDBGrid from the supplied buffers of a nanovdb. More...
 
void updateTransform (const UT_Matrix3D &xform, const UT_Vector3D &center, const UT_Vector3D &voxelsize, double taper)
 Replaces the map transform with the provided one. More...
 
void initFromBuffers (const void *data, exint datasize, UT_VDBType storagetype)
 
void initFromSize (exint datasize, UT_VDBType storagetype)
 
openvdb::GridBase::Ptr createVDB () const
 Create a VDB grid from the CE VDB grid. More...
 

Static Public Member Functions

static voidallocAlignedBufferFromVDB (const openvdb::GridBase &grid, exint &size)
 
static void buildTileStartsArray (UT_Array< UT_Vector3i > &starts, exint &leafcount, exint &lowercount, exint &uppercount, const openvdb::GridBase &grid)
 Utility function to build an tilestart array from a grid. More...
 
static void buildTileStartsArray (UT_Array< UT_Vector3i > &starts, exint &leafcount, exint &lowercount, exint &uppercount, const CE_BufferHostByte &cpugrid)
 Utility function to build an tilestart array from a nanovdb on cpu. More...
 
static openvdb::GridBase::Ptr createVDBFromAlignedBuffer (const void *data, exint datasize)
 

Protected Member Functions

void releaseBuffer ()
 

Protected Attributes

cl::Buffer myBuffer
 
exint myBufferSize = -1
 
UT_VDBType myStorageType = UT_VDB_INVALID
 

Detailed Description

Definition at line 28 of file CE_VDBGrid.h.

Constructor & Destructor Documentation

CE_VDBGrid::CE_VDBGrid ( )
inline

Definition at line 31 of file CE_VDBGrid.h.

CE_VDBGrid::~CE_VDBGrid ( )
inline

Definition at line 32 of file CE_VDBGrid.h.

Member Function Documentation

static void* CE_VDBGrid::allocAlignedBufferFromVDB ( const openvdb::GridBase &  grid,
exint size 
)
static

Builds a CPU buffer from the VDB provided: The result is SYSamalloc so must be SYSafreed.

const cl::Buffer& CE_VDBGrid::buffer ( ) const
inline

Return the underlying OpenCL buffer that can be used in kernel invocations.

Definition at line 41 of file CE_VDBGrid.h.

exint CE_VDBGrid::bufferSize ( ) const
inline

Definition at line 42 of file CE_VDBGrid.h.

static void CE_VDBGrid::buildTileStartsArray ( UT_Array< UT_Vector3i > &  starts,
exint leafcount,
exint lowercount,
exint uppercount,
const openvdb::GridBase &  grid 
)
static

Utility function to build an tilestart array from a grid.

static void CE_VDBGrid::buildTileStartsArray ( UT_Array< UT_Vector3i > &  starts,
exint leafcount,
exint lowercount,
exint uppercount,
const CE_BufferHostByte cpugrid 
)
static

Utility function to build an tilestart array from a nanovdb on cpu.

void CE_VDBGrid::copy ( const CE_VDBGrid src,
bool  readsrc = true 
)

Deep copy from another grid into this, if readsrc is false, will only allocate matching size.

openvdb::GridBase::Ptr CE_VDBGrid::createVDB ( ) const

Create a VDB grid from the CE VDB grid.

static openvdb::GridBase::Ptr CE_VDBGrid::createVDBFromAlignedBuffer ( const void data,
exint  datasize 
)
static

Create a VDB grid from generic memory. NanoVDB requires 32 byte aligned buffers.

exint CE_VDBGrid::getDeviceMemoryUsage ( ) const
inline

Definition at line 44 of file CE_VDBGrid.h.

bool CE_VDBGrid::hasBuffer ( ) const
inline

If the current OpenCL buffer is valid.

Definition at line 57 of file CE_VDBGrid.h.

void CE_VDBGrid::initFromBuffers ( const void data,
exint  datasize,
UT_VDBType  storagetype 
)

Initialize from a memory pointer and size. This will blocking-write to GPU data.

void CE_VDBGrid::initFromDeviceBuffers ( cl::Buffer  gridbuffer,
exint  gridsize,
UT_VDBType  storagetype 
)

Initialize the CE_VDBGrid from the supplied buffers of a nanovdb.

void CE_VDBGrid::initFromSize ( exint  datasize,
UT_VDBType  storagetype 
)

Initialize from a given size, allocating only assuming later code will write to it..

void CE_VDBGrid::initFromVDB ( const openvdb::GridBase &  grid)

Initialize the CE_VDBGrid from the supplied VDB grid.

bool CE_VDBGrid::isValid ( ) const
inline

Definition at line 58 of file CE_VDBGrid.h.

void CE_VDBGrid::releaseBuffer ( )
protected
UT_VDBType CE_VDBGrid::storageType ( ) const
inline

Definition at line 54 of file CE_VDBGrid.h.

void CE_VDBGrid::updateTransform ( const UT_Matrix3D xform,
const UT_Vector3D center,
const UT_Vector3D voxelsize,
double  taper 
)

Replaces the map transform with the provided one.

Member Data Documentation

cl::Buffer CE_VDBGrid::myBuffer
protected

Definition at line 113 of file CE_VDBGrid.h.

exint CE_VDBGrid::myBufferSize = -1
protected

Definition at line 114 of file CE_VDBGrid.h.

UT_VDBType CE_VDBGrid::myStorageType = UT_VDB_INVALID
protected

Definition at line 116 of file CE_VDBGrid.h.


The documentation for this class was generated from the following file: