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>
82 Buffer(
const Buffer& other): mData(other.mData) {}
84 void fill(
bool val) { mData.set(val); }
85 Buffer&
operator=(
const Buffer& b) {
if (&b !=
this) { mData = b.mData; }
return *
this; }
90 return mData.isOn(i) ? LeafNode::sOn : LeafNode::sOff;
94 bool operator==(
const Buffer& other)
const {
return mData == other.mData; }
95 bool operator!=(
const Buffer& other)
const {
return mData != other.mData; }
97 void setValue(
Index i,
bool val) { assert(i < SIZE); mData.set(i, val); }
99 void swap(Buffer& other) {
if (&other !=
this) std::swap(mData, other.mData); }
105 friend class ::TestLeaf;
120 explicit LeafNode(
const Coord& xyz,
bool value =
false,
bool active =
false);
126 template<
typename ValueType>
131 template<
typename ValueType>
134 template<
typename ValueType>
167 bool isEmpty()
const {
return mValueMask.isOff(); }
169 bool isDense()
const {
return mValueMask.isOn(); }
177 void evalActiveBoundingBox(CoordBBox&,
bool visitVoxels =
true)
const;
185 void setOrigin(
const Coord& origin) { mOrigin = origin; }
190 const Coord& origin()
const {
return mOrigin; }
192 void getOrigin(Coord& origin)
const { origin = mOrigin; }
197 static Index coordToOffset(
const Coord& xyz);
200 static Coord offsetToLocalCoord(
Index n);
202 Coord offsetToGlobalCoord(
Index n)
const;
205 std::string str()
const;
209 template<
typename OtherType, Index OtherLog2Dim>
221 void swap(Buffer& other) { mBuffer.swap(other); }
222 const Buffer&
buffer()
const {
return mBuffer; }
229 void readTopology(std::istream&,
bool fromHalf =
false);
231 void writeTopology(std::ostream&,
bool toHalf =
false)
const;
234 void readBuffers(std::istream&,
bool fromHalf =
false);
236 void writeBuffers(std::ostream&,
bool toHalf =
false)
const;
242 const bool& getValue(
const Coord& xyz)
const;
244 const bool& getValue(
Index offset)
const;
249 bool probeValue(
const Coord& xyz,
bool& val)
const;
255 void setActiveState(
const Coord& xyz,
bool on);
260 void setValueOnly(
const Coord& xyz,
bool val);
262 void setValueOnly(
Index offset,
bool val) { assert(offset<SIZE); mBuffer.setValue(offset,val); }
265 void setValueOff(
const Coord& xyz) { mValueMask.setOff(this->coordToOffset(xyz)); }
270 void setValueOff(
const Coord& xyz,
bool val);
272 void setValueOff(
Index offset,
bool val);
275 void setValueOn(
const Coord& xyz) { mValueMask.setOn(this->coordToOffset(xyz)); }
280 void setValueOn(
const Coord& xyz,
bool val);
282 void setValue(
const Coord& xyz,
bool val) { this->setValueOn(xyz, val); };
284 void setValueOn(
Index offset,
bool val);
288 template<
typename ModifyOp>
289 void modifyValue(
Index offset,
const ModifyOp& op);
292 template<
typename ModifyOp>
293 void modifyValue(
const Coord& xyz,
const ModifyOp& op);
296 template<
typename ModifyOp>
297 void modifyValueAndActiveState(
const Coord& xyz,
const ModifyOp& op);
305 bool isValueOn(
const Coord& xyz)
const {
return mValueMask.isOn(this->coordToOffset(xyz)); }
307 bool isValueOn(
Index offset)
const { assert(offset < SIZE);
return mValueMask.isOn(offset); }
313 void fill(
const CoordBBox& bbox,
bool value,
bool active =
true);
316 void fill(
const bool& value);
318 void fill(
const bool& value,
bool active);
331 template<
typename DenseT>
332 void copyToDense(
const CoordBBox& bbox, DenseT& dense)
const;
350 template<
typename DenseT>
351 void copyFromDense(
const CoordBBox& bbox,
const DenseT& dense,
bool background,
bool tolerance);
355 template<
typename AccessorT>
356 const bool&
getValueAndCache(
const Coord& xyz, AccessorT&)
const {
return this->getValue(xyz);}
360 template<
typename AccessorT>
365 template<
typename AccessorT>
366 void setValueAndCache(
const Coord& xyz,
bool val, AccessorT&) { this->setValueOn(xyz, val); }
371 template<
typename AccessorT>
376 template<
typename AccessorT>
379 this->setValueOff(xyz, value);
385 template<
typename ModifyOp,
typename AccessorT>
388 this->modifyValue(xyz, op);
393 template<
typename ModifyOp,
typename AccessorT>
396 this->modifyValueAndActiveState(xyz, op);
402 template<
typename AccessorT>
405 this->setActiveState(xyz, on);
411 template<
typename AccessorT>
414 return this->probeValue(xyz, val);
419 template<
typename AccessorT>
425 const bool&
getFirstValue()
const {
if (mValueMask.isOn(0))
return sOn;
else return sOff; }
429 const bool&
getLastValue()
const {
if (mValueMask.isOn(SIZE-1))
return sOn;
else return sOff; }
434 bool isConstant(
bool& constValue,
bool& state,
bool tolerance = 0)
const;
438 void resetBackground(
bool oldBackground,
bool newBackground);
440 void negate() { mBuffer.mData.toggle(); }
442 template<MergePolicy Policy>
443 void merge(
const LeafNode& other,
bool bg =
false,
bool otherBG =
false);
444 template<MergePolicy Policy>
void merge(
bool tileValue,
bool tileActive);
454 template<
typename OtherType>
468 template<
typename OtherType>
482 template<
typename OtherType>
485 template<
typename CombineOp>
487 template<
typename CombineOp>
488 void combine(
bool,
bool valueIsActive, CombineOp& op);
490 template<
typename CombineOp>
491 void combine2(
const LeafNode& other,
bool,
bool valueIsActive, CombineOp&);
492 template<
typename CombineOp>
493 void combine2(
bool,
const LeafNode& other,
bool valueIsActive, CombineOp&);
494 template<
typename CombineOp>
501 template<
typename BBoxOp>
void visitActiveBBox(BBoxOp&)
const;
503 template<
typename VisitorOp>
void visit(VisitorOp&);
504 template<
typename VisitorOp>
void visit(VisitorOp&)
const;
506 template<
typename OtherLeafNodeType,
typename VisitorOp>
507 void visit2Node(OtherLeafNodeType& other, VisitorOp&);
508 template<
typename OtherLeafNodeType,
typename VisitorOp>
509 void visit2Node(OtherLeafNodeType& other, VisitorOp&)
const;
510 template<
typename IterT,
typename VisitorOp>
511 void visit2(IterT& otherIter, VisitorOp&,
bool otherIsLHS =
false);
512 template<
typename IterT,
typename VisitorOp>
513 void visit2(IterT& otherIter, VisitorOp&,
bool otherIsLHS =
false)
const;
516 void signedFloodFill(
bool) {}
520 template<
typename PruneOp>
void pruneOp(PruneOp&) {}
524 template<
typename AccessorT>
526 template<
typename NodeT>
528 template<
typename NodeT>
530 template<
typename NodeT>
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&);
540 LeafNode* touchLeaf(
const Coord&) {
return this; }
542 template<
typename AccessorT>
545 template<
typename AccessorT>
547 template<
typename NodeT,
typename AccessorT>
551 if (!(boost::is_same<NodeT,LeafNode>::value))
return NULL;
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 (!(boost::is_same<NodeT,LeafNode>::value))
return NULL;
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 typedef ValueIter<MaskOnIter, const LeafNode, const bool>
ValueOnCIter;
720 template<
typename NodeT,
typename VisitorOp,
typename ChildAllIterT>
721 static inline void doVisit(NodeT&, VisitorOp&);
723 template<
typename NodeT,
typename OtherNodeT,
typename VisitorOp,
724 typename ChildAllIterT,
typename OtherChildAllIterT>
725 static inline void doVisit2Node(NodeT&
self, OtherNodeT& other, VisitorOp&);
727 template<
typename NodeT,
typename VisitorOp,
728 typename ChildAllIterT,
typename OtherChildAllIterT>
729 static inline void doVisit2(NodeT&
self, OtherChildAllIterT&, VisitorOp&,
bool otherIsLHS);
777 template<Index Log2Dim>
784 template<Index Log2Dim>
789 mOrigin(xyz & (~(DIM - 1)))
794 template<Index Log2Dim>
795 template<
typename ValueT>
798 mValueMask(other.getValueMask()),
799 mBuffer(other.getValueMask()),
800 mOrigin(other.origin())
805 template<Index Log2Dim>
806 template<
typename ValueT>
810 mValueMask(other.getValueMask()),
811 mBuffer(other.getValueMask()),
812 mOrigin(other.origin())
814 if (offValue) {
if (!onValue)
mBuffer.mData.toggle();
else mBuffer.mData.setOn(); }
818 template<Index Log2Dim>
819 template<
typename ValueT>
823 mValueMask(other.getValueMask()),
825 mOrigin(other.origin())
830 template<Index Log2Dim>
833 mValueMask(other.mValueMask),
834 mBuffer(other.mBuffer),
835 mOrigin(other.mOrigin)
840 template<Index Log2Dim>
850 template<Index Log2Dim>
858 template<Index Log2Dim>
863 if (bbox.isInside(this_bbox)) {
866 bbox.expand(this_bbox);
872 template<Index Log2Dim>
877 if (bbox.isInside(this_bbox))
return;
881 for(; iter; ++iter) this_bbox.expand(this->offsetToLocalCoord(iter.pos()));
882 this_bbox.translate(this->
origin());
884 bbox.expand(this_bbox);
889 template<Index Log2Dim>
890 template<
typename OtherType, Index OtherLog2Dim>
899 template<Index Log2Dim>
903 std::ostringstream ostr;
904 ostr <<
"LeafNode @" <<
mOrigin <<
": ";
913 template<Index Log2Dim>
917 assert ((xyz[0] & (
DIM-1u)) <
DIM && (xyz[1] & (
DIM-1u)) <
DIM && (xyz[2] & (
DIM-1u)) <
DIM);
918 return ((xyz[0] & (
DIM-1u)) << 2*Log2Dim)
919 + ((xyz[1] & (
DIM-1u)) << Log2Dim)
920 + (xyz[2] & (
DIM-1u));
924 template<Index Log2Dim>
928 assert(n < (1 << 3*Log2Dim));
930 xyz.setX(n >> 2*Log2Dim);
931 n &= ((1 << 2*Log2Dim) - 1);
932 xyz.setY(n >> Log2Dim);
933 xyz.setZ(n & ((1 << Log2Dim) - 1));
938 template<Index Log2Dim>
949 template<Index Log2Dim>
957 template<Index Log2Dim>
965 template<Index Log2Dim>
972 is.read(reinterpret_cast<char*>(&
mOrigin),
sizeof(Coord::ValueType) * 3);
981 int8_t numBuffers = 0;
982 is.read(reinterpret_cast<char*>(&numBuffers),
sizeof(int8_t));
986 boost::shared_array<bool> buf(
new bool[
SIZE]);
987 io::readData<bool>(is, buf.get(),
SIZE,
true);
992 if (buf[i])
mBuffer.mData.setOn(i);
995 if (numBuffers > 1) {
998 for (
int i = 1; i < numBuffers; ++i) {
999 io::readData<bool>(is, buf.get(),
SIZE,
true);
1006 template<Index Log2Dim>
1013 os.write(reinterpret_cast<const char*>(&
mOrigin),
sizeof(Coord::ValueType) * 3);
1022 template<Index Log2Dim>
1030 template<Index Log2Dim>
1041 template<Index Log2Dim>
1050 if (!tolerance && !(
mBuffer.mData.isOn() ||
mBuffer.mData.isOff()))
return false;
1053 constValue =
mBuffer.mData.isOn();
1061 template<Index Log2Dim>
1069 template<Index Log2Dim>
1073 assert(offset <
SIZE);
1078 template<Index Log2Dim>
1079 template<
typename AccessorT>
1082 bool val,
bool active, AccessorT&)
1084 this->
addTile(level, xyz, val, active);
1091 template<Index Log2Dim>
1096 if (
mBuffer.mData.isOn(this->coordToOffset(xyz)))
return sOn;
else return sOff;
1100 template<Index Log2Dim>
1104 assert(offset <
SIZE);
1106 if (
mBuffer.mData.isOn(offset))
return sOn;
else return sOff;
1110 template<Index Log2Dim>
1115 val =
mBuffer.mData.isOn(offset);
1120 template<Index Log2Dim>
1128 template<Index Log2Dim>
1132 assert(offset <
SIZE);
1134 mBuffer.mData.set(offset, val);
1138 template<Index Log2Dim>
1146 template<Index Log2Dim>
1154 template<Index Log2Dim>
1162 template<Index Log2Dim>
1166 assert(offset <
SIZE);
1168 mBuffer.mData.set(offset, val);
1172 template<Index Log2Dim>
1173 template<
typename ModifyOp>
1177 bool val =
mBuffer.mData.isOn(offset);
1179 mBuffer.mData.set(offset, val);
1184 template<Index Log2Dim>
1185 template<
typename ModifyOp>
1193 template<Index Log2Dim>
1194 template<
typename ModifyOp>
1201 mBuffer.mData.set(offset, val);
1209 template<Index Log2Dim>
1213 if (newBackground != oldBackground) {
1225 template<Index Log2Dim>
1226 template<MergePolicy Policy>
1233 const Index n = iter.pos();
1242 template<Index Log2Dim>
1243 template<MergePolicy Policy>
1249 if (!tileActive)
return;
1261 template<Index Log2Dim>
1262 template<
typename OtherType>
1270 template<Index Log2Dim>
1271 template<
typename OtherType>
1280 template<Index Log2Dim>
1281 template<
typename OtherType>
1293 template<Index Log2Dim>
1297 for (
Int32 x = bbox.min().x(); x <= bbox.max().x(); ++x) {
1298 const Index offsetX = (x & (
DIM-1u))<<2*Log2Dim;
1299 for (
Int32 y = bbox.min().y(); y <= bbox.max().y(); ++y) {
1300 const Index offsetXY = offsetX + ((y & (
DIM-1u))<< Log2Dim);
1301 for (
Int32 z = bbox.min().z(); z <= bbox.max().z(); ++z) {
1302 const Index offset = offsetXY + (z & (
DIM-1u));
1304 mBuffer.mData.set(offset, value);
1310 template<Index Log2Dim>
1317 template<Index Log2Dim>
1329 template<Index Log2Dim>
1330 template<
typename DenseT>
1334 typedef typename DenseT::ValueType DenseValueType;
1336 const size_t xStride = dense.xStride(), yStride = dense.yStride(), zStride = dense.zStride();
1337 const Coord&
min = dense.bbox().min();
1338 DenseValueType* t0 = dense.data() + zStride * (bbox.min()[2] - min[2]);
1339 const Int32 n0 = bbox.min()[2] & (
DIM-1u);
1340 for (
Int32 x = bbox.min()[0], ex = bbox.max()[0] + 1; x < ex; ++x) {
1341 DenseValueType* t1 = t0 + xStride * (x - min[0]);
1343 for (
Int32 y = bbox.min()[1], ey = bbox.max()[1] + 1; y < ey; ++y) {
1344 DenseValueType* t2 = t1 + yStride * (y - min[1]);
1346 for (
Int32 z = bbox.min()[2], ez = bbox.max()[2] + 1; z < ez; ++z, t2 += zStride) {
1347 *t2 = DenseValueType(
mBuffer.mData.isOn(n2++));
1354 template<Index Log2Dim>
1355 template<
typename DenseT>
1358 bool background,
bool tolerance)
1360 typedef typename DenseT::ValueType DenseValueType;
1362 const size_t xStride = dense.xStride(), yStride = dense.yStride(), zStride = dense.zStride();
1363 const Coord&
min = dense.bbox().min();
1364 const DenseValueType* s0 = dense.data() + zStride * (bbox.min()[2] - min[2]);
1365 const Int32 n0 = bbox.min()[2] & (
DIM-1u);
1366 for (
Int32 x = bbox.min()[0], ex = bbox.max()[0] + 1; x < ex; ++x) {
1367 const DenseValueType* s1 = s0 + xStride * (x - min[0]);
1369 for (
Int32 y = bbox.min()[1], ey = bbox.max()[1] + 1; y < ey; ++y) {
1370 const DenseValueType* s2 = s1 + yStride * (y - min[1]);
1372 for (
Int32 z = bbox.min()[2], ez = bbox.max()[2]+1; z < ez; ++z, ++n2, s2 += zStride) {
1374 if (tolerance || background ==
bool(*s2)) {
1376 mBuffer.mData.set(n2, background);
1379 mBuffer.mData.set(n2,
bool(*s2));
1390 template<Index Log2Dim>
1391 template<
typename CombineOp>
1397 bool result =
false, aVal =
mBuffer.mData.isOn(i), bVal = other.
mBuffer.mData.isOn(i);
1402 .setResultRef(result));
1409 template<Index Log2Dim>
1410 template<
typename CombineOp>
1415 args.
setBRef(value).setBIsActive(valueIsActive);
1417 bool result =
false, aVal =
mBuffer.mData.isOn(i);
1420 .setResultRef(result));
1430 template<Index Log2Dim>
1431 template<
typename CombineOp>
1434 bool valueIsActive, CombineOp& op)
1437 args.
setBRef(value).setBIsActive(valueIsActive);
1439 bool result =
false, aVal = other.
mBuffer.mData.isOn(i);
1442 .setResultRef(result));
1449 template<Index Log2Dim>
1450 template<
typename CombineOp>
1453 bool valueIsActive, CombineOp& op)
1456 args.
setARef(value).setAIsActive(valueIsActive);
1458 bool result =
false, bVal = other.
mBuffer.mData.isOn(i);
1461 .setResultRef(result));
1468 template<Index Log2Dim>
1469 template<
typename CombineOp>
1478 bool result =
false, b0Val = b0.
mBuffer.mData.isOn(i), b1Val = b1.
mBuffer.mData.isOn(i);
1483 .setResultRef(result));
1492 template<Index Log2Dim>
1493 template<
typename BBoxOp>
1497 if (op.template descent<LEVEL>()) {
1500 op.operator()<
LEVEL>(CoordBBox(i.getCoord(),1));
1502 op.template operator()<
LEVEL>(CoordBBox(i.getCoord(),1));
1515 template<Index Log2Dim>
1516 template<
typename VisitorOp>
1520 doVisit<LeafNode, VisitorOp, ChildAllIter>(*
this, op);
1524 template<Index Log2Dim>
1525 template<
typename VisitorOp>
1529 doVisit<const LeafNode, VisitorOp, ChildAllCIter>(*
this, op);
1533 template<Index Log2Dim>
1534 template<
typename NodeT,
typename VisitorOp,
typename ChildAllIterT>
1538 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1547 template<Index Log2Dim>
1548 template<
typename OtherLeafNodeType,
typename VisitorOp>
1553 typename OtherLeafNodeType::ChildAllIter>(*
this, other, op);
1557 template<Index Log2Dim>
1558 template<
typename OtherLeafNodeType,
typename VisitorOp>
1563 typename OtherLeafNodeType::ChildAllCIter>(*
this, other, op);
1567 template<Index Log2Dim>
1570 typename OtherNodeT,
1572 typename ChildAllIterT,
1573 typename OtherChildAllIterT>
1578 BOOST_STATIC_ASSERT(OtherNodeT::SIZE == NodeT::SIZE);
1579 BOOST_STATIC_ASSERT(OtherNodeT::LEVEL == NodeT::LEVEL);
1581 ChildAllIterT iter =
self.beginChildAll();
1582 OtherChildAllIterT otherIter = other.beginChildAll();
1584 for ( ; iter && otherIter; ++iter, ++otherIter) {
1585 op(iter, otherIter);
1593 template<Index Log2Dim>
1594 template<
typename IterT,
typename VisitorOp>
1598 doVisit2<LeafNode, VisitorOp, ChildAllIter, IterT>(*
this, otherIter, op, otherIsLHS);
1602 template<Index Log2Dim>
1603 template<
typename IterT,
typename VisitorOp>
1607 doVisit2<const LeafNode, VisitorOp, ChildAllCIter, IterT>(*
this, otherIter, op, otherIsLHS);
1611 template<Index Log2Dim>
1615 typename ChildAllIterT,
1616 typename OtherChildAllIterT>
1619 VisitorOp& op,
bool otherIsLHS)
1621 if (!otherIter)
return;
1624 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1625 op(otherIter, iter);
1628 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1629 op(iter, otherIter);
1638 #endif // OPENVDB_TREE_LEAFNODEBOOL_HAS_BEEN_INCLUDED
static Index getValueLevelAndCache(const Coord &, AccessorT &)
Return the LEVEL (=0) at which leaf node values reside.
Definition: LeafNodeBool.h:420
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition: LeafNode.h:466
bool isInactive() const
Return true if all of this node's values are inactive.
Definition: LeafNodeBool.h:436
NodeMaskType::DenseIterator MaskDenseIter
Definition: LeafNodeBool.h:580
void setValue(bool value) const
Definition: LeafNodeBool.h:599
ValueOffCIter endValueOff() const
Definition: LeafNodeBool.h:671
void setOff(Index32 n)
Set the nth bit off.
Definition: NodeMasks.h:395
NodeMaskType::OffIterator MaskOffIter
Definition: LeafNodeBool.h:579
boost::shared_ptr< LeafNodeType > Ptr
Definition: LeafNodeBool.h:58
static void getNodeLog2Dims(std::vector< Index > &dims)
Definition: LeafNodeBool.h:151
DenseIter< LeafNode, ValueType, ChildAll > ChildAllIter
Definition: LeafNode.h:358
bool isChildMaskOn(Index) const
Definition: LeafNodeBool.h:709
Buffer mBuffer
Buffer containing the actual data values.
Definition: LeafNode.h:850
const bool & getValue(Index i) const
Definition: LeafNodeBool.h:87
ChildAllIter endChildAll()
Definition: LeafNodeBool.h:697
void modifyValueAndActiveStateAndCache(const Coord &xyz, const ModifyOp &op, AccessorT &)
Definition: LeafNodeBool.h:394
static const Index LOG2DIM
Definition: LeafNode.h:71
util::NodeMask< Log2Dim > NodeMaskType
Definition: LeafNodeBool.h:60
ValueOnCIter endValueOn() const
Definition: LeafNodeBool.h:668
OPENVDB_DEPRECATED const Coord & getOrigin() const
Return the grid index coordinates of this node's local origin.
Definition: LeafNodeBool.h:188
OPENVDB_API Hermite min(const Hermite &, const Hermite &)
min and max operations done directly on the compressed data.
const NodeT * probeConstNode(const Coord &) const
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:531
Coord offsetToGlobalCoord(Index n) const
Return the global coordinates for a linear table offset.
Definition: LeafNode.h:1001
void evalActiveBoundingBox(CoordBBox &, bool visitVoxels=true) const
Definition: LeafNode.h:1285
ChildOnCIter cbeginChildOn() const
Definition: LeafNodeBool.h:679
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:1303
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:262
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:1125
bool isDense() const
Return true if this node only contains active voxels.
Definition: LeafNodeBool.h:169
const bool & getValueAndCache(const Coord &xyz, AccessorT &) const
Return the value of the voxel at the given coordinates.
Definition: LeafNodeBool.h:356
const LeafNode * probeConstLeaf(const Coord &) const
Return a const pointer to this node.
Definition: LeafNodeBool.h:561
static const bool sOff
Definition: LeafNodeBool.h:741
void unsetItem(Index pos, const ValueT &val) const
Definition: LeafNodeBool.h:640
ValueIter(const MaskIterT &iter, NodeT *parent)
Definition: LeafNodeBool.h:591
void prune(const ValueType &=zeroVal< ValueType >())
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:521
static Index64 onTileCount()
Definition: LeafNodeBool.h:163
LeafNode specialization for values of type bool that stores both the active states and the values of ...
Definition: LeafNodeBool.h:54
bool operator==(const LeafNode &other) const
Check for buffer, state and origin equivalence.
Definition: LeafNode.h:1253
bool isValueOn(const Coord &xyz) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNodeBool.h:305
boost::remove_const< UnsetItemT >::type NonConstValueType
Definition: Iterator.h:217
static Index log2dim()
Return log2 of the size of the buffer storage.
Definition: LeafNodeBool.h:145
ValueOnCIter cbeginValueOn() const
Definition: LeafNode.h:361
Definition: NodeMasks.h:189
ValueOffCIter beginValueOff() const
Definition: LeafNodeBool.h:661
const Coord & origin() const
Return the grid index coordinates of this node's local origin.
Definition: LeafNode.h:241
DenseIteratorBase< MaskDenseIter, DenseIter, NodeT, void, ValueT > BaseT
Definition: LeafNodeBool.h:623
void load(std::istream &is)
Definition: NodeMasks.h:496
static Coord offsetToLocalCoord(Index n)
Return the local coordinates for a linear table offset, where offset 0 has coordinates (0...
Definition: LeafNode.h:975
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:1480
static Index memUsage()
Return the memory-footprint of this Buffer in units of bytes.
Definition: LeafNode.h:142
LeafNode * probeLeafAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: LeafNodeBool.h:546
ValueAllCIter cbeginValueAll() const
Definition: LeafNodeBool.h:663
void visit2Node(OtherLeafNodeType &other, VisitorOp &)
Definition: LeafNode.h:1657
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:1472
ChildAllIter beginChildAll()
Definition: LeafNodeBool.h:687
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:386
const bool & operator[](Index i) const
Definition: LeafNodeBool.h:92
bool isEmpty() const
Return true if this node has no active voxels.
Definition: LeafNodeBool.h:167
const ValueType & getValue(const Coord &xyz) const
Return the value of the voxel at the given coordinates.
Definition: LeafNode.h:1012
ChildIter< MaskOnIter, LeafNode > ChildOnIter
Definition: LeafNodeBool.h:650
Index memUsage() const
Definition: LeafNodeBool.h:101
static Index getValueLevel(const Coord &)
Return the level (0) at which leaf node values reside.
Definition: LeafNodeBool.h:252
static Index coordToOffset(const Coord &xyz)
Return the linear table offset of the given global or local coordinates.
Definition: LeafNode.h:965
DenseIter()
Definition: LeafNodeBool.h:626
bool isValueMaskOn() const
Definition: LeafNodeBool.h:703
void combine2(const LeafNode &other, const ValueType &, bool valueIsActive, CombineOp &)
Definition: LeafNode.h:1547
static void evalNodeOrigin(Coord &xyz)
Compute the origin of the leaf node that contains the voxel with the given coordinates.
Definition: LeafNodeBool.h:718
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:494
void setValueMask(Index n, bool on)
Definition: LeafNodeBool.h:713
ValueAllCIter beginValueAll() const
Definition: LeafNodeBool.h:664
ValueOnCIter cendValueOn() const
Definition: LeafNodeBool.h:667
Bit mask for the internal and leaf nodes of VDB. This is a 64-bit implementation. ...
Definition: NodeMasks.h:288
NodeMaskType::OnIterator MaskOnIter
Definition: LeafNodeBool.h:578
Index32 Index
Definition: Types.h:56
static const Index SIZE
Definition: LeafNode.h:76
static void doVisit2Node(NodeT &self, OtherNodeT &other, VisitorOp &)
Definition: LeafNode.h:1682
void setItem(Index pos, bool value) const
Definition: LeafNodeBool.h:597
bool operator==(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Equality operator, does exact floating point comparisons.
Definition: Vec3.h:430
ChildOnIter endChildOn()
Definition: LeafNodeBool.h:691
static const Index DIM
Definition: LeafNode.h:73
static Index32 leafCount()
Definition: LeafNodeBool.h:154
ValueOffIter endValueOff()
Definition: LeafNodeBool.h:672
Buffer(const Buffer &other)
Definition: LeafNodeBool.h:82
CoordBBox getNodeBoundingBox() const
Return the bounding box of this node, i.e., the full index space spanned by this leaf node...
Definition: LeafNodeBool.h:182
Base class for sparse iterators over internal and leaf nodes.
Definition: Iterator.h:148
ValueOnCIter beginValueOn() const
Definition: LeafNodeBool.h:658
void readBuffers(std::istream &is, bool fromHalf=false)
Read buffers from a stream.
Definition: LeafNode.h:1204
void voxelizeActiveTiles()
Definition: LeafNodeBool.h:446
bool ValueType
Definition: LeafNodeBool.h:59
ValueIter< MaskOffIter, LeafNode, bool > ValueOffIter
Definition: LeafNodeBool.h:646
Index64 onVoxelCount() const
Return the number of active voxels.
Definition: LeafNodeBool.h:158
void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition: LeafNode.h:476
void setValueMask(const NodeMaskType &mask)
Definition: LeafNodeBool.h:708
Buffer()
Definition: LeafNodeBool.h:79
void setValueOff(Index offset)
Mark the voxel at the given offset as inactive but don't change its value.
Definition: LeafNodeBool.h:267
void signedFloodFill(bool, bool)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:519
Buffer & buffer()
Definition: LeafNodeBool.h:223
LeafNode * probeLeaf(const Coord &)
Return a pointer to this node.
Definition: LeafNodeBool.h:544
void modifyItem(Index n, const ModifyOp &op) const
Definition: LeafNodeBool.h:603
static Index64 offTileCount()
Definition: LeafNodeBool.h:164
const bool & getFirstValue() const
Return a const reference to the first entry in the buffer.
Definition: LeafNodeBool.h:425
ChildAllCIter beginChildAll() const
Definition: LeafNodeBool.h:686
bool operator!=(const LeafNode &other) const
Definition: LeafNode.h:265
void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition: LeafNodeBool.h:275
const LeafNode * probeConstLeafAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: LeafNodeBool.h:563
static Index getChildDim()
Definition: LeafNodeBool.h:152
void setValue(Index i, bool val)
Definition: LeafNodeBool.h:97
NodeT * probeNode(const Coord &)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:529
CombineArgs & setBRef(const ValueType &b)
Redirect the B value to a new external source.
Definition: Types.h:271
This struct collects both input and output arguments to "grid combiner" functors used with the tree::...
Definition: Types.h:232
NodeMaskType & getValueMask()
Definition: LeafNodeBool.h:707
Definition: version.h:100
Index64 onLeafVoxelCount() const
Definition: LeafNodeBool.h:161
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition: LeafNodeBool.h:265
const bool & getItem(Index pos) const
Definition: LeafNodeBool.h:593
~Buffer()
Definition: LeafNodeBool.h:83
#define OPENVDB_VERSION_NAME
Definition: version.h:45
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:1062
const LeafNode * probeLeafAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: LeafNodeBool.h:560
ChildOnIter beginChildOn()
Definition: LeafNodeBool.h:681
Index64 offVoxelCount() const
Return the number of inactive voxels.
Definition: LeafNodeBool.h:160
void fill(const ValueType &val)
Populates the buffer with a constant value.
Definition: LeafNode.h:100
const bool & getLastValue() const
Return a const reference to the last entry in the buffer.
Definition: LeafNodeBool.h:429
Base class for iterators over internal and leaf nodes.
Definition: Iterator.h:58
ValueOnIter endValueOn()
Definition: LeafNodeBool.h:669
void negate()
Definition: LeafNodeBool.h:440
bool isOff(Index32 n) const
Return true if the nth bit is off.
Definition: NodeMasks.h:446
static Index32 memUsage()
Return the byte size of this NodeMask.
Definition: NodeMasks.h:377
Buffer(const NodeMaskType &other)
Definition: LeafNodeBool.h:81
bool isOn(Index32 n) const
Return true if the nth bit is on.
Definition: NodeMasks.h:440
ValueIter< MaskDenseIter, LeafNode, bool > ValueAllIter
Definition: LeafNodeBool.h:648
bool isValueOn(Index offset) const
Return true if the voxel at the given offset is active.
Definition: LeafNodeBool.h:307
NodeT * probeNodeAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: LeafNodeBool.h:548
BaseT::NonConstValueType NonConstValueT
Definition: LeafNodeBool.h:624
ChildAllCIter beginChildAll() const
Definition: LeafNode.h:390
void visitActiveBBox(BBoxOp &) const
Calls the templated functor BBoxOp with bounding box information. An additional level argument is pro...
Definition: LeafNode.h:1602
void visit(VisitorOp &)
Definition: LeafNode.h:1625
ValueIter< MaskOnIter, const LeafNode, const bool > ValueOnCIter
Definition: LeafNodeBool.h:645
bool isConstant(ValueType &constValue, bool &state, const ValueType &tolerance=zeroVal< ValueType >()) const
Definition: LeafNode.h:1312
static void doVisit(NodeT &, VisitorOp &)
Definition: LeafNode.h:1643
bool operator==(const Buffer &other) const
Definition: LeafNodeBool.h:94
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:1088
uint32_t Index32
Definition: Types.h:54
const NodeMaskType & getValueMask() const
Definition: LeafNodeBool.h:706
ChildAllCIter cendChildAll() const
Definition: LeafNodeBool.h:695
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:403
ChildIter< MaskOffIter, const LeafNode > ChildOffCIter
Definition: LeafNodeBool.h:653
uint64_t Index64
Definition: Types.h:55
int32_t Int32
Definition: Types.h:58
void addTile(Index level, const Coord &, const ValueType &, bool)
Definition: LeafNode.h:1335
static Index32 nonLeafCount()
Definition: LeafNodeBool.h:155
Index64 memUsage() const
Return the memory in bytes occupied by this node.
Definition: LeafNode.h:1263
Index64 offLeafVoxelCount() const
Definition: LeafNodeBool.h:162
static bool hasActiveTiles()
Return false since leaf nodes never contain tiles.
Definition: LeafNodeBool.h:310
ChildOffIter endChildOff()
Definition: LeafNodeBool.h:694
Base class for dense iterators over internal and leaf nodes.
Definition: Iterator.h:211
void addTileAndCache(Index, const Coord &, const ValueType &, bool, AccessorT &)
Definition: LeafNode.h:1353
CombineArgs & setARef(const ValueType &a)
Redirect the A value to a new external source.
Definition: Types.h:269
const NodeMaskType & getValueMask() const
Definition: LeafNode.h:862
DenseIter< const LeafNode, const bool > ChildAllCIter
Definition: LeafNodeBool.h:655
SparseIteratorBase< MaskIterT, ValueIter, NodeT, ValueT > BaseT
Definition: LeafNodeBool.h:588
void setValuesOff()
Mark all voxels as inactive but don't change their values.
Definition: LeafNodeBool.h:302
static Index size()
Definition: LeafNodeBool.h:102
LeafNode * touchLeafAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: LeafNodeBool.h:543
ValueOnIter beginValueOn()
Definition: LeafNodeBool.h:659
ChildOnCIter endChildOn() const
Definition: LeafNodeBool.h:690
ChildIter< MaskOnIter, const LeafNode > ChildOnCIter
Definition: LeafNodeBool.h:651
Coord mOrigin
Global grid index coordinates (x,y,z) of the local origin of this node.
Definition: LeafNodeBool.h:737
NodeT * stealNode(const Coord &, const ValueType &, bool)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:527
static Index numValues()
Definition: LeafNodeBool.h:149
void getOrigin(Coord &origin) const
Return the grid index coordinates of this node's local origin.
Definition: LeafNodeBool.h:192
bool operator!=(const Buffer &other) const
Definition: LeafNodeBool.h:95
void setOn(Index32 n)
Set the nth bit on.
Definition: NodeMasks.h:390
bool isDense() const
Return true if this node contains only active voxels.
Definition: LeafNode.h:219
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:372
static Index size()
Definition: LeafNodeBool.h:148
void readTopology(std::istream &is, bool fromHalf=false)
Read in just the topology.
Definition: LeafNode.h:1185
ValueIter()
Definition: LeafNodeBool.h:590
static const Index LEVEL
Definition: LeafNode.h:77
LeafNode< ValueType, Log2Dim > Type
Definition: LeafNodeBool.h:74
Buffer mBuffer
Bitmask representing the values of voxels.
Definition: LeafNodeBool.h:735
static void doVisit2(NodeT &self, OtherChildAllIterT &, VisitorOp &, bool otherIsLHS)
Definition: LeafNode.h:1727
ValueIter< MaskDenseIter, const LeafNode, const bool > ValueAllCIter
Definition: LeafNodeBool.h:649
bool isValueMaskOn(Index n) const
Definition: LeafNodeBool.h:702
static const bool sOn
Definition: LeafNodeBool.h:740
bool operator!=(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Inequality operator, does exact floating point comparisons.
Definition: Vec3.h:438
void visit2(IterT &otherIter, VisitorOp &, bool otherIsLHS=false)
Definition: LeafNode.h:1703
std::string str() const
Return a string representation of this node.
Definition: LeafNode.h:952
bool isChildMaskOff(Index) const
Definition: LeafNodeBool.h:710
bool probeValue(const Coord &xyz, ValueType &val) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNode.h:1028
void resetBackground(const ValueType &oldBackground, const ValueType &newBackground)
Replace inactive occurrences of oldBackground with newBackground, and inactive occurrences of -oldBac...
Definition: LeafNode.h:1408
ChildOffCIter cbeginChildOff() const
Definition: LeafNodeBool.h:682
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:1150
void pruneOp(PruneOp &)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:520
OPENVDB_DEPRECATED void evalActiveVoxelBoundingBox(CoordBBox &) const
Definition: LeafNode.h:1271
bool isValueMaskOff() const
Definition: LeafNodeBool.h:705
void addLeafAndCache(LeafNode *, AccessorT &)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:525
ValueOffCIter cendValueOff() const
Definition: LeafNodeBool.h:670
void writeBuffers(std::ostream &os, bool toHalf=false) const
Write buffers to a stream.
Definition: LeafNode.h:1238
DenseIter< const LeafNode, const ValueType, ChildAll > ChildAllCIter
Definition: LeafNode.h:359
Coord mOrigin
Global grid index coordinates (x,y,z) of the local origin of this node.
Definition: LeafNode.h:854
ValueAllCIter endValueAll() const
Definition: LeafNodeBool.h:674
DenseIter(const MaskDenseIter &iter, NodeT *parent)
Definition: LeafNodeBool.h:627
ChildOffCIter endChildOff() const
Definition: LeafNodeBool.h:693
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:257
DenseIter< LeafNode, bool > ChildAllIter
Definition: LeafNodeBool.h:654
ChildAllCIter endChildAll() const
Definition: LeafNodeBool.h:696
ValueAllCIter cendValueAll() const
Definition: LeafNodeBool.h:673
void set(Index32 n, bool On)
Set the nth bit to the specified state.
Definition: NodeMasks.h:400
LeafNode< bool, Log2Dim > LeafNodeType
Definition: LeafNodeBool.h:57
ChildAllCIter cbeginChildAll() const
Definition: LeafNodeBool.h:685
ValueIter< MaskOffIter, const LeafNode, const bool > ValueOffCIter
Definition: LeafNodeBool.h:647
const NodeT * probeConstNodeAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: LeafNodeBool.h:565
const bool & getValue() const
Definition: LeafNodeBool.h:594
Definition: NodeMasks.h:220
bool resultIsActive() const
Definition: Types.h:280
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:1489
ChildOffCIter cendChildOff() const
Definition: LeafNodeBool.h:692
bool getItem(Index pos, void *&child, NonConstValueT &value) const
Definition: LeafNodeBool.h:629
ChildOnCIter beginChildOn() const
Definition: LeafNodeBool.h:680
Templated block class to hold specific data types and a fixed number of values determined by Log2Dim...
Definition: LeafNode.h:62
static Index getLevel()
Definition: LeafNodeBool.h:150
void modifyValueAndActiveState(const Coord &xyz, const ModifyOp &op)
Apply a functor to the voxel at the given coordinates.
Definition: LeafNode.h:509
NodeMaskType mValueMask
Bitmask that determines which voxels are active.
Definition: LeafNodeBool.h:733
bool isChildMaskOff() const
Definition: LeafNodeBool.h:711
bool isValueMaskOff(Index n) const
Definition: LeafNodeBool.h:704
void setOrigin(const Coord &origin)
Set the grid index coordinates of this node's local origin.
Definition: LeafNodeBool.h:185
LeafNode()
Default constructor.
Definition: LeafNode.h:894
ValueOffIter beginValueOff()
Definition: LeafNodeBool.h:662
Definition: NodeMasks.h:251
ChildOffCIter beginChildOff() const
Definition: LeafNodeBool.h:683
~LeafNode()
Destructor.
Definition: LeafNode.h:946
ValueAllIter beginValueAll()
Definition: LeafNodeBool.h:665
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:67
void pruneInactive(const ValueType &)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:522
ValueAllIter endValueAll()
Definition: LeafNodeBool.h:675
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:366
void addLeaf(LeafNode *)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:523
void setValueOn(Index offset)
Mark the voxel at the given offset as active but don't change its value.
Definition: LeafNodeBool.h:277
void setValuesOn()
Mark all voxels as active but don't change their values.
Definition: LeafNodeBool.h:300
void getOrigin(Int32 &x, Int32 &y, Int32 &z) const
Return the grid index coordinates of this node's local origin.
Definition: LeafNodeBool.h:193
void swap(Buffer &other)
Definition: LeafNodeBool.h:99
void setValueMaskOn(Index n)
Definition: LeafNodeBool.h:714
bool isValueOnAndCache(const Coord &xyz, AccessorT &) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNodeBool.h:361
void save(std::ostream &os) const
Definition: NodeMasks.h:492
ChildIter()
Definition: LeafNodeBool.h:614
ChildIter< MaskOffIter, LeafNode > ChildOffIter
Definition: LeafNodeBool.h:652
const Buffer & buffer() const
Definition: LeafNodeBool.h:222
NodeMaskType mValueMask
Bitmask that determines which voxels are active.
Definition: LeafNode.h:852
void writeTopology(std::ostream &os, bool toHalf=false) const
Write out just the topology.
Definition: LeafNode.h:1193
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:1070
ValueIter< MaskOnIter, LeafNode, bool > ValueOnIter
Definition: LeafNodeBool.h:644
ValueOnCIter cbeginValueOn() const
Definition: LeafNodeBool.h:657
ValueOffCIter cbeginValueOff() const
Definition: LeafNodeBool.h:660
OPENVDB_IMPORT uint32_t getFormatVersion(std::istream &)
Return the file format version number associated with the given input stream.
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:377
void setValueMaskOff(Index n)
Definition: LeafNodeBool.h:715
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:221
void merge(const LeafNode &)
Definition: LeafNode.h:1427
void modifyValue(const ModifyOp &op) const
Definition: LeafNodeBool.h:606
ChildIter(const MaskIterT &iter, NodeT *parent)
Definition: LeafNodeBool.h:615
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:412
Buffer(bool on)
Definition: LeafNodeBool.h:80
static Index dim()
Return the number of voxels in each dimension.
Definition: LeafNodeBool.h:147
ChildOnCIter cendChildOn() const
Definition: LeafNodeBool.h:689
void fill(bool val)
Definition: LeafNodeBool.h:84
ChildOffIter beginChildOff()
Definition: LeafNodeBool.h:684
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:282
Buffer & operator=(const Buffer &b)
Definition: LeafNodeBool.h:85
CoordBBox getNodeBoundingBox() const
Return the bounding box of this node, i.e., the full index space spanned by this leaf node...
Definition: LeafNode.h:232
void combine(const LeafNode &other, CombineOp &op)
Definition: LeafNode.h:1511