Go to the documentation of this file.
4 #ifndef OPENVDB_TREE_LEAF_NODE_MASK_HAS_BEEN_INCLUDED
5 #define OPENVDB_TREE_LEAF_NODE_MASK_HAS_BEEN_INCLUDED
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>
85 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;
157 const Coord& origin()
const {
return mOrigin; }
172 std::string str()
const;
176 template<
typename OtherType, Index OtherLog2Dim>
196 void readTopology(std::istream&,
bool fromHalf =
false);
198 void writeTopology(std::ostream&,
bool toHalf =
false)
const;
201 void readBuffers(std::istream&,
bool fromHalf =
false);
202 void readBuffers(std::istream& is,
const CoordBBox&,
bool fromHalf =
false);
204 void writeBuffers(std::ostream&,
bool toHalf =
false)
const;
210 const bool& getValue(
const Coord& xyz)
const;
212 const bool& getValue(
Index offset)
const;
217 bool probeValue(
const Coord& xyz,
bool& val)
const;
223 void setActiveState(
const Coord& xyz,
bool on);
228 void setValueOnly(
const Coord& xyz,
bool val);
230 void setValueOnly(
Index offset,
bool val) { assert(offset<SIZE); mBuffer.setValue(offset,val); }
238 void setValueOff(
const Coord& xyz,
bool val);
240 void setValueOff(
Index offset,
bool val);
248 void setValueOn(
const Coord& xyz,
bool val);
252 void setValueOn(
Index offset,
bool val);
256 template<
typename ModifyOp>
257 void modifyValue(
Index offset,
const ModifyOp& op);
260 template<
typename ModifyOp>
261 void modifyValue(
const Coord& xyz,
const ModifyOp& op);
264 template<
typename ModifyOp>
265 void modifyValueAndActiveState(
const Coord& xyz,
const ModifyOp& op);
273 bool isValueOn(
const Coord& xyz)
const {
return mBuffer.mData.isOn(this->coordToOffset(xyz)); }
275 bool isValueOn(
Index offset)
const { assert(offset < SIZE);
return mBuffer.mData.isOn(offset); }
284 void fill(
const CoordBBox& bbox,
bool value,
bool =
false);
289 void fill(
const bool& value,
bool dummy =
false);
302 template<
typename DenseT>
321 template<
typename DenseT>
326 template<
typename AccessorT>
331 template<
typename AccessorT>
336 template<
typename AccessorT>
342 template<
typename AccessorT>
347 template<
typename AccessorT>
350 this->setValueOff(xyz, value);
356 template<
typename ModifyOp,
typename AccessorT>
359 this->modifyValue(xyz, op);
364 template<
typename ModifyOp,
typename AccessorT>
367 this->modifyValueAndActiveState(xyz, op);
373 template<
typename AccessorT>
376 this->setActiveState(xyz, on);
382 template<
typename AccessorT>
385 return this->probeValue(xyz, val);
390 template<
typename AccessorT>
396 const bool&
getFirstValue()
const {
if (mBuffer.mData.isOn(0))
return Buffer::sOn;
else return Buffer::sOff; }
400 const bool&
getLastValue()
const {
if (mBuffer.mData.isOn(SIZE-1))
return Buffer::sOn;
else return Buffer::sOff; }
405 bool isConstant(
bool& constValue,
bool& state,
bool tolerance = 0)
const;
412 bool medianAll()
const;
421 Index medianOn(ValueType &value)
const;
431 Index medianOff(ValueType &value)
const;
441 void negate() { mBuffer.mData.toggle(); }
443 template<MergePolicy Policy>
444 void merge(
const LeafNode& other,
bool bg =
false,
bool otherBG =
false);
445 template<MergePolicy Policy>
void merge(
bool tileValue,
bool tileActive=
false);
457 template<
typename OtherType>
471 template<
typename OtherType>
485 template<
typename OtherType>
488 template<
typename CombineOp>
489 void combine(
const LeafNode& other, CombineOp& op);
490 template<
typename CombineOp>
491 void combine(
bool,
bool valueIsActive, CombineOp& op);
493 template<
typename CombineOp,
typename OtherType >
494 void combine2(
const LeafNode& other,
const OtherType&,
bool valueIsActive, CombineOp&);
495 template<
typename CombineOp,
typename OtherNodeT >
496 void combine2(
bool,
const OtherNodeT& other,
bool valueIsActive, CombineOp&);
497 template<
typename CombineOp,
typename OtherNodeT >
498 void combine2(
const LeafNode& b0,
const OtherNodeT& b1, CombineOp&);
504 template<
typename BBoxOp>
void visitActiveBBox(BBoxOp&)
const;
506 template<
typename VisitorOp>
void visit(VisitorOp&);
507 template<
typename VisitorOp>
void visit(VisitorOp&)
const;
509 template<
typename OtherLeafNodeType,
typename VisitorOp>
510 void visit2Node(OtherLeafNodeType& other, VisitorOp&);
511 template<
typename OtherLeafNodeType,
typename VisitorOp>
512 void visit2Node(OtherLeafNodeType& other, VisitorOp&)
const;
513 template<
typename IterT,
typename VisitorOp>
514 void visit2(IterT& otherIter, VisitorOp&,
bool otherIsLHS =
false);
515 template<
typename IterT,
typename VisitorOp>
516 void visit2(IterT& otherIter, VisitorOp&,
bool otherIsLHS =
false)
const;
519 void prune(
const ValueType& = zeroVal<ValueType>()) {}
522 template<
typename AccessorT>
524 template<
typename NodeT>
526 template<
typename NodeT>
528 template<
typename NodeT>
530 template<
typename ArrayT>
void getNodes(ArrayT&)
const {}
534 void addTile(
Index level,
const Coord&,
bool val,
bool active);
535 void addTile(
Index offset,
bool val,
bool active);
536 template<
typename AccessorT>
537 void addTileAndCache(
Index level,
const Coord&,
bool val,
bool active, AccessorT&);
542 template<
typename AccessorT>
545 template<
typename AccessorT>
547 template<
typename NodeT,
typename AccessorT>
551 if (!(std::is_same<NodeT, LeafNode>::value))
return nullptr;
552 return reinterpret_cast<NodeT*>(
this);
557 const LeafNode* probeLeaf(
const Coord&)
const {
return this; }
559 template<
typename AccessorT>
562 template<
typename AccessorT>
564 template<
typename NodeT,
typename AccessorT>
568 if (!(std::is_same<NodeT, LeafNode>::value))
return nullptr;
569 return reinterpret_cast<const NodeT*>(
this);
582 template<
typename MaskIterT,
typename NodeT,
typename ValueT>
586 public SparseIteratorBase<MaskIterT, ValueIter<MaskIterT, NodeT, ValueT>, NodeT, ValueT>
593 const bool&
getItem(
Index pos)
const {
return this->parent().getValue(pos); }
594 const bool&
getValue()
const {
return this->getItem(this->pos()); }
597 void setItem(
Index pos,
bool value)
const { this->parent().setValueOnly(pos, value); }
599 void setValue(
bool value)
const { this->setItem(this->pos(), value); }
602 template<
typename ModifyOp>
603 void modifyItem(
Index n,
const ModifyOp& op)
const { this->parent().modifyValue(n, op); }
605 template<
typename ModifyOp>
606 void modifyValue(
const ModifyOp& op)
const { this->modifyItem(this->pos(), op); }
610 template<
typename MaskIterT,
typename NodeT>
616 MaskIterT, ChildIter<MaskIterT, NodeT>, NodeT, bool>(iter, parent) {}
619 template<
typename NodeT,
typename ValueT>
621 MaskDenseIter, DenseIter<NodeT, ValueT>, NodeT, void, ValueT>
631 value = this->parent().getValue(pos);
640 void unsetItem(
Index pos,
const ValueT& val)
const {this->parent().setValueOnly(pos, val);}
645 using ValueOnCIter = ValueIter<MaskOnIter, const LeafNode, const bool>;
721 template<
typename NodeT,
typename VisitorOp,
typename ChildAllIterT>
722 static inline void doVisit(NodeT&, VisitorOp&);
724 template<
typename NodeT,
typename OtherNodeT,
typename VisitorOp,
725 typename ChildAllIterT,
typename OtherChildAllIterT>
726 static inline void doVisit2Node(NodeT&
self, OtherNodeT& other, VisitorOp&);
728 template<
typename NodeT,
typename VisitorOp,
729 typename ChildAllIterT,
typename OtherChildAllIterT>
730 static inline void doVisit2(NodeT&
self, OtherChildAllIterT&, VisitorOp&,
bool otherIsLHS);
766 template<Index Log2Dim>
773 template<Index Log2Dim>
776 : mBuffer(value || active)
777 , mOrigin(xyz & (~(DIM - 1)))
782 template<Index Log2Dim>
785 : mBuffer(value || active)
786 , mOrigin(xyz & (~(DIM - 1)))
791 template<Index Log2Dim>
794 : mBuffer(other.mBuffer)
795 , mOrigin(other.mOrigin)
801 template<Index Log2Dim>
802 template<
typename ValueT>
805 : mBuffer(other.valueMask())
806 , mOrigin(other.origin())
811 template<Index Log2Dim>
812 template<
typename ValueT>
816 : mBuffer(other.valueMask())
817 , mOrigin(other.origin())
822 template<Index Log2Dim>
823 template<
typename ValueT>
826 : mBuffer(other.valueMask())
827 , mOrigin(other.origin())
832 template<Index Log2Dim>
833 template<
typename ValueT>
836 bool offValue,
bool onValue, TopologyCopy)
837 : mBuffer(other.valueMask())
838 , mOrigin(other.origin())
840 if (offValue==
true) {
841 if (onValue==
false) {
842 mBuffer.
mData.toggle();
844 mBuffer.
mData.setOn();
850 template<Index Log2Dim>
860 template<Index Log2Dim>
865 return sizeof(*this);
869 template<Index Log2Dim>
874 if (bbox.
isInside(this_bbox))
return;
878 for(; iter; ++iter) this_bbox.
expand(this->offsetToLocalCoord(iter.pos()));
886 template<Index Log2Dim>
887 template<
typename OtherType, Index OtherLog2Dim>
896 template<Index Log2Dim>
900 std::ostringstream ostr;
901 ostr <<
"LeafNode @" << mOrigin <<
": ";
902 for (
Index32 n = 0; n <
SIZE; ++n) ostr << (mBuffer.
mData.isOn(n) ?
'#' :
'.');
910 template<Index Log2Dim>
914 assert ((xyz[0] & (
DIM-1u)) <
DIM && (xyz[1] & (
DIM-1u)) <
DIM && (xyz[2] & (
DIM-1u)) <
DIM);
915 return ((xyz[0] & (
DIM-1u)) << 2*Log2Dim)
916 + ((xyz[1] & (
DIM-1u)) << Log2Dim)
917 + (xyz[2] & (
DIM-1u));
921 template<Index Log2Dim>
925 assert(n < (1 << 3*Log2Dim));
927 xyz.
setX(n >> 2*Log2Dim);
928 n &= ((1 << 2*Log2Dim) - 1);
929 xyz.
setY(n >> Log2Dim);
930 xyz.
setZ(n & ((1 << Log2Dim) - 1));
935 template<Index Log2Dim>
946 template<Index Log2Dim>
950 mBuffer.
mData.load(is);
954 template<Index Log2Dim>
958 mBuffer.
mData.save(os);
962 template<Index Log2Dim>
972 bool background =
false;
974 background = *static_cast<const bool*>(bgPtr);
976 this->
clip(clipBBox, background);
980 template<Index Log2Dim>
985 mBuffer.
mData.load(is);
991 template<Index Log2Dim>
996 mBuffer.
mData.save(os);
998 os.write(reinterpret_cast<const char*>(&mOrigin),
sizeof(
Coord::ValueType) * 3);
1005 template<Index Log2Dim>
1009 return mOrigin == other.mOrigin && mBuffer == other.mBuffer;
1013 template<Index Log2Dim>
1024 template<Index Log2Dim>
1028 if (!mBuffer.
mData.isConstant(state))
return false;
1037 template<Index Log2Dim>
1041 const Index countTrue = mBuffer.
mData.countOn();
1045 template<Index Log2Dim>
1049 const Index countTrueOn = mBuffer.
mData.countOn();
1054 template<Index Log2Dim>
1058 const Index countFalseOff = mBuffer.
mData.countOff();
1060 return countFalseOff;
1067 template<Index Log2Dim>
1074 template<Index Log2Dim>
1078 assert(offset <
SIZE);
1083 template<Index Log2Dim>
1084 template<
typename AccessorT>
1087 bool val,
bool active, AccessorT&)
1089 this->
addTile(level, xyz, val, active);
1096 template<Index Log2Dim>
1101 if (mBuffer.
mData.isOn(this->coordToOffset(xyz)))
return Buffer::sOn;
else return Buffer::sOff;
1105 template<Index Log2Dim>
1109 assert(offset <
SIZE);
1111 if (mBuffer.
mData.isOn(offset))
return Buffer::sOn;
else return Buffer::sOff;
1115 template<Index Log2Dim>
1120 val = mBuffer.
mData.isOn(offset);
1125 template<Index Log2Dim>
1133 template<Index Log2Dim>
1137 assert(offset <
SIZE);
1138 mBuffer.
mData.set(offset, val);
1142 template<Index Log2Dim>
1150 template<Index Log2Dim>
1158 template<Index Log2Dim>
1166 template<Index Log2Dim>
1170 assert(offset <
SIZE);
1171 mBuffer.
mData.set(offset, val);
1175 template<Index Log2Dim>
1176 template<
typename ModifyOp>
1180 bool val = mBuffer.
mData.isOn(offset);
1182 mBuffer.
mData.set(offset, val);
1186 template<Index Log2Dim>
1187 template<
typename ModifyOp>
1195 template<Index Log2Dim>
1196 template<
typename ModifyOp>
1201 bool val = mBuffer.
mData.isOn(offset), state = val;
1203 mBuffer.
mData.set(offset, val);
1210 template<Index Log2Dim>
1211 template<MergePolicy Policy>
1221 template<Index Log2Dim>
1222 template<MergePolicy Policy>
1228 if (tileValue) mBuffer.
mData.setOn();
1236 template<Index Log2Dim>
1237 template<
typename OtherType>
1245 template<Index Log2Dim>
1246 template<
typename OtherType>
1255 template<Index Log2Dim>
1256 template<
typename OtherType>
1268 template<Index Log2Dim>
1275 this->
fill(nodeBBox, background,
false);
1276 }
else if (clipBBox.
isInside(nodeBBox)) {
1288 int &x = xyz.
x(), &y = xyz.
y(), &z = xyz.
z();
1289 for (x = nodeBBox.
min().
x(); x <= nodeBBox.
max().
x(); ++x) {
1290 for (y = nodeBBox.
min().
y(); y <= nodeBBox.
max().
y(); ++y) {
1291 for (z = nodeBBox.
min().
z(); z <= nodeBBox.
max().
z(); ++z) {
1308 template<Index Log2Dim>
1313 clippedBBox.intersect(bbox);
1314 if (!clippedBBox)
return;
1316 for (
Int32 x = clippedBBox.min().x(); x <= clippedBBox.max().x(); ++x) {
1317 const Index offsetX = (x & (
DIM-1u))<<2*Log2Dim;
1318 for (
Int32 y = clippedBBox.min().y(); y <= clippedBBox.max().y(); ++y) {
1319 const Index offsetXY = offsetX + ((y & (
DIM-1u))<< Log2Dim);
1320 for (
Int32 z = clippedBBox.min().z(); z <= clippedBBox.max().z(); ++z) {
1321 const Index offset = offsetXY + (z & (
DIM-1u));
1322 mBuffer.
mData.set(offset, value);
1328 template<Index Log2Dim>
1332 mBuffer.
fill(value);
1339 template<Index Log2Dim>
1340 template<
typename DenseT>
1344 using DenseValueType =
typename DenseT::ValueType;
1346 const size_t xStride = dense.xStride(), yStride = dense.yStride(), zStride = dense.zStride();
1347 const Coord&
min = dense.bbox().min();
1348 DenseValueType* t0 = dense.data() + zStride * (bbox.
min()[2] -
min[2]);
1350 for (
Int32 x = bbox.
min()[0], ex = bbox.
max()[0] + 1; x < ex; ++x) {
1351 DenseValueType* t1 = t0 + xStride * (x -
min[0]);
1353 for (
Int32 y = bbox.
min()[1], ey = bbox.
max()[1] + 1; y < ey; ++y) {
1354 DenseValueType* t2 = t1 + yStride * (y -
min[1]);
1356 for (
Int32 z = bbox.
min()[2], ez = bbox.
max()[2] + 1; z < ez; ++z, t2 += zStride) {
1357 *t2 = DenseValueType(mBuffer.
mData.isOn(n2++));
1364 template<Index Log2Dim>
1365 template<
typename DenseT>
1368 bool background,
bool tolerance)
1370 using DenseValueType =
typename DenseT::ValueType;
1372 inline static bool toBool(
const DenseValueType& v) {
return !
math::isZero(v); }
1375 const size_t xStride = dense.xStride(), yStride = dense.yStride(), zStride = dense.zStride();
1376 const Coord&
min = dense.bbox().min();
1377 const DenseValueType* s0 = dense.data() + zStride * (bbox.
min()[2] -
min[2]);
1379 for (
Int32 x = bbox.
min()[0], ex = bbox.
max()[0] + 1; x < ex; ++x) {
1380 const DenseValueType* s1 = s0 + xStride * (x -
min[0]);
1382 for (
Int32 y = bbox.
min()[1], ey = bbox.
max()[1] + 1; y < ey; ++y) {
1383 const DenseValueType* s2 = s1 + yStride * (y -
min[1]);
1385 for (
Int32 z = bbox.
min()[2], ez = bbox.
max()[2]+1; z < ez; ++z, ++n2, s2 += zStride) {
1387 if (tolerance || (background == Local::toBool(*s2))) {
1388 mBuffer.
mData.set(n2, background);
1390 mBuffer.
mData.set(n2, Local::toBool(*s2));
1401 template<Index Log2Dim>
1402 template<
typename CombineOp>
1408 bool result =
false, aVal = mBuffer.
mData.isOn(i), bVal = other.mBuffer.
mData.isOn(i);
1413 .setResultRef(result));
1414 mBuffer.
mData.set(i, result);
1419 template<Index Log2Dim>
1420 template<
typename CombineOp>
1425 args.
setBRef(value).setBIsActive(valueIsActive);
1427 bool result =
false, aVal = mBuffer.
mData.isOn(i);
1430 .setResultRef(result));
1431 mBuffer.
mData.set(i, result);
1439 template<Index Log2Dim>
1440 template<
typename CombineOp,
typename OtherType>
1443 bool valueIsActive, CombineOp& op)
1446 args.
setBRef(value).setBIsActive(valueIsActive);
1448 bool result =
false, aVal = other.mBuffer.
mData.isOn(i);
1451 .setResultRef(result));
1452 mBuffer.
mData.set(i, result);
1457 template<Index Log2Dim>
1458 template<
typename CombineOp,
typename OtherNodeT>
1461 bool valueIsActive, CombineOp& op)
1464 args.
setARef(value).setAIsActive(valueIsActive);
1466 bool result =
false, bVal = other.mBuffer.mData.isOn(i);
1469 .setResultRef(result));
1470 mBuffer.
mData.set(i, result);
1475 template<Index Log2Dim>
1476 template<
typename CombineOp,
typename OtherNodeT>
1482 bool result =
false, b0Val = b0.mBuffer.
mData.isOn(i), b1Val = b1.mBuffer.mData.isOn(i);
1484 .setAIsActive(b0Val)
1486 .setBIsActive(b1Val)
1487 .setResultRef(result));
1488 mBuffer.
mData.set(i, result);
1495 template<Index Log2Dim>
1496 template<
typename BBoxOp>
1500 if (op.template descent<LEVEL>()) {
1518 template<Index Log2Dim>
1519 template<
typename VisitorOp>
1523 doVisit<LeafNode, VisitorOp, ChildAllIter>(*
this, op);
1527 template<Index Log2Dim>
1528 template<
typename VisitorOp>
1532 doVisit<const LeafNode, VisitorOp, ChildAllCIter>(*
this, op);
1536 template<Index Log2Dim>
1537 template<
typename NodeT,
typename VisitorOp,
typename ChildAllIterT>
1541 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1550 template<Index Log2Dim>
1551 template<
typename OtherLeafNodeType,
typename VisitorOp>
1556 typename OtherLeafNodeType::ChildAllIter>(*
this, other, op);
1560 template<Index Log2Dim>
1561 template<
typename OtherLeafNodeType,
typename VisitorOp>
1566 typename OtherLeafNodeType::ChildAllCIter>(*
this, other, op);
1570 template<Index Log2Dim>
1573 typename OtherNodeT,
1575 typename ChildAllIterT,
1576 typename OtherChildAllIterT>
1581 static_assert(OtherNodeT::SIZE == NodeT::SIZE,
1582 "can't visit nodes of different sizes simultaneously");
1583 static_assert(OtherNodeT::LEVEL == NodeT::LEVEL,
1584 "can't visit nodes at different tree levels simultaneously");
1586 ChildAllIterT iter =
self.beginChildAll();
1587 OtherChildAllIterT otherIter = other.beginChildAll();
1589 for ( ; iter && otherIter; ++iter, ++otherIter) {
1590 op(iter, otherIter);
1598 template<Index Log2Dim>
1599 template<
typename IterT,
typename VisitorOp>
1603 doVisit2<LeafNode, VisitorOp, ChildAllIter, IterT>(*
this, otherIter, op, otherIsLHS);
1607 template<Index Log2Dim>
1608 template<
typename IterT,
typename VisitorOp>
1612 doVisit2<const LeafNode, VisitorOp, ChildAllCIter, IterT>(*
this, otherIter, op, otherIsLHS);
1616 template<Index Log2Dim>
1620 typename ChildAllIterT,
1621 typename OtherChildAllIterT>
1624 VisitorOp& op,
bool otherIsLHS)
1626 if (!otherIter)
return;
1629 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1630 op(otherIter, iter);
1633 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1634 op(iter, otherIter);
1643 #endif // OPENVDB_TREE_LEAF_NODE_MASK_HAS_BEEN_INCLUDED
void expand(ValueType padding)
Pad this bounding box with the specified padding.
Definition: Coord.h:418
static Index64 offTileCount()
Definition: LeafNodeMask.h:127
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:230
DenseIter< LeafNode, ValueType, ChildAll > ChildAllIter
Definition: LeafNode.h:286
bool isDense() const
Return true if this node only contains active voxels.
Definition: LeafNodeMask.h:132
const NodeT * probeConstNodeAndCache(const Coord &, AccessorT &) const
Definition: LeafNodeMask.h:565
Coord & setY(Int32 y)
Definition: Coord.h:81
ChildAllCIter cendChildAll() const
Definition: LeafNodeMask.h:695
void setValueMask(const NodeMaskType &mask)
Definition: LeafNodeMask.h:709
void modifyValueAndActiveState(const Coord &xyz, const ModifyOp &op)
Apply a functor to the voxel at the given coordinates.
Definition: LeafNode.h:448
void setValueOff(Index offset)
Mark the voxel at the given offset as inactive but don't change its value.
Definition: LeafNodeMask.h:235
void merge(const LeafNode &)
Definition: LeafNode.h:1630
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:348
bool isChildMaskOff() const
Definition: LeafNodeMask.h:712
Index64 onVoxelCount() const
Return the number of active voxels.
Definition: LeafNodeMask.h:121
bool isInactive() const
Return true if all of this node's values are inactive.
Definition: LeafNodeMask.h:434
static Coord offsetToLocalCoord(Index n)
Return the local coordinates for a linear table offset, where offset 0 has coordinates (0,...
Definition: LeafNode.h:1036
void nodeCount(std::vector< Index32 > &) const
no-op
Definition: LeafNodeMask.h:116
void setValueMaskOff(Index n)
Definition: LeafNodeMask.h:716
bool isValueOn(Index offset) const
Return true if the voxel at the given offset is active.
Definition: LeafNodeMask.h:275
static Index size()
Return the total number of voxels represented by this LeafNode.
Definition: LeafNodeMask.h:104
bool hasSameTopology(const LeafNode< OtherType, OtherLog2Dim > *other) const
Return true if the given node (which may have a different ValueType than this node) has the same acti...
Definition: LeafNode.h:1467
const NodeMaskType & valueMask() const
Definition: LeafNodeMask.h:707
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:374
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:337
void setValueMaskOn(Index n)
Definition: LeafNodeMask.h:715
const LeafNode * probeConstLeafAndCache(const Coord &, AccessorT &) const
Definition: LeafNodeMask.h:563
static Index getValueLevel(const Coord &)
Return the level (0) at which leaf node values reside.
Definition: LeafNodeMask.h:220
ValueAllCIter cbeginValueAll() const
Definition: LeafNodeMask.h:663
void setValue(bool value) const
Definition: LeafNodeMask.h:599
static void evalNodeOrigin(Coord &xyz)
Compute the origin of the leaf node that contains the voxel with the given coordinates.
Definition: LeafNodeMask.h:719
static Index64 onTileCount()
Definition: LeafNodeMask.h:126
ChildOnCIter endChildOn() const
Definition: LeafNodeMask.h:690
LeafNode * probeLeaf(const Coord &)
Definition: LeafNodeMask.h:544
ValueOnCIter cbeginValueOn() const
Definition: LeafNodeMask.h:657
bool operator!=(const LeafNode &other) const
Definition: LeafNode.h:193
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:25
bool isConstant(ValueType &firstValue, bool &state, const ValueType &tolerance=zeroVal< ValueType >()) const
Definition: LeafNode.h:1475
DenseIter(const MaskDenseIter &iter, NodeT *parent)
Definition: LeafNodeMask.h:627
ChildAllIter beginChildAll()
Definition: LeafNodeMask.h:687
static const Index SIZE
Definition: LeafNode.h:53
Int32 ValueType
Definition: Coord.h:33
ValueAllIter beginValueAll()
Definition: LeafNodeMask.h:665
void setItem(Index pos, bool value) const
Definition: LeafNodeMask.h:597
const Coord & origin() const
Return the grid index coordinates of this node's local origin.
Definition: LeafNode.h:170
static void doVisit2(NodeT &self, OtherChildAllIterT &, VisitorOp &, bool otherIsLHS)
Definition: LeafNode.h:1948
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
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:1220
bool isAllocated() const
Return true if memory for this node's buffer has been allocated.
Definition: LeafNodeMask.h:136
Definition: PointDataGrid.h:174
void addTile(Index level, const Coord &, const ValueType &, bool)
Definition: LeafNode.h:1580
void visit2(IterT &otherIter, VisitorOp &, bool otherIsLHS=false)
Definition: LeafNode.h:1924
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:1177
Coord & setZ(Int32 z)
Definition: Coord.h:82
void writeTopology(std::ostream &os, bool toHalf=false) const
Write out just the topology.
Definition: LeafNode.h:1292
void setOn(Index32 n)
Set the nth bit on.
Definition: NodeMasks.h:433
void modifyItem(Index n, const ModifyOp &op) const
Definition: LeafNodeMask.h:603
ChildAllCIter cbeginChildAll() const
Definition: LeafNodeMask.h:685
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition: LeafNode.h:399
bool isValueMaskOn(Index n) const
Definition: LeafNodeMask.h:702
ChildIter()
Definition: LeafNodeMask.h:614
void topologyDifference(const LeafNode< OtherType, Log2Dim > &other, const ValueType &)
Difference this node's set of active values with the active values of the other node,...
Definition: LeafNode.h:1696
const LeafNode * probeLeafAndCache(const Coord &, AccessorT &) const
Definition: LeafNodeMask.h:560
void visit2Node(OtherLeafNodeType &other, VisitorOp &)
Definition: LeafNode.h:1876
void getNodes(ArrayT &) const
Definition: LeafNodeMask.h:530
Int32 y() const
Definition: Coord.h:132
static const Index LOG2DIM
Definition: LeafNode.h:48
static const Index NUM_VALUES
Definition: LeafNode.h:51
bool allocate()
Allocate memory for this node's buffer if it has not already been allocated.
Definition: LeafNodeMask.h:140
const NodeMaskType & valueMask() const
Definition: LeafNode.h:867
ChildIter< MaskOffIter, const LeafNode > ChildOffCIter
Definition: LeafNodeMask.h:653
static void getNodeLog2Dims(std::vector< Index > &dims)
Append the Log2Dim of this LeafNode to the specified vector.
Definition: LeafNodeMask.h:110
ValueOffCIter cbeginValueOff() const
Definition: LeafNodeMask.h:660
Coord offsetToGlobalCoord(Index n) const
Return the global coordinates for a linear table offset.
Definition: LeafNode.h:1050
CombineArgs & setARef(const AValueType &a)
Redirect the A value to a new external source.
Definition: Types.h:620
DenseIter< const LeafNode, const bool > ChildAllCIter
Definition: LeafNodeMask.h:655
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:1119
ChildOnIter endChildOn()
Definition: LeafNodeMask.h:691
void fill(const ValueType &)
Populate this buffer with a constant value.
Definition: LeafBuffer.h:268
bool isChildMaskOff(Index) const
Definition: LeafNodeMask.h:711
ValueAllCIter cendValueAll() const
Definition: LeafNodeMask.h:673
Library and file format version numbers.
void evalActiveBoundingBox(CoordBBox &bbox, bool visitVoxels=true) const
Definition: LeafNode.h:1449
void getOrigin(Coord &origin) const
Definition: LeafNodeMask.h:159
Definition: NodeMasks.h:189
Index medianOn(ValueType &value, ValueType *tmp=nullptr) const
Computes the median value of all the active voxels in this node.
Definition: LeafNode.h:1529
Int32 x() const
Definition: Coord.h:131
static Index coordToOffset(const Coord &xyz)
Return the linear table offset of the given global or local coordinates.
Definition: LeafNode.h:1026
ValueOnCIter beginValueOn() const
Definition: LeafNodeMask.h:658
NodeT * stealNode(const Coord &, const ValueType &, bool)
Definition: LeafNodeMask.h:525
static Index numValues()
Return the total number of voxels represented by this LeafNode.
Definition: LeafNodeMask.h:106
ValueAllCIter endValueAll() const
Definition: LeafNodeMask.h:674
Base class for iterators over internal and leaf nodes.
Definition: Iterator.h:29
const NodeMaskType & getValueMask() const
Definition: LeafNodeMask.h:706
ChildOffCIter beginChildOff() const
Definition: LeafNodeMask.h:683
void intersect(const CoordBBox &bbox)
Intersect this bounding box with the given bounding box.
Definition: Coord.h:444
ChildIter(const MaskIterT &iter, NodeT *parent)
Definition: LeafNodeMask.h:615
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:427
std::shared_ptr< T > SharedPtr
Definition: Types.h:91
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:1111
Buffer mBuffer
Bitmask representing the values AND state of voxels.
Definition: LeafNodeMask.h:733
ValueOffCIter cendValueOff() const
Definition: LeafNodeMask.h:670
void reset()
Definition: Coord.h:327
ChildOnCIter cbeginChildOn() const
Definition: LeafNodeMask.h:679
const ValueType & getValue(const Coord &xyz) const
Return the value of the voxel at the given coordinates.
Definition: LeafNode.h:1061
ValueOffCIter beginValueOff() const
Definition: LeafNodeMask.h:661
static const Index LEVEL
Definition: LeafNode.h:54
Axis-aligned bounding box of signed integer coordinates.
Definition: Coord.h:248
ValueOnCIter cendValueOn() const
Definition: LeafNodeMask.h:667
bool probeValue(const Coord &xyz, ValueType &val) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNode.h:1077
SharedPtr< LeafNodeType > Ptr
Definition: LeafNodeMask.h:38
bool isValueMaskOff() const
Definition: LeafNodeMask.h:705
ChildAllCIter beginChildAll() const
Definition: LeafNodeMask.h:686
void getOrigin(Int32 &x, Int32 &y, Int32 &z) const
Definition: LeafNodeMask.h:160
bool hasOverlap(const CoordBBox &b) const
Return true if the given bounding box overlaps with this bounding box.
Definition: Coord.h:412
Base class for sparse iterators over internal and leaf nodes.
Definition: Iterator.h:114
void denseFill(const CoordBBox &bbox, bool value, bool=false)
Set all voxels within an axis-aligned box to the specified value.
Definition: LeafNodeMask.h:286
typename std::remove_const< UnsetItemT >::type NonConstValueType
Definition: Iterator.h:184
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:343
const Buffer & buffer() const
Definition: LeafNodeMask.h:189
Index64 offVoxelCount() const
Return the number of inactive voxels.
Definition: LeafNodeMask.h:123
Coord mOrigin
Global grid index coordinates (x,y,z) of the local origin of this node.
Definition: LeafNodeMask.h:736
LeafNode * touchLeafAndCache(const Coord &, AccessorT &)
Definition: LeafNodeMask.h:543
Definition: NodeMasks.h:251
bool ValueType
Definition: LeafNodeMask.h:35
Definition: NodeMasks.h:220
ValueIter< MaskOffIter, LeafNode, const bool > ValueOffIter
Definition: LeafNodeMask.h:646
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition: LeafNodeMask.h:233
const LeafNode * probeConstLeaf(const Coord &) const
Definition: LeafNodeMask.h:561
ChildOnCIter cendChildOn() const
Definition: LeafNodeMask.h:689
ChildAllCIter beginChildAll() const
Definition: LeafNode.h:318
bool isInside(const Coord &xyz) const
Return true if point (x, y, z) is inside this bounding box.
Definition: Coord.h:400
Index64 offLeafVoxelCount() const
Definition: LeafNodeMask.h:125
void voxelizeActiveTiles(bool=true)
No-op.
Definition: LeafNodeMask.h:449
void unsetItem(Index pos, const ValueT &val) const
Definition: LeafNodeMask.h:640
void translate(const Coord &t)
Translate this bounding box by (tx, ty, tz).
Definition: Coord.h:458
const bool & getItem(Index pos) const
Definition: LeafNodeMask.h:593
void negate()
Invert the bits of the voxels, i.e. states and values.
Definition: LeafNodeMask.h:441
General-purpose arithmetic and comparison routines, most of which accept arbitrary value types (or at...
static CoordBBox createCube(const Coord &min, ValueType dim)
Definition: Coord.h:313
ChildAllCIter endChildAll() const
Definition: LeafNodeMask.h:696
ValueOffIter endValueOff()
Definition: LeafNodeMask.h:672
ChildIter< MaskOnIter, const LeafNode > ChildOnCIter
Definition: LeafNodeMask.h:651
void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition: LeafNode.h:409
void addLeaf(LeafNode *)
Definition: LeafNodeMask.h:521
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:1247
static Index getLevel()
Return the level of this node, which by definition is zero for LeafNodes.
Definition: LeafNodeMask.h:108
ChildOnCIter beginChildOn() const
Definition: LeafNodeMask.h:680
static Index getChildDim()
Return the dimension of child nodes of this LeafNode, which is one for voxels.
Definition: LeafNodeMask.h:112
bool getItem(Index pos, void *&child, NonConstValueT &value) const
Definition: LeafNodeMask.h:629
bool isEmpty() const
Return true if this node has no active voxels.
Definition: LeafNodeMask.h:130
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:225
void clip(const CoordBBox &, const ValueType &background)
Set all voxels that lie outside the given axis-aligned box to the background.
Definition: LeafNode.h:1137
LeafNode * probeLeafAndCache(const Coord &, AccessorT &)
Definition: LeafNodeMask.h:546
typename NodeMaskType::DenseIterator MaskDenseIter
Definition: LeafNodeMask.h:580
void resetBackground(bool, bool)
no-op since for this temaplte specialization voxel values and states are indistinguishable.
Definition: LeafNodeMask.h:438
void modifyValue(const ModifyOp &op) const
Definition: LeafNodeMask.h:606
ValueAllIter endValueAll()
Definition: LeafNodeMask.h:675
ValueIter()
Definition: LeafNodeMask.h:590
ValueOnIter endValueOn()
Definition: LeafNodeMask.h:669
ChildOffCIter endChildOff() const
Definition: LeafNodeMask.h:693
Bit mask for the internal and leaf nodes of VDB. This is a 64-bit implementation.
Definition: NodeMasks.h:288
ValueType medianAll(ValueType *tmp=nullptr) const
Computes the median value of all the active AND inactive voxels in this node.
Definition: LeafNode.h:1511
bool operator==(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Equality operator, does exact floating point comparisons.
Definition: Vec3.h:471
Tag dispatch class that distinguishes topology copy constructors from deep copy constructors.
Definition: Types.h:681
ValueType * mData
Definition: LeafBuffer.h:169
void visit(VisitorOp &)
Definition: LeafNode.h:1844
const Coord & max() const
Definition: Coord.h:322
ChildOnIter beginChildOn()
Definition: LeafNodeMask.h:681
void readTopology(std::istream &is, bool fromHalf=false)
Read in just the topology.
Definition: LeafNode.h:1284
bool operator==(const LeafNode &other) const
Check for buffer, state and origin equivalence.
Definition: LeafNode.h:1429
typename NodeMaskType::OnIterator MaskOnIter
Definition: LeafNodeMask.h:578
const bool & getLastValue() const
Return a const reference to the last entry in the buffer.
Definition: LeafNodeMask.h:400
const Coord & min() const
Definition: Coord.h:321
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:188
void setOrigin(const Coord &origin)
Set the grid index coordinates of this node's local origin.
Definition: LeafNodeMask.h:155
Templated block class to hold specific data types and a fixed number of values determined by Log2Dim....
Definition: LeafNode.h:37
Int32 z() const
Definition: Coord.h:133
ValueOnCIter endValueOn() const
Definition: LeafNodeMask.h:668
ValueIter< MaskOffIter, const LeafNode, const bool > ValueOffCIter
Definition: LeafNodeMask.h:647
const NodeT * probeConstNode(const Coord &) const
Definition: LeafNodeMask.h:529
This struct collects both input and output arguments to "grid combiner" functors used with the tree::...
Definition: Types.h:567
ValueIter(const MaskIterT &iter, NodeT *parent)
Definition: LeafNodeMask.h:591
ValueOffCIter endValueOff() const
Definition: LeafNodeMask.h:671
ValueAllCIter beginValueAll() const
Definition: LeafNodeMask.h:664
LeafNode()
Default constructor.
Definition: LeafNode.h:922
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:154
static Index log2dim()
Return log2 of the size of the buffer storage.
Definition: LeafNodeMask.h:100
static Index32 nonLeafCount()
Return the non-leaf count for this node, which is zero.
Definition: LeafNodeMask.h:118
std::string str() const
Return a string representation of this node.
Definition: LeafNode.h:1013
OffIterator beginOff() const
Definition: NodeMasks.h:335
LeafNode specialization for values of type ValueMask that encodes both the active states and the bool...
Definition: LeafNodeMask.h:30
void setValueMask(Index n, bool on)
Definition: LeafNodeMask.h:714
const NodeMaskType & getValueMask() const
Definition: LeafNode.h:865
Buffer & buffer()
Definition: LeafNodeMask.h:190
ValueOnCIter cbeginValueOn() const
Definition: LeafNode.h:289
ValueOnIter beginValueOn()
Definition: LeafNodeMask.h:659
bool isValueMaskOff(Index n) const
Definition: LeafNodeMask.h:704
void stealNodes(ArrayT &, const ValueType &, bool)
Definition: LeafNodeMask.h:531
const bool & getValueAndCache(const Coord &xyz, AccessorT &) const
Return the value of the voxel at the given coordinates.
Definition: LeafNodeMask.h:327
Index64 memUsage() const
Return the memory in bytes occupied by this node.
Definition: LeafNode.h:1439
ChildOffIter beginChildOff()
Definition: LeafNodeMask.h:684
void visitActiveBBox(BBoxOp &) const
Calls the templated functor BBoxOp with bounding box information. An additional level argument is pro...
Definition: LeafNode.h:1821
const bool & getFirstValue() const
Return a const reference to the first entry in the buffer.
Definition: LeafNodeMask.h:396
static Index getValueLevelAndCache(const Coord &, AccessorT &)
Return the LEVEL (=0) at which leaf node values reside.
Definition: LeafNodeMask.h:391
ValueIter< MaskOnIter, const LeafNode, const bool > ValueOnCIter
Definition: LeafNodeMask.h:645
Coord & setX(Int32 x)
Definition: Coord.h:80
Index64 onLeafVoxelCount() const
Definition: LeafNodeMask.h:124
Index32 Index
Definition: Types.h:31
~LeafNode()
Destructor.
Definition: LeafNode.h:1006
bool operator!=(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Inequality operator, does exact floating point comparisons.
Definition: Vec3.h:479
bool isChildMaskOn(Index) const
Definition: LeafNodeMask.h:710
ChildOffCIter cendChildOff() const
Definition: LeafNodeMask.h:692
const OPENVDB_API 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 setValueOn(Index offset)
Mark the voxel at the given offset as active but don't change its value.
Definition: LeafNodeMask.h:245
ValueIter< MaskDenseIter, LeafNode, const bool > ValueAllIter
Definition: LeafNodeMask.h:648
DenseIter()
Definition: LeafNodeMask.h:626
ValueIter< MaskOnIter, LeafNode, const bool > ValueOnIter
Definition: LeafNodeMask.h:644
void combine2(const LeafNode &other, const OtherType &, bool valueIsActive, CombineOp &)
Definition: LeafNode.h:1760
static bool hasActiveTiles()
Return false since leaf nodes never contain tiles.
Definition: LeafNodeMask.h:278
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:102
Base class for dense iterators over internal and leaf nodes.
Definition: Iterator.h:178
void setValuesOff()
Mark all voxels as inactive but don't change their values.
Definition: LeafNodeMask.h:270
ValueIter< MaskDenseIter, const LeafNode, const bool > ValueAllCIter
Definition: LeafNodeMask.h:649
DenseIter< LeafNode, bool > ChildAllIter
Definition: LeafNodeMask.h:654
static void doVisit2Node(NodeT &self, OtherNodeT &other, VisitorOp &)
Definition: LeafNode.h:1901
typename BaseT::NonConstValueType NonConstValueT
Definition: LeafNodeMask.h:624
static Index32 leafCount()
Return the leaf count for this node, which is one.
Definition: LeafNodeMask.h:114
void readBuffers(std::istream &is, bool fromHalf=false)
Read buffers from a stream.
Definition: LeafNode.h:1320
void writeBuffers(std::ostream &os, bool toHalf=false) const
Write buffers to a stream.
Definition: LeafNode.h:1412
uint32_t Index32
Definition: Types.h:29
ValueOffIter beginValueOff()
Definition: LeafNodeMask.h:662
Index medianOff(ValueType &value, ValueType *tmp=nullptr) const
Computes the median value of all the inactive voxels in this node.
Definition: LeafNode.h:1553
CoordBBox getNodeBoundingBox() const
Return the bounding box of this node, i.e., the full index space spanned by this leaf node.
Definition: LeafNode.h:164
DenseIter< const LeafNode, const ValueType, ChildAll > ChildAllCIter
Definition: LeafNode.h:287
bool isValueMaskOn() const
Definition: LeafNodeMask.h:703
Tag dispatch class that distinguishes constructors during file input.
Definition: Types.h:683
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:357
void addLeafAndCache(LeafNode *, AccessorT &)
Definition: LeafNodeMask.h:523
ChildOffCIter cbeginChildOff() const
Definition: LeafNodeMask.h:682
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:383
NodeMaskType & getValueMask()
Definition: LeafNodeMask.h:708
Definition: Exceptions.h:13
int32_t Int32
Definition: Types.h:33
const bool & getValue() const
Definition: LeafNodeMask.h:594
ChildIter< MaskOnIter, LeafNode > ChildOnIter
Definition: LeafNodeMask.h:650
void topologyIntersection(const LeafNode< OtherType, Log2Dim > &other, const ValueType &)
Intersect this node's set of active values with the active values of the other node,...
Definition: LeafNode.h:1687
ChildOffIter endChildOff()
Definition: LeafNodeMask.h:694
uint64_t Index64
Definition: Types.h:30
static Index dim()
Return the number of voxels in each dimension.
Definition: LeafNodeMask.h:102
void combine(const LeafNode &other, CombineOp &op)
Definition: LeafNode.h:1720
void modifyValueAndActiveStateAndCache(const Coord &xyz, const ModifyOp &op, AccessorT &)
Definition: LeafNodeMask.h:365
ChildAllIter endChildAll()
Definition: LeafNodeMask.h:697
void addTileAndCache(Index, const Coord &, const ValueType &, bool, AccessorT &)
Definition: LeafNode.h:1597
void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition: LeafNodeMask.h:243
bool isValueOn(const Coord &xyz) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNodeMask.h:273
static const Index DIM
Definition: LeafNode.h:50
void setValuesOn()
Mark all voxels as active but don't change their values.
Definition: LeafNodeMask.h:268
NodeT * probeNodeAndCache(const Coord &, AccessorT &)
Definition: LeafNodeMask.h:548
CombineArgs & setBRef(const BValueType &b)
Redirect the B value to a new external source.
Definition: Types.h:622
ChildIter< MaskOffIter, LeafNode > ChildOffIter
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:332
typename NodeMaskType::OffIterator MaskOffIter
Definition: LeafNodeMask.h:579
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:1679
static void doVisit(NodeT &, VisitorOp &)
Definition: LeafNode.h:1862
NodeT * probeNode(const Coord &)
Definition: LeafNodeMask.h:527
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:250
bool isZero(const Type &x)
Return true if x is exactly equal to zero.
Definition: Math.h:281