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
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>
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>
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>
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>()) {
1510 template<Index Log2Dim>
1511 template<
typename VisitorOp>
1515 doVisit<LeafNode, VisitorOp, ChildAllIter>(*
this, op);
1519 template<Index Log2Dim>
1520 template<
typename VisitorOp>
1524 doVisit<const LeafNode, VisitorOp, ChildAllCIter>(*
this, op);
1528 template<Index Log2Dim>
1529 template<
typename NodeT,
typename VisitorOp,
typename ChildAllIterT>
1533 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1542 template<Index Log2Dim>
1543 template<
typename OtherLeafNodeType,
typename VisitorOp>
1548 typename OtherLeafNodeType::ChildAllIter>(*
this, other, op);
1552 template<Index Log2Dim>
1553 template<
typename OtherLeafNodeType,
typename VisitorOp>
1558 typename OtherLeafNodeType::ChildAllCIter>(*
this, other, op);
1562 template<Index Log2Dim>
1565 typename OtherNodeT,
1567 typename ChildAllIterT,
1568 typename OtherChildAllIterT>
1573 static_assert(OtherNodeT::SIZE == NodeT::SIZE,
1574 "can't visit nodes of different sizes simultaneously");
1575 static_assert(OtherNodeT::LEVEL == NodeT::LEVEL,
1576 "can't visit nodes at different tree levels simultaneously");
1578 ChildAllIterT iter =
self.beginChildAll();
1579 OtherChildAllIterT otherIter = other.beginChildAll();
1581 for ( ; iter && otherIter; ++iter, ++otherIter) {
1582 op(iter, otherIter);
1590 template<Index Log2Dim>
1591 template<
typename IterT,
typename VisitorOp>
1595 doVisit2<LeafNode, VisitorOp, ChildAllIter, IterT>(*
this, otherIter, op, otherIsLHS);
1599 template<Index Log2Dim>
1600 template<
typename IterT,
typename VisitorOp>
1604 doVisit2<const LeafNode, VisitorOp, ChildAllCIter, IterT>(*
this, otherIter, op, otherIsLHS);
1608 template<Index Log2Dim>
1612 typename ChildAllIterT,
1613 typename OtherChildAllIterT>
1616 VisitorOp& op,
bool otherIsLHS)
1618 if (!otherIter)
return;
1621 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1622 op(otherIter, iter);
1625 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1626 op(iter, otherIter);
1635 #endif // OPENVDB_TREE_LEAF_NODE_MASK_HAS_BEEN_INCLUDED
bool operator==(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Equality operator, does exact floating point comparisons.
Definition: Vec3.h:477
Index64 offLeafVoxelCount() const
Definition: LeafNodeMask.h:125
typename NodeMaskType::DenseIterator MaskDenseIter
Definition: LeafNodeMask.h:580
ValueAllIter endValueAll()
Definition: LeafNodeMask.h:675
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:1222
ChildAllCIter endChildAll() const
Definition: LeafNodeMask.h:696
void visit2Node(OtherLeafNodeType &other, VisitorOp &)
Definition: LeafNode.h:1870
@ MERGE_ACTIVE_STATES_AND_NODES
Definition: openvdb/Types.h:387
static const Index NUM_VALUES
Definition: LeafNode.h:51
ChildOnIter beginChildOn()
Definition: LeafNodeMask.h:681
void merge(const LeafNode &)
Definition: LeafNode.h:1632
ChildIter< MaskOnIter, const LeafNode > ChildOnCIter
Definition: LeafNodeMask.h:651
void addLeaf(LeafNode *)
Definition: LeafNodeMask.h:521
void reset()
Definition: Coord.h:327
bool hasOverlap(const CoordBBox &b) const
Return true if the given bounding box overlaps with this bounding box.
Definition: Coord.h:412
void writeBuffers(std::ostream &os, bool toHalf=false) const
Write buffers to a stream.
Definition: LeafNode.h:1414
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
bool isEmpty() const
Return true if this node has no active voxels.
Definition: LeafNodeMask.h:130
ValueOnCIter endValueOn() const
Definition: LeafNodeMask.h:668
const NodeT * probeConstNode(const Coord &) const
Definition: LeafNodeMask.h:529
typename std::remove_const< UnsetItemT >::type NonConstValueType
Definition: Iterator.h:184
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h.in:116
void resetBackground(bool, bool)
no-op since for this temaplte specialization voxel values and states are indistinguishable.
Definition: LeafNodeMask.h:438
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h.in:178
ValueAllCIter beginValueAll() const
Definition: LeafNodeMask.h:664
ChildOffCIter endChildOff() const
Definition: LeafNodeMask.h:693
ValueOnIter endValueOn()
Definition: LeafNodeMask.h:669
void setOn(Index32 n)
Set the nth bit on.
Definition: NodeMasks.h:452
ValueIter(const MaskIterT &iter, NodeT *parent)
Definition: LeafNodeMask.h:591
Index medianOn(ValueType &value, ValueType *tmp=nullptr) const
Computes the median value of all the active voxels in this node.
Definition: LeafNode.h:1531
Base class for sparse iterators over internal and leaf nodes.
Definition: Iterator.h:114
static Index log2dim()
Return log2 of the size of the buffer storage.
Definition: LeafNodeMask.h:100
typename NodeMaskType::OnIterator MaskOnIter
Definition: LeafNodeMask.h:578
void setValue(bool value) const
Definition: LeafNodeMask.h:599
const bool & getLastValue() const
Return a const reference to the last entry in the buffer.
Definition: LeafNodeMask.h:400
bool probeValue(const Coord &xyz, ValueType &val) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNode.h:1079
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
void unsetItem(Index pos, const ValueT &val) const
Definition: LeafNodeMask.h:640
ValueIter< MaskOffIter, const LeafNode, const bool > ValueOffCIter
Definition: LeafNodeMask.h:647
ChildOffIter beginChildOff()
Definition: LeafNodeMask.h:684
bool operator!=(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Inequality operator, does exact floating point comparisons.
Definition: Vec3.h:485
Int32 y() const
Definition: Coord.h:132
ValueOffCIter endValueOff() const
Definition: LeafNodeMask.h:671
static Index getValueLevelAndCache(const Coord &, AccessorT &)
Return the LEVEL (=0) at which leaf node values reside.
Definition: LeafNodeMask.h:391
void modifyValueAndActiveState(const Coord &xyz, const ModifyOp &op)
Apply a functor to the voxel at the given coordinates.
Definition: LeafNode.h:450
bool isZero(const Type &x)
Return true if x is exactly equal to zero.
Definition: Math.h:338
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:1681
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:1179
ValueType * mData
Definition: LeafBuffer.h:125
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:1121
DenseIter< const LeafNode, const ValueType, ChildAll > ChildAllCIter
Definition: LeafNode.h:289
int32_t Int32
Definition: openvdb/Types.h:52
static Index32 nonLeafCount()
Return the non-leaf count for this node, which is zero.
Definition: LeafNodeMask.h:118
ChildOffCIter cendChildOff() const
Definition: LeafNodeMask.h:692
Coord offsetToGlobalCoord(Index n) const
Return the global coordinates for a linear table offset.
Definition: LeafNode.h:1052
void modifyItem(Index n, const ModifyOp &op) const
Definition: LeafNodeMask.h:603
void setValueMask(Index n, bool on)
Definition: LeafNodeMask.h:714
Buffer & buffer()
Definition: LeafNodeMask.h:190
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
ValueOnIter beginValueOn()
Definition: LeafNodeMask.h:659
ValueIter< MaskOnIter, LeafNode, const bool > ValueOnIter
Definition: LeafNodeMask.h:644
bool isValueMaskOff(Index n) const
Definition: LeafNodeMask.h:704
void setItem(Index pos, bool value) const
Definition: LeafNodeMask.h:597
void stealNodes(ArrayT &, const ValueType &, bool)
Definition: LeafNodeMask.h:531
bool isConstant(ValueType &firstValue, bool &state, const ValueType &tolerance=zeroVal< ValueType >()) const
Definition: LeafNode.h:1477
const bool & getValueAndCache(const Coord &xyz, AccessorT &) const
Return the value of the voxel at the given coordinates.
Definition: LeafNodeMask.h:327
ValueIter< MaskDenseIter, const LeafNode, const bool > ValueAllCIter
Definition: LeafNodeMask.h:649
static const Index DIM
Definition: LeafNode.h:50
const bool & getFirstValue() const
Return a const reference to the first entry in the buffer.
Definition: LeafNodeMask.h:396
ValueIter< MaskOnIter, const LeafNode, const bool > ValueOnCIter
Definition: LeafNodeMask.h:645
static Index32 leafCount()
Return the leaf count for this node, which is one.
Definition: LeafNodeMask.h:114
Index64 onLeafVoxelCount() const
Definition: LeafNodeMask.h:124
Bit mask for the internal and leaf nodes of VDB. This is a 64-bit implementation.
Definition: NodeMasks.h:307
Base class for iterators over internal and leaf nodes.
Definition: Iterator.h:29
static const Index LOG2DIM
Definition: LeafNode.h:48
Definition: NodeMasks.h:239
bool isChildMaskOn(Index) const
Definition: LeafNodeMask.h:710
bool isValueMaskOn() const
Definition: LeafNodeMask.h:703
void combine(const LeafNode &other, CombineOp &op)
Definition: LeafNode.h:1722
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
ChildOffIter endChildOff()
Definition: LeafNodeMask.h:694
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:1469
Base class for dense iterators over internal and leaf nodes.
Definition: Iterator.h:178
static bool hasActiveTiles()
Return false since leaf nodes never contain tiles.
Definition: LeafNodeMask.h:278
void setValuesOff()
Mark all voxels as inactive but don't change their values.
Definition: LeafNodeMask.h:270
static Index dim()
Return the number of voxels in each dimension.
Definition: LeafNodeMask.h:102
Coord & setX(Int32 x)
Definition: Coord.h:80
DenseIter< LeafNode, bool > ChildAllIter
Definition: LeafNodeMask.h:654
ChildAllIter endChildAll()
Definition: LeafNodeMask.h:697
const ValueType & getValue(const Coord &xyz) const
Return the value of the voxel at the given coordinates.
Definition: LeafNode.h:1063
DenseIter(const MaskDenseIter &iter, NodeT *parent)
Definition: LeafNodeMask.h:627
CombineArgs & setARef(const AValueType &a)
Redirect the A value to a new external source.
Definition: openvdb/Types.h:499
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 operator==(const LeafNode &other) const
Check for buffer, state and origin equivalence.
Definition: LeafNode.h:1431
void visit2(IterT &otherIter, VisitorOp &, bool otherIsLHS=false)
Definition: LeafNode.h:1918
void combine2(const LeafNode &other, const OtherType &, bool valueIsActive, CombineOp &)
Definition: LeafNode.h:1762
Coord & setY(Int32 y)
Definition: Coord.h:81
ValueOffIter beginValueOff()
Definition: LeafNodeMask.h:662
Definition: openvdb/Types.h:107
friend class LeafNode
Definition: LeafNode.h:846
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
static Coord offsetToLocalCoord(Index n)
Return the local coordinates for a linear table offset, where offset 0 has coordinates (0,...
Definition: LeafNode.h:1038
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
ChildOffCIter cbeginChildOff() const
Definition: LeafNodeMask.h:682
Tag dispatch class that distinguishes constructors during file input.
Definition: openvdb/Types.h:566
void addLeafAndCache(LeafNode *, AccessorT &)
Definition: LeafNodeMask.h:523
ChildIter(const MaskIterT &iter, NodeT *parent)
Definition: LeafNodeMask.h:615
Index32 Index
Definition: openvdb/Types.h:50
const Coord & max() const
Definition: Coord.h:322
NodeMaskType & getValueMask()
Definition: LeafNodeMask.h:708
static void doVisit(NodeT &, VisitorOp &)
Definition: LeafNode.h:1856
const Coord & origin() const
Return the grid index coordinates of this node's local origin.
Definition: LeafNode.h:172
const NodeMaskType & getValueMask() const
Definition: LeafNode.h:867
ValueOnCIter cbeginValueOn() const
Definition: LeafNode.h:291
ChildIter< MaskOnIter, LeafNode > ChildOnIter
Definition: LeafNodeMask.h:650
General-purpose arithmetic and comparison routines, most of which accept arbitrary value types (or at...
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
ValueType combine(const ValueType &v0, const ValueType &v1, const ValueType &v2, const openvdb::Vec3d &w)
Combine different value types.
Definition: AttributeTransferUtil.h:140
void modifyValueAndActiveStateAndCache(const Coord &xyz, const ModifyOp &op, AccessorT &)
Definition: LeafNodeMask.h:365
void writeTopology(std::ostream &os, bool toHalf=false) const
Write out just the topology.
Definition: LeafNode.h:1294
void setValueMask(const NodeMaskType &mask)
Definition: LeafNodeMask.h:709
void evalActiveBoundingBox(CoordBBox &bbox, bool visitVoxels=true) const
Definition: LeafNode.h:1451
bool isValueOn(const Coord &xyz) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNodeMask.h:273
void setValuesOn()
Mark all voxels as active but don't change their values.
Definition: LeafNodeMask.h:268
Index64 onVoxelCount() const
Return the number of active voxels.
Definition: LeafNodeMask.h:121
NodeT * probeNodeAndCache(const Coord &, AccessorT &)
Definition: LeafNodeMask.h:548
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
typename BaseT::NonConstValueType NonConstValueT
Definition: LeafNodeMask.h:624
void visit(VisitorOp &)
Definition: LeafNode.h:1838
ChildIter< MaskOffIter, LeafNode > ChildOffIter
Definition: LeafNodeMask.h:652
void expand(ValueType padding)
Pad this bounding box with the specified padding.
Definition: Coord.h:418
static CoordBBox createCube(const Coord &min, ValueType dim)
Definition: Coord.h:313
static Index coordToOffset(const Coord &xyz)
Return the linear table offset of the given global or local coordinates.
Definition: LeafNode.h:1028
NodeT * probeNode(const Coord &)
Definition: LeafNodeMask.h:527
static Index size()
Return the total number of voxels represented by this LeafNode.
Definition: LeafNodeMask.h:104
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
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 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
const NodeMaskType & valueMask() const
Definition: LeafNodeMask.h:707
OffIterator beginOff() const
Definition: NodeMasks.h:354
Definition: NodeMasks.h:208
void setValueMaskOn(Index n)
Definition: LeafNodeMask.h:715
static Index64 offTileCount()
Definition: LeafNodeMask.h:127
static Index getValueLevel(const Coord &)
Return the level (0) at which leaf node values reside.
Definition: LeafNodeMask.h:220
CombineArgs & setBRef(const BValueType &b)
Redirect the B value to a new external source.
Definition: openvdb/Types.h:501
std::shared_ptr< T > SharedPtr
Definition: openvdb/Types.h:110
void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition: LeafNode.h:411
ChildOnCIter endChildOn() const
Definition: LeafNodeMask.h:690
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
static Index64 onTileCount()
Definition: LeafNodeMask.h:126
ChildAllCIter cendChildAll() const
Definition: LeafNodeMask.h:695
ValueOnCIter cbeginValueOn() const
Definition: LeafNodeMask.h:657
LeafNode * probeLeaf(const Coord &)
Definition: LeafNodeMask.h:544
void setValueOff(Index offset)
Mark the voxel at the given offset as inactive but don't change its value.
Definition: LeafNodeMask.h:235
This struct collects both input and output arguments to "grid combiner" functors used with the tree::...
Definition: openvdb/Types.h:446
bool isInactive() const
Return true if all of this node's values are inactive.
Definition: LeafNodeMask.h:434
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:25
ChildAllIter beginChildAll()
Definition: LeafNodeMask.h:687
void nodeCount(std::vector< Index32 > &) const
no-op
Definition: LeafNodeMask.h:116
void setValueMaskOff(Index n)
Definition: LeafNodeMask.h:716
ValueAllIter beginValueAll()
Definition: LeafNodeMask.h:665
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
bool isValueOn(Index offset) const
Return true if the voxel at the given offset is active.
Definition: LeafNodeMask.h:275
const Coord & min() const
Definition: Coord.h:321
void fill(const ValueType &)
Populate this buffer with a constant value.
Definition: LeafBuffer.h:225
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
const bool & getValue() const
Definition: LeafNodeMask.h:594
const LeafNode * probeConstLeafAndCache(const Coord &, AccessorT &) const
Definition: LeafNodeMask.h:563
std::string str() const
Return a string representation of this node.
Definition: LeafNode.h:1015
ValueAllCIter cbeginValueAll() const
Definition: LeafNodeMask.h:663
void readBuffers(std::istream &is, bool fromHalf=false)
Read buffers from a stream.
Definition: LeafNode.h:1322
static void evalNodeOrigin(Coord &xyz)
Compute the origin of the leaf node that contains the voxel with the given coordinates.
Definition: LeafNodeMask.h:719
const NodeMaskType & valueMask() const
Definition: LeafNode.h:869
static const Index SIZE
Definition: LeafNode.h:53
uint64_t Index64
Definition: openvdb/Types.h:49
bool isInside(const Coord &xyz) const
Return true if point (x, y, z) is inside this bounding box.
Definition: Coord.h:400
ValueType medianAll(ValueType *tmp=nullptr) const
Computes the median value of all the active AND inactive voxels in this node.
Definition: LeafNode.h:1513
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:1689
const LeafNode * probeLeafAndCache(const Coord &, AccessorT &) const
Definition: LeafNodeMask.h:560
void getNodes(ArrayT &) const
Definition: LeafNodeMask.h:530
void modifyValue(const ModifyOp &op) const
Definition: LeafNodeMask.h:606
static const Index LEVEL
Definition: LeafNode.h:54
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
ChildIter()
Definition: LeafNodeMask.h:614
ChildAllCIter beginChildAll() const
Definition: LeafNode.h:320
ValueIter()
Definition: LeafNodeMask.h:590
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
Tag dispatch class that distinguishes topology copy constructors from deep copy constructors.
Definition: openvdb/Types.h:560
DenseIter< const LeafNode, const bool > ChildAllCIter
Definition: LeafNodeMask.h:655
bool isAllocated() const
Return true if memory for this node's buffer has been allocated.
Definition: LeafNodeMask.h:136
void addTileAndCache(Index, const Coord &, const ValueType &, bool, AccessorT &)
Definition: LeafNode.h:1599
ChildOnIter endChildOn()
Definition: LeafNodeMask.h:691
@ MERGE_NODES
Definition: openvdb/Types.h:386
ValueAllCIter cendValueAll() const
Definition: LeafNodeMask.h:673
bool isChildMaskOff(Index) const
Definition: LeafNodeMask.h:711
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:1698
Index64 memUsage() const
Return the memory in bytes occupied by this node.
Definition: LeafNode.h:1441
LeafNode specialization for values of type ValueMask that encodes both the active states and the bool...
Definition: LeafNodeMask.h:30
void getOrigin(Coord &origin) const
Definition: LeafNodeMask.h:159
DenseIter()
Definition: LeafNodeMask.h:626
ChildAllCIter cbeginChildAll() const
Definition: LeafNodeMask.h:685
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:1249
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
static void doVisit2(NodeT &self, OtherChildAllIterT &, VisitorOp &, bool otherIsLHS)
Definition: LeafNode.h:1942
ChildOffCIter beginChildOff() const
Definition: LeafNodeMask.h:683
bool isValueMaskOn(Index n) const
Definition: LeafNodeMask.h:702
bool getItem(Index pos, void *&child, NonConstValueT &value) const
Definition: LeafNodeMask.h:629
Int32 ValueType
Definition: Coord.h:33
Index medianOff(ValueType &value, ValueType *tmp=nullptr) const
Computes the median value of all the inactive voxels in this node.
Definition: LeafNode.h:1555
uint32_t Index32
Definition: openvdb/Types.h:48
Buffer mBuffer
Bitmask representing the values AND state of voxels.
Definition: LeafNodeMask.h:733
ValueOffCIter cendValueOff() const
Definition: LeafNodeMask.h:670
bool allocate()
Allocate memory for this node's buffer if it has not already been allocated.
Definition: LeafNodeMask.h:140
ValueOffCIter beginValueOff() const
Definition: LeafNodeMask.h:661
ChildIter< MaskOffIter, const LeafNode > ChildOffCIter
Definition: LeafNodeMask.h:653
void addTile(Index level, const Coord &, const ValueType &, bool)
Definition: LeafNode.h:1582
void clip(const CoordBBox &, const ValueType &background)
Set all voxels that lie outside the given axis-aligned box to the background.
Definition: LeafNode.h:1139
const bool & getItem(Index pos) const
Definition: LeafNodeMask.h:593
bool operator!=(const LeafNode &other) const
Definition: LeafNode.h:195
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:1113
Definition: PointDataGrid.h:170
void intersect(const CoordBBox &bbox)
Intersect this bounding box with the given bounding box.
Definition: Coord.h:444
void getOrigin(Int32 &x, Int32 &y, Int32 &z) const
Definition: LeafNodeMask.h:160
ChildAllCIter beginChildAll() const
Definition: LeafNodeMask.h:686
void readTopology(std::istream &is, bool fromHalf=false)
Read in just the topology.
Definition: LeafNode.h:1286
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition: LeafNode.h:401
ValueOnCIter beginValueOn() const
Definition: LeafNodeMask.h:658
DenseIter< LeafNode, ValueType, ChildAll > ChildAllIter
Definition: LeafNode.h:288
ValueAllCIter endValueAll() const
Definition: LeafNodeMask.h:674
Coord & setZ(Int32 z)
Definition: Coord.h:82
const NodeMaskType & getValueMask() const
Definition: LeafNodeMask.h:706
Index64 offVoxelCount() const
Return the number of inactive voxels.
Definition: LeafNodeMask.h:123
bool ValueType
Definition: LeafNodeMask.h:35
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition: LeafNodeMask.h:233
Definition: openvdb/Exceptions.h:13
Templated block class to hold specific data types and a fixed number of values determined by Log2Dim....
Definition: LeafNode.h:37
void voxelizeActiveTiles(bool=true)
No-op.
Definition: LeafNodeMask.h:449
ChildOnCIter cbeginChildOn() const
Definition: LeafNodeMask.h:679
static void doVisit2Node(NodeT &self, OtherNodeT &other, VisitorOp &)
Definition: LeafNode.h:1895
Axis-aligned bounding box of signed integer coordinates.
Definition: Coord.h:248
void negate()
Invert the bits of the voxels, i.e. states and values.
Definition: LeafNodeMask.h:441
ValueOffIter endValueOff()
Definition: LeafNodeMask.h:672
ValueOnCIter cendValueOn() const
Definition: LeafNodeMask.h:667
SharedPtr< LeafNodeType > Ptr
Definition: LeafNodeMask.h:38
bool isValueMaskOff() const
Definition: LeafNodeMask.h:705
void visitActiveBBox(BBoxOp &) const
Calls the templated functor BBoxOp with bounding box information. An additional level argument is pro...
Definition: LeafNode.h:1823
Int32 z() const
Definition: Coord.h:133
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:429
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
static Index getLevel()
Return the level of this node, which by definition is zero for LeafNodes.
Definition: LeafNodeMask.h:108
Definition: NodeMasks.h:270
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
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
const Buffer & buffer() const
Definition: LeafNodeMask.h:189
~LeafNode()
Destructor.
Definition: LeafNode.h:1008
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
void translate(const Coord &t)
Translate this bounding box by (tx, ty, tz).
Definition: Coord.h:458
ValueIter< MaskOffIter, LeafNode, const bool > ValueOffIter
Definition: LeafNodeMask.h:646
const LeafNode * probeConstLeaf(const Coord &) const
Definition: LeafNodeMask.h:561
Int32 x() const
Definition: Coord.h:131
ChildOnCIter cendChildOn() const
Definition: LeafNodeMask.h:689
LeafNode * probeLeafAndCache(const Coord &, AccessorT &)
Definition: LeafNodeMask.h:546