HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CNanoVDB.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cnanovdb_map
 
struct  cnanovdb_Vec3F
 
struct  cnanovdb_coord
 
struct  cnanovdb_gridblindmetadata
 
struct  cnanovdb_griddata
 
struct  cnanovdb_treedata
 
struct  cnanovdb_readaccessor
 

Macros

#define CNANOVDB_DATA_ALIGNMENT   32
 
#define CNANOVDB_ALIGNMENT_PADDING(x, n)   (-(x) & ((n)-1))
 
#define USE_SINGLE_ROOT_KEY
 
#define CNANOVDB_GLOBAL
 
#define RESTRICT   __restrict
 
#define ROOT_LEVEL   3
 
#define DEFINEMASK_int(LOG2DIM, SIZE)
 
#define DEFINEMASK(LOG2DIM)   DEFINEMASK_int(LOG2DIM, (1U << (3*LOG2DIM)))
 
#define INSTANTIATE(LOG2DIM)   DEFINEMASK(LOG2DIM)
 
#define CREATE_TILEENTRY(VALUETYPE, SUFFIX)
 
#define CREATE_LEAF_NODE_int(LEVEL, LOG2DIM, CHILDTOTAL, TOTAL, MASK, VALUETYPE, STATSTYPE, SUFFIX)
 
#define CREATE_LEAF_NODE(LEVEL, LOG2DIM, TOTAL, VALUETYPE, STATSTYPE, SUFFIX)   CREATE_LEAF_NODE_int(LEVEL, LOG2DIM, (TOTAL-LOG2DIM), TOTAL, ((1u << TOTAL) - 1u), VALUETYPE, STATSTYPE, SUFFIX)
 
#define CREATE_INTERNAL_NODE_int(CHILDLEVEL, LEVEL, LOG2DIM, CHILDTOTAL, TOTAL, MASK, VALUETYPE, STATSTYPE, SUFFIX)
 
#define CREATE_INTERNAL_NODE(CHILDLEVEL, LEVEL, LOG2DIM, TOTAL, VALUETYPE, STATSTYPE, SUFFIX)   CREATE_INTERNAL_NODE_int(CHILDLEVEL, LEVEL, LOG2DIM, (TOTAL-LOG2DIM), TOTAL, ((1u << TOTAL) - 1u), VALUETYPE, STATSTYPE, SUFFIX)
 
#define DEFINE_KEY(KEY)   uint64_t KEY;
 
#define KEYSIZE   sizeof(uint64_t)
 
#define KEYSEARCH(SUFFIX)
 
#define CREATE_ROOTDATA(VALUETYPE, STATSTYPE, SUFFIX)
 
#define DEFINE_ISCACHED(LEVEL, MASK)
 
#define CREATE_ACCESSOR(VALUETYPE, SUFFIX)
 
#define CREATE_GRIDTYPE(VALUETYPE, STATSTYPE, SUFFIX)
 

Enumerations

enum  cnanovdb_GridType {
  cnanovdb_GridType_Unknown = 0, cnanovdb_GridType_Float = 1, cnanovdb_GridType_Double = 2, cnanovdb_GridType_Int16 = 3,
  cnanovdb_GridType_Int32 = 4, cnanovdb_GridType_Int64 = 5, cnanovdb_GridType_Vec3f = 6, cnanovdb_GridType_Vec3d = 7,
  cnanovdb_GridType_Mask = 8, cnanovdb_GridType_FP16 = 9, cnanovdb_GridType_End = 10
}
 

Functions

void cnanovdb_readaccessor_init (cnanovdb_readaccessor *RESTRICT acc, const CNANOVDB_GLOBAL void *RESTRICT rootdata)
 
 DEFINE_ISCACHED (0,((1u<< 3)-1u)) DEFINE_ISCACHED(1
 

Variables

<< 7)-1u)) DEFINE_ISCACHED(2,((1u<< 12)-1u)) inlineint32_tcnanovdb_readaccessor_computeDirty(constcnanovdb_readaccessor *RESTRICTacc, constcnanovdb_coord *RESTRICTijk){return(ijk->mVec[0]^acc->mKey.mVec[0])|(ijk-> mVec[1] acc mKey mVec (ijk->mVec[2]^acc->mKey.mVec[2])
 

Macro Definition Documentation

#define CNANOVDB_ALIGNMENT_PADDING (   x,
  n 
)    (-(x) & ((n)-1))

Definition at line 12 of file CNanoVDB.h.

#define CNANOVDB_DATA_ALIGNMENT   32

Definition at line 11 of file CNanoVDB.h.

#define CNANOVDB_GLOBAL

Definition at line 32 of file CNanoVDB.h.

#define CREATE_ACCESSOR (   VALUETYPE,
  SUFFIX 
)
Value:
inline VALUETYPE \
cnanovdb_readaccessor_getValue##SUFFIX(cnanovdb_readaccessor *RESTRICT acc, const cnanovdb_coord *RESTRICT ijk) \
{ \
int32_t dirty = cnanovdb_readaccessor_computeDirty(acc, ijk); \
if (cnanovdb_readaccessor_isCached0(acc, dirty)) \
return cnanovdb_node0##SUFFIX##_getValue( ((CNANOVDB_GLOBAL cnanovdb_node0##SUFFIX *) acc->mNode[0]), ijk); \
if (cnanovdb_readaccessor_isCached1(acc, dirty)) \
return cnanovdb_node1##SUFFIX##_getValueAndCache( ((CNANOVDB_GLOBAL cnanovdb_node1##SUFFIX *) acc->mNode[1]), ijk, acc); \
if (cnanovdb_readaccessor_isCached2(acc, dirty)) \
return cnanovdb_node2##SUFFIX##_getValueAndCache( ((CNANOVDB_GLOBAL cnanovdb_node2##SUFFIX *) acc->mNode[2]), ijk, acc); \
\
return cnanovdb_rootdata##SUFFIX##_getValueAndCache( ((CNANOVDB_GLOBAL cnanovdb_rootdata##SUFFIX *)acc->mNode[3]), ijk, acc); \
} \
\
inline bool \
cnanovdb_readaccessor_isActive##SUFFIX(cnanovdb_readaccessor *RESTRICT acc, const cnanovdb_coord *RESTRICT ijk) \
{ \
int32_t dirty = cnanovdb_readaccessor_computeDirty(acc, ijk); \
if (cnanovdb_readaccessor_isCached0(acc, dirty)) \
return cnanovdb_node0##SUFFIX##_isActive( ((CNANOVDB_GLOBAL cnanovdb_node0##SUFFIX *) acc->mNode[0]), ijk); \
if (cnanovdb_readaccessor_isCached1(acc, dirty)) \
return cnanovdb_node1##SUFFIX##_isActiveAndCache( ((CNANOVDB_GLOBAL cnanovdb_node1##SUFFIX *) acc->mNode[1]), ijk, acc); \
if (cnanovdb_readaccessor_isCached2(acc, dirty)) \
return cnanovdb_node2##SUFFIX##_isActiveAndCache( ((CNANOVDB_GLOBAL cnanovdb_node2##SUFFIX *) acc->mNode[2]), ijk, acc); \
\
return cnanovdb_rootdata##SUFFIX##_isActiveAndCache( ((CNANOVDB_GLOBAL cnanovdb_rootdata##SUFFIX *)acc->mNode[3]), ijk, acc); \
} \
#define RESTRICT
Definition: CNanoVDB.h:33
#define CNANOVDB_GLOBAL
Definition: CNanoVDB.h:32
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697

Definition at line 640 of file CNanoVDB.h.

#define CREATE_GRIDTYPE (   VALUETYPE,
  STATSTYPE,
  SUFFIX 
)
Value:
CREATE_TILEENTRY(VALUETYPE, SUFFIX) \
CREATE_LEAF_NODE(0, 3, 3, VALUETYPE, STATSTYPE, SUFFIX) \
CREATE_INTERNAL_NODE(0, 1, 4, 7, VALUETYPE, STATSTYPE, SUFFIX) \
CREATE_INTERNAL_NODE(1, 2, 5, 12, VALUETYPE, STATSTYPE, SUFFIX) \
CREATE_ROOTDATA(VALUETYPE, STATSTYPE, SUFFIX) \
CREATE_ACCESSOR(VALUETYPE, SUFFIX) \
#define CREATE_TILEENTRY(VALUETYPE, SUFFIX)
Definition: CNanoVDB.h:277
#define CREATE_LEAF_NODE(LEVEL, LOG2DIM, TOTAL, VALUETYPE, STATSTYPE, SUFFIX)
Definition: CNanoVDB.h:367
#define CREATE_INTERNAL_NODE(CHILDLEVEL, LEVEL, LOG2DIM, TOTAL, VALUETYPE, STATSTYPE, SUFFIX)
Definition: CNanoVDB.h:457
#define CREATE_ROOTDATA(VALUETYPE, STATSTYPE, SUFFIX)
Definition: CNanoVDB.h:505
#define CREATE_ACCESSOR(VALUETYPE, SUFFIX)
Definition: CNanoVDB.h:640

Definition at line 673 of file CNanoVDB.h.

#define CREATE_INTERNAL_NODE (   CHILDLEVEL,
  LEVEL,
  LOG2DIM,
  TOTAL,
  VALUETYPE,
  STATSTYPE,
  SUFFIX 
)    CREATE_INTERNAL_NODE_int(CHILDLEVEL, LEVEL, LOG2DIM, (TOTAL-LOG2DIM), TOTAL, ((1u << TOTAL) - 1u), VALUETYPE, STATSTYPE, SUFFIX)

Definition at line 457 of file CNanoVDB.h.

#define CREATE_INTERNAL_NODE_int (   CHILDLEVEL,
  LEVEL,
  LOG2DIM,
  CHILDTOTAL,
  TOTAL,
  MASK,
  VALUETYPE,
  STATSTYPE,
  SUFFIX 
)

Definition at line 370 of file CNanoVDB.h.

#define CREATE_LEAF_NODE (   LEVEL,
  LOG2DIM,
  TOTAL,
  VALUETYPE,
  STATSTYPE,
  SUFFIX 
)    CREATE_LEAF_NODE_int(LEVEL, LOG2DIM, (TOTAL-LOG2DIM), TOTAL, ((1u << TOTAL) - 1u), VALUETYPE, STATSTYPE, SUFFIX)

Definition at line 367 of file CNanoVDB.h.

#define CREATE_LEAF_NODE_int (   LEVEL,
  LOG2DIM,
  CHILDTOTAL,
  TOTAL,
  MASK,
  VALUETYPE,
  STATSTYPE,
  SUFFIX 
)

Definition at line 301 of file CNanoVDB.h.

#define CREATE_ROOTDATA (   VALUETYPE,
  STATSTYPE,
  SUFFIX 
)

Definition at line 505 of file CNanoVDB.h.

#define CREATE_TILEENTRY (   VALUETYPE,
  SUFFIX 
)
Value:
typedef union \
{ \
VALUETYPE value; \
uint64_t child; \
} cnanovdb_tileentry##SUFFIX; \
GLsizei const GLfloat * value
Definition: glcorearb.h:824

Definition at line 277 of file CNanoVDB.h.

#define DEFINE_ISCACHED (   LEVEL,
  MASK 
)
Value:
inline bool \
cnanovdb_readaccessor_isCached##LEVEL(cnanovdb_readaccessor *RESTRICT acc, int32_t dirty) \
{ \
if (!acc->mNode[LEVEL]) \
return false; \
if (dirty & ~MASK) \
{ \
acc->mNode[LEVEL] = 0; \
return false; \
} \
return true; \
} \
#define RESTRICT
Definition: CNanoVDB.h:33
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697

Definition at line 613 of file CNanoVDB.h.

#define DEFINE_KEY (   KEY)    uint64_t KEY;

Definition at line 462 of file CNanoVDB.h.

#define DEFINEMASK (   LOG2DIM)    DEFINEMASK_int(LOG2DIM, (1U << (3*LOG2DIM)))

Definition at line 68 of file CNanoVDB.h.

#define DEFINEMASK_int (   LOG2DIM,
  SIZE 
)
Value:
typedef struct \
{ \
uint64_t mWords[SIZE >> 6]; \
} cnanovdb_mask##LOG2DIM; \
\
static void cnanovdb_mask##LOG2DIM##_clear(CNANOVDB_GLOBAL cnanovdb_mask##LOG2DIM *RESTRICT mask) \
{ for (uint32_t i = 0; i < (SIZE >> 6); i++) mask->mWords[i] = 0; } \
\
static bool cnanovdb_mask##LOG2DIM##_isOn(const CNANOVDB_GLOBAL cnanovdb_mask##LOG2DIM *RESTRICT mask, uint32_t n) \
{ return 0 != (mask->mWords[n >> 6] & (((uint64_t)(1)) << (n & 63))); } \
#define RESTRICT
Definition: CNanoVDB.h:33
GLdouble n
Definition: glcorearb.h:2008
GLint GLuint mask
Definition: glcorearb.h:124
#define CNANOVDB_GLOBAL
Definition: CNanoVDB.h:32
#define SIZE
Definition: simple.C:41

Definition at line 55 of file CNanoVDB.h.

#define INSTANTIATE (   LOG2DIM)    DEFINEMASK(LOG2DIM)

Definition at line 71 of file CNanoVDB.h.

#define KEYSEARCH (   SUFFIX)
Value:
uint64_t key; \
key = cnanovdb_coord_to_key(ijk); \
for (int i = low; i < high; i++) \
{ \
const CNANOVDB_GLOBAL cnanovdb_rootdata_tile##SUFFIX *tile = tiles + i; \
if (tile->key == key) \
return tile; \
} \
#define CNANOVDB_GLOBAL
Definition: CNanoVDB.h:32
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697
* for(int i=0;i< n_subtasks;++i)*tasks.push(pool-> push(myfunc))
Definition: UT_RTreeImpl.h:685

Definition at line 466 of file CNanoVDB.h.

#define KEYSIZE   sizeof(uint64_t)

Definition at line 464 of file CNanoVDB.h.

#define RESTRICT   __restrict

Definition at line 33 of file CNanoVDB.h.

#define ROOT_LEVEL   3

Definition at line 53 of file CNanoVDB.h.

#define USE_SINGLE_ROOT_KEY

Definition at line 14 of file CNanoVDB.h.

Enumeration Type Documentation

Enumerator
cnanovdb_GridType_Unknown 
cnanovdb_GridType_Float 
cnanovdb_GridType_Double 
cnanovdb_GridType_Int16 
cnanovdb_GridType_Int32 
cnanovdb_GridType_Int64 
cnanovdb_GridType_Vec3f 
cnanovdb_GridType_Vec3d 
cnanovdb_GridType_Mask 
cnanovdb_GridType_FP16 
cnanovdb_GridType_End 

Definition at line 38 of file CNanoVDB.h.

Function Documentation

void cnanovdb_readaccessor_init ( cnanovdb_readaccessor *RESTRICT  acc,
const CNANOVDB_GLOBAL void *RESTRICT  rootdata 
)
inline

Definition at line 606 of file CNanoVDB.h.

DEFINE_ISCACHED ( ,
((1u<< 3)-1u)   
)

Variable Documentation

<<7)-1u))DEFINE_ISCACHED(2,((1u<<12)-1u))inlineint32_tcnanovdb_readaccessor_computeDirty(constcnanovdb_readaccessor*RESTRICTacc,constcnanovdb_coord*RESTRICTijk){return(ijk->mVec[0]^acc->mKey.mVec[0])|(ijk-> mVec [1] acc mKey mVec(ijk->mVec[2]^acc->mKey.mVec[2])

Definition at line 637 of file CNanoVDB.h.