8#ifndef OPENVDB_TREE_INTERNALNODE_HAS_BEEN_INCLUDED
9#define OPENVDB_TREE_INTERNALNODE_HAS_BEEN_INCLUDED
16#include <openvdb/version.h>
20#include <tbb/parallel_for.h>
30template<
typename, Index,
typename>
struct SameInternalConfig;
33template<
typename _ChildNodeType, Index Log2Dim>
39 using ValueType =
typename ChildNodeType::ValueType;
40 using BuildType =
typename ChildNodeType::BuildType;
46 TOTAL = Log2Dim + ChildNodeType::TOTAL,
49 LEVEL = 1 + ChildNodeType::LEVEL;
55 template<
typename OtherValueType>
58 OtherValueType>
::Type, Log2Dim>;
64 template<
typename OtherNodeType>
99 template<
typename OtherChildNodeType>
105 template<
typename OtherChildNodeType>
112 template<
typename OtherChildNodeType>
131 template<
typename NodeT,
typename ChildT,
typename MaskIterT,
typename TagT>
133 MaskIterT, ChildIter<NodeT, ChildT, MaskIterT, TagT>, NodeT, ChildT>
142 return *(this->
parent().getChildNode(
pos));
152 template<
typename NodeT,
typename ValueT,
typename MaskIterT,
typename TagT>
154 MaskIterT, ValueIter<NodeT, ValueT, MaskIterT, TagT>, NodeT, ValueT>
166 template<
typename ModifyOp>
174 template<
typename NodeT,
typename ChildT,
typename ValueT,
typename TagT>
176 MaskDenseIterator, DenseIter<NodeT, ChildT, ValueT, TagT>, NodeT, ChildT, ValueT>
188 child = this->
parent().getChildNode(
pos);
192 value = this->
parent().mNodes[
pos].getValue();
199 this->
parent().resetChildNode(
pos, child);
205 this->
parent().unsetChildNode(
pos, value);
211 using ChildOnIter = ChildIter<InternalNode, ChildNodeType, MaskOnIterator, ChildOn>;
212 using ChildOnCIter = ChildIter<const InternalNode,const ChildNodeType,MaskOnIterator,ChildOn>;
213 using ChildOffIter = ValueIter<InternalNode, const ValueType, MaskOffIterator, ChildOff>;
214 using ChildOffCIter = ValueIter<const InternalNode,const ValueType,MaskOffIterator,ChildOff>;
215 using ChildAllIter = DenseIter<InternalNode, ChildNodeType, ValueType, ChildAll>;
216 using ChildAllCIter = DenseIter<const InternalNode,const ChildNodeType, ValueType, ChildAll>;
218 using ValueOnIter = ValueIter<InternalNode, const ValueType, MaskOnIterator, ValueOn>;
219 using ValueOnCIter = ValueIter<const InternalNode, const ValueType, MaskOnIterator, ValueOn>;
220 using ValueOffIter = ValueIter<InternalNode, const ValueType, MaskOffIterator, ValueOff>;
221 using ValueOffCIter = ValueIter<const InternalNode,const ValueType,MaskOffIterator,ValueOff>;
222 using ValueAllIter = ValueIter<InternalNode, const ValueType, MaskOffIterator, ValueAll>;
223 using ValueAllCIter = ValueIter<const InternalNode,const ValueType,MaskOffIterator,ValueAll>;
376 template<
typename ModifyOp>
379 template<
typename ModifyOp>
386 template<
typename AccessorT>
393 template<
typename AccessorT>
400 template<
typename AccessorT>
407 template<
typename AccessorT>
415 template<
typename ModifyOp,
typename AccessorT>
422 template<
typename ModifyOp,
typename AccessorT>
429 template<
typename AccessorT>
436 template<
typename AccessorT>
444 template<
typename AccessorT>
453 template<
typename AccessorT>
459#if OPENVDB_ABI_VERSION_NUMBER < 14
463 void writeTopology(std::ostream&,
bool toHalf =
false)
const;
464 void readTopology(std::istream&,
bool fromHalf =
false);
465 void writeBuffers(std::ostream&,
bool toHalf =
false)
const;
466 void readBuffers(std::istream&,
bool fromHalf =
false);
467 void readBuffers(std::istream&,
const CoordBBox&,
bool fromHalf =
false);
586 template<
typename DenseT>
591 template<MergePolicy Policy>
596 template<MergePolicy Policy>
void merge(
const ValueType& tileValue,
bool tileActive);
610 template<
typename OtherChildNodeType>
626 template<
typename OtherChildNodeType>
641 template<
typename OtherChildNodeType>
645 template<
typename CombineOp>
647 template<
typename CombineOp>
650 template<
typename CombineOp,
typename OtherNodeType >
652 template<
typename CombineOp,
typename OtherNodeType >
653 void combine2(
const ValueType& value,
const OtherNodeType& other,
bool valIsActive, CombineOp&);
654 template<
typename CombineOp,
typename OtherValueType>
671 template<
typename AccessorT>
682 template<
typename NodeT>
702 template<
typename AccessorT>
752 template<
typename NodeType,
typename AccessorT>
754 template<
typename NodeType,
typename AccessorT>
769 template<
typename AccessorT>
771 template<
typename AccessorT>
773 template<
typename AccessorT>
787 template<
typename AccessorT>
813 template<
typename ArrayT>
815 template<
typename ArrayT>
842 template<
typename ArrayT>
851 template<
typename OtherChildNodeType, Index OtherLog2Dim>
908 struct VoxelizeActiveTiles;
909 template<
typename OtherInternalNode>
struct DeepCopy;
910 template<
typename OtherInternalNode>
struct TopologyCopy1;
911 template<
typename OtherInternalNode>
struct TopologyCopy2;
912 template<
typename OtherInternalNode>
struct TopologyUnion;
913 template<
typename OtherInternalNode>
struct TopologyDifference;
914 template<
typename OtherInternalNode>
struct TopologyIntersection;
932template<
typename ChildT1, Index Dim1,
typename NodeT2>
937template<
typename ChildT1, Index Dim1,
typename ChildT2>
939 static const bool value = ChildT1::template SameConfiguration<ChildT2>::value;
947template<
typename ChildT, Index Log2Dim>
955template<
typename ChildT, Index Log2Dim>
969template<
typename ChildT, Index Log2Dim>
979template<
typename ChildT, Index Log2Dim>
980template<
typename OtherInternalNode>
984 tbb::parallel_for(tbb::blocked_range<Index>(0,
NUM_VALUES), *
this);
988 for (
Index i = r.begin(), end=r.end(); i!=end; ++i) {
989 if (
s->mChildMask.isOff(i)) {
991 t->mNodes[i].setValue(
ValueType(
s->mNodes[i].getValue()));
998 const OtherInternalNode*
s;
1002template<
typename ChildT, Index Log2Dim>
1015template<
typename ChildT, Index Log2Dim>
1016template<
typename OtherChildNodeType>
1027template<
typename ChildT, Index Log2Dim>
1028template<
typename OtherInternalNode>
1032 const ValueType& background) :
s(source),
t(target),
b(background) {
1033 tbb::parallel_for(tbb::blocked_range<Index>(0,
NUM_VALUES), *
this);
1037 for (
Index i = r.begin(), end=r.end(); i!=end; ++i) {
1038 if (
s->isChildMaskOn(i)) {
1042 t->mNodes[i].setValue(
b);
1046 const OtherInternalNode*
s;
1051template<
typename ChildT, Index Log2Dim>
1052template<
typename OtherChildNodeType>
1064template<
typename ChildT, Index Log2Dim>
1065template<
typename OtherInternalNode>
1070 :
s(source),
t(target),
offV(offValue),
onV(onValue) {
1071 tbb::parallel_for(tbb::blocked_range<Index>(0,
NUM_VALUES), *
this);
1074 for (
Index i = r.begin(), end=r.end(); i!=end; ++i) {
1075 if (
s->isChildMaskOn(i)) {
1079 t->mNodes[i].setValue(
s->isValueMaskOn(i) ?
onV :
offV);
1083 const OtherInternalNode*
s;
1088template<
typename ChildT, Index Log2Dim>
1089template<
typename OtherChildNodeType>
1103template<
typename ChildT, Index Log2Dim>
1116template<
typename ChildT, Index Log2Dim>
1120 if (ChildNodeType::getLevel() == 0)
return mChildMask.countOn();
1123 sum +=
iter->leafCount();
1128template<
typename ChildT, Index Log2Dim>
1134 if (ChildNodeType::LEVEL > 0 && count > 0) {
1137 vec[ChildNodeType::LEVEL] += count;
1141template<
typename ChildT, Index Log2Dim>
1146 if (ChildNodeType::getLevel() == 0)
return sum;
1148 sum +=
iter->nonLeafCount();
1154template<
typename ChildT, Index Log2Dim>
1162template<
typename ChildT, Index Log2Dim>
1168 sum +=
iter->onVoxelCount();
1174template<
typename ChildT, Index Log2Dim>
1180 sum +=
iter->offVoxelCount();
1186template<
typename ChildT, Index Log2Dim>
1192 sum +=
mNodes[
iter.pos()].getChild()->onLeafVoxelCount();
1198template<
typename ChildT, Index Log2Dim>
1204 sum +=
mNodes[
iter.pos()].getChild()->offLeafVoxelCount();
1209template<
typename ChildT, Index Log2Dim>
1215 sum +=
iter->onTileCount();
1220template<
typename ChildT, Index Log2Dim>
1227 sum +=
iter->memUsage();
1233template<
typename ChildT, Index Log2Dim>
1237 if (bbox.
isInside(this->getNodeBoundingBox()))
return;
1240 bbox.
expand(i.getCoord(), ChildT::DIM);
1243 i->evalActiveBoundingBox(bbox, visitVoxels);
1251template<
typename ChildT, Index Log2Dim>
1259 ChildT* child =
mNodes[i].getChild();
1260 child->prune(tolerance);
1261 if (child->isConstant(value, state, tolerance)) {
1265 mNodes[i].setValue(value);
1274template<
typename ChildT, Index Log2Dim>
1275template<
typename NodeT>
1279 if ((NodeT::LEVEL == ChildT::LEVEL && !(std::is_same<NodeT, ChildT>::value)) ||
1280 NodeT::LEVEL > ChildT::LEVEL)
return nullptr;
1284 ChildT* child =
mNodes[n].getChild();
1285 if (std::is_same<NodeT, ChildT>::value) {
1288 mNodes[n].setValue(value);
1290 return (std::is_same<NodeT, ChildT>::value)
1291 ?
reinterpret_cast<NodeT*
>(child)
1300template<
typename ChildT, Index Log2Dim>
1301template<
typename NodeT>
1305 if ((NodeT::LEVEL == ChildT::LEVEL && !(std::is_same<NodeT, ChildT>::value)) ||
1306 NodeT::LEVEL > ChildT::LEVEL)
return nullptr;
1310 ChildT* child =
mNodes[n].getChild();
1311 return (std::is_same<NodeT, ChildT>::value)
1312 ?
reinterpret_cast<NodeT*
>(child)
1318template<
typename ChildT, Index Log2Dim>
1319template<
typename NodeT,
typename AccessorT>
1323 if ((NodeT::LEVEL == ChildT::LEVEL && !(std::is_same<NodeT, ChildT>::value)) ||
1324 NodeT::LEVEL > ChildT::LEVEL)
return nullptr;
1328 ChildT* child =
mNodes[n].getChild();
1329 acc.insert(xyz, child);
1330 return (std::is_same<NodeT, ChildT>::value)
1331 ?
reinterpret_cast<NodeT*
>(child)
1337template<
typename ChildT, Index Log2Dim>
1338template<
typename NodeT>
1342 if ((NodeT::LEVEL == ChildT::LEVEL && !(std::is_same<NodeT, ChildT>::value)) ||
1343 NodeT::LEVEL > ChildT::LEVEL)
return nullptr;
1347 const ChildT* child =
mNodes[n].getChild();
1348 return (std::is_same<NodeT, ChildT>::value)
1349 ?
reinterpret_cast<const NodeT*
>(child)
1355template<
typename ChildT, Index Log2Dim>
1356template<
typename NodeT,
typename AccessorT>
1360 if ((NodeT::LEVEL == ChildT::LEVEL && !(std::is_same<NodeT, ChildT>::value)) ||
1361 NodeT::LEVEL > ChildT::LEVEL)
return nullptr;
1365 const ChildT* child =
mNodes[n].getChild();
1366 acc.insert(xyz, child);
1367 return (std::is_same<NodeT, ChildT>::value)
1368 ?
reinterpret_cast<const NodeT*
>(child)
1377template<
typename ChildT, Index Log2Dim>
1385template<
typename ChildT, Index Log2Dim>
1393template<
typename ChildT, Index Log2Dim>
1401template<
typename ChildT, Index Log2Dim>
1409template<
typename ChildT, Index Log2Dim>
1418template<
typename ChildT, Index Log2Dim>
1427template<
typename ChildT, Index Log2Dim>
1433 value =
mNodes[offset].getValue();
1438template<
typename ChildT, Index Log2Dim>
1444 value =
mNodes[offset].getValue();
1453template<
typename ChildT, Index Log2Dim>
1454inline typename ChildT::LeafNodeType*
1461template<
typename ChildT, Index Log2Dim>
1462template<
typename AccessorT>
1463inline typename ChildT::LeafNodeType*
1470template<
typename ChildT, Index Log2Dim>
1471template<
typename AccessorT>
1472inline const typename ChildT::LeafNodeType*
1479template<
typename ChildT, Index Log2Dim>
1480inline const typename ChildT::LeafNodeType*
1487template<
typename ChildT, Index Log2Dim>
1488template<
typename AccessorT>
1489inline const typename ChildT::LeafNodeType*
1499template<
typename ChildT, Index Log2Dim>
1504 const Coord& xyz = leaf->origin();
1506 ChildT* child =
nullptr;
1508 if (ChildT::LEVEL>0) {
1511 child =
reinterpret_cast<ChildT*
>(leaf);
1515 if (ChildT::LEVEL>0) {
1516 child =
mNodes[n].getChild();
1518 delete mNodes[n].getChild();
1519 child =
reinterpret_cast<ChildT*
>(leaf);
1520 mNodes[n].setChild(child);
1523 child->addLeaf(leaf);
1527template<
typename ChildT, Index Log2Dim>
1528template<
typename AccessorT>
1533 const Coord& xyz = leaf->origin();
1535 ChildT* child =
nullptr;
1537 if (ChildT::LEVEL>0) {
1539 acc.insert(xyz, child);
1541 child =
reinterpret_cast<ChildT*
>(leaf);
1545 if (ChildT::LEVEL>0) {
1546 child =
mNodes[n].getChild();
1547 acc.insert(xyz, child);
1549 delete mNodes[n].getChild();
1550 child =
reinterpret_cast<ChildT*
>(leaf);
1551 mNodes[n].setChild(child);
1554 child->addLeafAndCache(leaf, acc);
1561template<
typename ChildT, Index Log2Dim>
1566 const Coord& xyz = child->origin();
1577template<
typename ChildT, Index Log2Dim>
1587template<
typename ChildT, Index Log2Dim>
1592 if (
LEVEL >= level) {
1595 if (
LEVEL > level) {
1598 child->addTile(level, xyz, value, state);
1601 mNodes[n].setValue(value);
1604 ChildT* child =
mNodes[n].getChild();
1605 if (
LEVEL > level) {
1606 child->addTile(level, xyz, value, state);
1611 mNodes[n].setValue(value);
1618template<
typename ChildT, Index Log2Dim>
1619template<
typename AccessorT>
1622 const ValueType& value,
bool state, AccessorT& acc)
1624 if (
LEVEL >= level) {
1627 if (
LEVEL > level) {
1630 acc.insert(xyz, child);
1631 child->addTileAndCache(level, xyz, value, state, acc);
1634 mNodes[n].setValue(value);
1637 ChildT* child =
mNodes[n].getChild();
1638 if (
LEVEL > level) {
1639 acc.insert(xyz, child);
1640 child->addTileAndCache(level, xyz, value, state, acc);
1645 mNodes[n].setValue(value);
1655template<
typename ChildT, Index Log2Dim>
1656inline typename ChildT::LeafNodeType*
1660 ChildT* child =
nullptr;
1665 child =
mNodes[n].getChild();
1667 return child->touchLeaf(xyz);
1671template<
typename ChildT, Index Log2Dim>
1672template<
typename AccessorT>
1673inline typename ChildT::LeafNodeType*
1680 acc.insert(xyz,
mNodes[n].getChild());
1681 return mNodes[n].getChild()->touchLeafAndCache(xyz, acc);
1688template<
typename ChildT, Index Log2Dim>
1695 firstValue =
mNodes[0].getValue();
1708template<
typename ChildT, Index Log2Dim>
1716 minValue = maxValue =
mNodes[0].getValue();
1734template<
typename ChildT, Index Log2Dim>
1739 const bool anyActiveTiles = !
mValueMask.isOff();
1740 if (
LEVEL==1 || anyActiveTiles)
return anyActiveTiles;
1742 if (
iter->hasActiveTiles())
return true;
1749template<
typename ChildT, Index Log2Dim>
1755 :
mNodes[n].getChild()->isValueOn(xyz);
1758template<
typename ChildT, Index Log2Dim>
1764 :
mNodes[n].getChild()->isValueOff(xyz);
1767template<
typename ChildT, Index Log2Dim>
1768template<
typename AccessorT>
1774 acc.insert(xyz,
mNodes[n].getChild());
1775 return mNodes[n].getChild()->isValueOnAndCache(xyz, acc);
1779template<
typename ChildT, Index Log2Dim>
1780inline const typename ChildT::ValueType&
1785 :
mNodes[n].getChild()->getValue(xyz);
1788template<
typename ChildT, Index Log2Dim>
1789template<
typename AccessorT>
1790inline const typename ChildT::ValueType&
1795 acc.insert(xyz,
mNodes[n].getChild());
1796 return mNodes[n].getChild()->getValueAndCache(xyz, acc);
1798 return mNodes[n].getValue();
1802template<
typename ChildT, Index Log2Dim>
1810template<
typename ChildT, Index Log2Dim>
1811template<
typename AccessorT>
1817 acc.insert(xyz,
mNodes[n].getChild());
1818 return mNodes[n].getChild()->getValueLevelAndCache(xyz, acc);
1824template<
typename ChildT, Index Log2Dim>
1830 value =
mNodes[n].getValue();
1833 return mNodes[n].getChild()->probeValue(xyz, value);
1836template<
typename ChildT, Index Log2Dim>
1837template<
typename AccessorT>
1844 acc.insert(xyz,
mNodes[n].getChild());
1845 return mNodes[n].getChild()->probeValueAndCache(xyz, value, acc);
1847 value =
mNodes[n].getValue();
1852template<
typename ChildT, Index Log2Dim>
1864 if (hasChild)
mNodes[n].getChild()->setValueOff(xyz);
1868template<
typename ChildT, Index Log2Dim>
1880 if (hasChild)
mNodes[n].getChild()->setValueOn(xyz);
1884template<
typename ChildT, Index Log2Dim>
1900 if (hasChild)
mNodes[n].getChild()->setValueOff(xyz, value);
1903template<
typename ChildT, Index Log2Dim>
1904template<
typename AccessorT>
1922 ChildT* child =
mNodes[n].getChild();
1923 acc.insert(xyz, child);
1924 child->setValueOffAndCache(xyz, value, acc);
1929template<
typename ChildT, Index Log2Dim>
1945 if (hasChild)
mNodes[n].getChild()->setValueOn(xyz, value);
1948template<
typename ChildT, Index Log2Dim>
1949template<
typename AccessorT>
1967 acc.insert(xyz,
mNodes[n].getChild());
1968 mNodes[n].getChild()->setValueAndCache(xyz, value, acc);
1973template<
typename ChildT, Index Log2Dim>
1986 if (hasChild)
mNodes[n].getChild()->setValueOnly(xyz, value);
1989template<
typename ChildT, Index Log2Dim>
1990template<
typename AccessorT>
2005 acc.insert(xyz,
mNodes[n].getChild());
2006 mNodes[n].getChild()->setValueOnlyAndCache(xyz, value, acc);
2011template<
typename ChildT, Index Log2Dim>
2026 if (hasChild)
mNodes[n].getChild()->setActiveState(xyz, on);
2029template<
typename ChildT, Index Log2Dim>
2030template<
typename AccessorT>
2046 ChildT* child =
mNodes[n].getChild();
2047 acc.insert(xyz, child);
2048 child->setActiveStateAndCache(xyz, on, acc);
2053template<
typename ChildT, Index Log2Dim>
2059 mNodes[
iter.pos()].getChild()->setValuesOn();
2064template<
typename ChildT, Index Log2Dim>
2065template<
typename ModifyOp>
2075 bool createChild = !active;
2089 if (hasChild)
mNodes[n].getChild()->modifyValue(xyz, op);
2092template<
typename ChildT, Index Log2Dim>
2093template<
typename ModifyOp,
typename AccessorT>
2104 bool createChild = !active;
2120 acc.insert(xyz, child);
2121 child->modifyValueAndCache(xyz, op, acc);
2126template<
typename ChildT, Index Log2Dim>
2127template<
typename ModifyOp>
2136 bool modifiedState = !tileState;
2138 op(modifiedVal, modifiedState);
2146 if (hasChild)
mNodes[n].getChild()->modifyValueAndActiveState(xyz, op);
2149template<
typename ChildT, Index Log2Dim>
2150template<
typename ModifyOp,
typename AccessorT>
2153 const Coord& xyz,
const ModifyOp& op, AccessorT& acc)
2160 bool modifiedState = !tileState;
2162 op(modifiedVal, modifiedState);
2172 acc.insert(xyz, child);
2173 child->modifyValueAndActiveStateAndCache(xyz, op, acc);
2181template<
typename ChildT, Index Log2Dim>
2188 this->
fill(nodeBBox, background,
false);
2189 }
else if (clipBBox.
isInside(nodeBBox)) {
2206 }
else if (!clipBBox.
isInside(tileBBox)) {
2210 mNodes[pos].getChild()->clip(clipBBox, background);
2217 mNodes[pos].setValue(background);
2219 this->
fill(tileBBox, val, on);
2231template<
typename ChildT, Index Log2Dim>
2236 clippedBBox.intersect(bbox);
2237 if (!clippedBBox)
return;
2241 Coord xyz, tileMin, tileMax;
2242 for (
int x = clippedBBox.min().x(); x <= clippedBBox.max().x(); x = tileMax.
x() + 1) {
2244 for (
int y = clippedBBox.min().y(); y <= clippedBBox.max().y(); y = tileMax.
y() + 1) {
2246 for (
int z = clippedBBox.min().z(); z <= clippedBBox.max().z(); z = tileMax.
z() + 1) {
2252 tileMax = tileMin.
offsetBy(ChildT::DIM - 1);
2258 ChildT* child =
nullptr;
2265 child =
mNodes[n].getChild();
2271 child->fill(
CoordBBox(xyz, tmp), value, active);
2287template<
typename ChildT, Index Log2Dim>
2292 clippedBBox.intersect(bbox);
2293 if (!clippedBBox)
return;
2297 Coord xyz, tileMin, tileMax;
2298 for (
int x = clippedBBox.min().x(); x <= clippedBBox.max().x(); x = tileMax.
x() + 1) {
2300 for (
int y = clippedBBox.min().y(); y <= clippedBBox.max().y(); y = tileMax.
y() + 1) {
2302 for (
int z = clippedBBox.min().z(); z <= clippedBBox.max().z(); z = tileMax.
z() + 1) {
2309 ChildT* child =
nullptr;
2311 child =
mNodes[n].getChild();
2321 tileMax = tileMin.
offsetBy(ChildT::DIM - 1);
2324 child->denseFill(
CoordBBox{xyz, clippedBBox.
max()}, value, active);
2334template<
typename ChildT, Index Log2Dim>
2335template<
typename DenseT>
2339 using DenseValueType =
typename DenseT::ValueType;
2341 const size_t xStride = dense.xStride(), yStride = dense.yStride(), zStride = dense.zStride();
2342 const Coord& min = dense.bbox().min();
2343 for (
Coord xyz = bbox.
min(), max; xyz[0] <= bbox.
max()[0]; xyz[0] = max[0] + 1) {
2344 for (xyz[1] = bbox.
min()[1]; xyz[1] <= bbox.
max()[1]; xyz[1] = max[1] + 1) {
2345 for (xyz[2] = bbox.
min()[2]; xyz[2] <= bbox.
max()[2]; xyz[2] = max[2] + 1) {
2354 mNodes[n].getChild()->copyToDense(sub, dense);
2358 DenseValueType* a0 = dense.data() + zStride*sub.
min()[2];
2359 for (
Int32 x=sub.
min()[0], ex=sub.
max()[0]+1; x<ex; ++x) {
2360 DenseValueType* a1 = a0 + x*xStride;
2361 for (
Int32 y=sub.
min()[1], ey=sub.
max()[1]+1; y<ey; ++y) {
2362 DenseValueType* a2 = a1 + y*yStride;
2364 z < ez; ++z, a2 += zStride)
2366 *a2 = DenseValueType(value);
2380#if OPENVDB_ABI_VERSION_NUMBER < 14
2382template<
typename ChildT, Index Log2Dim>
2386 mChildMask.save(os);
2387 mValueMask.save(os);
2391 std::unique_ptr<ValueType[]> valuePtr(
new ValueType[NUM_VALUES]);
2392 ValueType* values = valuePtr.get();
2394 for (
Index i = 0; i < NUM_VALUES; ++i) {
2395 values[i] = (mChildMask.isOff(i) ? mNodes[i].getValue() : zero);
2401 for (ChildOnCIter iter = this->cbeginChildOn(); iter; ++iter) {
2402 iter->writeTopology(os, toHalf);
2407template<
typename ChildT, Index Log2Dim>
2416 mChildMask.load(is);
2417 mValueMask.load(is);
2419 const bool oldVersion =
2421 const Index numValues = (oldVersion ? mChildMask.countOff() : NUM_VALUES);
2425 std::unique_ptr<ValueType[]> valuePtr(
new ValueType[numValues]);
2426 ValueType* values = valuePtr.get();
2432 for (ValueAllIter
iter = this->beginValueAll();
iter; ++
iter) {
2433 mNodes[
iter.pos()].setValue(values[n++]);
2437 for (ValueAllIter
iter = this->beginValueAll();
iter; ++
iter) {
2438 mNodes[
iter.pos()].setValue(values[
iter.pos()]);
2444 for (ChildOnIter
iter = this->beginChildOn();
iter; ++
iter) {
2445 ChildNodeType* child =
new ChildNodeType(PartialCreate(),
iter.getCoord(), background);
2446 mNodes[
iter.pos()].setChild(child);
2447 child->readTopology(is, fromHalf);
2457template<
typename ChildT, Index Log2Dim>
2458inline const typename ChildT::ValueType&
2465template<
typename ChildT, Index Log2Dim>
2466inline const typename ChildT::ValueType&
2477template<
typename ChildT, Index Log2Dim>
2478inline const typename ChildT::ValueType&
2483 return mNodes[n].getValue();
2486template<
typename ChildT, Index Log2Dim>
2492 value =
mNodes[n].getValue();
2496template<
typename ChildT, Index Log2Dim>
2502 return mNodes[n].getChild();
2505template<
typename ChildT, Index Log2Dim>
2511 return mNodes[n].getChild();
2514template<
typename ChildT, Index Log2Dim>
2521template<
typename ChildT, Index Log2Dim>
2530template<
typename ChildT, Index Log2Dim>
2536 mNodes[n].setValue(value);
2539template<
typename ChildT, Index Log2Dim>
2548template<
typename ChildT, Index Log2Dim>
2554 mNodes[n].setValue(value);
2558template<
typename ChildT, Index Log2Dim>
2567template<
typename ChildT, Index Log2Dim>
2573 mNodes[n].setValue(value);
2577template<
typename ChildT, Index Log2Dim>
2585template<
typename ChildT, Index Log2Dim>
2592 mNodes[n].setChild(child);
2597template<
typename ChildT, Index Log2Dim>
2605 delete mNodes[n].getChild();
2606 mNodes[n].setChild(child);
2609template<
typename ChildT, Index Log2Dim>
2616 auto* child =
mNodes[n].getChild();
2619 mNodes[n].setValue(value);
2623template<
typename ChildT, Index Log2Dim>
2635template<
typename ChildT, Index Log2Dim>
2641 mNodes[i].getChild()->negate();
2653template<
typename ChildT, Index Log2Dim>
2658 tbb::parallel_for(tbb::blocked_range<Index>(0,
NUM_VALUES), *
this);
2665 for (
Index i = r.begin(), end=r.end(); i!=end; ++i) {
2666 if (
mNode->mChildMask.isOn(i)) {
2667 mNode->mNodes[i].getChild()->voxelizeActiveTiles(
true);
2668 }
else if (
mNode->mValueMask.isOn(i)) {
2669 const Coord &ijk =
mNode->offsetToGlobalCoord(i);
2671 child->voxelizeActiveTiles(
true);
2672 mNode->mNodes[i].setChild(child);
2679template<
typename ChildT, Index Log2Dim>
2691 iter->voxelizeActiveTiles(
false);
2699template<
typename ChildT, Index Log2Dim>
2700template<MergePolicy Policy>
2717 background, otherBackground);
2725 child->resetBackground(otherBackground, background);
2756 child->resetBackground(otherBackground, background);
2777 child->resetBackground(otherBackground, background);
2784 mNodes[n].setChild(child);
2808template<
typename ChildT, Index Log2Dim>
2809template<MergePolicy Policy>
2818 if (!tileActive)
return;
2828 iter.setValue(tileValue);
2839template<
typename ChildT, Index Log2Dim>
2840template<
typename OtherInternalNode>
2845 { tV = (tV | sV) & ~tC; }
2850 tbb::parallel_for(tbb::blocked_range<Index>(0,
NUM_VALUES), *
this);
2854 else t->mChildMask |= (
s->mChildMask & !
t->mValueMask);
2857 t->mValueMask.foreach(
s->mValueMask,
t->mChildMask, op);
2861 for (
Index i = r.begin(), end=r.end(); i!=end; ++i) {
2862 if (
s->mChildMask.isOn(i)) {
2863 const typename OtherInternalNode::ChildNodeType& other = *(
s->mNodes[i].getChild());
2864 if (
t->mChildMask.isOn(i)) {
2868 ChildT* child =
new ChildT(other,
t->mNodes[i].getValue(),
TopologyCopy());
2869 if (
t->mValueMask.isOn(i)) child->setValuesOn();
2870 t->mNodes[i].setChild(child);
2873 }
else if (
s->mValueMask.isOn(i) &&
t->mChildMask.isOn(i)) {
2874 t->mNodes[i].getChild()->setValuesOn();
2878 const OtherInternalNode*
s;
2883template<
typename ChildT, Index Log2Dim>
2884template<
typename OtherChildT>
2888 TopologyUnion<InternalNode<OtherChildT, Log2Dim> > tmp(&other,
this, preserveTiles);
2891template<
typename ChildT, Index Log2Dim>
2892template<
typename OtherInternalNode>
2897 { tC = (tC & (sC | sV)) | (tV & sC); }
2900 const ValueType& background) :
s(source),
t(target),
b(background) {
2902 tbb::parallel_for(tbb::blocked_range<Index>(0,
NUM_VALUES), *
this);
2906 t->mChildMask.foreach(
s->mChildMask,
s->mValueMask,
t->mValueMask, op);
2908 t->mValueMask &=
s->mValueMask;
2912 for (
Index i = r.begin(), end=r.end(); i!=end; ++i) {
2913 if (
t->mChildMask.isOn(i)) {
2914 ChildT* child =
t->mNodes[i].getChild();
2915 if (
s->mChildMask.isOn(i)) {
2916 child->topologyIntersection(*(
s->mNodes[i].getChild()),
b);
2917 }
else if (
s->mValueMask.isOff(i)) {
2919 t->mNodes[i].setValue(
b);
2921 }
else if (
t->mValueMask.isOn(i) &&
s->mChildMask.isOn(i)) {
2922 t->mNodes[i].setChild(
new ChildT(*(
s->mNodes[i].getChild()),
2927 const OtherInternalNode*
s;
2932template<
typename ChildT, Index Log2Dim>
2933template<
typename OtherChildT>
2938 TopologyIntersection<InternalNode<OtherChildT, Log2Dim> > tmp(&other,
this, background);
2941template<
typename ChildT, Index Log2Dim>
2942template<
typename OtherInternalNode>
2947 { tC = (tC & (sC | ~sV)) | (tV & sC); }
2950 { tV &= ~((tC & sV) | (sC | sV)); }
2953 const ValueType& background) :
s(source),
t(target),
b(background) {
2955 tbb::parallel_for(tbb::blocked_range<Index>(0,
NUM_VALUES), *
this);
2960 t->mChildMask.foreach(
s->mChildMask,
s->mValueMask,
t->mValueMask, op1);
2963 t->mValueMask.foreach(
t->mChildMask,
s->mValueMask, oldChildMask, op2);
2967 for (
Index i = r.begin(), end=r.end(); i!=end; ++i) {
2968 if (
t->mChildMask.isOn(i)) {
2969 ChildT* child =
t->mNodes[i].getChild();
2970 if (
s->mChildMask.isOn(i)) {
2971 child->topologyDifference(*(
s->mNodes[i].getChild()),
b);
2972 }
else if (
s->mValueMask.isOn(i)) {
2974 t->mNodes[i].setValue(
b);
2976 }
else if (
t->mValueMask.isOn(i)) {
2977 if (
s->mChildMask.isOn(i)) {
2978 const typename OtherInternalNode::ChildNodeType& other =
2979 *(
s->mNodes[i].getChild());
2980 ChildT* child =
new ChildT(other.origin(),
t->mNodes[i].getValue(),
true);
2981 child->topologyDifference(other,
b);
2982 t->mNodes[i].setChild(child);
2987 const OtherInternalNode*
s;
2992template<
typename ChildT, Index Log2Dim>
2993template<
typename OtherChildT>
2998 TopologyDifference<InternalNode<OtherChildT, Log2Dim> > tmp(&other,
this, background);
3005template<
typename ChildT, Index Log2Dim>
3006template<
typename CombineOp>
3051 *child =
mNodes[i].getChild(),
3055 if (child && otherChild) {
3056 child->combine(*otherChild, op);
3063template<
typename ChildT, Index Log2Dim>
3064template<
typename CombineOp>
3076 .setBIsActive(valueIsActive));
3083 if (child) child->combine(value, valueIsActive, op);
3092template<
typename ChildT, Index Log2Dim>
3093template<
typename CombineOp,
typename OtherNodeType>
3104 .
setBRef(other1.mNodes[i].getValue())
3114 : other1.mNodes[i].getChild()->origin();
3123 }
else if (other1.isChildMaskOff(i)) {
3127 other1.mNodes[i].getValue(), other1.isValueMaskOn(i), op);
3132 *other1.mNodes[i].getChild(), op);
3139template<
typename ChildT, Index Log2Dim>
3140template<
typename CombineOp,
typename OtherNodeType>
3143 bool valueIsActive, CombineOp& op)
3148 if (other.isChildMaskOff(i)) {
3151 .
setBRef(other.mNodes[i].getValue())
3157 typename OtherNodeType::ChildNodeType* otherChild = other.mNodes[i].getChild();
3166 mNodes[i].getChild()->combine2(value, *otherChild, valueIsActive, op);
3172template<
typename ChildT, Index Log2Dim>
3173template<
typename CombineOp,
typename OtherValueType>
3176 bool valueIsActive, CombineOp& op)
3199 mNodes[i].getChild()->combine2(*otherChild, value, valueIsActive, op);
3208#if OPENVDB_ABI_VERSION_NUMBER < 14
3210template<
typename ChildT, Index Log2Dim>
3214 for (ChildOnCIter
iter = this->cbeginChildOn();
iter; ++
iter) {
3215 iter->writeBuffers(os, toHalf);
3220template<
typename ChildT, Index Log2Dim>
3222InternalNode<ChildT, Log2Dim>::readBuffers(std::istream& is,
bool fromHalf)
3224 for (ChildOnIter iter = this->beginChildOn(); iter; ++iter) {
3225 iter->readBuffers(is, fromHalf);
3230template<
typename ChildT, Index Log2Dim>
3233 const CoordBBox& clipBBox,
bool fromHalf)
3235 for (ChildOnIter
iter = this->beginChildOn();
iter; ++
iter) {
3240 iter->readBuffers(is, clipBBox, fromHalf);
3246 background = *
static_cast<const ValueType*
>(bgPtr);
3248 this->
clip(clipBBox, background);
3257template<
typename ChildT, Index Log2Dim>
3261 dims.push_back(Log2Dim);
3262 ChildNodeType::getNodeLog2Dims(dims);
3266template<
typename ChildT, Index Log2Dim>
3271 xyz.
setX(n >> 2*Log2Dim);
3272 n &= ((1<<2*Log2Dim)-1);
3273 xyz.
setY(n >> Log2Dim);
3274 xyz.
setZ(n & ((1<<Log2Dim)-1));
3278template<
typename ChildT, Index Log2Dim>
3282 return (((xyz[0] & (
DIM-1u)) >> ChildNodeType::TOTAL) << 2*Log2Dim)
3283 + (((xyz[1] & (
DIM-1u)) >> ChildNodeType::TOTAL) << Log2Dim)
3284 + ((xyz[2] & (
DIM-1u)) >> ChildNodeType::TOTAL);
3288template<
typename ChildT, Index Log2Dim>
3294 local <<= ChildT::TOTAL;
3295 return local + this->
origin();
3302template<
typename ChildT, Index Log2Dim>
3303template<
typename ArrayT>
3307 using T =
typename ArrayT::value_type;
3308 static_assert(std::is_pointer<T>::value,
"argument to getNodes() must be a pointer array");
3309 using ArrayChildT =
typename std::conditional<
3310 std::is_const<typename std::remove_pointer<T>::type>::value,
const ChildT, ChildT>::type;
3313 if (std::is_same<T, ArrayChildT*>::value) {
3314 array.push_back(
reinterpret_cast<T
>(
mNodes[
iter.pos()].getChild()));
3316 iter->getNodes(array);
3322template<
typename ChildT, Index Log2Dim>
3323template<
typename ArrayT>
3327 using T =
typename ArrayT::value_type;
3328 static_assert(std::is_pointer<T>::value,
"argument to getNodes() must be a pointer array");
3329 static_assert(std::is_const<typename std::remove_pointer<T>::type>::value,
3330 "argument to getNodes() must be an array of const node pointers");
3333 if (std::is_same<T, const ChildT*>::value) {
3334 array.push_back(
reinterpret_cast<T
>(
mNodes[
iter.pos()].getChild()));
3336 iter->getNodes(array);
3346template<
typename ChildT, Index Log2Dim>
3347template<
typename ArrayT>
3351 using T =
typename ArrayT::value_type;
3352 static_assert(std::is_pointer<T>::value,
"argument to stealNodes() must be a pointer array");
3353 using ArrayChildT =
typename std::conditional<
3354 std::is_const<typename std::remove_pointer<T>::type>::value,
const ChildT, ChildT>::type;
3358 if (std::is_same<T, ArrayChildT*>::value) {
3359 array.push_back(
reinterpret_cast<T
>(
mNodes[n].getChild()));
3361 mNodes[n].setValue(value);
3363 iter->stealNodes(array, value, state);
3366 if (std::is_same<T, ArrayChildT*>::value)
mChildMask.setOff();
3374template<
typename ChildT, Index Log2Dim>
3382 mNodes[i].getChild()->resetBackground(oldBackground, newBackground);
3385 mNodes[i].setValue(newBackground);
3393template<
typename ChildT, Index Log2Dim>
3394template<
typename OtherChildNodeType, Index OtherLog2Dim>
3408template<
typename ChildT, Index Log2Dim>
3414 delete mNodes[i].getChild();
3419 mNodes[i].setChild(child);
3422template<
typename ChildT, Index Log2Dim>
3430 mNodes[i].setChild(child);
3434template<
typename ChildT, Index Log2Dim>
3439 mNodes[i].setValue(value);
3444 mNodes[i].setValue(value);
3449template<
typename ChildT, Index Log2Dim>
3456template<
typename ChildT, Index Log2Dim>
3461 return mNodes[n].getChild();
3465template<
typename ChildT, Index Log2Dim>
3470 return mNodes[n].getChild();
#define OPENVDB_ASSERT(X)
Definition Assert.h:41
This struct collects both input and output arguments to "grid combiner" functors used with the tree::...
Definition Types.h:640
CombineArgs & setARef(const AValueType &a)
Redirect the A value to a new external source.
Definition Types.h:692
const AValueType & result() const
Get the output value.
Definition Types.h:684
CombineArgs & setBIsActive(bool b)
Set the active state of the B value.
Definition Types.h:708
CombineArgs & setBRef(const BValueType &b)
Redirect the B value to a new external source.
Definition Types.h:694
bool resultIsActive() const
Definition Types.h:703
CombineArgs & setAIsActive(bool b)
Set the active state of the A value.
Definition Types.h:706
static CoordBBox createCube(const Coord &min, ValueType dim)
Definition Coord.h:316
void minComponent(const Coord &other)
Perform a component-wise minimum with the other Coord.
Definition Coord.h:176
static bool lessThan(const Coord &a, const Coord &b)
Definition Coord.h:209
Tag dispatch class that distinguishes constructors during file input.
Definition Types.h:760
Tag dispatch class that distinguishes topology copy constructors from deep copy constructors.
Definition Types.h:754
Axis-aligned bounding box of signed integer coordinates.
Definition Coord.h:252
void translate(const Coord &t)
Translate this bounding box by (tx, ty, tz).
Definition Coord.h:461
void expand(ValueType padding)
Pad this bounding box with the specified padding.
Definition Coord.h:421
const Coord & min() const
Definition Coord.h:324
bool hasOverlap(const CoordBBox &b) const
Return true if the given bounding box overlaps with this bounding box.
Definition Coord.h:415
const Coord & max() const
Definition Coord.h:325
bool isInside(const Coord &xyz) const
Return true if point (x, y, z) is inside this bounding box.
Definition Coord.h:403
void intersect(const CoordBBox &bbox)
Intersect this bounding box with the given bounding box.
Definition Coord.h:447
Signed (x, y, z) 32-bit integer coordinates.
Definition Coord.h:26
Int32 y() const
Definition Coord.h:132
Coord offsetBy(Int32 dx, Int32 dy, Int32 dz) const
Definition Coord.h:92
Int32 x() const
Definition Coord.h:131
Coord & setZ(Int32 z)
Definition Coord.h:82
Coord & setY(Int32 y)
Definition Coord.h:81
static Coord max()
Return the largest possible coordinate.
Definition Coord.h:47
Int32 z() const
Definition Coord.h:133
Coord & setX(Int32 x)
Definition Coord.h:80
Definition InternalNode.h:35
void setValueAndCache(const Coord &xyz, const ValueType &value, AccessorT &)
Definition InternalNode.h:1951
ChildNodeType * getChildUnsafe(Index offset)
Return the child node at offset.
Definition InternalNode.h:2498
bool isValueOn(Index offset) const
Return true if the voxel at the given offset is active.
Definition InternalNode.h:338
void merge(InternalNode &other, const ValueType &background, const ValueType &otherBackground)
Efficiently merge another tree into this tree using one of several schemes.
Definition InternalNode.h:2702
ChildOnCIter cbeginChildOn() const
Definition InternalNode.h:225
const ValueType & getFirstValue() const
If the first entry in this node's table is a tile, return the tile's value. Otherwise,...
Definition InternalNode.h:2459
CoordBBox getNodeBoundingBox() const
Return the bounding box of this node, i.e., the full index space spanned by the node regardless of it...
Definition InternalNode.h:302
bool isConstant(ValueType &minValue, ValueType &maxValue, bool &state, const ValueType &tolerance=zeroVal< ValueType >()) const
Definition InternalNode.h:1710
ValueIter< const InternalNode, const ValueType, MaskOffIterator, ValueOff > ValueOffCIter
Definition InternalNode.h:221
ChildNodeType * probeChildUnsafe(Index offset, ValueType &value, bool &active)
Return a pointer to the child node for a specific offset. If no such node exists, return nullptr.
Definition InternalNode.h:1429
ChildOnCIter beginChildOn() const
Definition InternalNode.h:228
ValueIter< InternalNode, const ValueType, MaskOffIterator, ValueAll > ValueAllIter
Definition InternalNode.h:222
const ChildNodeType * probeConstChildUnsafe(Index offset) const
Definition InternalNode.h:1420
ChildOnIter beginChildOn()
Definition InternalNode.h:231
NodeType * probeNode(const Coord &xyz)
Return a pointer to the node that contains voxel (x, y, z). If no such node exists,...
const NodeType * probeNode(const Coord &xyz) const
Definition InternalNode.h:710
bool isChildMaskOff(Index n) const
Definition InternalNode.h:874
bool isValueOn(const Coord &xyz) const
Return true if the voxel at the given coordinates is active.
Definition InternalNode.h:1751
const ValueType & getValueUnsafe(Index offset) const
Return the tile value at offset.
Definition InternalNode.h:2479
const ChildNodeType * probeChildUnsafe(Index offset, ValueType &value, bool &active) const
Definition InternalNode.h:746
util::NodeMask< Log2Dim > NodeMaskType
Definition InternalNode.h:42
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 InternalNode.h:2337
void setChildNode(Index i, ChildNodeType *child)
Definition InternalNode.h:3424
bool isChildMaskOff() const
Definition InternalNode.h:875
ValueOffCIter cbeginValueOff() const
Definition InternalNode.h:237
LeafNodeType * probeLeafAndCache(const Coord &xyz, AccessorT &acc)
Same as probeLeaf() except, if necessary, update the accessor with pointers to the nodes along the pa...
Index32 transientData() const
Return the transient data value.
Definition InternalNode.h:277
InternalNode(const InternalNode< OtherChildNodeType, Log2Dim > &other)
Value conversion copy constructor.
Definition InternalNode.h:1018
InternalNode(const Coord &origin, const ValueType &fillValue, bool active=false)
Constructs an InternalNode with dense tiles.
Definition InternalNode.h:957
void addLeafAndCache(LeafNodeType *leaf, AccessorT &)
Same as addLeaf() except, if necessary, update the accessor with pointers to the nodes along the path...
Definition InternalNode.h:1530
static Index getChildDim()
Definition InternalNode.h:261
const NodeMaskType & getChildMask() const
Definition InternalNode.h:877
void topologyIntersection(const InternalNode< OtherChildNodeType, Log2Dim > &other, const ValueType &background)
Intersects this tree's set of active values with the active values of the other tree,...
NodeUnion< ValueType, ChildNodeType > UnionType
Definition InternalNode.h:41
NodeMaskType mChildMask
Definition InternalNode.h:918
bool isValueMaskOff() const
Definition InternalNode.h:872
InternalNode(const InternalNode< OtherChildNodeType, Log2Dim > &other, const ValueType &offValue, const ValueType &onValue, TopologyCopy)
Topology copy constructor.
Definition InternalNode.h:1091
void getNodes(ArrayT &array)
Adds all nodes of a certain type to a container with the following API:
Definition InternalNode.h:3305
bool isValueMaskOn() const
Definition InternalNode.h:870
Index64 nonLeafCount() const
Definition InternalNode.h:1143
NodeT * stealNode(const Coord &xyz, const ValueType &value, bool state)
Return a pointer to the node of type NodeT that contains voxel (x, y, z) and replace it with a tile o...
Definition InternalNode.h:1277
void voxelizeActiveTiles(bool threaded=true)
Densify active tiles, i.e., replace them with leaf-level active voxels.
Definition InternalNode.h:2681
NodeMaskType mValueMask
Definition InternalNode.h:918
InternalNode()
Default constructor.
Definition InternalNode.h:73
bool isChildMaskOn(Index n) const
Definition InternalNode.h:873
~InternalNode()
Definition InternalNode.h:1105
Index64 onLeafVoxelCount() const
Definition InternalNode.h:1188
const LeafNodeType * probeConstLeafAndCache(const Coord &xyz, AccessorT &acc) const
NodeMaskType getValueOffMask() const
Definition InternalNode.h:878
void merge(const ValueType &tileValue, bool tileActive)
Merge, using one of several schemes, this node (and its descendants) with a tile of the same dimensio...
Definition InternalNode.h:2811
LeafNodeType * probeLeaf(const Coord &xyz)
Return a pointer to the leaf node that contains voxel (x, y, z). If no such node exists,...
Definition InternalNode.h:1455
bool getValueUnsafe(Index offset, ValueType &value) const
Return the tile value and active state at offset.
Definition InternalNode.h:2488
ValueAllCIter cbeginValueAll() const
Definition InternalNode.h:238
void prune(const ValueType &tolerance=zeroVal< ValueType >())
Reduce the memory footprint of this tree by replacing with tiles any nodes whose values are all the s...
Definition InternalNode.h:1253
ValueIter< const InternalNode, const ValueType, MaskOffIterator, ValueAll > ValueAllCIter
Definition InternalNode.h:223
ValueOnCIter beginValueOn() const
Definition InternalNode.h:239
void setValueOnlyUnsafe(Index offset, const ValueType &value)
Set the tile value at offset but don't change its value.
Definition InternalNode.h:2532
Index64 offLeafVoxelCount() const
Definition InternalNode.h:1200
const ChildNodeType * probeConstChild(const Coord &xyz, ValueType &value, bool &active) const
Definition InternalNode.h:1403
void combine2(const InternalNode &other, const OtherValueType &, bool valIsActive, CombineOp &)
Definition InternalNode.h:3175
void resetBackground(const ValueType &oldBackground, const ValueType &newBackground)
Change inactive tiles or voxels with value oldBackground to newBackground or -oldBackground to -newBa...
Definition InternalNode.h:3376
void addTile(Index level, const Coord &xyz, const ValueType &value, bool state)
Add a tile at the specified tree level that contains voxel (x, y, z), possibly creating a parent bran...
Definition InternalNode.h:1589
void combine2(const ValueType &value, const OtherNodeType &other, bool valIsActive, CombineOp &)
Definition InternalNode.h:3142
void setOrigin(const Coord &origin)
Set the grid index coordinates of this node's local origin.
Definition InternalNode.h:274
const Coord & origin() const
Definition InternalNode.h:272
const ChildNodeType * probeConstChildUnsafe(Index offset, ValueType &value, bool &active) const
Definition InternalNode.h:1440
bool isInactive() const
Return true if this node has no children and only contains inactive values.
Definition InternalNode.h:333
void modifyValueAndActiveState(const Coord &xyz, const ModifyOp &op)
Apply a functor to the voxel at the given coordinates.
Definition InternalNode.h:2129
void setValueOnlyAndCache(const Coord &xyz, const ValueType &value, AccessorT &)
Definition InternalNode.h:1992
void combine2(const InternalNode &other0, const OtherNodeType &other1, CombineOp &)
Definition InternalNode.h:3095
friend class InternalNode
During topology-only construction, access is needed to protected/private members of other template in...
Definition InternalNode.h:865
bool isValueMaskOff(Index n) const
Definition InternalNode.h:871
void setValueOnly(const Coord &xyz, const ValueType &value)
Set the value of the voxel at the given coordinates but don't change its active state.
Definition InternalNode.h:1975
const LeafNodeType * probeConstLeaf(const Coord &xyz) const
Definition InternalNode.h:1481
void deleteChildUnsafe(Index offset, const ValueType &value, bool active)
Delete a child node at offset and replace with the given value and active state.
Definition InternalNode.h:2625
ChildNodeType * probeChild(const Coord &xyz)
Return a pointer to the child node that contains voxel (x, y, z). If no such node exists,...
Definition InternalNode.h:1379
Index getValueLevelAndCache(const Coord &xyz, AccessorT &) const
Return the level of the tree (0 = leaf) at which the value at the given coordinates resides.
Definition InternalNode.h:1813
const NodeType * probeConstNodeAndCache(const Coord &xyz, AccessorT &) const
void setActiveStateUnsafe(Index offset, bool on)
Set the tile active state at offset but don't change its value.
Definition InternalNode.h:2523
void fill(const CoordBBox &bbox, const ValueType &value, bool active=true)
Set all voxels within a given axis-aligned box to a constant value.
Definition InternalNode.h:2233
ValueOffCIter beginValueOff() const
Definition InternalNode.h:241
void setValueOffAndCache(const Coord &xyz, const ValueType &value, AccessorT &)
Definition InternalNode.h:1906
void addLeaf(LeafNodeType *leaf)
Add the specified leaf to this node, possibly creating a child branch in the process....
Definition InternalNode.h:1501
InternalNode(const InternalNode< OtherChildNodeType, Log2Dim > &other, const ValueType &background, TopologyCopy)
Topology copy constructor.
Definition InternalNode.h:1054
const ValueType & getValueAndCache(const Coord &xyz, AccessorT &) const
ChildAllCIter cbeginChildAll() const
Definition InternalNode.h:227
void clip(const CoordBBox &, const ValueType &background)
Set all voxels that lie outside the given axis-aligned box to the background.
Definition InternalNode.h:2183
Index64 leafCount() const
Definition InternalNode.h:1118
ChildAllIter beginChildAll()
Definition InternalNode.h:233
ValueIter< InternalNode, const ValueType, MaskOnIterator, ValueOn > ValueOnIter
Definition InternalNode.h:218
static Index getLevel()
Definition InternalNode.h:254
void setValueOff(const Coord &xyz, const ValueType &value)
Set the value of the voxel at the given coordinates and mark the voxel as inactive.
Definition InternalNode.h:1886
bool isValueOnAndCache(const Coord &xyz, AccessorT &) const
Definition InternalNode.h:1770
const ChildNodeType * probeChildUnsafe(Index offset) const
Definition InternalNode.h:736
void topologyDifference(const InternalNode< OtherChildNodeType, Log2Dim > &other, const ValueType &background)
Difference this node's set of active values with the active values of the other node,...
static const Index DIM
Definition InternalNode.h:47
ChildNodeType * stealChildUnsafe(Index offset, const ValueType &value, bool active)
Replace a child node at offset with the given value and active state.
Definition InternalNode.h:2611
bool probeValue(const Coord &xyz, ValueType &value) const
Definition InternalNode.h:1826
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 InternalNode.h:2013
ValueOnIter beginValueOn()
Definition InternalNode.h:243
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 InternalNode.h:2095
static const Index LEVEL
Definition InternalNode.h:49
void setValueMaskUnsafe(const NodeMaskType &mask)
Set the active/inactive value mask.
Definition InternalNode.h:2579
void topologyUnion(const InternalNode< OtherChildNodeType, Log2Dim > &other, const bool preserveTiles=false)
Union this branch's set of active values with the other branch's active values. The value type of the...
void resetChildUnsafe(Index offset, ChildNodeType *child)
Replace a child node at offset with the given child node.
Definition InternalNode.h:2599
ChildOffCIter cbeginChildOff() const
Definition InternalNode.h:226
ChildOffIter beginChildOff()
Definition InternalNode.h:232
ChildIter< InternalNode, ChildNodeType, MaskOnIterator, ChildOn > ChildOnIter
Definition InternalNode.h:211
Index64 onVoxelCount() const
Definition InternalNode.h:1164
ChildOffCIter beginChildOff() const
Definition InternalNode.h:229
static Index coordToOffset(const Coord &xyz)
Return the linear table offset of the given global or local coordinates.
Definition InternalNode.h:3280
void addTileAndCache(Index level, const Coord &xyz, const ValueType &, bool state, AccessorT &)
Same as addTile() except, if necessary, update the accessor with pointers to the nodes along the path...
Definition InternalNode.h:1621
typename ChildNodeType::LeafNodeType LeafNodeType
Definition InternalNode.h:38
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition InternalNode.h:1854
NodeType * probeNodeAndCache(const Coord &xyz, AccessorT &)
Same as probeNode() except, if necessary, update the accessor with pointers to the nodes along the pa...
void nodeCount(std::vector< Index64 > &vec) const
Definition InternalNode.h:1130
ValueOnCIter cbeginValueOn() const
Definition InternalNode.h:235
typename ChildNodeType::ValueType ValueType
Definition InternalNode.h:39
const LeafNodeType * probeLeaf(const Coord &xyz) const
void setValueOnUnsafe(Index offset)
Mark the tile active at offset but don't change its value.
Definition InternalNode.h:2541
void setValueOnUnsafe(Index offset, const ValueType &value)
Set the tile value at offset and mark the voxel as active.
Definition InternalNode.h:2550
void resetChildNode(Index i, ChildNodeType *child)
Definition InternalNode.h:3410
Index32 childCount() const
Definition InternalNode.h:1156
DenseIter< const InternalNode, const ChildNodeType, ValueType, ChildAll > ChildAllCIter
Definition InternalNode.h:216
Index getValueLevel(const Coord &xyz) const
Return the level of the tree (0 = leaf) at which the value at the given coordinates resides.
Definition InternalNode.h:1804
Index64 onTileCount() const
Definition InternalNode.h:1211
void modifyValue(const Coord &xyz, const ModifyOp &op)
Apply a functor to the value of the voxel at the given coordinates and mark the voxel as active.
Definition InternalNode.h:2067
bool hasSameTopology(const InternalNode< OtherChildNodeType, OtherLog2Dim > *other) const
Return true if the given tree branch has the same node and active value topology as this tree branch ...
Definition InternalNode.h:3396
void setValueMask(Index n, bool on)
Definition InternalNode.h:890
const ChildNodeType * getChildUnsafe(Index offset) const
Return the child node at offset.
Definition InternalNode.h:2516
Index64 offVoxelCount() const
Definition InternalNode.h:1176
typename NodeMaskType::OffIterator MaskOffIterator
Definition InternalNode.h:120
ChildIter< const InternalNode, const ChildNodeType, MaskOnIterator, ChildOn > ChildOnCIter
Definition InternalNode.h:212
bool isConstant(ValueType &firstValue, bool &state, const ValueType &tolerance=zeroVal< ValueType >()) const
Definition InternalNode.h:1690
LeafNodeType * touchLeaf(const Coord &xyz)
Return the leaf node that contains voxel (x, y, z). If no such node exists, create one,...
Definition InternalNode.h:1657
void getNodes(ArrayT &array) const
Definition InternalNode.h:3325
const ChildNodeType * getConstChildUnsafe(Index offset) const
Return the child node at offset.
Definition InternalNode.h:2507
Index32 mTransientData
Definition InternalNode.h:922
void denseFill(const CoordBBox &bbox, const ValueType &value, bool active=true)
Set all voxels within a given axis-aligned box to a constant value and ensure that those voxels are a...
Definition InternalNode.h:2289
static const Index NUM_VALUES
Definition InternalNode.h:48
ValueIter< InternalNode, const ValueType, MaskOffIterator, ChildOff > ChildOffIter
Definition InternalNode.h:213
UnionType mNodes[NUM_VALUES]
Definition InternalNode.h:917
void negate()
Change the sign of all the values represented in this node and its child nodes.
Definition InternalNode.h:2637
Coord offsetToGlobalCoord(Index n) const
Return the global coordinates for a linear table offset.
Definition InternalNode.h:3290
ValueIter< const InternalNode, const ValueType, MaskOffIterator, ChildOff > ChildOffCIter
Definition InternalNode.h:214
ChildAllCIter beginChildAll() const
Definition InternalNode.h:230
void setActiveStateAndCache(const Coord &xyz, bool on, AccessorT &)
Definition InternalNode.h:2032
void setValuesOn()
Mark all values (both tiles and voxels) as active.
Definition InternalNode.h:2055
void makeChildNodeEmpty(Index n, const ValueType &value)
Definition InternalNode.h:3451
void setTransientData(Index32 transientData)
Set the transient data value.
Definition InternalNode.h:279
typename ChildNodeType::BuildType BuildType
Definition InternalNode.h:40
LeafNodeType * touchLeafAndCache(const Coord &xyz, AccessorT &)
Same as touchLeaf() except, if necessary, update the accessor with pointers to the nodes along the pa...
void stealNodes(ArrayT &array, const ValueType &value, bool state)
Steals all nodes of a certain type from the tree and adds them to a container with the following API:
Definition InternalNode.h:3349
ChildNodeType * getChildNode(Index n)
Returns a pointer to the child node at the linear offset n.
Definition InternalNode.h:3458
typename NodeMaskType::OnIterator MaskOnIterator
Definition InternalNode.h:119
const LeafNodeType * probeLeafAndCache(const Coord &xyz, AccessorT &acc) const
bool probeValueAndCache(const Coord &xyz, ValueType &value, AccessorT &) const
Definition InternalNode.h:1839
static const Index LOG2DIM
Definition InternalNode.h:45
bool addChild(ChildNodeType *child)
Add the given child node at this level deducing the offset from it's origin. If a child node with thi...
Definition InternalNode.h:1563
ChildNodeType * probeChildUnsafe(Index offset)
Return a pointer to the child node for a specific offset. If no such node exists, return nullptr.
Definition InternalNode.h:1411
DenseIter< InternalNode, ChildNodeType, ValueType, ChildAll > ChildAllIter
Definition InternalNode.h:215
void evalActiveBoundingBox(CoordBBox &bbox, bool visitVoxels=true) const
Expand the specified bounding box so that it includes the active tiles of this internal node as well ...
Definition InternalNode.h:1235
ValueIter< const InternalNode, const ValueType, MaskOnIterator, ValueOn > ValueOnCIter
Definition InternalNode.h:219
const ChildNodeType * probeChild(const Coord &xyz) const
Definition InternalNode.h:718
bool isEmpty() const
Definition InternalNode.h:305
InternalNode(const ValueType &offValue)
Constructor of an InternalNode with dense inactive tiles of the specified value.
Definition InternalNode.h:949
const UnionType * getTable() const
Definition InternalNode.h:885
ChildNodeType * probeChild(const Coord &xyz, ValueType &value, bool &active)
Return a pointer to the child node that contains voxel (x, y, z). If no such node exists,...
Definition InternalNode.h:1395
static void getNodeLog2Dims(std::vector< Index > &dims)
Populated an std::vector with the dimension of all the nodes in the branch starting with this node.
Definition InternalNode.h:3259
ValueOffIter beginValueOff()
Definition InternalNode.h:245
void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition InternalNode.h:1870
ValueIter< InternalNode, const ValueType, MaskOffIterator, ValueOff > ValueOffIter
Definition InternalNode.h:220
const ChildNodeType * probeConstChild(const Coord &xyz) const
Definition InternalNode.h:1387
typename SubtreeT::Back ChildNodeType
Definition InternalNode.h:37
static void offsetToLocalCoord(Index n, Coord &xyz)
Return the local coordinates for a linear table offset, where offset 0 has coordinates (0,...
Definition InternalNode.h:3268
const NodeMaskType & getValueMask() const
Definition InternalNode.h:876
static const Index TOTAL
Definition InternalNode.h:46
const ChildNodeType * getChildNode(Index n) const
Returns a pointer to the child node at the linear offset n.
Definition InternalNode.h:3467
const NodeType * probeConstNode(const Coord &xyz) const
bool hasActiveTiles() const
Return true if this node or any of its child nodes have any active tiles.
Definition InternalNode.h:1736
void combine(InternalNode &other, CombineOp &)
Definition InternalNode.h:3008
InternalNode(const InternalNode &)
Deep copy constructor.
Definition InternalNode.h:1004
void setChildUnsafe(Index offset, ChildNodeType *child)
Replace a tile at offset with the given child node.
Definition InternalNode.h:2587
const ValueType & getValue(const Coord &xyz) const
Definition InternalNode.h:1781
Index64 memUsage() const
Return the total amount of memory in bytes occupied by this node and its children.
Definition InternalNode.h:1222
void setValueOn(const Coord &xyz, const ValueType &value)
Set the value of the voxel at the given coordinates and mark the voxel as active.
Definition InternalNode.h:1931
bool isValueOff(const Coord &xyz) const
Return true if the voxel at the given coordinates is inactive.
Definition InternalNode.h:1760
static const Index64 NUM_VOXELS
Definition InternalNode.h:51
void setValueOffUnsafe(Index offset)
Mark the tile inactive at offset but don't change its value.
Definition InternalNode.h:2560
ChildNodeType * unsetChildNode(Index i, const ValueType &value)
Definition InternalNode.h:3436
const ChildNodeType * probeChild(const Coord &xyz, ValueType &value, bool &active) const
Definition InternalNode.h:726
typename NodeMaskType::DenseIterator MaskDenseIterator
Definition InternalNode.h:121
void modifyValueAndActiveStateAndCache(const Coord &xyz, const ModifyOp &op, AccessorT &)
Definition InternalNode.h:2152
bool isValueOff(Index offset) const
Return true if the voxel at the given offset is inactive.
Definition InternalNode.h:342
ValueAllCIter beginValueAll() const
Definition InternalNode.h:242
Coord mOrigin
Definition InternalNode.h:920
static Index dim()
Definition InternalNode.h:251
void setValueOffUnsafe(Index offset, const ValueType &value)
Set the tile value at offset and mark the voxel as inactive.
Definition InternalNode.h:2569
InternalNode(PartialCreate, const Coord &, const ValueType &fillValue, bool active=false)
Construct a node without allocating child memory. Children are left unallocated and must be populated...
Definition InternalNode.h:971
void addTile(Index offset, const ValueType &value, bool state)
Delete any existing child branch at the specified offset and add a tile.
Definition InternalNode.h:1579
bool isValueMaskOn(Index n) const
Definition InternalNode.h:869
ValueAllIter beginValueAll()
Definition InternalNode.h:246
void combine(const ValueType &value, bool valueIsActive, CombineOp &)
Definition InternalNode.h:3066
const ValueType & getLastValue() const
If the last entry in this node's table is a tile, return the tile's value. Otherwise,...
Definition InternalNode.h:2467
Base class for iterators over internal and leaf nodes.
Definition Iterator.h:30
Index pos() const
Definition Iterator.h:60
InternalNode & parent() const
Definition Iterator.h:50
Default implementation of a NodeUnion that stores the child pointer and the value separately (i....
Definition NodeUnion.h:32
const ValueT & getValue() const
Definition NodeUnion.h:43
ChildT * getChild() const
Definition NodeUnion.h:40
void setValue(const ValueT &val)
Definition NodeUnion.h:45
Bit mask for the internal and leaf nodes of VDB. This is a 64-bit implementation.
Definition NodeMasks.h:309
Index64 Word
Definition NodeMasks.h:317
DenseMaskIterator< NodeMask > DenseIterator
Definition NodeMasks.h:351
void toggle(Index32 n)
Toggle the state of the nth bit.
Definition NodeMasks.h:484
OnMaskIterator< NodeMask > OnIterator
Definition NodeMasks.h:349
void setOff(Index32 n)
Set the nth bit off.
Definition NodeMasks.h:458
OffMaskIterator< NodeMask > OffIterator
Definition NodeMasks.h:350
void writeCompressedValues(std::ostream &os, const ValueT *srcBuf, Index srcCount, const MaskT &valueMask, const MaskT &childMask, bool toHalf, const ValueT *background=nullptr)
Definition Compression.h:622
void readCompressedValues(std::istream &is, ValueT *destBuf, Index destCount, const MaskT &valueMask, bool fromHalf, const ValueT *background=nullptr)
Definition Compression.h:450
void checkFormatVersion(std::ios_base &)
Throws an IoError if the file format version number is not supported.
uint32_t getFormatVersion(std::ios_base &)
Return the file format version number associated with the given input stream.
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 cwiseLessThan(const Mat< SIZE, T > &m0, const Mat< SIZE, T > &m1)
Definition Mat.h:1015
bool isApproxEqual(const Type &a, const Type &b, const Type &tolerance)
Return true if a is equal to b to within the given tolerance.
Definition Math.h:428
T negative(const T &val)
Return the unary negation of the given value.
Definition Math.h:139
bool isExactlyEqual(const T0 &a, const T1 &b)
Return true if a is exactly equal to b.
Definition Math.h:465
bool cwiseGreaterThan(const Mat< SIZE, T > &m0, const Mat< SIZE, T > &m1)
Definition Mat.h:1029
Definition TreeIterator.h:30
Index32 Index
Definition Types.h:34
constexpr T zeroVal()
Return the value of type T that corresponds to zero.
Definition Math.h:71
@ OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION
Definition version.h.in:339
uint32_t Index32
Definition Types.h:32
int32_t Int32
Definition Types.h:36
uint64_t Index64
Definition Types.h:33
@ MERGE_ACTIVE_STATES
Definition Types.h:578
@ MERGE_NODES
Definition Types.h:579
@ MERGE_ACTIVE_STATES_AND_NODES
Definition Types.h:580
Definition Exceptions.h:13
General-purpose arithmetic and comparison routines, most of which accept arbitrary value types (or at...
typename std::remove_const< ValueT >::type NonConstValueType
Definition Iterator.h:184
DenseIteratorBase()
Definition Iterator.h:188
ChildIter(const MaskIterT &iter, NodeT *parent)
Definition InternalNode.h:136
ChildIter()
Definition InternalNode.h:135
ChildT & getItem(Index pos) const
Definition InternalNode.h:139
void setItem(Index pos, const ChildT &c) const
Definition InternalNode.h:146
Definition InternalNode.h:125
Definition InternalNode.h:125
Definition InternalNode.h:982
DeepCopy(const OtherInternalNode *source, InternalNode *target)
Definition InternalNode.h:983
InternalNode * t
Definition InternalNode.h:999
const OtherInternalNode * s
Definition InternalNode.h:998
void operator()(const tbb::blocked_range< Index > &r) const
Definition InternalNode.h:987
DenseIteratorBase< MaskDenseIterator, DenseIter, NodeT, ChildT, ValueT > BaseT
Definition InternalNode.h:178
DenseIter(const MaskDenseIterator &iter, NodeT *parent)
Definition InternalNode.h:182
void unsetItem(Index pos, const ValueT &value) const
Definition InternalNode.h:203
void setItem(Index pos, ChildT *child) const
Definition InternalNode.h:197
DenseIter()
Definition InternalNode.h:181
bool getItem(Index pos, ChildT *&child, NonConstValueT &value) const
Definition InternalNode.h:185
typename BaseT::NonConstValueType NonConstValueT
Definition InternalNode.h:179
SameConfiguration<OtherNodeType>::value is true if and only if OtherNodeType is the type of an Intern...
Definition InternalNode.h:65
static const bool value
Definition InternalNode.h:66
Definition InternalNode.h:1030
TopologyCopy1(const OtherInternalNode *source, InternalNode *target, const ValueType &background)
Definition InternalNode.h:1031
InternalNode * t
Definition InternalNode.h:1047
const OtherInternalNode * s
Definition InternalNode.h:1046
const ValueType & b
Definition InternalNode.h:1048
void operator()(const tbb::blocked_range< Index > &r) const
Definition InternalNode.h:1036
Definition InternalNode.h:1067
const ValueType & offV
Definition InternalNode.h:1085
TopologyCopy2(const OtherInternalNode *source, InternalNode *target, const ValueType &offValue, const ValueType &onValue)
Definition InternalNode.h:1068
InternalNode * t
Definition InternalNode.h:1084
const OtherInternalNode * s
Definition InternalNode.h:1083
const ValueType & onV
Definition InternalNode.h:1085
void operator()(const tbb::blocked_range< Index > &r) const
Definition InternalNode.h:1073
Definition InternalNode.h:2946
void operator()(W &tC, const W &sC, const W &sV, const W &tV) const
Definition InternalNode.h:2946
Definition InternalNode.h:2949
void operator()(W &tV, const W &sC, const W &sV, const W &tC) const
Definition InternalNode.h:2949
TopologyDifference(const OtherInternalNode *source, InternalNode *target, const ValueType &background)
Definition InternalNode.h:2952
typename NodeMaskType::Word W
Definition InternalNode.h:2945
InternalNode * t
Definition InternalNode.h:2988
const OtherInternalNode * s
Definition InternalNode.h:2987
const ValueType & b
Definition InternalNode.h:2989
void operator()(const tbb::blocked_range< Index > &r) const
Definition InternalNode.h:2966
Definition InternalNode.h:2896
void operator()(W &tC, const W &sC, const W &sV, const W &tV) const
Definition InternalNode.h:2896
TopologyIntersection(const OtherInternalNode *source, InternalNode *target, const ValueType &background)
Definition InternalNode.h:2899
typename NodeMaskType::Word W
Definition InternalNode.h:2895
InternalNode * t
Definition InternalNode.h:2928
const OtherInternalNode * s
Definition InternalNode.h:2927
const ValueType & b
Definition InternalNode.h:2929
void operator()(const tbb::blocked_range< Index > &r) const
Definition InternalNode.h:2911
Definition InternalNode.h:2844
void operator()(W &tV, const W &sV, const W &tC) const
Definition InternalNode.h:2844
Definition InternalNode.h:2842
typename NodeMaskType::Word W
Definition InternalNode.h:2843
InternalNode * t
Definition InternalNode.h:2879
const bool mPreserveTiles
Definition InternalNode.h:2880
const OtherInternalNode * s
Definition InternalNode.h:2878
void operator()(const tbb::blocked_range< Index > &r) const
Definition InternalNode.h:2860
TopologyUnion(const OtherInternalNode *source, InternalNode *target, const bool preserveTiles)
Definition InternalNode.h:2847
ValueConverter<T>::Type is the type of an InternalNode having the same child hierarchy and dimensions...
Definition InternalNode.h:56
InternalNode< typename ChildNodeType::template ValueConverter< OtherValueType >::Type, Log2Dim > Type
Definition InternalNode.h:57
void modifyItem(Index pos, const ModifyOp &op) const
Definition InternalNode.h:167
ValueIter(const MaskIterT &iter, NodeT *parent)
Definition InternalNode.h:157
const ValueT & getItem(Index pos) const
Definition InternalNode.h:160
ValueIter()
Definition InternalNode.h:156
void setItem(Index pos, const ValueT &v) const
Definition InternalNode.h:163
Definition InternalNode.h:124
Definition InternalNode.h:124
Definition InternalNode.h:2655
InternalNode * mNode
Definition InternalNode.h:2676
void operator()(const tbb::blocked_range< Index > &r) const
Definition InternalNode.h:2663
VoxelizeActiveTiles(InternalNode &node)
Definition InternalNode.h:2656
static const bool value
Definition InternalNode.h:939
Definition InternalNode.h:933
static const bool value
Definition InternalNode.h:934
SparseIteratorBase()
Definition Iterator.h:122
const ValueType & getValue() const
Definition Iterator.h:139
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition version.h.in:121
#define OPENVDB_USE_VERSION_NAMESPACE
Definition version.h.in:291