4 #ifndef OPENVDB_TREE_LEAF_NODE_BOOL_HAS_BEEN_INCLUDED 5 #define OPENVDB_TREE_LEAF_NODE_BOOL_HAS_BEEN_INCLUDED 17 #include <type_traits> 28 template<Index Log2Dim>
40 static const Index LOG2DIM = Log2Dim;
41 static const Index TOTAL = Log2Dim;
42 static const Index DIM = 1 << TOTAL;
43 static const Index NUM_VALUES = 1 << 3 * Log2Dim;
44 static const Index NUM_VOXELS = NUM_VALUES;
45 static const Index SIZE = NUM_VALUES;
50 template<
typename ValueType>
55 template<
typename OtherNodeType>
56 struct SameConfiguration {
68 explicit LeafNode(
const Coord& xyz,
bool value =
false,
bool active =
false);
80 template<
typename OtherValueType>
96 template<
typename ValueType>
112 template<typename ValueType>
113 LeafNode(const
LeafNode<ValueType, Log2Dim>& other,
bool offValue,
bool onValue, TopologyCopy);
114 template<typename ValueType>
115 LeafNode(const
LeafNode<ValueType, Log2Dim>& other,
bool background, TopologyCopy);
125 static
Index log2dim() {
return Log2Dim; }
151 bool isEmpty()
const {
return mValueMask.isOff(); }
153 bool isDense()
const {
return mValueMask.isOn(); }
170 void evalActiveBoundingBox(CoordBBox& bbox,
bool visitVoxels =
true)
const;
177 void setOrigin(
const Coord& origin) { mOrigin = origin; }
180 const Coord&
origin()
const {
return mOrigin; }
181 void getOrigin(Coord& origin)
const { origin = mOrigin; }
186 static Index coordToOffset(
const Coord& xyz);
189 static Coord offsetToLocalCoord(
Index n);
191 Coord offsetToGlobalCoord(
Index n)
const;
199 std::string str()
const;
203 template<
typename OtherType, Index OtherLog2Dim>
223 void readTopology(std::istream&,
bool fromHalf =
false);
225 void writeTopology(std::ostream&,
bool toHalf =
false)
const;
228 void readBuffers(std::istream&,
bool fromHalf =
false);
229 void readBuffers(std::istream& is,
const CoordBBox&,
bool fromHalf =
false);
231 void writeBuffers(std::ostream&,
bool toHalf =
false)
const;
237 const bool& getValue(
const Coord& xyz)
const;
239 const bool& getValue(
Index offset)
const;
244 bool probeValue(
const Coord& xyz,
bool& val)
const;
248 bool probeValue(
Index offset,
bool& val)
const;
254 void setActiveState(
const Coord& xyz,
bool on);
259 void setValueOnly(
const Coord& xyz,
bool val);
264 void setValueOff(
const Coord& xyz) { mValueMask.setOff(this->coordToOffset(xyz)); }
269 void setValueOff(
const Coord& xyz,
bool val);
271 void setValueOff(
Index offset,
bool val);
274 void setValueOn(
const Coord& xyz) { mValueMask.setOn(this->coordToOffset(xyz)); }
279 void setValueOn(
const Coord& xyz,
bool val);
281 void setValue(
const Coord& xyz,
bool val) { this->setValueOn(xyz, val); }
283 void setValueOn(
Index offset,
bool val);
287 template<
typename ModifyOp>
288 void modifyValue(
Index offset,
const ModifyOp&
op);
291 template<
typename ModifyOp>
292 void modifyValue(
const Coord& xyz,
const ModifyOp& op);
295 template<
typename ModifyOp>
296 void modifyValueAndActiveState(
const Coord& xyz,
const ModifyOp& op);
316 void clip(
const CoordBBox&,
bool background);
319 void fill(
const CoordBBox& bbox,
bool value,
bool active =
true);
321 void denseFill(
const CoordBBox& bbox,
bool val,
bool on =
true) { this->fill(bbox, val, on); }
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 Buffer::sOn;
else return Buffer::sOff; }
437 const bool&
getLastValue()
const {
if (mValueMask.isOn(SIZE-1))
return Buffer::sOn;
else return Buffer::sOff; }
442 bool isConstant(
bool& constValue,
bool& state,
bool tolerance = 0)
const;
449 bool medianAll()
const;
493 void resetBackground(
bool oldBackground,
bool newBackground);
495 void negate() { mBuffer.mData.toggle(); }
497 template<MergePolicy Policy>
498 void merge(
const LeafNode& other,
bool bg =
false,
bool otherBG =
false);
499 template<MergePolicy Policy>
void merge(
bool tileValue,
bool tileActive);
511 template<
typename OtherType>
525 template<
typename OtherType>
539 template<
typename OtherType>
542 template<
typename CombineOp>
544 template<
typename CombineOp>
545 void combine(
bool,
bool valueIsActive, CombineOp& op);
547 template<
typename CombineOp,
typename OtherType >
548 void combine2(
const LeafNode& other,
const OtherType&,
bool valueIsActive, CombineOp&);
549 template<
typename CombineOp,
typename OtherNodeT >
550 void combine2(
bool,
const OtherNodeT& other,
bool valueIsActive, CombineOp&);
551 template<
typename CombineOp,
typename OtherNodeT >
552 void combine2(
const LeafNode& b0,
const OtherNodeT& b1, CombineOp&);
558 template<
typename AccessorT>
560 template<
typename NodeT>
562 template<
typename NodeT>
564 template<
typename NodeT>
566 template<
typename ArrayT>
void getNodes(ArrayT&)
const {}
570 void addTile(
Index level,
const Coord&,
bool val,
bool active);
571 void addTile(
Index offset,
bool val,
bool active);
572 template<
typename AccessorT>
573 void addTileAndCache(
Index level,
const Coord&,
bool val,
bool active, AccessorT&);
578 template<
typename AccessorT>
581 template<
typename AccessorT>
583 template<
typename NodeT,
typename AccessorT>
587 if (!(std::is_same<NodeT, LeafNode>::value))
return nullptr;
588 return reinterpret_cast<NodeT*
>(
this);
595 template<
typename AccessorT>
598 template<
typename AccessorT>
600 template<
typename NodeT,
typename AccessorT>
604 if (!(std::is_same<NodeT, LeafNode>::value))
return nullptr;
605 return reinterpret_cast<const NodeT*
>(
this);
618 template<
typename MaskIterT,
typename NodeT,
typename ValueT>
622 public SparseIteratorBase<MaskIterT, ValueIter<MaskIterT, NodeT, ValueT>, NodeT, ValueT>
629 const bool&
getItem(
Index pos)
const {
return this->parent().getValue(pos); }
630 const bool&
getValue()
const {
return this->getItem(this->pos()); }
633 void setItem(
Index pos,
bool value)
const { this->parent().setValueOnly(pos, value); }
635 void setValue(
bool value)
const { this->setItem(this->pos(), value); }
638 template<
typename ModifyOp>
639 void modifyItem(
Index n,
const ModifyOp& op)
const { this->parent().modifyValue(n, op); }
641 template<
typename ModifyOp>
642 void modifyValue(
const ModifyOp& op)
const { this->modifyItem(this->pos(), op); }
646 template<
typename MaskIterT,
typename NodeT>
652 MaskIterT, ChildIter<MaskIterT, NodeT>, NodeT,
bool>(iter, parent) {}
655 template<
typename NodeT,
typename ValueT>
657 MaskDenseIter, DenseIter<NodeT, ValueT>, NodeT, void, ValueT>
667 value = this->parent().getValue(pos);
676 void unsetItem(
Index pos,
const ValueT& val)
const {this->parent().setValueOnly(pos, val);}
681 using ValueOnCIter = ValueIter<MaskOnIter, const LeafNode, const bool>;
792 template<Index Log2Dim>
800 template<Index Log2Dim>
805 , mOrigin(xyz & (~(
DIM - 1)))
810 template<Index Log2Dim>
815 , mOrigin(xyz & (~(
DIM - 1)))
823 template<Index Log2Dim>
827 , mBuffer(other.mBuffer)
828 , mOrigin(other.mOrigin)
829 , mTransientData(other.mTransientData)
835 template<Index Log2Dim>
836 template<
typename ValueT>
841 , mTransientData(other.mTransientData)
845 static inline bool convertValue(
const ValueT& val) {
return bool(val); }
849 mBuffer.setValue(i, Local::convertValue(other.mBuffer[i]));
854 template<Index Log2Dim>
855 template<
typename ValueT>
860 , mBuffer(background)
862 , mTransientData(other.mTransientData)
867 template<Index Log2Dim>
868 template<
typename ValueT>
874 , mTransientData(other.mTransientData)
878 template<Index Log2Dim>
886 , mOrigin(xyz & (~(
DIM - 1)))
887 , mTransientData(trans)
891 template<Index Log2Dim>
892 template<
typename ValueT>
899 , mTransientData(other.mTransientData)
902 if (mValueMask.
isOn(i)) {
909 template<Index Log2Dim>
919 template<Index Log2Dim>
924 return sizeof(*this);
928 template<Index Log2Dim>
933 return sizeof(*this);
937 template<Index Log2Dim>
942 if (bbox.isInside(this_bbox))
return;
946 for(; iter; ++iter) this_bbox.expand(this->offsetToLocalCoord(iter.pos()));
947 this_bbox.translate(this->
origin());
949 bbox.expand(this_bbox);
954 template<Index Log2Dim>
955 template<
typename OtherType, Index OtherLog2Dim>
960 return (Log2Dim == OtherLog2Dim && mValueMask == other->
getValueMask());
964 template<Index Log2Dim>
968 std::ostringstream ostr;
969 ostr <<
"LeafNode @" << mOrigin <<
": ";
970 for (
Index32 n = 0; n <
SIZE; ++n) ostr << (mValueMask.
isOn(n) ?
'#' :
'.');
978 template<Index Log2Dim>
983 return ((xyz[0] & (
DIM-1u)) << 2*Log2Dim)
984 + ((xyz[1] & (
DIM-1u)) << Log2Dim)
985 + (xyz[2] & (
DIM-1u));
989 template<Index Log2Dim>
995 xyz.setX(n >> 2*Log2Dim);
996 n &= ((1 << 2*Log2Dim) - 1);
997 xyz.setY(n >> Log2Dim);
998 xyz.setZ(n & ((1 << Log2Dim) - 1));
1003 template<Index Log2Dim>
1014 template<Index Log2Dim>
1018 mValueMask.
load(is);
1022 template<Index Log2Dim>
1026 mValueMask.
save(os);
1030 template<Index Log2Dim>
1040 bool background =
false;
1042 background = *
static_cast<const bool*
>(bgPtr);
1044 this->
clip(clipBBox, background);
1048 template<Index Log2Dim>
1053 mValueMask.
load(is);
1055 is.read(reinterpret_cast<char*>(&mOrigin),
sizeof(Coord::ValueType) * 3);
1059 mBuffer.mData.load(is);
1064 int8_t numBuffers = 0;
1065 is.read(reinterpret_cast<char*>(&numBuffers),
sizeof(int8_t));
1069 std::unique_ptr<bool[]> buf{
new bool[
SIZE]};
1070 io::readData<bool>(is, buf.get(),
SIZE,
true);
1073 mBuffer.mData.setOff();
1075 if (buf[i]) mBuffer.mData.setOn(i);
1078 if (numBuffers > 1) {
1081 for (
int i = 1; i < numBuffers; ++i) {
1082 io::readData<bool>(is, buf.get(),
SIZE,
true);
1089 template<Index Log2Dim>
1094 mValueMask.
save(os);
1096 os.write(reinterpret_cast<const char*>(&mOrigin),
sizeof(Coord::ValueType) * 3);
1098 mBuffer.mData.save(os);
1105 template<Index Log2Dim>
1109 return mOrigin == other.mOrigin &&
1111 mBuffer == other.mBuffer;
1115 template<Index Log2Dim>
1126 template<Index Log2Dim>
1130 if (!mValueMask.
isConstant(state))
return false;
1133 if (!tolerance && !(mBuffer.mData.isOn() || mBuffer.mData.isOff()))
return false;
1135 constValue = mBuffer.mData.isOn();
1141 template<Index Log2Dim>
1145 const Index countTrue = mBuffer.mData.countOn();
1149 template<Index Log2Dim>
1159 template<Index Log2Dim>
1163 const NodeMaskType tmp = mBuffer.mData & (!mValueMask);
1172 template<Index Log2Dim>
1179 template<Index Log2Dim>
1188 template<Index Log2Dim>
1189 template<
typename AccessorT>
1192 bool val,
bool active, AccessorT&)
1194 this->
addTile(level, xyz, val, active);
1201 template<Index Log2Dim>
1206 if (mBuffer.mData.isOn(this->coordToOffset(xyz)))
return Buffer::sOn;
else return Buffer::sOff;
1210 template<Index Log2Dim>
1216 if (mBuffer.mData.isOn(offset))
return Buffer::sOn;
else return Buffer::sOff;
1220 template<Index Log2Dim>
1227 template<Index Log2Dim>
1232 val = mBuffer.mData.isOn(offset);
1233 return mValueMask.
isOn(offset);
1236 template<Index Log2Dim>
1244 template<Index Log2Dim>
1249 mValueMask.
setOn(offset);
1250 mBuffer.mData.set(offset, val);
1254 template<Index Log2Dim>
1262 template<Index Log2Dim>
1270 template<Index Log2Dim>
1278 template<Index Log2Dim>
1283 mValueMask.
setOff(offset);
1284 mBuffer.mData.set(offset, val);
1288 template<Index Log2Dim>
1289 template<
typename ModifyOp>
1293 bool val = mBuffer.mData.isOn(offset);
1295 mBuffer.mData.set(offset, val);
1296 mValueMask.
setOn(offset);
1300 template<Index Log2Dim>
1301 template<
typename ModifyOp>
1309 template<Index Log2Dim>
1310 template<
typename ModifyOp>
1315 bool val = mBuffer.mData.isOn(offset), state = mValueMask.
isOn(offset);
1317 mBuffer.mData.set(offset, val);
1318 mValueMask.
set(offset, state);
1325 template<Index Log2Dim>
1329 if (newBackground != oldBackground) {
1333 mBuffer.mData = (mBuffer.mData & mValueMask) | bgMask;
1341 template<Index Log2Dim>
1342 template<MergePolicy Policy>
1349 const Index n = iter.pos();
1350 if (mValueMask.
isOff(n)) {
1351 mBuffer.mData.set(n, other.mBuffer.mData.isOn(n));
1352 mValueMask.
setOn(n);
1358 template<Index Log2Dim>
1359 template<MergePolicy Policy>
1365 if (!tileActive)
return;
1367 if (tileValue) mBuffer.mData |= !mValueMask;
1368 else mBuffer.mData &= mValueMask;
1377 template<Index Log2Dim>
1378 template<
typename OtherType>
1386 template<Index Log2Dim>
1387 template<
typename OtherType>
1396 template<Index Log2Dim>
1397 template<
typename OtherType>
1409 template<Index Log2Dim>
1414 if (!clipBBox.hasOverlap(nodeBBox)) {
1416 this->
fill(nodeBBox, background,
false);
1417 }
else if (clipBBox.isInside(nodeBBox)) {
1427 nodeBBox.intersect(clipBBox);
1429 int &x = xyz.x(), &y = xyz.y(), &z = xyz.z();
1430 for (x = nodeBBox.min().x(); x <= nodeBBox.max().x(); ++x) {
1431 for (y = nodeBBox.min().y(); y <= nodeBBox.max().y(); ++y) {
1432 for (z = nodeBBox.min().z(); z <= nodeBBox.max().z(); ++z) {
1449 template<Index Log2Dim>
1454 clippedBBox.intersect(bbox);
1455 if (!clippedBBox)
return;
1457 for (
Int32 x = clippedBBox.min().x(); x <= clippedBBox.max().x(); ++x) {
1458 const Index offsetX = (x & (
DIM-1u))<<2*Log2Dim;
1459 for (
Int32 y = clippedBBox.min().y(); y <= clippedBBox.max().y(); ++y) {
1460 const Index offsetXY = offsetX + ((y & (
DIM-1u))<< Log2Dim);
1461 for (
Int32 z = clippedBBox.min().z(); z <= clippedBBox.max().z(); ++z) {
1462 const Index offset = offsetXY + (z & (
DIM-1u));
1463 mValueMask.
set(offset, active);
1464 mBuffer.mData.set(offset, value);
1470 template<Index Log2Dim>
1474 mBuffer.
fill(value);
1477 template<Index Log2Dim>
1481 mBuffer.
fill(value);
1482 mValueMask.
set(active);
1489 template<Index Log2Dim>
1490 template<
typename DenseT>
1494 using DenseValueType =
typename DenseT::ValueType;
1496 const size_t xStride = dense.xStride(), yStride = dense.yStride(), zStride = dense.zStride();
1497 const Coord&
min = dense.bbox().min();
1498 DenseValueType* t0 = dense.data() + zStride * (bbox.min()[2] - min[2]);
1499 const Int32 n0 = bbox.min()[2] & (
DIM-1u);
1500 for (
Int32 x = bbox.min()[0], ex = bbox.max()[0] + 1; x < ex; ++x) {
1501 DenseValueType* t1 = t0 + xStride * (x - min[0]);
1503 for (
Int32 y = bbox.min()[1], ey = bbox.max()[1] + 1; y < ey; ++y) {
1504 DenseValueType* t2 = t1 + yStride * (y - min[1]);
1506 for (
Int32 z = bbox.min()[2], ez = bbox.max()[2] + 1; z < ez; ++z, t2 += zStride) {
1507 *t2 = DenseValueType(mBuffer.mData.isOn(n2++));
1514 template<Index Log2Dim>
1515 template<
typename DenseT>
1518 bool background,
bool tolerance)
1520 using DenseValueType =
typename DenseT::ValueType;
1522 inline static bool toBool(
const DenseValueType& v) {
return !
math::isZero(v); }
1525 const size_t xStride = dense.xStride(), yStride = dense.yStride(), zStride = dense.zStride();
1526 const Coord&
min = dense.bbox().min();
1527 const DenseValueType* s0 = dense.data() + zStride * (bbox.min()[2] - min[2]);
1528 const Int32 n0 = bbox.min()[2] & (
DIM-1u);
1529 for (
Int32 x = bbox.min()[0], ex = bbox.max()[0] + 1; x < ex; ++x) {
1530 const DenseValueType* s1 = s0 + xStride * (x - min[0]);
1532 for (
Int32 y = bbox.min()[1], ey = bbox.max()[1] + 1; y < ey; ++y) {
1533 const DenseValueType* s2 = s1 + yStride * (y - min[1]);
1535 for (
Int32 z = bbox.min()[2], ez = bbox.max()[2]+1; z < ez; ++z, ++n2, s2 += zStride) {
1537 if (tolerance || (background == Local::toBool(*s2))) {
1538 mValueMask.setOff(n2);
1539 mBuffer.mData.set(n2, background);
1541 mValueMask.setOn(n2);
1542 mBuffer.mData.set(n2, Local::toBool(*s2));
1553 template<Index Log2Dim>
1554 template<
typename CombineOp>
1560 bool result =
false, aVal = mBuffer.mData.isOn(i), bVal = other.mBuffer.mData.isOn(i);
1562 .setAIsActive(mValueMask.isOn(i))
1565 .setResultRef(result));
1567 mBuffer.mData.set(i, result);
1572 template<Index Log2Dim>
1573 template<
typename CombineOp>
1578 args.
setBRef(value).setBIsActive(valueIsActive);
1580 bool result =
false, aVal = mBuffer.mData.isOn(i);
1582 .setAIsActive(mValueMask.isOn(i))
1583 .setResultRef(result));
1585 mBuffer.mData.set(i, result);
1593 template<Index Log2Dim>
1594 template<
typename CombineOp,
typename OtherType>
1597 bool valueIsActive, CombineOp& op)
1600 args.
setBRef(value).setBIsActive(valueIsActive);
1602 bool result =
false, aVal = other.mBuffer.mData.isOn(i);
1605 .setResultRef(result));
1607 mBuffer.mData.set(i, result);
1612 template<Index Log2Dim>
1613 template<
typename CombineOp,
typename OtherNodeT>
1616 bool valueIsActive, CombineOp& op)
1619 args.
setARef(value).setAIsActive(valueIsActive);
1621 bool result =
false, bVal = other.mBuffer.mData.isOn(i);
1623 .setBIsActive(other.valueMask().isOn(i))
1624 .setResultRef(result));
1626 mBuffer.mData.set(i, result);
1631 template<Index Log2Dim>
1632 template<
typename CombineOp,
typename OtherNodeT>
1639 mValueMask.set(i, b0.
valueMask().
isOn(i) || b1.valueMask().isOn(i));
1641 bool result =
false, b0Val = b0.mBuffer.mData.isOn(i), b1Val = b1.mBuffer.mData.isOn(i);
1645 .setBIsActive(b1.valueMask().isOn(i))
1646 .setResultRef(result));
1648 mBuffer.mData.set(i, result);
1657 #endif // OPENVDB_TREE_LEAF_NODE_BOOL_HAS_BEEN_INCLUDED void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition: LeafNodeBool.h:274
NodeT * stealNode(const Coord &, const ValueType &, bool)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:561
ValueAllCIter cbeginValueAll() const
Definition: LeafNodeBool.h:699
ValueOnIter beginValueOn()
Definition: LeafNodeBool.h:695
bool isValueOnAndCache(const Coord &xyz, AccessorT &) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNodeBool.h:369
Templated block class to hold specific data types and a fixed number of values determined by Log2Dim...
Definition: LeafNode.h:38
void setValueMask(const NodeMaskType &mask)
Definition: LeafNodeBool.h:745
ValueType medianAll(ValueType *tmp=nullptr) const
Computes the median value of all the active AND inactive voxels in this node.
Definition: LeafNode.h:1541
void setValuesOff()
Mark all voxels as inactive but don't change their values.
Definition: LeafNodeBool.h:301
void readBuffers(std::istream &is, bool fromHalf=false)
Read buffers from a stream.
Definition: LeafNode.h:1334
void addLeafAndCache(LeafNode *, AccessorT &)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:559
Index64 onVoxelCount() const
Return the number of active voxels.
Definition: LeafNodeBool.h:142
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition: LeafNodeBool.h:264
bool isChildMaskOff() const
Definition: LeafNodeBool.h:748
const bool & getItem(Index pos) const
Definition: LeafNodeBool.h:629
ValueOnCIter cbeginValueOn() const
Definition: LeafNode.h:300
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:281
void modifyValueAndActiveState(const Coord &xyz, const ModifyOp &op)
Apply a functor to the voxel at the given coordinates.
Definition: LeafNode.h:459
Definition: version.h.in:256
This struct collects both input and output arguments to "grid combiner" functors used with the tree::...
Definition: Types.h:568
ValueAllCIter cendValueAll() const
Definition: LeafNodeBool.h:709
bool operator==(const LeafNode &other) const
Check for buffer, state and origin equivalence.
Definition: LeafNode.h:1449
Base class for iterators over internal and leaf nodes.
Definition: Iterator.h:29
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:1234
Buffer mBuffer
Bitmask representing the values of voxels.
Definition: LeafNodeBool.h:760
LeafNode()
Default constructor.
Definition: LeafNode.h:932
ValueIter< MaskOffIter, LeafNode, const bool > ValueOffIter
Definition: LeafNodeBool.h:682
ValueOnCIter beginValueOn() const
Definition: LeafNodeBool.h:694
static Index64 nonLeafCount()
Definition: LeafNodeBool.h:139
void readTopology(std::istream &is, bool fromHalf=false)
Read in just the topology.
Definition: LeafNode.h:1298
General-purpose arithmetic and comparison routines, most of which accept arbitrary value types (or at...
bool getValueUnsafe(Index offset, bool &value) const
Return true if the voxel at the given offset is active and set value.
Definition: LeafNodeBool.h:479
ChildAllCIter beginChildAll() const
Definition: LeafNodeBool.h:722
void setValueOffUnsafe(Index offset, const bool &value)
Set the value of the voxel at the given coordinates and mark the voxel as active. ...
Definition: LeafNodeBool.h:491
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 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:438
ValueIter< MaskDenseIter, LeafNode, const bool > ValueAllIter
Definition: LeafNodeBool.h:684
void setValueOff(Index offset)
Mark the voxel at the given offset as inactive but don't change its value.
Definition: LeafNodeBool.h:266
uint64_t Index64
Definition: Types.h:53
ValueOffIter beginValueOff()
Definition: LeafNodeBool.h:698
DenseIter< LeafNode, bool > ChildAllIter
Definition: LeafNodeBool.h:690
Index64 offVoxelCount() const
Return the number of inactive voxels.
Definition: LeafNodeBool.h:144
LeafNode specialization for values of type bool that stores both the active states and the values of ...
Definition: LeafNodeBool.h:29
bool resultIsActive() const
Definition: Types.h:632
void setOn(Index32 n)
Set the nth bit on.
Definition: NodeMasks.h:452
Coord mOrigin
Global grid index coordinates (x,y,z) of the local origin of this node.
Definition: LeafNodeBool.h:762
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:1718
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition: LeafNode.h:410
CoordBBox getNodeBoundingBox() const
Return the bounding box of this node, i.e., the full index space spanned by this leaf node...
Definition: LeafNode.h:170
SharedPtr< LeafNodeType > Ptr
Definition: LeafNodeBool.h:37
ValueOffCIter endValueOff() const
Definition: LeafNodeBool.h:707
void modifyValueAndActiveStateAndCache(const Coord &xyz, const ModifyOp &op, AccessorT &)
Definition: LeafNodeBool.h:402
ChildIter< MaskOnIter, LeafNode > ChildOnIter
Definition: LeafNodeBool.h:686
const bool & getFirstValue() const
Return a const reference to the first entry in the buffer.
Definition: LeafNodeBool.h:433
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
ValueIter< MaskOnIter, LeafNode, const bool > ValueOnIter
Definition: LeafNodeBool.h:680
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:1125
void voxelizeActiveTiles(bool=true)
No-op.
Definition: LeafNodeBool.h:503
const Coord & origin() const
Return the grid index coordinates of this node's local origin.
Definition: LeafNodeBool.h:180
bool BuildType
Definition: LeafNodeBool.h:33
static const Index DIM
Definition: LeafNode.h:51
ValueAllIter endValueAll()
Definition: LeafNodeBool.h:711
LeafNode * touchLeaf(const Coord &)
Return a pointer to this node.
Definition: LeafNodeBool.h:577
void combine(const LeafNode &other, CombineOp &op)
Definition: LeafNode.h:1751
const ValueType & getValue(const Coord &xyz) const
Return the value of the voxel at the given coordinates.
Definition: LeafNode.h:1075
void setValueOnUnsafe(Index offset, const bool &value)
Set the value of the voxel at the given coordinates and mark the voxel as active. ...
Definition: LeafNodeBool.h:487
Bit mask for the internal and leaf nodes of VDB. This is a 64-bit implementation. ...
Definition: NodeMasks.h:307
bool isValueOff(const Coord &xyz) const
Return true if the voxel at the given coordinates is inactive.
Definition: LeafNodeBool.h:308
LeafNode * probeLeafAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: LeafNodeBool.h:582
void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition: LeafNode.h:420
Definition: NodeMasks.h:270
static Index numValues()
Definition: LeafNodeBool.h:129
void setValueOffUnsafe(Index offset)
Mark the voxel at the given offset as inactive but don't change its value.
Definition: LeafNodeBool.h:489
static Index64 onTileCount()
Definition: LeafNodeBool.h:147
typename NodeMaskType::OnIterator MaskOnIter
Definition: LeafNodeBool.h:614
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:1261
bool isValueOn(const Coord &xyz) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNodeBool.h:304
Definition: NodeMasks.h:239
static Coord offsetToLocalCoord(Index n)
Return the local coordinates for a linear table offset, where offset 0 has coordinates (0...
Definition: LeafNode.h:1050
void resetBackground(const ValueType &oldBackground, const ValueType &newBackground)
Replace inactive occurrences of oldBackground with newBackground, and inactive occurrences of -oldBac...
Definition: LeafNode.h:1639
void setOrigin(const Coord &origin)
Set the grid index coordinates of this node's local origin.
Definition: LeafNodeBool.h:177
ChildAllCIter cbeginChildAll() const
Definition: LeafNodeBool.h:721
bool getItem(Index pos, void *&child, NonConstValueT &value) const
Definition: LeafNodeBool.h:665
static const Index SIZE
Definition: LeafNode.h:54
NodeMaskType mValueMask
Bitmask that determines which voxels are active.
Definition: LeafNodeBool.h:758
ValueIter()
Definition: LeafNodeBool.h:626
void negate()
Definition: LeafNodeBool.h:495
ValueOnCIter endValueOn() const
Definition: LeafNodeBool.h:704
void setValueOnlyUnsafe(Index offset, const bool &value)
Set the value of the voxel at the given coordinates but don't change its active state.
Definition: LeafNodeBool.h:483
int32_t Int32
Definition: Types.h:56
ValueIter< MaskOnIter, const LeafNode, const bool > ValueOnCIter
Definition: LeafNodeBool.h:681
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:256
Index32 Index
Definition: Types.h:54
ChildOffCIter endChildOff() const
Definition: LeafNodeBool.h:729
bool isValueOff(Index offset) const
Return true if the voxel at the given offset is inactive.
Definition: LeafNodeBool.h:310
const Coord & origin() const
Return the grid index coordinates of this node's local origin.
Definition: LeafNode.h:176
const NodeMaskType & valueMask() const
Definition: LeafNodeBool.h:743
bool allocate()
Allocate memory for this node's buffer if it has not already been allocated.
Definition: LeafNodeBool.h:161
ChildIter< MaskOnIter, const LeafNode > ChildOnCIter
Definition: LeafNodeBool.h:687
void setTransientData(Index32 transientData)
Set the transient data value.
Definition: LeafNodeBool.h:196
ChildAllIter endChildAll()
Definition: LeafNodeBool.h:733
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:215
ValueOffCIter cbeginValueOff() const
Definition: LeafNodeBool.h:696
const bool & getValue() const
Definition: LeafNodeBool.h:630
ChildOffCIter beginChildOff() const
Definition: LeafNodeBool.h:719
void setValueOn(Index offset)
Mark the voxel at the given offset as active but don't change its value.
Definition: LeafNodeBool.h:276
void merge(const LeafNode &)
Definition: LeafNode.h:1661
const LeafNode * probeConstLeafAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: LeafNodeBool.h:599
void addTile(Index level, const Coord &, const ValueType &, bool)
Definition: LeafNode.h:1610
const bool & getValueAndCache(const Coord &xyz, AccessorT &) const
Return the value of the voxel at the given coordinates.
Definition: LeafNodeBool.h:364
static Index coordToOffset(const Coord &xyz)
Return the linear table offset of the given global or local coordinates.
Definition: LeafNode.h:1040
Index64 memUsage() const
Return the memory in bytes occupied by this node.
Definition: LeafNode.h:1459
void set(Index32 n, bool On)
Set the nth bit to the specified state.
Definition: NodeMasks.h:462
DenseIter(const MaskDenseIter &iter, NodeT *parent)
Definition: LeafNodeBool.h:663
bool operator==(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Equality operator, does exact floating point comparisons.
Definition: Vec3.h:474
typename NodeMaskType::OffIterator MaskOffIter
Definition: LeafNodeBool.h:615
void evalActiveBoundingBox(CoordBBox &bbox, bool visitVoxels=true) const
Definition: LeafNode.h:1479
static const Index LOG2DIM
Definition: LeafNode.h:49
DenseIter()
Definition: LeafNodeBool.h:662
const NodeMaskType & getValueMask() const
Definition: LeafNodeBool.h:742
bool operator!=(const LeafNode &other) const
Definition: LeafNode.h:204
ChildOffCIter cendChildOff() const
Definition: LeafNodeBool.h:728
DenseIter< const LeafNode, const bool > ChildAllCIter
Definition: LeafNodeBool.h:691
CombineArgs & setBRef(const BValueType &b)
Redirect the B value to a new external source.
Definition: Types.h:623
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:1133
void writeBuffers(std::ostream &os, bool toHalf=false) const
Write buffers to a stream.
Definition: LeafNode.h:1432
Definition: NodeMasks.h:208
ValueOnIter endValueOn()
Definition: LeafNodeBool.h:705
static bool hasActiveTiles()
Return false since leaf nodes never contain tiles.
Definition: LeafNodeBool.h:313
CombineArgs & setARef(const AValueType &a)
Redirect the A value to a new external source.
Definition: Types.h:621
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:1727
std::shared_ptr< T > SharedPtr
Definition: Types.h:114
void getOrigin(Coord &origin) const
Return the grid index coordinates of this node's local origin.
Definition: LeafNodeBool.h:181
void addLeaf(LeafNode *)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:557
bool isZero(const Type &x)
Return true if x is exactly equal to zero.
Definition: Math.h:337
const LeafNode * probeLeaf(const Coord &) const
Return a const pointer to this node.
Definition: LeafNodeBool.h:594
#define OPENVDB_ASSERT(X)
Definition: Assert.h:41
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:1497
ChildOnCIter endChildOn() const
Definition: LeafNodeBool.h:726
ChildOffCIter cbeginChildOff() const
Definition: LeafNodeBool.h:718
ChildAllCIter endChildAll() const
Definition: LeafNodeBool.h:732
void setActiveStateUnsafe(Index offset, bool on)
Set the active state of the voxel at the given offset but don't change its value. ...
Definition: LeafNodeBool.h:481
ValueAllIter beginValueAll()
Definition: LeafNodeBool.h:701
const NodeT * probeConstNode(const Coord &) const
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:565
uint32_t countOn(uint64_t v)
Definition: Util.h:622
ValueOnCIter cbeginValueOn() const
Definition: LeafNodeBool.h:693
void writeTopology(std::ostream &os, bool toHalf=false) const
Write out just the topology.
Definition: LeafNode.h:1306
static const Index NUM_VALUES
Definition: LeafNode.h:52
bool ValueType
Definition: LeafNodeBool.h:34
const LeafNode * probeConstLeaf(const Coord &) const
Return a const pointer to this node.
Definition: LeafNodeBool.h:597
void stealNodes(ArrayT &, const ValueType &, bool)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:567
ChildOnCIter cbeginChildOn() const
Definition: LeafNodeBool.h:715
ChildOffIter beginChildOff()
Definition: LeafNodeBool.h:720
ChildIter()
Definition: LeafNodeBool.h:650
NodeMaskType & getValueMask()
Definition: LeafNodeBool.h:744
void setValue(Index i, const ValueType &)
Set the i'th value of this buffer to the specified value.
Definition: LeafBuffer.h:233
Definition: Exceptions.h:13
bool isValueMaskOff(Index n) const
Definition: LeafNodeBool.h:740
bool isEmpty() const
Return true if this node has no active voxels.
Definition: LeafNodeBool.h:151
ChildIter< MaskOffIter, const LeafNode > ChildOffCIter
Definition: LeafNodeBool.h:689
ValueOffCIter beginValueOff() const
Definition: LeafNodeBool.h:697
void setItem(Index pos, bool value) const
Definition: LeafNodeBool.h:633
NodeT * probeNodeAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: LeafNodeBool.h:584
Index medianOn(ValueType &value, ValueType *tmp=nullptr) const
Computes the median value of all the active voxels in this node.
Definition: LeafNode.h:1559
Index32 countOn() const
Return the total number of on bits.
Definition: NodeMasks.h:443
void setValueMaskOff(Index n)
Definition: LeafNodeBool.h:752
LeafNode * probeLeaf(const Coord &)
Return a pointer to this node.
Definition: LeafNodeBool.h:580
Index64 onLeafVoxelCount() const
Definition: LeafNodeBool.h:145
void setValueMask(Index n, bool on)
Definition: LeafNodeBool.h:750
void unsetItem(Index pos, const ValueT &val) const
Definition: LeafNodeBool.h:676
void nodeCount(std::vector< Index64 > &) const
no-op
Definition: LeafNodeBool.h:136
static Index getLevel()
Definition: LeafNodeBool.h:130
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 dim()
Return the number of voxels in each dimension.
Definition: LeafNodeBool.h:127
static Index getValueLevel(const Coord &)
Return the level (0) at which leaf node values reside.
Definition: LeafNodeBool.h:251
std::string str() const
Return a string representation of this node.
Definition: LeafNode.h:1027
bool isOn(Index32 n) const
Return true if the nth bit is on.
Definition: NodeMasks.h:502
LeafNode * touchLeafAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: LeafNodeBool.h:579
ChildOffIter endChildOff()
Definition: LeafNodeBool.h:730
static Index64 offTileCount()
Definition: LeafNodeBool.h:148
bool isValueMaskOff() const
Definition: LeafNodeBool.h:741
void setValueOnUnsafe(Index offset)
Mark the voxel at the given offset as active but don't change its value.
Definition: LeafNodeBool.h:485
bool isConstant(bool &isOn) const
Definition: NodeMasks.h:526
void denseFill(const CoordBBox &bbox, bool val, bool on=true)
Set all voxels within an axis-aligned box to the specified value and active state.
Definition: LeafNodeBool.h:321
ValueOnCIter cendValueOn() const
Definition: LeafNodeBool.h:703
void addTileAndCache(Index, const Coord &, const ValueType &, bool, AccessorT &)
Definition: LeafNode.h:1627
ValueAllCIter beginValueAll() const
Definition: LeafNodeBool.h:700
ChildIter< MaskOffIter, LeafNode > ChildOffIter
Definition: LeafNodeBool.h:688
void setValue(bool value) const
Definition: LeafNodeBool.h:635
const bool & getLastValue() const
Return a const reference to the last entry in the buffer.
Definition: LeafNodeBool.h:437
ValueIter< MaskDenseIter, const LeafNode, const bool > ValueAllCIter
Definition: LeafNodeBool.h:685
typename BaseT::NonConstValueType NonConstValueT
Definition: LeafNodeBool.h:660
void prune(const ValueType &=zeroVal< ValueType >())
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:556
bool isValueMaskOn(Index n) const
Definition: LeafNodeBool.h:738
Index64 memUsageIfLoaded() const
Definition: LeafNode.h:1469
ValueOffCIter cendValueOff() const
Definition: LeafNodeBool.h:706
static Index getValueLevelAndCache(const Coord &, AccessorT &)
Return the LEVEL (=0) at which leaf node values reside.
Definition: LeafNodeBool.h:428
static void getNodeLog2Dims(std::vector< Index > &dims)
Definition: LeafNodeBool.h:131
static Index getChildDim()
Definition: LeafNodeBool.h:132
static Index64 leafCount()
Definition: LeafNodeBool.h:134
const LeafNode * probeLeafAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: LeafNodeBool.h:596
bool probeValue(const Coord &xyz, ValueType &val) const
Return true if the voxel at the given coordinates is active.
Definition: LeafNode.h:1091
OnIterator beginOn() const
Definition: NodeMasks.h:352
OffIterator beginOff() const
Definition: NodeMasks.h:354
typename NodeMaskType::DenseIterator MaskDenseIter
Definition: LeafNodeBool.h:616
const NodeMaskType & getValueMask() const
Definition: LeafNode.h:884
uint32_t Index32
Definition: Types.h:52
ValueOffIter endValueOff()
Definition: LeafNodeBool.h:708
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
void getNodes(ArrayT &) const
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:566
ChildIter(const MaskIterT &iter, NodeT *parent)
Definition: LeafNodeBool.h:651
Coord offsetToGlobalCoord(Index n) const
Return the global coordinates for a linear table offset.
Definition: LeafNode.h:1064
Index64 offLeafVoxelCount() const
Definition: LeafNodeBool.h:146
OPENVDB_API const void * getGridBackgroundValuePtr(std::ios_base &)
Return a pointer to the background value of the grid currently being read from or written to the give...
bool isConstant(ValueType &firstValue, bool &state, const ValueType &tolerance=zeroVal< ValueType >()) const
Definition: LeafNode.h:1505
NodeT * probeNode(const Coord &)
This function exists only to enable template instantiation.
Definition: LeafNodeBool.h:563
ChildOnCIter beginChildOn() const
Definition: LeafNodeBool.h:716
Index32 countOff() const
Return the total number of on bits.
Definition: NodeMasks.h:450
const bool & getValueUnsafe(Index offset) const
Return the value of the voxel at the given offset.
Definition: LeafNodeBool.h:477
void topologyUnion(const LeafNode< OtherType, Log2Dim > &other, const bool preserveTiles=false)
Union this node's set of active values with the active values of the other node, whose ValueType may ...
Definition: LeafNode.h:1710
void modifyItem(Index n, const ModifyOp &op) const
Definition: LeafNodeBool.h:639
void clip(const CoordBBox &, const ValueType &background)
Set all voxels that lie outside the given axis-aligned box to the background.
Definition: LeafNode.h:1151
bool isChildMaskOn(Index) const
Definition: LeafNodeBool.h:746
void setValuesOn()
Mark all voxels as active but don't change their values.
Definition: LeafNodeBool.h:299
typename std::remove_const< UnsetItemT >::type NonConstValueType
Definition: Iterator.h:184
ChildAllCIter cendChildAll() const
Definition: LeafNodeBool.h:731
void modifyValue(const ModifyOp &op) const
Definition: LeafNodeBool.h:642
void getOrigin(Int32 &x, Int32 &y, Int32 &z) const
Return the grid index coordinates of this node's local origin.
Definition: LeafNodeBool.h:182
const NodeMaskType & valueMask() const
Definition: LeafNode.h:886
void setValueMaskOn(Index n)
Definition: LeafNodeBool.h:751
bool isAllocated() const
Return true if memory for this node's buffer has been allocated.
Definition: LeafNodeBool.h:157
static void evalNodeOrigin(Coord &xyz)
Compute the origin of the leaf node that contains the voxel with the given coordinates.
Definition: LeafNodeBool.h:755
bool isValueMaskOn() const
Definition: LeafNodeBool.h:739
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
static Index size()
Definition: LeafNodeBool.h:128
OPENVDB_API uint32_t getFormatVersion(std::ios_base &)
Return the file format version number associated with the given input stream.
Tag dispatch class that distinguishes topology copy constructors from deep copy constructors.
Definition: Types.h:683
bool isChildMaskOff(Index) const
Definition: LeafNodeBool.h:747
Index medianOff(ValueType &value, ValueType *tmp=nullptr) const
Computes the median value of all the inactive voxels in this node.
Definition: LeafNode.h:1583
bool isDense() const
Return true if this node only contains active voxels.
Definition: LeafNodeBool.h:153
ChildOnIter beginChildOn()
Definition: LeafNodeBool.h:717
bool isValueOn(Index offset) const
Return true if the voxel at the given offset is active.
Definition: LeafNodeBool.h:306
~LeafNode()
Destructor.
Definition: LeafNode.h:1020
void load(std::istream &is)
Definition: NodeMasks.h:569
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h.in:121
ValueAllCIter endValueAll() const
Definition: LeafNodeBool.h:710
void save(std::ostream &os) const
Definition: NodeMasks.h:565
void setOff(Index32 n)
Set the nth bit off.
Definition: NodeMasks.h:457
ValueIter(const MaskIterT &iter, NodeT *parent)
Definition: LeafNodeBool.h:627
void combine2(const LeafNode &other, const OtherType &, bool valueIsActive, CombineOp &)
Definition: LeafNode.h:1791
ValueType combine(const ValueType &v0, const ValueType &v1, const ValueType &v2, const openvdb::Vec3d &w)
Combine different value types.
Definition: AttributeTransferUtil.h:141
ChildAllIter beginChildAll()
Definition: LeafNodeBool.h:723
Definition: PointDataGrid.h:171
Buffer & buffer()
Definition: LeafNodeBool.h:217
Base class for dense iterators over internal and leaf nodes.
Definition: Iterator.h:178
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 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:261
CoordBBox getNodeBoundingBox() const
Return the bounding box of this node, i.e., the full index space spanned by this leaf node...
Definition: LeafNodeBool.h:174
void fill(const ValueType &)
Populate this buffer with a constant value.
Definition: LeafBuffer.h:275
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:1191
Index32 transientData() const
Return the transient data value.
Definition: LeafNodeBool.h:194
ChildOnCIter cendChildOn() const
Definition: LeafNodeBool.h:725
bool isOff(Index32 n) const
Return true if the nth bit is off.
Definition: NodeMasks.h:508
bool operator!=(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Inequality operator, does exact floating point comparisons.
Definition: Vec3.h:482
ChildOnIter endChildOn()
Definition: LeafNodeBool.h:727
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h.in:218
Base class for sparse iterators over internal and leaf nodes.
Definition: Iterator.h:114
bool isInactive() const
Return true if all of this node's values are inactive.
Definition: LeafNodeBool.h:468
const NodeT * probeConstNodeAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: LeafNodeBool.h:601
Tag dispatch class that distinguishes constructors during file input.
Definition: Types.h:689
ValueIter< MaskOffIter, const LeafNode, const bool > ValueOffCIter
Definition: LeafNodeBool.h:683
const Buffer & buffer() const
Definition: LeafNodeBool.h:216