31 #ifndef OPENVDB_TREE_LEAF_NODE_MASK_HAS_BEEN_INCLUDED 32 #define OPENVDB_TREE_LEAF_NODE_MASK_HAS_BEEN_INCLUDED 44 #include <type_traits> 56 template<Index Log2Dim>
68 static const Index LOG2DIM = Log2Dim;
69 static const Index TOTAL = Log2Dim;
70 static const Index DIM = 1 << TOTAL;
71 static const Index NUM_VALUES = 1 << 3 * Log2Dim;
72 static const Index NUM_VOXELS = NUM_VALUES;
73 static const Index SIZE = NUM_VALUES;
78 template<
typename OtherValueType>
83 template<
typename OtherNodeType>
84 struct SameConfiguration {
95 explicit LeafNode(
const Coord& xyz,
bool value =
false,
bool dummy =
false);
97 #if OPENVDB_ABI_VERSION_NUMBER >= 3 106 template<
typename OtherValueType>
110 template<
typename ValueType>
114 template<
typename ValueType>
118 template<
typename ValueType>
157 bool isEmpty()
const {
return mBuffer.mData.isOff(); }
159 bool isDense()
const {
return mBuffer.mData.isOn(); }
161 #if OPENVDB_ABI_VERSION_NUMBER >= 3 162 bool isAllocated()
const {
return true; }
178 void evalActiveBoundingBox(
CoordBBox& bbox,
bool visitVoxels =
true)
const;
187 const Coord& origin()
const {
return mOrigin; }
202 std::string str()
const;
206 template<
typename OtherType, Index OtherLog2Dim>
226 void readTopology(std::istream&,
bool fromHalf =
false);
228 void writeTopology(std::ostream&,
bool toHalf =
false)
const;
231 void readBuffers(std::istream&,
bool fromHalf =
false);
232 void readBuffers(std::istream& is,
const CoordBBox&,
bool fromHalf =
false);
234 void writeBuffers(std::ostream&,
bool toHalf =
false)
const;
240 const bool& getValue(
const Coord& xyz)
const;
242 const bool& getValue(
Index offset)
const;
247 bool probeValue(
const Coord& xyz,
bool& val)
const;
253 void setActiveState(
const Coord& xyz,
bool on);
258 void setValueOnly(
const Coord& xyz,
bool val);
260 void setValueOnly(
Index offset,
bool val) { assert(offset<SIZE); mBuffer.setValue(offset,val); }
268 void setValueOff(
const Coord& xyz,
bool val);
270 void setValueOff(
Index offset,
bool val);
278 void setValueOn(
const Coord& xyz,
bool val);
282 void setValueOn(
Index offset,
bool val);
286 template<
typename ModifyOp>
287 void modifyValue(
Index offset,
const ModifyOp& op);
290 template<
typename ModifyOp>
291 void modifyValue(
const Coord& xyz,
const ModifyOp& op);
294 template<
typename ModifyOp>
295 void modifyValueAndActiveState(
const Coord& xyz,
const ModifyOp& op);
303 bool isValueOn(
const Coord& xyz)
const {
return mBuffer.mData.isOn(this->coordToOffset(xyz)); }
305 bool isValueOn(
Index offset)
const { assert(offset < SIZE);
return mBuffer.mData.isOn(offset); }
314 void fill(
const CoordBBox& bbox,
bool value,
bool =
false);
319 void fill(
const bool& value,
bool dummy =
false);
332 template<
typename DenseT>
351 template<
typename DenseT>
356 template<
typename AccessorT>
361 template<
typename AccessorT>
366 template<
typename AccessorT>
372 template<
typename AccessorT>
377 template<
typename AccessorT>
380 this->setValueOff(xyz, value);
386 template<
typename ModifyOp,
typename AccessorT>
389 this->modifyValue(xyz, op);
394 template<
typename ModifyOp,
typename AccessorT>
397 this->modifyValueAndActiveState(xyz, op);
403 template<
typename AccessorT>
406 this->setActiveState(xyz, on);
412 template<
typename AccessorT>
415 return this->probeValue(xyz, val);
420 template<
typename AccessorT>
426 const bool&
getFirstValue()
const {
if (mBuffer.mData.isOn(0))
return Buffer::sOn;
else return Buffer::sOff; }
430 const bool&
getLastValue()
const {
if (mBuffer.mData.isOn(SIZE-1))
return Buffer::sOn;
else return Buffer::sOff; }
435 bool isConstant(
bool& constValue,
bool& state,
bool tolerance = 0)
const;
442 bool medianAll()
const;
451 Index medianOn(ValueType &value)
const;
461 Index medianOff(ValueType &value)
const;
471 void negate() { mBuffer.mData.toggle(); }
473 template<MergePolicy Policy>
474 void merge(
const LeafNode& other,
bool bg =
false,
bool otherBG =
false);
475 template<MergePolicy Policy>
void merge(
bool tileValue,
bool tileActive=
false);
487 template<
typename OtherType>
501 template<
typename OtherType>
515 template<
typename OtherType>
518 template<
typename CombineOp>
519 void combine(
const LeafNode& other, CombineOp& op);
520 template<
typename CombineOp>
521 void combine(
bool,
bool valueIsActive, CombineOp& op);
523 template<
typename CombineOp,
typename OtherType >
524 void combine2(
const LeafNode& other,
const OtherType&,
bool valueIsActive, CombineOp&);
525 template<
typename CombineOp,
typename OtherNodeT >
526 void combine2(
bool,
const OtherNodeT& other,
bool valueIsActive, CombineOp&);
527 template<
typename CombineOp,
typename OtherNodeT >
528 void combine2(
const LeafNode& b0,
const OtherNodeT& b1, CombineOp&);
534 template<
typename BBoxOp>
void visitActiveBBox(BBoxOp&)
const;
536 template<
typename VisitorOp>
void visit(VisitorOp&);
537 template<
typename VisitorOp>
void visit(VisitorOp&)
const;
539 template<
typename OtherLeafNodeType,
typename VisitorOp>
540 void visit2Node(OtherLeafNodeType& other, VisitorOp&);
541 template<
typename OtherLeafNodeType,
typename VisitorOp>
542 void visit2Node(OtherLeafNodeType& other, VisitorOp&)
const;
543 template<
typename IterT,
typename VisitorOp>
544 void visit2(IterT& otherIter, VisitorOp&,
bool otherIsLHS =
false);
545 template<
typename IterT,
typename VisitorOp>
546 void visit2(IterT& otherIter, VisitorOp&,
bool otherIsLHS =
false)
const;
549 void prune(
const ValueType& = zeroVal<ValueType>()) {}
552 template<
typename AccessorT>
554 template<
typename NodeT>
556 template<
typename NodeT>
558 template<
typename NodeT>
560 template<
typename ArrayT>
void getNodes(ArrayT&)
const {}
564 void addTile(
Index level,
const Coord&,
bool val,
bool active);
565 void addTile(
Index offset,
bool val,
bool active);
566 template<
typename AccessorT>
567 void addTileAndCache(
Index level,
const Coord&,
bool val,
bool active, AccessorT&);
572 template<
typename AccessorT>
575 template<
typename AccessorT>
577 template<
typename NodeT,
typename AccessorT>
581 if (!(std::is_same<NodeT, LeafNode>::value))
return nullptr;
582 return reinterpret_cast<NodeT*>(
this);
587 const LeafNode* probeLeaf(
const Coord&)
const {
return this; }
589 template<
typename AccessorT>
592 template<
typename AccessorT>
594 template<
typename NodeT,
typename AccessorT>
598 if (!(std::is_same<NodeT, LeafNode>::value))
return nullptr;
599 return reinterpret_cast<const NodeT*>(
this);
612 template<
typename MaskIterT,
typename NodeT,
typename ValueT>
616 public SparseIteratorBase<MaskIterT, ValueIter<MaskIterT, NodeT, ValueT>, NodeT, ValueT>
623 const bool&
getItem(
Index pos)
const {
return this->parent().getValue(pos); }
624 const bool&
getValue()
const {
return this->getItem(this->pos()); }
627 void setItem(
Index pos,
bool value)
const { this->parent().setValueOnly(pos, value); }
629 void setValue(
bool value)
const { this->setItem(this->pos(), value); }
632 template<
typename ModifyOp>
633 void modifyItem(
Index n,
const ModifyOp& op)
const { this->parent().modifyValue(n, op); }
635 template<
typename ModifyOp>
636 void modifyValue(
const ModifyOp& op)
const { this->modifyItem(this->pos(), op); }
640 template<
typename MaskIterT,
typename NodeT>
646 MaskIterT, ChildIter<MaskIterT, NodeT>, NodeT, bool>(iter, parent) {}
649 template<
typename NodeT,
typename ValueT>
651 MaskDenseIter, DenseIter<NodeT, ValueT>, NodeT, void, ValueT>
661 value = this->parent().getValue(pos);
670 void unsetItem(
Index pos,
const ValueT& val)
const {this->parent().setValueOnly(pos, val);}
675 using ValueOnCIter = ValueIter<MaskOnIter, const LeafNode, const bool>;
751 template<
typename NodeT,
typename VisitorOp,
typename ChildAllIterT>
752 static inline void doVisit(NodeT&, VisitorOp&);
754 template<
typename NodeT,
typename OtherNodeT,
typename VisitorOp,
755 typename ChildAllIterT,
typename OtherChildAllIterT>
756 static inline void doVisit2Node(NodeT&
self, OtherNodeT& other, VisitorOp&);
758 template<
typename NodeT,
typename VisitorOp,
759 typename ChildAllIterT,
typename OtherChildAllIterT>
760 static inline void doVisit2(NodeT&
self, OtherChildAllIterT&, VisitorOp&,
bool otherIsLHS);
796 template<Index Log2Dim>
803 template<Index Log2Dim>
806 : mBuffer(value || active)
807 , mOrigin(xyz & (~(DIM - 1)))
812 #if OPENVDB_ABI_VERSION_NUMBER >= 3 813 template<Index Log2Dim>
816 : mBuffer(value || active)
817 , mOrigin(xyz & (~(DIM - 1)))
823 template<Index Log2Dim>
826 : mBuffer(other.mBuffer)
827 , mOrigin(other.mOrigin)
833 template<Index Log2Dim>
834 template<
typename ValueT>
837 : mBuffer(other.valueMask())
838 , mOrigin(other.origin())
843 template<Index Log2Dim>
844 template<
typename ValueT>
848 : mBuffer(other.valueMask())
849 , mOrigin(other.origin())
854 template<Index Log2Dim>
855 template<
typename ValueT>
858 : mBuffer(other.valueMask())
859 , mOrigin(other.origin())
864 template<Index Log2Dim>
865 template<
typename ValueT>
869 : mBuffer(other.valueMask())
870 , mOrigin(other.origin())
872 if (offValue==
true) {
873 if (onValue==
false) {
874 mBuffer.
mData.toggle();
876 mBuffer.
mData.setOn();
882 template<Index Log2Dim>
892 template<Index Log2Dim>
897 return sizeof(*this);
901 template<Index Log2Dim>
906 if (bbox.
isInside(this_bbox))
return;
910 for(; iter; ++iter) this_bbox.
expand(this->offsetToLocalCoord(iter.pos()));
918 template<Index Log2Dim>
919 template<
typename OtherType, Index OtherLog2Dim>
928 template<Index Log2Dim>
932 std::ostringstream ostr;
933 ostr <<
"LeafNode @" << mOrigin <<
": ";
934 for (
Index32 n = 0; n <
SIZE; ++n) ostr << (mBuffer.
mData.isOn(n) ?
'#' :
'.');
942 template<Index Log2Dim>
946 assert ((xyz[0] & (
DIM-1u)) <
DIM && (xyz[1] & (
DIM-1u)) <
DIM && (xyz[2] & (
DIM-1u)) <
DIM);
947 return ((xyz[0] & (
DIM-1u)) << 2*Log2Dim)
948 + ((xyz[1] & (
DIM-1u)) << Log2Dim)
949 + (xyz[2] & (
DIM-1u));
953 template<Index Log2Dim>
957 assert(n < (1 << 3*Log2Dim));
959 xyz.
setX(n >> 2*Log2Dim);
960 n &= ((1 << 2*Log2Dim) - 1);
961 xyz.
setY(n >> Log2Dim);
962 xyz.
setZ(n & ((1 << Log2Dim) - 1));
967 template<Index Log2Dim>
978 template<Index Log2Dim>
982 mBuffer.
mData.load(is);
986 template<Index Log2Dim>
990 mBuffer.
mData.save(os);
994 template<Index Log2Dim>
1004 bool background =
false;
1006 background = *static_cast<const bool*>(bgPtr);
1008 this->
clip(clipBBox, background);
1012 template<Index Log2Dim>
1017 mBuffer.
mData.load(is);
1023 template<Index Log2Dim>
1028 mBuffer.
mData.save(os);
1030 os.write(reinterpret_cast<const char*>(&mOrigin),
sizeof(
Coord::ValueType) * 3);
1037 template<Index Log2Dim>
1041 return mOrigin == other.mOrigin && mBuffer == other.mBuffer;
1045 template<Index Log2Dim>
1056 template<Index Log2Dim>
1060 if (!mBuffer.
mData.isConstant(state))
return false;
1069 template<Index Log2Dim>
1073 const Index countTrue = mBuffer.
mData.countOn();
1077 template<Index Log2Dim>
1081 const Index countTrueOn = mBuffer.
mData.countOn();
1086 template<Index Log2Dim>
1090 const Index countFalseOff = mBuffer.
mData.countOff();
1092 return countFalseOff;
1099 template<Index Log2Dim>
1106 template<Index Log2Dim>
1110 assert(offset <
SIZE);
1115 template<Index Log2Dim>
1116 template<
typename AccessorT>
1119 bool val,
bool active, AccessorT&)
1121 this->
addTile(level, xyz, val, active);
1128 template<Index Log2Dim>
1133 if (mBuffer.
mData.isOn(this->coordToOffset(xyz)))
return Buffer::sOn;
else return Buffer::sOff;
1137 template<Index Log2Dim>
1141 assert(offset <
SIZE);
1143 if (mBuffer.
mData.isOn(offset))
return Buffer::sOn;
else return Buffer::sOff;
1147 template<Index Log2Dim>
1152 val = mBuffer.
mData.isOn(offset);
1157 template<Index Log2Dim>
1165 template<Index Log2Dim>
1169 assert(offset <
SIZE);
1170 mBuffer.
mData.set(offset, val);
1174 template<Index Log2Dim>
1182 template<Index Log2Dim>
1190 template<Index Log2Dim>
1198 template<Index Log2Dim>
1202 assert(offset <
SIZE);
1203 mBuffer.
mData.set(offset, val);
1207 template<Index Log2Dim>
1208 template<
typename ModifyOp>
1212 bool val = mBuffer.
mData.isOn(offset);
1214 mBuffer.
mData.set(offset, val);
1218 template<Index Log2Dim>
1219 template<
typename ModifyOp>
1227 template<Index Log2Dim>
1228 template<
typename ModifyOp>
1233 bool val = mBuffer.
mData.isOn(offset), state = val;
1235 mBuffer.
mData.set(offset, val);
1242 template<Index Log2Dim>
1243 template<MergePolicy Policy>
1253 template<Index Log2Dim>
1254 template<MergePolicy Policy>
1260 if (tileValue) mBuffer.
mData.setOn();
1268 template<Index Log2Dim>
1269 template<
typename OtherType>
1277 template<Index Log2Dim>
1278 template<
typename OtherType>
1287 template<Index Log2Dim>
1288 template<
typename OtherType>
1300 template<Index Log2Dim>
1307 this->
fill(nodeBBox, background,
false);
1308 }
else if (clipBBox.
isInside(nodeBBox)) {
1320 int &x = xyz.
x(), &y = xyz.
y(), &z = xyz.
z();
1321 for (x = nodeBBox.
min().
x(); x <= nodeBBox.
max().
x(); ++x) {
1322 for (y = nodeBBox.
min().
y(); y <= nodeBBox.
max().
y(); ++y) {
1323 for (z = nodeBBox.
min().
z(); z <= nodeBBox.
max().
z(); ++z) {
1340 template<Index Log2Dim>
1345 clippedBBox.intersect(bbox);
1346 if (!clippedBBox)
return;
1348 for (
Int32 x = clippedBBox.min().x(); x <= clippedBBox.max().x(); ++x) {
1349 const Index offsetX = (x & (
DIM-1u))<<2*Log2Dim;
1350 for (
Int32 y = clippedBBox.min().y(); y <= clippedBBox.max().y(); ++y) {
1351 const Index offsetXY = offsetX + ((y & (
DIM-1u))<< Log2Dim);
1352 for (
Int32 z = clippedBBox.min().z(); z <= clippedBBox.max().z(); ++z) {
1353 const Index offset = offsetXY + (z & (
DIM-1u));
1354 mBuffer.
mData.set(offset, value);
1360 template<Index Log2Dim>
1364 mBuffer.
fill(value);
1371 template<Index Log2Dim>
1372 template<
typename DenseT>
1376 using DenseValueType =
typename DenseT::ValueType;
1378 const size_t xStride = dense.xStride(), yStride = dense.yStride(), zStride = dense.zStride();
1379 const Coord&
min = dense.bbox().min();
1380 DenseValueType* t0 = dense.data() + zStride * (bbox.
min()[2] -
min[2]);
1382 for (
Int32 x = bbox.
min()[0], ex = bbox.
max()[0] + 1; x < ex; ++x) {
1383 DenseValueType* t1 = t0 + xStride * (x -
min[0]);
1385 for (
Int32 y = bbox.
min()[1], ey = bbox.
max()[1] + 1; y < ey; ++y) {
1386 DenseValueType* t2 = t1 + yStride * (y -
min[1]);
1388 for (
Int32 z = bbox.
min()[2], ez = bbox.
max()[2] + 1; z < ez; ++z, t2 += zStride) {
1389 *t2 = DenseValueType(mBuffer.
mData.isOn(n2++));
1396 template<Index Log2Dim>
1397 template<
typename DenseT>
1400 bool background,
bool tolerance)
1402 using DenseValueType =
typename DenseT::ValueType;
1404 inline static bool toBool(
const DenseValueType& v) {
return !
math::isZero(v); }
1407 const size_t xStride = dense.xStride(), yStride = dense.yStride(), zStride = dense.zStride();
1408 const Coord&
min = dense.bbox().min();
1409 const DenseValueType* s0 = dense.data() + zStride * (bbox.
min()[2] -
min[2]);
1411 for (
Int32 x = bbox.
min()[0], ex = bbox.
max()[0] + 1; x < ex; ++x) {
1412 const DenseValueType* s1 = s0 + xStride * (x -
min[0]);
1414 for (
Int32 y = bbox.
min()[1], ey = bbox.
max()[1] + 1; y < ey; ++y) {
1415 const DenseValueType* s2 = s1 + yStride * (y -
min[1]);
1417 for (
Int32 z = bbox.
min()[2], ez = bbox.
max()[2]+1; z < ez; ++z, ++n2, s2 += zStride) {
1419 if (tolerance || (background == Local::toBool(*s2))) {
1420 mBuffer.
mData.set(n2, background);
1422 mBuffer.
mData.set(n2, Local::toBool(*s2));
1433 template<Index Log2Dim>
1434 template<
typename CombineOp>
1440 bool result =
false, aVal = mBuffer.
mData.isOn(i), bVal = other.mBuffer.
mData.isOn(i);
1445 .setResultRef(result));
1446 mBuffer.
mData.set(i, result);
1451 template<Index Log2Dim>
1452 template<
typename CombineOp>
1457 args.
setBRef(value).setBIsActive(valueIsActive);
1459 bool result =
false, aVal = mBuffer.
mData.isOn(i);
1462 .setResultRef(result));
1463 mBuffer.
mData.set(i, result);
1471 template<Index Log2Dim>
1472 template<
typename CombineOp,
typename OtherType>
1475 bool valueIsActive, CombineOp& op)
1478 args.
setBRef(value).setBIsActive(valueIsActive);
1480 bool result =
false, aVal = other.mBuffer.
mData.isOn(i);
1483 .setResultRef(result));
1484 mBuffer.
mData.set(i, result);
1489 template<Index Log2Dim>
1490 template<
typename CombineOp,
typename OtherNodeT>
1493 bool valueIsActive, CombineOp& op)
1496 args.
setARef(value).setAIsActive(valueIsActive);
1498 bool result =
false, bVal = other.mBuffer.mData.isOn(i);
1501 .setResultRef(result));
1502 mBuffer.
mData.set(i, result);
1507 template<Index Log2Dim>
1508 template<
typename CombineOp,
typename OtherNodeT>
1514 bool result =
false, b0Val = b0.mBuffer.
mData.isOn(i), b1Val = b1.mBuffer.mData.isOn(i);
1516 .setAIsActive(b0Val)
1518 .setBIsActive(b1Val)
1519 .setResultRef(result));
1520 mBuffer.
mData.set(i, result);
1527 template<Index Log2Dim>
1528 template<
typename BBoxOp>
1532 if (op.template descent<LEVEL>()) {
1550 template<Index Log2Dim>
1551 template<
typename VisitorOp>
1555 doVisit<LeafNode, VisitorOp, ChildAllIter>(*
this, op);
1559 template<Index Log2Dim>
1560 template<
typename VisitorOp>
1564 doVisit<const LeafNode, VisitorOp, ChildAllCIter>(*
this, op);
1568 template<Index Log2Dim>
1569 template<
typename NodeT,
typename VisitorOp,
typename ChildAllIterT>
1573 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1582 template<Index Log2Dim>
1583 template<
typename OtherLeafNodeType,
typename VisitorOp>
1588 typename OtherLeafNodeType::ChildAllIter>(*
this, other, op);
1592 template<Index Log2Dim>
1593 template<
typename OtherLeafNodeType,
typename VisitorOp>
1598 typename OtherLeafNodeType::ChildAllCIter>(*
this, other, op);
1602 template<Index Log2Dim>
1605 typename OtherNodeT,
1607 typename ChildAllIterT,
1608 typename OtherChildAllIterT>
1613 static_assert(OtherNodeT::SIZE == NodeT::SIZE,
1614 "can't visit nodes of different sizes simultaneously");
1615 static_assert(OtherNodeT::LEVEL == NodeT::LEVEL,
1616 "can't visit nodes at different tree levels simultaneously");
1618 ChildAllIterT iter =
self.beginChildAll();
1619 OtherChildAllIterT otherIter = other.beginChildAll();
1621 for ( ; iter && otherIter; ++iter, ++otherIter) {
1622 op(iter, otherIter);
1630 template<Index Log2Dim>
1631 template<
typename IterT,
typename VisitorOp>
1635 doVisit2<LeafNode, VisitorOp, ChildAllIter, IterT>(*
this, otherIter, op, otherIsLHS);
1639 template<Index Log2Dim>
1640 template<
typename IterT,
typename VisitorOp>
1644 doVisit2<const LeafNode, VisitorOp, ChildAllCIter, IterT>(*
this, otherIter, op, otherIsLHS);
1648 template<Index Log2Dim>
1652 typename ChildAllIterT,
1653 typename OtherChildAllIterT>
1656 VisitorOp& op,
bool otherIsLHS)
1658 if (!otherIter)
return;
1661 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1662 op(otherIter, iter);
1665 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1666 op(iter, otherIter);
1675 #endif // OPENVDB_TREE_LEAF_NODE_MASK_HAS_BEEN_INCLUDED void setValuesOn()
Mark all voxels as active but don't change their values.
Definition: LeafNodeMask.h:298
ChildOffIter beginChildOff()
Definition: LeafNodeMask.h:714
ChildAllIter endChildAll()
Definition: LeafNodeMask.h:727
Coord & setY(Int32 y)
Definition: Coord.h:107
static Index getValueLevelAndCache(const Coord &, AccessorT &)
Return the LEVEL (=0) at which leaf node values reside.
Definition: LeafNodeMask.h:421
Coord & setZ(Int32 z)
Definition: Coord.h:108
~LeafNode()
Destructor.
Definition: LeafNode.h:1032
ChildAllCIter beginChildAll() const
Definition: LeafNodeMask.h:716
static Index size()
Return the total number of voxels represented by this LeafNode.
Definition: LeafNodeMask.h:133
typename std::remove_const< UnsetItemT >::type NonConstValueType
Definition: Iterator.h:211
void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition: LeafNodeMask.h:273
Definition: NodeMasks.h:272
static Index log2dim()
Return log2 of the size of the buffer storage.
Definition: LeafNodeMask.h:129
ValueIter< MaskDenseIter, const LeafNode, const bool > ValueAllCIter
Definition: LeafNodeMask.h:679
Base class for iterators over internal and leaf nodes.
Definition: Iterator.h:56
bool isDense() const
Return true if this node only contains active voxels.
Definition: LeafNodeMask.h:159
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:280
void setValueMaskOn(Index n)
Definition: LeafNodeMask.h:745
OffIterator beginOff() const
Definition: NodeMasks.h:356
Index32 Index
Definition: Types.h:61
ValueOnCIter cbeginValueOn() const
Definition: LeafNode.h:320
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:1137
uint64_t Index64
Definition: Types.h:60
void modifyItem(Index n, const ModifyOp &op) const
Definition: LeafNodeMask.h:633
General-purpose arithmetic and comparison routines, most of which accept arbitrary value types (or at...
ValueOnIter endValueOn()
Definition: LeafNodeMask.h:699
Coord & setX(Int32 x)
Definition: Coord.h:106
static Index dim()
Return the number of voxels in each dimension.
Definition: LeafNodeMask.h:131
void getNodes(ArrayT &) const
This function exists only to enable template instantiation.
Definition: LeafNodeMask.h:560
static const Index SIZE
Definition: LeafNode.h:80
ValueOnCIter cendValueOn() const
Definition: LeafNodeMask.h:697
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:1248
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:378
Base class for dense iterators over internal and leaf nodes.
Definition: Iterator.h:205
void visit2(IterT &otherIter, VisitorOp &, bool otherIsLHS=false)
Definition: LeafNode.h:1971
bool operator!=(const LeafNode &other) const
Definition: LeafNode.h:224
void setValue(bool value) const
Definition: LeafNodeMask.h:629
DenseIter< const LeafNode, const bool > ChildAllCIter
Definition: LeafNodeMask.h:685
Base class for sparse iterators over internal and leaf nodes.
Definition: Iterator.h:141
ChildAllCIter beginChildAll() const
Definition: LeafNode.h:349
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition: LeafNode.h:430
Int32 z() const
Definition: Coord.h:159
ChildOffCIter cbeginChildOff() const
Definition: LeafNodeMask.h:712
const Coord & origin() const
Return the grid index coordinates of this node's local origin.
Definition: LeafNode.h:201
Tag dispatch class that distinguishes topology copy constructors from deep copy constructors.
Definition: Types.h:518
static void doVisit2(NodeT &self, OtherChildAllIterT &, VisitorOp &, bool otherIsLHS)
Definition: LeafNode.h:1995
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:218
ValueAllCIter cendValueAll() const
Definition: LeafNodeMask.h:703
const Coord & max() const
Definition: Coord.h:338
static void getNodeLog2Dims(std::vector< Index > &dims)
Append the Log2Dim of this LeafNode to the specified vector.
Definition: LeafNodeMask.h:139
ValueAllCIter endValueAll() const
Definition: LeafNodeMask.h:704
ChildOffIter endChildOff()
Definition: LeafNodeMask.h:724
void writeTopology(std::ostream &os, bool toHalf=false) const
Write out just the topology.
Definition: LeafNode.h:1324
const NodeMaskType & getValueMask() const
Definition: LeafNodeMask.h:736
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:1728
Bit mask for the internal and leaf nodes of VDB. This is a 64-bit implementation.
Definition: NodeMasks.h:309
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:1737
void readTopology(std::istream &is, bool fromHalf=false)
Read in just the topology.
Definition: LeafNode.h:1316
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:1277
bool operator==(const LeafNode &other) const
Check for buffer, state and origin equivalence.
Definition: LeafNode.h:1464
ValueIter< MaskOffIter, const LeafNode, const bool > ValueOffCIter
Definition: LeafNodeMask.h:677
bool isValueOn(const Coord &xyz) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNodeMask.h:303
ValueType * mData
Definition: LeafBuffer.h:225
void evalActiveBoundingBox(CoordBBox &bbox, bool visitVoxels=true) const
Definition: LeafNode.h:1484
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:413
void reset()
Definition: Coord.h:343
Index medianOn(ValueType &value, ValueType *tmp=nullptr) const
Computes the median value of all the active voxels in this node.
Definition: LeafNode.h:1564
bool isChildMaskOff(Index) const
Definition: LeafNodeMask.h:741
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:51
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:260
void modifyValueAndActiveState(const Coord &xyz, const ModifyOp &op)
Apply a functor to the voxel at the given coordinates.
Definition: LeafNode.h:475
int32_t Int32
Definition: Types.h:63
Buffer mBuffer
Bitmask representing the values AND state of voxels.
Definition: LeafNodeMask.h:763
LeafNode specialization for values of type ValueMask that encodes both the active states and the bool...
Definition: LeafNodeMask.h:57
static Index getChildDim()
Return the dimension of child nodes of this LeafNode, which is one for voxels.
Definition: LeafNodeMask.h:141
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:458
ValueIter< MaskOffIter, LeafNode, const bool > ValueOffIter
Definition: LeafNodeMask.h:676
ChildOnIter beginChildOn()
Definition: LeafNodeMask.h:711
static void doVisit(NodeT &, VisitorOp &)
Definition: LeafNode.h:1909
ValueType medianAll(ValueType *tmp=nullptr) const
Computes the median value of all the active AND inactive voxels in this node.
Definition: LeafNode.h:1546
void setValueMask(Index n, bool on)
Definition: LeafNodeMask.h:744
Int32 x() const
Definition: Coord.h:157
Index64 offVoxelCount() const
Return the number of inactive voxels.
Definition: LeafNodeMask.h:150
Index64 offLeafVoxelCount() const
Definition: LeafNodeMask.h:152
bool isInactive() const
Return true if all of this node's values are inactive.
Definition: LeafNodeMask.h:464
NodeT * probeNodeAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: LeafNodeMask.h:578
Index64 memUsage() const
Return the memory in bytes occupied by this node.
Definition: LeafNode.h:1474
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:387
Index64 onLeafVoxelCount() const
Definition: LeafNodeMask.h:151
DenseIter(const MaskDenseIter &iter, NodeT *parent)
Definition: LeafNodeMask.h:657
void visitActiveBBox(BBoxOp &) const
Calls the templated functor BBoxOp with bounding box information. An additional level argument is pro...
Definition: LeafNode.h:1868
bool isValueMaskOn(Index n) const
Definition: LeafNodeMask.h:732
static void evalNodeOrigin(Coord &xyz)
Compute the origin of the leaf node that contains the voxel with the given coordinates.
Definition: LeafNodeMask.h:749
void voxelizeActiveTiles(bool=true)
No-op.
Definition: LeafNodeMask.h:479
LeafNode * probeLeafAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: LeafNodeMask.h:576
Buffer & buffer()
Definition: LeafNodeMask.h:220
bool isInside(const Coord &xyz) const
Return true if point (x, y, z) is inside this bounding box.
Definition: Coord.h:404
void setValueMask(const NodeMaskType &mask)
Definition: LeafNodeMask.h:739
ValueIter< MaskOnIter, const LeafNode, const bool > ValueOnCIter
Definition: LeafNodeMask.h:675
ChildOffCIter beginChildOff() const
Definition: LeafNodeMask.h:713
ChildAllIter beginChildAll()
Definition: LeafNodeMask.h:717
const ValueType & getValue(const Coord &xyz) const
Return the value of the voxel at the given coordinates.
Definition: LeafNode.h:1087
ValueOffCIter cendValueOff() const
Definition: LeafNodeMask.h:700
ChildOnCIter cendChildOn() const
Definition: LeafNodeMask.h:719
Definition: NodeMasks.h:210
uint32_t Index32
Definition: Types.h:59
LeafNode()
Default constructor.
Definition: LeafNode.h:946
ChildIter()
Definition: LeafNodeMask.h:644
ChildIter< MaskOnIter, const LeafNode > ChildOnCIter
Definition: LeafNodeMask.h:681
ChildOnIter endChildOn()
Definition: LeafNodeMask.h:721
void setValueOff(Index offset)
Mark the voxel at the given offset as inactive but don't change its value.
Definition: LeafNodeMask.h:265
void negate()
Invert the bits of the voxels, i.e. states and values.
Definition: LeafNodeMask.h:471
bool operator==(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Equality operator, does exact floating point comparisons.
Definition: Vec3.h:488
static Index32 leafCount()
Return the leaf count for this node, which is one.
Definition: LeafNodeMask.h:143
ChildOnCIter cbeginChildOn() const
Definition: LeafNodeMask.h:709
void setItem(Index pos, bool value) const
Definition: LeafNodeMask.h:627
Definition: NodeMasks.h:241
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:1203
const NodeMaskType & getValueMask() const
Definition: LeafNode.h:889
ValueOffCIter endValueOff() const
Definition: LeafNodeMask.h:701
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:136
static Index getValueLevel(const Coord &)
Return the level (0) at which leaf node values reside.
Definition: LeafNodeMask.h:250
void setValuesOff()
Mark all voxels as inactive but don't change their values.
Definition: LeafNodeMask.h:300
bool isZero(const Type &x)
Return true if x is exactly equal to zero.
Definition: Math.h:308
void combine2(const LeafNode &other, const OtherType &, bool valueIsActive, CombineOp &)
Definition: LeafNode.h:1804
Index64 onVoxelCount() const
Return the number of active voxels.
Definition: LeafNodeMask.h:148
bool hasOverlap(const CoordBBox &b) const
Return true if the given bounding box overlaps with this bounding box.
Definition: Coord.h:416
void setOrigin(const Coord &origin)
Set the grid index coordinates of this node's local origin.
Definition: LeafNodeMask.h:185
LeafNode * touchLeafAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: LeafNodeMask.h:573
bool isValueOn(Index offset) const
Return true if the voxel at the given offset is active.
Definition: LeafNodeMask.h:305
void visit2Node(OtherLeafNodeType &other, VisitorOp &)
Definition: LeafNode.h:1923
static Index numValues()
Return the total number of voxels represented by this LeafNode.
Definition: LeafNodeMask.h:135
void writeBuffers(std::ostream &os, bool toHalf=false) const
Write buffers to a stream.
Definition: LeafNode.h:1447
ValueIter()
Definition: LeafNodeMask.h:620
NodeMaskType & getValueMask()
Definition: LeafNodeMask.h:738
void clip(const CoordBBox &, const ValueType &background)
Set all voxels that lie outside the given axis-aligned box to the background.
Definition: LeafNode.h:1163
ValueAllIter endValueAll()
Definition: LeafNodeMask.h:705
CoordBBox getNodeBoundingBox() const
Return the bounding box of this node, i.e., the full index space spanned by this leaf node.
Definition: LeafNode.h:195
void addLeafAndCache(LeafNode *, AccessorT &)
This function exists only to enable template instantiation.
Definition: LeafNodeMask.h:553
ValueOnIter beginValueOn()
Definition: LeafNodeMask.h:689
bool isEmpty() const
Return true if this node has no active voxels.
Definition: LeafNodeMask.h:157
void addTile(Index level, const Coord &, const ValueType &, bool)
Definition: LeafNode.h:1615
void getOrigin(Coord &origin) const
Return the grid index coordinates of this node's local origin.
Definition: LeafNodeMask.h:189
const Coord & min() const
Definition: Coord.h:337
NodeT * probeNode(const Coord &)
This function exists only to enable template instantiation.
Definition: LeafNodeMask.h:557
bool isValueMaskOff(Index n) const
Definition: LeafNodeMask.h:734
void stealNodes(ArrayT &, const ValueType &, bool)
This function exists only to enable template instantiation.
Definition: LeafNodeMask.h:561
void getOrigin(Int32 &x, Int32 &y, Int32 &z) const
Return the grid index coordinates of this node's local origin.
Definition: LeafNodeMask.h:190
ValueOnCIter endValueOn() const
Definition: LeafNodeMask.h:698
static bool hasActiveTiles()
Return false since leaf nodes never contain tiles.
Definition: LeafNodeMask.h:308
Definition: Exceptions.h:40
void resetBackground(bool, bool)
no-op since for this temaplte specialization voxel values and states are indistinguishable.
Definition: LeafNodeMask.h:468
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:373
Axis-aligned bounding box of signed integer coordinates.
Definition: Coord.h:264
void visit(VisitorOp &)
Definition: LeafNode.h:1891
bool ValueType
Definition: LeafNodeMask.h:62
ChildAllCIter cbeginChildAll() const
Definition: LeafNodeMask.h:715
ChildOffCIter endChildOff() const
Definition: LeafNodeMask.h:723
const LeafNode * probeConstLeaf(const Coord &) const
Return a const pointer to this node.
Definition: LeafNodeMask.h:591
ValueAllCIter cbeginValueAll() const
Definition: LeafNodeMask.h:693
static void doVisit2Node(NodeT &self, OtherNodeT &other, VisitorOp &)
Definition: LeafNode.h:1948
void topologyUnion(const LeafNode< OtherType, Log2Dim > &other)
Union this node's set of active values with the active values of the other node, whose ValueType may ...
Definition: LeafNode.h:1720
const NodeT * probeConstNode(const Coord &) const
This function exists only to enable template instantiation.
Definition: LeafNodeMask.h:559
static const Index NUM_VALUES
Definition: LeafNode.h:78
ValueOnCIter cbeginValueOn() const
Definition: LeafNodeMask.h:687
ValueOffCIter beginValueOff() const
Definition: LeafNodeMask.h:691
void denseFill(const CoordBBox &bbox, bool value, bool=false)
Set all voxels within an axis-aligned box to the specified value.
Definition: LeafNodeMask.h:316
DenseIter< LeafNode, bool > ChildAllIter
Definition: LeafNodeMask.h:684
Int32 ValueType
Definition: Coord.h:59
Index medianOff(ValueType &value, ValueType *tmp=nullptr) const
Computes the median value of all the inactive voxels in this node.
Definition: LeafNode.h:1588
DenseIter< const LeafNode, const ValueType, ChildAll > ChildAllCIter
Definition: LeafNode.h:318
ChildOnCIter endChildOn() const
Definition: LeafNodeMask.h:720
bool allocate()
Allocate memory for this node's buffer if it has not already been allocated.
Definition: LeafNodeMask.h:169
void expand(ValueType padding)
Pad this bounding box with the specified padding.
Definition: Coord.h:422
ChildAllCIter cendChildAll() const
Definition: LeafNodeMask.h:725
ValueAllCIter beginValueAll() const
Definition: LeafNodeMask.h:694
bool isChildMaskOff() const
Definition: LeafNodeMask.h:742
This struct collects both input and output arguments to "grid combiner" functors used with the tree::...
Definition: Types.h:386
Library and file format version numbers.
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition: LeafNodeMask.h:263
std::string str() const
Return a string representation of this node.
Definition: LeafNode.h:1039
ValueIter< MaskOnIter, LeafNode, const bool > ValueOnIter
Definition: LeafNodeMask.h:674
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:255
Templated block class to hold specific data types and a fixed number of values determined by Log2Dim....
Definition: LeafNode.h:64
Int32 y() const
Definition: Coord.h:158
ValueOnCIter beginValueOn() const
Definition: LeafNodeMask.h:688
void addTileAndCache(Index, const Coord &, const ValueType &, bool, AccessorT &)
Definition: LeafNode.h:1632
const NodeMaskType & valueMask() const
Definition: LeafNodeMask.h:737
static Index coordToOffset(const Coord &xyz)
Return the linear table offset of the given global or local coordinates.
Definition: LeafNode.h:1052
const LeafNode * probeLeafAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: LeafNodeMask.h:590
const LeafNode * probeConstLeafAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: LeafNodeMask.h:593
ValueIter< MaskDenseIter, LeafNode, const bool > ValueAllIter
Definition: LeafNodeMask.h:678
const bool & getValueAndCache(const Coord &xyz, AccessorT &) const
Return the value of the voxel at the given coordinates.
Definition: LeafNodeMask.h:357
static const Index LEVEL
Definition: LeafNode.h:81
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:1502
static const Index DIM
Definition: LeafNode.h:77
void merge(const LeafNode &)
Definition: LeafNode.h:1667
static Coord offsetToLocalCoord(Index n)
Return the local coordinates for a linear table offset, where offset 0 has coordinates (0,...
Definition: LeafNode.h:1062
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:404
bool probeValue(const Coord &xyz, ValueType &val) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNode.h:1103
std::shared_ptr< T > SharedPtr
Definition: Types.h:139
typename NodeMaskType::DenseIterator MaskDenseIter
Definition: LeafNodeMask.h:610
static Index getLevel()
Return the level of this node, which by definition is zero for LeafNodes.
Definition: LeafNodeMask.h:137
ChildAllCIter endChildAll() const
Definition: LeafNodeMask.h:726
ChildIter(const MaskIterT &iter, NodeT *parent)
Definition: LeafNodeMask.h:645
Coord mOrigin
Global grid index coordinates (x,y,z) of the local origin of this node.
Definition: LeafNodeMask.h:766
ChildOnCIter beginChildOn() const
Definition: LeafNodeMask.h:710
NodeT * stealNode(const Coord &, const ValueType &, bool)
This function exists only to enable template instantiation.
Definition: LeafNodeMask.h:555
static Index64 onTileCount()
Definition: LeafNodeMask.h:153
DenseIter< LeafNode, ValueType, ChildAll > ChildAllIter
Definition: LeafNode.h:317
bool isValueMaskOn() const
Definition: LeafNodeMask.h:733
DenseIter()
Definition: LeafNodeMask.h:656
void fill(const ValueType &)
Populate this buffer with a constant value.
Definition: LeafBuffer.h:343
void modifyValue(const ModifyOp &op) const
Definition: LeafNodeMask.h:636
typename BaseT::NonConstValueType NonConstValueT
Definition: LeafNodeMask.h:654
ChildIter< MaskOffIter, LeafNode > ChildOffIter
Definition: LeafNodeMask.h:682
const bool & getFirstValue() const
Return a const reference to the first entry in the buffer.
Definition: LeafNodeMask.h:426
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 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:367
const Buffer & buffer() const
Definition: LeafNodeMask.h:219
const NodeT * probeConstNodeAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: LeafNodeMask.h:595
const bool & getValue() const
Definition: LeafNodeMask.h:624
Tag dispatch class that distinguishes constructors during file input.
Definition: Types.h:520
bool isConstant(ValueType &firstValue, bool &state, const ValueType &tolerance=zeroVal< ValueType >()) const
Definition: LeafNode.h:1510
static Index32 nonLeafCount()
Return the non-leaf count for this node, which is zero.
Definition: LeafNodeMask.h:145
const bool & getLastValue() const
Return a const reference to the last entry in the buffer.
Definition: LeafNodeMask.h:430
LeafNode * probeLeaf(const Coord &)
Return a pointer to this node.
Definition: LeafNodeMask.h:574
void readBuffers(std::istream &is, bool fromHalf=false)
Read buffers from a stream.
Definition: LeafNode.h:1352
const bool & getItem(Index pos) const
Definition: LeafNodeMask.h:623
typename NodeMaskType::OnIterator MaskOnIter
Definition: LeafNodeMask.h:608
typename NodeMaskType::OffIterator MaskOffIter
Definition: LeafNodeMask.h:609
CombineArgs & setARef(const AValueType &a)
Redirect the A value to a new external source.
Definition: Types.h:439
void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition: LeafNode.h:440
static CoordBBox createCube(const Coord &min, ValueType dim)
Definition: Coord.h:329
void setValueOn(Index offset)
Mark the voxel at the given offset as active but don't change its value.
Definition: LeafNodeMask.h:275
ChildIter< MaskOnIter, LeafNode > ChildOnIter
Definition: LeafNodeMask.h:680
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:188
ValueIter(const MaskIterT &iter, NodeT *parent)
Definition: LeafNodeMask.h:621
const NodeMaskType & valueMask() const
Definition: LeafNode.h:891
Coord offsetToGlobalCoord(Index n) const
Return the global coordinates for a linear table offset.
Definition: LeafNode.h:1076
bool getItem(Index pos, void *&child, NonConstValueT &value) const
Definition: LeafNodeMask.h:659
ChildIter< MaskOffIter, const LeafNode > ChildOffCIter
Definition: LeafNodeMask.h:683
void addLeaf(LeafNode *)
This function exists only to enable template instantiation.
Definition: LeafNodeMask.h:551
SharedPtr< LeafNodeType > Ptr
Definition: LeafNodeMask.h:65
ChildOffCIter cendChildOff() const
Definition: LeafNodeMask.h:722
Definition: PointDataGrid.h:201
static Index64 offTileCount()
Definition: LeafNodeMask.h:154
void modifyValueAndActiveStateAndCache(const Coord &xyz, const ModifyOp &op, AccessorT &)
Definition: LeafNodeMask.h:395
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:1145
ValueOffIter endValueOff()
Definition: LeafNodeMask.h:702
void unsetItem(Index pos, const ValueT &val) const
Definition: LeafNodeMask.h:670
ValueOffIter beginValueOff()
Definition: LeafNodeMask.h:692
void combine(const LeafNode &other, CombineOp &op)
Definition: LeafNode.h:1762
bool isValueMaskOff() const
Definition: LeafNodeMask.h:735
bool operator!=(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Inequality operator, does exact floating point comparisons.
Definition: Vec3.h:496
bool isChildMaskOn(Index) const
Definition: LeafNodeMask.h:740
void setOn(Index32 n)
Set the nth bit on.
Definition: NodeMasks.h:454
void intersect(const CoordBBox &bbox)
Intersect this bounding box with the given bounding box.
Definition: Coord.h:448
bool isValueOnAndCache(const Coord &xyz, AccessorT &) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNodeMask.h:362
ValueAllIter beginValueAll()
Definition: LeafNodeMask.h:695
CoordBBox getNodeBoundingBox() const
Return the bounding box of this node, i.e., the full index space spanned by this leaf node.
Definition: LeafNodeMask.h:182
CombineArgs & setBRef(const BValueType &b)
Redirect the B value to a new external source.
Definition: Types.h:441
void translate(const Coord &t)
Definition: Coord.h:462
ValueOffCIter cbeginValueOff() const
Definition: LeafNodeMask.h:690
static const Index LOG2DIM
Definition: LeafNode.h:75
void setValueMaskOff(Index n)
Definition: LeafNodeMask.h:746