31 #ifndef OPENVDB_TREE_LEAFNODEBOOL_HAS_BEEN_INCLUDED
32 #define OPENVDB_TREE_LEAFNODEBOOL_HAS_BEEN_INCLUDED
35 #include <boost/shared_ptr.hpp>
36 #include <boost/shared_array.hpp>
37 #include <boost/static_assert.hpp>
38 #include <openvdb/Types.h>
39 #include <openvdb/io/Compression.h>
40 #include <openvdb/util/NodeMasks.h>
53 template<Index Log2Dim>
58 typedef boost::shared_ptr<LeafNodeType>
Ptr;
63 static const Index LOG2DIM = Log2Dim;
64 static const Index TOTAL = Log2Dim;
65 static const Index DIM = 1 << TOTAL;
66 static const Index NUM_VALUES = 1 << 3 * Log2Dim;
67 static const Index NUM_VOXELS = NUM_VALUES;
68 static const Index SIZE = NUM_VALUES;
73 template<
typename ValueType>
78 template<
typename OtherNodeType>
79 struct SameConfiguration {
90 Buffer(
const Buffer& other): mData(other.mData) {}
92 void fill(
bool val) { mData.set(val); }
93 Buffer&
operator=(
const Buffer& b) {
if (&b !=
this) { mData = b.mData; }
return *
this; }
98 return mData.isOn(i) ? LeafNode::sOn : LeafNode::sOff;
102 bool operator==(
const Buffer& other)
const {
return mData == other.mData; }
103 bool operator!=(
const Buffer& other)
const {
return mData != other.mData; }
107 void swap(Buffer& other) {
if (&other !=
this) std::swap(mData, other.mData); }
113 friend class ::TestLeaf;
128 explicit LeafNode(
const Coord& xyz,
bool value =
false,
bool active =
false);
134 template<
typename OtherValueType>
138 template<
typename ValueType>
142 template<
typename ValueType>
146 template<
typename ValueType>
179 bool isEmpty()
const {
return mValueMask.isOff(); }
181 bool isDense()
const {
return mValueMask.isOn(); }
189 void evalActiveBoundingBox(CoordBBox& bbox,
bool visitVoxels =
true)
const;
196 void setOrigin(
const Coord& origin) { mOrigin = origin; }
198 const Coord& origin()
const {
return mOrigin; }
200 void getOrigin(Coord& origin)
const { origin = mOrigin; }
205 static Index coordToOffset(
const Coord& xyz);
208 static Coord offsetToLocalCoord(
Index n);
210 Coord offsetToGlobalCoord(
Index n)
const;
213 std::string str()
const;
217 template<
typename OtherType, Index OtherLog2Dim>
229 void swap(Buffer& other) { mBuffer.swap(other); }
230 const Buffer&
buffer()
const {
return mBuffer; }
237 void readTopology(std::istream&,
bool fromHalf =
false);
239 void writeTopology(std::ostream&,
bool toHalf =
false)
const;
242 void readBuffers(std::istream&,
bool fromHalf =
false);
244 void writeBuffers(std::ostream&,
bool toHalf =
false)
const;
250 const bool& getValue(
const Coord& xyz)
const;
252 const bool& getValue(
Index offset)
const;
257 bool probeValue(
const Coord& xyz,
bool& val)
const;
263 void setActiveState(
const Coord& xyz,
bool on);
268 void setValueOnly(
const Coord& xyz,
bool val);
270 void setValueOnly(
Index offset,
bool val) { assert(offset<SIZE); mBuffer.setValue(offset,val); }
273 void setValueOff(
const Coord& xyz) { mValueMask.setOff(this->coordToOffset(xyz)); }
278 void setValueOff(
const Coord& xyz,
bool val);
280 void setValueOff(
Index offset,
bool val);
283 void setValueOn(
const Coord& xyz) { mValueMask.setOn(this->coordToOffset(xyz)); }
288 void setValueOn(
const Coord& xyz,
bool val);
290 void setValue(
const Coord& xyz,
bool val) { this->setValueOn(xyz, val); };
292 void setValueOn(
Index offset,
bool val);
296 template<
typename ModifyOp>
297 void modifyValue(
Index offset,
const ModifyOp& op);
300 template<
typename ModifyOp>
301 void modifyValue(
const Coord& xyz,
const ModifyOp& op);
304 template<
typename ModifyOp>
305 void modifyValueAndActiveState(
const Coord& xyz,
const ModifyOp& op);
313 bool isValueOn(
const Coord& xyz)
const {
return mValueMask.isOn(this->coordToOffset(xyz)); }
315 bool isValueOn(
Index offset)
const { assert(offset < SIZE);
return mValueMask.isOn(offset); }
321 void fill(
const CoordBBox& bbox,
bool value,
bool active =
true);
324 void fill(
const bool& value);
326 void fill(
const bool& value,
bool active);
339 template<
typename DenseT>
340 void copyToDense(
const CoordBBox& bbox, DenseT& dense)
const;
358 template<
typename DenseT>
359 void copyFromDense(
const CoordBBox& bbox,
const DenseT& dense,
bool background,
bool tolerance);
363 template<
typename AccessorT>
364 const bool&
getValueAndCache(
const Coord& xyz, AccessorT&)
const {
return this->getValue(xyz);}
368 template<
typename AccessorT>
373 template<
typename AccessorT>
374 void setValueAndCache(
const Coord& xyz,
bool val, AccessorT&) { this->setValueOn(xyz, val); }
379 template<
typename AccessorT>
384 template<
typename AccessorT>
387 this->setValueOff(xyz, value);
393 template<
typename ModifyOp,
typename AccessorT>
396 this->modifyValue(xyz, op);
401 template<
typename ModifyOp,
typename AccessorT>
404 this->modifyValueAndActiveState(xyz, op);
410 template<
typename AccessorT>
413 this->setActiveState(xyz, on);
419 template<
typename AccessorT>
422 return this->probeValue(xyz, val);
427 template<
typename AccessorT>
433 const bool&
getFirstValue()
const {
if (mValueMask.isOn(0))
return sOn;
else return sOff; }
437 const bool&
getLastValue()
const {
if (mValueMask.isOn(SIZE-1))
return sOn;
else return sOff; }
442 bool isConstant(
bool& constValue,
bool& state,
bool tolerance = 0)
const;
446 void resetBackground(
bool oldBackground,
bool newBackground);
448 void negate() { mBuffer.mData.toggle(); }
450 template<MergePolicy Policy>
451 void merge(
const LeafNode& other,
bool bg =
false,
bool otherBG =
false);
452 template<MergePolicy Policy>
void merge(
bool tileValue,
bool tileActive);
462 template<
typename OtherType>
476 template<
typename OtherType>
490 template<
typename OtherType>
493 template<
typename CombineOp>
495 template<
typename CombineOp>
496 void combine(
bool,
bool valueIsActive, CombineOp& op);
498 template<
typename CombineOp,
typename OtherType >
499 void combine2(
const LeafNode& other,
const OtherType&,
bool valueIsActive, CombineOp&);
500 template<
typename CombineOp,
typename OtherNodeT >
501 void combine2(
bool,
const OtherNodeT& other,
bool valueIsActive, CombineOp&);
502 template<
typename CombineOp,
typename OtherNodeT >
503 void combine2(
const LeafNode& b0,
const OtherNodeT& b1, CombineOp&);
509 template<
typename BBoxOp>
void visitActiveBBox(BBoxOp&)
const;
511 template<
typename VisitorOp>
void visit(VisitorOp&);
512 template<
typename VisitorOp>
void visit(VisitorOp&)
const;
514 template<
typename OtherLeafNodeType,
typename VisitorOp>
515 void visit2Node(OtherLeafNodeType& other, VisitorOp&);
516 template<
typename OtherLeafNodeType,
typename VisitorOp>
517 void visit2Node(OtherLeafNodeType& other, VisitorOp&)
const;
518 template<
typename IterT,
typename VisitorOp>
519 void visit2(IterT& otherIter, VisitorOp&,
bool otherIsLHS =
false);
520 template<
typename IterT,
typename VisitorOp>
521 void visit2(IterT& otherIter, VisitorOp&,
bool otherIsLHS =
false)
const;
524 void signedFloodFill(
bool) {}
528 template<
typename PruneOp>
void pruneOp(PruneOp&) {}
532 template<
typename AccessorT>
534 template<
typename NodeT>
536 template<
typename NodeT>
538 template<
typename NodeT>
542 void addTile(
Index level,
const Coord&,
bool val,
bool active);
543 void addTile(
Index offset,
bool val,
bool active);
544 template<
typename AccessorT>
545 void addTileAndCache(
Index level,
const Coord&,
bool val,
bool active, AccessorT&);
548 LeafNode* touchLeaf(
const Coord&) {
return this; }
550 template<
typename AccessorT>
553 template<
typename AccessorT>
555 template<
typename NodeT,
typename AccessorT>
559 if (!(boost::is_same<NodeT,LeafNode>::value))
return NULL;
560 return reinterpret_cast<NodeT*
>(
this);
565 const LeafNode* probeLeaf(
const Coord&)
const {
return this; }
567 template<
typename AccessorT>
570 template<
typename AccessorT>
572 template<
typename NodeT,
typename AccessorT>
576 if (!(boost::is_same<NodeT,LeafNode>::value))
return NULL;
577 return reinterpret_cast<const NodeT*
>(
this);
590 template<
typename MaskIterT,
typename NodeT,
typename ValueT>
594 public SparseIteratorBase<MaskIterT, ValueIter<MaskIterT, NodeT, ValueT>, NodeT, ValueT>
601 const bool&
getItem(
Index pos)
const {
return this->parent().getValue(pos); }
602 const bool&
getValue()
const {
return this->getItem(this->pos()); }
605 void setItem(
Index pos,
bool value)
const { this->parent().setValueOnly(pos, value); }
607 void setValue(
bool value)
const { this->setItem(this->pos(), value); }
610 template<
typename ModifyOp>
611 void modifyItem(
Index n,
const ModifyOp& op)
const { this->parent().modifyValue(n, op); }
613 template<
typename ModifyOp>
614 void modifyValue(
const ModifyOp& op)
const { this->modifyItem(this->pos(), op); }
618 template<
typename MaskIterT,
typename NodeT>
624 MaskIterT, ChildIter<MaskIterT, NodeT>, NodeT, bool>(iter, parent) {}
627 template<
typename NodeT,
typename ValueT>
629 MaskDenseIter, DenseIter<NodeT, ValueT>, NodeT, void, ValueT>
639 value = this->parent().getValue(pos);
648 void unsetItem(
Index pos,
const ValueT& val)
const {this->parent().setValueOnly(pos, val);}
653 typedef ValueIter<MaskOnIter, const LeafNode, const bool>
ValueOnCIter;
728 template<
typename NodeT,
typename VisitorOp,
typename ChildAllIterT>
729 static inline void doVisit(NodeT&, VisitorOp&);
731 template<
typename NodeT,
typename OtherNodeT,
typename VisitorOp,
732 typename ChildAllIterT,
typename OtherChildAllIterT>
733 static inline void doVisit2Node(NodeT&
self, OtherNodeT& other, VisitorOp&);
735 template<
typename NodeT,
typename VisitorOp,
736 typename ChildAllIterT,
typename OtherChildAllIterT>
737 static inline void doVisit2(NodeT&
self, OtherChildAllIterT&, VisitorOp&,
bool otherIsLHS);
785 template<Index Log2Dim>
792 template<Index Log2Dim>
797 mOrigin(xyz & (~(DIM - 1)))
802 template<Index Log2Dim>
805 mValueMask(other.mValueMask),
806 mBuffer(other.mBuffer),
807 mOrigin(other.mOrigin)
813 template<Index Log2Dim>
814 template<
typename ValueT>
817 mValueMask(other.getValueMask()),
818 mOrigin(other.origin())
822 static inline bool convertValue(
const ValueT& val) {
return bool(val); }
831 template<Index Log2Dim>
832 template<
typename ValueT>
836 mValueMask(other.getValueMask()),
838 mOrigin(other.origin())
843 template<Index Log2Dim>
844 template<
typename ValueT>
847 mValueMask(other.getValueMask()),
848 mBuffer(other.getValueMask()),
849 mOrigin(other.origin())
854 template<Index Log2Dim>
855 template<
typename ValueT>
859 mValueMask(other.getValueMask()),
860 mBuffer(other.getValueMask()),
861 mOrigin(other.origin())
863 if (offValue) {
if (!onValue)
mBuffer.mData.toggle();
else mBuffer.mData.setOn(); }
867 template<Index Log2Dim>
877 template<Index Log2Dim>
885 template<Index Log2Dim>
890 if (bbox.isInside(this_bbox))
return;
894 for(; iter; ++iter) this_bbox.expand(this->offsetToLocalCoord(iter.pos()));
895 this_bbox.translate(this->
origin());
897 bbox.expand(this_bbox);
902 template<Index Log2Dim>
903 template<
typename OtherType, Index OtherLog2Dim>
912 template<Index Log2Dim>
916 std::ostringstream ostr;
917 ostr <<
"LeafNode @" <<
mOrigin <<
": ";
926 template<Index Log2Dim>
930 assert ((xyz[0] & (
DIM-1u)) <
DIM && (xyz[1] & (
DIM-1u)) <
DIM && (xyz[2] & (
DIM-1u)) <
DIM);
931 return ((xyz[0] & (
DIM-1u)) << 2*Log2Dim)
932 + ((xyz[1] & (
DIM-1u)) << Log2Dim)
933 + (xyz[2] & (
DIM-1u));
937 template<Index Log2Dim>
941 assert(n < (1 << 3*Log2Dim));
943 xyz.setX(n >> 2*Log2Dim);
944 n &= ((1 << 2*Log2Dim) - 1);
945 xyz.setY(n >> Log2Dim);
946 xyz.setZ(n & ((1 << Log2Dim) - 1));
951 template<Index Log2Dim>
962 template<Index Log2Dim>
970 template<Index Log2Dim>
978 template<Index Log2Dim>
985 is.read(reinterpret_cast<char*>(&
mOrigin),
sizeof(Coord::ValueType) * 3);
994 int8_t numBuffers = 0;
995 is.read(reinterpret_cast<char*>(&numBuffers),
sizeof(int8_t));
999 boost::shared_array<bool> buf(
new bool[
SIZE]);
1000 io::readData<bool>(is, buf.get(),
SIZE,
true);
1005 if (buf[i])
mBuffer.mData.setOn(i);
1008 if (numBuffers > 1) {
1011 for (
int i = 1; i < numBuffers; ++i) {
1012 io::readData<bool>(is, buf.get(),
SIZE,
true);
1019 template<Index Log2Dim>
1026 os.write(reinterpret_cast<const char*>(&
mOrigin),
sizeof(Coord::ValueType) * 3);
1035 template<Index Log2Dim>
1043 template<Index Log2Dim>
1054 template<Index Log2Dim>
1063 if (!tolerance && !(
mBuffer.mData.isOn() ||
mBuffer.mData.isOff()))
return false;
1066 constValue =
mBuffer.mData.isOn();
1074 template<Index Log2Dim>
1082 template<Index Log2Dim>
1086 assert(offset <
SIZE);
1091 template<Index Log2Dim>
1092 template<
typename AccessorT>
1095 bool val,
bool active, AccessorT&)
1097 this->
addTile(level, xyz, val, active);
1104 template<Index Log2Dim>
1109 if (
mBuffer.mData.isOn(this->coordToOffset(xyz)))
return sOn;
else return sOff;
1113 template<Index Log2Dim>
1117 assert(offset <
SIZE);
1119 if (
mBuffer.mData.isOn(offset))
return sOn;
else return sOff;
1123 template<Index Log2Dim>
1128 val =
mBuffer.mData.isOn(offset);
1133 template<Index Log2Dim>
1141 template<Index Log2Dim>
1145 assert(offset <
SIZE);
1147 mBuffer.mData.set(offset, val);
1151 template<Index Log2Dim>
1159 template<Index Log2Dim>
1167 template<Index Log2Dim>
1175 template<Index Log2Dim>
1179 assert(offset <
SIZE);
1181 mBuffer.mData.set(offset, val);
1185 template<Index Log2Dim>
1186 template<
typename ModifyOp>
1190 bool val =
mBuffer.mData.isOn(offset);
1192 mBuffer.mData.set(offset, val);
1197 template<Index Log2Dim>
1198 template<
typename ModifyOp>
1206 template<Index Log2Dim>
1207 template<
typename ModifyOp>
1214 mBuffer.mData.set(offset, val);
1222 template<Index Log2Dim>
1226 if (newBackground != oldBackground) {
1238 template<Index Log2Dim>
1239 template<MergePolicy Policy>
1246 const Index n = iter.pos();
1255 template<Index Log2Dim>
1256 template<MergePolicy Policy>
1262 if (!tileActive)
return;
1274 template<Index Log2Dim>
1275 template<
typename OtherType>
1283 template<Index Log2Dim>
1284 template<
typename OtherType>
1293 template<Index Log2Dim>
1294 template<
typename OtherType>
1306 template<Index Log2Dim>
1310 for (
Int32 x = bbox.min().x(); x <= bbox.max().x(); ++x) {
1311 const Index offsetX = (x & (
DIM-1u))<<2*Log2Dim;
1312 for (
Int32 y = bbox.min().y(); y <= bbox.max().y(); ++y) {
1313 const Index offsetXY = offsetX + ((y & (
DIM-1u))<< Log2Dim);
1314 for (
Int32 z = bbox.min().z(); z <= bbox.max().z(); ++z) {
1315 const Index offset = offsetXY + (z & (
DIM-1u));
1317 mBuffer.mData.set(offset, value);
1323 template<Index Log2Dim>
1330 template<Index Log2Dim>
1342 template<Index Log2Dim>
1343 template<
typename DenseT>
1347 typedef typename DenseT::ValueType DenseValueType;
1349 const size_t xStride = dense.xStride(), yStride = dense.yStride(), zStride = dense.zStride();
1350 const Coord&
min = dense.bbox().min();
1351 DenseValueType* t0 = dense.data() + zStride * (bbox.min()[2] - min[2]);
1352 const Int32 n0 = bbox.min()[2] & (
DIM-1u);
1353 for (
Int32 x = bbox.min()[0], ex = bbox.max()[0] + 1; x < ex; ++x) {
1354 DenseValueType* t1 = t0 + xStride * (x - min[0]);
1356 for (
Int32 y = bbox.min()[1], ey = bbox.max()[1] + 1; y < ey; ++y) {
1357 DenseValueType* t2 = t1 + yStride * (y - min[1]);
1359 for (
Int32 z = bbox.min()[2], ez = bbox.max()[2] + 1; z < ez; ++z, t2 += zStride) {
1360 *t2 = DenseValueType(
mBuffer.mData.isOn(n2++));
1367 template<Index Log2Dim>
1368 template<
typename DenseT>
1371 bool background,
bool tolerance)
1373 typedef typename DenseT::ValueType DenseValueType;
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]);
1378 const Int32 n0 = bbox.min()[2] & (
DIM-1u);
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 ==
bool(*s2)) {
1389 mBuffer.mData.set(n2, background);
1392 mBuffer.mData.set(n2,
bool(*s2));
1403 template<Index Log2Dim>
1404 template<
typename CombineOp>
1410 bool result =
false, aVal =
mBuffer.mData.isOn(i), bVal = other.
mBuffer.mData.isOn(i);
1415 .setResultRef(result));
1422 template<Index Log2Dim>
1423 template<
typename CombineOp>
1428 args.
setBRef(value).setBIsActive(valueIsActive);
1430 bool result =
false, aVal =
mBuffer.mData.isOn(i);
1433 .setResultRef(result));
1443 template<Index Log2Dim>
1444 template<
typename CombineOp,
typename OtherType>
1447 bool valueIsActive, CombineOp& op)
1450 args.
setBRef(value).setBIsActive(valueIsActive);
1452 bool result =
false, aVal = other.
mBuffer.mData.isOn(i);
1455 .setResultRef(result));
1462 template<Index Log2Dim>
1463 template<
typename CombineOp,
typename OtherNodeT>
1466 bool valueIsActive, CombineOp& op)
1469 args.
setARef(value).setAIsActive(valueIsActive);
1471 bool result =
false, bVal = other.mBuffer.mData.isOn(i);
1473 .setBIsActive(other.mValueMask.isOn(i))
1474 .setResultRef(result));
1481 template<Index Log2Dim>
1482 template<
typename CombineOp,
typename OtherNodeT>
1491 bool result =
false, b0Val = b0.
mBuffer.mData.isOn(i), b1Val = b1.mBuffer.mData.isOn(i);
1495 .setBIsActive(b1.mValueMask.isOn(i))
1496 .setResultRef(result));
1505 template<Index Log2Dim>
1506 template<
typename BBoxOp>
1510 if (op.template descent<LEVEL>()) {
1513 op.operator()<
LEVEL>(CoordBBox::createCube(i.getCoord(), 1));
1515 op.template operator()<
LEVEL>(CoordBBox::createCube(i.getCoord(), 1));
1528 template<Index Log2Dim>
1529 template<
typename VisitorOp>
1533 doVisit<LeafNode, VisitorOp, ChildAllIter>(*
this, op);
1537 template<Index Log2Dim>
1538 template<
typename VisitorOp>
1542 doVisit<const LeafNode, VisitorOp, ChildAllCIter>(*
this, op);
1546 template<Index Log2Dim>
1547 template<
typename NodeT,
typename VisitorOp,
typename ChildAllIterT>
1551 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1560 template<Index Log2Dim>
1561 template<
typename OtherLeafNodeType,
typename VisitorOp>
1566 typename OtherLeafNodeType::ChildAllIter>(*
this, other, op);
1570 template<Index Log2Dim>
1571 template<
typename OtherLeafNodeType,
typename VisitorOp>
1576 typename OtherLeafNodeType::ChildAllCIter>(*
this, other, op);
1580 template<Index Log2Dim>
1583 typename OtherNodeT,
1585 typename ChildAllIterT,
1586 typename OtherChildAllIterT>
1591 BOOST_STATIC_ASSERT(OtherNodeT::SIZE == NodeT::SIZE);
1592 BOOST_STATIC_ASSERT(OtherNodeT::LEVEL == NodeT::LEVEL);
1594 ChildAllIterT iter =
self.beginChildAll();
1595 OtherChildAllIterT otherIter = other.beginChildAll();
1597 for ( ; iter && otherIter; ++iter, ++otherIter) {
1598 op(iter, otherIter);
1606 template<Index Log2Dim>
1607 template<
typename IterT,
typename VisitorOp>
1611 doVisit2<LeafNode, VisitorOp, ChildAllIter, IterT>(*
this, otherIter, op, otherIsLHS);
1615 template<Index Log2Dim>
1616 template<
typename IterT,
typename VisitorOp>
1620 doVisit2<const LeafNode, VisitorOp, ChildAllCIter, IterT>(*
this, otherIter, op, otherIsLHS);
1624 template<Index Log2Dim>
1628 typename ChildAllIterT,
1629 typename OtherChildAllIterT>
1632 VisitorOp& op,
bool otherIsLHS)
1634 if (!otherIter)
return;
1637 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1638 op(otherIter, iter);
1641 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1642 op(iter, otherIter);
1651 #endif // OPENVDB_TREE_LEAFNODEBOOL_HAS_BEEN_INCLUDED
bool resultIsActive() const
Definition: Types.h:314
OPENVDB_API Hermite min(const Hermite &, const Hermite &)
min and max operations done directly on the compressed data.
Coord mOrigin
Global grid index coordinates (x,y,z) of the local origin of this node.
Definition: LeafNodeBool.h:745
ChildOffCIter beginChildOff() const
Definition: LeafNodeBool.h:691
static const Index LOG2DIM
Definition: LeafNode.h:74
ValueIter< MaskOnIter, LeafNode, const bool > ValueOnIter
Definition: LeafNodeBool.h:652
ChildIter()
Definition: LeafNodeBool.h:622
void pruneOp(PruneOp &)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:528
LeafNode * probeLeafAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: LeafNodeBool.h:554
void addLeaf(LeafNode *)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:531
BaseT::NonConstValueType NonConstValueT
Definition: LeafNodeBool.h:632
ValueOffCIter cendValueOff() const
Definition: LeafNodeBool.h:678
static Index32 leafCount()
Definition: LeafNodeBool.h:166
void setValueOnlyAndCache(const Coord &xyz, bool val, AccessorT &)
Change the value of the voxel at the given coordinates but preserve its state.
Definition: LeafNodeBool.h:380
void combine(const LeafNode &other, CombineOp &op)
Definition: LeafNode.h:1533
ChildIter< MaskOnIter, LeafNode > ChildOnIter
Definition: LeafNodeBool.h:658
void combine2(const LeafNode &other, const OtherType &, bool valueIsActive, CombineOp &)
Definition: LeafNode.h:1569
CoordBBox getNodeBoundingBox() const
Return the bounding box of this node, i.e., the full index space spanned by this leaf node...
Definition: LeafNodeBool.h:193
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition: LeafNode.h:476
void swap(Buffer &other)
Definition: LeafNodeBool.h:107
DenseIter< LeafNode, bool > ChildAllIter
Definition: LeafNodeBool.h:662
Base class for sparse iterators over internal and leaf nodes.
Definition: Iterator.h:148
void setOff(Index32 n)
Set the nth bit off.
Definition: NodeMasks.h:393
static const bool sOn
Definition: LeafNodeBool.h:748
Index64 offVoxelCount() const
Return the number of inactive voxels.
Definition: LeafNodeBool.h:172
ChildAllCIter beginChildAll() const
Definition: LeafNodeBool.h:694
void setValueMask(Index n, bool on)
Definition: LeafNodeBool.h:721
const bool & getLastValue() const
Return a const reference to the last entry in the buffer.
Definition: LeafNodeBool.h:437
bool operator!=(const Buffer &other) const
Definition: LeafNodeBool.h:103
ValueIter< MaskOffIter, const LeafNode, const bool > ValueOffCIter
Definition: LeafNodeBool.h:655
ValueOnCIter cendValueOn() const
Definition: LeafNodeBool.h:675
void swap(Buffer &other)
Exchange this node's data buffer with the given data buffer without changing the active states of the...
Definition: LeafNodeBool.h:229
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: LeafNodeBool.h:420
const bool & getItem(Index pos) const
Definition: LeafNodeBool.h:601
static Index getLevel()
Definition: LeafNodeBool.h:162
Buffer(const Buffer &other)
Definition: LeafNodeBool.h:90
void pruneInactive(const ValueType &)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:530
bool isValueMaskOff(Index n) const
Definition: LeafNodeBool.h:712
Coord offsetToGlobalCoord(Index n) const
Return the global coordinates for a linear table offset.
Definition: LeafNode.h:1037
void getOrigin(Int32 &x, Int32 &y, Int32 &z) const
Return the grid index coordinates of this node's local origin.
Definition: LeafNodeBool.h:201
void topologyIntersection(const LeafNode< OtherType, Log2Dim > &other, const ValueType &)
Intersect this node's set of active values with the active values of the other node, whose ValueType may be different. So a resulting voxel will be active only if both of the original voxels were active.
Definition: LeafNode.h:1502
const bool & getValue() const
Definition: LeafNodeBool.h:602
void visit2Node(OtherLeafNodeType &other, VisitorOp &)
Definition: LeafNode.h:1679
OnIterator beginOn() const
Definition: NodeMasks.h:332
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:1494
const NodeMaskType & getValueMask() const
Definition: LeafNodeBool.h:714
static Index getChildDim()
Definition: LeafNodeBool.h:164
CombineArgs & setARef(const AValueType &a)
Redirect the A value to a new external source.
Definition: Types.h:303
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition: LeafNodeBool.h:273
void setActiveState(Index offset, bool on)
Set the active state of the voxel at the given offset but don't change its value. ...
Definition: LeafNodeBool.h:265
LeafNode specialization for values of type bool that stores both the active states and the values of ...
Definition: LeafNodeBool.h:54
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:1325
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:1161
static Index32 nonLeafCount()
Definition: LeafNodeBool.h:167
const LeafNode * probeLeafAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: LeafNodeBool.h:568
ValueAllIter endValueAll()
Definition: LeafNodeBool.h:683
Index32 Index
Definition: Types.h:57
ValueOffCIter endValueOff() const
Definition: LeafNodeBool.h:679
void fill(const ValueType &val)
Populates the buffer with a constant value.
Definition: LeafNode.h:111
ValueOnIter endValueOn()
Definition: LeafNodeBool.h:677
void negate()
Definition: LeafNodeBool.h:448
ChildAllCIter cbeginChildAll() const
Definition: LeafNodeBool.h:693
bool operator==(const LeafNode &other) const
Check for buffer, state and origin equivalence.
Definition: LeafNode.h:1289
ValueOnCIter cbeginValueOn() const
Definition: LeafNode.h:371
ChildOnCIter beginChildOn() const
Definition: LeafNodeBool.h:688
ChildOnIter beginChildOn()
Definition: LeafNodeBool.h:689
static Index dim()
Return the number of voxels in each dimension.
Definition: LeafNodeBool.h:159
static const Index SIZE
Definition: LeafNode.h:79
const Coord & origin() const
Return the grid index coordinates of this node's local origin.
Definition: LeafNode.h:252
static void doVisit2Node(NodeT &self, OtherNodeT &other, VisitorOp &)
Definition: LeafNode.h:1704
const bool & getFirstValue() const
Return a const reference to the first entry in the buffer.
Definition: LeafNodeBool.h:433
bool operator==(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Equality operator, does exact floating point comparisons.
Definition: Vec3.h:446
void setOrigin(const Coord &origin)
Set the grid index coordinates of this node's local origin.
Definition: LeafNodeBool.h:196
ValueIter< MaskOnIter, const LeafNode, const bool > ValueOnCIter
Definition: LeafNodeBool.h:653
void load(std::istream &is)
Definition: NodeMasks.h:494
static Coord offsetToLocalCoord(Index n)
Return the local coordinates for a linear table offset, where offset 0 has coordinates (0...
Definition: LeafNode.h:1023
const LeafNode * probeConstLeafAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: LeafNodeBool.h:571
ValueOffIter beginValueOff()
Definition: LeafNodeBool.h:670
ChildOffIter beginChildOff()
Definition: LeafNodeBool.h:692
static Index getValueLevelAndCache(const Coord &, AccessorT &)
Return the LEVEL (=0) at which leaf node values reside.
Definition: LeafNodeBool.h:428
Definition: NodeMasks.h:188
const ValueType & getValue(const Coord &xyz) const
Return the value of the voxel at the given coordinates.
Definition: LeafNode.h:1048
ValueIter< MaskOffIter, LeafNode, const bool > ValueOffIter
Definition: LeafNodeBool.h:654
~Buffer()
Definition: LeafNodeBool.h:91
NodeMaskType & getValueMask()
Definition: LeafNodeBool.h:715
bool isDense() const
Return true if this node only contains active voxels.
Definition: LeafNodeBool.h:181
static Index coordToOffset(const Coord &xyz)
Return the linear table offset of the given global or local coordinates.
Definition: LeafNode.h:1013
void setValueOn(Index offset)
Mark the voxel at the given offset as active but don't change its value.
Definition: LeafNodeBool.h:285
static Index size()
Definition: LeafNodeBool.h:160
ChildAllCIter cendChildAll() const
Definition: LeafNodeBool.h:703
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:504
void readBuffers(std::istream &is, bool fromHalf=false)
Read buffers from a stream.
Definition: LeafNode.h:1240
void setValue(Index i, const ValueType &val)
Set the i'th value of the Buffer to the specified value.
Definition: LeafNode.h:122
void setValue(bool value) const
Definition: LeafNodeBool.h:607
Index64 offLeafVoxelCount() const
Definition: LeafNodeBool.h:174
static bool hasActiveTiles()
Return false since leaf nodes never contain tiles.
Definition: LeafNodeBool.h:318
void modifyValueAndActiveStateAndCache(const Coord &xyz, const ModifyOp &op, AccessorT &)
Definition: LeafNodeBool.h:402
static Index log2dim()
Return log2 of the size of the buffer storage.
Definition: LeafNodeBool.h:157
ValueIter< MaskDenseIter, LeafNode, const bool > ValueAllIter
Definition: LeafNodeBool.h:656
void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition: LeafNode.h:486
ValueOnIter beginValueOn()
Definition: LeafNodeBool.h:667
ChildIter< MaskOnIter, const LeafNode > ChildOnCIter
Definition: LeafNodeBool.h:659
ChildOffIter endChildOff()
Definition: LeafNodeBool.h:702
bool operator!=(const LeafNode &other) const
Definition: LeafNode.h:275
static const Index DIM
Definition: LeafNode.h:76
bool getItem(Index pos, void *&child, NonConstValueT &value) const
Definition: LeafNodeBool.h:637
ValueAllCIter cbeginValueAll() const
Definition: LeafNodeBool.h:671
void addLeafAndCache(LeafNode *, AccessorT &)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:533
Bit mask for the internal and leaf nodes of VDB. This is a 64-bit implementation. ...
Definition: NodeMasks.h:287
LeafNode< ValueType, Log2Dim > Type
Definition: LeafNodeBool.h:74
ValueIter()
Definition: LeafNodeBool.h:598
void setActiveStateAndCache(const Coord &xyz, bool on, AccessorT &)
Set the active state of the voxel at the given coordinates without changing its value.
Definition: LeafNodeBool.h:411
void setValue(const Coord &xyz, bool val)
Set the value of the voxel at the given coordinates and mark the voxel as active. ...
Definition: LeafNodeBool.h:290
Definition: NodeMasks.h:219
This struct collects both input and output arguments to "grid combiner" functors used with the tree::...
Definition: Types.h:265
Index memUsage() const
Definition: LeafNodeBool.h:109
bool isInactive() const
Return true if all of this node's values are inactive.
Definition: LeafNodeBool.h:444
const bool & getValueAndCache(const Coord &xyz, AccessorT &) const
Return the value of the voxel at the given coordinates.
Definition: LeafNodeBool.h:364
static const bool sOff
Definition: LeafNodeBool.h:749
Buffer(bool on)
Definition: LeafNodeBool.h:88
NodeMaskType::OnIterator MaskOnIter
Definition: LeafNodeBool.h:586
bool isChildMaskOn(Index) const
Definition: LeafNodeBool.h:717
void setValuesOff()
Mark all voxels as inactive but don't change their values.
Definition: LeafNodeBool.h:310
ChildAllIter endChildAll()
Definition: LeafNodeBool.h:705
bool isOff(Index32 n) const
Return true if the nth bit is off.
Definition: NodeMasks.h:444
bool isValueOn(const Coord &xyz) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNodeBool.h:313
uint64_t Index64
Definition: Types.h:56
ChildAllIter beginChildAll()
Definition: LeafNodeBool.h:695
#define OPENVDB_VERSION_NAME
Definition: version.h:45
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: LeafNodeBool.h:394
bool isChildMaskOff(Index) const
Definition: LeafNodeBool.h:718
bool isEmpty() const
Return true if this node has no active voxels.
Definition: LeafNodeBool.h:179
ChildOffCIter endChildOff() const
Definition: LeafNodeBool.h:701
ChildOffCIter cbeginChildOff() const
Definition: LeafNodeBool.h:690
void visitActiveBBox(BBoxOp &) const
Calls the templated functor BBoxOp with bounding box information. An additional level argument is pro...
Definition: LeafNode.h:1624
void visit(VisitorOp &)
Definition: LeafNode.h:1647
DenseIter(const MaskDenseIter &iter, NodeT *parent)
Definition: LeafNodeBool.h:635
static Index memUsage()
Return the memory-footprint of this Buffer in units of bytes.
Definition: LeafNode.h:153
static void doVisit(NodeT &, VisitorOp &)
Definition: LeafNode.h:1665
ChildAllCIter endChildAll() const
Definition: LeafNodeBool.h:704
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:1124
ChildOnCIter cbeginChildOn() const
Definition: LeafNodeBool.h:687
void setValueOnly(Index offset, bool val)
Set the value of the voxel at the given offset but don't change its active state. ...
Definition: LeafNodeBool.h:270
const bool & getValue(Index i) const
Definition: LeafNodeBool.h:95
Index64 memUsage() const
Return the memory in bytes occupied by this node.
Definition: LeafNode.h:1299
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:1098
void voxelizeActiveTiles()
Definition: LeafNodeBool.h:454
bool ValueType
Definition: LeafNodeBool.h:59
Index64 onVoxelCount() const
Return the number of active voxels.
Definition: LeafNodeBool.h:170
void setValueOff(Index offset)
Mark the voxel at the given offset as inactive but don't change its value.
Definition: LeafNodeBool.h:275
ChildIter< MaskOffIter, LeafNode > ChildOffIter
Definition: LeafNodeBool.h:660
void addTileAndCache(Index, const Coord &, const ValueType &, bool, AccessorT &)
Definition: LeafNode.h:1375
void fill(bool val)
Definition: LeafNodeBool.h:92
ValueAllCIter cendValueAll() const
Definition: LeafNodeBool.h:681
static Index64 offTileCount()
Definition: LeafNodeBool.h:176
Base class for iterators over internal and leaf nodes.
Definition: Iterator.h:58
ValueOnCIter cbeginValueOn() const
Definition: LeafNodeBool.h:665
static Index32 memUsage()
Return the byte size of this NodeMask.
Definition: NodeMasks.h:377
Buffer()
Definition: LeafNodeBool.h:87
void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition: LeafNodeBool.h:283
bool isOn(Index32 n) const
Return true if the nth bit is on.
Definition: NodeMasks.h:438
void setValueMaskOff(Index n)
Definition: LeafNodeBool.h:723
const NodeT * probeConstNodeAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: LeafNodeBool.h:573
Base class for dense iterators over internal and leaf nodes.
Definition: Iterator.h:211
ChildAllCIter beginChildAll() const
Definition: LeafNode.h:400
ChildOnCIter cendChildOn() const
Definition: LeafNodeBool.h:697
NodeMaskType mValueMask
Bitmask that determines which voxels are active.
Definition: LeafNodeBool.h:741
bool isConstant(ValueType &constValue, bool &state, const ValueType &tolerance=zeroVal< ValueType >()) const
Definition: LeafNode.h:1334
bool isValueMaskOff() const
Definition: LeafNodeBool.h:713
void setValue(Index i, bool val)
Definition: LeafNodeBool.h:105
void setValuesOn()
Mark all voxels as active but don't change their values.
Definition: LeafNodeBool.h:308
void setValueMaskOn(Index n)
Definition: LeafNodeBool.h:722
void setOn(Index32 n)
Set the nth bit on.
Definition: NodeMasks.h:388
void addTile(Index level, const Coord &, const ValueType &, bool)
Definition: LeafNode.h:1357
CombineArgs & setBRef(const BValueType &b)
Redirect the B value to a new external source.
Definition: Types.h:305
void unsetItem(Index pos, const ValueT &val) const
Definition: LeafNodeBool.h:648
static Index getValueLevel(const Coord &)
Return the level (0) at which leaf node values reside.
Definition: LeafNodeBool.h:260
ValueAllIter beginValueAll()
Definition: LeafNodeBool.h:673
ValueIter(const MaskIterT &iter, NodeT *parent)
Definition: LeafNodeBool.h:599
void readTopology(std::istream &is, bool fromHalf=false)
Read in just the topology.
Definition: LeafNode.h:1221
bool isValueMaskOn() const
Definition: LeafNodeBool.h:711
static const Index LEVEL
Definition: LeafNode.h:80
static void doVisit2(NodeT &self, OtherChildAllIterT &, VisitorOp &, bool otherIsLHS)
Definition: LeafNode.h:1749
const Buffer & buffer() const
Definition: LeafNodeBool.h:230
LeafNode * probeLeaf(const Coord &)
Return a pointer to this node.
Definition: LeafNodeBool.h:552
ValueOnCIter beginValueOn() const
Definition: LeafNodeBool.h:666
uint32_t Index32
Definition: Types.h:55
const NodeMaskType & getValueMask() const
Definition: LeafNode.h:872
NodeMaskType::OffIterator MaskOffIter
Definition: LeafNodeBool.h:587
int32_t Int32
Definition: Types.h:59
ValueOffCIter cbeginValueOff() const
Definition: LeafNodeBool.h:668
LeafNode< bool, Log2Dim > LeafNodeType
Definition: LeafNodeBool.h:57
bool isValueOnAndCache(const Coord &xyz, AccessorT &) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNodeBool.h:369
OPENVDB_IMPORT uint32_t getFormatVersion(std::istream &)
Return the file format version number associated with the given input stream.
const bool & operator[](Index i) const
Definition: LeafNodeBool.h:100
void modifyItem(Index n, const ModifyOp &op) const
Definition: LeafNodeBool.h:611
void modifyValue(const ModifyOp &op) const
Definition: LeafNodeBool.h:614
bool probeValue(const Coord &xyz, ValueType &val) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNode.h:1064
NodeT * probeNodeAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: LeafNodeBool.h:556
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:1186
Buffer(const NodeMaskType &other)
Definition: LeafNodeBool.h:89
const NodeT * probeConstNode(const Coord &) const
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:539
SparseIteratorBase< MaskIterT, ValueIter, NodeT, ValueT > BaseT
Definition: LeafNodeBool.h:596
DenseIteratorBase< MaskDenseIter, DenseIter, NodeT, void, ValueT > BaseT
Definition: LeafNodeBool.h:631
void writeBuffers(std::ostream &os, bool toHalf=false) const
Write buffers to a stream.
Definition: LeafNode.h:1274
DenseIter< const LeafNode, const ValueType, ChildAll > ChildAllCIter
Definition: LeafNode.h:369
Definition: LeafNode.h:57
void setValueAndCache(const Coord &xyz, bool val, AccessorT &)
Change the value of the voxel at the given coordinates and mark it as active.
Definition: LeafNodeBool.h:374
NodeMaskType::DenseIterator MaskDenseIter
Definition: LeafNodeBool.h:588
Index64 onLeafVoxelCount() const
Definition: LeafNodeBool.h:173
boost::shared_ptr< LeafNodeType > Ptr
Definition: LeafNodeBool.h:58
static void getNodeLog2Dims(std::vector< Index > &dims)
Definition: LeafNodeBool.h:163
void visit2(IterT &otherIter, VisitorOp &, bool otherIsLHS=false)
Definition: LeafNode.h:1725
DenseIter()
Definition: LeafNodeBool.h:634
static Index64 onTileCount()
Definition: LeafNodeBool.h:175
std::string str() const
Return a string representation of this node.
Definition: LeafNode.h:1000
void setValueMask(const NodeMaskType &mask)
Definition: LeafNodeBool.h:716
void signedFloodFill(bool, bool)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:527
ChildOnCIter endChildOn() const
Definition: LeafNodeBool.h:698
bool isValueOn(Index offset) const
Return true if the voxel at the given offset is active.
Definition: LeafNodeBool.h:315
void topologyDifference(const LeafNode< OtherType, Log2Dim > &other, const ValueType &)
Difference this node's set of active values with the active values of the other node, whose ValueType may be different. So a resulting voxel will be active only if the original voxel is active in this LeafNode and inactive in the other LeafNode.
Definition: LeafNode.h:1511
void resetBackground(const ValueType &oldBackground, const ValueType &newBackground)
Replace inactive occurrences of oldBackground with newBackground, and inactive occurrences of -oldBac...
Definition: LeafNode.h:1430
void modifyValueAndActiveState(const Coord &xyz, const ModifyOp &op)
Apply a functor to the voxel at the given coordinates.
Definition: LeafNode.h:519
void setValueOffAndCache(const Coord &xyz, bool value, AccessorT &)
Change the value of the voxel at the given coordinates and mark it as inactive.
Definition: LeafNodeBool.h:385
static Index size()
Definition: LeafNodeBool.h:110
LeafNode()
Default constructor.
Definition: LeafNode.h:919
bool operator!=(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Inequality operator, does exact floating point comparisons.
Definition: Vec3.h:454
ChildIter< MaskOffIter, const LeafNode > ChildOffCIter
Definition: LeafNodeBool.h:661
NodeT * probeNode(const Coord &)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:537
void setItem(Index pos, bool value) const
Definition: LeafNodeBool.h:605
Coord mOrigin
Global grid index coordinates (x,y,z) of the local origin of this node.
Definition: LeafNode.h:864
Buffer & operator=(const Buffer &b)
Definition: LeafNodeBool.h:93
void evalActiveBoundingBox(CoordBBox &bbox, bool visitVoxels=true) const
Definition: LeafNode.h:1307
bool isValueMaskOn(Index n) const
Definition: LeafNodeBool.h:710
void set(Index32 n, bool On)
Set the nth bit to the specified state.
Definition: NodeMasks.h:398
Definition: NodeMasks.h:250
ChildIter(const MaskIterT &iter, NodeT *parent)
Definition: LeafNodeBool.h:623
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:67
NodeMaskType mValueMask
Bitmask that determines which voxels are active.
Definition: LeafNode.h:862
void writeTopology(std::ostream &os, bool toHalf=false) const
Write out just the topology.
Definition: LeafNode.h:1229
DenseIter< const LeafNode, const bool > ChildAllCIter
Definition: LeafNodeBool.h:663
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:1106
void getOrigin(Coord &origin) const
Return the grid index coordinates of this node's local origin.
Definition: LeafNodeBool.h:200
ChildOnIter endChildOn()
Definition: LeafNodeBool.h:699
void merge(const LeafNode &)
Definition: LeafNode.h:1449
util::NodeMask< Log2Dim > NodeMaskType
Definition: LeafNodeBool.h:60
~LeafNode()
Destructor.
Definition: LeafNode.h:993
ValueOffCIter beginValueOff() const
Definition: LeafNodeBool.h:669
ValueOnCIter endValueOn() const
Definition: LeafNodeBool.h:676
ValueOffIter endValueOff()
Definition: LeafNodeBool.h:680
ValueAllCIter endValueAll() const
Definition: LeafNodeBool.h:682
NodeT * stealNode(const Coord &, const ValueType &, bool)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:535
Templated block class to hold specific data types and a fixed number of values determined by Log2Dim...
Definition: LeafNode.h:65
static Index numValues()
Definition: LeafNodeBool.h:161
ValueIter< MaskDenseIter, const LeafNode, const bool > ValueAllCIter
Definition: LeafNodeBool.h:657
static void evalNodeOrigin(Coord &xyz)
Compute the origin of the leaf node that contains the voxel with the given coordinates.
Definition: LeafNodeBool.h:726
CoordBBox getNodeBoundingBox() const
Return the bounding box of this node, i.e., the full index space spanned by this leaf node...
Definition: LeafNode.h:246
const LeafNode * probeConstLeaf(const Coord &) const
Return a const pointer to this node.
Definition: LeafNodeBool.h:569
void save(std::ostream &os) const
Definition: NodeMasks.h:490
Buffer mBuffer
Bitmask representing the values of voxels.
Definition: LeafNodeBool.h:743
void prune(const ValueType &=zeroVal< ValueType >())
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:529
ChildOffCIter cendChildOff() const
Definition: LeafNodeBool.h:700
Buffer & buffer()
Definition: LeafNodeBool.h:231
bool operator==(const Buffer &other) const
Definition: LeafNodeBool.h:102
DenseIter< LeafNode, ValueType, ChildAll > ChildAllIter
Definition: LeafNode.h:368
bool isChildMaskOff() const
Definition: LeafNodeBool.h:719
boost::remove_const< UnsetItemT >::type NonConstValueType
Definition: Iterator.h:217
Buffer mBuffer
Buffer containing the actual data values.
Definition: LeafNode.h:860
Definition: version.h:100
LeafNode * touchLeafAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: LeafNodeBool.h:551
ValueAllCIter beginValueAll() const
Definition: LeafNodeBool.h:672