4 #ifndef OPENVDB_TREE_LEAF_NODE_MASK_HAS_BEEN_INCLUDED 5 #define OPENVDB_TREE_LEAF_NODE_MASK_HAS_BEEN_INCLUDED 7 #include <openvdb/version.h> 17 #include <type_traits> 29 template<Index Log2Dim>
41 static const Index LOG2DIM = Log2Dim;
42 static const Index TOTAL = Log2Dim;
43 static const Index DIM = 1 << TOTAL;
44 static const Index NUM_VALUES = 1 << 3 * Log2Dim;
45 static const Index NUM_VOXELS = NUM_VALUES;
46 static const Index SIZE = NUM_VALUES;
51 template<
typename OtherValueType>
56 template<
typename OtherNodeType>
57 struct SameConfiguration {
68 explicit LeafNode(
const Coord& xyz,
bool value =
false,
bool dummy =
false);
77 template<
typename OtherValueType>
81 template<
typename ValueType>
87 template<
typename ValueType>
89 template<
typename ValueType>
130 bool isEmpty()
const {
return mBuffer.mData.isOff(); }
132 bool isDense()
const {
return mBuffer.mData.isOn(); }
148 void evalActiveBoundingBox(
CoordBBox& bbox,
bool visitVoxels =
true)
const;
155 void setOrigin(
const Coord& origin) { mOrigin = origin; }
158 const Coord&
origin()
const {
return mOrigin; }
159 void getOrigin(Coord& origin)
const { origin = mOrigin; }
164 static Index coordToOffset(
const Coord& xyz);
167 static Coord offsetToLocalCoord(
Index n);
169 Coord offsetToGlobalCoord(
Index n)
const;
171 #if OPENVDB_ABI_VERSION_NUMBER >= 9 179 std::string str()
const;
183 template<
typename OtherType, Index OtherLog2Dim>
203 void readTopology(std::istream&,
bool fromHalf =
false);
205 void writeTopology(std::ostream&,
bool toHalf =
false)
const;
208 void readBuffers(std::istream&,
bool fromHalf =
false);
209 void readBuffers(std::istream& is,
const CoordBBox&,
bool fromHalf =
false);
211 void writeBuffers(std::ostream&,
bool toHalf =
false)
const;
217 const bool& getValue(
const Coord& xyz)
const;
219 const bool& getValue(
Index offset)
const;
224 bool probeValue(
const Coord& xyz,
bool& val)
const;
230 void setActiveState(
const Coord& xyz,
bool on);
235 void setValueOnly(
const Coord& xyz,
bool val);
237 void setValueOnly(
Index offset,
bool val) { assert(offset<SIZE); mBuffer.setValue(offset,val); }
240 void setValueOff(
const Coord& xyz) { mBuffer.mData.setOff(this->coordToOffset(xyz)); }
245 void setValueOff(
const Coord& xyz,
bool val);
247 void setValueOff(
Index offset,
bool val);
250 void setValueOn(
const Coord& xyz) { mBuffer.mData.setOn(this->coordToOffset(xyz)); }
255 void setValueOn(
const Coord& xyz,
bool val);
257 void setValue(
const Coord& xyz,
bool val) { this->setValueOn(xyz, val); }
259 void setValueOn(
Index offset,
bool val);
263 template<
typename ModifyOp>
264 void modifyValue(
Index offset,
const ModifyOp& op);
267 template<
typename ModifyOp>
268 void modifyValue(
const Coord& xyz,
const ModifyOp& op);
271 template<
typename ModifyOp>
272 void modifyValueAndActiveState(
const Coord& xyz,
const ModifyOp& op);
280 bool isValueOn(
const Coord& xyz)
const {
return mBuffer.mData.isOn(this->coordToOffset(xyz)); }
282 bool isValueOn(
Index offset)
const { assert(offset < SIZE);
return mBuffer.mData.isOn(offset); }
296 void fill(
const bool& value,
bool dummy =
false);
309 template<
typename DenseT>
328 template<
typename DenseT>
333 template<
typename AccessorT>
334 const bool&
getValueAndCache(
const Coord& xyz, AccessorT&)
const {
return this->getValue(xyz);}
338 template<
typename AccessorT>
343 template<
typename AccessorT>
344 void setValueAndCache(
const Coord& xyz,
bool val, AccessorT&) { this->setValueOn(xyz, val); }
349 template<
typename AccessorT>
354 template<
typename AccessorT>
357 this->setValueOff(xyz, value);
363 template<
typename ModifyOp,
typename AccessorT>
366 this->modifyValue(xyz, op);
371 template<
typename ModifyOp,
typename AccessorT>
374 this->modifyValueAndActiveState(xyz, op);
380 template<
typename AccessorT>
383 this->setActiveState(xyz, on);
389 template<
typename AccessorT>
392 return this->probeValue(xyz, val);
397 template<
typename AccessorT>
403 const bool&
getFirstValue()
const {
if (mBuffer.mData.isOn(0))
return Buffer::sOn;
else return Buffer::sOff; }
407 const bool&
getLastValue()
const {
if (mBuffer.mData.isOn(SIZE-1))
return Buffer::sOn;
else return Buffer::sOff; }
412 bool isConstant(
bool& constValue,
bool& state,
bool tolerance = 0)
const;
419 bool medianAll()
const;
448 void negate() { mBuffer.mData.toggle(); }
450 template<MergePolicy Policy>
451 void merge(
const LeafNode& other,
bool bg =
false,
bool otherBG =
false);
452 template<MergePolicy Policy>
void merge(
bool tileValue,
bool tileActive=
false);
464 template<
typename OtherType>
478 template<
typename OtherType>
492 template<
typename OtherType>
495 template<
typename CombineOp>
497 template<
typename CombineOp>
498 void combine(
bool,
bool valueIsActive, CombineOp& op);
500 template<
typename CombineOp,
typename OtherType >
501 void combine2(
const LeafNode& other,
const OtherType&,
bool valueIsActive, CombineOp&);
502 template<
typename CombineOp,
typename OtherNodeT >
503 void combine2(
bool,
const OtherNodeT& other,
bool valueIsActive, CombineOp&);
504 template<
typename CombineOp,
typename OtherNodeT >
505 void combine2(
const LeafNode& b0,
const OtherNodeT& b1, CombineOp&);
511 template<
typename BBoxOp>
void visitActiveBBox(BBoxOp&)
const;
513 template<
typename VisitorOp>
void visit(VisitorOp&);
514 template<
typename VisitorOp>
void visit(VisitorOp&)
const;
516 template<
typename OtherLeafNodeType,
typename VisitorOp>
517 void visit2Node(OtherLeafNodeType& other, VisitorOp&);
518 template<
typename OtherLeafNodeType,
typename VisitorOp>
519 void visit2Node(OtherLeafNodeType& other, VisitorOp&)
const;
520 template<
typename IterT,
typename VisitorOp>
521 void visit2(IterT& otherIter, VisitorOp&,
bool otherIsLHS =
false);
522 template<
typename IterT,
typename VisitorOp>
523 void visit2(IterT& otherIter, VisitorOp&,
bool otherIsLHS =
false)
const;
529 template<
typename AccessorT>
531 template<
typename NodeT>
533 template<
typename NodeT>
535 template<
typename NodeT>
537 template<
typename ArrayT>
void getNodes(ArrayT&)
const {}
541 void addTile(
Index level,
const Coord&,
bool val,
bool active);
542 void addTile(
Index offset,
bool val,
bool active);
543 template<
typename AccessorT>
544 void addTileAndCache(
Index level,
const Coord&,
bool val,
bool active, AccessorT&);
549 template<
typename AccessorT>
552 template<
typename AccessorT>
554 template<
typename NodeT,
typename AccessorT>
559 return reinterpret_cast<NodeT*
>(
this);
566 template<
typename AccessorT>
569 template<
typename AccessorT>
571 template<
typename NodeT,
typename AccessorT>
576 return reinterpret_cast<const NodeT*
>(
this);
589 template<
typename MaskIterT,
typename NodeT,
typename ValueT>
593 public SparseIteratorBase<MaskIterT, ValueIter<MaskIterT, NodeT, ValueT>, NodeT, ValueT>
600 const bool&
getItem(
Index pos)
const {
return this->parent().getValue(pos); }
601 const bool&
getValue()
const {
return this->getItem(this->pos()); }
604 void setItem(
Index pos,
bool value)
const { this->parent().setValueOnly(pos, value); }
606 void setValue(
bool value)
const { this->setItem(this->pos(), value); }
609 template<
typename ModifyOp>
610 void modifyItem(
Index n,
const ModifyOp& op)
const { this->parent().modifyValue(n, op); }
612 template<
typename ModifyOp>
613 void modifyValue(
const ModifyOp& op)
const { this->modifyItem(this->pos(), op); }
617 template<
typename MaskIterT,
typename NodeT>
623 MaskIterT, ChildIter<MaskIterT, NodeT>, NodeT, bool>(iter, parent) {}
626 template<
typename NodeT,
typename ValueT>
628 MaskDenseIter, DenseIter<NodeT, ValueT>, NodeT, void, ValueT>
638 value = this->parent().getValue(pos);
647 void unsetItem(
Index pos,
const ValueT& val)
const {this->parent().setValueOnly(pos, val);}
652 using ValueOnCIter = ValueIter<MaskOnIter, const LeafNode, const bool>;
728 template<
typename NodeT,
typename VisitorOp,
typename ChildAllIterT>
729 static inline void doVisit(NodeT&, VisitorOp&);
731 template<
typename NodeT,
typename OtherNodeT,
typename VisitorOp,
732 typename ChildAllIterT,
typename OtherChildAllIterT>
733 static inline void doVisit2Node(NodeT&
self, OtherNodeT& other, VisitorOp&);
735 template<
typename NodeT,
typename VisitorOp,
736 typename ChildAllIterT,
typename OtherChildAllIterT>
737 static inline void doVisit2(NodeT&
self, OtherChildAllIterT&, VisitorOp&,
bool otherIsLHS);
743 #if OPENVDB_ABI_VERSION_NUMBER >= 9 776 template<Index Log2Dim>
783 template<Index Log2Dim>
786 : mBuffer(value || active)
787 , mOrigin(xyz & (~(DIM - 1)))
792 template<Index Log2Dim>
795 : mBuffer(value || active)
796 , mOrigin(xyz & (~(DIM - 1)))
801 template<Index Log2Dim>
804 : mBuffer(other.mBuffer)
805 , mOrigin(other.mOrigin)
806 #if OPENVDB_ABI_VERSION_NUMBER >= 9
807 , mTransientData(other.mTransientData)
814 template<Index Log2Dim>
815 template<
typename ValueT>
820 #if OPENVDB_ABI_VERSION_NUMBER >= 9
821 , mTransientData(other.mTransientData)
827 template<Index Log2Dim>
828 template<
typename ValueT>
834 #if OPENVDB_ABI_VERSION_NUMBER >= 9
835 , mTransientData(other.mTransientData)
841 template<Index Log2Dim>
842 template<
typename ValueT>
847 #if OPENVDB_ABI_VERSION_NUMBER >= 9
848 , mTransientData(other.mTransientData)
854 template<Index Log2Dim>
855 template<
typename ValueT>
861 #if OPENVDB_ABI_VERSION_NUMBER >= 9
862 , mTransientData(other.mTransientData)
865 if (offValue==
true) {
866 if (onValue==
false) {
867 mBuffer.
mData.toggle();
869 mBuffer.
mData.setOn();
875 template<Index Log2Dim>
885 template<Index Log2Dim>
890 return sizeof(*this);
894 template<Index Log2Dim>
899 if (bbox.isInside(this_bbox))
return;
903 for(; iter; ++iter) this_bbox.expand(this->offsetToLocalCoord(iter.pos()));
904 this_bbox.translate(this->
origin());
906 bbox.expand(this_bbox);
911 template<Index Log2Dim>
912 template<
typename OtherType, Index OtherLog2Dim>
921 template<Index Log2Dim>
925 std::ostringstream ostr;
926 ostr <<
"LeafNode @" << mOrigin <<
": ";
927 for (
Index32 n = 0; n <
SIZE; ++n) ostr << (mBuffer.
mData.isOn(n) ?
'#' :
'.');
935 template<Index Log2Dim>
939 assert ((xyz[0] & (DIM-1u)) < DIM && (xyz[1] & (DIM-1u)) < DIM && (xyz[2] & (DIM-1u)) < DIM);
940 return ((xyz[0] & (DIM-1u)) << 2*Log2Dim)
941 + ((xyz[1] & (DIM-1u)) << Log2Dim)
942 + (xyz[2] & (DIM-1u));
946 template<Index Log2Dim>
950 assert(n < (1 << 3*Log2Dim));
952 xyz.setX(n >> 2*Log2Dim);
953 n &= ((1 << 2*Log2Dim) - 1);
954 xyz.setY(n >> Log2Dim);
955 xyz.setZ(n & ((1 << Log2Dim) - 1));
960 template<Index Log2Dim>
971 template<Index Log2Dim>
975 mBuffer.
mData.load(is);
979 template<Index Log2Dim>
983 mBuffer.
mData.save(os);
987 template<Index Log2Dim>
997 bool background =
false;
999 background = *
static_cast<const bool*
>(bgPtr);
1001 this->
clip(clipBBox, background);
1005 template<Index Log2Dim>
1010 mBuffer.
mData.load(is);
1012 is.read(reinterpret_cast<char*>(&mOrigin),
sizeof(Coord::ValueType) * 3);
1016 template<Index Log2Dim>
1021 mBuffer.
mData.save(os);
1023 os.write(reinterpret_cast<const char*>(&mOrigin),
sizeof(Coord::ValueType) * 3);
1030 template<Index Log2Dim>
1034 return mOrigin == other.mOrigin && mBuffer == other.mBuffer;
1038 template<Index Log2Dim>
1049 template<Index Log2Dim>
1053 if (!mBuffer.
mData.isConstant(state))
return false;
1062 template<Index Log2Dim>
1066 const Index countTrue = mBuffer.
mData.countOn();
1067 return countTrue > (NUM_VALUES >> 1);
1070 template<Index Log2Dim>
1074 const Index countTrueOn = mBuffer.
mData.countOn();
1079 template<Index Log2Dim>
1083 const Index countFalseOff = mBuffer.
mData.countOff();
1085 return countFalseOff;
1092 template<Index Log2Dim>
1099 template<Index Log2Dim>
1103 assert(offset < SIZE);
1108 template<Index Log2Dim>
1109 template<
typename AccessorT>
1112 bool val,
bool active, AccessorT&)
1114 this->
addTile(level, xyz, val, active);
1121 template<Index Log2Dim>
1126 if (mBuffer.
mData.isOn(this->coordToOffset(xyz)))
return Buffer::sOn;
else return Buffer::sOff;
1130 template<Index Log2Dim>
1134 assert(offset < SIZE);
1136 if (mBuffer.
mData.isOn(offset))
return Buffer::sOn;
else return Buffer::sOff;
1140 template<Index Log2Dim>
1145 val = mBuffer.
mData.isOn(offset);
1150 template<Index Log2Dim>
1158 template<Index Log2Dim>
1162 assert(offset < SIZE);
1163 mBuffer.
mData.set(offset, val);
1167 template<Index Log2Dim>
1175 template<Index Log2Dim>
1183 template<Index Log2Dim>
1191 template<Index Log2Dim>
1195 assert(offset < SIZE);
1196 mBuffer.
mData.set(offset, val);
1200 template<Index Log2Dim>
1201 template<
typename ModifyOp>
1205 bool val = mBuffer.
mData.isOn(offset);
1207 mBuffer.
mData.set(offset, val);
1211 template<Index Log2Dim>
1212 template<
typename ModifyOp>
1220 template<Index Log2Dim>
1221 template<
typename ModifyOp>
1226 bool val = mBuffer.
mData.isOn(offset), state = val;
1228 mBuffer.
mData.set(offset, val);
1235 template<Index Log2Dim>
1236 template<MergePolicy Policy>
1246 template<Index Log2Dim>
1247 template<MergePolicy Policy>
1253 if (tileValue) mBuffer.
mData.setOn();
1261 template<Index Log2Dim>
1262 template<
typename OtherType>
1270 template<Index Log2Dim>
1271 template<
typename OtherType>
1280 template<Index Log2Dim>
1281 template<
typename OtherType>
1293 template<Index Log2Dim>
1298 if (!clipBBox.hasOverlap(nodeBBox)) {
1300 this->
fill(nodeBBox, background,
false);
1301 }
else if (clipBBox.isInside(nodeBBox)) {
1311 nodeBBox.intersect(clipBBox);
1313 int &x = xyz.x(), &y = xyz.y(), &z = xyz.z();
1314 for (x = nodeBBox.min().x(); x <= nodeBBox.max().x(); ++x) {
1315 for (y = nodeBBox.min().y(); y <= nodeBBox.max().y(); ++y) {
1316 for (z = nodeBBox.min().z(); z <= nodeBBox.max().z(); ++z) {
1333 template<Index Log2Dim>
1338 clippedBBox.intersect(bbox);
1339 if (!clippedBBox)
return;
1341 for (
Int32 x = clippedBBox.min().x(); x <= clippedBBox.max().x(); ++x) {
1342 const Index offsetX = (x & (DIM-1u))<<2*Log2Dim;
1343 for (
Int32 y = clippedBBox.min().y(); y <= clippedBBox.max().y(); ++y) {
1344 const Index offsetXY = offsetX + ((y & (DIM-1u))<< Log2Dim);
1345 for (
Int32 z = clippedBBox.min().z(); z <= clippedBBox.max().z(); ++z) {
1346 const Index offset = offsetXY + (z & (DIM-1u));
1347 mBuffer.
mData.set(offset, value);
1353 template<Index Log2Dim>
1357 mBuffer.
fill(value);
1364 template<Index Log2Dim>
1365 template<
typename DenseT>
1369 using DenseValueType =
typename DenseT::ValueType;
1371 const size_t xStride = dense.xStride(), yStride = dense.yStride(), zStride = dense.zStride();
1372 const Coord&
min = dense.bbox().min();
1373 DenseValueType* t0 = dense.data() + zStride * (bbox.min()[2] - min[2]);
1374 const Int32 n0 = bbox.min()[2] & (DIM-1u);
1375 for (
Int32 x = bbox.min()[0], ex = bbox.max()[0] + 1; x < ex; ++x) {
1376 DenseValueType* t1 = t0 + xStride * (x - min[0]);
1378 for (
Int32 y = bbox.min()[1], ey = bbox.max()[1] + 1; y < ey; ++y) {
1379 DenseValueType* t2 = t1 + yStride * (y - min[1]);
1381 for (
Int32 z = bbox.min()[2], ez = bbox.max()[2] + 1; z < ez; ++z, t2 += zStride) {
1382 *t2 = DenseValueType(mBuffer.
mData.isOn(n2++));
1389 template<Index Log2Dim>
1390 template<
typename DenseT>
1393 bool background,
bool tolerance)
1395 using DenseValueType =
typename DenseT::ValueType;
1397 inline static bool toBool(
const DenseValueType& v) {
return !
math::isZero(v); }
1400 const size_t xStride = dense.xStride(), yStride = dense.yStride(), zStride = dense.zStride();
1401 const Coord&
min = dense.bbox().min();
1402 const DenseValueType* s0 = dense.data() + zStride * (bbox.min()[2] - min[2]);
1403 const Int32 n0 = bbox.min()[2] & (DIM-1u);
1404 for (
Int32 x = bbox.min()[0], ex = bbox.max()[0] + 1; x < ex; ++x) {
1405 const DenseValueType* s1 = s0 + xStride * (x - min[0]);
1407 for (
Int32 y = bbox.min()[1], ey = bbox.max()[1] + 1; y < ey; ++y) {
1408 const DenseValueType* s2 = s1 + yStride * (y - min[1]);
1410 for (
Int32 z = bbox.min()[2], ez = bbox.max()[2]+1; z < ez; ++z, ++n2, s2 += zStride) {
1412 if (tolerance || (background == Local::toBool(*s2))) {
1413 mBuffer.mData.set(n2, background);
1415 mBuffer.mData.set(n2, Local::toBool(*s2));
1426 template<Index Log2Dim>
1427 template<
typename CombineOp>
1433 bool result =
false, aVal = mBuffer.mData.isOn(i), bVal = other.mBuffer.
mData.isOn(i);
1438 .setResultRef(result));
1439 mBuffer.mData.set(i, result);
1444 template<Index Log2Dim>
1445 template<
typename CombineOp>
1450 args.
setBRef(value).setBIsActive(valueIsActive);
1452 bool result =
false, aVal = mBuffer.mData.isOn(i);
1455 .setResultRef(result));
1456 mBuffer.mData.set(i, result);
1464 template<Index Log2Dim>
1465 template<
typename CombineOp,
typename OtherType>
1468 bool valueIsActive, CombineOp& op)
1471 args.
setBRef(value).setBIsActive(valueIsActive);
1473 bool result =
false, aVal = other.mBuffer.
mData.isOn(i);
1476 .setResultRef(result));
1477 mBuffer.mData.set(i, result);
1482 template<Index Log2Dim>
1483 template<
typename CombineOp,
typename OtherNodeT>
1486 bool valueIsActive, CombineOp& op)
1489 args.
setARef(value).setAIsActive(valueIsActive);
1491 bool result =
false, bVal = other.mBuffer.mData.isOn(i);
1494 .setResultRef(result));
1495 mBuffer.mData.set(i, result);
1500 template<Index Log2Dim>
1501 template<
typename CombineOp,
typename OtherNodeT>
1507 bool result =
false, b0Val = b0.mBuffer.
mData.isOn(i), b1Val = b1.mBuffer.mData.isOn(i);
1509 .setAIsActive(b0Val)
1511 .setBIsActive(b1Val)
1512 .setResultRef(result));
1513 mBuffer.mData.set(i, result);
1520 template<Index Log2Dim>
1521 template<
typename BBoxOp>
1525 if (op.template descent<LEVEL>()) {
1527 op.template operator()<LEVEL>(CoordBBox::createCube(i.getCoord(), 1));
1535 template<Index Log2Dim>
1536 template<
typename VisitorOp>
1540 doVisit<LeafNode, VisitorOp, ChildAllIter>(*
this, op);
1544 template<Index Log2Dim>
1545 template<
typename VisitorOp>
1549 doVisit<const LeafNode, VisitorOp, ChildAllCIter>(*
this, op);
1553 template<Index Log2Dim>
1554 template<
typename NodeT,
typename VisitorOp,
typename ChildAllIterT>
1558 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1567 template<Index Log2Dim>
1568 template<
typename OtherLeafNodeType,
typename VisitorOp>
1573 typename OtherLeafNodeType::ChildAllIter>(*
this, other, op);
1577 template<Index Log2Dim>
1578 template<
typename OtherLeafNodeType,
typename VisitorOp>
1583 typename OtherLeafNodeType::ChildAllCIter>(*
this, other, op);
1587 template<Index Log2Dim>
1590 typename OtherNodeT,
1592 typename ChildAllIterT,
1593 typename OtherChildAllIterT>
1598 static_assert(OtherNodeT::SIZE == NodeT::SIZE,
1599 "can't visit nodes of different sizes simultaneously");
1600 static_assert(OtherNodeT::LEVEL == NodeT::LEVEL,
1601 "can't visit nodes at different tree levels simultaneously");
1603 ChildAllIterT iter =
self.beginChildAll();
1604 OtherChildAllIterT otherIter = other.beginChildAll();
1606 for ( ; iter && otherIter; ++iter, ++otherIter) {
1607 op(iter, otherIter);
1615 template<Index Log2Dim>
1616 template<
typename IterT,
typename VisitorOp>
1620 doVisit2<LeafNode, VisitorOp, ChildAllIter, IterT>(*
this, otherIter, op, otherIsLHS);
1624 template<Index Log2Dim>
1625 template<
typename IterT,
typename VisitorOp>
1629 doVisit2<const LeafNode, VisitorOp, ChildAllCIter, IterT>(*
this, otherIter, op, otherIsLHS);
1633 template<Index Log2Dim>
1637 typename ChildAllIterT,
1638 typename OtherChildAllIterT>
1641 VisitorOp& op,
bool otherIsLHS)
1643 if (!otherIter)
return;
1646 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1647 op(otherIter, iter);
1650 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1651 op(iter, otherIter);
1660 #endif // OPENVDB_TREE_LEAF_NODE_MASK_HAS_BEEN_INCLUDED const Coord & origin() const
Return the grid index coordinates of this node's local origin.
Definition: LeafNodeMask.h:158
Buffer mBuffer
Bitmask representing the values AND state of voxels.
Definition: LeafNodeMask.h:740
const LeafNode * probeConstLeafAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: LeafNodeMask.h:570
ValueIter< MaskOffIter, const LeafNode, const bool > ValueOffCIter
Definition: LeafNodeMask.h:654
ValueAllCIter cendValueAll() const
Definition: LeafNodeMask.h:680
static Index32 nonLeafCount()
Return the non-leaf count for this node, which is zero.
Definition: LeafNodeMask.h:118
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:1144
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:1136
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:1245
static Index getValueLevelAndCache(const Coord &, AccessorT &)
Return the LEVEL (=0) at which leaf node values reside.
Definition: LeafNodeMask.h:398
Buffer & buffer()
Definition: LeafNodeMask.h:197
ChildT * child
Definition: GridBuilder.h:1286
ChildOffCIter cendChildOff() const
Definition: LeafNodeMask.h:699
CombineArgs & setBRef(const BValueType &b)
Redirect the B value to a new external source.
Definition: Types.h:584
ValueOnCIter cendValueOn() const
Definition: LeafNodeMask.h:674
Base class for iterators over internal and leaf nodes.
Definition: Iterator.h:29
LeafNode specialization for values of type ValueMask that encodes both the active states and the bool...
Definition: LeafNodeMask.h:30
bool ValueType
Definition: LeafNodeMask.h:35
void setValueAndCache(const Coord &xyz, bool val, AccessorT &)
Change the value of the voxel at the given coordinates and mark it as active.
Definition: LeafNodeMask.h:344
ValueIter< MaskDenseIter, const LeafNode, const bool > ValueAllCIter
Definition: LeafNodeMask.h:656
Definition: NodeMasks.h:270
static const Index LOG2DIM
Definition: LeafNode.h:48
void setValueMask(Index n, bool on)
Definition: LeafNodeMask.h:721
ValueOnIter beginValueOn()
Definition: LeafNodeMask.h:666
static Index32 leafCount()
Return the leaf count for this node, which is one.
Definition: LeafNodeMask.h:114
ValueIter< MaskOnIter, LeafNode, const bool > ValueOnIter
Definition: LeafNodeMask.h:651
bool isChildMaskOff(Index) const
Definition: LeafNodeMask.h:718
const LeafNode * probeConstLeaf(const Coord &) const
Return a const pointer to this node.
Definition: LeafNodeMask.h:568
const bool & getItem(Index pos) const
Definition: LeafNodeMask.h:600
ChildAllCIter cendChildAll() const
Definition: LeafNodeMask.h:702
void writeBuffers(std::ostream &os, bool toHalf=false) const
Write buffers to a stream.
Definition: LeafNode.h:1437
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition: LeafNodeMask.h:240
bool getItem(Index pos, void *&child, NonConstValueT &value) const
Definition: LeafNodeMask.h:636
General-purpose arithmetic and comparison routines, most of which accept arbitrary value types (or at...
void setValuesOn()
Mark all voxels as active but don't change their values.
Definition: LeafNodeMask.h:275
const LeafNode * probeLeafAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: LeafNodeMask.h:567
Templated block class to hold specific data types and a fixed number of values determined by Log2Dim...
Definition: LeafNode.h:37
const Buffer & buffer() const
Definition: LeafNodeMask.h:196
NodeT * probeNode(const Coord &)
This function exists only to enable template instantiation.
Definition: LeafNodeMask.h:534
void visit2(IterT &otherIter, VisitorOp &, bool otherIsLHS=false)
Definition: LeafNode.h:1941
void negate()
Invert the bits of the voxels, i.e. states and values.
Definition: LeafNodeMask.h:448
void modifyValue(const ModifyOp &op) const
Definition: LeafNodeMask.h:613
Index medianOff(ValueType &value, ValueType *tmp=nullptr) const
Computes the median value of all the inactive voxels in this node.
Definition: LeafNode.h:1578
void setValue(const Coord &xyz, bool val)
Set the value of the voxel at the given coordinates and mark the voxel as active. ...
Definition: LeafNodeMask.h:257
Base class for dense iterators over internal and leaf nodes.
Definition: Iterator.h:178
static Index getChildDim()
Return the dimension of child nodes of this LeafNode, which is one for voxels.
Definition: LeafNodeMask.h:112
ValueAllCIter endValueAll() const
Definition: LeafNodeMask.h:681
DenseIter< LeafNode, bool > ChildAllIter
Definition: LeafNodeMask.h:661
static Index numValues()
Return the total number of voxels represented by this LeafNode.
Definition: LeafNodeMask.h:106
SharedPtr< LeafNodeType > Ptr
Definition: LeafNodeMask.h:38
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition: LeafNode.h:408
static Index getLevel()
Return the level of this node, which by definition is zero for LeafNodes.
Definition: LeafNodeMask.h:108
static bool hasActiveTiles()
Return false since leaf nodes never contain tiles.
Definition: LeafNodeMask.h:285
ValueOffIter beginValueOff()
Definition: LeafNodeMask.h:669
ChildAllCIter cbeginChildAll() const
Definition: LeafNodeMask.h:692
ChildAllCIter endChildAll() const
Definition: LeafNodeMask.h:703
ValueIter< MaskOffIter, LeafNode, const bool > ValueOffIter
Definition: LeafNodeMask.h:653
const NodeMaskType & valueMask() const
Definition: LeafNodeMask.h:714
void modifyItem(Index n, const ModifyOp &op) const
Definition: LeafNodeMask.h:610
const ValueType & getValue(const Coord &xyz) const
Return the value of the voxel at the given coordinates.
Definition: LeafNode.h:1086
void addLeafAndCache(LeafNode *, AccessorT &)
This function exists only to enable template instantiation.
Definition: LeafNodeMask.h:530
static const Index SIZE
Definition: LeafNode.h:53
Definition: NodeMasks.h:239
static void doVisit2(NodeT &self, OtherChildAllIterT &, VisitorOp &, bool otherIsLHS)
Definition: LeafNode.h:1965
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...
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:436
bool isChildMaskOff() const
Definition: LeafNodeMask.h:719
void setTransientData(Index32 transientData)
Set the transient data value.
Definition: LeafNodeMask.h:175
bool operator==(const LeafNode &other) const
Check for buffer, state and origin equivalence.
Definition: LeafNode.h:1454
ChildOnCIter cendChildOn() const
Definition: LeafNodeMask.h:696
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: LeafNodeMask.h:364
ChildOnIter beginChildOn()
Definition: LeafNodeMask.h:688
void setValueOnly(Index offset, bool val)
Set the value of the voxel at the given offset but don't change its active state. ...
Definition: LeafNodeMask.h:237
ValueType medianAll(ValueType *tmp=nullptr) const
Computes the median value of all the active AND inactive voxels in this node.
Definition: LeafNode.h:1536
bool isValueOn(const Coord &xyz) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNodeMask.h:280
void addLeaf(LeafNode *)
This function exists only to enable template instantiation.
Definition: LeafNodeMask.h:528
ChildIter< MaskOnIter, LeafNode > ChildOnIter
Definition: LeafNodeMask.h:657
void resetBackground(bool, bool)
no-op since for this template specialization voxel values and states are indistinguishable.
Definition: LeafNodeMask.h:445
std::shared_ptr< T > SharedPtr
Definition: Types.h:114
void readTopology(std::istream &is, bool fromHalf=false)
Read in just the topology.
Definition: LeafNode.h:1309
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:1272
ChildOnCIter cbeginChildOn() const
Definition: LeafNodeMask.h:686
NodeT * probeNodeAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: LeafNodeMask.h:555
void setValueMask(const NodeMaskType &mask)
Definition: LeafNodeMask.h:716
void getOrigin(Int32 &x, Int32 &y, Int32 &z) const
Return the grid index coordinates of this node's local origin.
Definition: LeafNodeMask.h:160
bool isDense() const
Return true if this node only contains active voxels.
Definition: LeafNodeMask.h:132
typename NodeMaskType::OnIterator MaskOnIter
Definition: LeafNodeMask.h:585
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, whose ValueType may be different. So a resulting voxel will be active only if both of the original voxels were active.
Definition: LeafNode.h:1712
void modifyValueAndActiveState(const Coord &xyz, const ModifyOp &op)
Apply a functor to the voxel at the given coordinates.
Definition: LeafNode.h:457
Tag dispatch class that distinguishes topology copy constructors from deep copy constructors.
Definition: Types.h:644
DenseIter< const LeafNode, const bool > ChildAllCIter
Definition: LeafNodeMask.h:662
Index64 offVoxelCount() const
Return the number of inactive voxels.
Definition: LeafNodeMask.h:123
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, whose ValueType may be different. So a resulting voxel will be active only if the original voxel is active in this LeafNode and inactive in the other LeafNode.
Definition: LeafNode.h:1721
void fill(const ValueType &)
Populate this buffer with a constant value.
Definition: LeafBuffer.h:225
ValueOnIter endValueOn()
Definition: LeafNodeMask.h:676
CoordBBox getNodeBoundingBox() const
Return the bounding box of this node, i.e., the full index space spanned by this leaf node...
Definition: LeafNode.h:166
void setActiveStateAndCache(const Coord &xyz, bool on, AccessorT &)
Set the active state of the voxel at the given coordinates without changing its value.
Definition: LeafNodeMask.h:381
void prune(const ValueType &=zeroVal< ValueType >())
This function exists only to enable template instantiation.
Definition: LeafNodeMask.h:527
static void doVisit(NodeT &, VisitorOp &)
Definition: LeafNode.h:1879
static Index64 offTileCount()
Definition: LeafNodeMask.h:127
void nodeCount(std::vector< Index32 > &) const
no-op
Definition: LeafNodeMask.h:116
static Index64 onTileCount()
Definition: LeafNodeMask.h:126
static Index getValueLevel(const Coord &)
Return the level (0) at which leaf node values reside.
Definition: LeafNodeMask.h:227
bool probeValueAndCache(const Coord &xyz, bool &val, AccessorT &) const
Return true if the voxel at the given coordinates is active and return the voxel value in val...
Definition: LeafNodeMask.h:390
OffIterator beginOff() const
Definition: NodeMasks.h:354
LeafNode * touchLeafAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: LeafNodeMask.h:550
const bool & getFirstValue() const
Return a const reference to the first entry in the buffer.
Definition: LeafNodeMask.h:403
std::string str() const
Return a string representation of this node.
Definition: LeafNode.h:1038
const NodeT * probeConstNodeAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: LeafNodeMask.h:572
BBox< Coord > CoordBBox
Definition: NanoVDB.h:1658
void setOrigin(const Coord &origin)
Set the grid index coordinates of this node's local origin.
Definition: LeafNodeMask.h:155
void combine2(const LeafNode &other, const OtherType &, bool valueIsActive, CombineOp &)
Definition: LeafNode.h:1785
DenseIter(const MaskDenseIter &iter, NodeT *parent)
Definition: LeafNodeMask.h:634
ValueAllIter beginValueAll()
Definition: LeafNodeMask.h:672
ValueAllIter endValueAll()
Definition: LeafNodeMask.h:682
ChildIter< MaskOffIter, const LeafNode > ChildOffCIter
Definition: LeafNodeMask.h:660
CombineArgs & setARef(const AValueType &a)
Redirect the A value to a new external source.
Definition: Types.h:582
LeafNode()
Default constructor.
Definition: LeafNode.h:935
This struct collects both input and output arguments to "grid combiner" functors used with the tree::...
Definition: Types.h:529
const NodeMaskType & valueMask() const
Definition: LeafNode.h:876
void getOrigin(Coord &origin) const
Return the grid index coordinates of this node's local origin.
Definition: LeafNodeMask.h:159
void addTile(Index level, const Coord &, const ValueType &, bool)
Definition: LeafNode.h:1605
const bool & getValue() const
Definition: LeafNodeMask.h:601
Index medianOn(ValueType &value, ValueType *tmp=nullptr) const
Computes the median value of all the active voxels in this node.
Definition: LeafNode.h:1554
void setValueOn(Index offset)
Mark the voxel at the given offset as active but don't change its value.
Definition: LeafNodeMask.h:252
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:1202
bool isValueMaskOff() const
Definition: LeafNodeMask.h:712
const NodeT * probeConstNode(const Coord &) const
This function exists only to enable template instantiation.
Definition: LeafNodeMask.h:536
ValueOnCIter beginValueOn() const
Definition: LeafNodeMask.h:665
ValueOffCIter cendValueOff() const
Definition: LeafNodeMask.h:677
ValueIter(const MaskIterT &iter, NodeT *parent)
Definition: LeafNodeMask.h:598
void visit2Node(OtherLeafNodeType &other, VisitorOp &)
Definition: LeafNode.h:1893
LeafNode * touchLeaf(const Coord &)
Return a pointer to this node.
Definition: LeafNodeMask.h:548
ChildOnIter endChildOn()
Definition: LeafNodeMask.h:698
ChildOffCIter cbeginChildOff() const
Definition: LeafNodeMask.h:689
bool isChildMaskOn(Index) const
Definition: LeafNodeMask.h:717
DenseIter< const LeafNode, const ValueType, ChildAll > ChildAllCIter
Definition: LeafNode.h:296
bool isInactive() const
Return true if all of this node's values are inactive.
Definition: LeafNodeMask.h:441
CoordBBox getNodeBoundingBox() const
Return the bounding box of this node, i.e., the full index space spanned by this leaf node...
Definition: LeafNodeMask.h:152
uint64_t Index64
Definition: Types.h:53
Definition: Exceptions.h:13
bool isValueOn(Index offset) const
Return true if the voxel at the given offset is active.
Definition: LeafNodeMask.h:282
void visitActiveBBox(BBoxOp &) const
Calls the templated functor BBoxOp with bounding box information. An additional level argument is pro...
Definition: LeafNode.h:1846
ChildOffIter endChildOff()
Definition: LeafNodeMask.h:701
ChildOffCIter endChildOff() const
Definition: LeafNodeMask.h:700
bool isValueMaskOn() const
Definition: LeafNodeMask.h:710
const NodeMaskType & getValueMask() const
Definition: LeafNodeMask.h:713
bool isConstant(ValueType &firstValue, bool &state, const ValueType &tolerance=zeroVal< ValueType >()) const
Definition: LeafNode.h:1500
ValueT value
Definition: GridBuilder.h:1287
void setValuesOff()
Mark all voxels as inactive but don't change their values.
Definition: LeafNodeMask.h:277
bool allocate()
Allocate memory for this node's buffer if it has not already been allocated.
Definition: LeafNodeMask.h:140
void visit(VisitorOp &)
Definition: LeafNode.h:1861
ValueOffCIter cbeginValueOff() const
Definition: LeafNodeMask.h:667
ValueIter()
Definition: LeafNodeMask.h:597
static Index dim()
Return the number of voxels in each dimension.
Definition: LeafNodeMask.h:102
void clip(const CoordBBox &, const ValueType &background)
Set all voxels that lie outside the given axis-aligned box to the background.
Definition: LeafNode.h:1162
NodeT * stealNode(const Coord &, const ValueType &, bool)
This function exists only to enable template instantiation.
Definition: LeafNodeMask.h:532
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:1492
bool isValueMaskOff(Index n) const
Definition: LeafNodeMask.h:711
ChildOnCIter beginChildOn() const
Definition: LeafNodeMask.h:687
void unsetItem(Index pos, const ValueT &val) const
Definition: LeafNodeMask.h:647
bool probeValue(const Coord &xyz, ValueType &val) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNode.h:1102
bool isEmpty() const
Return true if this node has no active voxels.
Definition: LeafNodeMask.h:130
static Index coordToOffset(const Coord &xyz)
Return the linear table offset of the given global or local coordinates.
Definition: LeafNode.h:1051
ChildIter()
Definition: LeafNodeMask.h:621
Index32 Index
Definition: Types.h:54
ChildAllCIter beginChildAll() const
Definition: LeafNodeMask.h:693
ValueIter< MaskDenseIter, LeafNode, const bool > ValueAllIter
Definition: LeafNodeMask.h:655
ChildIter< MaskOnIter, const LeafNode > ChildOnCIter
Definition: LeafNodeMask.h:658
static Coord offsetToLocalCoord(Index n)
Return the local coordinates for a linear table offset, where offset 0 has coordinates (0...
Definition: LeafNode.h:1061
NodeMaskType & getValueMask()
Definition: LeafNodeMask.h:715
static void doVisit2Node(NodeT &self, OtherNodeT &other, VisitorOp &)
Definition: LeafNode.h:1918
bool operator!=(const LeafNode &other) const
Definition: LeafNode.h:202
ChildOffCIter beginChildOff() const
Definition: LeafNodeMask.h:690
Coord offsetToGlobalCoord(Index n) const
Return the global coordinates for a linear table offset.
Definition: LeafNode.h:1075
ValueIter< MaskOnIter, const LeafNode, const bool > ValueOnCIter
Definition: LeafNodeMask.h:652
bool isValueOnAndCache(const Coord &xyz, AccessorT &) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNodeMask.h:339
void voxelizeActiveTiles(bool=true)
No-op.
Definition: LeafNodeMask.h:456
void addTileAndCache(Index, const Coord &, const ValueType &, bool, AccessorT &)
Definition: LeafNode.h:1622
ValueType * mData
Definition: LeafBuffer.h:125
DenseIter()
Definition: LeafNodeMask.h:633
void setValueOffAndCache(const Coord &xyz, bool value, AccessorT &)
Change the value of the voxel at the given coordinates and mark it as inactive.
Definition: LeafNodeMask.h:355
void writeTopology(std::ostream &os, bool toHalf=false) const
Write out just the topology.
Definition: LeafNode.h:1317
ChildIter< MaskOffIter, LeafNode > ChildOffIter
Definition: LeafNodeMask.h:659
typename BaseT::NonConstValueType NonConstValueT
Definition: LeafNodeMask.h:631
void denseFill(const CoordBBox &bbox, bool value, bool=false)
Set all voxels within an axis-aligned box to the specified value.
Definition: LeafNodeMask.h:293
DenseIter< LeafNode, ValueType, ChildAll > ChildAllIter
Definition: LeafNode.h:295
ValueOnCIter cbeginValueOn() const
Definition: LeafNodeMask.h:664
int32_t Int32
Definition: Types.h:56
static Index size()
Return the total number of voxels represented by this LeafNode.
Definition: LeafNodeMask.h:104
ValueOffIter endValueOff()
Definition: LeafNodeMask.h:679
void setValueOff(Index offset)
Mark the voxel at the given offset as inactive but don't change its value.
Definition: LeafNodeMask.h:242
void swap(Buffer &other)
Exchange this node's data buffer with the given data buffer without changing the active states of the...
Definition: LeafNodeMask.h:195
Index64 onVoxelCount() const
Return the number of active voxels.
Definition: LeafNodeMask.h:121
void setValueMaskOn(Index n)
Definition: LeafNodeMask.h:722
Index32 transientData() const
Return the transient data value.
Definition: LeafNodeMask.h:173
LeafNode * probeLeafAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: LeafNodeMask.h:553
const NodeMaskType & getValueMask() const
Definition: LeafNode.h:874
typename NodeMaskType::DenseIterator MaskDenseIter
Definition: LeafNodeMask.h:587
void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition: LeafNodeMask.h:250
ChildOffIter beginChildOff()
Definition: LeafNodeMask.h:691
ChildAllCIter beginChildAll() const
Definition: LeafNode.h:327
void setValueOnlyAndCache(const Coord &xyz, bool val, AccessorT &)
Change the value of the voxel at the given coordinates but preserve its state.
Definition: LeafNodeMask.h:350
void merge(const LeafNode &)
Definition: LeafNode.h:1655
Coord mOrigin
Global grid index coordinates (x,y,z) of the local origin of this node.
Definition: LeafNodeMask.h:742
Bit mask for the internal and leaf nodes of VDB. This is a 64-bit implementation. ...
Definition: NodeMasks.h:307
ValueAllCIter cbeginValueAll() const
Definition: LeafNodeMask.h:670
LeafNode * probeLeaf(const Coord &)
Return a pointer to this node.
Definition: LeafNodeMask.h:551
ChildOnCIter endChildOn() const
Definition: LeafNodeMask.h:697
Tag dispatch class that distinguishes constructors during file input.
Definition: Types.h:650
typename NodeMaskType::OffIterator MaskOffIter
Definition: LeafNodeMask.h:586
void getNodes(ArrayT &) const
This function exists only to enable template instantiation.
Definition: LeafNodeMask.h:537
ChildAllIter beginChildAll()
Definition: LeafNodeMask.h:694
const bool & getValueAndCache(const Coord &xyz, AccessorT &) const
Return the value of the voxel at the given coordinates.
Definition: LeafNodeMask.h:334
ValueAllCIter beginValueAll() const
Definition: LeafNodeMask.h:671
void setValueMaskOff(Index n)
Definition: LeafNodeMask.h:723
void setItem(Index pos, bool value) const
Definition: LeafNodeMask.h:604
Definition: NodeMasks.h:208
void readBuffers(std::istream &is, bool fromHalf=false)
Read buffers from a stream.
Definition: LeafNode.h:1345
Definition: PointDataGrid.h:170
ValueOffCIter endValueOff() const
Definition: LeafNodeMask.h:678
ValueOnCIter endValueOn() const
Definition: LeafNodeMask.h:675
uint32_t Index32
Definition: Types.h:52
void stealNodes(ArrayT &, const ValueType &, bool)
This function exists only to enable template instantiation.
Definition: LeafNodeMask.h:538
void setActiveState(Index offset, bool on)
Set the active state of the voxel at the given offset but don't change its value. ...
Definition: LeafNodeMask.h:232
bool isZero(const Type &x)
Return true if x is exactly equal to zero.
Definition: Math.h:338
void modifyValueAndActiveStateAndCache(const Coord &xyz, const ModifyOp &op, AccessorT &)
Definition: LeafNodeMask.h:372
ValueOnCIter cbeginValueOn() const
Definition: LeafNode.h:298
bool isAllocated() const
Return true if memory for this node's buffer has been allocated.
Definition: LeafNodeMask.h:136
static void evalNodeOrigin(Coord &xyz)
Compute the origin of the leaf node that contains the voxel with the given coordinates.
Definition: LeafNodeMask.h:726
const bool & getLastValue() const
Return a const reference to the last entry in the buffer.
Definition: LeafNodeMask.h:407
void evalActiveBoundingBox(CoordBBox &bbox, bool visitVoxels=true) const
Definition: LeafNode.h:1474
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h.in:116
bool operator==(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Equality operator, does exact floating point comparisons.
Definition: Vec3.h:477
bool operator!=(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Inequality operator, does exact floating point comparisons.
Definition: Vec3.h:485
void setValue(bool value) const
Definition: LeafNodeMask.h:606
static Index log2dim()
Return log2 of the size of the buffer storage.
Definition: LeafNodeMask.h:100
void combine(const LeafNode &other, CombineOp &op)
Definition: LeafNode.h:1745
void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition: LeafNode.h:418
bool isValueMaskOn(Index n) const
Definition: LeafNodeMask.h:709
ValueType combine(const ValueType &v0, const ValueType &v1, const ValueType &v2, const openvdb::Vec3d &w)
Combine different value types.
Definition: AttributeTransferUtil.h:141
static void getNodeLog2Dims(std::vector< Index > &dims)
Append the Log2Dim of this LeafNode to the specified vector.
Definition: LeafNodeMask.h:110
Index64 offLeafVoxelCount() const
Definition: LeafNodeMask.h:125
Index64 memUsage() const
Return the memory in bytes occupied by this node.
Definition: LeafNode.h:1464
Base class for sparse iterators over internal and leaf nodes.
Definition: Iterator.h:114
ValueOffCIter beginValueOff() const
Definition: LeafNodeMask.h:668
ChildIter(const MaskIterT &iter, NodeT *parent)
Definition: LeafNodeMask.h:622
const Coord & origin() const
Return the grid index coordinates of this node's local origin.
Definition: LeafNode.h:172
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:1704
typename std::remove_const< UnsetItemT >::type NonConstValueType
Definition: Iterator.h:184
Index64 onLeafVoxelCount() const
Definition: LeafNodeMask.h:124
void setOn(Index32 n)
Set the nth bit on.
Definition: NodeMasks.h:452
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h.in:202
const LeafNode * probeLeaf(const Coord &) const
Return a const pointer to this node.
Definition: LeafNodeMask.h:565
ChildAllIter endChildAll()
Definition: LeafNodeMask.h:704
~LeafNode()
Destructor.
Definition: LeafNode.h:1031