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) + ((xyz[1] &
DIM-1u) << Log2Dim) + (xyz[2] &
DIM-1u);
922 template<Index Log2Dim>
926 assert(n < (1 << 3*Log2Dim));
928 xyz.setX(n >> 2*Log2Dim);
929 n &= ((1 << 2*Log2Dim) - 1);
930 xyz.setY(n >> Log2Dim);
931 xyz.setZ(n & ((1 << Log2Dim) - 1));
936 template<Index Log2Dim>
947 template<Index Log2Dim>
955 template<Index Log2Dim>
963 template<Index Log2Dim>
970 is.read(reinterpret_cast<char*>(&
mOrigin),
sizeof(Coord::ValueType) * 3);
979 int8_t numBuffers = 0;
980 is.read(reinterpret_cast<char*>(&numBuffers),
sizeof(int8_t));
984 boost::shared_array<bool> buf(
new bool[
SIZE]);
985 io::readData<bool>(is, buf.get(),
SIZE,
true);
990 if (buf[i])
mBuffer.mData.setOn(i);
993 if (numBuffers > 1) {
996 for (
int i = 1; i < numBuffers; ++i) {
997 io::readData<bool>(is, buf.get(),
SIZE,
true);
1004 template<Index Log2Dim>
1011 os.write(reinterpret_cast<const char*>(&
mOrigin),
sizeof(Coord::ValueType) * 3);
1020 template<Index Log2Dim>
1028 template<Index Log2Dim>
1039 template<Index Log2Dim>
1048 if (!tolerance && !(
mBuffer.mData.isOn() ||
mBuffer.mData.isOff()))
return false;
1051 constValue =
mBuffer.mData.isOn();
1059 template<Index Log2Dim>
1067 template<Index Log2Dim>
1071 assert(offset <
SIZE);
1076 template<Index Log2Dim>
1077 template<
typename AccessorT>
1080 bool val,
bool active, AccessorT&)
1082 this->
addTile(level, xyz, val, active);
1089 template<Index Log2Dim>
1094 if (
mBuffer.mData.isOn(this->coordToOffset(xyz)))
return sOn;
else return sOff;
1098 template<Index Log2Dim>
1102 assert(offset <
SIZE);
1104 if (
mBuffer.mData.isOn(offset))
return sOn;
else return sOff;
1108 template<Index Log2Dim>
1113 val =
mBuffer.mData.isOn(offset);
1118 template<Index Log2Dim>
1126 template<Index Log2Dim>
1130 assert(offset <
SIZE);
1132 mBuffer.mData.set(offset, val);
1136 template<Index Log2Dim>
1144 template<Index Log2Dim>
1152 template<Index Log2Dim>
1160 template<Index Log2Dim>
1164 assert(offset <
SIZE);
1166 mBuffer.mData.set(offset, val);
1170 template<Index Log2Dim>
1171 template<
typename ModifyOp>
1175 bool val =
mBuffer.mData.isOn(offset);
1177 mBuffer.mData.set(offset, val);
1182 template<Index Log2Dim>
1183 template<
typename ModifyOp>
1191 template<Index Log2Dim>
1192 template<
typename ModifyOp>
1199 mBuffer.mData.set(offset, val);
1207 template<Index Log2Dim>
1211 if (newBackground != oldBackground) {
1220 template<Index Log2Dim>
1221 template<MergePolicy Policy>
1228 const Index n = iter.pos();
1237 template<Index Log2Dim>
1238 template<MergePolicy Policy>
1244 if (!tileActive)
return;
1253 template<Index Log2Dim>
1254 template<
typename OtherType>
1261 template<Index Log2Dim>
1262 template<
typename OtherType>
1270 template<Index Log2Dim>
1271 template<
typename OtherType>
1279 template<Index Log2Dim>
1283 for (
Int32 x = bbox.min().x(); x <= bbox.max().x(); ++x) {
1284 const Index offsetX = (x&
DIM-1u)<<2*Log2Dim;
1285 for (
Int32 y = bbox.min().y(); y <= bbox.max().y(); ++y) {
1286 const Index offsetXY = offsetX + ((y&
DIM-1u)<< Log2Dim);
1287 for (
Int32 z = bbox.min().z(); z <= bbox.max().z(); ++z) {
1288 const Index offset = offsetXY + (z&
DIM-1u);
1290 mBuffer.mData.set(offset, value);
1296 template<Index Log2Dim>
1303 template<Index Log2Dim>
1315 template<Index Log2Dim>
1316 template<
typename DenseT>
1320 typedef typename DenseT::ValueType DenseValueType;
1322 const size_t xStride = dense.xStride(), yStride = dense.yStride();
1323 const Coord&
min = dense.bbox().min();
1324 DenseValueType* t0 = dense.data() + bbox.min()[2]-min[2];
1325 const Int32 n0 = bbox.min()[2]&
DIM-1u;
1326 for (
Int32 x = bbox.min()[0], ex=bbox.max()[0]+1; x<ex; ++x) {
1327 DenseValueType* t1 = t0 + xStride*(x-min[0]);
1329 for (
Int32 y = bbox.min()[1], ey=bbox.max()[1]+1; y<ey; ++y) {
1330 DenseValueType* t2 = t1 + yStride*(y-min[1]);
1332 for (
Int32 z = bbox.min()[2], ez=bbox.max()[2]+1; z<ez ; ++z) {
1333 *t2++ = DenseValueType(
mBuffer.mData.isOn(n2++));
1340 template<Index Log2Dim>
1341 template<
typename DenseT>
1344 bool background,
bool tolerance)
1346 typedef typename DenseT::ValueType DenseValueType;
1348 const size_t xStride = dense.xStride(), yStride = dense.yStride();
1349 const Coord&
min = dense.bbox().min();
1350 const DenseValueType* s0 = dense.data() + bbox.min()[2]-min[2];
1351 const Int32 n0 = bbox.min()[2]&
DIM-1u;
1352 for (
Int32 x = bbox.min()[0], ex=bbox.max()[0]+1; x<ex; ++x) {
1353 const DenseValueType* s1 = s0 + xStride*(x-min[0]);
1355 for (
Int32 y = bbox.min()[1], ey=bbox.max()[1]+1; y<ey; ++y) {
1356 const DenseValueType* s2 = s1 + yStride*(y-min[1]);
1358 for (
Int32 z = bbox.min()[2], ez=bbox.max()[2]+1; z<ez ; ++z, ++n2, ++s2) {
1360 if (tolerance || background ==
bool(*s2)) {
1362 mBuffer.mData.set(n2, background);
1365 mBuffer.mData.set(n2,
bool(*s2));
1376 template<Index Log2Dim>
1377 template<
typename CombineOp>
1383 bool result =
false, aVal =
mBuffer.mData.isOn(i), bVal = other.
mBuffer.mData.isOn(i);
1388 .setResultRef(result));
1395 template<Index Log2Dim>
1396 template<
typename CombineOp>
1401 args.
setBRef(value).setBIsActive(valueIsActive);
1403 bool result =
false, aVal =
mBuffer.mData.isOn(i);
1406 .setResultRef(result));
1416 template<Index Log2Dim>
1417 template<
typename CombineOp>
1420 bool valueIsActive, CombineOp& op)
1423 args.
setBRef(value).setBIsActive(valueIsActive);
1425 bool result =
false, aVal = other.
mBuffer.mData.isOn(i);
1428 .setResultRef(result));
1435 template<Index Log2Dim>
1436 template<
typename CombineOp>
1439 bool valueIsActive, CombineOp& op)
1442 args.
setARef(value).setAIsActive(valueIsActive);
1444 bool result =
false, bVal = other.
mBuffer.mData.isOn(i);
1447 .setResultRef(result));
1454 template<Index Log2Dim>
1455 template<
typename CombineOp>
1464 bool result =
false, b0Val = b0.
mBuffer.mData.isOn(i), b1Val = b1.
mBuffer.mData.isOn(i);
1469 .setResultRef(result));
1478 template<Index Log2Dim>
1479 template<
typename BBoxOp>
1483 if (op.template descent<LEVEL>()) {
1486 op.operator()<
LEVEL>(CoordBBox(i.getCoord(),1));
1488 op.template operator()<
LEVEL>(CoordBBox(i.getCoord(),1));
1501 template<Index Log2Dim>
1502 template<
typename VisitorOp>
1506 doVisit<LeafNode, VisitorOp, ChildAllIter>(*
this, op);
1510 template<Index Log2Dim>
1511 template<
typename VisitorOp>
1515 doVisit<const LeafNode, VisitorOp, ChildAllCIter>(*
this, op);
1519 template<Index Log2Dim>
1520 template<
typename NodeT,
typename VisitorOp,
typename ChildAllIterT>
1524 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1533 template<Index Log2Dim>
1534 template<
typename OtherLeafNodeType,
typename VisitorOp>
1539 typename OtherLeafNodeType::ChildAllIter>(*
this, other, op);
1543 template<Index Log2Dim>
1544 template<
typename OtherLeafNodeType,
typename VisitorOp>
1549 typename OtherLeafNodeType::ChildAllCIter>(*
this, other, op);
1553 template<Index Log2Dim>
1556 typename OtherNodeT,
1558 typename ChildAllIterT,
1559 typename OtherChildAllIterT>
1564 BOOST_STATIC_ASSERT(OtherNodeT::SIZE == NodeT::SIZE);
1565 BOOST_STATIC_ASSERT(OtherNodeT::LEVEL == NodeT::LEVEL);
1567 ChildAllIterT iter =
self.beginChildAll();
1568 OtherChildAllIterT otherIter = other.beginChildAll();
1570 for ( ; iter && otherIter; ++iter, ++otherIter) {
1571 op(iter, otherIter);
1579 template<Index Log2Dim>
1580 template<
typename IterT,
typename VisitorOp>
1584 doVisit2<LeafNode, VisitorOp, ChildAllIter, IterT>(*
this, otherIter, op, otherIsLHS);
1588 template<Index Log2Dim>
1589 template<
typename IterT,
typename VisitorOp>
1593 doVisit2<const LeafNode, VisitorOp, ChildAllCIter, IterT>(*
this, otherIter, op, otherIsLHS);
1597 template<Index Log2Dim>
1601 typename ChildAllIterT,
1602 typename OtherChildAllIterT>
1605 VisitorOp& op,
bool otherIsLHS)
1607 if (!otherIter)
return;
1610 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1611 op(otherIter, iter);
1614 for (ChildAllIterT iter =
self.
beginChildAll(); iter; ++iter) {
1615 op(iter, otherIter);
1624 #endif // OPENVDB_TREE_LEAFNODEBOOL_HAS_BEEN_INCLUDED
ValueIter< MaskDenseIter, LeafNode, bool > ValueAllIter
Definition: LeafNodeBool.h:648
DenseIter< LeafNode, ValueType, ChildAll > ChildAllIter
Definition: LeafNode.h:358
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 modifyItem(Index n, const ModifyOp &op) const
Definition: LeafNodeBool.h:603
ChildOnCIter cbeginChildOn() const
Definition: LeafNodeBool.h:679
ValueIter< MaskOffIter, const LeafNode, const bool > ValueOffCIter
Definition: LeafNodeBool.h:647
bool isValueOn(Index offset) const
Return true if the voxel at the given offset is active.
Definition: LeafNodeBool.h:307
void combine(const LeafNode &other, CombineOp &op)
Definition: LeafNode.h:1507
ChildAllCIter cendChildAll() const
Definition: LeafNodeBool.h:695
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition: LeafNode.h:466
const LeafNode * probeConstLeafAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: LeafNodeBool.h:563
ChildIter< MaskOffIter, const LeafNode > ChildOffCIter
Definition: LeafNodeBool.h:653
void load(std::istream &is)
Definition: NodeMasks.h:496
const bool & operator[](Index i) const
Definition: LeafNodeBool.h:92
void evalActiveBoundingBox(CoordBBox &, bool visitVoxels=true) const
Definition: LeafNode.h:1281
ValueOffIter beginValueOff()
Definition: LeafNodeBool.h:662
Buffer mBuffer
Buffer containing the actual data values.
Definition: LeafNode.h:850
NodeMaskType & getValueMask()
Definition: LeafNodeBool.h:707
DenseIter< const LeafNode, const bool > ChildAllCIter
Definition: LeafNodeBool.h:655
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:1299
LeafNode< ValueType, Log2Dim > Type
Definition: LeafNodeBool.h:74
Index64 onLeafVoxelCount() const
Definition: LeafNodeBool.h:161
ValueOffCIter beginValueOff() const
Definition: LeafNodeBool.h:661
static const Index LOG2DIM
Definition: LeafNode.h:71
ValueAllIter endValueAll()
Definition: LeafNodeBool.h:675
const bool & getItem(Index pos) const
Definition: LeafNodeBool.h:593
Buffer(const NodeMaskType &other)
Definition: LeafNodeBool.h:81
int32_t Int32
Definition: Types.h:58
boost::shared_ptr< LeafNodeType > Ptr
Definition: LeafNodeBool.h:58
Coord offsetToGlobalCoord(Index n) const
Return the global coordinates for a linear table offset.
Definition: LeafNode.h:1001
ChildOnIter beginChildOn()
Definition: LeafNodeBool.h:681
ValueIter()
Definition: LeafNodeBool.h:590
void fill(bool val)
Definition: LeafNodeBool.h:84
bool operator==(const LeafNode &other) const
Check for buffer, state and origin equivalence.
Definition: LeafNode.h:1249
void set(Index32 n, bool On)
Set the nth bit to the specified state.
Definition: NodeMasks.h:400
ChildAllCIter endChildAll() const
Definition: LeafNodeBool.h:696
ValueOnCIter cbeginValueOn() const
Definition: LeafNode.h:361
void modifyValueAndActiveStateAndCache(const Coord &xyz, const ModifyOp &op, AccessorT &)
Definition: LeafNodeBool.h:394
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:1123
Buffer()
Definition: LeafNodeBool.h:79
LeafNode specialization for values of type bool that stores both the active states and the values of ...
Definition: LeafNodeBool.h:54
const NodeT * probeConstNode(const Coord &) const
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:531
LeafNode * probeLeaf(const Coord &)
Return a pointer to this node.
Definition: LeafNodeBool.h:544
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 visit2Node(OtherLeafNodeType &other, VisitorOp &)
Definition: LeafNode.h:1653
const bool & getValue() const
Definition: LeafNodeBool.h:594
Definition: NodeMasks.h:220
This struct collects both input and output arguments to "grid combiner" functors used with the tree::...
Definition: Types.h:232
uint32_t Index32
Definition: Types.h:54
const ValueType & getValue(const Coord &xyz) const
Return the value of the voxel at the given coordinates.
Definition: LeafNode.h:1012
bool isDense() const
Return true if this node only contains active voxels.
Definition: LeafNodeBool.h:169
static Index coordToOffset(const Coord &xyz)
Return the linear table offset of the given global or local coordinates.
Definition: LeafNode.h:965
static Index size()
Definition: LeafNodeBool.h:102
const Coord & origin() const
Return the grid index coordinates of this node's local origin.
Definition: LeafNode.h:241
void combine2(const LeafNode &other, const ValueType &, bool valueIsActive, CombineOp &)
Definition: LeafNode.h:1543
static bool hasActiveTiles()
Return false since leaf nodes never contain tiles.
Definition: LeafNodeBool.h:310
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:1476
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 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:1468
static Index64 onTileCount()
Definition: LeafNodeBool.h:163
ChildOffIter endChildOff()
Definition: LeafNodeBool.h:694
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition: LeafNodeBool.h:265
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
ValueOffCIter cendValueOff() const
Definition: LeafNodeBool.h:670
void setValuesOff()
Mark all voxels as inactive but don't change their values.
Definition: LeafNodeBool.h:302
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
Index64 offVoxelCount() const
Return the number of inactive voxels.
Definition: LeafNodeBool.h:160
OnIterator beginOn() const
Definition: NodeMasks.h:332
const Buffer & buffer() const
Definition: LeafNodeBool.h:222
ChildIter()
Definition: LeafNodeBool.h:614
void setValueMask(const NodeMaskType &mask)
Definition: LeafNodeBool.h:708
ValueOnCIter cbeginValueOn() const
Definition: LeafNodeBool.h:657
ValueOffCIter cbeginValueOff() const
Definition: LeafNodeBool.h:660
void signedFloodFill(bool, bool)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:519
static const Index SIZE
Definition: LeafNode.h:76
const NodeT * probeConstNodeAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: LeafNodeBool.h:565
static void doVisit2Node(NodeT &self, OtherNodeT &other, VisitorOp &)
Definition: LeafNode.h:1678
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:395
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
static const Index DIM
Definition: LeafNode.h:73
Buffer mBuffer
Bitmask representing the values of voxels.
Definition: LeafNodeBool.h:735
NodeMaskType mValueMask
Bitmask that determines which voxels are active.
Definition: LeafNodeBool.h:733
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 readBuffers(std::istream &is, bool fromHalf=false)
Read buffers from a stream.
Definition: LeafNode.h:1200
NodeT * probeNode(const Coord &)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:529
const bool & getValueAndCache(const Coord &xyz, AccessorT &) const
Return the value of the voxel at the given coordinates.
Definition: LeafNodeBool.h:356
void prune(const ValueType &=zeroVal< ValueType >())
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:521
NodeMaskType::OnIterator MaskOnIter
Definition: LeafNodeBool.h:578
ValueAllIter beginValueAll()
Definition: LeafNodeBool.h:665
bool isChildMaskOff(Index) const
Definition: LeafNodeBool.h:710
ChildOffCIter beginChildOff() const
Definition: LeafNodeBool.h:683
bool operator!=(const LeafNode &other) const
Definition: LeafNode.h:265
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
ChildOffCIter cbeginChildOff() const
Definition: LeafNodeBool.h:682
bool getItem(Index pos, void *&child, NonConstValueT &value) const
Definition: LeafNodeBool.h:629
bool operator==(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Equality operator, does exact floating point comparisons.
Definition: Vec3.h:430
Templated block class to hold specific data types and a fixed number of values determined by Log2Dim...
Definition: LeafNode.h:62
void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition: LeafNode.h:476
OPENVDB_IMPORT uint32_t getFormatVersion(std::istream &)
Return the file format version number associated with the given input stream.
ValueOnIter beginValueOn()
Definition: LeafNodeBool.h:659
bool isValueOnAndCache(const Coord &xyz, AccessorT &) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNodeBool.h:361
bool operator==(const Buffer &other) const
Definition: LeafNodeBool.h:94
ChildOnCIter endChildOn() const
Definition: LeafNodeBool.h:690
void setValueMaskOn(Index n)
Definition: LeafNodeBool.h:714
void modifyValue(const ModifyOp &op) const
Definition: LeafNodeBool.h:606
LeafNode * probeLeafAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: LeafNodeBool.h:546
Buffer & operator=(const Buffer &b)
Definition: LeafNodeBool.h:85
bool isOff(Index32 n) const
Return true if the nth bit is off.
Definition: NodeMasks.h:446
bool isOn(Index32 n) const
Return true if the nth bit is on.
Definition: NodeMasks.h:440
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
DenseIteratorBase< MaskDenseIter, DenseIter, NodeT, void, ValueT > BaseT
Definition: LeafNodeBool.h:623
ValueAllCIter cendValueAll() const
Definition: LeafNodeBool.h:673
bool ValueType
Definition: LeafNodeBool.h:59
static Index size()
Definition: LeafNodeBool.h:148
#define OPENVDB_VERSION_NAME
Definition: version.h:45
Buffer & buffer()
Definition: LeafNodeBool.h:223
ChildAllCIter cbeginChildAll() const
Definition: LeafNodeBool.h:685
static Index64 offTileCount()
Definition: LeafNodeBool.h:164
bool isValueMaskOn(Index n) const
Definition: LeafNodeBool.h:702
void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition: LeafNodeBool.h:275
static Index dim()
Return the number of voxels in each dimension.
Definition: LeafNodeBool.h:147
void swap(Buffer &other)
Definition: LeafNodeBool.h:99
ChildOnCIter cendChildOn() const
Definition: LeafNodeBool.h:689
Index64 offLeafVoxelCount() const
Definition: LeafNodeBool.h:162
void setOrigin(const Coord &origin)
Set the grid index coordinates of this node's local origin.
Definition: LeafNodeBool.h:185
ValueIter(const MaskIterT &iter, NodeT *parent)
Definition: LeafNodeBool.h:591
DenseIter()
Definition: LeafNodeBool.h:626
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:1598
void visit(VisitorOp &)
Definition: LeafNode.h:1621
DenseIter(const MaskDenseIter &iter, NodeT *parent)
Definition: LeafNodeBool.h:627
static void doVisit(NodeT &, VisitorOp &)
Definition: LeafNode.h:1639
bool operator!=(const Buffer &other) const
Definition: LeafNodeBool.h:95
static Index log2dim()
Return log2 of the size of the buffer storage.
Definition: LeafNodeBool.h:145
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
Base class for iterators over internal and leaf nodes.
Definition: Iterator.h:58
void addTile(Index level, const Coord &, const ValueType &, bool)
Definition: LeafNode.h:1331
void setValueOn(Index offset)
Mark the voxel at the given offset as active but don't change its value.
Definition: LeafNodeBool.h:277
bool isChildMaskOn(Index) const
Definition: LeafNodeBool.h:709
NodeMaskType::OffIterator MaskOffIter
Definition: LeafNodeBool.h:579
Coord mOrigin
Global grid index coordinates (x,y,z) of the local origin of this node.
Definition: LeafNodeBool.h:737
static void getNodeLog2Dims(std::vector< Index > &dims)
Definition: LeafNodeBool.h:151
CombineArgs & setBRef(const ValueType &b)
Redirect the B value to a new external source.
Definition: Types.h:271
NodeT * stealNode(const Coord &, const ValueType &, bool)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:527
bool isConstant(ValueType &constValue, bool &state, const ValueType &tolerance=zeroVal< ValueType >()) const
Definition: LeafNode.h:1308
ValueOnCIter beginValueOn() const
Definition: LeafNodeBool.h:658
void addTileAndCache(Index, const Coord &, const ValueType &, bool, AccessorT &)
Definition: LeafNode.h:1349
util::NodeMask< Log2Dim > NodeMaskType
Definition: LeafNodeBool.h:60
OPENVDB_API Hermite min(const Hermite &, const Hermite &)
min and max operations done directly on the compressed data.
const bool & getLastValue() const
Return a const reference to the last entry in the buffer.
Definition: LeafNodeBool.h:429
ValueIter< MaskOffIter, LeafNode, bool > ValueOffIter
Definition: LeafNodeBool.h:646
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
Index64 memUsage() const
Return the memory in bytes occupied by this node.
Definition: LeafNode.h:1259
void save(std::ostream &os) const
Definition: NodeMasks.h:492
Base class for dense iterators over internal and leaf nodes.
Definition: Iterator.h:211
static const bool sOff
Definition: LeafNodeBool.h:741
ChildOffCIter cendChildOff() const
Definition: LeafNodeBool.h:692
const NodeMaskType & getValueMask() const
Definition: LeafNode.h:862
const NodeMaskType & getValueMask() const
Definition: LeafNodeBool.h:706
bool isChildMaskOff() const
Definition: LeafNodeBool.h:711
ChildOnIter endChildOn()
Definition: LeafNodeBool.h:691
bool isValueOn(const Coord &xyz) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNodeBool.h:305
void readTopology(std::istream &is, bool fromHalf=false)
Read in just the topology.
Definition: LeafNode.h:1181
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
static const Index LEVEL
Definition: LeafNode.h:77
static void doVisit2(NodeT &self, OtherChildAllIterT &, VisitorOp &, bool otherIsLHS)
Definition: LeafNode.h:1723
void pruneOp(PruneOp &)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:520
void pruneInactive(const ValueType &)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:522
void setValue(bool value) const
Definition: LeafNodeBool.h:599
void addLeaf(LeafNode *)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:523
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
std::string str() const
Return a string representation of this node.
Definition: LeafNode.h:952
bool isDense() const
Return true if this node contains only active voxels.
Definition: LeafNode.h:219
BaseT::NonConstValueType NonConstValueT
Definition: LeafNodeBool.h:624
DenseIter< LeafNode, bool > ChildAllIter
Definition: LeafNodeBool.h:654
bool probeValue(const Coord &xyz, ValueType &val) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNode.h:1028
ChildIter< MaskOnIter, const LeafNode > ChildOnCIter
Definition: LeafNodeBool.h:651
ChildIter(const MaskIterT &iter, NodeT *parent)
Definition: LeafNodeBool.h:615
ChildAllIter endChildAll()
Definition: LeafNodeBool.h:697
ValueAllCIter cbeginValueAll() const
Definition: LeafNodeBool.h:663
ChildIter< MaskOnIter, LeafNode > ChildOnIter
Definition: LeafNodeBool.h:650
ChildIter< MaskOffIter, LeafNode > ChildOffIter
Definition: LeafNodeBool.h:652
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:1147
ChildAllIter beginChildAll()
Definition: LeafNodeBool.h:687
static Index getValueLevel(const Coord &)
Return the level (0) at which leaf node values reside.
Definition: LeafNodeBool.h:252
Definition: NodeMasks.h:189
OPENVDB_DEPRECATED void evalActiveVoxelBoundingBox(CoordBBox &) const
Definition: LeafNode.h:1267
Buffer(const Buffer &other)
Definition: LeafNodeBool.h:82
bool isValueMaskOn() const
Definition: LeafNodeBool.h:703
void visit2(IterT &otherIter, VisitorOp &, bool otherIsLHS=false)
Definition: LeafNode.h:1699
void setValueOff(Index offset)
Mark the voxel at the given offset as inactive but don't change its value.
Definition: LeafNodeBool.h:267
Index32 Index
Definition: Types.h:56
void writeBuffers(std::ostream &os, bool toHalf=false) const
Write buffers to a stream.
Definition: LeafNode.h:1234
LeafNode< bool, Log2Dim > LeafNodeType
Definition: LeafNodeBool.h:57
Coord mOrigin
Global grid index coordinates (x,y,z) of the local origin of this node.
Definition: LeafNode.h:854
void setValueMaskOff(Index n)
Definition: LeafNodeBool.h:715
void setOn(Index32 n)
Set the nth bit on.
Definition: NodeMasks.h:390
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
static Index memUsage()
Return the memory-footprint of this Buffer in units of bytes.
Definition: LeafNode.h:142
bool operator!=(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Inequality operator, does exact floating point comparisons.
Definition: Vec3.h:438
ValueAllCIter beginValueAll() const
Definition: LeafNodeBool.h:664
ChildOnCIter beginChildOn() const
Definition: LeafNodeBool.h:680
void resetBackground(const ValueType &oldBackground, const ValueType &newBackground)
Replace inactive occurrences of oldBackground with newBackground, and inactive occurrences of -oldBac...
Definition: LeafNode.h:1404
static Index getLevel()
Definition: LeafNodeBool.h:150
ValueOnCIter cendValueOn() const
Definition: LeafNodeBool.h:667
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
bool isValueMaskOff(Index n) const
Definition: LeafNodeBool.h:704
boost::remove_const< UnsetItemT >::type NonConstValueType
Definition: Iterator.h:217
ValueIter< MaskDenseIter, const LeafNode, const bool > ValueAllCIter
Definition: LeafNodeBool.h:649
const LeafNode * probeConstLeaf(const Coord &) const
Return a const pointer to this node.
Definition: LeafNodeBool.h:561
static Index32 memUsage()
Return the byte size of this NodeMask.
Definition: NodeMasks.h:377
DenseIter< const LeafNode, const ValueType, ChildAll > ChildAllCIter
Definition: LeafNode.h:359
ChildOffIter beginChildOff()
Definition: LeafNodeBool.h:684
static Index getValueLevelAndCache(const Coord &, AccessorT &)
Return the LEVEL (=0) at which leaf node values reside.
Definition: LeafNodeBool.h:420
static Index32 leafCount()
Definition: LeafNodeBool.h:154
NodeMaskType::DenseIterator MaskDenseIter
Definition: LeafNodeBool.h:580
ValueOffCIter endValueOff() const
Definition: LeafNodeBool.h:671
void modifyValueAndActiveState(const Coord &xyz, const ModifyOp &op)
Apply a functor to the voxel at the given coordinates.
Definition: LeafNode.h:509
LeafNode()
Default constructor.
Definition: LeafNode.h:894
ValueOffIter endValueOff()
Definition: LeafNodeBool.h:672
CombineArgs & setARef(const ValueType &a)
Redirect the A value to a new external source.
Definition: Types.h:269
LeafNode * touchLeafAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: LeafNodeBool.h:543
void addLeafAndCache(LeafNode *, AccessorT &)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:525
Buffer(bool on)
Definition: LeafNodeBool.h:80
ValueAllCIter endValueAll() const
Definition: LeafNodeBool.h:674
ChildOffCIter endChildOff() const
Definition: LeafNodeBool.h:693
static Index numValues()
Definition: LeafNodeBool.h:149
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:1485
ValueIter< MaskOnIter, LeafNode, bool > ValueOnIter
Definition: LeafNodeBool.h:644
~Buffer()
Definition: LeafNodeBool.h:83
bool resultIsActive() const
Definition: Types.h:280
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
Definition: NodeMasks.h:251
void voxelizeActiveTiles()
Definition: LeafNodeBool.h:446
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:56
void unsetItem(Index pos, const ValueT &val) const
Definition: LeafNodeBool.h:640
NodeT * probeNodeAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: LeafNodeBool.h:548
const bool & getFirstValue() const
Return a const reference to the first entry in the buffer.
Definition: LeafNodeBool.h:425
Index64 onVoxelCount() const
Return the number of active voxels.
Definition: LeafNodeBool.h:158
ValueIter< MaskOnIter, const LeafNode, const bool > ValueOnCIter
Definition: LeafNodeBool.h:645
~LeafNode()
Destructor.
Definition: LeafNode.h:946
static Index getChildDim()
Definition: LeafNodeBool.h:152
ChildAllCIter beginChildAll() const
Definition: LeafNodeBool.h:686
void setValueMask(Index n, bool on)
Definition: LeafNodeBool.h:713
static const bool sOn
Definition: LeafNodeBool.h:740
NodeMaskType mValueMask
Bitmask that determines which voxels are active.
Definition: LeafNode.h:852
uint64_t Index64
Definition: Types.h:55
static Index32 nonLeafCount()
Definition: LeafNodeBool.h:155
Bit mask for the internal and leaf nodes of VDB. This is a 64-bit implementation. ...
Definition: NodeMasks.h:288
const bool & getValue(Index i) const
Definition: LeafNodeBool.h:87
void setItem(Index pos, bool value) const
Definition: LeafNodeBool.h:597
void fill(const ValueType &val)
Populates the buffer with a constant value.
Definition: LeafNode.h:100
bool isInactive() const
Return true if all of this node's values are inactive.
Definition: LeafNodeBool.h:436
SparseIteratorBase< MaskIterT, ValueIter, NodeT, ValueT > BaseT
Definition: LeafNodeBool.h:588
bool isValueMaskOff() const
Definition: LeafNodeBool.h:705
void writeTopology(std::ostream &os, bool toHalf=false) const
Write out just the topology.
Definition: LeafNode.h:1189
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
const LeafNode * probeLeafAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: LeafNodeBool.h:560
void merge(const LeafNode &)
Definition: LeafNode.h:1423
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 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
Index memUsage() const
Definition: LeafNodeBool.h:101
void getOrigin(Coord &origin) const
Return the grid index coordinates of this node's local origin.
Definition: LeafNodeBool.h:192
bool isEmpty() const
Return true if this node has no active voxels.
Definition: LeafNodeBool.h:167
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
void setValue(Index i, bool val)
Definition: LeafNodeBool.h:97
ValueOnIter endValueOn()
Definition: LeafNodeBool.h:669
void negate()
Definition: LeafNodeBool.h:440