4#ifndef OPENVDB_TREE_LEAFNODE_HAS_BEEN_INCLUDED
5#define OPENVDB_TREE_LEAFNODE_HAS_BEEN_INCLUDED
30template<Index,
typename>
struct SameLeafConfig;
37template<
typename T, Index Log2Dim>
59 template<
typename OtherValueType>
64 template<
typename OtherNodeType>
98 template<
typename OtherValueType>
102 template<
typename OtherValueType>
107 template<
typename OtherValueType>
151 bool isEmpty()
const {
return mValueMask.isOff(); }
153 bool isDense()
const {
return mValueMask.isOn(); }
155 bool isAllocated()
const {
return !mBuffer.isOutOfCore() && !mBuffer.empty(); }
199 template<
typename OtherType, Index OtherLog2Dim>
215 template<
typename MaskIterT,
typename NodeT,
typename ValueT,
typename TagT>
220 MaskIterT, ValueIter<MaskIterT, NodeT, ValueT, TagT>, NodeT, ValueT>
222 using ValueType = std::conditional_t<std::is_const_v<NodeT>, ValueT,
223 std::remove_const_t<ValueT>>;
240 if constexpr (std::is_const_v<NodeT>) {
241 static_assert(!std::is_const_v<NodeT>,
242 "ValueIter::setItem cannot be called on const iterators");
254 template<
typename ModifyOp>
257 if constexpr (std::is_const_v<NodeT>) {
258 static_assert(!std::is_const_v<NodeT>,
259 "ValueIter::modifyItem cannot be called on const iterators");
265 this->
parent().setValueOn(n);
269 template<
typename ModifyOp>
279 template<
typename MaskIterT,
typename NodeT,
typename TagT>
281 public SparseIteratorBase<MaskIterT, ChildIter<MaskIterT, NodeT, TagT>, NodeT, ValueType>
288 template<
typename NodeT,
typename ValueT,
typename TagT>
290 MaskDenseIterator, DenseIter<NodeT, ValueT, TagT>, NodeT, void, ValueT>
316 using ValueOnIter = ValueIter<MaskOnIterator, LeafNode, const ValueType, ValueOn>;
317 using ValueOnCIter = ValueIter<MaskOnIterator, const LeafNode, const ValueType, ValueOn>;
318 using ValueOffIter = ValueIter<MaskOffIterator, LeafNode, const ValueType, ValueOff>;
319 using ValueOffCIter = ValueIter<MaskOffIterator,const LeafNode,const ValueType,ValueOff>;
320 using ValueAllIter = ValueIter<MaskDenseIterator, LeafNode, const ValueType, ValueAll>;
321 using ValueAllCIter = ValueIter<MaskDenseIterator,const LeafNode,const ValueType,ValueAll>;
323 using ChildOnCIter = ChildIter<MaskOnIterator, const LeafNode, ChildOn>;
460 mBuffer.setValue(offset, val);
461 mValueMask.setOn(offset);
466 template<
typename ModifyOp>
469 mBuffer.loadValues();
470 if (!mBuffer.empty()) {
474 mValueMask.setOn(offset);
480 template<
typename ModifyOp>
487 template<
typename ModifyOp>
490 mBuffer.loadValues();
491 if (!mBuffer.empty()) {
493 bool state = mValueMask.isOn(offset);
497 mValueMask.set(offset, state);
526 this->
fill(bbox, value, active);
545 template<
typename DenseT>
564 template<
typename DenseT>
570 template<
typename AccessorT>
578 template<
typename AccessorT>
583 template<
typename AccessorT>
592 template<
typename AccessorT>
601 template<
typename ModifyOp,
typename AccessorT>
609 template<
typename ModifyOp,
typename AccessorT>
617 template<
typename AccessorT>
626 template<
typename AccessorT>
635 template<
typename AccessorT>
644 template<
typename AccessorT>
648 state = mValueMask.isOn(offset);
650 return mBuffer[offset];
655 template<
typename AccessorT>
676 template<MergePolicy Policy>
void merge(
const ValueType& tileValue,
bool tileActive);
677 template<MergePolicy Policy>
686 template<
typename OtherType>
700 template<
typename OtherType>
714 template<
typename OtherType>
717 template<
typename CombineOp>
719 template<
typename CombineOp>
722 template<
typename CombineOp,
typename OtherType >
724 template<
typename CombineOp,
typename OtherNodeT >
726 template<
typename CombineOp,
typename OtherNodeT >
733 template<
typename AccessorT>
735 template<
typename NodeT>
737 template<
typename NodeT>
739 template<
typename NodeT>
741 template<
typename ArrayT>
void getNodes(ArrayT&)
const {}
747 template<
typename AccessorT>
753 template<
typename AccessorT>
755 template<
typename NodeT,
typename AccessorT>
759 if (!(std::is_same<NodeT, LeafNode>::value))
return nullptr;
760 return reinterpret_cast<NodeT*
>(
this);
764 template<
typename AccessorT>
770 template<
typename AccessorT>
772 template<
typename AccessorT>
775 template<
typename NodeT,
typename AccessorT>
779 if (!(std::is_same<NodeT, LeafNode>::value))
return nullptr;
780 return reinterpret_cast<const NodeT*
>(
this);
887 friend class ::TestLeaf;
888 template<
typename>
friend class ::TestLeafIO;
934 NodeMaskType mValueMask;
948template<Index Dim1,
typename NodeT2>
951template<Index Dim1,
typename T2>
959template<
typename T, Index Log2Dim>
968template<
typename T, Index Log2Dim>
973 mOrigin(xyz & (~(
DIM - 1)))
978template<
typename T, Index Log2Dim>
983 mOrigin(xyz & (~(
DIM - 1)))
988template<
typename T, Index Log2Dim>
991 : mBuffer(other.mBuffer)
993 , mOrigin(other.mOrigin)
994 , mTransientData(other.mTransientData)
1000template<
typename T, Index Log2Dim>
1001template<
typename OtherValueType>
1005 , mOrigin(other.mOrigin)
1006 , mTransientData(other.mTransientData)
1010 static inline ValueType convertValue(
const OtherValueType& val) {
return ValueType(val); }
1014 mBuffer[i] = Local::convertValue(other.mBuffer[i]);
1019template<
typename T, Index Log2Dim>
1020template<
typename OtherValueType>
1024 : mBuffer(background)
1026 , mOrigin(other.mOrigin)
1027 , mTransientData(other.mTransientData)
1032template<
typename T, Index Log2Dim>
1033template<
typename OtherValueType>
1038 , mOrigin(other.mOrigin)
1039 , mTransientData(other.mTransientData)
1042 mBuffer[i] = (mValueMask.isOn(i) ? onValue : offValue);
1047template<
typename T, Index Log2Dim>
1054template<
typename T, Index Log2Dim>
1058 std::ostringstream ostr;
1059 ostr <<
"LeafNode @" << mOrigin <<
": " << mBuffer;
1067template<
typename T, Index Log2Dim>
1072 return ((xyz[0] & (
DIM-1u)) << 2*Log2Dim)
1073 + ((xyz[1] & (
DIM-1u)) << Log2Dim)
1074 + (xyz[2] & (
DIM-1u));
1077template<
typename T, Index Log2Dim>
1083 xyz.
setX(n >> 2*Log2Dim);
1084 n &= ((1<<2*Log2Dim)-1);
1085 xyz.
setY(n >> Log2Dim);
1086 xyz.
setZ(n & ((1<<Log2Dim)-1));
1091template<
typename T, Index Log2Dim>
1102template<
typename ValueT, Index Log2Dim>
1109template<
typename ValueT, Index Log2Dim>
1114 return mBuffer[offset];
1118template<
typename T, Index Log2Dim>
1125template<
typename T, Index Log2Dim>
1130 val = mBuffer[offset];
1131 return mValueMask.isOn(offset);
1135template<
typename T, Index Log2Dim>
1142template<
typename T, Index Log2Dim>
1147 mBuffer.setValue(offset, val);
1148 mValueMask.setOff(offset);
1152template<
typename T, Index Log2Dim>
1160template<
typename T, Index Log2Dim>
1167template<
typename T, Index Log2Dim>
1178template<
typename T, Index Log2Dim>
1185 this->
fill(background,
false);
1186 }
else if (clipBBox.
isInside(nodeBBox)) {
1198 int &x = xyz.
x(), &y = xyz.
y(), &z = xyz.
z();
1199 for (x = nodeBBox.
min().
x(); x <= nodeBBox.
max().
x(); ++x) {
1200 for (y = nodeBBox.
min().
y(); y <= nodeBBox.
max().
y(); ++y) {
1201 for (z = nodeBBox.
min().
z(); z <= nodeBBox.
max().
z(); ++z) {
1218template<
typename T, Index Log2Dim>
1225 clippedBBox.intersect(bbox);
1226 if (!clippedBBox)
return;
1228 for (
Int32 x = clippedBBox.min().x(); x <= clippedBBox.max().x(); ++x) {
1229 const Index offsetX = (x & (
DIM-1u)) << 2*Log2Dim;
1230 for (
Int32 y = clippedBBox.min().y(); y <= clippedBBox.max().y(); ++y) {
1231 const Index offsetXY = offsetX + ((y & (
DIM-1u)) << Log2Dim);
1232 for (
Int32 z = clippedBBox.min().z(); z <= clippedBBox.max().z(); ++z) {
1233 const Index offset = offsetXY + (z & (
DIM-1u));
1234 mBuffer[offset] = value;
1235 mValueMask.set(offset, active);
1241template<
typename T, Index Log2Dim>
1245 mBuffer.fill(value);
1248template<
typename T, Index Log2Dim>
1252 mBuffer.fill(value);
1253 mValueMask.set(active);
1260template<
typename T, Index Log2Dim>
1261template<
typename DenseT>
1265 mBuffer.loadValues();
1267 using DenseValueType =
typename DenseT::ValueType;
1269 const size_t xStride = dense.xStride(), yStride = dense.yStride(), zStride = dense.zStride();
1270 const Coord& min = dense.bbox().min();
1271 DenseValueType* t0 = dense.data() + zStride * (bbox.
min()[2] - min[2]);
1272 const T* s0 = &mBuffer[bbox.
min()[2] & (
DIM-1u)];
1273 for (
Int32 x = bbox.
min()[0], ex = bbox.
max()[0] + 1; x < ex; ++x) {
1274 DenseValueType* t1 = t0 + xStride * (x - min[0]);
1275 const T* s1 = s0 + ((x & (
DIM-1u)) << 2*Log2Dim);
1276 for (
Int32 y = bbox.
min()[1], ey = bbox.
max()[1] + 1; y < ey; ++y) {
1277 DenseValueType* t2 = t1 + yStride * (y - min[1]);
1278 const T* s2 = s1 + ((y & (
DIM-1u)) << Log2Dim);
1279 for (
Int32 z = bbox.
min()[2], ez = bbox.
max()[2] + 1; z < ez; ++z, t2 += zStride) {
1280 *t2 = DenseValueType(*s2++);
1287template<
typename T, Index Log2Dim>
1288template<
typename DenseT>
1295 using DenseValueType =
typename DenseT::ValueType;
1297 const size_t xStride = dense.xStride(), yStride = dense.yStride(), zStride = dense.zStride();
1298 const Coord& min = dense.bbox().min();
1300 const DenseValueType* s0 = dense.data() + zStride * (bbox.
min()[2] - min[2]);
1302 for (
Int32 x = bbox.
min()[0], ex = bbox.
max()[0]+1; x < ex; ++x) {
1303 const DenseValueType* s1 = s0 + xStride * (x - min[0]);
1305 for (
Int32 y = bbox.
min()[1], ey = bbox.
max()[1]+1; y < ey; ++y) {
1306 const DenseValueType* s2 = s1 + yStride * (y - min[1]);
1308 for (
Int32 z = bbox.
min()[2], ez = bbox.
max()[2]+1; z < ez; ++z, ++n2, s2 += zStride) {
1310 mValueMask.setOff(n2);
1311 mBuffer[n2] = background;
1313 mValueMask.setOn(n2);
1325template<
typename T, Index Log2Dim>
1329 mValueMask.load(is);
1333template<
typename T, Index Log2Dim>
1337 mValueMask.save(os);
1345template<
typename T, Index Log2Dim>
1352 is,
nullptr,
SIZE, mValueMask, fromHalf);
1361template<
typename T, Index Log2Dim>
1369template<
typename T, Index Log2Dim>
1374 const bool seekable = meta && meta->seekable();
1376#ifdef OPENVDB_USE_DELAYED_LOADING
1377 std::streamoff maskpos = is.tellg();
1382 mValueMask.seek(is);
1385 mValueMask.load(is);
1388 int8_t numBuffers = 1;
1394 is.read(
reinterpret_cast<char*
>(&numBuffers),
sizeof(int8_t));
1401 mValueMask.setOff();
1402 mBuffer.setOutOfCore(
false);
1404#ifdef OPENVDB_USE_DELAYED_LOADING
1409 io::MappedFile::Ptr mappedFile = io::getMappedFilePtr(is);
1410 const bool delayLoad = ((mappedFile.get() !=
nullptr) && clipBBox.
isInside(nodeBBox));
1413 mBuffer.setOutOfCore(
true);
1414 mBuffer.mFileInfo =
new typename Buffer::FileInfo;
1415 mBuffer.mFileInfo->meta = meta;
1416 mBuffer.mFileInfo->bufpos = is.tellg();
1417 mBuffer.mFileInfo->mapping = mappedFile;
1420 mBuffer.mFileInfo->maskpos = maskpos;
1427 mBuffer.setOutOfCore(
false);
1432 background = *
static_cast<const T*
>(bgPtr);
1434 this->
clip(clipBBox, background);
1435#ifdef OPENVDB_USE_DELAYED_LOADING
1440 if (numBuffers > 1) {
1445 for (
int i = 1; i < numBuffers; ++i) {
1455 if (meta) meta->setLeaf(meta->leaf() + 1);
1459template<
typename T, Index Log2Dim>
1464 mValueMask.save(os);
1466 mBuffer.loadValues();
1476template<
typename T, Index Log2Dim>
1480 return mOrigin == other.mOrigin &&
1482 mBuffer == other.mBuffer;
1486template<
typename T, Index Log2Dim>
1492 return sizeof(*this) + mBuffer.memUsage() -
sizeof(mBuffer);
1496template<
typename T, Index Log2Dim>
1502 return sizeof(*this) + mBuffer.memUsageIfLoaded() -
sizeof(mBuffer);
1506template<
typename T, Index Log2Dim>
1511 if (bbox.
isInside(this_bbox))
return;
1523template<
typename T, Index Log2Dim>
1524template<
typename OtherType, Index OtherLog2Dim>
1529 return (Log2Dim == OtherLog2Dim && mValueMask == other->
getValueMask());
1532template<
typename T, Index Log2Dim>
1538 if (!mValueMask.isConstant(state))
return false;
1539 firstValue = mBuffer[0];
1546template<
typename T, Index Log2Dim>
1553 if (!mValueMask.isConstant(state))
return false;
1554 minValue = maxValue = mBuffer[0];
1556 const T& v = mBuffer[i];
1558 if ((maxValue - v) > tolerance)
return false;
1560 }
else if (v > maxValue) {
1561 if ((v - minValue) > tolerance)
return false;
1568template<
typename T, Index Log2Dim>
1572 std::unique_ptr<T[]> data(
nullptr);
1573 if (tmp ==
nullptr) {
1577 if (tmp != mBuffer.data()) {
1578 const T* src = mBuffer.data();
1579 for (T* dst = tmp; dst-tmp <
NUM_VALUES;) *dst++ = *src++;
1581 static const size_t midpoint = (
NUM_VALUES - 1) >> 1;
1582 std::nth_element(tmp, tmp + midpoint, tmp +
NUM_VALUES);
1583 return tmp[midpoint];
1586template<
typename T, Index Log2Dim>
1590 const Index count = mValueMask.countOn();
1594 }
else if (count == 0) {
1597 std::unique_ptr<T[]> data(
nullptr);
1598 if (tmp ==
nullptr) {
1599 data.reset(
new T[count]);
1603 T *begin = tmp - count;
1604 const size_t midpoint = (count - 1) >> 1;
1605 std::nth_element(begin, begin + midpoint, tmp);
1606 value = begin[midpoint];
1610template<
typename T, Index Log2Dim>
1614 const Index count = mValueMask.countOff();
1618 }
else if (count == 0) {
1621 std::unique_ptr<T[]> data(
nullptr);
1622 if (tmp ==
nullptr) {
1623 data.reset(
new T[count]);
1627 T *begin = tmp - count;
1628 const size_t midpoint = (count - 1) >> 1;
1629 std::nth_element(begin, begin + midpoint, tmp);
1630 value = begin[midpoint];
1637template<
typename T, Index Log2Dim>
1644template<
typename T, Index Log2Dim>
1653template<
typename T, Index Log2Dim>
1654template<
typename AccessorT>
1657 const ValueType& val,
bool active, AccessorT&)
1659 this->
addTile(level, xyz, val, active);
1666template<
typename T, Index Log2Dim>
1676 for (
iter = this->mValueMask.beginOff();
iter; ++
iter) {
1679 inactiveValue = newBackground;
1687template<
typename T, Index Log2Dim>
1688template<MergePolicy Policy>
1699 if (mValueMask.isOff(n)) {
1700 mBuffer[n] = other.mBuffer[n];
1701 mValueMask.setOn(n);
1707template<
typename T, Index Log2Dim>
1708template<MergePolicy Policy>
1716template<
typename T, Index Log2Dim>
1717template<MergePolicy Policy>
1725 if (!tileActive)
return;
1729 mBuffer[n] = tileValue;
1730 mValueMask.setOn(n);
1736template<
typename T, Index Log2Dim>
1737template<
typename OtherType>
1744template<
typename T, Index Log2Dim>
1745template<
typename OtherType>
1753template<
typename T, Index Log2Dim>
1754template<
typename OtherType>
1762template<
typename T, Index Log2Dim>
1769 mBuffer[i] = -mBuffer[i];
1777template<
typename T, Index Log2Dim>
1778template<
typename CombineOp>
1796template<
typename T, Index Log2Dim>
1797template<
typename CombineOp>
1817template<
typename T, Index Log2Dim>
1818template<
typename CombineOp,
typename OtherType>
1821 bool valueIsActive, CombineOp& op)
1828 op(args.
setARef(other.mBuffer[i])
1836template<
typename T, Index Log2Dim>
1837template<
typename CombineOp,
typename OtherNodeT>
1840 bool valueIsActive, CombineOp& op)
1847 op(args.
setBRef(other.mBuffer[i])
1855template<
typename T, Index Log2Dim>
1856template<
typename CombineOp,
typename OtherNodeT>
1864 mValueMask.set(i, b0.
valueMask().
isOn(i) || b1.valueMask().isOn(i));
1865 op(args.
setARef(b0.mBuffer[i])
1878template<
typename T, Index Log2Dim>
1882 for (
Index32 i = 0, N = buf.
size(); i < N; ++i) os << buf.mData[i] <<
", ";
#define OPENVDB_ASSERT(X)
Definition Assert.h:41
This struct collects both input and output arguments to "grid combiner" functors used with the tree::...
Definition Types.h:640
CombineArgs & setARef(const AValueType &a)
Redirect the A value to a new external source.
Definition Types.h:692
CombineArgs & setBIsActive(bool b)
Set the active state of the B value.
Definition Types.h:708
CombineArgs & setResultRef(AValueType &val)
Redirect the result value to a new external destination.
Definition Types.h:696
CombineArgs & setBRef(const BValueType &b)
Redirect the B value to a new external source.
Definition Types.h:694
bool resultIsActive() const
Definition Types.h:703
CombineArgs & setAIsActive(bool b)
Set the active state of the A value.
Definition Types.h:706
static CoordBBox inf()
Return an "infinite" bounding box, as defined by the Coord value range.
Definition Coord.h:322
static CoordBBox createCube(const Coord &min, ValueType dim)
Definition Coord.h:316
Int32 ValueType
Definition Coord.h:33
Tag dispatch class that distinguishes constructors during file input.
Definition Types.h:760
Tag dispatch class that distinguishes topology copy constructors from deep copy constructors.
Definition Types.h:754
Axis-aligned bounding box of signed integer coordinates.
Definition Coord.h:252
void translate(const Coord &t)
Translate this bounding box by (tx, ty, tz).
Definition Coord.h:461
void expand(ValueType padding)
Pad this bounding box with the specified padding.
Definition Coord.h:421
const Coord & min() const
Definition Coord.h:324
bool hasOverlap(const CoordBBox &b) const
Return true if the given bounding box overlaps with this bounding box.
Definition Coord.h:415
const Coord & max() const
Definition Coord.h:325
bool isInside(const Coord &xyz) const
Return true if point (x, y, z) is inside this bounding box.
Definition Coord.h:403
void intersect(const CoordBBox &bbox)
Intersect this bounding box with the given bounding box.
Definition Coord.h:447
void reset()
Definition Coord.h:330
Signed (x, y, z) 32-bit integer coordinates.
Definition Coord.h:26
Int32 y() const
Definition Coord.h:132
Int32 x() const
Definition Coord.h:131
Coord & setZ(Int32 z)
Definition Coord.h:82
Coord & setY(Int32 y)
Definition Coord.h:81
Int32 z() const
Definition Coord.h:133
Coord & setX(Int32 x)
Definition Coord.h:80
Base class for iterators over internal and leaf nodes.
Definition Iterator.h:30
Index pos() const
Definition Iterator.h:60
LeafNode & parent() const
Definition Iterator.h:50
Array of fixed size 23Log2Dim that stores the voxel values of a LeafNode.
Definition LeafBuffer.h:32
static Index size()
Return the number of values contained in this buffer.
Definition LeafBuffer.h:112
Templated block class to hold specific data types and a fixed number of values determined by Log2Dim....
Definition LeafNode.h:39
void stealNodes(ArrayT &, const ValueType &, bool)
Definition LeafNode.h:742
void setValueOff(Index offset, const ValueType &val)
Set the value of the voxel at the given offset and mark the voxel as inactive.
Definition LeafNode.h:1144
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:636
bool isValueOn(Index offset) const
Return true if the voxel at the given offset is active.
Definition LeafNode.h:509
void addTile(Index offset, const ValueType &, bool)
Definition LeafNode.h:1646
DenseIter< const LeafNode, const ValueType, ChildAll > ChildAllCIter
Definition LeafNode.h:327
static Index64 onTileCount()
Definition LeafNode.h:148
void getOrigin(Int32 &x, Int32 &y, Int32 &z) const
Definition LeafNode.h:178
static Coord offsetToLocalCoord(Index n)
Return the local coordinates for a linear table offset, where offset 0 has coordinates (0,...
Definition LeafNode.h:1079
ValueIter< MaskOffIterator, LeafNode, const ValueType, ValueOff > ValueOffIter
Definition LeafNode.h:318
ChildOnCIter cbeginChildOn() const
Definition LeafNode.h:351
SharedPtr< LeafNode > Ptr
Definition LeafNode.h:46
CoordBBox getNodeBoundingBox() const
Return the bounding box of this node, i.e., the full index space spanned by this leaf node.
Definition LeafNode.h:170
NodeMaskType & getValueMask()
Definition LeafNode.h:914
bool isConstant(ValueType &minValue, ValueType &maxValue, bool &state, const ValueType &tolerance=zeroVal< ValueType >()) const
Definition LeafNode.h:1548
void setValueOn(Index offset)
Mark the voxel at the given offset as active but don't change its value.
Definition LeafNode.h:451
bool isChildMaskOn(Index) const
Definition LeafNode.h:917
ChildOnCIter beginChildOn() const
Definition LeafNode.h:352
ChildOnIter beginChildOn()
Definition LeafNode.h:353
LeafNode()
Default constructor.
Definition LeafNode.h:961
static Index64 nonLeafCount()
Return the non-leaf count for this node, which is zero.
Definition LeafNode.h:138
bool isValueOn(const Coord &xyz) const
Return true if the voxel at the given coordinates is active.
Definition LeafNode.h:507
ValueOnIter endValueOn()
Definition LeafNode.h:341
void writeTopology(std::ostream &os, bool toHalf=false) const
Write out just the topology.
Definition LeafNode.h:1335
util::NodeMask< Log2Dim > NodeMaskType
Definition LeafNode.h:45
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:1263
bool isChildMaskOff() const
Definition LeafNode.h:919
ValueOffCIter cbeginValueOff() const
Definition LeafNode.h:332
Index32 transientData() const
Return the transient data value.
Definition LeafNode.h:190
static Index32 childCount()
Return the child count for this node, which is zero.
Definition LeafNode.h:140
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:457
LeafNode(const LeafNode &)
Deep copy constructor.
Definition LeafNode.h:990
static Index getChildDim()
Return the dimension of child nodes of this LeafNode, which is one for voxels.
Definition LeafNode.h:130
bool operator!=(const LeafNode &other) const
Definition LeafNode.h:204
static Index64 leafCount()
Return the leaf count for this node, which is one.
Definition LeafNode.h:132
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:1290
ChildIter< MaskOnIterator, LeafNode, ChildOn > ChildOnIter
Definition LeafNode.h:322
void setValueMask(const NodeMaskType &mask)
Definition LeafNode.h:916
ChildOnIter endChildOn()
Definition LeafNode.h:363
ValueAllIter endValueAll()
Definition LeafNode.h:347
LeafNode * touchLeaf(const Coord &)
Return a pointer to this node.
Definition LeafNode.h:752
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:1162
LeafNode * probeLeaf(const Coord &)
Definition LeafNode.h:763
bool isValueMaskOff() const
Definition LeafNode.h:912
void prune(const ValueType &=zeroVal< ValueType >())
This function exists only to enable template instantiation.
Definition LeafNode.h:731
bool isValueMaskOn() const
Definition LeafNode.h:910
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:1756
LeafBuffer< ValueType, Log2Dim > Buffer
Definition LeafNode.h:43
void getNodes(ArrayT &) const
Definition LeafNode.h:741
void setValuesOff()
Mark all voxels as inactive but don't change their values.
Definition LeafNode.h:504
ValueAllCIter endValueAll() const
Definition LeafNode.h:346
Index medianOff(ValueType &value, ValueType *tmp=nullptr) const
Computes the median value of all the inactive voxels in this node.
Definition LeafNode.h:1612
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:453
Index64 onLeafVoxelCount() const
Definition LeafNode.h:146
ChildOffCIter endChildOff() const
Definition LeafNode.h:365
void merge(const ValueType &tileValue, bool tileActive)
Definition LeafNode.h:1719
bool getValueUnsafe(Index offset, ValueType &value) const
Return true if the voxel at the given offset is active and set value.
Definition LeafNode.h:872
~LeafNode()
Destructor.
Definition LeafNode.h:1049
bool probeValue(Index offset, ValueType &val) const
Return true if the voxel at the given offset is active.
Definition LeafNode.h:1127
ValueAllCIter cbeginValueAll() const
Definition LeafNode.h:335
NodeT * probeNode(const Coord &)
Definition LeafNode.h:738
void readTopology(std::istream &is, bool fromHalf=false)
Read in just the topology.
Definition LeafNode.h:1327
ChildIter< MaskOffIterator, LeafNode, ChildOff > ChildOffIter
Definition LeafNode.h:324
ValueOnCIter beginValueOn() const
Definition LeafNode.h:330
static void evalNodeOrigin(Coord &xyz)
Compute the origin of the leaf node that contains the voxel with the given coordinates.
Definition LeafNode.h:928
const Buffer & buffer() const
Definition LeafNode.h:377
LeafNode * probeLeafAndCache(const Coord &, AccessorT &)
Definition LeafNode.h:765
void setValueMaskOn(Index n)
Definition LeafNode.h:922
void setValueOnlyUnsafe(Index offset, const ValueType &value)
Set the value of the voxel at the given coordinates but don't change its active state.
Definition LeafNode.h:876
Index medianOn(ValueType &value, ValueType *tmp=nullptr) const
Computes the median value of all the active voxels in this node.
Definition LeafNode.h:1588
Index64 offLeafVoxelCount() const
Definition LeafNode.h:147
const LeafNode * probeLeaf(const Coord &) const
Definition LeafNode.h:774
const ValueType & getValue(Index offset) const
Return the value of the voxel at the given linear offset.
Definition LeafNode.h:1111
void addTile(Index level, const Coord &, const ValueType &, bool)
Definition LeafNode.h:1639
ChildIter< MaskOffIterator, const LeafNode, ChildOff > ChildOffCIter
Definition LeafNode.h:325
void resetBackground(const ValueType &oldBackground, const ValueType &newBackground)
Replace inactive occurrences of oldBackground with newBackground, and inactive occurrences of -oldBac...
Definition LeafNode.h:1668
void setOrigin(const Coord &origin)
Set the grid index coordinates of this node's local origin.
Definition LeafNode.h:173
ValueType medianAll(ValueType *tmp=nullptr) const
Computes the median value of all the active AND inactive voxels in this node.
Definition LeafNode.h:1570
const Coord & origin() const
Definition LeafNode.h:176
static Index getValueLevel(const Coord &)
Return the level (i.e., 0) at which leaf node values reside.
Definition LeafNode.h:426
bool isInactive() const
Return true if all of this node's values are inactive.
Definition LeafNode.h:861
void modifyValueAndActiveState(const Coord &xyz, const ModifyOp &op)
Apply a functor to the voxel at the given coordinates.
Definition LeafNode.h:488
bool isValueMaskOff(Index n) const
Definition LeafNode.h:911
ValueOnCIter cendValueOn() const
Definition LeafNode.h:339
bool isAllocated() const
Return true if memory for this node's buffer has been allocated.
Definition LeafNode.h:155
static Index getValueLevelAndCache(const Coord &, AccessorT &)
Return the LEVEL (=0) at which leaf node values reside.
Definition LeafNode.h:656
static Index numValues()
Return the total number of voxels represented by this LeafNode.
Definition LeafNode.h:124
const ValueType & getValueUnsafe(Index offset) const
Return the value of the voxel at the given offset.
Definition LeafNode.h:870
void setActiveStateUnsafe(Index offset, bool on)
Set the active state of the voxel at the given offset but don't change its value.
Definition LeafNode.h:874
ValueOffCIter beginValueOff() const
Definition LeafNode.h:333
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:618
LeafNode(PartialCreate, const Coord &coords, const ValueType &value=zeroVal< ValueType >(), bool active=false)
"Partial creation" constructor used during file input
Definition LeafNode.h:980
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:645
const ValueType & getValueAndCache(const Coord &xyz, AccessorT &) const
Return the value of the voxel at the given coordinates.
Definition LeafNode.h:571
ChildAllCIter cbeginChildAll() const
Definition LeafNode.h:357
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:1747
ChildOffIter endChildOff()
Definition LeafNode.h:366
static const Index NUM_VOXELS
Definition LeafNode.h:53
void clip(const CoordBBox &, const ValueType &background)
Set all voxels that lie outside the given axis-aligned box to the background.
Definition LeafNode.h:1180
ChildAllIter beginChildAll()
Definition LeafNode.h:359
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:459
void combine2(const ValueType &, const OtherNodeT &other, bool valueIsActive, CombineOp &)
Definition LeafNode.h:1839
ValueIter< MaskDenseIterator, LeafNode, const ValueType, ValueAll > ValueAllIter
Definition LeafNode.h:320
static Index getLevel()
Return the level of this node, which by definition is zero for LeafNodes.
Definition LeafNode.h:126
ValueIter< MaskOffIterator, const LeafNode, const ValueType, ValueOff > ValueOffCIter
Definition LeafNode.h:319
bool isValueOnAndCache(const Coord &xyz, AccessorT &) const
Return true if the voxel at the given coordinates is active.
Definition LeafNode.h:579
void addLeaf(LeafNode *)
Definition LeafNode.h:732
static const Index DIM
Definition LeafNode.h:51
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:1154
ValueOnIter beginValueOn()
Definition LeafNode.h:331
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:602
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:1739
static const Index LEVEL
Definition LeafNode.h:55
NodeT * probeNodeAndCache(const Coord &, AccessorT &)
Definition LeafNode.h:756
const ValueType & getFirstValue() const
Return a const reference to the first value in the buffer.
Definition LeafNode.h:661
ChildOffCIter cbeginChildOff() const
Definition LeafNode.h:354
ChildOffIter beginChildOff()
Definition LeafNode.h:356
bool isChildMaskOff(Index) const
Definition LeafNode.h:918
void readBuffers(std::istream &is, const CoordBBox &bbox, bool fromHalf=false)
Read buffers that intersect the given bounding box.
Definition LeafNode.h:1371
Index64 onVoxelCount() const
Return the number of voxels marked On.
Definition LeafNode.h:143
ChildOffCIter beginChildOff() const
Definition LeafNode.h:355
static Index coordToOffset(const Coord &xyz)
Return the linear table offset of the given global or local coordinates.
Definition LeafNode.h:1069
static Index64 offTileCount()
Definition LeafNode.h:149
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition LeafNode.h:439
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:1526
ValueOffIter endValueOff()
Definition LeafNode.h:344
void setValueOff(Index offset)
Mark the voxel at the given offset as inactive but don't change its value.
Definition LeafNode.h:441
const LeafNode * probeConstLeafAndCache(const Coord &, AccessorT &) const
Definition LeafNode.h:771
ChildAllCIter endChildAll() const
Definition LeafNode.h:368
void nodeCount(std::vector< Index64 > &) const
no-op
Definition LeafNode.h:134
const NodeT * probeConstNodeAndCache(const Coord &, AccessorT &) const
Definition LeafNode.h:776
ValueOnCIter cbeginValueOn() const
Definition LeafNode.h:329
void writeBuffers(std::ostream &os, bool toHalf=false) const
Write buffers to a stream.
Definition LeafNode.h:1461
static Index log2dim()
Return log2 of the dimension of this LeafNode, e.g. 3 if dimensions are 8^3.
Definition LeafNode.h:118
void combine(const LeafNode &other, CombineOp &op)
Definition LeafNode.h:1780
static void getNodeLog2Dims(std::vector< Index > &dims)
Append the Log2Dim of this LeafNode to the specified vector.
Definition LeafNode.h:128
ChildOnCIter endChildOn() const
Definition LeafNode.h:362
const LeafNode * probeConstLeaf(const Coord &) const
Return a const pointer to this node.
Definition LeafNode.h:769
void setValueOnUnsafe(Index offset)
Mark the voxel at the given offset as active but don't change its value.
Definition LeafNode.h:878
void setValueOnUnsafe(Index offset, const ValueType &value)
Set the value of the voxel at the given coordinates and mark the voxel as active.
Definition LeafNode.h:880
ChildOnCIter cendChildOn() const
Definition LeafNode.h:361
void merge(const LeafNode &other, const ValueType &, const ValueType &)
Definition LeafNode.h:1710
static bool hasActiveTiles()
Return false since leaf nodes never contain tiles.
Definition LeafNode.h:516
ChildAllCIter cendChildAll() const
Definition LeafNode.h:367
Index64 memUsageIfLoaded() const
Definition LeafNode.h:1498
void combine2(const LeafNode &other, const OtherType &, bool valueIsActive, CombineOp &)
Definition LeafNode.h:1820
void fill(const ValueType &value, bool active)
Set all voxels to the specified value and active state.
Definition LeafNode.h:1250
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:1220
LeafNode(const LeafNode< OtherValueType, Log2Dim > &other, const ValueType &offValue, const ValueType &onValue, TopologyCopy)
Topology copy constructor.
Definition LeafNode.h:1035
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:481
ChildAllIter endChildAll()
Definition LeafNode.h:369
size_t streamingSize(bool toHalf=false) const
void setValueMask(Index n, bool on)
Definition LeafNode.h:921
const NodeMaskType & valueMask() const
Definition LeafNode.h:915
Index64 offVoxelCount() const
Return the number of voxels marked Off.
Definition LeafNode.h:145
typename NodeMaskType::OffIterator MaskOffIterator
Definition LeafNode.h:208
void setValueOff(const Coord &xyz, const ValueType &val)
Set the value of the voxel at the given coordinates and mark the voxel as inactive.
Definition LeafNode.h:1137
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:376
void readBuffers(std::istream &is, bool fromHalf=false)
Read buffers from a stream.
Definition LeafNode.h:1363
bool isConstant(ValueType &firstValue, bool &state, const ValueType &tolerance=zeroVal< ValueType >()) const
Definition LeafNode.h:1534
T BuildType
Definition LeafNode.h:41
ValueAllCIter cendValueAll() const
Definition LeafNode.h:345
friend class LeafNode
Definition LeafNode.h:892
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:524
static const Index NUM_VALUES
Definition LeafNode.h:52
void negate()
Definition LeafNode.h:1764
Coord offsetToGlobalCoord(Index n) const
Return the global coordinates for a linear table offset.
Definition LeafNode.h:1093
ChildAllCIter beginChildAll() const
Definition LeafNode.h:358
const LeafNode * probeLeafAndCache(const Coord &, AccessorT &) const
Definition LeafNode.h:773
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:627
void getOrigin(Coord &origin) const
Definition LeafNode.h:177
const ValueType & getValue(const Coord &xyz) const
Return the value of the voxel at the given coordinates.
Definition LeafNode.h:1104
void setValuesOn()
Mark all voxels as active but don't change their values.
Definition LeafNode.h:502
void setTransientData(Index32 transientData)
Set the transient data value.
Definition LeafNode.h:192
static Index size()
Return the total number of voxels represented by this LeafNode.
Definition LeafNode.h:122
ChildOffCIter cendChildOff() const
Definition LeafNode.h:364
void skipCompressedValues(bool seekable, std::istream &, bool fromHalf)
Definition LeafNode.h:1347
void fill(const ValueType &value)
Set all voxels to the specified value but don't change their active states.
Definition LeafNode.h:1243
typename NodeMaskType::OnIterator MaskOnIterator
Definition LeafNode.h:207
static const Index LOG2DIM
Definition LeafNode.h:49
bool operator==(const LeafNode &other) const
Check for buffer, state and origin equivalence.
Definition LeafNode.h:1478
static const Index SIZE
Definition LeafNode.h:54
void evalActiveBoundingBox(CoordBBox &bbox, bool visitVoxels=true) const
Definition LeafNode.h:1508
bool isEmpty() const
Return true if this node has no active voxels.
Definition LeafNode.h:151
void combine2(const LeafNode &b0, const OtherNodeT &b1, CombineOp &)
Definition LeafNode.h:1858
ValueIter< MaskOnIterator, LeafNode, const ValueType, ValueOn > ValueOnIter
Definition LeafNode.h:316
void merge(const LeafNode &)
Definition LeafNode.h:1690
ValueIter< MaskOnIterator, const LeafNode, const ValueType, ValueOn > ValueOnCIter
Definition LeafNode.h:317
ValueOffIter beginValueOff()
Definition LeafNode.h:334
const NodeT * probeConstNode(const Coord &) const
Definition LeafNode.h:740
void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition LeafNode.h:449
Buffer & buffer()
Definition LeafNode.h:378
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:593
void setValueOnly(Index offset, const ValueType &val)
Set the value of the voxel at the given offset but don't change its active state.
Definition LeafNode.h:1169
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:431
ChildIter< MaskOnIterator, const LeafNode, ChildOn > ChildOnCIter
Definition LeafNode.h:323
bool allocate()
Allocate memory for this node's buffer if it has not already been allocated.
Definition LeafNode.h:157
const NodeMaskType & getValueMask() const
Definition LeafNode.h:913
void addTileAndCache(Index, const Coord &, const ValueType &, bool, AccessorT &)
Definition LeafNode.h:1656
static const Index TOTAL
Definition LeafNode.h:50
void addLeafAndCache(LeafNode *, AccessorT &)
Definition LeafNode.h:734
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:467
ValueOffCIter cendValueOff() const
Definition LeafNode.h:342
void setValueMaskOff(Index n)
Definition LeafNode.h:923
Index64 memUsage() const
Return the memory in bytes occupied by this node.
Definition LeafNode.h:1488
bool isDense() const
Return true if this node contains only active voxels.
Definition LeafNode.h:153
ValueOffCIter endValueOff() const
Definition LeafNode.h:343
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:584
bool isValueOff(const Coord &xyz) const
Return true if the voxel at the given coordinates is inactive.
Definition LeafNode.h:511
std::string str() const
Return a string representation of this node.
Definition LeafNode.h:1056
NodeT * stealNode(const Coord &, const ValueType &, bool)
Definition LeafNode.h:736
void setValueOffUnsafe(Index offset)
Mark the voxel at the given offset as inactive but don't change its value.
Definition LeafNode.h:882
T ValueType
Definition LeafNode.h:42
bool probeValue(const Coord &xyz, ValueType &val) const
Return true if the voxel at the given coordinates is active.
Definition LeafNode.h:1120
ValueOnCIter endValueOn() const
Definition LeafNode.h:340
typename NodeMaskType::DenseIterator MaskDenseIterator
Definition LeafNode.h:209
void voxelizeActiveTiles(bool=true)
No-op.
Definition LeafNode.h:673
void modifyValueAndActiveStateAndCache(const Coord &xyz, const ModifyOp &op, AccessorT &)
Definition LeafNode.h:610
bool isValueOff(Index offset) const
Return true if the voxel at the given offset is inactive.
Definition LeafNode.h:513
LeafNode * touchLeafAndCache(const Coord &, AccessorT &)
Definition LeafNode.h:754
LeafNode(const Coord &coords, const ValueType &value=zeroVal< ValueType >(), bool active=false)
Constructor.
Definition LeafNode.h:970
const ValueType & getLastValue() const
Return a const reference to the last value in the buffer.
Definition LeafNode.h:663
ValueAllCIter beginValueAll() const
Definition LeafNode.h:336
static Index dim()
Return the number of voxels in each coordinate dimension.
Definition LeafNode.h:120
void setValueOffUnsafe(Index offset, const ValueType &value)
Set the value of the voxel at the given coordinates and mark the voxel as active.
Definition LeafNode.h:884
ValueIter< MaskDenseIterator, const LeafNode, const ValueType, ValueAll > ValueAllCIter
Definition LeafNode.h:321
void combine(const ValueType &value, bool valueIsActive, CombineOp &op)
Definition LeafNode.h:1799
DenseIter< LeafNode, ValueType, ChildAll > ChildAllIter
Definition LeafNode.h:326
bool isValueMaskOn(Index n) const
Definition LeafNode.h:909
LeafNode< ValueType, Log2Dim > LeafNodeType
Definition LeafNode.h:44
LeafNode(const LeafNode< OtherValueType, Log2Dim > &other, const ValueType &background, TopologyCopy)
Topology copy constructor.
Definition LeafNode.h:1022
ValueAllIter beginValueAll()
Definition LeafNode.h:337
LeafNode(const LeafNode< OtherValueType, Log2Dim > &other)
Value conversion copy constructor.
Definition LeafNode.h:1003
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
DenseMaskIterator< NodeMask > DenseIterator
Definition NodeMasks.h:350
bool isOn(Index32 n) const
Return true if the nth bit is on.
Definition NodeMasks.h:502
OnMaskIterator< NodeMask > OnIterator
Definition NodeMasks.h:348
void setOn(Index32 n)
Set the nth bit on.
Definition NodeMasks.h:452
OffMaskIterator< NodeMask > OffIterator
Definition NodeMasks.h:349
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:646
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:55
void readCompressedValues(std::istream &is, ValueT *destBuf, Index destCount, const MaskT &valueMask, bool fromHalf)
Definition Compression.h:466
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:248
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
bool isExactlyEqual(const T0 &a, const T1 &b)
Return true if a is exactly equal to b.
Definition Math.h:443
Definition TreeIterator.h:30
std::ostream & operator<<(std::ostream &os, const typename LeafNode< T, Log2Dim >::Buffer &buf)
Definition LeafNode.h:1880
Index32 Index
Definition Types.h:54
constexpr T zeroVal()
Return the value of type T that corresponds to zero.
Definition Math.h:70
@ OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION
Definition version.h.in:262
uint32_t Index32
Definition Types.h:52
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:579
@ MERGE_ACTIVE_STATES_AND_NODES
Definition Types.h:580
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:293
typename std::remove_const< ValueT >::type NonConstValueType
Definition Iterator.h:184
DenseIteratorBase()
Definition Iterator.h:188
ChildIter(const MaskIterT &iter, NodeT *parent)
Definition LeafNode.h:284
ChildIter()
Definition LeafNode.h:283
Definition LeafNode.h:213
Definition LeafNode.h:213
DenseIter(const MaskDenseIterator &iter, NodeT *parent)
Definition LeafNode.h:296
void unsetItem(Index pos, const ValueT &value) const
Definition LeafNode.h:309
bool getItem(Index pos, void *&child, NonConstValueT &value) const
Definition LeafNode.h:298
DenseIter()
Definition LeafNode.h:295
typename BaseT::NonConstValueType NonConstValueT
Definition LeafNode.h:293
DenseIteratorBase< MaskDenseIterator, DenseIter, NodeT, void, ValueT > BaseT
Definition LeafNode.h:292
SameConfiguration<OtherNodeType>::value is true if and only if OtherNodeType is the type of a LeafNod...
Definition LeafNode.h:65
static const bool value
Definition LeafNode.h:66
ValueConverter<T>::Type is the type of a LeafNode having the same dimensions as this node but a diffe...
Definition LeafNode.h:60
LeafNode< OtherValueType, Log2Dim > Type
Definition LeafNode.h:60
void setValue(const ValueT &value) const
Definition LeafNode.h:251
void modifyValue(const ModifyOp &op) const
Definition LeafNode.h:270
ValueT & getItem(Index pos) const
Definition LeafNode.h:234
void setItem(Index pos, const ValueT &value) const
Definition LeafNode.h:238
ValueIter(const MaskIterT &iter, NodeT *parent)
Definition LeafNode.h:227
ValueT & getValue() const
Definition LeafNode.h:235
std::conditional_t< std::is_const_v< NodeT >, ValueT, std::remove_const_t< ValueT > > ValueType
Definition LeafNode.h:222
ValueIter()
Definition LeafNode.h:226
void modifyItem(Index n, const ModifyOp &op) const
Definition LeafNode.h:255
SparseIteratorBase< MaskIterT, ValueIter, NodeT, ValueT > BaseT
Definition LeafNode.h:224
Definition LeafNode.h:212
Definition LeafNode.h:212
static const bool value
Definition LeafNode.h:952
Definition LeafNode.h:949
static const bool value
Definition LeafNode.h:949
SparseIteratorBase()
Definition Iterator.h:122
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:218