125#ifndef NANOVDB_NANOVDB_H_HAS_BEEN_INCLUDED
126#define NANOVDB_NANOVDB_H_HAS_BEEN_INCLUDED
133#define NANOVDB_DATA_ALIGNMENT 32
139#define NANOVDB_MAGIC_NUMB 0x304244566f6e614eUL
140#define NANOVDB_MAGIC_GRID 0x314244566f6e614eUL
141#define NANOVDB_MAGIC_FILE 0x324244566f6e614eUL
142#define NANOVDB_MAGIC_MASK 0x00FFFFFFFFFFFFFFUL
144#define NANOVDB_USE_NEW_MAGIC_NUMBERS
146#define NANOVDB_MAJOR_VERSION_NUMBER 32
147#define NANOVDB_MINOR_VERSION_NUMBER 10
148#define NANOVDB_PATCH_VERSION_NUMBER 0
150#define TBB_SUPPRESS_DEPRECATED_MESSAGES 1
153#define NANOVDB_USE_SINGLE_ROOT_KEY
166#define NANOVDB_FPN_BRANCHLESS
168#if !defined(NANOVDB_ALIGN)
169#define NANOVDB_ALIGN(n) alignas(n)
212template <
class EnumT>
213__hostdev__ inline constexpr uint32_t
strlen(){
return (uint32_t)EnumT::StrLen - (uint32_t)EnumT::End;}
501 return defaultSemantic;
690 switch (blindClass) {
742 : mData(major << 21 | minor << 10 | patch)
775template<
typename T,
int Rank = (util::is_specialization<T, math::Vec3>::value || util::is_specialization<T, math::Vec4>::value || util::is_same<T, math::Rgba8>::value) ? 1 : 0>
786 static T
scalar(
const T& s) {
return s; }
795 static const int Size = T::SIZE;
802template<
typename T,
int = sizeof(
typename TensorTraits<T>::ElementType)>
847template<
typename BuildT>
902template<
typename BuildT>
903[[deprecated(
"Use toGridType<T>() instead.")]]
909template<
typename BuildT>
924template<
typename BuildT>
925[[deprecated(
"Use toGridClass<T>() instead.")]]
968 for (
auto bit : list) mFlags |=
static_cast<Type>(1 << bit);
970 template<
typename MaskT>
973 for (
auto mask : list) mFlags |=
static_cast<Type>(mask);
980 for (
auto bit : list) mFlags |=
static_cast<Type>(1 << bit);
982 template<
typename MaskT>
986 for (
auto mask : list) mFlags |=
static_cast<Type>(mask);
998 for (
auto bit : list) mFlags |=
static_cast<Type>(1 << bit);
1002 for (
auto bit : list) mFlags &= ~static_cast<Type>(1 << bit);
1005 template<
typename MaskT>
1007 template<
typename MaskT>
1010 template<
typename MaskT>
1013 for (
auto mask : list) mFlags |=
static_cast<Type>(mask);
1015 template<
typename MaskT>
1018 for (
auto mask : list) mFlags &= ~static_cast<Type>(mask);
1022 template<
typename MaskT>
1029 template<
typename MaskT>
1031 template<
typename MaskT>
1034 template<
typename MaskT>
1037 for (
auto mask : list) {
1038 if (0 != (mFlags &
static_cast<Type>(mask)))
return true;
1043 template<
typename MaskT>
1046 for (
auto mask : list) {
1047 if (0 == (mFlags &
static_cast<Type>(mask)))
return true;
1063template<u
int32_t LOG2DIM>
1067 static constexpr uint32_t
SIZE = 1U << (3 * LOG2DIM);
1083 for (
const uint64_t *w = mWords, *q = w +
WORD_COUNT; w != q; ++w)
1091 uint32_t n = i >> 6, sum =
util::countOn(mWords[n] & ((uint64_t(1) << (i & 63u)) - 1u));
1092 for (
const uint64_t* w = mWords; n--; ++w)
1117 mPos = mParent->findNext<On>(mPos + 1);
1129 const Mask* mParent;
1176 const uint64_t v = on ? ~uint64_t(0) : uint64_t(0);
1188 template<
typename WordT>
1193 return reinterpret_cast<WordT*
>(mWords)[n];
1195 template<
typename WordT>
1200 reinterpret_cast<WordT*
>(mWords)[n] = w;
1204 template<
typename MaskT = Mask>
1207 static_assert(
sizeof(
Mask) ==
sizeof(MaskT),
"Mismatching sizeof");
1208 static_assert(
WORD_COUNT == MaskT::WORD_COUNT,
"Mismatching word count");
1209 static_assert(LOG2DIM == MaskT::LOG2DIM,
"Mismatching LOG2DIM");
1210 auto* src =
reinterpret_cast<const uint64_t*
>(&other);
1211 for (uint64_t *dst = mWords, *end = dst +
WORD_COUNT; dst != end; ++dst)
1222 if (mWords[i] != other.mWords[i])
1231 __hostdev__ bool isOn(uint32_t n)
const {
return 0 != (mWords[n >> 6] & (uint64_t(1) << (n & 63))); }
1234 __hostdev__ bool isOff(uint32_t n)
const {
return 0 == (mWords[n >> 6] & (uint64_t(1) << (n & 63))); }
1240 if (mWords[i] != ~uint64_t(0))
1249 if (mWords[i] != uint64_t(0))
1271#if defined(__CUDACC__)
1298 auto& word = mWords[n >> 6];
1300 word &= ~(uint64_t(1) << n);
1301 word |= uint64_t(on) << n;
1310 for (uint32_t i = 0; i <
WORD_COUNT; ++i)mWords[i] = ~uint64_t(0);
1316 for (uint32_t i = 0; i <
WORD_COUNT; ++i) mWords[i] = uint64_t(0);
1322 const uint64_t v = on ? ~uint64_t(0) : uint64_t(0);
1323 for (uint32_t i = 0; i <
WORD_COUNT; ++i) mWords[i] = v;
1329 for (
auto* w = mWords; n--; ++w) *w = ~*w;
1336 uint64_t* w1 = mWords;
1337 const uint64_t* w2 = other.mWords;
1338 for (uint32_t n =
WORD_COUNT; n--; ++w1, ++w2) *w1 &= *w2;
1344 uint64_t* w1 = mWords;
1345 const uint64_t* w2 = other.mWords;
1346 for (uint32_t n =
WORD_COUNT; n--; ++w1, ++w2) *w1 |= *w2;
1352 uint64_t* w1 = mWords;
1353 const uint64_t* w2 = other.mWords;
1354 for (uint32_t n =
WORD_COUNT; n--; ++w1, ++w2) *w1 &= ~*w2;
1360 uint64_t* w1 = mWords;
1361 const uint64_t* w2 = other.mWords;
1362 for (uint32_t n =
WORD_COUNT; n--; ++w1, ++w2) *w1 ^= *w2;
1371 const uint64_t* w = mWords;
1372 for (; n <
WORD_COUNT && !(ON ? *w : ~*w); ++w, ++n);
1380 uint32_t n = start >> 6;
1382 uint32_t m = start & 63u;
1383 uint64_t b = ON ? mWords[n] : ~mWords[n];
1384 if (b & (uint64_t(1u) << m))
return start;
1385 b &= ~uint64_t(0u) << m;
1386 while (!b && ++n <
WORD_COUNT) b = ON ? mWords[n] : ~mWords[n];
1394 uint32_t n = start >> 6;
1396 uint32_t m = start & 63u;
1397 uint64_t b = ON ? mWords[n] : ~mWords[n];
1398 if (b & (uint64_t(1u) << m))
return start;
1399 b &= (uint64_t(1u) << m) - 1u;
1400 while (!b && n) b = ON ? mWords[--n] : ~mWords[--n];
1424 :
mMatF{ 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f}
1425 ,
mInvMatF{1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f}
1426 ,
mVecF{0.0f, 0.0f, 0.0f}
1428 ,
mMatD{ 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0}
1429 ,
mInvMatD{1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0}
1430 ,
mVecD{0.0, 0.0, 0.0}
1435 :
mMatF{float(s), 0.0f, 0.0f, 0.0f, float(s), 0.0f, 0.0f, 0.0f, float(s)}
1436 ,
mInvMatF{1.0f / float(s), 0.0f, 0.0f, 0.0f, 1.0f / float(s), 0.0f, 0.0f, 0.0f, 1.0f / float(s)}
1437 ,
mVecF{float(t[0]), float(t[1]), float(t[2])}
1439 ,
mMatD{s, 0.0, 0.0, 0.0, s, 0.0, 0.0, 0.0, s}
1440 ,
mInvMatD{1.0 / s, 0.0, 0.0, 0.0, 1.0 / s, 0.0, 0.0, 0.0, 1.0 / s}
1441 ,
mVecD{t[0], t[1], t[2]}
1448 template<
typename MatT,
typename Vec3T>
1449 void set(
const MatT& mat,
const MatT& invMat,
const Vec3T& translate,
double taper = 1.0);
1454 template<
typename Mat4T>
1455 void set(
const Mat4T& mat,
const Mat4T& invMat,
double taper = 1.0) { this->
set(mat, invMat, mat[3], taper); }
1457 template<
typename Vec3T>
1458 void set(
double scale,
const Vec3T& translation,
double taper = 1.0);
1465 template<
typename Vec3T>
1473 template<
typename Vec3T>
1482 template<
typename Vec3T>
1491 template<
typename Vec3T>
1499 template<
typename Vec3T>
1510 template<
typename Vec3T>
1522 template<
typename Vec3T>
1531 template<
typename Vec3T>
1540 template<
typename Vec3T>
1542 template<
typename Vec3T>
1549template<
typename MatT,
typename Vec3T>
1550inline void Map::set(
const MatT& mat,
const MatT& invMat,
const Vec3T& translate,
double taper)
1554 mTaperF =
static_cast<float>(taper);
1556 for (
int i = 0; i < 3; ++i) {
1557 *vd++ = translate[i];
1558 *vf++ =
static_cast<float>(translate[i]);
1559 for (
int j = 0; j < 3; ++j) {
1561 *mid++ = invMat[j][i];
1562 *mf++ =
static_cast<float>(mat[j][i]);
1563 *mif++ =
static_cast<float>(invMat[j][i]);
1568template<
typename Vec3T>
1569inline void Map::set(
double dx,
const Vec3T& trans,
double taper)
1572 const double mat[3][3] = { {dx, 0.0, 0.0},
1575 const double idx = 1.0 / dx;
1576 const double invMat[3][3] = { {idx, 0.0, 0.0},
1579 this->
set(mat, invMat, trans, taper);
1668 template<
typename BlindDataT>
1679 auto check = [&]()->
bool{
1697 default:
return true;}
1719template<
typename Gr
idOrTreeOrRootT,
int LEVEL>
1723template<
typename Gr
idOrTreeOrRootT>
1726 static_assert(GridOrTreeOrRootT::RootNodeType::LEVEL == 3,
"Tree depth is not supported");
1727 using Type =
typename GridOrTreeOrRootT::LeafNodeType;
1728 using type =
typename GridOrTreeOrRootT::LeafNodeType;
1730template<
typename Gr
idOrTreeOrRootT>
1733 static_assert(GridOrTreeOrRootT::RootNodeType::LEVEL == 3,
"Tree depth is not supported");
1734 using Type =
const typename GridOrTreeOrRootT::LeafNodeType;
1735 using type =
const typename GridOrTreeOrRootT::LeafNodeType;
1738template<
typename Gr
idOrTreeOrRootT>
1741 static_assert(GridOrTreeOrRootT::RootNodeType::LEVEL == 3,
"Tree depth is not supported");
1742 using Type =
typename GridOrTreeOrRootT::RootNodeType::ChildNodeType::ChildNodeType;
1743 using type =
typename GridOrTreeOrRootT::RootNodeType::ChildNodeType::ChildNodeType;
1745template<
typename Gr
idOrTreeOrRootT>
1748 static_assert(GridOrTreeOrRootT::RootNodeType::LEVEL == 3,
"Tree depth is not supported");
1749 using Type =
const typename GridOrTreeOrRootT::RootNodeType::ChildNodeType::ChildNodeType;
1750 using type =
const typename GridOrTreeOrRootT::RootNodeType::ChildNodeType::ChildNodeType;
1752template<
typename Gr
idOrTreeOrRootT>
1755 static_assert(GridOrTreeOrRootT::RootNodeType::LEVEL == 3,
"Tree depth is not supported");
1756 using Type =
typename GridOrTreeOrRootT::RootNodeType::ChildNodeType;
1757 using type =
typename GridOrTreeOrRootT::RootNodeType::ChildNodeType;
1759template<
typename Gr
idOrTreeOrRootT>
1762 static_assert(GridOrTreeOrRootT::RootNodeType::LEVEL == 3,
"Tree depth is not supported");
1763 using Type =
const typename GridOrTreeOrRootT::RootNodeType::ChildNodeType;
1764 using type =
const typename GridOrTreeOrRootT::RootNodeType::ChildNodeType;
1766template<
typename Gr
idOrTreeOrRootT>
1769 static_assert(GridOrTreeOrRootT::RootNodeType::LEVEL == 3,
"Tree depth is not supported");
1770 using Type =
typename GridOrTreeOrRootT::RootNodeType;
1771 using type =
typename GridOrTreeOrRootT::RootNodeType;
1774template<
typename Gr
idOrTreeOrRootT>
1777 static_assert(GridOrTreeOrRootT::RootNodeType::LEVEL == 3,
"Tree depth is not supported");
1778 using Type =
const typename GridOrTreeOrRootT::RootNodeType;
1779 using type =
const typename GridOrTreeOrRootT::RootNodeType;
1782template<
typename Gr
idOrTreeOrRootT,
int LEVEL>
1787template<
typename BuildT>
1789template<
typename BuildT>
1791template<
typename BuildT>
1793template<
typename BuildT>
1795template<
typename BuildT>
1797template<
typename BuildT>
1799template<
typename BuildT>
1801template<
typename BuildT>
1817 :
packed((d & 0x7FFFFFFFu) | (uint32_t(a) << 31))
1899 [[deprecated(
"Use Checksum::data instead.")]]
1901 [[deprecated(
"Use Checksum::head and Ckecksum::tail instead.")]]
1903 [[deprecated(
"Use Checksum::head and Ckecksum::tail instead.")]]
1914 [[deprecated(
"Use Checksum::isHalf instead.")]]
1998 uint64_t gridSize = 0u,
2003#ifdef NANOVDB_USE_NEW_MAGIC_NUMBERS
2013 mGridSize = gridSize;
2014 mGridName[0] =
'\0';
2017 mVoxelSize = map.getVoxelSize();
2018 mGridClass = gridClass;
2019 mGridType = gridType;
2020 mBlindMetadataOffset = mGridSize;
2021 mBlindMetadataCount = 0u;
2024#ifdef NANOVDB_USE_NEW_MAGIC_NUMBERS
2038 if (test) test =
mVersion.isCompatible();
2056 template<
typename Vec3T>
2058 template<
typename Vec3T>
2060 template<
typename Vec3T>
2062 template<
typename Vec3T>
2064 template<
typename Vec3T>
2067 template<
typename Vec3T>
2069 template<
typename Vec3T>
2071 template<
typename Vec3T>
2073 template<
typename Vec3T>
2075 template<
typename Vec3T>
2086 template <u
int32_t LEVEL>
2089 static_assert(LEVEL >= 0 && LEVEL <= 3,
"invalid LEVEL template parameter");
2090 const void *treeData =
this + 1;
2092 return nodeOffset ?
util::PtrAdd(treeData, nodeOffset) :
nullptr;
2098 template <u
int32_t LEVEL>
2101 static_assert(LEVEL >= 0 && LEVEL <= 3,
"invalid LEVEL template parameter");
2102 void *treeData =
this + 1;
2104 return nodeOffset ?
util::PtrAdd(treeData, nodeOffset) :
nullptr;
2109 template <u
int32_t LEVEL>
2112 static_assert(LEVEL >= 0 && LEVEL < 3,
"invalid LEVEL template parameter");
2133 return metaData->template getBlindData<const char>();
2167template<
typename BuildT,
int LEVEL0 = -1,
int LEVEL1 = -1,
int LEVEL2 = -1>
2170template<
typename BuildT>
2177template<
typename TreeT>
2221 template<
typename T = BuildType>
2228 template<
typename T = BuildType>
2248 template<
typename Vec3T>
2252 template<
typename Vec3T>
2257 template<
typename Vec3T>
2262 template<
typename Vec3T>
2267 template<
typename Vec3T>
2271 template<
typename Vec3T>
2275 template<
typename Vec3T>
2280 template<
typename Vec3T>
2285 template<
typename Vec3T>
2290 template<
typename Vec3T>
2327 template<
typename NodeT>
2363 [[deprecated(
"Use Grid::getBlindData<T>() instead.")]]
2366 printf(
"\nnanovdb::Grid::blindData is unsafe and hence deprecated! Please use nanovdb::Grid::getBlindData instead.\n\n");
2371 template <
typename BlindDataT>
2378 template <
typename BlindDataT>
2391template<
typename TreeT>
2401template<
typename TreeT>
2404 auto test = [&](
int n) {
2407 if (name[i] != str[i])
2409 if (name[i] ==
'\0' && str[i] ==
'\0')
2441 template<
typename NodeT>
2457template<
typename Gr
idT>
2460 using Type =
typename GridT::TreeType;
2461 using type =
typename GridT::TreeType;
2463template<
typename Gr
idT>
2466 using Type =
const typename GridT::TreeType;
2467 using type =
const typename GridT::TreeType;
2470template<
typename Gr
idT>
2476template<
typename RootT>
2479 static_assert(RootT::LEVEL == 3,
"Tree depth is not supported");
2480 static_assert(RootT::ChildNodeType::LOG2DIM == 5,
"Tree configuration is not supported");
2481 static_assert(RootT::ChildNodeType::ChildNodeType::LOG2DIM == 4,
"Tree configuration is not supported");
2482 static_assert(RootT::LeafNodeType::LOG2DIM == 3,
"Tree configuration is not supported");
2497 using Node2 =
typename RootT::ChildNodeType;
2498 using Node1 =
typename Node2::ChildNodeType;
2556 template<
typename NodeT>
2559 static_assert(NodeT::LEVEL < 3,
"Invalid NodeT");
2577 template<
typename NodeT>
2587 template<
typename NodeT>
2620 template<
typename OpT,
typename... ArgsT>
2626 template<
typename OpT,
typename... ArgsT>
2637template<
typename RootT>
2640 min = this->
root().minimum();
2641 max = this->
root().maximum();
2649template<
typename ChildT>
2659#ifdef NANOVDB_USE_SINGLE_ROOT_KEY
2661 template<
typename CoordType>
2664 static_assert(
sizeof(
CoordT) ==
sizeof(CoordType),
"Mismatching sizeof");
2665 static_assert(32 - ChildT::TOTAL <= 21,
"Cannot use 64 bit root keys");
2666 return (
KeyT(uint32_t(ijk[2]) >> ChildT::TOTAL)) |
2667 (
KeyT(uint32_t(ijk[1]) >> ChildT::TOTAL) << 21) |
2668 (
KeyT(uint32_t(ijk[0]) >> ChildT::TOTAL) << 42);
2672 static constexpr uint64_t MASK = (1u << 21) - 1;
2673 return CoordT(((key >> 42) & MASK) << ChildT::TOTAL,
2674 ((key >> 21) & MASK) << ChildT::TOTAL,
2675 ( key & MASK) << ChildT::TOTAL);
2678 using KeyT = CoordT;
2679 __hostdev__ static KeyT CoordToKey(
const CoordT& ijk) {
return ijk & ~ChildT::MASK; }
2680 __hostdev__ static CoordT KeyToCoord(
const KeyT& key) {
return key; }
2699 struct NANOVDB_ALIGN(NANOVDB_DATA_ALIGNMENT)
Tile
2701 template<
typename CoordType>
2708 template<
typename CoordType,
typename ValueType>
2732 return reinterpret_cast<const Tile*
>(
this + 1) + n;
2737 return reinterpret_cast<Tile*
>(
this + 1) + n;
2740 template<
typename DataT>
2779 return reinterpret_cast<DataT*
>(
mBegin) - 1;
2784 return mPos->child != 0;
2789 return mPos->child == 0;
2794 return mPos->child == 0 &&
mPos->state != 0;
2818 for(; iter; ++iter)
if (iter->key == key)
break;
2826 for(; iter; ++iter)
if (iter->key == key)
break;
2832 auto iter = this->
probe(ijk);
2833 return iter ? iter.operator->() :
nullptr;
2843 auto iter = this->
probe(ijk);
2844 return iter && iter.isChild() ? iter.child() :
nullptr;
2886template<
typename ChildT>
2907 static constexpr uint32_t
LEVEL = 1 + ChildT::LEVEL;
2909 template<
typename RootT>
2927 template<
typename RootT>
2939 while (mTileIter && mTileIter.isValue()) ++mTileIter;
2946 while (mTileIter && mTileIter.isValue()) ++mTileIter;
2963 template<
typename RootT>
2973 while (mTileIter && mTileIter.isChild()) ++mTileIter;
2980 while (mTileIter && mTileIter.isChild()) ++mTileIter;
2997 template<
typename RootT>
3007 while (mTileIter && !mTileIter.isValueOn()) ++mTileIter;
3013 while (mTileIter && !mTileIter.isValueOn()) ++mTileIter;
3030 template<
typename RootT>
3042 if (mTileIter.isChild())
return mTileIter.child();
3043 value = mTileIter.value();
3124 template<
typename OpT,
typename... ArgsT>
3129 return OpT::get(*
tile, args...);
3131 return OpT::get(*
this, args...);
3134 template<
typename OpT,
typename... ArgsT>
3139 return OpT::set(*
tile, args...);
3141 return OpT::set(*
this, args...);
3146 static_assert(
sizeof(
typename DataType::Tile) %
NANOVDB_DATA_ALIGNMENT == 0,
"sizeof(RootData::Tile) is misaligned");
3148 template<
typename,
int,
int,
int>
3154 template<
typename RayT,
typename AccT>
3155 __hostdev__ uint32_t getDimAndCache(
const CoordType& ijk,
const RayT& ray,
const AccT& acc)
const
3158 if (
tile->isChild()) {
3160 acc.insert(ijk, child);
3161 return child->getDimAndCache(ijk, ray, acc);
3163 return 1 << ChildT::TOTAL;
3165 return ChildNodeType::dim();
3171 template<
typename Policy = ActiveExact,
typename RayT,
typename AccT>
3172 __hostdev__ DimAndActive getDimAndActiveAndCache(
const CoordType& ijk,
const RayT& ray,
const AccT& acc)
const
3174 if (
const Tile* tile = this->probeTile(ijk)) {
3175 if (tile->isChild()) {
3176 const auto* child = this->getChild(tile);
3177 acc.insert(ijk, child);
3178 return child->template getDimAndActiveAndCache<Policy>(ijk, ray, acc);
3180 return {uint32_t(1) << ChildT::TOTAL, tile->state > 0u};
3182 return {ChildNodeType::dim(),
false};
3185 template<
typename OpT,
typename AccT,
typename... ArgsT>
3186 __hostdev__ typename OpT::Type getAndCache(
const CoordType& ijk,
const AccT& acc, ArgsT&&... args)
const
3188 if (
const Tile* tile = this->probeTile(ijk)) {
3189 if constexpr(OpT::LEVEL < LEVEL) {
3190 if (tile->isChild()) {
3191 const ChildT* child = this->getChild(tile);
3192 acc.insert(ijk, child);
3193 return child->template getAndCache<OpT>(ijk, acc, args...);
3196 return OpT::get(*tile, args...);
3198 return OpT::get(*
this, args...);
3201 template<
typename OpT,
typename AccT,
typename... ArgsT>
3202 __hostdev__ void setAndCache(
const CoordType& ijk,
const AccT& acc, ArgsT&&... args)
3204 if (Tile* tile = DataType::probeTile(ijk)) {
3205 if constexpr(OpT::LEVEL < LEVEL) {
3206 if (tile->isChild()) {
3207 ChildT* child = this->getChild(tile);
3208 acc.insert(ijk, child);
3209 return child->template setAndCache<OpT>(ijk, acc, args...);
3212 return OpT::set(*tile, args...);
3214 return OpT::set(*
this, args...);
3226template<
typename ChildT, u
int32_t LOG2DIM>
3233 using MaskT =
typename ChildT::template MaskType<LOG2DIM>;
3265 alignas(32) Tile
mTable[1u << (3 * LOG2DIM)];
3275 template<
typename ValueT>
3308 template<
typename T>
3320#if defined(__GNUC__) && (__GNUC__ < 14) && !defined(__APPLE__) && !defined(__llvm__)
3321#pragma GCC diagnostic push
3322#pragma GCC diagnostic ignored "-Wstringop-overflow"
3328#if defined(__GNUC__) && (__GNUC__ < 14) && !defined(__APPLE__) && !defined(__llvm__)
3329#pragma GCC diagnostic pop
3340template<
typename ChildT, u
int32_t Log2Dim = ChildT::LOG2DIM + 1>
3352 template<u
int32_t LOG2>
3362 static constexpr uint32_t
LEVEL = 1 + ChildT::LEVEL;
3366 template <
typename ParentT>
3389 return *mParent->getChild(BaseT::pos());
3394 return mParent->getChild(BaseT::pos());
3399 return (*this)->origin();
3431 return mParent->data()->getValue(BaseT::pos());
3436 return mParent->offsetToGlobalCoord(BaseT::pos());
3442 return mParent->data()->isActive(BaseT::mPos);
3470 return mParent->data()->getValue(BaseT::pos());
3475 return mParent->offsetToGlobalCoord(BaseT::pos());
3497 , mParent(parent->
data())
3504 const ChildT* child =
nullptr;
3505 if (mParent->mChildMask.isOn(BaseT::pos())) {
3506 child = mParent->getChild(BaseT::pos());
3508 value = mParent->getValue(BaseT::pos());
3515 return mParent->isActive(BaseT::pos());
3520 return mParent->offsetToGlobalCoord(BaseT::pos());
3608 return (((ijk[0] &
MASK) >> ChildT::TOTAL) << (2 *
LOG2DIM)) |
3609 (((ijk[1] &
MASK) >> ChildT::TOTAL) << (
LOG2DIM)) |
3610 ((ijk[2] &
MASK) >> ChildT::TOTAL);
3617 const uint32_t m = n & ((1 << 2 *
LOG2DIM) - 1);
3624 ijk <<= ChildT::TOTAL;
3638 template<
typename OpT,
typename... ArgsT>
3643 return OpT::get(*
this, n, args...);
3646 template<
typename OpT,
typename... ArgsT>
3651 return OpT::set(*
this, n, args...);
3657 template<
typename,
int,
int,
int>
3662 template<
typename, u
int32_t>
3665 template<
typename RayT,
typename AccT>
3666 __hostdev__ uint32_t getDimAndCache(
const CoordType& ijk,
const RayT& ray,
const AccT& acc)
const
3674 const ChildT* child = this->
getChild(n);
3675 acc.insert(ijk, child);
3676 return child->getDimAndCache(ijk, ray, acc);
3678 return ChildNodeType::dim();
3685 template<
typename Policy = ActiveExact,
typename RayT,
typename AccT>
3686 __hostdev__ DimAndActive getDimAndActiveAndCache(
const CoordType& ijk,
const RayT& ray,
const AccT& acc)
const
3691 if constexpr (util::is_same<Policy, ActiveOnLeafOnly>::value) {
3692 if (DataType::mFlags & uint32_t(1u))
3693 return {this->dim(),
false};
3694 const uint32_t n = CoordToOffset(ijk);
3695 if (DataType::mChildMask.isOn(n)) {
3696 const ChildT* child = this->getChild(n);
3697 acc.insert(ijk, child);
3698 return child->template getDimAndActiveAndCache<Policy>(ijk, ray, acc);
3700 return {ChildNodeType::dim(), DataType::mValueMask.isOn(n)};
3702 const bool skip = (DataType::mFlags & uint32_t(1u));
3703 const uint32_t n = CoordToOffset(ijk);
3704 if (DataType::mChildMask.isOn(n)) {
3705 const ChildT* child = this->getChild(n);
3706 acc.insert(ijk, child);
3707 const auto r = child->template getDimAndActiveAndCache<Policy>(ijk, ray, acc);
3708 return {skip ? this->dim() : r.dim(), r.active()};
3710 return {skip ? this->dim() : ChildNodeType::dim(), DataType::mValueMask.isOn(n)};
3714 template<
typename OpT,
typename AccT,
typename... ArgsT>
3715 __hostdev__ typename OpT::Type getAndCache(
const CoordType& ijk,
const AccT& acc, ArgsT&&... args)
const
3717 const uint32_t n = CoordToOffset(ijk);
3718 if constexpr(OpT::LEVEL < LEVEL) {
3719 if (this->isChild(n)) {
3720 const ChildT* child = this->getChild(n);
3721 acc.insert(ijk, child);
3722 return child->template getAndCache<OpT>(ijk, acc, args...);
3725 return OpT::get(*
this, n, args...);
3728 template<
typename OpT,
typename AccT,
typename... ArgsT>
3729 __hostdev__ void setAndCache(
const CoordType& ijk,
const AccT& acc, ArgsT&&... args)
3731 const uint32_t n = CoordToOffset(ijk);
3732 if constexpr(OpT::LEVEL < LEVEL) {
3733 if (this->isChild(n)) {
3734 ChildT* child = this->getChild(n);
3735 acc.insert(ijk, child);
3736 return child->template setAndCache<OpT>(ijk, acc, args...);
3739 return OpT::set(*
this, n, args...);
3749template<
typename ValueT,
typename CoordT,
template<u
int32_t>
class MaskT, uint32_t LOG2DIM>
3752 static_assert(
sizeof(CoordT) ==
sizeof(
Coord),
"Mismatching sizeof");
3753 static_assert(
sizeof(MaskT<LOG2DIM>) ==
sizeof(
Mask<LOG2DIM>),
"Mismatching sizeof");
3776 return sizeof(
LeafData) - (12 + 3 + 1 +
sizeof(MaskT<LOG2DIM>) + 2 * (
sizeof(ValueT) +
sizeof(
FloatType)) + (1u << (3 * LOG2DIM)) *
sizeof(ValueT));
3799#if defined(__GNUC__) && (__GNUC__ < 12) && !defined(__APPLE__) && !defined(__llvm__)
3800#pragma GCC diagnostic push
3801#pragma GCC diagnostic ignored "-Wstringop-overflow"
3807#if defined(__GNUC__) && (__GNUC__ < 12) && !defined(__APPLE__) && !defined(__llvm__)
3808#pragma GCC diagnostic pop
3811 template<
typename T>
3816 for (
auto *p =
mValues, *q = p + 512; p != q; ++p)
3830template<
typename CoordT,
template<u
int32_t>
class MaskT, uint32_t LOG2DIM>
3833 static_assert(
sizeof(CoordT) ==
sizeof(
Coord),
"Mismatching sizeof");
3834 static_assert(
sizeof(MaskT<LOG2DIM>) ==
sizeof(
Mask<LOG2DIM>),
"Mismatching sizeof");
3856 return sizeof(
LeafFnBase) - (12 + 3 + 1 +
sizeof(MaskT<LOG2DIM>) + 2 * 4 + 4 * 2);
3861 mQuantum = (max - min) /
float((1 << bitWidth) - 1);
3891 template<
typename T>
3900template<
typename CoordT,
template<u
int32_t>
class MaskT, uint32_t LOG2DIM>
3901struct NANOVDB_ALIGN(NANOVDB_DATA_ALIGNMENT)
LeafData<
Fp4, CoordT, MaskT, LOG2DIM>
3908 alignas(32) uint8_t
mCode[1u << (3 * LOG2DIM - 1)];
3913 static_assert(
BaseT::padding() == 0,
"expected no padding in LeafFnBase");
3914 return sizeof(
LeafData) -
sizeof(
BaseT) - (1u << (3 * LOG2DIM - 1));
3921 const uint8_t c =
mCode[i>>1];
3937template<
typename CoordT,
template<u
int32_t>
class MaskT, uint32_t LOG2DIM>
3938struct NANOVDB_ALIGN(NANOVDB_DATA_ALIGNMENT)
LeafData<
Fp8, CoordT, MaskT, LOG2DIM>
3945 alignas(32) uint8_t
mCode[1u << 3 * LOG2DIM];
3949 static_assert(
BaseT::padding() == 0,
"expected no padding in LeafFnBase");
3950 return sizeof(
LeafData) -
sizeof(
BaseT) - (1u << 3 * LOG2DIM);
3967template<
typename CoordT,
template<u
int32_t>
class MaskT, uint32_t LOG2DIM>
3968struct NANOVDB_ALIGN(NANOVDB_DATA_ALIGNMENT)
LeafData<
Fp16, CoordT, MaskT, LOG2DIM>
3975 alignas(32) uint16_t
mCode[1u << 3 * LOG2DIM];
3980 static_assert(
BaseT::padding() == 0,
"expected no padding in LeafFnBase");
3981 return sizeof(
LeafData) -
sizeof(
BaseT) - 2 * (1u << 3 * LOG2DIM);
3999template<
typename CoordT,
template<u
int32_t>
class MaskT, uint32_t LOG2DIM>
4000struct NANOVDB_ALIGN(NANOVDB_DATA_ALIGNMENT)
LeafData<
FpN, CoordT, MaskT, LOG2DIM>
4009 static_assert(
BaseT::padding() == 0,
"expected no padding in LeafFnBase");
4018#ifdef NANOVDB_FPN_BRANCHLESS
4021 uint16_t code =
reinterpret_cast<const uint16_t*
>(
this + 1)[i >> (4 - b)];
4022 const static uint8_t shift[5] = {15, 7, 3, 1, 0};
4023 const static uint16_t mask[5] = {1, 3, 15, 255, 65535};
4024 code >>= (i & shift[b]) << b;
4027 uint32_t code =
reinterpret_cast<const uint32_t*
>(
this + 1)[i >> (5 - b)];
4028 code >>= (i & ((32 >> b) - 1)) << b;
4029 code &= (1 << (1 << b)) - 1;
4033 auto* values =
reinterpret_cast<const uint8_t*
>(
this + 1);
4036 code = float((values[i >> 3] >> (i & 7)) & uint8_t(1));
4039 code = float((values[i >> 2] >> ((i & 3) << 1)) & uint8_t(3));
4042 code = float((values[i >> 1] >> ((i & 1) << 2)) & uint8_t(15));
4045 code = float(values[i]);
4048 code = float(
reinterpret_cast<const uint16_t*
>(values)[i]);
4064template<
typename CoordT,
template<u
int32_t>
class MaskT, uint32_t LOG2DIM>
4065struct NANOVDB_ALIGN(NANOVDB_DATA_ALIGNMENT)
LeafData<bool, CoordT, MaskT, LOG2DIM>
4067 static_assert(
sizeof(CoordT) ==
sizeof(
Coord),
"Mismatching sizeof");
4068 static_assert(
sizeof(MaskT<LOG2DIM>) ==
sizeof(
Mask<LOG2DIM>),
"Mismatching sizeof");
4101 template<
typename T>
4114template<
typename CoordT,
template<u
int32_t>
class MaskT, uint32_t LOG2DIM>
4117 static_assert(
sizeof(CoordT) ==
sizeof(
Coord),
"Mismatching sizeof");
4118 static_assert(
sizeof(MaskT<LOG2DIM>) ==
sizeof(
Mask<LOG2DIM>),
"Mismatching sizeof");
4135 return sizeof(
LeafData) - (12u + 3u + 1u +
sizeof(MaskT<LOG2DIM>) + 2 * 8u);
4150 template<
typename T>
4163template<
typename CoordT,
template<u
int32_t>
class MaskT, uint32_t LOG2DIM>
4166 static_assert(
sizeof(CoordT) ==
sizeof(
Coord),
"Mismatching sizeof");
4167 static_assert(
sizeof(MaskT<LOG2DIM>) ==
sizeof(
Mask<LOG2DIM>),
"Mismatching sizeof");
4180 return sizeof(
LeafIndexBase) - (12u + 3u + 1u +
sizeof(MaskT<LOG2DIM>) + 2 * 8u);
4191 template<
typename T>
4205template<
typename CoordT,
template<u
int32_t>
class MaskT, uint32_t LOG2DIM>
4225template<
typename CoordT,
template<u
int32_t>
class MaskT, uint32_t LOG2DIM>
4243 uint32_t n = i >> 6;
4244 const uint64_t w =
BaseT::mValueMask.words()[n], mask = uint64_t(1) << (i & 63u);
4245 if (!(w & mask))
return uint64_t(0);
4254template<
typename CoordT,
template<u
int32_t>
class MaskT, uint32_t LOG2DIM>
4255struct NANOVDB_ALIGN(NANOVDB_DATA_ALIGNMENT)
LeafData<
Point, CoordT, MaskT, LOG2DIM>
4257 static_assert(
sizeof(CoordT) ==
sizeof(
Coord),
"Mismatching sizeof");
4258 static_assert(
sizeof(MaskT<LOG2DIM>) ==
sizeof(
Mask<LOG2DIM>),
"Mismatching sizeof");
4280 return sizeof(
LeafData) - (12u + 3u + 1u +
sizeof(MaskT<LOG2DIM>) + 2 * 8u + (1u << 3 * LOG2DIM) * 2u);
4307 template<
typename T>
4320template<
typename BuildT,
4321 typename CoordT =
Coord,
4322 template<u
int32_t>
class MaskT =
Mask,
4323 uint32_t Log2Dim = 3>
4330 static constexpr uint32_t
DIM = 1;
4340 template<u
int32_t LOG2>
4366 return mParent->getValue(BaseT::pos());
4371 return mParent->offsetToGlobalCoord(BaseT::pos());
4399 return mParent->getValue(BaseT::pos());
4404 return mParent->offsetToGlobalCoord(BaseT::pos());
4420 , mPos(1u << 3 * Log2Dim)
4433 return mParent->getValue(mPos);
4438 return mParent->offsetToGlobalCoord(mPos);
4443 return mParent->isActive(mPos);
4445 __hostdev__ operator bool()
const {
return mPos < (1u << 3 * Log2Dim); }
4505 const uint32_t m = n & ((1 << 2 *
LOG2DIM) - 1);
4609 template<
typename OpT,
typename... ArgsT>
4615 template<
typename OpT,
typename... ArgsT>
4618 return OpT::get(*
this, n, args...);
4621 template<
typename OpT,
typename... ArgsT>
4627 template<
typename OpT,
typename... ArgsT>
4630 return OpT::set(*
this, n, args...);
4636 template<
typename,
int,
int,
int>
4641 template<
typename, u
int32_t>
4644 template<
typename RayT,
typename AccT>
4645 __hostdev__ uint32_t getDimAndCache(
const CoordT&,
const RayT& ,
const AccT&)
const
4660 template<
typename Policy = ActiveExact,
typename RayT,
typename AccT>
4664 const uint32_t n = CoordToOffset(ijk);
4665 const uint32_t dimOut = (DataType::mFlags & uint8_t(1u)) ? this->dim() : ChildNodeType::dim();
4666 return {dimOut, DataType::mValueMask.isOn(n)};
4669 template<
typename OpT,
typename AccT,
typename... ArgsT>
4672 getAndCache(
const CoordType& ijk,
const AccT&, ArgsT&&... args)
const
4674 return OpT::get(*
this, CoordToOffset(ijk), args...);
4677 template<
typename OpT,
typename AccT,
typename... ArgsT>
4679 __hostdev__ decltype(OpT::set(util::declval<LeafNode&>(), util::declval<uint32_t>(), util::declval<ArgsT>()...))
4680 setAndCache(
const CoordType& ijk,
const AccT&, ArgsT&&... args)
4682 return OpT::set(*
this, CoordToOffset(ijk), args...);
4689template<
typename ValueT,
typename CoordT,
template<u
int32_t>
class MaskT, uint32_t LOG2DIM>
4692 static_assert(
LOG2DIM == 3,
"LeafNode::updateBBox: only supports LOGDIM = 3!");
4697 auto update = [&](uint32_t min, uint32_t max,
int axis) {
4703 uint32_t Xmin = word64 ? 0u : 8u, Xmax = Xmin;
4704 for (
int i = 1; i < 8; ++i) {
4713 update(Xmin, Xmax, 0);
4715 const uint32_t *p =
reinterpret_cast<const uint32_t*
>(&word64), word32 = p[0] | p[1];
4716 const uint16_t *q =
reinterpret_cast<const uint16_t*
>(&word32), word16 = q[0] | q[1];
4717 const uint8_t *b =
reinterpret_cast<const uint8_t*
>(&word16),
byte = b[0] | b[1];
4728template<
typename BuildT>
4730template<
typename BuildT>
4732template<
typename BuildT>
4734template<
typename BuildT>
4736template<
typename BuildT>
4738template<
typename BuildT>
4742template<
typename BuildT,
int LEVEL>
4746template<
typename BuildT>
4752template<
typename BuildT>
4758template<
typename BuildT>
4764template<
typename BuildT>
4771template<
typename BuildT,
int LEVEL>
4844template<
typename OpT,
typename GridDataT,
typename... ArgsT>
4848 switch (gridData->mGridType){
4850 return OpT::template known<float>(gridData, args...);
4852 return OpT::template known<double>(gridData, args...);
4854 return OpT::template known<int16_t>(gridData, args...);
4856 return OpT::template known<int32_t>(gridData, args...);
4858 return OpT::template known<int64_t>(gridData, args...);
4860 return OpT::template known<Vec3f>(gridData, args...);
4862 return OpT::template known<Vec3d>(gridData, args...);
4864 return OpT::template known<uint32_t>(gridData, args...);
4866 return OpT::template known<ValueMask>(gridData, args...);
4868 return OpT::template known<ValueIndex>(gridData, args...);
4870 return OpT::template known<ValueOnIndex>(gridData, args...);
4872 return OpT::template known<bool>(gridData, args...);
4874 return OpT::template known<math::Rgba8>(gridData, args...);
4876 return OpT::template known<Fp4>(gridData, args...);
4878 return OpT::template known<Fp8>(gridData, args...);
4880 return OpT::template known<Fp16>(gridData, args...);
4882 return OpT::template known<FpN>(gridData, args...);
4884 return OpT::template known<Vec4f>(gridData, args...);
4886 return OpT::template known<Vec4d>(gridData, args...);
4888 return OpT::template known<uint8_t>(gridData, args...);
4890 return OpT::template known<Half>(gridData, args...);
4892 return OpT::unknown(gridData, args...);
4917template<
typename BuildT>
4927 mutable const RootT* mRoot;
4974 template<
typename RayT>
4977 return mRoot->getDimAndCache(ijk, ray, *
this);
4983 template<
typename Policy = ActiveExact,
typename RayT>
4986 return mRoot->template getDimAndActiveAndCache<Policy>(ijk, ray, *
this);
4988 template<
typename OpT,
typename... ArgsT>
4991 return mRoot->template
get<OpT>(ijk, args...);
4994 template<
typename OpT,
typename... ArgsT>
4997 return const_cast<RootT*
>(mRoot)->
template set<OpT>(ijk, args...);
5004 template<
typename, u
int32_t>
5006 template<
typename,
typename,
template<u
int32_t>
class, uint32_t>
5010 template<
typename NodeT>
5015template<
typename BuildT,
int LEVEL0>
5018 static_assert(LEVEL0 >= 0 && LEVEL0 <= 2,
"LEVEL0 should be 0, 1, or 2");
5032 mutable CoordT mKey;
5033 mutable const RootT* mRoot;
5034 mutable const NodeT* mNode;
5066 mKey = CoordType::max();
5079 return (ijk[0] & int32_t(~NodeT::MASK)) == mKey[0] &&
5080 (ijk[1] & int32_t(~NodeT::MASK)) == mKey[1] &&
5081 (ijk[2] & int32_t(~NodeT::MASK)) == mKey[2];
5096 template<
typename RayT>
5099 if (this->
isCached(ijk))
return mNode->getDimAndCache(ijk, ray, *
this);
5100 return mRoot->getDimAndCache(ijk, ray, *
this);
5107 template<
typename Policy = ActiveExact,
typename RayT>
5110 if (this->
isCached(ijk))
return mNode->template getDimAndActiveAndCache<Policy>(ijk, ray, *
this);
5111 return mRoot->template getDimAndActiveAndCache<Policy>(ijk, ray, *
this);
5114 template<
typename OpT,
typename... ArgsT>
5117 if constexpr(OpT::LEVEL <= LEVEL0)
if (this->
isCached(ijk))
return mNode->template getAndCache<OpT>(ijk, *
this, args...);
5118 return mRoot->template getAndCache<OpT>(ijk, *
this, args...);
5121 template<
typename OpT,
typename... ArgsT>
5124 if constexpr(OpT::LEVEL <= LEVEL0)
if (this->
isCached(ijk))
return const_cast<NodeT*
>(mNode)->
template setAndCache<OpT>(ijk, *
this, args...);
5125 return const_cast<RootT*
>(mRoot)->
template setAndCache<OpT>(ijk, *
this, args...);
5132 template<
typename, u
int32_t>
5134 template<
typename,
typename,
template<u
int32_t>
class, uint32_t>
5140 mKey = ijk & ~NodeT::MASK;
5145 template<
typename OtherNodeT>
5146 __hostdev__ void insert(
const CoordType&,
const OtherNodeT*)
const {}
5150template<
typename BuildT,
int LEVEL0,
int LEVEL1>
5153 static_assert(LEVEL0 >= 0 && LEVEL0 <= 2,
"LEVEL0 must be 0, 1, 2");
5154 static_assert(LEVEL1 >= 0 && LEVEL1 <= 2,
"LEVEL1 must be 0, 1, 2");
5155 static_assert(LEVEL0 < LEVEL1,
"Level 0 must be lower than level 1");
5168#ifdef NANOVDB_USE_SINGLE_ACCESSOR_KEY
5169 mutable CoordT mKey;
5171 mutable CoordT mKeys[2];
5173 mutable const RootT* mRoot;
5174 mutable const Node1T* mNode1;
5175 mutable const Node2T* mNode2;
5186#ifdef NANOVDB_USE_SINGLE_ACCESSOR_KEY
5187 : mKey(CoordType::max())
5189 : mKeys{CoordType::max(), CoordType::max()}
5212#ifdef NANOVDB_USE_SINGLE_ACCESSOR_KEY
5213 mKey = CoordType::max();
5215 mKeys[0] = mKeys[1] = CoordType::max();
5228#ifdef NANOVDB_USE_SINGLE_ACCESSOR_KEY
5233 if (dirty & int32_t(~Node1T::MASK)) {
5239 __hostdev__ bool isCached2(CoordValueType dirty)
const
5243 if (dirty & int32_t(~Node2T::MASK)) {
5249 __hostdev__ CoordValueType computeDirty(
const CoordType& ijk)
const
5251 return (ijk[0] ^ mKey[0]) | (ijk[1] ^ mKey[1]) | (ijk[2] ^ mKey[2]);
5256 return (ijk[0] & int32_t(~Node1T::MASK)) == mKeys[0][0] &&
5257 (ijk[1] & int32_t(~Node1T::MASK)) == mKeys[0][1] &&
5258 (ijk[2] & int32_t(~Node1T::MASK)) == mKeys[0][2];
5262 return (ijk[0] & int32_t(~Node2T::MASK)) == mKeys[1][0] &&
5263 (ijk[1] & int32_t(~Node2T::MASK)) == mKeys[1][1] &&
5264 (ijk[2] & int32_t(~Node2T::MASK)) == mKeys[1][2];
5280 template<
typename RayT>
5283#ifdef NANOVDB_USE_SINGLE_ACCESSOR_KEY
5284 const CoordValueType dirty = this->computeDirty(ijk);
5289 return mNode1->getDimAndCache(ijk, ray, *
this);
5291 return mNode2->getDimAndCache(ijk, ray, *
this);
5293 return mRoot->getDimAndCache(ijk, ray, *
this);
5300 template<
typename Policy = ActiveExact,
typename RayT>
5303#ifdef NANOVDB_USE_SINGLE_ACCESSOR_KEY
5304 const CoordValueType dirty = this->computeDirty(ijk);
5309 return mNode1->template getDimAndActiveAndCache<Policy>(ijk, ray, *
this);
5311 return mNode2->template getDimAndActiveAndCache<Policy>(ijk, ray, *
this);
5313 return mRoot->template getDimAndActiveAndCache<Policy>(ijk, ray, *
this);
5316 template<
typename OpT,
typename... ArgsT>
5319#ifdef NANOVDB_USE_SINGLE_ACCESSOR_KEY
5320 const CoordValueType dirty = this->computeDirty(ijk);
5324 if constexpr(OpT::LEVEL <= LEVEL0) {
5325 if (this->
isCached1(dirty))
return mNode1->template getAndCache<OpT>(ijk, *
this, args...);
5327#ifdef NANOVDB_USE_OLD_ACCESSOR
5330 if constexpr(OpT::LEVEL <= LEVEL1) {
5331 if (this->
isCached2(dirty))
return mNode2->template getAndCache<OpT>(ijk, *
this, args...);
5333 return mRoot->template getAndCache<OpT>(ijk, *
this, args...);
5336 template<
typename OpT,
typename... ArgsT>
5339#ifdef NANOVDB_USE_SINGLE_ACCESSOR_KEY
5340 const CoordValueType dirty = this->computeDirty(ijk);
5344 if constexpr(OpT::LEVEL <= LEVEL0) {
5345 if (this->
isCached1(dirty))
return const_cast<Node1T*
>(mNode1)->
template setAndCache<OpT>(ijk, *
this, args...);
5347#ifdef NANOVDB_USE_OLD_ACCESSOR
5350 if constexpr(OpT::LEVEL <= LEVEL1) {
5351 if (this->
isCached2(dirty))
return const_cast<Node2T*
>(mNode2)->
template setAndCache<OpT>(ijk, *
this, args...);
5353 return const_cast<RootT*
>(mRoot)->
template setAndCache<OpT>(ijk, *
this, args...);
5360 template<
typename, u
int32_t>
5362 template<
typename,
typename,
template<u
int32_t>
class, uint32_t>
5368#ifdef NANOVDB_USE_SINGLE_ACCESSOR_KEY
5371 mKeys[0] = ijk & ~Node1T::MASK;
5375 __hostdev__ void insert(
const CoordType& ijk,
const Node2T* node)
const
5377#ifdef NANOVDB_USE_SINGLE_ACCESSOR_KEY
5380 mKeys[1] = ijk & ~Node2T::MASK;
5384 template<
typename OtherNodeT>
5385 __hostdev__ void insert(
const CoordType&,
const OtherNodeT*)
const {}
5389template<
typename BuildT>
5390class ReadAccessor<BuildT, 0, 1, 2>
5392 using GridT = NanoGrid<BuildT>;
5393 using TreeT = NanoTree<BuildT>;
5394 using RootT = NanoRoot<BuildT>;
5395 using NodeT2 = NanoUpper<BuildT>;
5396 using NodeT1 = NanoLower<BuildT>;
5397 using LeafT = NanoLeaf<BuildT>;
5398 using CoordT =
typename RootT::CoordType;
5399 using ValueT =
typename RootT::ValueType;
5401 using FloatType =
typename RootT::FloatType;
5402 using CoordValueType =
typename RootT::CoordT::ValueType;
5405#ifdef NANOVDB_USE_SINGLE_ACCESSOR_KEY
5406 mutable CoordT mKey;
5408 mutable CoordT mKeys[3];
5410 mutable const RootT* mRoot;
5411 mutable const void* mNode[3];
5414 using BuildType = BuildT;
5415 using ValueType = ValueT;
5416 using CoordType = CoordT;
5418 static const int CacheLevels = 3;
5422#ifdef NANOVDB_USE_SINGLE_ACCESSOR_KEY
5423 : mKey(CoordType::max())
5425 : mKeys{CoordType::max(), CoordType::max(), CoordType::max()}
5428 , mNode{
nullptr,
nullptr,
nullptr}
5434 : ReadAccessor(grid.tree().root())
5440 : ReadAccessor(tree.root())
5444 __hostdev__ const RootT& root()
const {
return *mRoot; }
5447 ReadAccessor(
const ReadAccessor&) =
default;
5448 ~ReadAccessor() =
default;
5449 ReadAccessor& operator=(
const ReadAccessor&) =
default;
5454 template<
typename NodeT>
5457 using T =
typename NodeTrait<TreeT, NodeT::LEVEL>::type;
5458 static_assert(util::is_same<T, NodeT>::value,
"ReadAccessor::getNode: Invalid node type");
5459 return reinterpret_cast<const T*
>(mNode[NodeT::LEVEL]);
5463 __hostdev__ const typename NodeTrait<TreeT, LEVEL>::type* getNode()
const
5465 using T =
typename NodeTrait<TreeT, LEVEL>::type;
5466 static_assert(LEVEL >= 0 && LEVEL <= 2,
"ReadAccessor::getNode: Invalid node type");
5467 return reinterpret_cast<const T*
>(mNode[LEVEL]);
5473#ifdef NANOVDB_USE_SINGLE_ACCESSOR_KEY
5474 mKey = CoordType::max();
5476 mKeys[0] = mKeys[1] = mKeys[2] = CoordType::max();
5478 mNode[0] = mNode[1] = mNode[2] =
nullptr;
5481#ifdef NANOVDB_USE_SINGLE_ACCESSOR_KEY
5482 template<
typename NodeT>
5483 __hostdev__ bool isCached(CoordValueType dirty)
const
5485 if (!mNode[NodeT::LEVEL])
5487 if (dirty & int32_t(~NodeT::MASK)) {
5488 mNode[NodeT::LEVEL] =
nullptr;
5494 __hostdev__ CoordValueType computeDirty(
const CoordType& ijk)
const
5496 return (ijk[0] ^ mKey[0]) | (ijk[1] ^ mKey[1]) | (ijk[2] ^ mKey[2]);
5499 template<
typename NodeT>
5500 __hostdev__ bool isCached(
const CoordType& ijk)
const
5502 return (ijk[0] & int32_t(~NodeT::MASK)) == mKeys[NodeT::LEVEL][0] &&
5503 (ijk[1] & int32_t(~NodeT::MASK)) == mKeys[NodeT::LEVEL][1] &&
5504 (ijk[2] & int32_t(~NodeT::MASK)) == mKeys[NodeT::LEVEL][2];
5508 __hostdev__ ValueType getValue(
const CoordType& ijk)
const {
return this->
template get<GetValue<BuildT>>(ijk);}
5509 __hostdev__ ValueType getValue(
int i,
int j,
int k)
const {
return this->
template get<GetValue<BuildT>>(CoordType(i, j, k)); }
5510 __hostdev__ ValueType operator()(
const CoordType& ijk)
const {
return this->
template get<GetValue<BuildT>>(ijk); }
5511 __hostdev__ ValueType operator()(
int i,
int j,
int k)
const {
return this->
template get<GetValue<BuildT>>(CoordType(i, j, k)); }
5512 __hostdev__ auto getNodeInfo(
const CoordType& ijk)
const {
return this->
template get<GetNodeInfo<BuildT>>(ijk); }
5513 __hostdev__ bool isActive(
const CoordType& ijk)
const {
return this->
template get<GetState<BuildT>>(ijk); }
5514 __hostdev__ bool probeValue(
const CoordType& ijk, ValueType& v)
const {
return this->
template get<ProbeValue<BuildT>>(ijk, v); }
5515 __hostdev__ const LeafT* probeLeaf(
const CoordType& ijk)
const {
return this->
template get<GetLeaf<BuildT>>(ijk); }
5517 template<
typename OpT,
typename... ArgsT>
5518 __hostdev__ typename OpT::Type get(
const CoordType& ijk, ArgsT&&... args)
const
5520#ifdef NANOVDB_USE_SINGLE_ACCESSOR_KEY
5521 const CoordValueType dirty = this->computeDirty(ijk);
5525 if constexpr(OpT::LEVEL <=0) {
5526 if (this->isCached<LeafT>(dirty))
return ((
const LeafT*)mNode[0])->template getAndCache<OpT>(ijk, *
this, args...);
5528#ifdef NANOVDB_USE_OLD_ACCESSOR
5531 if constexpr(OpT::LEVEL <= 1) {
5532 if (this->isCached<NodeT1>(dirty))
return ((
const NodeT1*)mNode[1])->template getAndCache<OpT>(ijk, *
this, args...);
5534#ifdef NANOVDB_USE_OLD_ACCESSOR
5537 if constexpr(OpT::LEVEL <= 2) {
5538 if (this->isCached<NodeT2>(dirty))
return ((
const NodeT2*)mNode[2])->template getAndCache<OpT>(ijk, *
this, args...);
5540 return mRoot->template getAndCache<OpT>(ijk, *
this, args...);
5543 template<
typename OpT,
typename... ArgsT>
5544 __hostdev__ void set(
const CoordType& ijk, ArgsT&&... args)
const
5546#ifdef NANOVDB_USE_SINGLE_ACCESSOR_KEY
5547 const CoordValueType dirty = this->computeDirty(ijk);
5551 if constexpr(OpT::LEVEL <= 0) {
5552 if (this->isCached<LeafT>(dirty))
return ((LeafT*)mNode[0])->template setAndCache<OpT>(ijk, *
this, args...);
5554#ifdef NANOVDB_USE_OLD_ACCESSOR
5557 if constexpr(OpT::LEVEL <= 1) {
5558 if (this->isCached<NodeT1>(dirty))
return ((NodeT1*)mNode[1])->template setAndCache<OpT>(ijk, *
this, args...);
5560#ifdef NANOVDB_USE_OLD_ACCESSOR
5563 if constexpr(OpT::LEVEL <= 2) {
5564 if (this->isCached<NodeT2>(dirty))
return ((NodeT2*)mNode[2])->template setAndCache<OpT>(ijk, *
this, args...);
5566 return ((RootT*)mRoot)->template setAndCache<OpT>(ijk, *
this, args...);
5569 template<
typename RayT>
5570 __hostdev__ uint32_t getDim(
const CoordType& ijk,
const RayT& ray)
const
5572#ifdef NANOVDB_USE_SINGLE_ACCESSOR_KEY
5573 const CoordValueType dirty = this->computeDirty(ijk);
5577 if (this->isCached<LeafT>(dirty)) {
5578 return ((LeafT*)mNode[0])->getDimAndCache(ijk, ray, *
this);
5579 }
else if (this->isCached<NodeT1>(dirty)) {
5580 return ((NodeT1*)mNode[1])->getDimAndCache(ijk, ray, *
this);
5581 }
else if (this->isCached<NodeT2>(dirty)) {
5582 return ((NodeT2*)mNode[2])->getDimAndCache(ijk, ray, *
this);
5584 return mRoot->getDimAndCache(ijk, ray, *
this);
5591 template<
typename Policy = ActiveExact,
typename RayT>
5592 __hostdev__ DimAndActive getDimAndActive(
const CoordType& ijk,
const RayT& ray)
const
5594#ifdef NANOVDB_USE_SINGLE_ACCESSOR_KEY
5595 const CoordValueType dirty = this->computeDirty(ijk);
5599 if (this->isCached<LeafT>(dirty)) {
5600 return ((LeafT*)mNode[0])->template getDimAndActiveAndCache<Policy>(ijk, ray, *
this);
5601 }
else if (this->isCached<NodeT1>(dirty)) {
5602 return ((NodeT1*)mNode[1])->template getDimAndActiveAndCache<Policy>(ijk, ray, *
this);
5603 }
else if (this->isCached<NodeT2>(dirty)) {
5604 return ((NodeT2*)mNode[2])->template getDimAndActiveAndCache<Policy>(ijk, ray, *
this);
5606 return mRoot->template getDimAndActiveAndCache<Policy>(ijk, ray, *
this);
5612 friend class RootNode;
5613 template<
typename, u
int32_t>
5614 friend class InternalNode;
5615 template<
typename,
typename,
template<u
int32_t>
class, uint32_t>
5616 friend class LeafNode;
5619 template<
typename NodeT>
5620 __hostdev__ void insert(
const CoordType& ijk,
const NodeT* node)
const
5622#ifdef NANOVDB_USE_SINGLE_ACCESSOR_KEY
5625 mKeys[NodeT::LEVEL] = ijk & ~NodeT::MASK;
5627 mNode[NodeT::LEVEL] = node;
5645template<
int LEVEL0 = -1,
int LEVEL1 = -1,
int LEVEL2 = -1,
typename ValueT =
float>
5651template<
int LEVEL0 = -1,
int LEVEL1 = -1,
int LEVEL2 = -1,
typename ValueT =
float>
5657template<
int LEVEL0 = -1,
int LEVEL1 = -1,
int LEVEL2 = -1,
typename ValueT =
float>
5674 uint32_t mRootTableSize, mPadding{0};
5677 template<
typename T>
5680 mGridData = *grid.
data();
5681 mTreeData = *grid.
tree().data();
5683 mRootTableSize = grid.
tree().root().getTableSize();
5688 *
this = *
reinterpret_cast<const GridMetaData*
>(gridData);
5691 mGridData = *gridData;
5711 template<
typename T>
5752template<
typename AttT,
typename BuildT = u
int32_t>
5761 : AccT(
grid.tree().root())
5763 , mData(
grid.template getBlindData<AttT>(0))
5779 const uint64_t count = mGrid.blindMetaData(0u).mValueCount;
5781 end = begin + count;
5789 auto* leaf = this->probeLeaf(ijk);
5790 if (leaf ==
nullptr) {
5793 begin = mData + leaf->minimum();
5794 end = begin + leaf->maximum();
5795 return leaf->maximum();
5801 begin = end =
nullptr;
5802 if (
auto* leaf = this->probeLeaf(ijk)) {
5804 if (leaf->isActive(offset)) {
5805 begin = mData + leaf->minimum();
5806 end = begin + leaf->getValue(offset);
5808 begin += leaf->getValue(offset - 1);
5815template<
typename AttT>
5824 : AccT(
grid.tree().root())
5826 , mData(
grid.template getBlindData<AttT>(0))
5846 const uint64_t count = mGrid.blindMetaData(0u).mValueCount;
5848 end = begin + count;
5856 auto* leaf = this->probeLeaf(ijk);
5857 if (leaf ==
nullptr)
5859 begin = mData + leaf->offset();
5860 end = begin + leaf->pointCount();
5861 return leaf->pointCount();
5867 if (
auto* leaf = this->probeLeaf(ijk)) {
5869 if (leaf->isActive(n)) {
5870 begin = mData + leaf->first(n);
5871 end = mData + leaf->last(n);
5875 begin = end =
nullptr;
5883template<
typename ChannelT,
typename IndexT = ValueIndex>
5913 , mChannel(channelPtr)
5944 return mChannel =
const_cast<ChannelT*
>(mGrid.template getBlindData<ChannelT>(channelID));
5960 const bool isActive = BaseT::probeValue(ijk,
idx);
5967 template<
typename T>
5975template <
typename BuildT,
typename ValueT>
5980template <
typename Gr
idT,
typename ValueT>
5983 using BuildT =
typename GridT::BuildType;
5996struct MiniGridHandle {
6001 BufferType(BufferType &&other) : data(other.data), size(other.size) {other.data=
nullptr; other.size=0;}
6002 ~BufferType() {std::free(data);}
6003 BufferType& operator=(
const BufferType &other) =
delete;
6004 BufferType& operator=(BufferType &&other){data=other.data; size=other.size; other.data=
nullptr; other.size=0;
return *
this;}
6005 static BufferType create(
size_t n, BufferType* dummy =
nullptr) {
return BufferType(n);}
6007 MiniGridHandle(BufferType &&buf) : buffer(std::move(buf)) {}
6008 const uint8_t* data()
const {
return buffer.data;}
6090#if !defined(__CUDA_ARCH__) && !defined(__HIP__)
6113template<
typename StreamT>
6119#ifdef NANOVDB_USE_NEW_MAGIC_NUMBERS
6124 const char* gridName = gridData->
gridName();
6134 os.write((
const char*)&head,
sizeof(
FileHeader));
6136 os.write(gridName, nameSize);
6143 os.write((
const char*)&data,
sizeof(
GridData));
6146 os.write((
const char*)gridData, gridData->
mGridSize);
6158template<
typename StreamT,
typename ValueT>
6168 fprintf(stderr,
"nanovdb::writeUncompressedGrid: expected an IndexGrid but got \"%s\"\n",
toStr(str, gridData->
mGridClass));
6171 fprintf(stderr,
"nanovdb::writeUncompressedGrid: index grid already has \"%i\" blind data\n", gridData->
mBlindMetadataCount);
6176#ifdef NANOVDB_USE_NEW_MAGIC_NUMBERS
6181 const char* gridName = gridData->
gridName();
6190 os.write((
const char*)&head,
sizeof(
FileHeader));
6192 os.write(gridName, nameSize);
6201 os.write((
const char*)&data,
sizeof(
GridData));
6207 os.write((
const char*)blindData, gridData->
mData1*
sizeof(ValueT));
6212template<
typename GridHandleT,
template<
typename...>
class VecT>
6215#ifdef NANOVDB_USE_IOSTREAMS
6216 std::ofstream os(fileName, std::ios::out | std::ios::binary | std::ios::trunc);
6220 StreamT(
const char* name) { fptr = fopen(name,
"wb"); }
6221 ~StreamT() { fclose(fptr); }
6222 void write(
const char* data,
size_t n) { fwrite(data, 1, n, fptr); }
6223 bool is_open()
const {
return fptr != NULL; }
6226 if (!os.is_open()) {
6227 fprintf(stderr,
"nanovdb::writeUncompressedGrids: Unable to open file \"%s\"for output\n", fileName);
6230 for (
auto& h : handles) {
6240template<
typename GridHandleT,
typename StreamT,
template<
typename...>
class VecT>
6241VecT<GridHandleT>
readUncompressedGrids(StreamT& is,
const typename GridHandleT::BufferType& pool =
typename GridHandleT::BufferType())
6243 VecT<GridHandleT> handles;
6245 is.read((
char*)&data,
sizeof(
GridData));
6247 uint64_t size = data.
mGridSize, sum = 0u;
6250 is.read((
char*)&data,
sizeof(
GridData));
6251 sum += data.mGridSize;
6253 is.skip(-int64_t(sum +
sizeof(
GridData)));
6254 auto buffer = GridHandleT::BufferType::create(size + sum, &pool);
6255 is.read((
char*)(buffer.data()), buffer.size());
6256 handles.emplace_back(std::move(buffer));
6260 while(is.read((
char*)&head,
sizeof(
FileHeader))) {
6262 fprintf(stderr,
"nanovdb::readUncompressedGrids: invalid magic number = \"%s\"\n", (
const char*)&(head.
magic));
6266 fprintf(stderr,
"nanovdb::readUncompressedGrids: invalid major version = \"%s\"\n",
toStr(str, head.
version));
6270 fprintf(stderr,
"nanovdb::readUncompressedGrids: invalid codec = \"%s\"\n",
toStr(str, head.
codec));
6274 for (uint16_t i = 0; i < head.
gridCount; ++i) {
6276 is.skip(meta.nameSize);
6277 auto buffer = GridHandleT::BufferType::create(meta.gridSize, &pool);
6278 is.read((
char*)buffer.data(), meta.gridSize);
6279 handles.emplace_back(std::move(buffer));
6287template<
typename GridHandleT,
template<
typename...>
class VecT>
6288VecT<GridHandleT>
readUncompressedGrids(
const char* fileName,
const typename GridHandleT::BufferType& buffer =
typename GridHandleT::BufferType())
6290#ifdef NANOVDB_USE_IOSTREAMS
6291 struct StreamT :
public std::ifstream {
6292 StreamT(
const char* name) : std::ifstream(name, std::ios::in | std::ios::binary){}
6293 void skip(int64_t off) { this->seekg(off, std::ios_base::cur); }
6298 StreamT(
const char* name) { fptr = fopen(name,
"rb"); }
6299 ~StreamT() { fclose(fptr); }
6300 bool read(
char* data,
size_t n) {
6301 size_t m = fread(data, 1, n, fptr);
6304 void skip(int64_t off) { fseek(fptr, (
long int)off, SEEK_CUR); }
6305 bool is_open()
const {
return fptr != NULL; }
6308 StreamT is(fileName);
6309 if (!is.is_open()) {
6310 fprintf(stderr,
"nanovdb::readUncompressedGrids: Unable to open file \"%s\"for input\n", fileName);
6356template<
typename BuildT>
6368template<
typename BuildT>
6381template<
typename BuildT>
6396template<
typename BuildT>
6410template<
typename BuildT>
6424template<
typename BuildT>
6438template<
typename BuildT>
6451template<
typename BuildT>
6463template<
typename BuildT>
6474template<
typename BuildT>
6488 return tile.state > 0u;
6509template<
typename BuildT>
#define NANOVDB_MAGIC_FILE
Definition NanoVDB.h:141
#define NANOVDB_MAGIC_GRID
Definition NanoVDB.h:140
#define NANOVDB_MINOR_VERSION_NUMBER
Definition NanoVDB.h:147
#define NANOVDB_DATA_ALIGNMENT
Definition NanoVDB.h:133
#define NANOVDB_MAJOR_VERSION_NUMBER
Definition NanoVDB.h:146
#define NANOVDB_MAGIC_NUMB
Definition NanoVDB.h:139
#define NANOVDB_PATCH_VERSION_NUMBER
Definition NanoVDB.h:148
BitFlags(std::initializer_list< uint8_t > list)
Definition NanoVDB.h:966
__hostdev__ void setBitOn(std::initializer_list< uint8_t > list)
Definition NanoVDB.h:996
__hostdev__ Type getFlags() const
Definition NanoVDB.h:988
__hostdev__ void setOn()
Definition NanoVDB.h:990
BitFlags(Type mask)
Definition NanoVDB.h:965
__hostdev__ bool isMaskOn(MaskT mask) const
Definition NanoVDB.h:1030
__hostdev__ void setBitOff(uint8_t bit)
Definition NanoVDB.h:994
__hostdev__ void setOff()
Definition NanoVDB.h:991
__hostdev__ bool isBitOn(uint8_t bit) const
Definition NanoVDB.h:1027
BitFlags()
Definition NanoVDB.h:964
__hostdev__ void setMaskOff(MaskT mask)
Definition NanoVDB.h:1008
__hostdev__ void initBit(std::initializer_list< uint8_t > list)
Definition NanoVDB.h:977
__hostdev__ bool isMaskOff(std::initializer_list< MaskT > list) const
return true if any of the masks in the list are off
Definition NanoVDB.h:1044
__hostdev__ void initMask(std::initializer_list< MaskT > list)
Definition NanoVDB.h:983
__hostdev__ void setBit(uint8_t bit, bool on)
Definition NanoVDB.h:1021
__hostdev__ void setBitOn(uint8_t bit)
Definition NanoVDB.h:993
__hostdev__ Type & data()
Definition NanoVDB.h:976
BitFlags(std::initializer_list< MaskT > list)
Definition NanoVDB.h:971
__hostdev__ void setMask(MaskT mask, bool on)
Definition NanoVDB.h:1023
__hostdev__ bool isOff() const
Definition NanoVDB.h:1026
__hostdev__ bool isBitOff(uint8_t bit) const
Definition NanoVDB.h:1028
__hostdev__ void setBitOff(std::initializer_list< uint8_t > list)
Definition NanoVDB.h:1000
__hostdev__ void setMaskOff(std::initializer_list< MaskT > list)
Definition NanoVDB.h:1016
__hostdev__ bool isMaskOn(std::initializer_list< MaskT > list) const
return true if any of the masks in the list are on
Definition NanoVDB.h:1035
__hostdev__ Type data() const
Definition NanoVDB.h:975
__hostdev__ bool isOn() const
Definition NanoVDB.h:1025
__hostdev__ void setMaskOn(std::initializer_list< MaskT > list)
Definition NanoVDB.h:1011
__hostdev__ bool isMaskOff(MaskT mask) const
Definition NanoVDB.h:1032
__hostdev__ void setMaskOn(MaskT mask)
Definition NanoVDB.h:1006
decltype(mFlags) Type
Definition NanoVDB.h:963
__hostdev__ BitFlags & operator=(Type n)
required for backwards compatibility
Definition NanoVDB.h:1052
Class to access values in channels at a specific voxel location.
Definition NanoVDB.h:5885
__hostdev__ ChannelT & operator()(int i, int j, int k) const
Definition NanoVDB.h:5954
__hostdev__ ChannelT * setChannel(uint32_t channelID)
Change to an internal channel, assuming it exists as as blind data in the IndexGrid.
Definition NanoVDB.h:5942
NanoTree< IndexT > TreeType
Definition NanoVDB.h:5894
__hostdev__ uint64_t getIndex(const math::Coord &ijk) const
Return the linear offset into a channel that maps to the specified coordinate.
Definition NanoVDB.h:5948
__hostdev__ ChannelAccessor(const NanoGrid< IndexT > &grid, ChannelT *channelPtr)
Ctor from an IndexGrid and an external channel.
Definition NanoVDB.h:5910
__hostdev__ bool probeValue(const math::Coord &ijk, typename util::remove_const< ChannelT >::type &v) const
return the state and updates the value of the specified voxel
Definition NanoVDB.h:5957
__hostdev__ const uint64_t & valueCount() const
Return total number of values indexed by the IndexGrid.
Definition NanoVDB.h:5932
__hostdev__ ChannelT & operator()(const math::Coord &ijk) const
Definition NanoVDB.h:5953
__hostdev__ uint64_t idx(int i, int j, int k) const
Definition NanoVDB.h:5949
__hostdev__ const TreeType & tree() const
Definition NanoVDB.h:5926
__hostdev__ ChannelAccessor(const NanoGrid< IndexT > &grid, uint32_t channelID=0u)
Ctor from an IndexGrid and an integer ID of an internal channel that is assumed to exist as blind dat...
Definition NanoVDB.h:5899
__hostdev__ const NanoGrid< IndexT > & grid() const
Definition NanoVDB.h:5923
ChannelT ValueType
Definition NanoVDB.h:5893
ChannelAccessor< ChannelT, IndexT > AccessorType
Definition NanoVDB.h:5895
__hostdev__ const Vec3d & voxelSize() const
Return a vector of the axial voxel sizes.
Definition NanoVDB.h:5929
__hostdev__ T & getValue(const math::Coord &ijk, T *channelPtr) const
Return the value from a specified channel that maps to the specified coordinate.
Definition NanoVDB.h:5968
__hostdev__ ChannelT * setChannel(ChannelT *channelPtr)
Definition NanoVDB.h:5936
__hostdev__ ChannelT & getValue(const math::Coord &ijk) const
Return the value from a cached channel that maps to the specified coordinate.
Definition NanoVDB.h:5952
Class that encapsulates two CRC32 checksums, one for the Grid, Tree and Root node meta data and one f...
Definition NanoVDB.h:1870
__hostdev__ Checksum(uint64_t checksum, CheckMode mode=CheckMode::Full)
Definition NanoVDB.h:1893
__hostdev__ bool isFull() const
return true if the 64 bit checksum is fill, i.e. of both had and nodes
Definition NanoVDB.h:1919
__hostdev__ Checksum(uint32_t head, uint32_t tail)
Constructor that allows the two 32bit checksums to be initiated explicitly.
Definition NanoVDB.h:1888
__hostdev__ uint64_t checksum() const
return the 64 bit checksum of this instance
Definition NanoVDB.h:1900
__hostdev__ uint64_t full() const
Definition NanoVDB.h:1906
__hostdev__ uint64_t & full()
Definition NanoVDB.h:1907
__hostdev__ bool isEmpty() const
return true if the 64 bit checksum is disables (unset)
Definition NanoVDB.h:1922
__hostdev__ bool operator==(const Checksum &rhs) const
return true if the checksums are identical
Definition NanoVDB.h:1935
__hostdev__ Checksum()
default constructor initiates checksum to EMPTY
Definition NanoVDB.h:1883
__hostdev__ bool isHalf() const
Definition NanoVDB.h:1916
__hostdev__ uint32_t head() const
Definition NanoVDB.h:1908
__hostdev__ uint32_t & head()
Definition NanoVDB.h:1909
uint64_t mCRC64
Definition NanoVDB.h:1875
uint32_t mCRC32[2]
Definition NanoVDB.h:1875
static constexpr uint32_t EMPTY32
Definition NanoVDB.h:1879
__hostdev__ uint32_t tail() const
Definition NanoVDB.h:1910
__hostdev__ uint32_t checksum(int i) const
Definition NanoVDB.h:1904
__hostdev__ uint32_t & checksum(int i)
Definition NanoVDB.h:1902
__hostdev__ bool operator!=(const Checksum &rhs) const
return true if the checksums are not identical
Definition NanoVDB.h:1939
static constexpr uint64_t EMPTY64
Definition NanoVDB.h:1880
__hostdev__ bool isPartial() const
return true if the 64 bit checksum is partial, i.e. of head only
Definition NanoVDB.h:1915
__hostdev__ CheckMode mode() const
return the mode of the 64 bit checksum
Definition NanoVDB.h:1927
__hostdev__ uint32_t & tail()
Definition NanoVDB.h:1911
__hostdev__ void disable()
Definition NanoVDB.h:1924
Dummy type for a 16bit quantization of float point values.
Definition NanoVDB.h:199
Dummy type for a 4bit quantization of float point values.
Definition NanoVDB.h:193
Dummy type for a 8bit quantization of float point values.
Definition NanoVDB.h:196
Dummy type for a variable bit quantization of floating point values.
Definition NanoVDB.h:202
Highest level of the data structure. Contains a tree and a world->index transform (that currently onl...
Definition NanoVDB.h:2179
__hostdev__ const NanoTree< BuildT > & tree() const
Definition NanoVDB.h:2233
typename RootType::LeafNodeType LeafNodeType
Definition NanoVDB.h:2186
__hostdev__ const GridClass & gridClass() const
Definition NanoVDB.h:2308
typename TreeT::ValueType ValueType
Definition NanoVDB.h:2188
__hostdev__ DataType * data()
Definition NanoVDB.h:2202
__hostdev__ Vec3T worldToIndexF(const Vec3T &xyz) const
Definition NanoVDB.h:2272
typename TreeT::RootType RootType
Definition NanoVDB.h:2182
__hostdev__ bool hasMinMax() const
Definition NanoVDB.h:2318
__hostdev__ util::enable_if< util::is_same< T, Point >::value, constuint64_t & >::type pointCount() const
Definition NanoVDB.h:2230
__hostdev__ int findBlindData(const char *name) const
__hostdev__ const Map & map() const
Definition NanoVDB.h:2245
typename TreeT::CoordType CoordType
Definition NanoVDB.h:2190
typename RootNodeType::ChildNodeType UpperNodeType
Definition NanoVDB.h:2184
__hostdev__ const GridBlindMetaData & blindMetaData(uint32_t n) const
Definition NanoVDB.h:2385
__hostdev__ uint32_t blindDataCount() const
Definition NanoVDB.h:2351
__hostdev__ bool hasStdDeviation() const
Definition NanoVDB.h:2322
__hostdev__ BlindDataT * getBlindData(uint32_t n)
Definition NanoVDB.h:2379
__hostdev__ uint32_t gridIndex() const
Definition NanoVDB.h:2213
__hostdev__ bool isUnknown() const
Definition NanoVDB.h:2317
__hostdev__ Vec3T worldToIndexDir(const Vec3T &dir) const
Definition NanoVDB.h:2263
__hostdev__ const GridType & gridType() const
Definition NanoVDB.h:2307
__hostdev__ bool isSequential() const
Definition NanoVDB.h:2336
__hostdev__ const Checksum & checksum() const
Definition NanoVDB.h:2345
__hostdev__ bool isVoxelBVH() const
Definition NanoVDB.h:2315
GridData DataType
Definition NanoVDB.h:2187
RootType RootNodeType
Definition NanoVDB.h:2183
__hostdev__ bool isValid() const
Definition NanoVDB.h:2306
__hostdev__ uint64_t gridSize() const
Definition NanoVDB.h:2210
__hostdev__ Version version() const
Definition NanoVDB.h:2200
__hostdev__ Vec3T indexToWorldGrad(const Vec3T &grad) const
Definition NanoVDB.h:2268
__hostdev__ bool hasLongGridName() const
Definition NanoVDB.h:2320
__hostdev__ Vec3T indexToWorldGradF(const Vec3T &grad) const
Definition NanoVDB.h:2291
__hostdev__ bool hasBBox() const
Definition NanoVDB.h:2319
__hostdev__ util::enable_if< BuildTraits< T >::is_index, constuint64_t & >::type valueCount() const
Definition NanoVDB.h:2223
__hostdev__ Vec3T indexToWorldDirF(const Vec3T &dir) const
Definition NanoVDB.h:2281
__hostdev__ const char * shortGridName() const
Definition NanoVDB.h:2342
__hostdev__ const char * gridName() const
Definition NanoVDB.h:2339
__hostdev__ bool isMask() const
Definition NanoVDB.h:2316
__hostdev__ const BlindDataT * getBlindData(uint32_t n) const
Definition NanoVDB.h:2372
__hostdev__ uint64_t activeVoxelCount() const
Definition NanoVDB.h:2303
DefaultReadAccessor< BuildType > AccessorType
Definition NanoVDB.h:2191
__hostdev__ bool isBreadthFirst() const
Definition NanoVDB.h:2323
__hostdev__ bool isPointIndex() const
Definition NanoVDB.h:2312
__hostdev__ bool hasAverage() const
Definition NanoVDB.h:2321
__hostdev__ bool isGridIndex() const
Definition NanoVDB.h:2313
__hostdev__ Vec3T indexToWorldDir(const Vec3T &dir) const
Definition NanoVDB.h:2258
__hostdev__ Vec3T indexToWorld(const Vec3T &xyz) const
Definition NanoVDB.h:2253
__hostdev__ bool isLevelSet() const
Definition NanoVDB.h:2309
__hostdev__ uint32_t gridCount() const
Definition NanoVDB.h:2216
__hostdev__ bool isPointData() const
Definition NanoVDB.h:2314
typename UpperNodeType::ChildNodeType LowerNodeType
Definition NanoVDB.h:2185
__hostdev__ AccessorType getAccessor() const
Definition NanoVDB.h:2239
__hostdev__ Vec3T worldToIndex(const Vec3T &xyz) const
Definition NanoVDB.h:2249
__hostdev__ const void * blindData(uint32_t n) const
Definition NanoVDB.h:2364
__hostdev__ const DataType * data() const
Definition NanoVDB.h:2204
__hostdev__ bool isStaggered() const
Definition NanoVDB.h:2311
__hostdev__ Vec3T worldToIndexDirF(const Vec3T &dir) const
Definition NanoVDB.h:2286
__hostdev__ Vec3T indexToWorldF(const Vec3T &xyz) const
Definition NanoVDB.h:2276
__hostdev__ const Vec3d & voxelSize() const
Definition NanoVDB.h:2242
TreeT TreeType
Definition NanoVDB.h:2181
Grid(const Grid &)=delete
Disallow constructions, copy and assignment.
typename TreeT::BuildType BuildType
Definition NanoVDB.h:2189
Grid & operator=(const Grid &)=delete
__hostdev__ bool isFogVolume() const
Definition NanoVDB.h:2310
__hostdev__ bool isSequential() const
Definition NanoVDB.h:2328
__hostdev__ int findBlindDataForSemantic(GridBlindDataSemantic semantic) const
__hostdev__ NanoTree< BuildT > & tree()
Definition NanoVDB.h:2236
Type containing raw 16 bits for half precision floating point values (IEEE 754 Half)
Definition NanoVDB.h:187
uint16_t raw
Definition NanoVDB.h:189
Visits child nodes of this node only.
Definition NanoVDB.h:3368
__hostdev__ NodeT & operator*() const
Definition NanoVDB.h:3386
__hostdev__ ChildIter(ParentT *parent)
Definition NanoVDB.h:3380
ChildIter & operator=(const ChildIter &)=default
__hostdev__ CoordType getOrigin() const
Definition NanoVDB.h:3396
__hostdev__ NodeT * operator->() const
Definition NanoVDB.h:3391
__hostdev__ CoordType getCoord() const
Definition NanoVDB.h:3401
__hostdev__ ChildIter()
Definition NanoVDB.h:3375
DenseIterator & operator=(const DenseIterator &)=default
__hostdev__ DenseIterator(const InternalNode *parent)
Definition NanoVDB.h:3495
__hostdev__ CoordType getOrigin() const
Definition NanoVDB.h:3517
__hostdev__ const ChildT * probeChild(ValueType &value) const
Definition NanoVDB.h:3501
__hostdev__ bool isValueOn() const
Definition NanoVDB.h:3512
__hostdev__ DenseIterator()
Definition NanoVDB.h:3490
__hostdev__ CoordType getCoord() const
Definition NanoVDB.h:3522
ValueIterator & operator=(const ValueIterator &)=default
__hostdev__ ValueIterator(const InternalNode *parent)
Definition NanoVDB.h:3422
__hostdev__ ValueIterator()
Definition NanoVDB.h:3417
__hostdev__ CoordType getOrigin() const
Definition NanoVDB.h:3433
__hostdev__ ValueType operator*() const
Definition NanoVDB.h:3428
__hostdev__ CoordType getCoord() const
Definition NanoVDB.h:3438
__hostdev__ bool isActive() const
Definition NanoVDB.h:3439
__hostdev__ ValueOnIterator(const InternalNode *parent)
Definition NanoVDB.h:3461
__hostdev__ ValueOnIterator()
Definition NanoVDB.h:3456
__hostdev__ CoordType getOrigin() const
Definition NanoVDB.h:3472
ValueOnIterator & operator=(const ValueOnIterator &)=default
__hostdev__ ValueType operator*() const
Definition NanoVDB.h:3467
__hostdev__ CoordType getCoord() const
Definition NanoVDB.h:3477
Internal nodes of a VDB tree.
Definition NanoVDB.h:3342
__hostdev__ const MaskType< LOG2DIM > & childMask() const
Definition NanoVDB.h:3549
__hostdev__ const FloatType & stdDeviation() const
Definition NanoVDB.h:3568
__hostdev__ const ValueType & minimum() const
Definition NanoVDB.h:3556
__hostdev__ ConstChildIterator cbeginChild() const
Definition NanoVDB.h:3408
__hostdev__ const ChildNodeType * probeChild(const CoordType &ijk) const
Definition NanoVDB.h:3599
__hostdev__ const ValueType & maximum() const
Definition NanoVDB.h:3559
static constexpr bool FIXED_SIZE
Definition NanoVDB.h:3351
__hostdev__ DenseIterator beginDense() const
Definition NanoVDB.h:3525
__hostdev__ DataType * data()
Definition NanoVDB.h:3534
ChildIter< const InternalNode > ConstChildIterator
Definition NanoVDB.h:3405
__hostdev__ DenseIterator cbeginChildAll() const
Definition NanoVDB.h:3526
InternalData< ChildT, Log2Dim > DataType
Definition NanoVDB.h:3344
__hostdev__ bool isActive(const CoordType &ijk) const
Definition NanoVDB.h:3589
static __hostdev__ Coord OffsetToLocalCoord(uint32_t n)
Definition NanoVDB.h:3614
__hostdev__ ChildNodeType * probeChild(const CoordType &ijk)
Definition NanoVDB.h:3594
friend class ReadAccessor
Definition NanoVDB.h:3658
static constexpr uint32_t MASK
Definition NanoVDB.h:3361
static __hostdev__ uint32_t dim()
Definition NanoVDB.h:3539
typename ChildT::CoordType CoordType
Definition NanoVDB.h:3350
static constexpr uint32_t LEVEL
Definition NanoVDB.h:3362
__hostdev__ const MaskType< LOG2DIM > & getValueMask() const
Definition NanoVDB.h:3546
__hostdev__ FloatType variance() const
Definition NanoVDB.h:3565
__hostdev__ ValueIterator cbeginValueAll() const
Definition NanoVDB.h:3447
friend class InternalNode
Definition NanoVDB.h:3663
static constexpr uint32_t DIM
Definition NanoVDB.h:3359
__hostdev__ OpT::Type get(const CoordType &ijk, ArgsT &&... args) const
Definition NanoVDB.h:3639
typename DataType::BuildT BuildType
Definition NanoVDB.h:3347
__hostdev__ void localToGlobalCoord(Coord &ijk) const
Definition NanoVDB.h:3622
typename Mask< Log2Dim >::template Iterator< On > MaskIterT
Definition NanoVDB.h:3355
__hostdev__ ValueType getFirstValue() const
Definition NanoVDB.h:3575
ChildT ChildNodeType
Definition NanoVDB.h:3349
typename DataType::ValueT ValueType
Definition NanoVDB.h:3345
typename DataType::StatsT FloatType
Definition NanoVDB.h:3346
__hostdev__ bool probeValue(const CoordType &ijk, ValueType &v) const
Definition NanoVDB.h:3591
__hostdev__ void set(const CoordType &ijk, ArgsT &&... args)
Definition NanoVDB.h:3647
__hostdev__ ValueOnIterator beginValueOn() const
Definition NanoVDB.h:3480
__hostdev__ CoordType origin() const
Definition NanoVDB.h:3553
typename ChildT::LeafNodeType LeafNodeType
Definition NanoVDB.h:3348
static constexpr uint32_t TOTAL
Definition NanoVDB.h:3358
ChildIter< InternalNode > ChildIterator
Definition NanoVDB.h:3404
__hostdev__ ValueOnIterator cbeginValueOn() const
Definition NanoVDB.h:3481
static constexpr uint32_t LOG2DIM
Definition NanoVDB.h:3357
__hostdev__ ValueType getLastValue() const
Definition NanoVDB.h:3582
__hostdev__ const math::BBox< CoordType > & bbox() const
Definition NanoVDB.h:3571
__hostdev__ const MaskType< LOG2DIM > & getChildMask() const
Definition NanoVDB.h:3550
__hostdev__ ValueIterator beginValue() const
Definition NanoVDB.h:3446
static __hostdev__ uint32_t CoordToOffset(const CoordType &ijk)
Definition NanoVDB.h:3606
__hostdev__ Coord offsetToGlobalCoord(uint32_t n) const
Definition NanoVDB.h:3628
static constexpr uint32_t SIZE
Definition NanoVDB.h:3360
typename ChildT::template MaskType< LOG2 > MaskType
Definition NanoVDB.h:3353
__hostdev__ const LeafNodeType * probeLeaf(const CoordType &ijk) const
Definition NanoVDB.h:3592
__hostdev__ ChildIterator beginChild()
Definition NanoVDB.h:3407
__hostdev__ const MaskType< LOG2DIM > & valueMask() const
Definition NanoVDB.h:3545
__hostdev__ const DataType * data() const
Definition NanoVDB.h:3536
__hostdev__ ValueType getValue(const CoordType &ijk) const
Definition NanoVDB.h:3588
__hostdev__ const FloatType & average() const
Definition NanoVDB.h:3562
static constexpr uint64_t NUM_VALUES
Definition NanoVDB.h:3363
InternalNode & operator=(const InternalNode &)=delete
InternalNode(const InternalNode &)=delete
__hostdev__ bool isActive() const
Definition NanoVDB.h:3636
friend class RootNode
Definition NanoVDB.h:3661
static __hostdev__ size_t memUsage()
Definition NanoVDB.h:3542
ValueIterator & operator=(const ValueIterator &)=default
__hostdev__ CoordT getCoord() const
Definition NanoVDB.h:4435
__hostdev__ ValueIterator(const LeafNode *parent)
Definition NanoVDB.h:4423
__hostdev__ ValueIterator()
Definition NanoVDB.h:4418
__hostdev__ ValueType operator*() const
Definition NanoVDB.h:4430
__hostdev__ ValueIterator & operator++()
Definition NanoVDB.h:4446
__hostdev__ ValueIterator operator++(int)
Definition NanoVDB.h:4451
__hostdev__ bool isActive() const
Definition NanoVDB.h:4440
__hostdev__ CoordT getCoord() const
Definition NanoVDB.h:4401
__hostdev__ ValueOffIterator()
Definition NanoVDB.h:4385
ValueOffIterator & operator=(const ValueOffIterator &)=default
__hostdev__ ValueType operator*() const
Definition NanoVDB.h:4396
__hostdev__ ValueOffIterator(const LeafNode *parent)
Definition NanoVDB.h:4390
__hostdev__ ValueOnIterator()
Definition NanoVDB.h:4352
__hostdev__ CoordT getCoord() const
Definition NanoVDB.h:4368
__hostdev__ ValueOnIterator(const LeafNode *parent)
Definition NanoVDB.h:4357
ValueOnIterator & operator=(const ValueOnIterator &)=default
__hostdev__ ValueType operator*() const
Definition NanoVDB.h:4363
Leaf nodes of the VDB tree. (defaults to 8x8x8 = 512 voxels)
Definition NanoVDB.h:4325
__hostdev__ void setValueOnly(uint32_t offset, const ValueType &v)
Sets the value at the specified location but leaves its state unchanged.
Definition NanoVDB.h:4567
__hostdev__ FloatType stdDeviation() const
Return a const reference to the standard deviation of all the active values encoded in this leaf node...
Definition NanoVDB.h:4492
static constexpr bool FIXED_SIZE
Definition NanoVDB.h:4339
__hostdev__ DataType * data()
Definition NanoVDB.h:4471
typename DataType::BuildType BuildType
Definition NanoVDB.h:4337
static __hostdev__ CoordT OffsetToLocalCoord(uint32_t n)
Compute the local coordinates from a linear offset.
Definition NanoVDB.h:4502
static __hostdev__ uint32_t padding()
Definition NanoVDB.h:4537
LeafData< BuildT, CoordT, MaskT, Log2Dim > DataType
Definition NanoVDB.h:4334
CoordT CoordType
Definition NanoVDB.h:4338
friend class ReadAccessor
Definition NanoVDB.h:4637
static constexpr uint32_t MASK
Definition NanoVDB.h:4467
__hostdev__ CoordT offsetToGlobalCoord(uint32_t n) const
Definition NanoVDB.h:4512
static __hostdev__ uint32_t dim()
Return the dimension, in index space, of this leaf node (typically 8 as for openvdb leaf nodes!...
Definition NanoVDB.h:4518
LeafNode< BuildT, CoordT, MaskT, Log2Dim > LeafNodeType
Definition NanoVDB.h:4333
static constexpr uint32_t LEVEL
Definition NanoVDB.h:4468
__hostdev__ const MaskType< LOG2DIM > & getValueMask() const
Definition NanoVDB.h:4477
__hostdev__ FloatType variance() const
Return the variance of all the active values encoded in this leaf node.
Definition NanoVDB.h:4489
__hostdev__ auto set(const uint32_t n, ArgsT &&... args)
Definition NanoVDB.h:4628
LeafNode & operator=(const LeafNode &)=delete
__hostdev__ CoordT origin() const
Return the origin in index space of this leaf node.
Definition NanoVDB.h:4497
__hostdev__ ValueIterator cbeginValueAll() const
Definition NanoVDB.h:4460
friend class InternalNode
Definition NanoVDB.h:4642
static constexpr uint32_t DIM
Definition NanoVDB.h:4465
__hostdev__ const LeafNode * probeLeaf(const CoordT &) const
Definition NanoVDB.h:4592
__hostdev__ ValueOffIterator cbeginValueOff() const
Definition NanoVDB.h:4409
__hostdev__ void localToGlobalCoord(Coord &ijk) const
Converts (in place) a local index coordinate to a global index coordinate.
Definition NanoVDB.h:4510
typename DataType::FloatType FloatType
Definition NanoVDB.h:4336
__hostdev__ ValueType getFirstValue() const
Return the first value in this leaf node.
Definition NanoVDB.h:4555
static __hostdev__ uint32_t CoordToOffset(const CoordT &ijk)
Definition NanoVDB.h:4595
typename Mask< Log2Dim >::template Iterator< ON > MaskIterT
Definition NanoVDB.h:4343
__hostdev__ void setValueOnly(const CoordT &ijk, const ValueType &v)
Definition NanoVDB.h:4568
__hostdev__ FloatType average() const
Return a const reference to the average of all the active values encoded in this leaf node.
Definition NanoVDB.h:4486
__hostdev__ math::BBox< CoordT > bbox() const
Return the bounding box in index space of active values in this leaf node.
Definition NanoVDB.h:4521
__hostdev__ bool probeValue(const CoordT &ijk, ValueType &v) const
Return true if the voxel value at the given coordinate is active and updates v with the value.
Definition NanoVDB.h:4585
__hostdev__ uint8_t flags() const
Definition NanoVDB.h:4494
__hostdev__ bool hasBBox() const
Definition NanoVDB.h:4582
__hostdev__ auto set(const CoordType &ijk, ArgsT &&... args)
Definition NanoVDB.h:4622
__hostdev__ ValueOffIterator beginValueOff() const
Definition NanoVDB.h:4408
__hostdev__ ValueOnIterator beginValueOn() const
Definition NanoVDB.h:4375
static constexpr uint32_t TOTAL
Definition NanoVDB.h:4464
__hostdev__ void setValue(const CoordT &ijk, const ValueType &v)
Sets the value at the specified location and activate its state.
Definition NanoVDB.h:4562
__hostdev__ bool isActive(const CoordT &ijk) const
Return true if the voxel value at the given coordinate is active.
Definition NanoVDB.h:4571
__hostdev__ ValueType minimum() const
Return a const reference to the minimum active value encoded in this leaf node.
Definition NanoVDB.h:4480
__hostdev__ auto get(const CoordType &ijk, ArgsT &&... args) const
Definition NanoVDB.h:4610
__hostdev__ ValueOnIterator cbeginValueOn() const
Definition NanoVDB.h:4376
MaskT< LOG2 > MaskType
Definition NanoVDB.h:4341
__hostdev__ ValueType maximum() const
Return a const reference to the maximum active value encoded in this leaf node.
Definition NanoVDB.h:4483
static constexpr uint32_t LOG2DIM
Definition NanoVDB.h:4463
__hostdev__ ValueType getLastValue() const
Return the last value in this leaf node.
Definition NanoVDB.h:4557
__hostdev__ bool isActive(uint32_t n) const
Definition NanoVDB.h:4572
LeafNode(const LeafNode &)=delete
__hostdev__ ValueType getValue(const CoordT &ijk) const
Return the voxel value at the given coordinate.
Definition NanoVDB.h:4552
LeafNode()=delete
This class cannot be constructed or deleted.
__hostdev__ bool updateBBox()
Updates the local bounding box of active voxels in this node. Return true if bbox was updated.
Definition NanoVDB.h:4690
__hostdev__ ValueIterator beginValue() const
Definition NanoVDB.h:4459
__hostdev__ uint64_t memUsage() const
return memory usage in bytes for the leaf node
Definition NanoVDB.h:4540
static constexpr uint32_t SIZE
Definition NanoVDB.h:4466
typename DataType::ValueType ValueType
Definition NanoVDB.h:4335
__hostdev__ auto get(const uint32_t n, ArgsT &&... args) const
Definition NanoVDB.h:4616
__hostdev__ ValueType getValue(uint32_t offset) const
Return the voxel value at the given offset.
Definition NanoVDB.h:4549
__hostdev__ const MaskType< LOG2DIM > & valueMask() const
Return a const reference to the bit mask of active voxels in this leaf node.
Definition NanoVDB.h:4476
__hostdev__ const DataType * data() const
Definition NanoVDB.h:4473
static constexpr uint64_t NUM_VALUES
Definition NanoVDB.h:4469
static __hostdev__ uint32_t voxelCount()
Return the total number of voxels (e.g. values) encoded in this leaf node.
Definition NanoVDB.h:4535
__hostdev__ bool isActive() const
Return true if any of the voxel value are active in this leaf node.
Definition NanoVDB.h:4575
friend class RootNode
Definition NanoVDB.h:4640
Definition NanoVDB.h:1133
DenseIterator & operator=(const DenseIterator &)=default
__hostdev__ DenseIterator & operator++()
Definition NanoVDB.h:1143
__hostdev__ DenseIterator operator++(int)
Definition NanoVDB.h:1148
__hostdev__ uint32_t pos() const
Definition NanoVDB.h:1141
__hostdev__ uint32_t operator*() const
Definition NanoVDB.h:1140
__hostdev__ DenseIterator(uint32_t pos=Mask::SIZE)
Definition NanoVDB.h:1135
Definition NanoVDB.h:1099
__hostdev__ Iterator operator++(int)
Definition NanoVDB.h:1120
__hostdev__ Iterator()
Definition NanoVDB.h:1101
Iterator & operator=(const Iterator &)=default
__hostdev__ uint32_t pos() const
Definition NanoVDB.h:1113
__hostdev__ uint32_t operator*() const
Definition NanoVDB.h:1112
__hostdev__ Iterator & operator++()
Definition NanoVDB.h:1115
__hostdev__ Iterator(uint32_t pos, const Mask *parent)
Definition NanoVDB.h:1106
Bit-mask to encode active states and facilitate sequential iterators and a fast codec for I/O compres...
Definition NanoVDB.h:1065
__hostdev__ void setAtomic(uint32_t n, bool on)
Definition NanoVDB.h:1267
__hostdev__ bool isOff(uint32_t n) const
Return true if the given bit is NOT set.
Definition NanoVDB.h:1234
__hostdev__ void set(uint32_t n, bool on)
Set the specified bit on or off.
Definition NanoVDB.h:1295
__hostdev__ void setOffAtomic(uint32_t n)
Definition NanoVDB.h:1263
__hostdev__ void setOnAtomic(uint32_t n)
Definition NanoVDB.h:1259
__hostdev__ void setOn()
Set all bits on.
Definition NanoVDB.h:1308
__hostdev__ uint32_t countOn(uint32_t i) const
Return the number of lower set bits in mask up to but excluding the i'th bit.
Definition NanoVDB.h:1089
NANOVDB_HOSTDEV_DISABLE_WARNING __hostdev__ uint32_t findNext(uint32_t start) const
Definition NanoVDB.h:1378
__hostdev__ uint32_t countOn() const
Return the total number of set bits in this Mask.
Definition NanoVDB.h:1080
__hostdev__ uint64_t * words()
Return a pointer to the list of words of the bit mask.
Definition NanoVDB.h:1185
__hostdev__ Mask(bool on)
Definition NanoVDB.h:1174
__hostdev__ DenseIterator beginAll() const
Definition NanoVDB.h:1166
__hostdev__ void setOff(uint32_t n)
Set the specified bit off.
Definition NanoVDB.h:1257
__hostdev__ void setOff()
Set all bits off.
Definition NanoVDB.h:1314
Iterator< false > OffIterator
Definition NanoVDB.h:1160
Mask & operator=(const Mask &)=default
__hostdev__ Mask()
Initialize all bits to zero.
Definition NanoVDB.h:1169
__hostdev__ Mask & operator&=(const Mask &other)
Bitwise intersection.
Definition NanoVDB.h:1334
Iterator< true > OnIterator
Definition NanoVDB.h:1159
__hostdev__ util::enable_if<!util::is_same< MaskT, Mask >::value, Mask & >::type operator=(const MaskT &other)
Assignment operator that works with openvdb::util::NodeMask.
Definition NanoVDB.h:1205
__hostdev__ void toggle(uint32_t n)
Definition NanoVDB.h:1331
__hostdev__ bool operator!=(const Mask &other) const
Definition NanoVDB.h:1228
__hostdev__ bool isOff() const
Return true if none of the bits are set in this Mask.
Definition NanoVDB.h:1246
static constexpr uint32_t WORD_COUNT
Definition NanoVDB.h:1068
__hostdev__ OffIterator beginOff() const
Definition NanoVDB.h:1164
__hostdev__ void toggle()
brief Toggle the state of all bits in the mask
Definition NanoVDB.h:1326
__hostdev__ const uint64_t * words() const
Definition NanoVDB.h:1186
__hostdev__ void set(bool on)
Set all bits off.
Definition NanoVDB.h:1320
__hostdev__ OnIterator beginOn() const
Definition NanoVDB.h:1162
static __hostdev__ uint32_t wordCount()
Return the number of machine words used by this Mask.
Definition NanoVDB.h:1077
static __hostdev__ uint32_t bitCount()
Return the number of bits available in this Mask.
Definition NanoVDB.h:1074
__hostdev__ Mask & operator|=(const Mask &other)
Bitwise union.
Definition NanoVDB.h:1342
__hostdev__ bool operator==(const Mask &other) const
Definition NanoVDB.h:1219
NANOVDB_HOSTDEV_DISABLE_WARNING __hostdev__ uint32_t findPrev(uint32_t start) const
Definition NanoVDB.h:1392
Mask(const Mask &)=default
Copy constructor.
__hostdev__ bool isOn(uint32_t n) const
Return true if the given bit is set.
Definition NanoVDB.h:1231
static constexpr uint32_t SIZE
Definition NanoVDB.h:1067
__hostdev__ bool isOn() const
Return true if all the bits are set in this Mask.
Definition NanoVDB.h:1237
__hostdev__ void setWord(WordT w, uint32_t n)
Definition NanoVDB.h:1196
NANOVDB_HOSTDEV_DISABLE_WARNING __hostdev__ uint32_t findFirst() const
Definition NanoVDB.h:1368
__hostdev__ Mask & operator-=(const Mask &other)
Bitwise difference.
Definition NanoVDB.h:1350
__hostdev__ Mask & operator^=(const Mask &other)
Bitwise XOR.
Definition NanoVDB.h:1358
__hostdev__ WordT getWord(uint32_t n) const
Definition NanoVDB.h:1189
__hostdev__ void setOn(uint32_t n)
Set the specified bit on.
Definition NanoVDB.h:1255
static __hostdev__ size_t memUsage()
Return the memory footprint in bytes of this Mask.
Definition NanoVDB.h:1071
__hostdev__ uint64_t voxelPoints(const Coord &ijk, const AttT *&begin, const AttT *&end) const
get iterators over attributes to points at a specific voxel location
Definition NanoVDB.h:5865
PointAccessor(const NanoGrid< Point > &grid)
Definition NanoVDB.h:5823
__hostdev__ uint64_t leafPoints(const Coord &ijk, const AttT *&begin, const AttT *&end) const
Return the number of points in the leaf node containing the coordinate ijk. If this return value is l...
Definition NanoVDB.h:5854
__hostdev__ uint64_t gridPoints(const AttT *&begin, const AttT *&end) const
Return the total number of point in the grid and set the iterators to the complete range of points.
Definition NanoVDB.h:5844
__hostdev__ const NanoGrid< Point > & grid() const
Definition NanoVDB.h:5840
__hostdev__ uint64_t voxelPoints(const Coord &ijk, const AttT *&begin, const AttT *&end) const
get iterators over attributes to points at a specific voxel location
Definition NanoVDB.h:5799
__hostdev__ uint64_t leafPoints(const Coord &ijk, const AttT *&begin, const AttT *&end) const
Return the number of points in the leaf node containing the coordinate ijk. If this return value is l...
Definition NanoVDB.h:5787
__hostdev__ uint64_t gridPoints(const AttT *&begin, const AttT *&end) const
Return the total number of point in the grid and set the iterators to the complete range of points.
Definition NanoVDB.h:5777
__hostdev__ const NanoGrid< BuildT > & grid() const
Definition NanoVDB.h:5773
PointAccessor(const NanoGrid< BuildT > &grid)
Definition NanoVDB.h:5760
Dummy type for indexing points into voxels.
Definition NanoVDB.h:205
__hostdev__ auto set(const CoordType &ijk, ArgsT &&... args) const
Definition NanoVDB.h:4995
__hostdev__ DimAndActive getDimAndActive(const CoordType &ijk, const RayT &ray) const
Fused getDim + isActive: one tree walk returns both the HDDA step size and the active state of ijk,...
Definition NanoVDB.h:4984
ReadAccessor & operator=(const ReadAccessor &)=default
__hostdev__ bool isActive(const CoordType &ijk) const
Definition NanoVDB.h:4971
__hostdev__ ReadAccessor(const RootT &root)
Constructor from a root node.
Definition NanoVDB.h:4936
friend class InternalNode
Definition NanoVDB.h:5005
__hostdev__ uint32_t getDim(const CoordType &ijk, const RayT &ray) const
Definition NanoVDB.h:4975
__hostdev__ const LeafT * probeLeaf(const CoordType &ijk) const
Definition NanoVDB.h:4973
__hostdev__ bool probeValue(const CoordType &ijk, ValueType &v) const
Definition NanoVDB.h:4972
__hostdev__ ValueType operator()(int i, int j, int k) const
Definition NanoVDB.h:4969
typename RootT::CoordType CoordType
Definition NanoVDB.h:4931
__hostdev__ auto get(const CoordType &ijk, ArgsT &&... args) const
Definition NanoVDB.h:4989
__hostdev__ auto getNodeInfo(const CoordType &ijk) const
Definition NanoVDB.h:4970
__hostdev__ ReadAccessor(const TreeT &tree)
Constructor from a tree.
Definition NanoVDB.h:4948
friend class LeafNode
Definition NanoVDB.h:5007
ReadAccessor(const ReadAccessor &)=default
Defaults constructors.
typename RootT::ValueType ValueType
Definition NanoVDB.h:4930
__hostdev__ ReadAccessor(const GridT &grid)
Constructor from a grid.
Definition NanoVDB.h:4942
__hostdev__ void clear()
Reset this access to its initial state, i.e. with an empty cache.
Definition NanoVDB.h:4955
__hostdev__ ValueType getValue(const CoordType &ijk) const
Definition NanoVDB.h:4963
static const int CacheLevels
Definition NanoVDB.h:4933
BuildT BuildType
Definition NanoVDB.h:4929
__hostdev__ ValueType operator()(const CoordType &ijk) const
Definition NanoVDB.h:4968
__hostdev__ ValueType getValue(int i, int j, int k) const
Definition NanoVDB.h:4967
__hostdev__ const RootT & root() const
Definition NanoVDB.h:4957
friend class RootNode
Allow nodes to insert themselves into the cache.
Definition NanoVDB.h:5003
__hostdev__ DimAndActive getDimAndActive(const CoordType &ijk, const RayT &ray) const
Fused getDim + isActive: one tree walk returns both the HDDA step size and the active state of ijk,...
Definition NanoVDB.h:5108
ReadAccessor & operator=(const ReadAccessor &)=default
__hostdev__ void set(const CoordType &ijk, ArgsT &&... args) const
Definition NanoVDB.h:5122
__hostdev__ bool isActive(const CoordType &ijk) const
Definition NanoVDB.h:5092
CoordT CoordType
Definition NanoVDB.h:5039
__hostdev__ ReadAccessor(const RootT &root)
Constructor from a root node.
Definition NanoVDB.h:5044
friend class InternalNode
Definition NanoVDB.h:5133
__hostdev__ uint32_t getDim(const CoordType &ijk, const RayT &ray) const
Definition NanoVDB.h:5097
__hostdev__ OpT::Type get(const CoordType &ijk, ArgsT &&... args) const
Definition NanoVDB.h:5115
ValueT ValueType
Definition NanoVDB.h:5038
__hostdev__ const LeafT * probeLeaf(const CoordType &ijk) const
Definition NanoVDB.h:5094
__hostdev__ bool probeValue(const CoordType &ijk, ValueType &v) const
Definition NanoVDB.h:5093
__hostdev__ ValueType operator()(int i, int j, int k) const
Definition NanoVDB.h:5090
__hostdev__ bool isCached(const CoordType &ijk) const
Definition NanoVDB.h:5077
__hostdev__ auto getNodeInfo(const CoordType &ijk) const
Definition NanoVDB.h:5091
__hostdev__ ReadAccessor(const TreeT &tree)
Constructor from a tree.
Definition NanoVDB.h:5058
friend class LeafNode
Definition NanoVDB.h:5135
ReadAccessor(const ReadAccessor &)=default
Defaults constructors.
__hostdev__ ReadAccessor(const GridT &grid)
Constructor from a grid.
Definition NanoVDB.h:5052
__hostdev__ void clear()
Reset this access to its initial state, i.e. with an empty cache.
Definition NanoVDB.h:5064
__hostdev__ ValueType getValue(const CoordType &ijk) const
Definition NanoVDB.h:5084
static const int CacheLevels
Definition NanoVDB.h:5041
BuildT BuildType
Definition NanoVDB.h:5037
__hostdev__ ValueType operator()(const CoordType &ijk) const
Definition NanoVDB.h:5089
__hostdev__ ValueType getValue(int i, int j, int k) const
Definition NanoVDB.h:5088
__hostdev__ const RootT & root() const
Definition NanoVDB.h:5070
friend class RootNode
Allow nodes to insert themselves into the cache.
Definition NanoVDB.h:5131
__hostdev__ DimAndActive getDimAndActive(const CoordType &ijk, const RayT &ray) const
Fused getDim + isActive: one tree walk returns both the HDDA step size and the active state of ijk,...
Definition NanoVDB.h:5301
ReadAccessor & operator=(const ReadAccessor &)=default
__hostdev__ bool isCached1(const CoordType &ijk) const
Definition NanoVDB.h:5254
__hostdev__ void set(const CoordType &ijk, ArgsT &&... args) const
Definition NanoVDB.h:5337
__hostdev__ bool isActive(const CoordType &ijk) const
Definition NanoVDB.h:5276
CoordT CoordType
Definition NanoVDB.h:5180
__hostdev__ ReadAccessor(const RootT &root)
Constructor from a root node.
Definition NanoVDB.h:5185
friend class InternalNode
Definition NanoVDB.h:5361
__hostdev__ uint32_t getDim(const CoordType &ijk, const RayT &ray) const
Definition NanoVDB.h:5281
__hostdev__ OpT::Type get(const CoordType &ijk, ArgsT &&... args) const
Definition NanoVDB.h:5317
ValueT ValueType
Definition NanoVDB.h:5179
__hostdev__ const LeafT * probeLeaf(const CoordType &ijk) const
Definition NanoVDB.h:5278
__hostdev__ bool probeValue(const CoordType &ijk, ValueType &v) const
Definition NanoVDB.h:5277
__hostdev__ ValueType operator()(int i, int j, int k) const
Definition NanoVDB.h:5274
__hostdev__ bool isCached2(const CoordType &ijk) const
Definition NanoVDB.h:5260
__hostdev__ auto getNodeInfo(const CoordType &ijk) const
Definition NanoVDB.h:5275
__hostdev__ ReadAccessor(const TreeT &tree)
Constructor from a tree.
Definition NanoVDB.h:5204
friend class LeafNode
Definition NanoVDB.h:5363
ReadAccessor(const ReadAccessor &)=default
Defaults constructors.
__hostdev__ ReadAccessor(const GridT &grid)
Constructor from a grid.
Definition NanoVDB.h:5198
__hostdev__ void clear()
Reset this access to its initial state, i.e. with an empty cache.
Definition NanoVDB.h:5210
__hostdev__ ValueType getValue(const CoordType &ijk) const
Definition NanoVDB.h:5268
static const int CacheLevels
Definition NanoVDB.h:5182
BuildT BuildType
Definition NanoVDB.h:5178
__hostdev__ ValueType operator()(const CoordType &ijk) const
Definition NanoVDB.h:5273
__hostdev__ ValueType getValue(int i, int j, int k) const
Definition NanoVDB.h:5272
__hostdev__ const RootT & root() const
Definition NanoVDB.h:5221
friend class RootNode
Allow nodes to insert themselves into the cache.
Definition NanoVDB.h:5359
Definition NanoVDB.h:2168
Definition NanoVDB.h:2742
__hostdev__ TileT & operator*() const
Definition NanoVDB.h:2766
TileT * mPos
Definition NanoVDB.h:2746
__hostdev__ TileIter()
Definition NanoVDB.h:2749
TileT * mBegin
Definition NanoVDB.h:2746
__hostdev__ TileIter(DataT *data, uint32_t pos=0)
Definition NanoVDB.h:2750
typename util::match_const< ChildT, DataT >::type NodeT
Definition NanoVDB.h:2745
__hostdev__ bool isChild() const
Definition NanoVDB.h:2781
typename util::match_const< Tile, DataT >::type TileT
Definition NanoVDB.h:2744
TileT * mEnd
Definition NanoVDB.h:2746
__hostdev__ ValueT value() const
Definition NanoVDB.h:2801
__hostdev__ RootData * data() const
Definition NanoVDB.h:2776
__hostdev__ bool isValueOn() const
Definition NanoVDB.h:2791
__hostdev__ bool isValue() const
Definition NanoVDB.h:2786
__hostdev__ NodeT * child() const
Definition NanoVDB.h:2796
__hostdev__ auto pos() const
Definition NanoVDB.h:2760
__hostdev__ TileIter & operator++()
Definition NanoVDB.h:2761
__hostdev__ TileT * operator->() const
Definition NanoVDB.h:2771
__hostdev__ BaseIter(DataT *data)
Definition NanoVDB.h:2917
__hostdev__ BaseIter()
Definition NanoVDB.h:2916
typename util::match_const< Tile, RootT >::type TileT
Definition NanoVDB.h:2914
DataType::template TileIter< DataT > mTileIter
Definition NanoVDB.h:2915
__hostdev__ CoordType getOrigin() const
Definition NanoVDB.h:2923
typename util::match_const< DataType, RootT >::type DataT
Definition NanoVDB.h:2913
__hostdev__ uint32_t pos() const
Definition NanoVDB.h:2921
__hostdev__ TileT * tile() const
Definition NanoVDB.h:2922
__hostdev__ CoordType getCoord() const
Definition NanoVDB.h:2924
Definition NanoVDB.h:2929
__hostdev__ NodeT & operator*() const
Definition NanoVDB.h:2941
__hostdev__ ChildIter operator++(int)
Definition NanoVDB.h:2949
__hostdev__ ChildIter(RootT *parent)
Definition NanoVDB.h:2937
__hostdev__ ChildIter & operator++()
Definition NanoVDB.h:2943
__hostdev__ NodeT * operator->() const
Definition NanoVDB.h:2942
__hostdev__ ChildIter()
Definition NanoVDB.h:2936
Definition NanoVDB.h:3032
__hostdev__ NodeT * probeChild(ValueType &value) const
Definition NanoVDB.h:3040
__hostdev__ DenseIter operator++(int)
Definition NanoVDB.h:3052
__hostdev__ DenseIter & operator++()
Definition NanoVDB.h:3047
__hostdev__ DenseIter()
Definition NanoVDB.h:3038
__hostdev__ DenseIter(RootT *parent)
Definition NanoVDB.h:3039
__hostdev__ bool isValueOn() const
Definition NanoVDB.h:3046
Definition NanoVDB.h:2965
__hostdev__ ValueIter & operator++()
Definition NanoVDB.h:2977
__hostdev__ ValueType operator*() const
Definition NanoVDB.h:2975
__hostdev__ ValueIter operator++(int)
Definition NanoVDB.h:2983
__hostdev__ ValueIter()
Definition NanoVDB.h:2970
__hostdev__ ValueIter(RootT *parent)
Definition NanoVDB.h:2971
__hostdev__ bool isActive() const
Definition NanoVDB.h:2976
Definition NanoVDB.h:2999
__hostdev__ ValueOnIter(RootT *parent)
Definition NanoVDB.h:3005
__hostdev__ ValueOnIter()
Definition NanoVDB.h:3004
__hostdev__ ValueType operator*() const
Definition NanoVDB.h:3009
__hostdev__ ValueOnIter operator++(int)
Definition NanoVDB.h:3016
__hostdev__ ValueOnIter & operator++()
Definition NanoVDB.h:3010
Top-most node of the VDB tree structure.
Definition NanoVDB.h:2888
__hostdev__ const FloatType & stdDeviation() const
Definition NanoVDB.h:3105
__hostdev__ const ValueType & minimum() const
Definition NanoVDB.h:3093
__hostdev__ ConstChildIterator cbeginChild() const
Definition NanoVDB.h:2961
__hostdev__ DenseIterator beginDense()
Definition NanoVDB.h:3063
__hostdev__ const ValueType & maximum() const
Definition NanoVDB.h:3096
static constexpr bool FIXED_SIZE
Definition NanoVDB.h:2905
ChildIter< const RootNode > ConstChildIterator
Definition NanoVDB.h:2958
__hostdev__ DataType * data()
Definition NanoVDB.h:3075
__hostdev__ bool isEmpty() const
Definition NanoVDB.h:3114
__hostdev__ bool isActive(const CoordType &ijk) const
Definition NanoVDB.h:3119
__hostdev__ ConstValueOnIterator cbeginValueOn() const
Definition NanoVDB.h:3028
__hostdev__ ValueIterator beginValue()
Definition NanoVDB.h:2994
friend class ReadAccessor
Definition NanoVDB.h:3149
ChildT UpperNodeType
Definition NanoVDB.h:2894
typename ChildT::CoordType CoordType
Definition NanoVDB.h:2901
static constexpr uint32_t LEVEL
Definition NanoVDB.h:2907
__hostdev__ FloatType variance() const
Definition NanoVDB.h:3102
RootNode & operator=(const RootNode &)=delete
ValueOnIter< RootNode > ValueOnIterator
Definition NanoVDB.h:3024
ValueIter< const RootNode > ConstValueIterator
Definition NanoVDB.h:2992
__hostdev__ OpT::Type get(const CoordType &ijk, ArgsT &&... args) const
Definition NanoVDB.h:3125
RootData< ChildT > DataType
Definition NanoVDB.h:2890
__hostdev__ const uint32_t & tileCount() const
Definition NanoVDB.h:3089
typename DataType::BuildT BuildType
Definition NanoVDB.h:2899
ValueIter< RootNode > ValueIterator
Definition NanoVDB.h:2991
RootNode(const RootNode &)=delete
ChildT ChildNodeType
Definition NanoVDB.h:2891
typename DataType::ValueT ValueType
Definition NanoVDB.h:2897
__hostdev__ ConstDenseIterator cbeginDense() const
Definition NanoVDB.h:3064
RootType RootNodeType
Definition NanoVDB.h:2893
__hostdev__ ConstValueIterator cbeginValueAll() const
Definition NanoVDB.h:2995
RootNode< ChildT > RootType
Definition NanoVDB.h:2892
typename DataType::StatsT FloatType
Definition NanoVDB.h:2898
__hostdev__ const ValueType & background() const
Definition NanoVDB.h:3086
ChildIter< RootNode > ChildIterator
Definition NanoVDB.h:2957
__hostdev__ bool probeValue(const CoordType &ijk, ValueType &v) const
Definition NanoVDB.h:3121
__hostdev__ ValueOnIterator beginValueOn()
Definition NanoVDB.h:3027
__hostdev__ void set(const CoordType &ijk, ArgsT &&... args)
Definition NanoVDB.h:3135
friend class Tree
Definition NanoVDB.h:3152
typename ChildT::LeafNodeType LeafNodeType
Definition NanoVDB.h:2896
DefaultReadAccessor< BuildType > AccessorType
Definition NanoVDB.h:2903
math::BBox< CoordType > BBoxType
Definition NanoVDB.h:2902
ValueOnIter< const RootNode > ConstValueOnIterator
Definition NanoVDB.h:3025
__hostdev__ ConstDenseIterator cbeginChildAll() const
Definition NanoVDB.h:3065
__hostdev__ const BBoxType & bbox() const
Definition NanoVDB.h:3080
typename DataType::Tile Tile
Definition NanoVDB.h:2904
__hostdev__ uint64_t memUsage() const
Definition NanoVDB.h:3111
typename UpperNodeType::ChildNodeType LowerNodeType
Definition NanoVDB.h:2895
__hostdev__ AccessorType getAccessor() const
Definition NanoVDB.h:3073
__hostdev__ const LeafNodeType * probeLeaf(const CoordType &ijk) const
Definition NanoVDB.h:3122
static __hostdev__ uint64_t memUsage(uint32_t tableSize)
Definition NanoVDB.h:3108
__hostdev__ ChildIterator beginChild()
Definition NanoVDB.h:2960
__hostdev__ const DataType * data() const
Definition NanoVDB.h:3077
RootNode()=delete
This class cannot be constructed or deleted.
__hostdev__ const uint32_t & getTableSize() const
Definition NanoVDB.h:3090
__hostdev__ ValueType getValue(const CoordType &ijk) const
Definition NanoVDB.h:3117
__hostdev__ const FloatType & average() const
Definition NanoVDB.h:3099
DenseIter< const RootNode > ConstDenseIterator
Definition NanoVDB.h:3061
DenseIter< RootNode > DenseIterator
Definition NanoVDB.h:3060
__hostdev__ ValueType getValue(int i, int j, int k) const
Definition NanoVDB.h:3118
VDB Tree, which is a thin wrapper around a RootNode.
Definition NanoVDB.h:2478
typename RootT::ChildNodeType Node2
Definition NanoVDB.h:2497
__hostdev__ const NodeT * getFirstNode() const
Definition NanoVDB.h:2588
typename RootType::LeafNodeType LeafNodeType
Definition NanoVDB.h:2490
__hostdev__ DataType * data()
Definition NanoVDB.h:2507
RootT Node3
Definition NanoVDB.h:2496
__hostdev__ bool isActive(const CoordType &ijk) const
Definition NanoVDB.h:2525
static __hostdev__ uint64_t memUsage()
Definition NanoVDB.h:2512
__hostdev__ const NodeTrait< NanoRoot< BuildT >, 2 >::type * getFirstUpper() const
Definition NanoVDB.h:2618
__hostdev__ NanoRoot< BuildT > & root()
Definition NanoVDB.h:2514
__hostdev__ NodeTrait< NanoRoot< BuildT >, 1 >::type * getFirstLower()
Definition NanoVDB.h:2615
__hostdev__ uint32_t nodeCount() const
Definition NanoVDB.h:2557
typename RootNodeType::ChildNodeType UpperNodeType
Definition NanoVDB.h:2488
__hostdev__ LeafNodeType * getFirstLeaf()
Definition NanoVDB.h:2613
Tree()=delete
This class cannot be constructed or deleted.
__hostdev__ const LeafNodeType * getFirstLeaf() const
Definition NanoVDB.h:2614
__hostdev__ const ValueType & background() const
Definition NanoVDB.h:2534
__hostdev__ bool probeValue(const CoordType &ijk, ValueType &v) const
Definition NanoVDB.h:2531
__hostdev__ auto set(const CoordType &ijk, ArgsT &&... args)
Definition NanoVDB.h:2627
RootT RootNodeType
Definition NanoVDB.h:2487
typename RootT::CoordType CoordType
Definition NanoVDB.h:2493
__hostdev__ uint64_t activeVoxelCount() const
Definition NanoVDB.h:2543
DefaultReadAccessor< BuildType > AccessorType
Definition NanoVDB.h:2494
__hostdev__ auto get(const CoordType &ijk, ArgsT &&... args) const
Definition NanoVDB.h:2621
Tree(const Tree &)=delete
LeafNodeType Node0
Definition NanoVDB.h:2499
__hostdev__ NodeTrait< NanoRoot< BuildT >, LEVEL >::type * getFirstNode()
Definition NanoVDB.h:2598
__hostdev__ NodeT * getFirstNode()
Definition NanoVDB.h:2578
typename Node2::ChildNodeType Node1
Definition NanoVDB.h:2498
__hostdev__ uint32_t totalNodeCount() const
Definition NanoVDB.h:2569
RootT RootType
Definition NanoVDB.h:2486
__hostdev__ void extrema(ValueType &min, ValueType &max) const
Tree & operator=(const Tree &)=delete
__hostdev__ const NodeTrait< NanoRoot< BuildT >, 1 >::type * getFirstLower() const
Definition NanoVDB.h:2616
typename UpperNodeType::ChildNodeType LowerNodeType
Definition NanoVDB.h:2489
__hostdev__ AccessorType getAccessor() const
Definition NanoVDB.h:2518
typename RootT::ValueType ValueType
Definition NanoVDB.h:2491
__hostdev__ const NodeTrait< NanoRoot< BuildT >, LEVEL >::type * getFirstNode() const
Definition NanoVDB.h:2607
__hostdev__ uint32_t nodeCount(int level) const
Definition NanoVDB.h:2563
__hostdev__ const uint32_t & activeTileCount(uint32_t level) const
Definition NanoVDB.h:2550
TreeData DataType
Definition NanoVDB.h:2485
__hostdev__ const DataType * data() const
Definition NanoVDB.h:2509
__hostdev__ ValueType getValue(const CoordType &ijk) const
Definition NanoVDB.h:2521
__hostdev__ NodeTrait< NanoRoot< BuildT >, 2 >::type * getFirstUpper()
Definition NanoVDB.h:2617
__hostdev__ ValueType getValue(int i, int j, int k) const
Definition NanoVDB.h:2522
__hostdev__ const NanoRoot< BuildT > & root() const
Definition NanoVDB.h:2516
typename RootT::BuildType BuildType
Definition NanoVDB.h:2492
Dummy type for a voxel whose value equals an offset into an external value array.
Definition NanoVDB.h:177
Dummy type for a voxel whose value equals its binary active state.
Definition NanoVDB.h:183
Dummy type for a voxel whose value equals an offset into an external value array of active values.
Definition NanoVDB.h:180
Bit-compacted representation of all three version numbers.
Definition NanoVDB.h:727
__hostdev__ Version(uint32_t major, uint32_t minor, uint32_t patch)
Constructor from major.minor.patch version numbers.
Definition NanoVDB.h:741
__hostdev__ uint32_t getMajor() const
Definition NanoVDB.h:754
__hostdev__ Version()
Default constructor.
Definition NanoVDB.h:732
static constexpr uint32_t End
Definition NanoVDB.h:730
__hostdev__ bool operator<=(const Version &rhs) const
Definition NanoVDB.h:750
__hostdev__ bool operator==(const Version &rhs) const
Definition NanoVDB.h:748
__hostdev__ Version(uint32_t data)
Constructor from a raw uint32_t data representation.
Definition NanoVDB.h:739
__hostdev__ int age() const
Returns the difference between major version of this instance and NANOVDB_MAJOR_VERSION_NUMBER.
Definition NanoVDB.h:761
__hostdev__ bool isCompatible() const
Definition NanoVDB.h:757
__hostdev__ bool operator>(const Version &rhs) const
Definition NanoVDB.h:751
__hostdev__ uint32_t getMinor() const
Definition NanoVDB.h:755
__hostdev__ bool operator>=(const Version &rhs) const
Definition NanoVDB.h:752
__hostdev__ bool operator<(const Version &rhs) const
Definition NanoVDB.h:749
__hostdev__ uint32_t id() const
Definition NanoVDB.h:753
__hostdev__ uint32_t getPatch() const
Definition NanoVDB.h:756
static constexpr uint32_t StrLen
Definition NanoVDB.h:730
Signed (i, j, k) 32-bit integer coordinate class, similar to openvdb::math::Coord.
Definition Math.h:425
#define __hostdev__
Definition SampleFromVoxels.h:29
Definition NanoVDB.h:6012
void writeUncompressedGrid(StreamT &os, const GridData *gridData, bool raw=false)
This is a standalone alternative to io::writeGrid(...,Codec::NONE) defined in util/IO....
Definition NanoVDB.h:6114
__hostdev__ Codec toCodec(const char *str)
Definition NanoVDB.h:6036
VecT< GridHandleT > readUncompressedGrids(StreamT &is, const typename GridHandleT::BufferType &pool=typename GridHandleT::BufferType())
read all uncompressed grids from a stream and return their handles.
Definition NanoVDB.h:6241
__hostdev__ const char * toStr(char *dst, Codec codec)
Definition NanoVDB.h:6026
Codec
Define compression codecs.
Definition NanoVDB.h:6020
@ StrLen
Definition NanoVDB.h:6024
@ ZIP
Definition NanoVDB.h:6021
@ End
Definition NanoVDB.h:6023
@ BLOSC
Definition NanoVDB.h:6022
@ NONE
Definition NanoVDB.h:6020
void writeUncompressedGrids(const char *fileName, const VecT< GridHandleT > &handles, bool raw=false)
write multiple NanoVDB grids to a single file, without compression.
Definition NanoVDB.h:6213
__hostdev__ constexpr T Pow2(T x) noexcept
Return x * x.
Definition Math.h:258
__hostdev__ constexpr Vec3T matMult(const float *mat, const Vec3T &xyz) noexcept
Multiply a 3x3 matrix and a 3d vector using 32bit floating point arithmetics.
Definition Math.h:2201
__hostdev__ constexpr uint64_t AlignUp(uint64_t byteCount) noexcept
round up byteSize to the nearest wordSize, e.g. to align to machine word: AlignUp<sizeof(size_t)(n)
Definition Math.h:411
__hostdev__ constexpr Vec3T matMultT(const float *mat, const Vec3T &xyz) noexcept
Multiply the transposed of a 3x3 matrix and a 3d vector using 32bit floating point arithmetics.
Definition Math.h:2271
Definition GridChecksum.h:86
size_t strlen(const char *str)
length of a c-sting, excluding '\0'.
Definition Util.h:191
uint32_t countOn(uint64_t v)
Definition Util.h:694
uint32_t findHighestOn(uint32_t v)
Returns the index of the highest, i.e. most significant, on bit in the specified 32 bit word.
Definition Util.h:644
char * strncpy(char *dst, const char *src, size_t max)
Copies the first num characters of src to dst. If the end of the source C string (which is signaled b...
Definition Util.h:223
bool streq(const char *lhs, const char *rhs)
Test if two null-terminated byte strings are the same.
Definition Util.h:306
static DstT * PtrAdd(void *p, int64_t offset)
Adds a byte offset to a non-const pointer to produce another non-const pointer.
Definition Util.h:550
static void * memzero(void *dst, size_t byteCount)
Zero initialization of memory.
Definition Util.h:335
char * strcpy(char *dst, const char *src)
Copy characters from src to dst.
Definition Util.h:204
uint32_t findLowestOn(uint32_t v)
Returns the index of the lowest, i.e. least significant, on bit in the specified 32 bit word.
Definition Util.h:574
static int64_t PtrDiff(const void *p, const void *q)
Compute the distance, in bytes, between two pointers, dist = p - q.
Definition Util.h:536
uint64_t atomicOr(uint64_t *target, uint64_t mask)
Atomically ORs mask into the 64-bit word at target (relaxed ordering). Returns the old value....
Definition Util.h:719
char * sprint(char *dst, T var1, Types... var2)
prints a variable number of string and/or numbers to a destination string
Definition Util.h:324
uint64_t atomicAnd(uint64_t *target, uint64_t mask)
Atomically ANDs mask into the 64-bit word at target (relaxed ordering). Returns the old value....
Definition Util.h:743
Defines a simple memory pool used to call cub functions that use dynamic temporary storage.
Definition GridHandle.h:32
__hostdev__ bool isFloatingPoint(GridType gridType)
return true if the GridType maps to a floating point type
Definition NanoVDB.h:613
math::Vec4< float > Vec4f
Definition Math.h:2832
__hostdev__ auto getAccessor(const GridT &grid, ValueT *sideCar=nullptr)
Generic template functions that return an Accessor to either an index grid or a regular grid.
Definition NanoVDB.h:5981
Grid< Fp4Tree > Fp4Grid
Definition NanoVDB.h:4795
ReadAccessor< BuildT, 0, 1, 2 > DefaultReadAccessor
Definition NanoVDB.h:2171
PointType
Definition NanoVDB.h:399
@ Voxel32
Definition NanoVDB.h:405
@ Grid32
Definition NanoVDB.h:404
@ Voxel8
Definition NanoVDB.h:407
@ Default
Definition NanoVDB.h:408
@ PointID
Definition NanoVDB.h:400
@ World32
Definition NanoVDB.h:402
@ Disable
Definition NanoVDB.h:399
@ Voxel16
Definition NanoVDB.h:406
@ World64
Definition NanoVDB.h:401
@ Grid64
Definition NanoVDB.h:403
auto callNanoGrid(GridDataT *gridData, ArgsT &&... args)
Below is an example of the struct used for generic programming with callNanoGrid.
Definition NanoVDB.h:4845
__hostdev__ constexpr uint32_t strlen()
return the number of characters (including null termination) required to convert enum type to a strin...
Definition NanoVDB.h:213
Grid< Vec4fTree > Vec4fGrid
Definition NanoVDB.h:4805
Grid< NanoTree< BuildT > > NanoGrid
Definition NanoVDB.h:4739
__hostdev__ CheckMode toCheckMode(const Checksum &checksum)
Maps 64 bit checksum to CheckMode enum.
Definition NanoVDB.h:1945
__hostdev__ GridType toGridType()
Maps from a templated build type to a GridType enum.
Definition NanoVDB.h:848
typename NodeTrait< GridOrTreeOrRootT, LEVEL >::type NodeTraitT
Definition NanoVDB.h:1783
__hostdev__ char * toStr(char *dst, GridType gridType)
Maps a GridType to a c-string.
Definition NanoVDB.h:257
NanoTree< Vec3i > Vec3ITree
Definition NanoVDB.h:4787
Grid< Fp16Tree > Fp16Grid
Definition NanoVDB.h:4797
Grid< FloatTree > FloatGrid
Definition NanoVDB.h:4794
math::Vec3< uint16_t > Vec3u16
Definition Math.h:2828
math::Vec3< uint8_t > Vec3u8
Definition Math.h:2827
Grid< Vec3fTree > Vec3fGrid
Definition NanoVDB.h:4803
__hostdev__ bool isInteger(GridType gridType)
Return true if the GridType maps to a POD integer type.
Definition NanoVDB.h:639
__hostdev__ GridClass toGridClass(GridBlindDataSemantic semantics, GridClass defaultClass=GridClass::Unknown)
Maps from GridBlindDataSemantic to GridClass.
Definition NanoVDB.h:452
InternalNode< NanoLeaf< BuildT >, 4 > NanoLower
Definition NanoVDB.h:4731
Grid< Vec4dTree > Vec4dGrid
Definition NanoVDB.h:4806
typename GridTree< GridT >::type GridTreeT
Definition NanoVDB.h:2471
__hostdev__ MagicType toMagic(uint64_t magic)
maps 64 bits of magic number to enum
Definition NanoVDB.h:370
Grid< BoolTree > BoolGrid
Definition NanoVDB.h:4809
math::Vec3< float > Vec3f
Definition Math.h:2824
InternalNode< NanoLower< BuildT >, 5 > NanoUpper
Definition NanoVDB.h:4733
GridClass
Classes (superset of OpenVDB) that are currently supported by NanoVDB.
Definition NanoVDB.h:292
@ FogVolume
Definition NanoVDB.h:294
@ TensorGrid
Definition NanoVDB.h:301
@ VoxelVolume
Definition NanoVDB.h:299
@ End
Definition NanoVDB.h:303
@ Unknown
Definition NanoVDB.h:292
@ Topology
Definition NanoVDB.h:298
@ VoxelBVH
Definition NanoVDB.h:302
@ PointIndex
Definition NanoVDB.h:296
@ IndexGrid
Definition NanoVDB.h:300
@ PointData
Definition NanoVDB.h:297
@ Staggered
Definition NanoVDB.h:295
@ LevelSet
Definition NanoVDB.h:293
GridType
List of types that are currently supported by NanoVDB.
Definition NanoVDB.h:223
@ Vec3u8
Definition NanoVDB.h:247
@ Float
Definition NanoVDB.h:224
@ Boolean
Definition NanoVDB.h:234
@ Vec4f
Definition NanoVDB.h:240
@ Int16
Definition NanoVDB.h:226
@ StrLen
Definition NanoVDB.h:251
@ Fp4
Definition NanoVDB.h:236
@ Mask
Definition NanoVDB.h:231
@ Vec3u16
Definition NanoVDB.h:248
@ Vec4d
Definition NanoVDB.h:241
@ Fp8
Definition NanoVDB.h:237
@ End
Definition NanoVDB.h:250
@ Unknown
Definition NanoVDB.h:223
@ Index
Definition NanoVDB.h:242
@ FpN
Definition NanoVDB.h:239
@ UInt8
Definition NanoVDB.h:249
@ RGBA8
Definition NanoVDB.h:235
@ Int32
Definition NanoVDB.h:227
@ OnIndex
Definition NanoVDB.h:243
@ Half
Definition NanoVDB.h:232
@ PointIndex
Definition NanoVDB.h:246
@ Vec3d
Definition NanoVDB.h:230
@ Double
Definition NanoVDB.h:225
@ UInt32
Definition NanoVDB.h:233
@ Vec3f
Definition NanoVDB.h:229
@ Int64
Definition NanoVDB.h:228
@ Fp16
Definition NanoVDB.h:238
CheckMode
List of different modes for computing for a checksum.
Definition NanoVDB.h:1843
@ Partial
Definition NanoVDB.h:1846
@ Full
Definition NanoVDB.h:1848
@ Disable
Definition NanoVDB.h:1843
@ Half
Definition NanoVDB.h:1845
@ Empty
Definition NanoVDB.h:1844
Grid< Vec3dTree > Vec3dGrid
Definition NanoVDB.h:4804
typename NanoNode< BuildT, LEVEL >::type NanoNodeT
Definition NanoVDB.h:4772
Grid< Point > PointGrid
Definition NanoVDB.h:4810
RootNode< NanoUpper< BuildT > > NanoRoot
Definition NanoVDB.h:4735
typename util::conditional< BuildTraits< BuildT >::is_index, ChannelAccessor< ValueT, BuildT >, DefaultReadAccessor< BuildT > >::type AccType
Generic Accessor type that maps to either a ReadAccessor or ChannelAccessor.
Definition NanoVDB.h:5976
ReadAccessor< ValueT, LEVEL0, LEVEL1, LEVEL2 > createAccessor(const NanoGrid< ValueT > &grid)
Free-standing function for convenient creation of a ReadAccessor with optional and customizable node ...
Definition NanoVDB.h:5646
NanoTree< ValueMask > MaskTree
Definition NanoVDB.h:4788
GridFlags
Grid flags which indicate what extra information is present in the grid buffer.
Definition NanoVDB.h:331
@ HasAverage
Definition NanoVDB.h:335
@ HasStdDeviation
Definition NanoVDB.h:336
@ HasLongGridName
Definition NanoVDB.h:332
@ HasMinMax
Definition NanoVDB.h:334
@ End
Definition NanoVDB.h:338
@ HasBBox
Definition NanoVDB.h:333
@ IsBreadthFirst
Definition NanoVDB.h:337
Grid< OnIndexTree > OnIndexGrid
Definition NanoVDB.h:4812
Grid< Vec3ITree > Vec3IGrid
Definition NanoVDB.h:4807
Grid< Fp8Tree > Fp8Grid
Definition NanoVDB.h:4796
__hostdev__ GridBlindDataSemantic toSemantic(GridClass gridClass, GridBlindDataSemantic defaultSemantic=GridBlindDataSemantic::Unknown)
Maps from GridClass to GridBlindDataSemantic.
Definition NanoVDB.h:486
Grid< Int64Tree > Int64Grid
Definition NanoVDB.h:4802
Tree< NanoRoot< BuildT > > NanoTree
Definition NanoVDB.h:4737
__hostdev__ GridType mapToGridType()
Definition NanoVDB.h:904
NanoTree< int32_t > Int32Tree
Definition NanoVDB.h:4780
LeafNode< BuildT, Coord, Mask, 3 > NanoLeaf
Template specializations to the default configuration used in OpenVDB: Root -> 32^3 -> 16^3 -> 8^3.
Definition NanoVDB.h:4729
NanoTree< ValueOnIndex > OnIndexTree
Definition NanoVDB.h:4791
NanoTree< Half > HalfTree
Definition NanoVDB.h:4792
GridBlindDataClass
Blind-data Classes that are currently supported by NanoVDB.
Definition NanoVDB.h:414
@ ChannelArray
Definition NanoVDB.h:418
@ End
Definition NanoVDB.h:419
@ IndexArray
Definition NanoVDB.h:415
@ AttributeArray
Definition NanoVDB.h:416
@ GridName
Definition NanoVDB.h:417
NanoTree< double > DoubleTree
Definition NanoVDB.h:4779
NanoTree< ValueIndex > IndexTree
Definition NanoVDB.h:4790
__hostdev__ bool isFloatingPointVector(GridType gridType)
return true if the GridType maps to a floating point vec3.
Definition NanoVDB.h:627
NanoTree< Vec4d > Vec4dTree
Definition NanoVDB.h:4786
Grid< UInt32Tree > UInt32Grid
Definition NanoVDB.h:4801
NanoTree< Fp8 > Fp8Tree
Definition NanoVDB.h:4776
static __hostdev__ bool isAligned(const void *p)
return true if the specified pointer is 32 byte aligned
Definition NanoVDB.h:597
math::BBox< Vec3d > Vec3dBBox
Definition Math.h:2836
MagicType
Enums used to identify magic numbers recognized by NanoVDB.
Definition NanoVDB.h:361
@ OpenVDB
Definition NanoVDB.h:362
@ NanoGrid
Definition NanoVDB.h:364
@ Unknown
Definition NanoVDB.h:361
@ NanoVDB
Definition NanoVDB.h:363
@ NanoFile
Definition NanoVDB.h:365
typename BuildToValueMap< T >::type BuildToValueMapT
Definition NanoVDB.h:592
NanoTree< int64_t > Int64Tree
Definition NanoVDB.h:4782
__hostdev__ bool isValid(GridType gridType, GridClass gridClass)
return true if the combination of GridType and GridClass is valid.
Definition NanoVDB.h:661
NanoTree< Vec4f > Vec4fTree
Definition NanoVDB.h:4785
NanoTree< Vec3d > Vec3dTree
Definition NanoVDB.h:4784
NanoTree< Fp16 > Fp16Tree
Definition NanoVDB.h:4777
Grid< MaskTree > MaskGrid
Definition NanoVDB.h:4808
static __hostdev__ uint64_t alignmentPadding(const void *p)
return the smallest number of bytes that when added to the specified pointer results in a 32 byte ali...
Definition NanoVDB.h:600
NanoTree< FpN > FpNTree
Definition NanoVDB.h:4778
math::Vec3< double > Vec3d
Definition Math.h:2823
__hostdev__ bool isIndex(GridType gridType)
Return true if the GridType maps to a special index type (not a POD integer type).
Definition NanoVDB.h:652
math::BBox< Coord > CoordBBox
Definition Math.h:2835
Grid< HalfTree > HalfGrid
Definition NanoVDB.h:4813
math::Vec4< double > Vec4d
Definition Math.h:2831
static __hostdev__ T * alignPtr(T *p)
offset the specified pointer so it is 32 byte aligned. Works with both const and non-const pointers.
Definition NanoVDB.h:608
Grid< IndexTree > IndexGrid
Definition NanoVDB.h:4811
GridBlindDataSemantic
Blind-data Semantics that are currently understood by NanoVDB.
Definition NanoVDB.h:422
@ GaussianId
Definition NanoVDB.h:442
@ PointQuat
Definition NanoVDB.h:436
@ TriangleId
Definition NanoVDB.h:441
@ FogVolume
Definition NanoVDB.h:433
@ PointRadius
Definition NanoVDB.h:426
@ LineId
Definition NanoVDB.h:440
@ PointOpacity
Definition NanoVDB.h:435
@ PointPosition
Definition NanoVDB.h:423
@ PointColor
Definition NanoVDB.h:424
@ VoxelCoords
Definition NanoVDB.h:431
@ PointVelocity
Definition NanoVDB.h:427
@ End
Definition NanoVDB.h:445
@ Unknown
Definition NanoVDB.h:422
@ GridCoords
Definition NanoVDB.h:430
@ WorldCoords
Definition NanoVDB.h:429
@ VoxelBVH
Definition NanoVDB.h:444
@ PointNormal
Definition NanoVDB.h:425
@ PointSH0
Definition NanoVDB.h:438
@ PointSHN
Definition NanoVDB.h:439
@ Staggered
Definition NanoVDB.h:434
@ LevelSet
Definition NanoVDB.h:432
@ PointScale
Definition NanoVDB.h:437
@ PointId
Definition NanoVDB.h:428
Grid< Int32Tree > Int32Grid
Definition NanoVDB.h:4800
NanoTree< Vec3f > Vec3fTree
Definition NanoVDB.h:4783
NanoTree< bool > BoolTree
Definition NanoVDB.h:4789
NanoTree< uint32_t > UInt32Tree
Definition NanoVDB.h:4781
__hostdev__ GridClass mapToGridClass(GridClass defaultClass=GridClass::Unknown)
Definition NanoVDB.h:926
Grid< DoubleTree > DoubleGrid
Definition NanoVDB.h:4799
Grid< FpNTree > FpNGrid
Definition NanoVDB.h:4798
NanoTree< float > FloatTree
Definition NanoVDB.h:4774
NanoTree< Fp4 > Fp4Tree
Definition NanoVDB.h:4775
Math functions and classes.
#define NANOVDB_HOSTDEV_DISABLE_WARNING
Definition Util.h:106
#define NANOVDB_ASSERT(x)
Definition Util.h:53
Policy that exactly matches separate getDim and isActive calls. A skip flag still controls dim but ca...
Definition NanoVDB.h:1831
Policy that preserves getDim's skip-flag fast path. If an InternalNode short-circuits,...
Definition NanoVDB.h:1838
uint16_t mFlags
Definition NanoVDB.h:943
uint32_t mFlags
Definition NanoVDB.h:948
uint64_t mFlags
Definition NanoVDB.h:953
uint8_t mFlags
Definition NanoVDB.h:938
float type
Definition NanoVDB.h:574
float Type
Definition NanoVDB.h:573
float type
Definition NanoVDB.h:560
float Type
Definition NanoVDB.h:559
float type
Definition NanoVDB.h:567
float Type
Definition NanoVDB.h:566
float type
Definition NanoVDB.h:581
float Type
Definition NanoVDB.h:580
uint64_t Type
Definition NanoVDB.h:587
uint64_t type
Definition NanoVDB.h:588
uint64_t Type
Definition NanoVDB.h:538
uint64_t type
Definition NanoVDB.h:539
bool Type
Definition NanoVDB.h:552
bool type
Definition NanoVDB.h:553
uint64_t Type
Definition NanoVDB.h:545
uint64_t type
Definition NanoVDB.h:546
Maps one type (e.g. the build types above) to other (actual) types.
Definition NanoVDB.h:530
T Type
Definition NanoVDB.h:531
T type
Definition NanoVDB.h:532
Define static boolean tests for template build types.
Definition NanoVDB.h:510
static constexpr bool is_offindex
Definition NanoVDB.h:514
static constexpr bool is_onindex
Definition NanoVDB.h:513
static constexpr bool is_index
Definition NanoVDB.h:512
static constexpr bool is_Fp
Definition NanoVDB.h:518
static constexpr bool is_float
Definition NanoVDB.h:520
static constexpr bool is_special
Definition NanoVDB.h:522
static constexpr bool is_FpX
Definition NanoVDB.h:516
Result of a fused ReadAccessor::getDimAndActive traversal: the getDim(ijk, ray) step size and the pol...
Definition NanoVDB.h:1812
uint32_t packed
Definition NanoVDB.h:1813
__hostdev__ DimAndActive()
Definition NanoVDB.h:1815
__hostdev__ uint32_t dim() const
Definition NanoVDB.h:1822
__hostdev__ bool active() const
Definition NanoVDB.h:1823
__hostdev__ DimAndActive(uint32_t d, bool a)
Definition NanoVDB.h:1816
double FloatType
Definition NanoVDB.h:841
double FloatType
Definition NanoVDB.h:811
uint64_t FloatType
Definition NanoVDB.h:823
bool FloatType
Definition NanoVDB.h:835
uint64_t FloatType
Definition NanoVDB.h:829
bool FloatType
Definition NanoVDB.h:817
float FloatType
Definition NanoVDB.h:805
Implements Tree::getDim(math::Coord)
Definition NanoVDB.h:6412
static __hostdev__ Type get(const NanoUpper< BuildT > &, uint32_t)
Definition NanoVDB.h:6417
static __hostdev__ Type get(const typename NanoRoot< BuildT >::Tile &)
Definition NanoVDB.h:6416
uint32_t Type
Definition NanoVDB.h:6413
static __hostdev__ Type get(const NanoLower< BuildT > &, uint32_t)
Definition NanoVDB.h:6418
static constexpr int LEVEL
Definition NanoVDB.h:6414
static __hostdev__ Type get(const NanoLeaf< BuildT > &, uint32_t)
Definition NanoVDB.h:6419
static __hostdev__ Type get(const NanoRoot< BuildT > &)
Definition NanoVDB.h:6415
Return the pointer to the leaf node that contains math::Coord. Implements Tree::probeLeaf(math::Coord...
Definition NanoVDB.h:6426
static __hostdev__ Type get(const NanoUpper< BuildT > &, uint32_t)
Definition NanoVDB.h:6431
static __hostdev__ Type get(const typename NanoRoot< BuildT >::Tile &)
Definition NanoVDB.h:6430
static __hostdev__ Type get(const NanoLower< BuildT > &, uint32_t)
Definition NanoVDB.h:6432
static constexpr int LEVEL
Definition NanoVDB.h:6428
const NanoLeaf< BuildT > * Type
Definition NanoVDB.h:6427
static __hostdev__ Type get(const NanoRoot< BuildT > &)
Definition NanoVDB.h:6429
static __hostdev__ Type get(const NanoLeaf< BuildT > &leaf, uint32_t)
Definition NanoVDB.h:6433
Return point to the lower internal node where math::Coord maps to one of its values,...
Definition NanoVDB.h:6440
const NanoLower< BuildT > * Type
Definition NanoVDB.h:6441
static __hostdev__ Type get(const NanoUpper< BuildT > &, uint32_t)
Definition NanoVDB.h:6445
static __hostdev__ Type get(const NanoLower< BuildT > &node, uint32_t)
Definition NanoVDB.h:6446
static __hostdev__ Type get(const typename NanoRoot< BuildT >::Tile &)
Definition NanoVDB.h:6444
static constexpr int LEVEL
Definition NanoVDB.h:6442
static __hostdev__ Type get(const NanoRoot< BuildT > &)
Definition NanoVDB.h:6443
Definition NanoVDB.h:6515
uint32_t level
Definition NanoVDB.h:6516
FloatType average
Definition NanoVDB.h:6518
ValueType maximum
Definition NanoVDB.h:6517
CoordBBox bbox
Definition NanoVDB.h:6519
ValueType minimum
Definition NanoVDB.h:6517
uint32_t dim
Definition NanoVDB.h:6516
FloatType stdDevi
Definition NanoVDB.h:6518
Implements Tree::getNodeInfo(math::Coord)
Definition NanoVDB.h:6511
static __hostdev__ Type get(const NanoUpper< BuildT > &node, uint32_t n)
Definition NanoVDB.h:6531
static __hostdev__ Type get(const typename NanoRoot< BuildT >::Tile &tile)
Definition NanoVDB.h:6527
static __hostdev__ Type get(const NanoLeaf< BuildT > &leaf, uint32_t n)
Definition NanoVDB.h:6539
typename NanoLeaf< BuildT >::ValueType ValueType
Definition NanoVDB.h:6512
static constexpr int LEVEL
Definition NanoVDB.h:6521
NodeInfo Type
Definition NanoVDB.h:6522
typename NanoLeaf< BuildT >::FloatType FloatType
Definition NanoVDB.h:6513
static __hostdev__ Type get(const NanoRoot< BuildT > &root)
Definition NanoVDB.h:6523
static __hostdev__ Type get(const NanoLower< BuildT > &node, uint32_t n)
Definition NanoVDB.h:6535
Implements Tree::isActive(math::Coord)
Definition NanoVDB.h:6398
static __hostdev__ Type get(const NanoUpper< BuildT > &node, uint32_t n)
Definition NanoVDB.h:6403
bool Type
Definition NanoVDB.h:6399
static __hostdev__ Type get(const typename NanoRoot< BuildT >::Tile &tile)
Definition NanoVDB.h:6402
static __hostdev__ Type get(const NanoLeaf< BuildT > &leaf, uint32_t n)
Definition NanoVDB.h:6405
static constexpr int LEVEL
Definition NanoVDB.h:6400
static __hostdev__ Type get(const NanoRoot< BuildT > &)
Definition NanoVDB.h:6401
static __hostdev__ Type get(const NanoLower< BuildT > &node, uint32_t n)
Definition NanoVDB.h:6404
Return point to the root Tile where math::Coord maps to one of its values, i.e. terminates.
Definition NanoVDB.h:6465
static __hostdev__ Type get(const typename NanoRoot< BuildT >::Tile &tile)
Definition NanoVDB.h:6469
static constexpr int LEVEL
Definition NanoVDB.h:6467
static __hostdev__ Type get(const NanoRoot< BuildT > &)
Definition NanoVDB.h:6468
const typename NanoRoot< BuildT >::Tile * Type
Definition NanoVDB.h:6466
Return point to the upper internal node where math::Coord maps to one of its values,...
Definition NanoVDB.h:6453
static __hostdev__ Type get(const NanoUpper< BuildT > &node, uint32_t)
Definition NanoVDB.h:6458
static __hostdev__ Type get(const typename NanoRoot< BuildT >::Tile &)
Definition NanoVDB.h:6457
static constexpr int LEVEL
Definition NanoVDB.h:6455
const NanoUpper< BuildT > * Type
Definition NanoVDB.h:6454
static __hostdev__ Type get(const NanoRoot< BuildT > &)
Definition NanoVDB.h:6456
Below is an example of a struct used for random get methods.
Definition NanoVDB.h:6358
static __hostdev__ Type get(const NanoUpper< BuildT > &node, uint32_t n)
Definition NanoVDB.h:6363
static __hostdev__ Type get(const typename NanoRoot< BuildT >::Tile &tile)
Definition NanoVDB.h:6362
static __hostdev__ Type get(const NanoLeaf< BuildT > &leaf, uint32_t n)
Definition NanoVDB.h:6365
static constexpr int LEVEL
Definition NanoVDB.h:6360
static __hostdev__ Type get(const NanoRoot< BuildT > &root)
Definition NanoVDB.h:6361
static __hostdev__ Type get(const NanoLower< BuildT > &node, uint32_t n)
Definition NanoVDB.h:6364
typename NanoLeaf< BuildT >::ValueType Type
Definition NanoVDB.h:6359
Struct with all the member data of the Grid (useful during serialization of an openvdb grid)
Definition NanoVDB.h:1974
__hostdev__ Vec3T applyInverseJacobian(const Vec3T &xyz) const
Definition NanoVDB.h:2063
__hostdev__ bool isEmpty() const
test if the grid is empty, e.i the root table has size 0
Definition NanoVDB.h:2159
__hostdev__ bool isRootConnected() const
return true if RootData follows TreeData in memory without any extra padding
Definition NanoVDB.h:2163
static __hostdev__ uint64_t memUsage()
Return memory usage in bytes for this class only.
Definition NanoVDB.h:2142
uint32_t mBlindMetadataCount
Definition NanoVDB.h:1990
__hostdev__ const void * treePtr() const
Definition NanoVDB.h:2082
Version mVersion
Definition NanoVDB.h:1978
uint32_t mData0
Definition NanoVDB.h:1991
__hostdev__ uint32_t nodeCount() const
Return number of nodes at LEVEL.
Definition NanoVDB.h:2110
GridType mGridType
Definition NanoVDB.h:1988
__hostdev__ void setMinMaxOn(bool on=true)
Definition NanoVDB.h:2044
uint64_t mMagic
Definition NanoVDB.h:1976
__hostdev__ void * nodePtr()
Return a non-const void pointer to the first node at LEVEL.
Definition NanoVDB.h:2099
__hostdev__ Vec3T applyIJTF(const Vec3T &xyz) const
Definition NanoVDB.h:2076
GridClass mGridClass
Definition NanoVDB.h:1987
__hostdev__ void setBBoxOn(bool on=true)
Definition NanoVDB.h:2045
__hostdev__ void setLongGridNameOn(bool on=true)
Definition NanoVDB.h:2046
uint64_t mGridSize
Definition NanoVDB.h:1982
__hostdev__ const GridBlindMetaData * blindMetaData(uint32_t n) const
Returns a const reference to the blindMetaData at the specified linear offset.
Definition NanoVDB.h:2119
__hostdev__ Vec3T applyInverseJacobianF(const Vec3T &xyz) const
Definition NanoVDB.h:2074
__hostdev__ bool isValid() const
return true if the magic number and the version are both valid
Definition NanoVDB.h:2031
__hostdev__ Vec3T applyInverseMapF(const Vec3T &xyz) const
Definition NanoVDB.h:2070
__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)
Definition NanoVDB.h:1997
GridData & operator=(const GridData &)=default
Use this method to initiate most member data.
__hostdev__ const CoordBBox & indexBBox() const
return AABB of active values in index space
Definition NanoVDB.h:2148
Checksum mChecksum
Definition NanoVDB.h:1977
Vec3dBBox mWorldBBox
Definition NanoVDB.h:1985
__hostdev__ uint32_t rootTableSize() const
return the root table has size
Definition NanoVDB.h:2151
__hostdev__ const char * gridName() const
Definition NanoVDB.h:2125
__hostdev__ Vec3T applyIJT(const Vec3T &xyz) const
Definition NanoVDB.h:2065
uint64_t mData1
Definition NanoVDB.h:1992
uint32_t mGridCount
Definition NanoVDB.h:1981
__hostdev__ const void * nodePtr() const
Return a non-const void pointer to the first node at LEVEL.
Definition NanoVDB.h:2087
__hostdev__ void setStdDeviationOn(bool on=true)
Definition NanoVDB.h:2048
__hostdev__ Vec3T applyMap(const Vec3T &xyz) const
Definition NanoVDB.h:2057
uint64_t mData2
Definition NanoVDB.h:1993
__hostdev__ Vec3T applyJacobianF(const Vec3T &xyz) const
Definition NanoVDB.h:2072
__hostdev__ Vec3T applyInverseMap(const Vec3T &xyz) const
Definition NanoVDB.h:2059
Map mMap
Definition NanoVDB.h:1984
__hostdev__ const Vec3dBBox & worldBBox() const
return AABB of active values in world space
Definition NanoVDB.h:2145
__hostdev__ Vec3T applyJacobian(const Vec3T &xyz) const
Definition NanoVDB.h:2061
Vec3d mVoxelSize
Definition NanoVDB.h:1986
BitFlags< 32 > mFlags
Definition NanoVDB.h:1979
char mGridName[MaxNameSize]
Definition NanoVDB.h:1983
int64_t mBlindMetadataOffset
Definition NanoVDB.h:1989
uint32_t mGridIndex
Definition NanoVDB.h:1980
static const int MaxNameSize
Definition NanoVDB.h:1975
__hostdev__ void * treePtr()
Definition NanoVDB.h:2079
__hostdev__ Vec3T applyMapF(const Vec3T &xyz) const
Definition NanoVDB.h:2068
__hostdev__ bool setGridName(const char *src)
Definition NanoVDB.h:2049
__hostdev__ void setAverageOn(bool on=true)
Definition NanoVDB.h:2047
const typename GridT::TreeType Type
Definition NanoVDB.h:2466
const typename GridT::TreeType type
Definition NanoVDB.h:2467
defines a tree type from a grid type while preserving constness
Definition NanoVDB.h:2459
typename GridT::TreeType Type
Definition NanoVDB.h:2460
typename GridT::TreeType type
Definition NanoVDB.h:2461
StatsT mAverage
Definition NanoVDB.h:3254
typename ChildT::CoordType CoordT
Definition NanoVDB.h:3232
__hostdev__ void setMin(const ValueT &v)
Definition NanoVDB.h:3324
__hostdev__ const StatsT & average() const
Definition NanoVDB.h:3313
static constexpr bool FIXED_SIZE
Definition NanoVDB.h:3234
__hostdev__ const ValueT & getMin() const
Definition NanoVDB.h:3311
MaskT mChildMask
Definition NanoVDB.h:3250
static __hostdev__ uint64_t memUsage()
Definition NanoVDB.h:3267
__hostdev__ const ValueT & getMax() const
Definition NanoVDB.h:3312
__hostdev__ void setDev(const StatsT &v)
Definition NanoVDB.h:3327
math::BBox< CoordT > mBBox
Definition NanoVDB.h:3247
InternalData(const InternalData &)=delete
__hostdev__ void setChild(uint32_t n, const void *ptr)
Definition NanoVDB.h:3269
typename ChildT::FloatType StatsT
Definition NanoVDB.h:3231
__hostdev__ void setAvg(const StatsT &v)
Definition NanoVDB.h:3326
__hostdev__ bool isChild(uint32_t n) const
Definition NanoVDB.h:3306
__hostdev__ void setValue(uint32_t n, const ValueT &v)
Definition NanoVDB.h:3276
typename ChildT::BuildType BuildT
Definition NanoVDB.h:3230
static __hostdev__ constexpr uint32_t padding()
Return padding of this class in bytes, due to aliasing and 32B alignment.
Definition NanoVDB.h:3261
StatsT mStdDevi
Definition NanoVDB.h:3255
Tile mTable[1u<<(3 *LOG2DIM)]
Definition NanoVDB.h:3265
__hostdev__ void setMax(const ValueT &v)
Definition NanoVDB.h:3325
__hostdev__ void setOrigin(const T &ijk)
Definition NanoVDB.h:3309
__hostdev__ ChildT * getChild(uint32_t n)
Returns a pointer to the child node at the specifed linear offset.
Definition NanoVDB.h:3283
ValueT mMaximum
Definition NanoVDB.h:3253
__hostdev__ bool isActive(uint32_t n) const
Definition NanoVDB.h:3300
MaskT mValueMask
Definition NanoVDB.h:3249
typename ChildT::template MaskType< LOG2DIM > MaskT
Definition NanoVDB.h:3233
__hostdev__ ValueT getValue(uint32_t n) const
Definition NanoVDB.h:3294
__hostdev__ const StatsT & stdDeviation() const
Definition NanoVDB.h:3314
InternalData & operator=(const InternalData &)=delete
typename ChildT::ValueType ValueT
Definition NanoVDB.h:3229
__hostdev__ const ChildT * getChild(uint32_t n) const
Definition NanoVDB.h:3288
ValueT mMinimum
Definition NanoVDB.h:3252
InternalData()=delete
This class cannot be constructed or deleted.
uint64_t mFlags
Definition NanoVDB.h:3248
static __hostdev__ constexpr uint64_t memUsage()
Definition NanoVDB.h:3977
static constexpr bool FIXED_SIZE
Definition NanoVDB.h:3974
__hostdev__ float getValue(uint32_t i) const
Definition NanoVDB.h:3985
Fp16 BuildType
Definition NanoVDB.h:3972
uint16_t mCode[1u<< 3 *LOG2DIM]
Definition NanoVDB.h:3975
LeafData & operator=(const LeafData &)=delete
LeafData(const LeafData &)=delete
static __hostdev__ constexpr uint32_t padding()
Definition NanoVDB.h:3978
uint16_t ArrayType
Definition NanoVDB.h:3973
LeafData()=delete
This class cannot be constructed or deleted.
LeafFnBase< CoordT, MaskT, LOG2DIM > BaseT
Definition NanoVDB.h:3971
static __hostdev__ constexpr uint8_t bitWidth()
Definition NanoVDB.h:3984
static __hostdev__ constexpr uint64_t memUsage()
Definition NanoVDB.h:3910
static constexpr bool FIXED_SIZE
Definition NanoVDB.h:3907
__hostdev__ float getValue(uint32_t i) const
Definition NanoVDB.h:3918
LeafData & operator=(const LeafData &)=delete
LeafData(const LeafData &)=delete
uint8_t mCode[1u<<(3 *LOG2DIM - 1)]
Definition NanoVDB.h:3908
static __hostdev__ constexpr uint32_t padding()
Definition NanoVDB.h:3911
LeafData()=delete
This class cannot be constructed or deleted.
LeafFnBase< CoordT, MaskT, LOG2DIM > BaseT
Definition NanoVDB.h:3904
uint8_t ArrayType
Definition NanoVDB.h:3906
Fp4 BuildType
Definition NanoVDB.h:3905
static __hostdev__ constexpr uint8_t bitWidth()
Definition NanoVDB.h:3917
static constexpr bool FIXED_SIZE
Definition NanoVDB.h:3944
__hostdev__ float getValue(uint32_t i) const
Definition NanoVDB.h:3954
LeafData & operator=(const LeafData &)=delete
LeafData(const LeafData &)=delete
static __hostdev__ constexpr uint32_t padding()
Definition NanoVDB.h:3947
LeafData()=delete
This class cannot be constructed or deleted.
Fp8 BuildType
Definition NanoVDB.h:3942
LeafFnBase< CoordT, MaskT, LOG2DIM > BaseT
Definition NanoVDB.h:3941
uint8_t ArrayType
Definition NanoVDB.h:3943
static __hostdev__ constexpr int64_t memUsage()
Definition NanoVDB.h:3946
uint8_t mCode[1u<< 3 *LOG2DIM]
Definition NanoVDB.h:3945
static __hostdev__ constexpr uint8_t bitWidth()
Definition NanoVDB.h:3953
FpN BuildType
Definition NanoVDB.h:4005
static constexpr bool FIXED_SIZE
Definition NanoVDB.h:4006
__hostdev__ float getValue(uint32_t i) const
Definition NanoVDB.h:4016
static __hostdev__ size_t memUsage(uint32_t bitWidth)
Definition NanoVDB.h:4015
__hostdev__ uint8_t bitWidth() const
Definition NanoVDB.h:4013
LeafData & operator=(const LeafData &)=delete
LeafData(const LeafData &)=delete
static __hostdev__ constexpr uint32_t padding()
Definition NanoVDB.h:4007
LeafData()=delete
This class cannot be constructed or deleted.
LeafFnBase< CoordT, MaskT, LOG2DIM > BaseT
Definition NanoVDB.h:4004
__hostdev__ size_t memUsage() const
Definition NanoVDB.h:4014
uint64_t mOffset
Definition NanoVDB.h:4270
uint16_t mValues[1u<< 3 *LOG2DIM]
Definition NanoVDB.h:4272
static constexpr bool FIXED_SIZE
Definition NanoVDB.h:4263
__hostdev__ void setMin(const ValueType &)
Definition NanoVDB.h:4302
static __hostdev__ uint64_t memUsage()
Definition NanoVDB.h:4282
__hostdev__ void setDev(const FloatType &)
Definition NanoVDB.h:4305
__hostdev__ void setValueOnly(uint32_t offset, uint16_t value)
Definition NanoVDB.h:4289
uint64_t ValueType
Definition NanoVDB.h:4259
__hostdev__ uint64_t last(uint32_t i) const
Definition NanoVDB.h:4287
uint8_t mFlags
Definition NanoVDB.h:4267
LeafData & operator=(const LeafData &)=delete
__hostdev__ void setValue(uint32_t offset, uint16_t value)
Definition NanoVDB.h:4290
LeafData(const LeafData &)=delete
MaskT< LOG2DIM > mValueMask
Definition NanoVDB.h:4268
CoordT mBBoxMin
Definition NanoVDB.h:4265
uint8_t mBBoxDif[3]
Definition NanoVDB.h:4266
__hostdev__ void setOn(uint32_t offset)
Definition NanoVDB.h:4295
static __hostdev__ constexpr uint32_t padding()
Return padding of this class in bytes, due to aliasing and 32B alignment.
Definition NanoVDB.h:4278
Point BuildType
Definition NanoVDB.h:4260
__hostdev__ void setAvg(const FloatType &)
Definition NanoVDB.h:4304
uint16_t ArrayType
Definition NanoVDB.h:4262
__hostdev__ ValueType getMax() const
Definition NanoVDB.h:4298
typename FloatTraits< ValueType >::FloatType FloatType
Definition NanoVDB.h:4261
__hostdev__ uint64_t offset() const
Definition NanoVDB.h:4284
LeafData()=delete
This class cannot be constructed or deleted.
__hostdev__ uint64_t first(uint32_t i) const
Definition NanoVDB.h:4286
__hostdev__ void setOrigin(const T &ijk)
Definition NanoVDB.h:4308
__hostdev__ FloatType getDev() const
Definition NanoVDB.h:4300
__hostdev__ uint64_t getValue(uint32_t i) const
Definition NanoVDB.h:4288
uint64_t mPointCount
Definition NanoVDB.h:4271
__hostdev__ FloatType getAvg() const
Definition NanoVDB.h:4299
__hostdev__ void setMax(const ValueType &)
Definition NanoVDB.h:4303
__hostdev__ ValueType getMin() const
Definition NanoVDB.h:4297
__hostdev__ uint64_t pointCount() const
Definition NanoVDB.h:4285
static __hostdev__ uint32_t valueCount()
Definition NanoVDB.h:4212
__hostdev__ uint64_t getMax() const
Definition NanoVDB.h:4217
ValueIndex BuildType
Definition NanoVDB.h:4210
LeafIndexBase< CoordT, MaskT, LOG2DIM > BaseT
Definition NanoVDB.h:4209
__hostdev__ uint64_t getAvg() const
Definition NanoVDB.h:4218
__hostdev__ uint64_t getValue(uint32_t i) const
Definition NanoVDB.h:4220
__hostdev__ uint64_t lastOffset() const
Definition NanoVDB.h:4214
__hostdev__ uint64_t getDev() const
Definition NanoVDB.h:4219
__hostdev__ uint64_t getMin() const
Definition NanoVDB.h:4216
static constexpr bool FIXED_SIZE
Definition NanoVDB.h:4123
__hostdev__ void setMin(const ValueType &)
Definition NanoVDB.h:4145
static __hostdev__ uint64_t memUsage()
Definition NanoVDB.h:4131
__hostdev__ bool getDev() const
Definition NanoVDB.h:4142
__hostdev__ bool getValue(uint32_t i) const
Definition NanoVDB.h:4138
__hostdev__ void setDev(const FloatType &)
Definition NanoVDB.h:4148
ValueMask BuildType
Definition NanoVDB.h:4120
uint8_t mFlags
Definition NanoVDB.h:4127
LeafData & operator=(const LeafData &)=delete
LeafData(const LeafData &)=delete
__hostdev__ void setValue(uint32_t offset, bool)
Definition NanoVDB.h:4143
static __hostdev__ bool hasStats()
Definition NanoVDB.h:4132
__hostdev__ bool getMax() const
Definition NanoVDB.h:4140
MaskT< LOG2DIM > mValueMask
Definition NanoVDB.h:4128
CoordT mBBoxMin
Definition NanoVDB.h:4125
bool ValueType
Definition NanoVDB.h:4119
uint8_t mBBoxDif[3]
Definition NanoVDB.h:4126
__hostdev__ void setOn(uint32_t offset)
Definition NanoVDB.h:4144
static __hostdev__ constexpr uint32_t padding()
Definition NanoVDB.h:4133
__hostdev__ void setAvg(const FloatType &)
Definition NanoVDB.h:4147
LeafData()=delete
This class cannot be constructed or deleted.
__hostdev__ void setOrigin(const T &ijk)
Definition NanoVDB.h:4151
uint64_t mPadding[2]
Definition NanoVDB.h:4129
__hostdev__ bool getMin() const
Definition NanoVDB.h:4139
bool FloatType
Definition NanoVDB.h:4121
__hostdev__ void setMax(const ValueType &)
Definition NanoVDB.h:4146
__hostdev__ bool getAvg() const
Definition NanoVDB.h:4141
void ArrayType
Definition NanoVDB.h:4122
__hostdev__ uint64_t getMax() const
Definition NanoVDB.h:4237
LeafIndexBase< CoordT, MaskT, LOG2DIM > BaseT
Definition NanoVDB.h:4229
__hostdev__ uint64_t getAvg() const
Definition NanoVDB.h:4238
__hostdev__ uint64_t getValue(uint32_t i) const
Definition NanoVDB.h:4240
__hostdev__ uint64_t lastOffset() const
Definition NanoVDB.h:4235
__hostdev__ uint64_t getDev() const
Definition NanoVDB.h:4239
__hostdev__ uint64_t getMin() const
Definition NanoVDB.h:4236
__hostdev__ uint32_t valueCount() const
Definition NanoVDB.h:4231
ValueOnIndex BuildType
Definition NanoVDB.h:4230
bool BuildType
Definition NanoVDB.h:4070
static constexpr bool FIXED_SIZE
Definition NanoVDB.h:4073
__hostdev__ void setMax(const bool &)
Definition NanoVDB.h:4097
static __hostdev__ uint64_t memUsage()
Definition NanoVDB.h:4083
__hostdev__ bool getDev() const
Definition NanoVDB.h:4089
__hostdev__ bool getValue(uint32_t i) const
Definition NanoVDB.h:4085
uint8_t mFlags
Definition NanoVDB.h:4077
LeafData & operator=(const LeafData &)=delete
__hostdev__ void setAvg(const bool &)
Definition NanoVDB.h:4098
LeafData(const LeafData &)=delete
MaskT< LOG2DIM > ArrayType
Definition NanoVDB.h:4072
static __hostdev__ bool hasStats()
Definition NanoVDB.h:4084
__hostdev__ void setMin(const bool &)
Definition NanoVDB.h:4096
__hostdev__ bool getMax() const
Definition NanoVDB.h:4087
__hostdev__ void setDev(const bool &)
Definition NanoVDB.h:4099
MaskT< LOG2DIM > mValueMask
Definition NanoVDB.h:4078
MaskT< LOG2DIM > mValues
Definition NanoVDB.h:4079
CoordT mBBoxMin
Definition NanoVDB.h:4075
bool ValueType
Definition NanoVDB.h:4069
uint8_t mBBoxDif[3]
Definition NanoVDB.h:4076
__hostdev__ void setOn(uint32_t offset)
Definition NanoVDB.h:4095
static __hostdev__ constexpr uint32_t padding()
Definition NanoVDB.h:4082
LeafData()=delete
This class cannot be constructed or deleted.
__hostdev__ void setOrigin(const T &ijk)
Definition NanoVDB.h:4102
__hostdev__ void setValue(uint32_t offset, bool v)
Definition NanoVDB.h:4090
uint64_t mPadding[2]
Definition NanoVDB.h:4080
__hostdev__ bool getMin() const
Definition NanoVDB.h:4086
bool FloatType
Definition NanoVDB.h:4071
__hostdev__ bool getAvg() const
Definition NanoVDB.h:4088
ValueType mMaximum
Definition NanoVDB.h:3766
static constexpr bool FIXED_SIZE
Definition NanoVDB.h:3758
typename FloatTraits< ValueT >::FloatType FloatType
Definition NanoVDB.h:3756
static __hostdev__ uint64_t memUsage()
Definition NanoVDB.h:3778
FloatType mAverage
Definition NanoVDB.h:3767
__hostdev__ void setAvg(const FloatType &v)
Definition NanoVDB.h:3805
uint8_t mFlags
Definition NanoVDB.h:3762
LeafData & operator=(const LeafData &)=delete
LeafData(const LeafData &)=delete
static __hostdev__ bool hasStats()
Definition NanoVDB.h:3780
ValueT ValueType
Definition NanoVDB.h:3754
MaskT< LOG2DIM > mValueMask
Definition NanoVDB.h:3763
CoordT mBBoxMin
Definition NanoVDB.h:3760
uint8_t mBBoxDif[3]
Definition NanoVDB.h:3761
__hostdev__ void setOn(uint32_t offset)
Definition NanoVDB.h:3789
static __hostdev__ constexpr uint32_t padding()
Return padding of this class in bytes, due to aliasing and 32B alignment.
Definition NanoVDB.h:3774
__hostdev__ ValueType getValue(uint32_t i) const
Definition NanoVDB.h:3782
__hostdev__ void fill(const ValueType &v)
Definition NanoVDB.h:3814
__hostdev__ ValueType getMax() const
Definition NanoVDB.h:3792
LeafData()=delete
This class cannot be constructed or deleted.
ValueT ArrayType
Definition NanoVDB.h:3757
__hostdev__ void setMin(const ValueType &v)
Definition NanoVDB.h:3803
__hostdev__ void setOrigin(const T &ijk)
Definition NanoVDB.h:3812
__hostdev__ void setValueOnly(uint32_t offset, const ValueType &value)
Definition NanoVDB.h:3783
__hostdev__ FloatType getDev() const
Definition NanoVDB.h:3794
ValueType mMinimum
Definition NanoVDB.h:3765
__hostdev__ FloatType getAvg() const
Definition NanoVDB.h:3793
__hostdev__ void setValue(uint32_t offset, const ValueType &value)
Definition NanoVDB.h:3784
ValueT BuildType
Definition NanoVDB.h:3755
ValueType mValues[1u<< 3 *LOG2DIM]
Definition NanoVDB.h:3769
FloatType mStdDevi
Definition NanoVDB.h:3768
__hostdev__ ValueType getMin() const
Definition NanoVDB.h:3791
__hostdev__ void setMax(const ValueType &v)
Definition NanoVDB.h:3804
__hostdev__ void setDev(const FloatType &v)
Definition NanoVDB.h:3806
Base-class for quantized float leaf nodes.
Definition NanoVDB.h:3832
__hostdev__ float getAvg() const
return the quantized average of the active values in this node
Definition NanoVDB.h:3873
float ValueType
Definition NanoVDB.h:3835
__hostdev__ float getMax() const
return the quantized maximum of the active values in this node
Definition NanoVDB.h:3870
__hostdev__ float getDev() const
return the quantized standard deviation of the active values in this node
Definition NanoVDB.h:3877
static __hostdev__ uint64_t memUsage()
Definition NanoVDB.h:3847
__hostdev__ void setDev(float dev)
Definition NanoVDB.h:3889
uint16_t mMax
Definition NanoVDB.h:3845
uint8_t mFlags
Definition NanoVDB.h:3840
uint16_t mMin
Definition NanoVDB.h:3845
static __hostdev__ bool hasStats()
Definition NanoVDB.h:3849
__hostdev__ void setAvg(float avg)
Definition NanoVDB.h:3886
float mQuantum
Definition NanoVDB.h:3844
MaskT< LOG2DIM > mValueMask
Definition NanoVDB.h:3841
uint16_t mAvg
Definition NanoVDB.h:3845
CoordT mBBoxMin
Definition NanoVDB.h:3838
uint8_t mBBoxDif[3]
Definition NanoVDB.h:3839
__hostdev__ void setOn(uint32_t offset)
Definition NanoVDB.h:3864
static __hostdev__ constexpr uint32_t padding()
Return padding of this class in bytes, due to aliasing and 32B alignment.
Definition NanoVDB.h:3854
float mMinimum
Definition NanoVDB.h:3843
float FloatType
Definition NanoVDB.h:3836
__hostdev__ void setOrigin(const T &ijk)
Definition NanoVDB.h:3892
uint16_t mDev
Definition NanoVDB.h:3845
__hostdev__ void init(float min, float max, uint8_t bitWidth)
Definition NanoVDB.h:3858
__hostdev__ void setMin(float min)
Definition NanoVDB.h:3880
__hostdev__ void setMax(float max)
Definition NanoVDB.h:3883
__hostdev__ float getMin() const
return the quantized minimum of the active values in this node
Definition NanoVDB.h:3867
uint64_t mOffset
Definition NanoVDB.h:4177
static constexpr bool FIXED_SIZE
Definition NanoVDB.h:4171
__hostdev__ const uint64_t & firstOffset() const
Definition NanoVDB.h:4185
__hostdev__ void setMin(const ValueType &)
Definition NanoVDB.h:4186
static __hostdev__ uint64_t memUsage()
Definition NanoVDB.h:4182
__hostdev__ void setDev(const FloatType &)
Definition NanoVDB.h:4189
uint64_t ValueType
Definition NanoVDB.h:4168
uint64_t FloatType
Definition NanoVDB.h:4169
uint8_t mFlags
Definition NanoVDB.h:4175
uint64_t mPrefixSum
Definition NanoVDB.h:4177
LeafIndexBase & operator=(const LeafIndexBase &)=default
MaskT< LOG2DIM > mValueMask
Definition NanoVDB.h:4176
LeafIndexBase(const LeafIndexBase &)=default
CoordT mBBoxMin
Definition NanoVDB.h:4173
uint8_t mBBoxDif[3]
Definition NanoVDB.h:4174
__hostdev__ void setOn(uint32_t offset)
Definition NanoVDB.h:4190
static __hostdev__ constexpr uint32_t padding()
Definition NanoVDB.h:4178
__hostdev__ void setAvg(const FloatType &)
Definition NanoVDB.h:4188
__hostdev__ bool hasStats() const
Definition NanoVDB.h:4183
__hostdev__ void setOrigin(const T &ijk)
Definition NanoVDB.h:4192
LeafIndexBase()=default
This class should be used as an abstract class and only constructed or deleted via child classes.
__hostdev__ void setMax(const ValueType &)
Definition NanoVDB.h:4187
void ArrayType
Definition NanoVDB.h:4170
Definition NanoVDB.h:4328
static __hostdev__ uint32_t dim()
Definition NanoVDB.h:4331
static constexpr uint32_t DIM
Definition NanoVDB.h:4330
static constexpr uint32_t TOTAL
Definition NanoVDB.h:4329
Defines an affine transform and its inverse represented as a 3x3 matrix and a vec3 translation.
Definition NanoVDB.h:1412
double mTaperD
Definition NanoVDB.h:1420
__hostdev__ constexpr Vec3T applyIJT(const Vec3T &xyz) const
Apply the transposed inverse 3x3 transformation to an input 3d vector using 64bit floating point arit...
Definition NanoVDB.h:1541
void set(const Mat4T &mat, const Mat4T &invMat, double taper=1.0)
Initialize the member data from 4x4 matrices.
Definition NanoVDB.h:1455
__hostdev__ constexpr Vec3T applyInverseMap(const Vec3T &xyz) const
Apply the inverse affine mapping to a vector using 64bit floating point arithmetics.
Definition NanoVDB.h:1500
__hostdev__ constexpr Vec3T applyJacobianF(const Vec3T &ijk) const
Apply the linear forward 3x3 transformation to an input 3d vector using 32bit floating point arithmet...
Definition NanoVDB.h:1492
__hostdev__ constexpr Vec3T applyIJTF(const Vec3T &xyz) const
Definition NanoVDB.h:1543
__hostdev__ constexpr Vec3T applyInverseMapF(const Vec3T &xyz) const
Apply the inverse affine mapping to a vector using 32bit floating point arithmetics.
Definition NanoVDB.h:1511
__hostdev__ constexpr Vec3T applyInverseJacobianF(const Vec3T &xyz) const
Apply the linear inverse 3x3 transformation to an input 3d vector using 32bit floating point arithmet...
Definition NanoVDB.h:1532
__hostdev__ constexpr Vec3d getVoxelSize() const
Return a voxels size in each coordinate direction, measured at the origin.
Definition NanoVDB.h:1546
double mVecD[3]
Definition NanoVDB.h:1419
float mInvMatF[9]
Definition NanoVDB.h:1414
__hostdev__ constexpr Map()
Default constructor for the identity map.
Definition NanoVDB.h:1423
__hostdev__ constexpr Vec3T applyMap(const Vec3T &ijk) const
Apply the forward affine transformation to a vector using 64bit floating point arithmetics.
Definition NanoVDB.h:1466
__hostdev__ constexpr Vec3T applyMapF(const Vec3T &ijk) const
Apply the forward affine transformation to a vector using 32bit floating point arithmetics.
Definition NanoVDB.h:1474
double mInvMatD[9]
Definition NanoVDB.h:1418
float mMatF[9]
Definition NanoVDB.h:1413
double mMatD[9]
Definition NanoVDB.h:1417
__hostdev__ constexpr Map(double s, const Vec3d &t=Vec3d(0.0, 0.0, 0.0))
Definition NanoVDB.h:1434
__hostdev__ constexpr Vec3T applyInverseJacobian(const Vec3T &xyz) const
Apply the linear inverse 3x3 transformation to an input 3d vector using 64bit floating point arithmet...
Definition NanoVDB.h:1523
float mTaperF
Definition NanoVDB.h:1416
float mVecF[3]
Definition NanoVDB.h:1415
__hostdev__ constexpr Vec3T applyJacobian(const Vec3T &ijk) const
Apply the linear forward 3x3 transformation to an input 3d vector using 64bit floating point arithmet...
Definition NanoVDB.h:1483
void set(const MatT &mat, const MatT &invMat, const Vec3T &translate, double taper=1.0)
Initialize the member data from 3x3 or 4x4 matrices.
Definition NanoVDB.h:1550
NanoLeaf< BuildT > type
Definition NanoVDB.h:4750
NanoLeaf< BuildT > Type
Definition NanoVDB.h:4749
NanoLower< BuildT > Type
Definition NanoVDB.h:4755
NanoLower< BuildT > type
Definition NanoVDB.h:4756
NanoUpper< BuildT > type
Definition NanoVDB.h:4762
NanoUpper< BuildT > Type
Definition NanoVDB.h:4761
NanoRoot< BuildT > type
Definition NanoVDB.h:4768
NanoRoot< BuildT > Type
Definition NanoVDB.h:4767
Trait to map from LEVEL to node type.
Definition NanoVDB.h:4743
typename GridOrTreeOrRootT::LeafNodeType type
Definition NanoVDB.h:1728
typename GridOrTreeOrRootT::LeafNodeType Type
Definition NanoVDB.h:1727
typename GridOrTreeOrRootT::RootNodeType::ChildNodeType::ChildNodeType Type
Definition NanoVDB.h:1742
typename GridOrTreeOrRootT::RootNodeType::ChildNodeType::ChildNodeType type
Definition NanoVDB.h:1743
typename GridOrTreeOrRootT::RootNodeType::ChildNodeType type
Definition NanoVDB.h:1757
typename GridOrTreeOrRootT::RootNodeType::ChildNodeType Type
Definition NanoVDB.h:1756
typename GridOrTreeOrRootT::RootNodeType type
Definition NanoVDB.h:1771
typename GridOrTreeOrRootT::RootNodeType Type
Definition NanoVDB.h:1770
const typename GridOrTreeOrRootT::LeafNodeType Type
Definition NanoVDB.h:1734
const typename GridOrTreeOrRootT::LeafNodeType type
Definition NanoVDB.h:1735
const typename GridOrTreeOrRootT::RootNodeType::ChildNodeType::ChildNodeType type
Definition NanoVDB.h:1750
const typename GridOrTreeOrRootT::RootNodeType::ChildNodeType::ChildNodeType Type
Definition NanoVDB.h:1749
const typename GridOrTreeOrRootT::RootNodeType::ChildNodeType Type
Definition NanoVDB.h:1763
const typename GridOrTreeOrRootT::RootNodeType::ChildNodeType type
Definition NanoVDB.h:1764
const typename GridOrTreeOrRootT::RootNodeType type
Definition NanoVDB.h:1779
const typename GridOrTreeOrRootT::RootNodeType Type
Definition NanoVDB.h:1778
Struct to derive node type from its level in a given grid, tree or root while preserving constness.
Definition NanoVDB.h:1720
Implements Tree::probeLeaf(math::Coord)
Definition NanoVDB.h:6476
static __hostdev__ Type get(const NanoLeaf< BuildT > &leaf, uint32_t n, ValueT &v)
Definition NanoVDB.h:6500
bool Type
Definition NanoVDB.h:6477
static __hostdev__ Type get(const NanoLower< BuildT > &node, uint32_t n, ValueT &v)
Definition NanoVDB.h:6495
typename BuildToValueMap< BuildT >::Type ValueT
Definition NanoVDB.h:6479
static constexpr int LEVEL
Definition NanoVDB.h:6478
static __hostdev__ Type get(const NanoUpper< BuildT > &node, uint32_t n, ValueT &v)
Definition NanoVDB.h:6490
static __hostdev__ Type get(const typename NanoRoot< BuildT >::Tile &tile, ValueT &v)
Definition NanoVDB.h:6485
static __hostdev__ Type get(const NanoRoot< BuildT > &root, ValueT &v)
Definition NanoVDB.h:6480
Definition NanoVDB.h:2700
ValueT value
Definition NanoVDB.h:2723
uint32_t state
Definition NanoVDB.h:2722
__hostdev__ bool isChild() const
Definition NanoVDB.h:2716
KeyT key
Definition NanoVDB.h:2720
__hostdev__ CoordT origin() const
Definition NanoVDB.h:2719
__hostdev__ bool isValue() const
Definition NanoVDB.h:2717
int64_t child
Definition NanoVDB.h:2721
__hostdev__ void setChild(const CoordType &k, const void *ptr, const RootData *data)
Definition NanoVDB.h:2702
__hostdev__ void setValue(const CoordType &k, bool s, const ValueType &v)
Definition NanoVDB.h:2709
__hostdev__ bool isActive() const
Definition NanoVDB.h:2718
StatsT mAverage
Definition NanoVDB.h:2688
typename ChildT::CoordType CoordT
Definition NanoVDB.h:2654
RootData()=delete
This class cannot be constructed or deleted.
__hostdev__ void setMin(const ValueT &v)
Definition NanoVDB.h:2871
__hostdev__ const StatsT & average() const
Definition NanoVDB.h:2868
static constexpr bool FIXED_SIZE
Definition NanoVDB.h:2656
__hostdev__ const ValueT & getMin() const
Definition NanoVDB.h:2866
__hostdev__ Tile * probeTile(const CoordT &ijk)
Definition NanoVDB.h:2830
__hostdev__ TileIterator beginTile()
Definition NanoVDB.h:2811
ValueT mBackground
Definition NanoVDB.h:2685
__hostdev__ ConstTileIterator probe(const CoordT &ijk) const
Definition NanoVDB.h:2822
__hostdev__ const ValueT & getMax() const
Definition NanoVDB.h:2867
__hostdev__ ChildT * getChild(const Tile *tile)
Returns a const reference to the child node in the specified tile.
Definition NanoVDB.h:2855
__hostdev__ void setDev(const StatsT &v)
Definition NanoVDB.h:2874
uint32_t mTableSize
Definition NanoVDB.h:2683
math::BBox< CoordT > mBBox
Definition NanoVDB.h:2682
uint64_t KeyT
Return a key based on the coordinates of a voxel.
Definition NanoVDB.h:2660
__hostdev__ ConstTileIterator cbeginTile() const
Definition NanoVDB.h:2812
__hostdev__ ChildT * probeChild(const CoordT &ijk)
Definition NanoVDB.h:2841
typename ChildT::FloatType StatsT
Definition NanoVDB.h:2655
__hostdev__ void setAvg(const StatsT &v)
Definition NanoVDB.h:2873
__hostdev__ const Tile * tile(uint32_t n) const
Returns a pointer to the tile at the specified linear offset.
Definition NanoVDB.h:2729
__hostdev__ const Tile * probeTile(const CoordT &ijk) const
Definition NanoVDB.h:2836
typename ChildT::BuildType BuildT
Definition NanoVDB.h:2653
static __hostdev__ constexpr uint32_t padding()
Return padding of this class in bytes, due to aliasing and 32B alignment.
Definition NanoVDB.h:2694
StatsT mStdDevi
Definition NanoVDB.h:2689
RootData(const RootData &)=delete
static __hostdev__ CoordT KeyToCoord(const KeyT &key)
Definition NanoVDB.h:2670
RootData & operator=(const RootData &)=delete
static __hostdev__ KeyT CoordToKey(const CoordType &ijk)
Definition NanoVDB.h:2662
__hostdev__ void setMax(const ValueT &v)
Definition NanoVDB.h:2872
ValueT mMaximum
Definition NanoVDB.h:2687
__hostdev__ TileIterator probe(const CoordT &ijk)
Definition NanoVDB.h:2814
__hostdev__ const StatsT & stdDeviation() const
Definition NanoVDB.h:2869
__hostdev__ Tile * tile(uint32_t n)
Definition NanoVDB.h:2734
typename ChildT::ValueType ValueT
Definition NanoVDB.h:2652
TileIter< const RootData > ConstTileIterator
Definition NanoVDB.h:2809
__hostdev__ const ChildT * probeChild(const CoordT &ijk) const
Definition NanoVDB.h:2847
__hostdev__ const ChildT * getChild(const Tile *tile) const
Definition NanoVDB.h:2860
TileIter< RootData > TileIterator
Definition NanoVDB.h:2808
ValueT mMinimum
Definition NanoVDB.h:2686
Definition NanoVDB.h:6370
static __hostdev__ void set(NanoLower< BuildT > &node, uint32_t n, const ValueT &v)
Definition NanoVDB.h:6377
static __hostdev__ void set(NanoRoot< BuildT > &, const ValueT &)
Definition NanoVDB.h:6374
static __hostdev__ void set(NanoUpper< BuildT > &node, uint32_t n, const ValueT &v)
Definition NanoVDB.h:6376
static constexpr int LEVEL
Definition NanoVDB.h:6373
static __hostdev__ void set(NanoLeaf< BuildT > &leaf, uint32_t n, const ValueT &v)
Definition NanoVDB.h:6378
typename NanoLeaf< BuildT >::ValueType ValueT
Definition NanoVDB.h:6372
static __hostdev__ void set(typename NanoRoot< BuildT >::Tile &tile, const ValueT &v)
Definition NanoVDB.h:6375
Definition NanoVDB.h:6383
static __hostdev__ void set(NanoLower< BuildT > &, uint32_t, const ValueT &)
Definition NanoVDB.h:6390
static __hostdev__ void set(NanoRoot< BuildT > &, const ValueT &)
Definition NanoVDB.h:6387
static __hostdev__ void set(NanoUpper< BuildT > &, uint32_t, const ValueT &)
Definition NanoVDB.h:6389
static constexpr int LEVEL
Definition NanoVDB.h:6386
static __hostdev__ void set(NanoLeaf< BuildT > &leaf, uint32_t n, const ValueT &v)
Definition NanoVDB.h:6391
static __hostdev__ void set(typename NanoRoot< BuildT >::Tile &, const ValueT &)
Definition NanoVDB.h:6388
typename NanoLeaf< BuildT >::ValueType ValueT
Definition NanoVDB.h:6385
T ElementType
Definition NanoVDB.h:785
static const int Rank
Definition NanoVDB.h:781
static const int Size
Definition NanoVDB.h:784
static T scalar(const T &s)
Definition NanoVDB.h:786
static const bool IsVector
Definition NanoVDB.h:783
static const bool IsScalar
Definition NanoVDB.h:782
static ElementType scalar(const T &v)
Definition NanoVDB.h:797
static const int Rank
Definition NanoVDB.h:792
static const int Size
Definition NanoVDB.h:795
typename T::ValueType ElementType
Definition NanoVDB.h:796
static const bool IsVector
Definition NanoVDB.h:794
static const bool IsScalar
Definition NanoVDB.h:793
Definition NanoVDB.h:2423
__hostdev__ const void * getRoot() const
Get a const void pointer to the root node (never NULL)
Definition NanoVDB.h:2439
__hostdev__ bool isEmpty() const
Return true if the root is empty, i.e. has not child nodes or constant tiles.
Definition NanoVDB.h:2445
int64_t mNodeOffset[4]
Definition NanoVDB.h:2424
__hostdev__ bool isRootNext() const
return true if RootData is layout out immediately after TreeData in memory
Definition NanoVDB.h:2451
TreeData & operator=(const TreeData &)=default
__hostdev__ void setRoot(const void *root)
Definition NanoVDB.h:2430
uint32_t mNodeCount[3]
Definition NanoVDB.h:2425
__hostdev__ void * getRoot()
Get a non-const void pointer to the root node (never NULL)
Definition NanoVDB.h:2436
uint32_t mTileCount[3]
Definition NanoVDB.h:2426
__hostdev__ void setFirstNode(const NodeT *node)
Definition NanoVDB.h:2442
__hostdev__ CoordBBox bbox() const
Return the index bounding box of all the active values in this tree, i.e. in all nodes of the tree.
Definition NanoVDB.h:2448
uint64_t mVoxelCount
Definition NanoVDB.h:2427
C++11 implementation of std::conditional.
Definition Util.h:429
C++11 implementation of std::enable_if.
Definition Util.h:379
static constexpr bool value
Definition Util.h:370
C++11 implementation of std::is_same.
Definition Util.h:353
static constexpr bool value
Definition Util.h:354
typename remove_const< T >::type type
Definition Util.h:499
T type
Definition Util.h:446
ValueT value
Definition NanoVDB.h:3238
Tile(const Tile &)=delete
Tile & operator=(const Tile &)=delete
Tile()=delete
This class cannot be constructed or deleted.
int64_t child
Definition NanoVDB.h:3239