4#ifndef OPENVDB_TREE_LEAFNODE_HAS_BEEN_INCLUDED
5#define OPENVDB_TREE_LEAFNODE_HAS_BEEN_INCLUDED
29template<Index,
typename>
struct SameLeafConfig;
36template<
typename T, Index Log2Dim>
51 NUM_VALUES = 1 << 3 * Log2Dim,
52 NUM_VOXELS = NUM_VALUES,
58 template<
typename OtherValueType>
63 template<
typename OtherNodeType>
77 const ValueType& value = zeroVal<ValueType>(),
87 const ValueType& value = zeroVal<ValueType>(),
97 template<
typename OtherValueType>
101 template<
typename OtherValueType>
106 template<
typename OtherValueType>
148 bool isEmpty()
const {
return mValueMask.isOff(); }
150 bool isDense()
const {
return mValueMask.isOn(); }
152 bool isAllocated()
const {
return !mBuffer.isOutOfCore() && !mBuffer.empty(); }
158 Index64 memUsageIfLoaded()
const;
163 void evalActiveBoundingBox(
CoordBBox& bbox,
bool visitVoxels =
true)
const;
192 std::string str()
const;
196 template<
typename OtherType, Index OtherLog2Dim>
200 bool operator==(
const LeafNode& other)
const;
212 template<
typename MaskIterT,
typename NodeT,
typename ValueT,
typename TagT>
217 MaskIterT, ValueIter<MaskIterT, NodeT, ValueT, TagT>, NodeT, ValueT>
224 ValueT&
getItem(
Index pos)
const {
return this->parent().getValue(pos); }
225 ValueT&
getValue()
const {
return this->parent().getValue(this->pos()); }
230 this->parent().setValueOnly(pos, value);
235 this->parent().setValueOnly(this->pos(), value);
239 template<
typename ModifyOp>
240 void modifyItem(
Index n,
const ModifyOp& op)
const { this->parent().modifyValue(n, op); }
242 template<
typename ModifyOp>
243 void modifyValue(
const ModifyOp& op)
const { this->parent().modifyValue(this->pos(), op); }
247 template<
typename MaskIterT,
typename NodeT,
typename TagT>
249 public SparseIteratorBase<MaskIterT, ChildIter<MaskIterT, NodeT, TagT>, NodeT, ValueType>
256 template<
typename NodeT,
typename ValueT,
typename TagT>
258 MaskDenseIterator, DenseIter<NodeT, ValueT, TagT>, NodeT, void, ValueT>
268 value = this->parent().getValue(pos);
279 this->parent().setValueOnly(pos, value);
354 void readTopology(std::istream& is,
bool fromHalf =
false);
358 void writeTopology(std::ostream& os,
bool toHalf =
false)
const;
363 void readBuffers(std::istream& is,
bool fromHalf =
false);
368 void readBuffers(std::istream& is,
const CoordBBox& bbox,
bool fromHalf =
false);
372 void writeBuffers(std::ostream& os,
bool toHalf =
false)
const;
397 void setActiveState(
const Coord& xyz,
bool on);
402 void setValueOnly(
const Coord& xyz,
const ValueType& val);
404 void setValueOnly(
Index offset,
const ValueType& val);
412 void setValueOff(
const Coord& xyz,
const ValueType& val);
414 void setValueOff(
Index offset,
const ValueType& val);
422 this->setValueOn(LeafNode::coordToOffset(xyz), val);
428 mBuffer.setValue(offset, val);
429 mValueMask.setOn(offset);
434 template<
typename ModifyOp>
437 mBuffer.loadValues();
438 if (!mBuffer.empty()) {
442 mValueMask.setOn(offset);
448 template<
typename ModifyOp>
451 this->modifyValue(this->coordToOffset(xyz), op);
455 template<
typename ModifyOp>
458 mBuffer.loadValues();
459 if (!mBuffer.empty()) {
460 const Index offset = this->coordToOffset(xyz);
461 bool state = mValueMask.isOn(offset);
465 mValueMask.set(offset, state);
483 void clip(
const CoordBBox&,
const ValueType& background);
486 void fill(
const CoordBBox& bbox,
const ValueType&,
bool active =
true);
490 this->fill(bbox, value, active);
494 void fill(
const ValueType& value);
496 void fill(
const ValueType& value,
bool active);
509 template<
typename DenseT>
510 void copyToDense(
const CoordBBox& bbox, DenseT& dense)
const;
528 template<
typename DenseT>
529 void copyFromDense(
const CoordBBox& bbox,
const DenseT& dense,
530 const ValueType& background,
const ValueType& tolerance);
534 template<
typename AccessorT>
537 return this->getValue(xyz);
542 template<
typename AccessorT>
547 template<
typename AccessorT>
550 this->setValueOn(xyz, val);
556 template<
typename AccessorT>
559 this->setValueOnly(xyz, val);
565 template<
typename ModifyOp,
typename AccessorT>
568 this->modifyValue(xyz, op);
573 template<
typename ModifyOp,
typename AccessorT>
576 this->modifyValueAndActiveState(xyz, op);
581 template<
typename AccessorT>
584 this->setValueOff(xyz, value);
590 template<
typename AccessorT>
593 this->setActiveState(xyz, on);
599 template<
typename AccessorT>
602 return this->probeValue(xyz, val);
608 template<
typename AccessorT>
611 const Index offset = this->coordToOffset(xyz);
612 state = mValueMask.isOn(offset);
614 return mBuffer[offset];
619 template<
typename AccessorT>
631 void resetBackground(
const ValueType& oldBackground,
const ValueType& newBackground);
639 template<MergePolicy Policy>
void merge(
const LeafNode&);
640 template<MergePolicy Policy>
void merge(
const ValueType& tileValue,
bool tileActive);
641 template<MergePolicy Policy>
642 void merge(
const LeafNode& other,
const ValueType& ,
const ValueType& );
650 template<
typename OtherType>
664 template<
typename OtherType>
678 template<
typename OtherType>
681 template<
typename CombineOp>
682 void combine(
const LeafNode& other, CombineOp& op);
683 template<
typename CombineOp>
684 void combine(
const ValueType& value,
bool valueIsActive, CombineOp& op);
686 template<
typename CombineOp,
typename OtherType >
687 void combine2(
const LeafNode& other,
const OtherType&,
bool valueIsActive, CombineOp&);
688 template<
typename CombineOp,
typename OtherNodeT >
689 void combine2(
const ValueType&,
const OtherNodeT& other,
bool valueIsActive, CombineOp&);
690 template<
typename CombineOp,
typename OtherNodeT >
691 void combine2(
const LeafNode& b0,
const OtherNodeT& b1, CombineOp&);
697 template<
typename AccessorT>
699 template<
typename NodeT>
701 template<
typename NodeT>
703 template<
typename NodeT>
705 template<
typename ArrayT>
void getNodes(ArrayT&)
const {}
709 void addTile(
Index level,
const Coord&,
const ValueType&,
bool);
710 void addTile(
Index offset,
const ValueType&,
bool);
711 template<
typename AccessorT>
712 void addTileAndCache(
Index,
const Coord&,
const ValueType&,
bool, AccessorT&);
717 template<
typename AccessorT>
719 template<
typename NodeT,
typename AccessorT>
723 if (!(std::is_same<NodeT, LeafNode>::value))
return nullptr;
724 return reinterpret_cast<NodeT*
>(
this);
728 template<
typename AccessorT>
734 template<
typename AccessorT>
736 template<
typename AccessorT>
739 template<
typename NodeT,
typename AccessorT>
743 if (!(std::is_same<NodeT, LeafNode>::value))
return nullptr;
744 return reinterpret_cast<const NodeT*
>(
this);
758 bool isConstant(ValueType& firstValue,
bool& state,
759 const ValueType& tolerance = zeroVal<ValueType>())
const;
772 bool isConstant(ValueType& minValue, ValueType& maxValue,
773 bool& state,
const ValueType& tolerance = zeroVal<ValueType>())
const;
790 ValueType medianAll(ValueType *tmp =
nullptr)
const;
806 Index medianOn(ValueType &value, ValueType *tmp =
nullptr)
const;
822 Index medianOff(ValueType &value, ValueType *tmp =
nullptr)
const;
828 friend class ::TestLeaf;
829 template<
typename>
friend class ::TestLeafIO;
866 inline void skipCompressedValues(
bool seekable, std::istream&,
bool fromHalf);
875 NodeMaskType mValueMask;
889template<Index Dim1,
typename NodeT2>
892template<Index Dim1,
typename T2>
900template<
typename T, Index Log2Dim>
909template<
typename T, Index Log2Dim>
914 mOrigin(xyz & (~(DIM - 1)))
919template<
typename T, Index Log2Dim>
924 mOrigin(xyz & (~(DIM - 1)))
929template<
typename T, Index Log2Dim>
932 : mBuffer(other.mBuffer)
933 , mValueMask(other.valueMask())
934 , mOrigin(other.mOrigin)
935 , mTransientData(other.mTransientData)
941template<
typename T, Index Log2Dim>
942template<
typename OtherValueType>
945 : mValueMask(other.valueMask())
946 , mOrigin(other.mOrigin)
947 , mTransientData(other.mTransientData)
951 static inline ValueType convertValue(
const OtherValueType& val) {
return ValueType(val); }
955 mBuffer[i] = Local::convertValue(other.mBuffer[i]);
960template<
typename T, Index Log2Dim>
961template<
typename OtherValueType>
965 : mBuffer(background)
966 , mValueMask(other.valueMask())
967 , mOrigin(other.mOrigin)
968 , mTransientData(other.mTransientData)
973template<
typename T, Index Log2Dim>
974template<
typename OtherValueType>
978 : mValueMask(other.valueMask())
979 , mOrigin(other.mOrigin)
980 , mTransientData(other.mTransientData)
983 mBuffer[i] = (mValueMask.
isOn(i) ? onValue : offValue);
988template<
typename T, Index Log2Dim>
995template<
typename T, Index Log2Dim>
999 std::ostringstream ostr;
1000 ostr <<
"LeafNode @" << mOrigin <<
": " << mBuffer;
1008template<
typename T, Index Log2Dim>
1012 assert ((xyz[0] & (DIM-1u)) < DIM && (xyz[1] & (DIM-1u)) < DIM && (xyz[2] & (DIM-1u)) < DIM);
1013 return ((xyz[0] & (DIM-1u)) << 2*Log2Dim)
1014 + ((xyz[1] & (DIM-1u)) << Log2Dim)
1015 + (xyz[2] & (DIM-1u));
1018template<
typename T, Index Log2Dim>
1022 assert(n<(1<< 3*Log2Dim));
1024 xyz.
setX(n >> 2*Log2Dim);
1025 n &= ((1<<2*Log2Dim)-1);
1026 xyz.
setY(n >> Log2Dim);
1027 xyz.
setZ(n & ((1<<Log2Dim)-1));
1032template<
typename T, Index Log2Dim>
1036 return (this->offsetToLocalCoord(n) + this->origin());
1043template<
typename ValueT, Index Log2Dim>
1050template<
typename ValueT, Index Log2Dim>
1054 assert(offset < SIZE);
1055 return mBuffer[offset];
1059template<
typename T, Index Log2Dim>
1066template<
typename T, Index Log2Dim>
1070 assert(offset < SIZE);
1071 val = mBuffer[offset];
1072 return mValueMask.isOn(offset);
1076template<
typename T, Index Log2Dim>
1083template<
typename T, Index Log2Dim>
1087 assert(offset < SIZE);
1088 mBuffer.setValue(offset, val);
1089 mValueMask.setOff(offset);
1093template<
typename T, Index Log2Dim>
1097 mValueMask.set(this->coordToOffset(xyz), on);
1101template<
typename T, Index Log2Dim>
1108template<
typename T, Index Log2Dim>
1112 assert(offset<SIZE); mBuffer.setValue(offset, val);
1119template<
typename T, Index Log2Dim>
1123 CoordBBox nodeBBox = this->getNodeBoundingBox();
1126 this->fill(background,
false);
1127 }
else if (clipBBox.
isInside(nodeBBox)) {
1139 int &x = xyz.
x(), &y = xyz.
y(), &z = xyz.
z();
1140 for (x = nodeBBox.
min().
x(); x <= nodeBBox.
max().
x(); ++x) {
1141 for (y = nodeBBox.
min().
y(); y <= nodeBBox.
max().
y(); ++y) {
1142 for (z = nodeBBox.
min().
z(); z <= nodeBBox.
max().
z(); ++z) {
1143 mask.
setOn(
static_cast<Index32>(this->coordToOffset(xyz)));
1151 this->setValueOff(maskIter.pos(), background);
1159template<
typename T, Index Log2Dim>
1165 auto clippedBBox = this->getNodeBoundingBox();
1166 clippedBBox.intersect(bbox);
1167 if (!clippedBBox)
return;
1169 for (
Int32 x = clippedBBox.min().x(); x <= clippedBBox.max().x(); ++x) {
1170 const Index offsetX = (x & (DIM-1u)) << 2*Log2Dim;
1171 for (
Int32 y = clippedBBox.min().y(); y <= clippedBBox.max().y(); ++y) {
1172 const Index offsetXY = offsetX + ((y & (DIM-1u)) << Log2Dim);
1173 for (
Int32 z = clippedBBox.min().z(); z <= clippedBBox.max().z(); ++z) {
1174 const Index offset = offsetXY + (z & (DIM-1u));
1175 mBuffer[offset] = value;
1176 mValueMask.set(offset, active);
1182template<
typename T, Index Log2Dim>
1186 mBuffer.fill(value);
1189template<
typename T, Index Log2Dim>
1193 mBuffer.fill(value);
1194 mValueMask.set(active);
1201template<
typename T, Index Log2Dim>
1202template<
typename DenseT>
1206 mBuffer.loadValues();
1208 using DenseValueType =
typename DenseT::ValueType;
1210 const size_t xStride = dense.xStride(), yStride = dense.yStride(), zStride = dense.zStride();
1211 const Coord& min = dense.bbox().min();
1212 DenseValueType* t0 = dense.data() + zStride * (bbox.
min()[2] - min[2]);
1213 const T* s0 = &mBuffer[bbox.
min()[2] & (DIM-1u)];
1214 for (
Int32 x = bbox.
min()[0], ex = bbox.
max()[0] + 1; x < ex; ++x) {
1215 DenseValueType* t1 = t0 + xStride * (x - min[0]);
1216 const T* s1 = s0 + ((x & (DIM-1u)) << 2*Log2Dim);
1217 for (
Int32 y = bbox.
min()[1], ey = bbox.
max()[1] + 1; y < ey; ++y) {
1218 DenseValueType* t2 = t1 + yStride * (y - min[1]);
1219 const T* s2 = s1 + ((y & (DIM-1u)) << Log2Dim);
1220 for (
Int32 z = bbox.
min()[2], ez = bbox.
max()[2] + 1; z < ez; ++z, t2 += zStride) {
1221 *t2 = DenseValueType(*s2++);
1228template<
typename T, Index Log2Dim>
1229template<
typename DenseT>
1236 using DenseValueType =
typename DenseT::ValueType;
1238 const size_t xStride = dense.xStride(), yStride = dense.yStride(), zStride = dense.zStride();
1239 const Coord& min = dense.bbox().min();
1241 const DenseValueType* s0 = dense.data() + zStride * (bbox.
min()[2] - min[2]);
1242 const Int32 n0 = bbox.
min()[2] & (DIM-1u);
1243 for (
Int32 x = bbox.
min()[0], ex = bbox.
max()[0]+1; x < ex; ++x) {
1244 const DenseValueType* s1 = s0 + xStride * (x - min[0]);
1245 const Int32 n1 = n0 + ((x & (DIM-1u)) << 2*LOG2DIM);
1246 for (
Int32 y = bbox.
min()[1], ey = bbox.
max()[1]+1; y < ey; ++y) {
1247 const DenseValueType* s2 = s1 + yStride * (y - min[1]);
1248 Int32 n2 = n1 + ((y & (DIM-1u)) << LOG2DIM);
1249 for (
Int32 z = bbox.
min()[2], ez = bbox.
max()[2]+1; z < ez; ++z, ++n2, s2 += zStride) {
1251 mValueMask.setOff(n2);
1252 mBuffer[n2] = background;
1254 mValueMask.setOn(n2);
1266template<
typename T, Index Log2Dim>
1270 mValueMask.load(is);
1274template<
typename T, Index Log2Dim>
1278 mValueMask.save(os);
1286template<
typename T, Index Log2Dim>
1293 is,
nullptr, SIZE, mValueMask, fromHalf);
1302template<
typename T, Index Log2Dim>
1310template<
typename T, Index Log2Dim>
1315 const bool seekable = meta && meta->seekable();
1317#ifdef OPENVDB_USE_DELAYED_LOADING
1318 std::streamoff maskpos = is.tellg();
1323 mValueMask.seek(is);
1326 mValueMask.load(is);
1329 int8_t numBuffers = 1;
1335 is.read(
reinterpret_cast<char*
>(&numBuffers),
sizeof(int8_t));
1338 CoordBBox nodeBBox = this->getNodeBoundingBox();
1341 skipCompressedValues(seekable, is, fromHalf);
1342 mValueMask.setOff();
1343 mBuffer.setOutOfCore(
false);
1345#ifdef OPENVDB_USE_DELAYED_LOADING
1350 io::MappedFile::Ptr mappedFile = io::getMappedFilePtr(is);
1351 const bool delayLoad = ((mappedFile.get() !=
nullptr) && clipBBox.
isInside(nodeBBox));
1354 mBuffer.setOutOfCore(
true);
1355 mBuffer.mFileInfo =
new typename Buffer::FileInfo;
1356 mBuffer.mFileInfo->meta = meta;
1357 mBuffer.mFileInfo->bufpos = is.tellg();
1358 mBuffer.mFileInfo->mapping = mappedFile;
1361 mBuffer.mFileInfo->maskpos = maskpos;
1363 skipCompressedValues(seekable, is, fromHalf);
1368 mBuffer.setOutOfCore(
false);
1373 background = *
static_cast<const T*
>(bgPtr);
1375 this->clip(clipBBox, background);
1376#ifdef OPENVDB_USE_DELAYED_LOADING
1381 if (numBuffers > 1) {
1386 for (
int i = 1; i < numBuffers; ++i) {
1396 if (meta) meta->setLeaf(meta->leaf() + 1);
1400template<
typename T, Index Log2Dim>
1405 mValueMask.save(os);
1407 mBuffer.loadValues();
1417template<
typename T, Index Log2Dim>
1421 return mOrigin == other.mOrigin &&
1423 mBuffer == other.mBuffer;
1427template<
typename T, Index Log2Dim>
1433 return sizeof(*this) + mBuffer.
memUsage() -
sizeof(mBuffer);
1437template<
typename T, Index Log2Dim>
1443 return sizeof(*this) + mBuffer.memUsageIfLoaded() -
sizeof(mBuffer);
1447template<
typename T, Index Log2Dim>
1451 CoordBBox this_bbox = this->getNodeBoundingBox();
1452 if (bbox.
isInside(this_bbox))
return;
1456 for(; iter; ++iter) this_bbox.
expand(this->offsetToLocalCoord(iter.pos()));
1464template<
typename T, Index Log2Dim>
1465template<
typename OtherType, Index OtherLog2Dim>
1470 return (Log2Dim == OtherLog2Dim && mValueMask == other->
getValueMask());
1473template<
typename T, Index Log2Dim>
1479 if (!mValueMask.isConstant(state))
return false;
1480 firstValue = mBuffer[0];
1481 for (
Index i = 1; i < SIZE; ++i) {
1487template<
typename T, Index Log2Dim>
1494 if (!mValueMask.isConstant(state))
return false;
1495 minValue = maxValue = mBuffer[0];
1496 for (
Index i = 1; i < SIZE; ++i) {
1497 const T& v = mBuffer[i];
1499 if ((maxValue - v) > tolerance)
return false;
1501 }
else if (v > maxValue) {
1502 if ((v - minValue) > tolerance)
return false;
1509template<
typename T, Index Log2Dim>
1513 std::unique_ptr<T[]> data(
nullptr);
1514 if (tmp ==
nullptr) {
1515 data.reset(
new T[NUM_VALUES]);
1518 if (tmp != mBuffer.data()) {
1519 const T* src = mBuffer.data();
1520 for (T* dst = tmp; dst-tmp < NUM_VALUES;) *dst++ = *src++;
1522 static const size_t midpoint = (NUM_VALUES - 1) >> 1;
1523 std::nth_element(tmp, tmp + midpoint, tmp + NUM_VALUES);
1524 return tmp[midpoint];
1527template<
typename T, Index Log2Dim>
1531 const Index count = mValueMask.countOn();
1532 if (count == NUM_VALUES) {
1533 value = this->medianAll(tmp);
1535 }
else if (count == 0) {
1538 std::unique_ptr<T[]> data(
nullptr);
1539 if (tmp ==
nullptr) {
1540 data.reset(
new T[count]);
1543 for (
auto iter=this->cbeginValueOn(); iter; ++iter) *tmp++ = *iter;
1544 T *begin = tmp - count;
1545 const size_t midpoint = (count - 1) >> 1;
1546 std::nth_element(begin, begin + midpoint, tmp);
1547 value = begin[midpoint];
1551template<
typename T, Index Log2Dim>
1555 const Index count = mValueMask.countOff();
1556 if (count == NUM_VALUES) {
1557 value = this->medianAll(tmp);
1559 }
else if (count == 0) {
1562 std::unique_ptr<T[]> data(
nullptr);
1563 if (tmp ==
nullptr) {
1564 data.reset(
new T[count]);
1567 for (
auto iter=this->cbeginValueOff(); iter; ++iter) *tmp++ = *iter;
1568 T *begin = tmp - count;
1569 const size_t midpoint = (count - 1) >> 1;
1570 std::nth_element(begin, begin + midpoint, tmp);
1571 value = begin[midpoint];
1578template<
typename T, Index Log2Dim>
1582 this->addTile(this->coordToOffset(xyz), val, active);
1585template<
typename T, Index Log2Dim>
1589 assert(offset < SIZE);
1590 setValueOnly(offset, val);
1591 setActiveState(offset, active);
1594template<
typename T, Index Log2Dim>
1595template<
typename AccessorT>
1598 const ValueType& val,
bool active, AccessorT&)
1600 this->addTile(level, xyz, val, active);
1607template<
typename T, Index Log2Dim>
1616 for (iter = this->mValueMask.beginOff(); iter; ++iter) {
1619 inactiveValue = newBackground;
1627template<
typename T, Index Log2Dim>
1628template<MergePolicy Policy>
1637 for (; iter; ++iter) {
1639 if (mValueMask.isOff(n)) {
1640 mBuffer[n] = other.mBuffer[n];
1641 mValueMask.setOn(n);
1647template<
typename T, Index Log2Dim>
1648template<MergePolicy Policy>
1653 this->
template merge<Policy>(other);
1656template<
typename T, Index Log2Dim>
1657template<MergePolicy Policy>
1665 if (!tileActive)
return;
1668 const Index n = iter.pos();
1669 mBuffer[n] = tileValue;
1670 mValueMask.setOn(n);
1676template<
typename T, Index Log2Dim>
1677template<
typename OtherType>
1684template<
typename T, Index Log2Dim>
1685template<
typename OtherType>
1693template<
typename T, Index Log2Dim>
1694template<
typename OtherType>
1702template<
typename T, Index Log2Dim>
1708 for (
Index i = 0; i < SIZE; ++i) {
1709 mBuffer[i] = -mBuffer[i];
1717template<
typename T, Index Log2Dim>
1718template<
typename CombineOp>
1725 for (
Index i = 0; i < SIZE; ++i) {
1736template<
typename T, Index Log2Dim>
1737template<
typename CombineOp>
1745 for (
Index i = 0; i < SIZE; ++i) {
1757template<
typename T, Index Log2Dim>
1758template<
typename CombineOp,
typename OtherType>
1761 bool valueIsActive, CombineOp& op)
1767 for (
Index i = 0; i < SIZE; ++i) {
1768 op(args.
setARef(other.mBuffer[i])
1776template<
typename T, Index Log2Dim>
1777template<
typename CombineOp,
typename OtherNodeT>
1780 bool valueIsActive, CombineOp& op)
1786 for (
Index i = 0; i < SIZE; ++i) {
1787 op(args.
setBRef(other.mBuffer[i])
1795template<
typename T, Index Log2Dim>
1796template<
typename CombineOp,
typename OtherNodeT>
1803 for (
Index i = 0; i < SIZE; ++i) {
1804 mValueMask.set(i, b0.
valueMask().
isOn(i) || b1.valueMask().isOn(i));
1805 op(args.
setARef(b0.mBuffer[i])
1818template<
typename T, Index Log2Dim>
1822 for (
Index32 i = 0, N = buf.
size(); i < N; ++i) os << buf.mData[i] <<
", ";
This struct collects both input and output arguments to "grid combiner" functors used with the tree::...
Definition Types.h:569
CombineArgs & setARef(const AValueType &a)
Redirect the A value to a new external source.
Definition Types.h:621
CombineArgs & setBIsActive(bool b)
Set the active state of the B value.
Definition Types.h:637
CombineArgs & setResultRef(AValueType &val)
Redirect the result value to a new external destination.
Definition Types.h:625
CombineArgs & setBRef(const BValueType &b)
Redirect the B value to a new external source.
Definition Types.h:623
bool resultIsActive() const
Definition Types.h:632
CombineArgs & setAIsActive(bool b)
Set the active state of the A value.
Definition Types.h:635
Tag dispatch class that distinguishes constructors during file input.
Definition Types.h:689
Tag dispatch class that distinguishes topology copy constructors from deep copy constructors.
Definition Types.h:683
Axis-aligned bounding box of signed integer coordinates.
Definition Coord.h:251
void translate(const Coord &t)
Translate this bounding box by (tx, ty, tz).
Definition Coord.h:460
void expand(ValueType padding)
Pad this bounding box with the specified padding.
Definition Coord.h:420
const Coord & min() const
Definition Coord.h:323
bool hasOverlap(const CoordBBox &b) const
Return true if the given bounding box overlaps with this bounding box.
Definition Coord.h:414
const Coord & max() const
Definition Coord.h:324
static CoordBBox inf()
Return an "infinite" bounding box, as defined by the Coord value range.
Definition Coord.h:321
bool isInside(const Coord &xyz) const
Return true if point (x, y, z) is inside this bounding box.
Definition Coord.h:402
void intersect(const CoordBBox &bbox)
Intersect this bounding box with the given bounding box.
Definition Coord.h:446
void reset()
Definition Coord.h:329
Signed (x, y, z) 32-bit integer coordinates.
Definition Coord.h:25
Int32 ValueType
Definition Coord.h:32
Int32 y() const
Definition Coord.h:131
Int32 x() const
Definition Coord.h:130
Coord & setZ(Int32 z)
Definition Coord.h:81
Coord & setY(Int32 y)
Definition Coord.h:80
Int32 z() const
Definition Coord.h:132
Coord & setX(Int32 x)
Definition Coord.h:79
Base class for iterators over internal and leaf nodes.
Definition Iterator.h:30
Index memUsage() const
Return the memory footprint of this buffer in bytes.
Definition LeafBuffer.h:319
static Index size()
Return the number of values contained in this buffer.
Definition LeafBuffer.h:111
Templated block class to hold specific data types and a fixed number of values determined by Log2Dim....
Definition LeafNode.h:38
void stealNodes(ArrayT &, const ValueType &, bool)
Definition LeafNode.h:706
LeafNode & operator=(const LeafNode &)=default
Deep assignment operator.
bool probeValueAndCache(const Coord &xyz, ValueType &val, AccessorT &) const
Return true if the voxel at the given coordinates is active and return the voxel value in val.
Definition LeafNode.h:600
bool isValueOn(Index offset) const
Return true if the voxel at the given offset is active.
Definition LeafNode.h:477
static Index64 onTileCount()
Definition LeafNode.h:145
void getOrigin(Int32 &x, Int32 &y, Int32 &z) const
Definition LeafNode.h:175
static Coord offsetToLocalCoord(Index n)
Return the local coordinates for a linear table offset, where offset 0 has coordinates (0,...
Definition LeafNode.h:1020
ChildOnCIter cbeginChildOn() const
Definition LeafNode.h:319
SharedPtr< LeafNode > Ptr
Definition LeafNode.h:45
CoordBBox getNodeBoundingBox() const
Return the bounding box of this node, i.e., the full index space spanned by this leaf node.
Definition LeafNode.h:167
NodeMaskType & getValueMask()
Definition LeafNode.h:855
void setValueOn(Index offset)
Mark the voxel at the given offset as active but don't change its value.
Definition LeafNode.h:419
bool isChildMaskOn(Index) const
Definition LeafNode.h:858
ChildOnCIter beginChildOn() const
Definition LeafNode.h:320
ChildOnIter beginChildOn()
Definition LeafNode.h:321
bool isValueOn(const Coord &xyz) const
Return true if the voxel at the given coordinates is active.
Definition LeafNode.h:475
ValueOnIter endValueOn()
Definition LeafNode.h:309
void writeTopology(std::ostream &os, bool toHalf=false) const
Write out just the topology.
Definition LeafNode.h:1276
void copyToDense(const CoordBBox &bbox, DenseT &dense) const
Copy into a dense grid the values of the voxels that lie within a given bounding box.
Definition LeafNode.h:1204
bool isChildMaskOff() const
Definition LeafNode.h:860
ValueOffCIter cbeginValueOff() const
Definition LeafNode.h:300
Index32 transientData() const
Return the transient data value.
Definition LeafNode.h:187
static Index32 childCount()
Return the child count for this node, which is zero.
Definition LeafNode.h:137
void setValue(const Coord &xyz, const ValueType &val)
Set the value of the voxel at the given coordinates and mark the voxel as active.
Definition LeafNode.h:425
static Index getChildDim()
Return the dimension of child nodes of this LeafNode, which is one for voxels.
Definition LeafNode.h:129
bool operator!=(const LeafNode &other) const
Definition LeafNode.h:201
void copyFromDense(const CoordBBox &bbox, const DenseT &dense, const ValueType &background, const ValueType &tolerance)
Copy from a dense grid into this node the values of the voxels that lie within a given bounding box.
Definition LeafNode.h:1231
const ValueType & getValue(const Coord &xyz) const
Return the value of the voxel at the given coordinates.
Definition LeafNode.h:1045
void setValueMask(const NodeMaskType &mask)
Definition LeafNode.h:857
ChildOnIter endChildOn()
Definition LeafNode.h:331
ValueAllIter endValueAll()
Definition LeafNode.h:315
LeafNode * touchLeaf(const Coord &)
Return a pointer to this node.
Definition LeafNode.h:716
void setValueOnly(const Coord &xyz, const ValueType &val)
Set the value of the voxel at the given coordinates but don't change its active state.
Definition LeafNode.h:1103
LeafNode * probeLeaf(const Coord &)
Definition LeafNode.h:727
bool isValueMaskOff() const
Definition LeafNode.h:853
void prune(const ValueType &=zeroVal< ValueType >())
This function exists only to enable template instantiation.
Definition LeafNode.h:695
bool isValueMaskOn() const
Definition LeafNode.h:851
void topologyDifference(const LeafNode< OtherType, Log2Dim > &other, const ValueType &)
Difference this node's set of active values with the active values of the other node,...
Definition LeafNode.h:1696
void getNodes(ArrayT &) const
Definition LeafNode.h:705
void setValuesOff()
Mark all voxels as inactive but don't change their values.
Definition LeafNode.h:472
ValueAllCIter endValueAll() const
Definition LeafNode.h:314
Index medianOff(ValueType &value, ValueType *tmp=nullptr) const
Computes the median value of all the inactive voxels in this node.
Definition LeafNode.h:1553
void setValueOn(const Coord &xyz, const ValueType &val)
Set the value of the voxel at the given coordinates and mark the voxel as active.
Definition LeafNode.h:421
Index64 onLeafVoxelCount() const
Definition LeafNode.h:143
ChildOffCIter endChildOff() const
Definition LeafNode.h:333
ValueType medianAll(ValueType *tmp=nullptr) const
Computes the median value of all the active AND inactive voxels in this node.
Definition LeafNode.h:1511
~LeafNode()
Destructor.
Definition LeafNode.h:990
ValueAllCIter cbeginValueAll() const
Definition LeafNode.h:303
NodeT * probeNode(const Coord &)
Definition LeafNode.h:702
void readTopology(std::istream &is, bool fromHalf=false)
Read in just the topology.
Definition LeafNode.h:1268
ValueOnCIter beginValueOn() const
Definition LeafNode.h:298
static void evalNodeOrigin(Coord &xyz)
Compute the origin of the leaf node that contains the voxel with the given coordinates.
Definition LeafNode.h:869
const Buffer & buffer() const
Definition LeafNode.h:345
LeafNode * probeLeafAndCache(const Coord &, AccessorT &)
Definition LeafNode.h:729
void setValueMaskOn(Index n)
Definition LeafNode.h:863
Index medianOn(ValueType &value, ValueType *tmp=nullptr) const
Computes the median value of all the active voxels in this node.
Definition LeafNode.h:1529
Index64 offLeafVoxelCount() const
Definition LeafNode.h:144
const LeafNode * probeLeaf(const Coord &) const
Definition LeafNode.h:738
void addTile(Index level, const Coord &, const ValueType &, bool)
Definition LeafNode.h:1580
void resetBackground(const ValueType &oldBackground, const ValueType &newBackground)
Replace inactive occurrences of oldBackground with newBackground, and inactive occurrences of -oldBac...
Definition LeafNode.h:1609
void setOrigin(const Coord &origin)
Set the grid index coordinates of this node's local origin.
Definition LeafNode.h:170
const Coord & origin() const
Return the grid index coordinates of this node's local origin.
Definition LeafNode.h:173
static Index getValueLevel(const Coord &)
Return the level (i.e., 0) at which leaf node values reside.
Definition LeafNode.h:394
bool isInactive() const
Return true if all of this node's values are inactive.
Definition LeafNode.h:825
void modifyValueAndActiveState(const Coord &xyz, const ModifyOp &op)
Apply a functor to the voxel at the given coordinates.
Definition LeafNode.h:456
bool isValueMaskOff(Index n) const
Definition LeafNode.h:852
ValueOnCIter cendValueOn() const
Definition LeafNode.h:307
bool isAllocated() const
Return true if memory for this node's buffer has been allocated.
Definition LeafNode.h:152
static Index getValueLevelAndCache(const Coord &, AccessorT &)
Return the LEVEL (=0) at which leaf node values reside.
Definition LeafNode.h:620
static Index numValues()
Return the total number of voxels represented by this LeafNode.
Definition LeafNode.h:123
ValueOffCIter beginValueOff() const
Definition LeafNode.h:301
void setValueOffAndCache(const Coord &xyz, const ValueType &value, AccessorT &)
Change the value of the voxel at the given coordinates and mark it as inactive.
Definition LeafNode.h:582
const ValueType & getValue(const Coord &xyz, bool &state, int &level, AccessorT &) const
Return the value of the voxel at the given coordinates and return its active state and level (i....
Definition LeafNode.h:609
const ValueType & getValueAndCache(const Coord &xyz, AccessorT &) const
Return the value of the voxel at the given coordinates.
Definition LeafNode.h:535
ChildAllCIter cbeginChildAll() const
Definition LeafNode.h:325
void topologyIntersection(const LeafNode< OtherType, Log2Dim > &other, const ValueType &)
Intersect this node's set of active values with the active values of the other node,...
Definition LeafNode.h:1687
ChildOffIter endChildOff()
Definition LeafNode.h:334
void clip(const CoordBBox &, const ValueType &background)
Set all voxels that lie outside the given axis-aligned box to the background.
Definition LeafNode.h:1121
ChildAllIter beginChildAll()
Definition LeafNode.h:327
void setValueOn(Index offset, const ValueType &val)
Set the value of the voxel at the given offset and mark the voxel as active.
Definition LeafNode.h:427
static Index getLevel()
Return the level of this node, which by definition is zero for LeafNodes.
Definition LeafNode.h:125
bool isValueOnAndCache(const Coord &xyz, AccessorT &) const
Return true if the voxel at the given coordinates is active.
Definition LeafNode.h:543
void addLeaf(LeafNode *)
Definition LeafNode.h:696
void setActiveState(const Coord &xyz, bool on)
Set the active state of the voxel at the given coordinates but don't change its value.
Definition LeafNode.h:1095
ValueOnIter beginValueOn()
Definition LeafNode.h:299
void modifyValueAndCache(const Coord &xyz, const ModifyOp &op, AccessorT &)
Apply a functor to the value of the voxel at the given coordinates and mark the voxel as active.
Definition LeafNode.h:566
void topologyUnion(const LeafNode< OtherType, Log2Dim > &other, const bool preserveTiles=false)
Union this node's set of active values with the active values of the other node, whose ValueType may ...
Definition LeafNode.h:1679
NodeT * probeNodeAndCache(const Coord &, AccessorT &)
Definition LeafNode.h:720
const ValueType & getFirstValue() const
Return a const reference to the first value in the buffer.
Definition LeafNode.h:625
ChildOffCIter cbeginChildOff() const
Definition LeafNode.h:322
ChildOffIter beginChildOff()
Definition LeafNode.h:324
bool isChildMaskOff(Index) const
Definition LeafNode.h:859
Index64 onVoxelCount() const
Return the number of voxels marked On.
Definition LeafNode.h:140
ChildOffCIter beginChildOff() const
Definition LeafNode.h:323
static Index coordToOffset(const Coord &xyz)
Return the linear table offset of the given global or local coordinates.
Definition LeafNode.h:1010
static Index64 offTileCount()
Definition LeafNode.h:146
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition LeafNode.h:407
bool hasSameTopology(const LeafNode< OtherType, OtherLog2Dim > *other) const
Return true if the given node (which may have a different ValueType than this node) has the same acti...
Definition LeafNode.h:1467
ValueOffIter endValueOff()
Definition LeafNode.h:312
void setValueOff(Index offset)
Mark the voxel at the given offset as inactive but don't change its value.
Definition LeafNode.h:409
const LeafNode * probeConstLeafAndCache(const Coord &, AccessorT &) const
Definition LeafNode.h:735
ChildAllCIter endChildAll() const
Definition LeafNode.h:336
const NodeT * probeConstNodeAndCache(const Coord &, AccessorT &) const
Definition LeafNode.h:740
ValueOnCIter cbeginValueOn() const
Definition LeafNode.h:297
void writeBuffers(std::ostream &os, bool toHalf=false) const
Write buffers to a stream.
Definition LeafNode.h:1402
static Index log2dim()
Return log2 of the dimension of this LeafNode, e.g. 3 if dimensions are 8^3.
Definition LeafNode.h:117
void combine(const LeafNode &other, CombineOp &op)
Definition LeafNode.h:1720
static void getNodeLog2Dims(std::vector< Index > &dims)
Append the Log2Dim of this LeafNode to the specified vector.
Definition LeafNode.h:127
ChildOnCIter endChildOn() const
Definition LeafNode.h:330
const LeafNode * probeConstLeaf(const Coord &) const
Return a const pointer to this node.
Definition LeafNode.h:733
static Index32 nonLeafCount()
Return the non-leaf count for this node, which is zero.
Definition LeafNode.h:135
ChildOnCIter cendChildOn() const
Definition LeafNode.h:329
static bool hasActiveTiles()
Return false since leaf nodes never contain tiles.
Definition LeafNode.h:480
ChildAllCIter cendChildAll() const
Definition LeafNode.h:335
Index64 memUsageIfLoaded() const
Definition LeafNode.h:1439
void combine2(const LeafNode &other, const OtherType &, bool valueIsActive, CombineOp &)
Definition LeafNode.h:1760
void fill(const CoordBBox &bbox, const ValueType &, bool active=true)
Set all voxels within an axis-aligned box to the specified value and active state.
Definition LeafNode.h:1161
void modifyValue(const Coord &xyz, const ModifyOp &op)
Apply a functor to the value of the voxel at the given coordinates and mark the voxel as active.
Definition LeafNode.h:449
ChildAllIter endChildAll()
Definition LeafNode.h:337
size_t streamingSize(bool toHalf=false) const
void setValueMask(Index n, bool on)
Definition LeafNode.h:862
const NodeMaskType & valueMask() const
Definition LeafNode.h:856
Index64 offVoxelCount() const
Return the number of voxels marked Off.
Definition LeafNode.h:142
typename NodeMaskType::OffIterator MaskOffIterator
Definition LeafNode.h:205
void swap(Buffer &other)
Exchange this node's data buffer with the given data buffer without changing the active states of the...
Definition LeafNode.h:344
void readBuffers(std::istream &is, bool fromHalf=false)
Read buffers from a stream.
Definition LeafNode.h:1304
bool isConstant(ValueType &firstValue, bool &state, const ValueType &tolerance=zeroVal< ValueType >()) const
Definition LeafNode.h:1475
T BuildType
Definition LeafNode.h:40
ValueAllCIter cendValueAll() const
Definition LeafNode.h:313
friend class LeafNode
Definition LeafNode.h:833
void denseFill(const CoordBBox &bbox, const ValueType &value, bool active=true)
Set all voxels within an axis-aligned box to the specified value and active state.
Definition LeafNode.h:488
void negate()
Definition LeafNode.h:1704
Coord offsetToGlobalCoord(Index n) const
Return the global coordinates for a linear table offset.
Definition LeafNode.h:1034
ChildAllCIter beginChildAll() const
Definition LeafNode.h:326
const LeafNode * probeLeafAndCache(const Coord &, AccessorT &) const
Definition LeafNode.h:737
void setActiveStateAndCache(const Coord &xyz, bool on, AccessorT &)
Set the active state of the voxel at the given coordinates without changing its value.
Definition LeafNode.h:591
void getOrigin(Coord &origin) const
Definition LeafNode.h:174
void setValuesOn()
Mark all voxels as active but don't change their values.
Definition LeafNode.h:470
void setTransientData(Index32 transientData)
Set the transient data value.
Definition LeafNode.h:189
void nodeCount(std::vector< Index32 > &) const
no-op
Definition LeafNode.h:133
static Index size()
Return the total number of voxels represented by this LeafNode.
Definition LeafNode.h:121
ChildOffCIter cendChildOff() const
Definition LeafNode.h:332
void skipCompressedValues(bool seekable, std::istream &, bool fromHalf)
Definition LeafNode.h:1288
typename NodeMaskType::OnIterator MaskOnIterator
Definition LeafNode.h:204
bool operator==(const LeafNode &other) const
Check for buffer, state and origin equivalence.
Definition LeafNode.h:1419
static const Index SIZE
Definition LeafNode.h:53
void evalActiveBoundingBox(CoordBBox &bbox, bool visitVoxels=true) const
Definition LeafNode.h:1449
bool isEmpty() const
Return true if this node has no active voxels.
Definition LeafNode.h:148
void merge(const LeafNode &)
Definition LeafNode.h:1630
ValueOffIter beginValueOff()
Definition LeafNode.h:302
const NodeT * probeConstNode(const Coord &) const
Definition LeafNode.h:704
void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition LeafNode.h:417
Buffer & buffer()
Definition LeafNode.h:346
void setValueOnlyAndCache(const Coord &xyz, const ValueType &val, AccessorT &)
Change the value of the voxel at the given coordinates but preserve its state.
Definition LeafNode.h:557
void setActiveState(Index offset, bool on)
Set the active state of the voxel at the given offset but don't change its value.
Definition LeafNode.h:399
static Index32 leafCount()
Return the leaf count for this node, which is one.
Definition LeafNode.h:131
bool allocate()
Allocate memory for this node's buffer if it has not already been allocated.
Definition LeafNode.h:154
const NodeMaskType & getValueMask() const
Definition LeafNode.h:854
void addTileAndCache(Index, const Coord &, const ValueType &, bool, AccessorT &)
Definition LeafNode.h:1597
void addLeafAndCache(LeafNode *, AccessorT &)
Definition LeafNode.h:698
void modifyValue(Index offset, const ModifyOp &op)
Apply a functor to the value of the voxel at the given offset and mark the voxel as active.
Definition LeafNode.h:435
ValueOffCIter cendValueOff() const
Definition LeafNode.h:310
void setValueMaskOff(Index n)
Definition LeafNode.h:864
Index64 memUsage() const
Return the memory in bytes occupied by this node.
Definition LeafNode.h:1429
bool isDense() const
Return true if this node contains only active voxels.
Definition LeafNode.h:150
ValueOffCIter endValueOff() const
Definition LeafNode.h:311
void setValueAndCache(const Coord &xyz, const ValueType &val, AccessorT &)
Change the value of the voxel at the given coordinates and mark it as active.
Definition LeafNode.h:548
std::string str() const
Return a string representation of this node.
Definition LeafNode.h:997
NodeT * stealNode(const Coord &, const ValueType &, bool)
Definition LeafNode.h:700
T ValueType
Definition LeafNode.h:41
bool probeValue(const Coord &xyz, ValueType &val) const
Return true if the voxel at the given coordinates is active.
Definition LeafNode.h:1061
ValueOnCIter endValueOn() const
Definition LeafNode.h:308
typename NodeMaskType::DenseIterator MaskDenseIterator
Definition LeafNode.h:206
void voxelizeActiveTiles(bool=true)
No-op.
Definition LeafNode.h:637
void modifyValueAndActiveStateAndCache(const Coord &xyz, const ModifyOp &op, AccessorT &)
Definition LeafNode.h:574
LeafNode * touchLeafAndCache(const Coord &, AccessorT &)
Definition LeafNode.h:718
const ValueType & getLastValue() const
Return a const reference to the last value in the buffer.
Definition LeafNode.h:627
ValueAllCIter beginValueAll() const
Definition LeafNode.h:304
static Index dim()
Return the number of voxels in each coordinate dimension.
Definition LeafNode.h:119
bool isValueMaskOn(Index n) const
Definition LeafNode.h:850
ValueAllIter beginValueAll()
Definition LeafNode.h:305
Index32 pos() const
Definition NodeMasks.h:200
Definition NodeMasks.h:271
Bit mask for the internal and leaf nodes of VDB. This is a 64-bit implementation.
Definition NodeMasks.h:308
OnIterator beginOn() const
Definition NodeMasks.h:352
OffIterator beginOff() const
Definition NodeMasks.h:354
bool isOn(Index32 n) const
Return true if the nth bit is on.
Definition NodeMasks.h:502
void setOn(Index32 n)
Set the nth bit on.
Definition NodeMasks.h:452
Definition NodeMasks.h:240
Definition NodeMasks.h:209
OPENVDB_API uint32_t getDataCompression(std::ios_base &)
Return a bitwise OR of compression option flags (COMPRESS_ZIP, COMPRESS_ACTIVE_MASK,...
void writeCompressedValues(std::ostream &os, ValueT *srcBuf, Index srcCount, const MaskT &valueMask, const MaskT &childMask, bool toHalf)
Definition Compression.h:645
OPENVDB_API uint32_t getFormatVersion(std::ios_base &)
Return the file format version number associated with the given input stream.
@ COMPRESS_ZIP
Definition Compression.h:54
void readCompressedValues(std::istream &is, ValueT *destBuf, Index destCount, const MaskT &valueMask, bool fromHalf)
Definition Compression.h:465
OPENVDB_API const void * getGridBackgroundValuePtr(std::ios_base &)
Return a pointer to the background value of the grid currently being read from or written to the give...
OPENVDB_API SharedPtr< StreamMetadata > getStreamMetadataPtr(std::ios_base &)
Return a shared pointer to an object that stores metadata (file format, compression scheme,...
void readData(std::istream &is, T *data, Index count, uint32_t compression, DelayedLoadMetadata *metadata=nullptr, size_t metadataOffset=size_t(0))
Read data from a stream.
Definition Compression.h:247
bool isApproxEqual(const Type &a, const Type &b, const Type &tolerance)
Return true if a is equal to b to within the given tolerance.
Definition Math.h:406
T negative(const T &val)
Return the unary negation of the given value.
Definition Math.h:128
std::ostream & operator<<(std::ostream &os, const typename LeafNode< T, Log2Dim >::Buffer &buf)
Definition LeafNode.h:1820
Index32 Index
Definition Types.h:54
constexpr T zeroVal()
Return the value of type T that corresponds to zero.
Definition Math.h:70
uint32_t Index32
Definition Types.h:52
@ OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION
Definition version.h.in:256
int32_t Int32
Definition Types.h:56
uint64_t Index64
Definition Types.h:53
std::shared_ptr< T > SharedPtr
Definition Types.h:114
@ MERGE_NODES
Definition Types.h:508
@ MERGE_ACTIVE_STATES_AND_NODES
Definition Types.h:509
Definition Exceptions.h:13
static pnanovdb_uint32_t allocate(pnanovdb_uint32_t *poffset, pnanovdb_uint32_t size, pnanovdb_uint32_t alignment)
Definition pnanovdb_validate_strides.h:20
Definition Compression.h:292
Base class for dense iterators over internal and leaf nodes.
Definition Iterator.h:179
typename std::remove_const< UnsetItemT >::type NonConstValueType
Definition Iterator.h:184
Leaf nodes have no children, so their child iterators have no get/set accessors.
Definition LeafNode.h:250
ChildIter(const MaskIterT &iter, NodeT *parent)
Definition LeafNode.h:252
ChildIter()
Definition LeafNode.h:251
Definition LeafNode.h:210
Definition LeafNode.h:210
Definition LeafNode.h:259
DenseIter(const MaskDenseIterator &iter, NodeT *parent)
Definition LeafNode.h:264
void unsetItem(Index pos, const ValueT &value) const
Definition LeafNode.h:277
bool getItem(Index pos, void *&child, NonConstValueT &value) const
Definition LeafNode.h:266
DenseIter()
Definition LeafNode.h:263
typename BaseT::NonConstValueType NonConstValueT
Definition LeafNode.h:261
SameConfiguration<OtherNodeType>::value is true if and only if OtherNodeType is the type of a LeafNod...
Definition LeafNode.h:64
Definition LeafNode.h:209
ValueConverter<T>::Type is the type of a LeafNode having the same dimensions as this node but a diffe...
Definition LeafNode.h:59
Definition LeafNode.h:218
void setValue(const ValueT &value) const
Definition LeafNode.h:233
void modifyValue(const ModifyOp &op) const
Definition LeafNode.h:243
ValueT & getItem(Index pos) const
Definition LeafNode.h:224
void setItem(Index pos, const ValueT &value) const
Definition LeafNode.h:228
ValueIter(const MaskIterT &iter, NodeT *parent)
Definition LeafNode.h:222
ValueT & getValue() const
Definition LeafNode.h:225
ValueIter()
Definition LeafNode.h:221
void modifyItem(Index n, const ModifyOp &op) const
Definition LeafNode.h:240
Definition LeafNode.h:209
Definition LeafNode.h:209
Definition LeafNode.h:890
Base class for sparse iterators over internal and leaf nodes.
Definition Iterator.h:115
ValueType ValueType
Definition Iterator.h:117
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition version.h.in:121
#define OPENVDB_USE_VERSION_NAMESPACE
Definition version.h.in:212