4#ifndef OPENVDB_TREE_LEAFNODE_HAS_BEEN_INCLUDED 
    5#define OPENVDB_TREE_LEAFNODE_HAS_BEEN_INCLUDED 
   30template<Index, 
typename> 
struct SameLeafConfig; 
 
   37template<
typename T, Index Log2Dim>
 
   59    template<
typename OtherValueType>
 
   64    template<
typename OtherNodeType>
 
   98    template<
typename OtherValueType>
 
  102    template<
typename OtherValueType>
 
  107    template<
typename OtherValueType>
 
  151    bool isEmpty()
 const { 
return mValueMask.isOff(); }
 
  153    bool isDense()
 const { 
return mValueMask.isOn(); }
 
  155    bool isAllocated()
 const { 
return !mBuffer.isOutOfCore() && !mBuffer.empty(); }
 
  199    template<
typename OtherType, Index OtherLog2Dim>
 
  215    template<
typename MaskIterT, 
typename NodeT, 
typename ValueT, 
typename TagT>
 
  220            MaskIterT, ValueIter<MaskIterT, NodeT, ValueT, TagT>, NodeT, ValueT>
 
  238            this->
parent().setValueOnly(this->
pos(), value);
 
 
  242        template<
typename ModifyOp>
 
  245        template<
typename ModifyOp>
 
 
  250    template<
typename MaskIterT, 
typename NodeT, 
typename TagT>
 
  252        public SparseIteratorBase<MaskIterT, ChildIter<MaskIterT, NodeT, TagT>, NodeT, ValueType>
 
 
  259    template<
typename NodeT, 
typename ValueT, 
typename TagT>
 
  261        MaskDenseIterator, DenseIter<NodeT, ValueT, TagT>, NodeT, void, ValueT>
 
  287    using ValueOnIter = ValueIter<MaskOnIterator, LeafNode, const ValueType, ValueOn>;
 
  288    using ValueOnCIter = ValueIter<MaskOnIterator, const LeafNode, const ValueType, ValueOn>;
 
  289    using ValueOffIter = ValueIter<MaskOffIterator, LeafNode, const ValueType, ValueOff>;
 
  290    using ValueOffCIter = ValueIter<MaskOffIterator,const LeafNode,const ValueType,ValueOff>;
 
  291    using ValueAllIter = ValueIter<MaskDenseIterator, LeafNode, const ValueType, ValueAll>;
 
  292    using ValueAllCIter = ValueIter<MaskDenseIterator,const LeafNode,const ValueType,ValueAll>;
 
  294    using ChildOnCIter = ChildIter<MaskOnIterator, const LeafNode, ChildOn>;
 
  431        mBuffer.setValue(offset, val);
 
  432        mValueMask.setOn(offset);
 
 
  437    template<
typename ModifyOp>
 
  440        mBuffer.loadValues();
 
  441        if (!mBuffer.empty()) {
 
  445            mValueMask.setOn(offset);
 
 
  451    template<
typename ModifyOp>
 
  458    template<
typename ModifyOp>
 
  461        mBuffer.loadValues();
 
  462        if (!mBuffer.empty()) {
 
  464            bool state = mValueMask.isOn(offset);
 
  468            mValueMask.set(offset, state);
 
 
  497        this->
fill(bbox, value, active);
 
 
  516    template<
typename DenseT>
 
  535    template<
typename DenseT>
 
  541    template<
typename AccessorT>
 
  549    template<
typename AccessorT>
 
  554    template<
typename AccessorT>
 
  563    template<
typename AccessorT>
 
  572    template<
typename ModifyOp, 
typename AccessorT>
 
  580    template<
typename ModifyOp, 
typename AccessorT>
 
  588    template<
typename AccessorT>
 
  597    template<
typename AccessorT>
 
  606    template<
typename AccessorT>
 
  615    template<
typename AccessorT>
 
  619        state = mValueMask.isOn(offset);
 
  621        return mBuffer[offset];
 
 
  626    template<
typename AccessorT>
 
  647    template<MergePolicy Policy> 
void merge(
const ValueType& tileValue, 
bool tileActive);
 
  648    template<MergePolicy Policy>
 
  657    template<
typename OtherType>
 
  671    template<
typename OtherType>
 
  685    template<
typename OtherType>
 
  688    template<
typename CombineOp>
 
  690    template<
typename CombineOp>
 
  693    template<
typename CombineOp, 
typename OtherType >
 
  695    template<
typename CombineOp, 
typename OtherNodeT >
 
  697    template<
typename CombineOp, 
typename OtherNodeT >
 
  704    template<
typename AccessorT>
 
  706    template<
typename NodeT>
 
  708    template<
typename NodeT>
 
  710    template<
typename NodeT>
 
  712    template<
typename ArrayT> 
void getNodes(ArrayT&)
 const {}
 
  718    template<
typename AccessorT>
 
  724    template<
typename AccessorT>
 
  726    template<
typename NodeT, 
typename AccessorT>
 
  730        if (!(std::is_same<NodeT, LeafNode>::value)) 
return nullptr;
 
  731        return reinterpret_cast<NodeT*
>(
this);
 
 
  735    template<
typename AccessorT>
 
  741    template<
typename AccessorT>
 
  743    template<
typename AccessorT>
 
  746    template<
typename NodeT, 
typename AccessorT>
 
  750        if (!(std::is_same<NodeT, LeafNode>::value)) 
return nullptr;
 
  751        return reinterpret_cast<const NodeT*
>(
this);
 
 
  858    friend class ::TestLeaf;
 
  859    template<
typename> 
friend class ::TestLeafIO;
 
  905    NodeMaskType mValueMask;
 
 
  919template<Index Dim1, 
typename NodeT2>
 
  922template<Index Dim1, 
typename T2>
 
  930template<
typename T, Index Log2Dim>
 
  939template<
typename T, Index Log2Dim>
 
  944    mOrigin(xyz & (~(
DIM - 1)))
 
 
  949template<
typename T, Index Log2Dim>
 
  954    mOrigin(xyz & (~(
DIM - 1)))
 
 
  959template<
typename T, Index Log2Dim>
 
  962    : mBuffer(other.mBuffer)
 
  964    , mOrigin(other.mOrigin)
 
  965    , mTransientData(other.mTransientData)
 
 
  971template<
typename T, Index Log2Dim>
 
  972template<
typename OtherValueType>
 
  976    , mOrigin(other.mOrigin)
 
  977    , mTransientData(other.mTransientData)
 
  981        static inline ValueType convertValue(
const OtherValueType& val) { 
return ValueType(val); }
 
  985        mBuffer[i] = Local::convertValue(other.mBuffer[i]);
 
 
  990template<
typename T, Index Log2Dim>
 
  991template<
typename OtherValueType>
 
  995    : mBuffer(background)
 
  997    , mOrigin(other.mOrigin)
 
  998    , mTransientData(other.mTransientData)
 
 
 1003template<
typename T, Index Log2Dim>
 
 1004template<
typename OtherValueType>
 
 1009    , mOrigin(other.mOrigin)
 
 1010    , mTransientData(other.mTransientData)
 
 1013        mBuffer[i] = (mValueMask.isOn(i) ? onValue : offValue);
 
 
 1018template<
typename T, Index Log2Dim>
 
 1025template<
typename T, Index Log2Dim>
 
 1029    std::ostringstream ostr;
 
 1030    ostr << 
"LeafNode @" << mOrigin << 
": " << mBuffer;
 
 
 1038template<
typename T, Index Log2Dim>
 
 1043    return ((xyz[0] & (
DIM-1u)) << 2*Log2Dim)
 
 1044        +  ((xyz[1] & (
DIM-1u)) <<  Log2Dim)
 
 1045        +   (xyz[2] & (
DIM-1u));
 
 
 1048template<
typename T, Index Log2Dim>
 
 1054    xyz.
setX(n >> 2*Log2Dim);
 
 1055    n &= ((1<<2*Log2Dim)-1);
 
 1056    xyz.
setY(n >> Log2Dim);
 
 1057    xyz.
setZ(n & ((1<<Log2Dim)-1));
 
 
 1062template<
typename T, Index Log2Dim>
 
 1073template<
typename ValueT, Index Log2Dim>
 
 1080template<
typename ValueT, Index Log2Dim>
 
 1085    return mBuffer[offset];
 
 
 1089template<
typename T, Index Log2Dim>
 
 1096template<
typename T, Index Log2Dim>
 
 1101    val = mBuffer[offset];
 
 1102    return mValueMask.isOn(offset);
 
 
 1106template<
typename T, Index Log2Dim>
 
 1113template<
typename T, Index Log2Dim>
 
 1118    mBuffer.setValue(offset, val);
 
 1119    mValueMask.setOff(offset);
 
 
 1123template<
typename T, Index Log2Dim>
 
 1131template<
typename T, Index Log2Dim>
 
 1138template<
typename T, Index Log2Dim>
 
 1149template<
typename T, Index Log2Dim>
 
 1156        this->
fill(background, 
false);
 
 1157    } 
else if (clipBBox.
isInside(nodeBBox)) {
 
 1169    int &x = xyz.
x(), &y = xyz.
y(), &z = xyz.
z();
 
 1170    for (x = nodeBBox.
min().
x(); x <= nodeBBox.
max().
x(); ++x) {
 
 1171        for (y = nodeBBox.
min().
y(); y <= nodeBBox.
max().
y(); ++y) {
 
 1172            for (z = nodeBBox.
min().
z(); z <= nodeBBox.
max().
z(); ++z) {
 
 
 1189template<
typename T, Index Log2Dim>
 
 1196    clippedBBox.intersect(bbox);
 
 1197    if (!clippedBBox) 
return;
 
 1199    for (
Int32 x = clippedBBox.min().x(); x <= clippedBBox.max().x(); ++x) {
 
 1200        const Index offsetX = (x & (
DIM-1u)) << 2*Log2Dim;
 
 1201        for (
Int32 y = clippedBBox.min().y(); y <= clippedBBox.max().y(); ++y) {
 
 1202            const Index offsetXY = offsetX + ((y & (
DIM-1u)) << Log2Dim);
 
 1203            for (
Int32 z = clippedBBox.min().z(); z <= clippedBBox.max().z(); ++z) {
 
 1204                const Index offset = offsetXY + (z & (
DIM-1u));
 
 1205                mBuffer[offset] = value;
 
 1206                mValueMask.set(offset, active);
 
 
 1212template<
typename T, Index Log2Dim>
 
 1216    mBuffer.fill(value);
 
 
 1219template<
typename T, Index Log2Dim>
 
 1223    mBuffer.fill(value);
 
 1224    mValueMask.set(active);
 
 
 1231template<
typename T, Index Log2Dim>
 
 1232template<
typename DenseT>
 
 1236    mBuffer.loadValues();
 
 1238    using DenseValueType = 
typename DenseT::ValueType;
 
 1240    const size_t xStride = dense.xStride(), yStride = dense.yStride(), zStride = dense.zStride();
 
 1241    const Coord& min = dense.bbox().min();
 
 1242    DenseValueType* t0 = dense.data() + zStride * (bbox.
min()[2] - min[2]); 
 
 1243    const T* s0 = &mBuffer[bbox.
min()[2] & (
DIM-1u)]; 
 
 1244    for (
Int32 x = bbox.
min()[0], ex = bbox.
max()[0] + 1; x < ex; ++x) {
 
 1245        DenseValueType* t1 = t0 + xStride * (x - min[0]);
 
 1246        const T* s1 = s0 + ((x & (
DIM-1u)) << 2*Log2Dim);
 
 1247        for (
Int32 y = bbox.
min()[1], ey = bbox.
max()[1] + 1; y < ey; ++y) {
 
 1248            DenseValueType* t2 = t1 + yStride * (y - min[1]);
 
 1249            const T* s2 = s1 + ((y & (
DIM-1u)) << Log2Dim);
 
 1250            for (
Int32 z = bbox.
min()[2], ez = bbox.
max()[2] + 1; z < ez; ++z, t2 += zStride) {
 
 1251                *t2 = DenseValueType(*s2++);
 
 
 1258template<
typename T, Index Log2Dim>
 
 1259template<
typename DenseT>
 
 1266    using DenseValueType = 
typename DenseT::ValueType;
 
 1268    const size_t xStride = dense.xStride(), yStride = dense.yStride(), zStride = dense.zStride();
 
 1269    const Coord& min = dense.bbox().min();
 
 1271    const DenseValueType* s0 = dense.data() + zStride * (bbox.
min()[2] - min[2]); 
 
 1273    for (
Int32 x = bbox.
min()[0], ex = bbox.
max()[0]+1; x < ex; ++x) {
 
 1274        const DenseValueType* s1 = s0 + xStride * (x - min[0]);
 
 1276        for (
Int32 y = bbox.
min()[1], ey = bbox.
max()[1]+1; y < ey; ++y) {
 
 1277            const DenseValueType* s2 = s1 + yStride * (y - min[1]);
 
 1279            for (
Int32 z = bbox.
min()[2], ez = bbox.
max()[2]+1; z < ez; ++z, ++n2, s2 += zStride) {
 
 1281                    mValueMask.setOff(n2);
 
 1282                    mBuffer[n2] = background;
 
 1284                    mValueMask.setOn(n2);
 
 
 1296template<
typename T, Index Log2Dim>
 
 1300    mValueMask.load(is);
 
 
 1304template<
typename T, Index Log2Dim>
 
 1308    mValueMask.save(os);
 
 
 1316template<
typename T, Index Log2Dim>
 
 1323            is, 
nullptr, 
SIZE, mValueMask, fromHalf);
 
 
 1332template<
typename T, Index Log2Dim>
 
 1340template<
typename T, Index Log2Dim>
 
 1345    const bool seekable = meta && meta->seekable();
 
 1347#ifdef OPENVDB_USE_DELAYED_LOADING 
 1348    std::streamoff maskpos = is.tellg();
 
 1353        mValueMask.seek(is);
 
 1356        mValueMask.load(is);
 
 1359    int8_t numBuffers = 1;
 
 1365        is.read(
reinterpret_cast<char*
>(&numBuffers), 
sizeof(int8_t));
 
 1372        mValueMask.setOff();
 
 1373        mBuffer.setOutOfCore(
false);
 
 1375#ifdef OPENVDB_USE_DELAYED_LOADING 
 1380        io::MappedFile::Ptr mappedFile = io::getMappedFilePtr(is);
 
 1381        const bool delayLoad = ((mappedFile.get() != 
nullptr) && clipBBox.
isInside(nodeBBox));
 
 1384            mBuffer.setOutOfCore(
true);
 
 1385            mBuffer.mFileInfo = 
new typename Buffer::FileInfo;
 
 1386            mBuffer.mFileInfo->meta = meta;
 
 1387            mBuffer.mFileInfo->bufpos = is.tellg();
 
 1388            mBuffer.mFileInfo->mapping = mappedFile;
 
 1391            mBuffer.mFileInfo->maskpos = maskpos;
 
 1398            mBuffer.setOutOfCore(
false);
 
 1403                background = *
static_cast<const T*
>(bgPtr);
 
 1405            this->
clip(clipBBox, background);
 
 1406#ifdef OPENVDB_USE_DELAYED_LOADING 
 1411    if (numBuffers > 1) {
 
 1416        for (
int i = 1; i < numBuffers; ++i) {
 
 1426    if (meta)   meta->setLeaf(meta->leaf() + 1);
 
 
 1430template<
typename T, Index Log2Dim>
 
 1435    mValueMask.save(os);
 
 1437    mBuffer.loadValues();
 
 
 1447template<
typename T, Index Log2Dim>
 
 1451    return mOrigin == other.mOrigin &&
 
 1453           mBuffer == other.mBuffer;
 
 
 1457template<
typename T, Index Log2Dim>
 
 1463    return sizeof(*this) + mBuffer.memUsage() - 
sizeof(mBuffer);
 
 
 1467template<
typename T, Index Log2Dim>
 
 1473    return sizeof(*this) + mBuffer.memUsageIfLoaded() - 
sizeof(mBuffer);
 
 
 1477template<
typename T, Index Log2Dim>
 
 1482    if (bbox.
isInside(this_bbox)) 
return;
 
 
 1494template<
typename T, Index Log2Dim>
 
 1495template<
typename OtherType, Index OtherLog2Dim>
 
 1500    return (Log2Dim == OtherLog2Dim && mValueMask == other->
getValueMask());
 
 
 1503template<
typename T, Index Log2Dim>
 
 1509    if (!mValueMask.isConstant(state)) 
return false;
 
 1510    firstValue = mBuffer[0];
 
 
 1517template<
typename T, Index Log2Dim>
 
 1524    if (!mValueMask.isConstant(state)) 
return false;
 
 1525    minValue = maxValue = mBuffer[0];
 
 1527        const T& v = mBuffer[i];
 
 1529            if ((maxValue - v) > tolerance) 
return false;
 
 1531        } 
else if (v > maxValue) {
 
 1532            if ((v - minValue) > tolerance) 
return false;
 
 
 1539template<
typename T, Index Log2Dim>
 
 1543    std::unique_ptr<T[]> data(
nullptr);
 
 1544    if (tmp == 
nullptr) {
 
 1548    if (tmp != mBuffer.data()) {
 
 1549        const T* src = mBuffer.data();
 
 1550        for (T* dst = tmp; dst-tmp < 
NUM_VALUES;) *dst++ = *src++;
 
 1552    static const size_t midpoint = (
NUM_VALUES - 1) >> 1;
 
 1553    std::nth_element(tmp, tmp + midpoint, tmp + 
NUM_VALUES);
 
 1554    return tmp[midpoint];
 
 
 1557template<
typename T, Index Log2Dim>
 
 1561    const Index count = mValueMask.countOn();
 
 1565    } 
else if (count == 0) {
 
 1568    std::unique_ptr<T[]> data(
nullptr);
 
 1569    if (tmp == 
nullptr) {
 
 1570        data.reset(
new T[count]);
 
 1574    T *begin = tmp - count;
 
 1575    const size_t midpoint = (count - 1) >> 1;
 
 1576    std::nth_element(begin, begin + midpoint, tmp);
 
 1577    value = begin[midpoint];
 
 
 1581template<
typename T, Index Log2Dim>
 
 1585    const Index count = mValueMask.countOff();
 
 1589    } 
else if (count == 0) {
 
 1592    std::unique_ptr<T[]> data(
nullptr);
 
 1593    if (tmp == 
nullptr) {
 
 1594        data.reset(
new T[count]);
 
 1598    T *begin = tmp - count;
 
 1599    const size_t midpoint = (count - 1) >> 1;
 
 1600    std::nth_element(begin, begin + midpoint, tmp);
 
 1601    value = begin[midpoint];
 
 
 1608template<
typename T, Index Log2Dim>
 
 1615template<
typename T, Index Log2Dim>
 
 1624template<
typename T, Index Log2Dim>
 
 1625template<
typename AccessorT>
 
 1628    const ValueType& val, 
bool active, AccessorT&)
 
 1630    this->
addTile(level, xyz, val, active);
 
 
 1637template<
typename T, Index Log2Dim>
 
 1647    for (
iter = this->mValueMask.beginOff(); 
iter; ++
iter) {
 
 1650            inactiveValue = newBackground;
 
 
 1658template<
typename T, Index Log2Dim>
 
 1659template<MergePolicy Policy>
 
 1670        if (mValueMask.isOff(n)) {
 
 1671            mBuffer[n] = other.mBuffer[n];
 
 1672            mValueMask.setOn(n);
 
 
 1678template<
typename T, Index Log2Dim>
 
 1679template<MergePolicy Policy>
 
 1687template<
typename T, Index Log2Dim>
 
 1688template<MergePolicy Policy>
 
 1696    if (!tileActive) 
return;
 
 1700        mBuffer[n] = tileValue;
 
 1701        mValueMask.setOn(n);
 
 
 1707template<
typename T, Index Log2Dim>
 
 1708template<
typename OtherType>
 
 1715template<
typename T, Index Log2Dim>
 
 1716template<
typename OtherType>
 
 1724template<
typename T, Index Log2Dim>
 
 1725template<
typename OtherType>
 
 1733template<
typename T, Index Log2Dim>
 
 1740        mBuffer[i] = -mBuffer[i];
 
 
 1748template<
typename T, Index Log2Dim>
 
 1749template<
typename CombineOp>
 
 1767template<
typename T, Index Log2Dim>
 
 1768template<
typename CombineOp>
 
 1788template<
typename T, Index Log2Dim>
 
 1789template<
typename CombineOp, 
typename OtherType>
 
 1792    bool valueIsActive, CombineOp& op)
 
 1799        op(args.
setARef(other.mBuffer[i])
 
 
 1807template<
typename T, Index Log2Dim>
 
 1808template<
typename CombineOp, 
typename OtherNodeT>
 
 1811    bool valueIsActive, CombineOp& op)
 
 1818        op(args.
setBRef(other.mBuffer[i])
 
 
 1826template<
typename T, Index Log2Dim>
 
 1827template<
typename CombineOp, 
typename OtherNodeT>
 
 1835        mValueMask.set(i, b0.
valueMask().
isOn(i) || b1.valueMask().isOn(i));
 
 1836        op(args.
setARef(b0.mBuffer[i])
 
 
 1849template<
typename T, Index Log2Dim>
 
 1853    for (
Index32 i = 0, N = buf.
size(); i < N; ++i) os << buf.mData[i] << 
", ";
 
 
#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:569
CombineArgs & setARef(const AValueType &a)
Redirect the A value to a new external source.
Definition Types.h:621
CombineArgs & setBIsActive(bool b)
Set the active state of the B value.
Definition Types.h:637
CombineArgs & setResultRef(AValueType &val)
Redirect the result value to a new external destination.
Definition Types.h:625
CombineArgs & setBRef(const BValueType &b)
Redirect the B value to a new external source.
Definition Types.h:623
bool resultIsActive() const
Definition Types.h:632
CombineArgs & setAIsActive(bool b)
Set the active state of the A value.
Definition Types.h:635
static CoordBBox inf()
Return an "infinite" bounding box, as defined by the Coord value range.
Definition Coord.h:322
static CoordBBox createCube(const Coord &min, ValueType dim)
Definition Coord.h:316
Int32 ValueType
Definition Coord.h:33
Tag dispatch class that distinguishes constructors during file input.
Definition Types.h:689
Tag dispatch class that distinguishes topology copy constructors from deep copy constructors.
Definition Types.h:683
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
void reset()
Definition Coord.h:330
Signed (x, y, z) 32-bit integer coordinates.
Definition Coord.h:26
Int32 y() const
Definition Coord.h:132
Int32 x() const
Definition Coord.h:131
Coord & setZ(Int32 z)
Definition Coord.h:82
Coord & setY(Int32 y)
Definition Coord.h:81
Int32 z() const
Definition Coord.h:133
Coord & setX(Int32 x)
Definition Coord.h:80
Base class for iterators over internal and leaf nodes.
Definition Iterator.h:30
Index pos() const
Definition Iterator.h:60
LeafNode & parent() const
Definition Iterator.h:50
Array of fixed size 23Log2Dim that stores the voxel values of a LeafNode.
Definition LeafBuffer.h:32
static Index size()
Return the number of values contained in this buffer.
Definition LeafBuffer.h:112
Templated block class to hold specific data types and a fixed number of values determined by Log2Dim....
Definition LeafNode.h:39
void stealNodes(ArrayT &, const ValueType &, bool)
Definition LeafNode.h:713
void setValueOff(Index offset, const ValueType &val)
Set the value of the voxel at the given offset and mark the voxel as inactive.
Definition LeafNode.h:1115
LeafNode & operator=(const LeafNode &)=default
Deep assignment operator.
bool probeValueAndCache(const Coord &xyz, ValueType &val, AccessorT &) const
Return true if the voxel at the given coordinates is active and return the voxel value in val.
Definition LeafNode.h:607
bool isValueOn(Index offset) const
Return true if the voxel at the given offset is active.
Definition LeafNode.h:480
void addTile(Index offset, const ValueType &, bool)
Definition LeafNode.h:1617
DenseIter< const LeafNode, const ValueType, ChildAll > ChildAllCIter
Definition LeafNode.h:298
static Index64 onTileCount()
Definition LeafNode.h:148
void getOrigin(Int32 &x, Int32 &y, Int32 &z) const
Definition LeafNode.h:178
static Coord offsetToLocalCoord(Index n)
Return the local coordinates for a linear table offset, where offset 0 has coordinates (0,...
Definition LeafNode.h:1050
ValueIter< MaskOffIterator, LeafNode, const ValueType, ValueOff > ValueOffIter
Definition LeafNode.h:289
ChildOnCIter cbeginChildOn() const
Definition LeafNode.h:322
SharedPtr< LeafNode > Ptr
Definition LeafNode.h:46
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
NodeMaskType & getValueMask()
Definition LeafNode.h:885
bool isConstant(ValueType &minValue, ValueType &maxValue, bool &state, const ValueType &tolerance=zeroVal< ValueType >()) const
Definition LeafNode.h:1519
void setValueOn(Index offset)
Mark the voxel at the given offset as active but don't change its value.
Definition LeafNode.h:422
bool isChildMaskOn(Index) const
Definition LeafNode.h:888
ChildOnCIter beginChildOn() const
Definition LeafNode.h:323
ChildOnIter beginChildOn()
Definition LeafNode.h:324
LeafNode()
Default constructor.
Definition LeafNode.h:932
static Index64 nonLeafCount()
Return the non-leaf count for this node, which is zero.
Definition LeafNode.h:138
bool isValueOn(const Coord &xyz) const
Return true if the voxel at the given coordinates is active.
Definition LeafNode.h:478
ValueOnIter endValueOn()
Definition LeafNode.h:312
void writeTopology(std::ostream &os, bool toHalf=false) const
Write out just the topology.
Definition LeafNode.h:1306
util::NodeMask< Log2Dim > NodeMaskType
Definition LeafNode.h:45
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
bool isChildMaskOff() const
Definition LeafNode.h:890
ValueOffCIter cbeginValueOff() const
Definition LeafNode.h:303
Index32 transientData() const
Return the transient data value.
Definition LeafNode.h:190
static Index32 childCount()
Return the child count for this node, which is zero.
Definition LeafNode.h:140
void setValue(const Coord &xyz, const ValueType &val)
Set the value of the voxel at the given coordinates and mark the voxel as active.
Definition LeafNode.h:428
LeafNode(const LeafNode &)
Deep copy constructor.
Definition LeafNode.h:961
static Index getChildDim()
Return the dimension of child nodes of this LeafNode, which is one for voxels.
Definition LeafNode.h:130
bool operator!=(const LeafNode &other) const
Definition LeafNode.h:204
static Index64 leafCount()
Return the leaf count for this node, which is one.
Definition LeafNode.h:132
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
ChildIter< MaskOnIterator, LeafNode, ChildOn > ChildOnIter
Definition LeafNode.h:293
void setValueMask(const NodeMaskType &mask)
Definition LeafNode.h:887
ChildOnIter endChildOn()
Definition LeafNode.h:334
ValueAllIter endValueAll()
Definition LeafNode.h:318
LeafNode * touchLeaf(const Coord &)
Return a pointer to this node.
Definition LeafNode.h:723
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
LeafNode * probeLeaf(const Coord &)
Definition LeafNode.h:734
bool isValueMaskOff() const
Definition LeafNode.h:883
void prune(const ValueType &=zeroVal< ValueType >())
This function exists only to enable template instantiation.
Definition LeafNode.h:702
bool isValueMaskOn() const
Definition LeafNode.h:881
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,...
Definition LeafNode.h:1727
LeafBuffer< ValueType, Log2Dim > Buffer
Definition LeafNode.h:43
void getNodes(ArrayT &) const
Definition LeafNode.h:712
void setValuesOff()
Mark all voxels as inactive but don't change their values.
Definition LeafNode.h:475
ValueAllCIter endValueAll() const
Definition LeafNode.h:317
Index medianOff(ValueType &value, ValueType *tmp=nullptr) const
Computes the median value of all the inactive voxels in this node.
Definition LeafNode.h:1583
void setValueOn(const Coord &xyz, const ValueType &val)
Set the value of the voxel at the given coordinates and mark the voxel as active.
Definition LeafNode.h:424
Index64 onLeafVoxelCount() const
Definition LeafNode.h:146
ChildOffCIter endChildOff() const
Definition LeafNode.h:336
void merge(const ValueType &tileValue, bool tileActive)
Definition LeafNode.h:1690
bool getValueUnsafe(Index offset, ValueType &value) const
Return true if the voxel at the given offset is active and set value.
Definition LeafNode.h:843
~LeafNode()
Destructor.
Definition LeafNode.h:1020
bool probeValue(Index offset, ValueType &val) const
Return true if the voxel at the given offset is active.
Definition LeafNode.h:1098
ValueAllCIter cbeginValueAll() const
Definition LeafNode.h:306
NodeT * probeNode(const Coord &)
Definition LeafNode.h:709
void readTopology(std::istream &is, bool fromHalf=false)
Read in just the topology.
Definition LeafNode.h:1298
ChildIter< MaskOffIterator, LeafNode, ChildOff > ChildOffIter
Definition LeafNode.h:295
ValueOnCIter beginValueOn() const
Definition LeafNode.h:301
static void evalNodeOrigin(Coord &xyz)
Compute the origin of the leaf node that contains the voxel with the given coordinates.
Definition LeafNode.h:899
const Buffer & buffer() const
Definition LeafNode.h:348
LeafNode * probeLeafAndCache(const Coord &, AccessorT &)
Definition LeafNode.h:736
void setValueMaskOn(Index n)
Definition LeafNode.h:893
void setValueOnlyUnsafe(Index offset, const ValueType &value)
Set the value of the voxel at the given coordinates but don't change its active state.
Definition LeafNode.h:847
Index medianOn(ValueType &value, ValueType *tmp=nullptr) const
Computes the median value of all the active voxels in this node.
Definition LeafNode.h:1559
Index64 offLeafVoxelCount() const
Definition LeafNode.h:147
const LeafNode * probeLeaf(const Coord &) const
Definition LeafNode.h:745
const ValueType & getValue(Index offset) const
Return the value of the voxel at the given linear offset.
Definition LeafNode.h:1082
void addTile(Index level, const Coord &, const ValueType &, bool)
Definition LeafNode.h:1610
ChildIter< MaskOffIterator, const LeafNode, ChildOff > ChildOffCIter
Definition LeafNode.h:296
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 LeafNode.h:173
ValueType medianAll(ValueType *tmp=nullptr) const
Computes the median value of all the active AND inactive voxels in this node.
Definition LeafNode.h:1541
const Coord & origin() const
Definition LeafNode.h:176
static Index getValueLevel(const Coord &)
Return the level (i.e., 0) at which leaf node values reside.
Definition LeafNode.h:397
bool isInactive() const
Return true if all of this node's values are inactive.
Definition LeafNode.h:832
void modifyValueAndActiveState(const Coord &xyz, const ModifyOp &op)
Apply a functor to the voxel at the given coordinates.
Definition LeafNode.h:459
bool isValueMaskOff(Index n) const
Definition LeafNode.h:882
ValueOnCIter cendValueOn() const
Definition LeafNode.h:310
bool isAllocated() const
Return true if memory for this node's buffer has been allocated.
Definition LeafNode.h:155
static Index getValueLevelAndCache(const Coord &, AccessorT &)
Return the LEVEL (=0) at which leaf node values reside.
Definition LeafNode.h:627
static Index numValues()
Return the total number of voxels represented by this LeafNode.
Definition LeafNode.h:124
const ValueType & getValueUnsafe(Index offset) const
Return the value of the voxel at the given offset.
Definition LeafNode.h:841
void setActiveStateUnsafe(Index offset, bool on)
Set the active state of the voxel at the given offset but don't change its value.
Definition LeafNode.h:845
ValueOffCIter beginValueOff() const
Definition LeafNode.h:304
void setValueOffAndCache(const Coord &xyz, const ValueType &value, AccessorT &)
Change the value of the voxel at the given coordinates and mark it as inactive.
Definition LeafNode.h:589
LeafNode(PartialCreate, const Coord &coords, const ValueType &value=zeroVal< ValueType >(), bool active=false)
"Partial creation" constructor used during file input
Definition LeafNode.h:951
const ValueType & getValue(const Coord &xyz, bool &state, int &level, AccessorT &) const
Return the value of the voxel at the given coordinates and return its active state and level (i....
Definition LeafNode.h:616
const ValueType & getValueAndCache(const Coord &xyz, AccessorT &) const
Return the value of the voxel at the given coordinates.
Definition LeafNode.h:542
ChildAllCIter cbeginChildAll() const
Definition LeafNode.h:328
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,...
Definition LeafNode.h:1718
ChildOffIter endChildOff()
Definition LeafNode.h:337
static const Index NUM_VOXELS
Definition LeafNode.h:53
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
ChildAllIter beginChildAll()
Definition LeafNode.h:330
void setValueOn(Index offset, const ValueType &val)
Set the value of the voxel at the given offset and mark the voxel as active.
Definition LeafNode.h:430
void combine2(const ValueType &, const OtherNodeT &other, bool valueIsActive, CombineOp &)
Definition LeafNode.h:1810
ValueIter< MaskDenseIterator, LeafNode, const ValueType, ValueAll > ValueAllIter
Definition LeafNode.h:291
static Index getLevel()
Return the level of this node, which by definition is zero for LeafNodes.
Definition LeafNode.h:126
ValueIter< MaskOffIterator, const LeafNode, const ValueType, ValueOff > ValueOffCIter
Definition LeafNode.h:290
bool isValueOnAndCache(const Coord &xyz, AccessorT &) const
Return true if the voxel at the given coordinates is active.
Definition LeafNode.h:550
void addLeaf(LeafNode *)
Definition LeafNode.h:703
static const Index DIM
Definition LeafNode.h:51
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
ValueOnIter beginValueOn()
Definition LeafNode.h:302
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 LeafNode.h:573
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
static const Index LEVEL
Definition LeafNode.h:55
NodeT * probeNodeAndCache(const Coord &, AccessorT &)
Definition LeafNode.h:727
const ValueType & getFirstValue() const
Return a const reference to the first value in the buffer.
Definition LeafNode.h:632
ChildOffCIter cbeginChildOff() const
Definition LeafNode.h:325
ChildOffIter beginChildOff()
Definition LeafNode.h:327
bool isChildMaskOff(Index) const
Definition LeafNode.h:889
void readBuffers(std::istream &is, const CoordBBox &bbox, bool fromHalf=false)
Read buffers that intersect the given bounding box.
Definition LeafNode.h:1342
Index64 onVoxelCount() const
Return the number of voxels marked On.
Definition LeafNode.h:143
ChildOffCIter beginChildOff() const
Definition LeafNode.h:326
static Index coordToOffset(const Coord &xyz)
Return the linear table offset of the given global or local coordinates.
Definition LeafNode.h:1040
static Index64 offTileCount()
Definition LeafNode.h:149
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition LeafNode.h:410
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
ValueOffIter endValueOff()
Definition LeafNode.h:315
void setValueOff(Index offset)
Mark the voxel at the given offset as inactive but don't change its value.
Definition LeafNode.h:412
const LeafNode * probeConstLeafAndCache(const Coord &, AccessorT &) const
Definition LeafNode.h:742
ChildAllCIter endChildAll() const
Definition LeafNode.h:339
void nodeCount(std::vector< Index64 > &) const
no-op
Definition LeafNode.h:134
const NodeT * probeConstNodeAndCache(const Coord &, AccessorT &) const
Definition LeafNode.h:747
ValueOnCIter cbeginValueOn() const
Definition LeafNode.h:300
void writeBuffers(std::ostream &os, bool toHalf=false) const
Write buffers to a stream.
Definition LeafNode.h:1432
static Index log2dim()
Return log2 of the dimension of this LeafNode, e.g. 3 if dimensions are 8^3.
Definition LeafNode.h:118
void combine(const LeafNode &other, CombineOp &op)
Definition LeafNode.h:1751
static void getNodeLog2Dims(std::vector< Index > &dims)
Append the Log2Dim of this LeafNode to the specified vector.
Definition LeafNode.h:128
ChildOnCIter endChildOn() const
Definition LeafNode.h:333
const LeafNode * probeConstLeaf(const Coord &) const
Return a const pointer to this node.
Definition LeafNode.h:740
void setValueOnUnsafe(Index offset)
Mark the voxel at the given offset as active but don't change its value.
Definition LeafNode.h:849
void setValueOnUnsafe(Index offset, const ValueType &value)
Set the value of the voxel at the given coordinates and mark the voxel as active.
Definition LeafNode.h:851
ChildOnCIter cendChildOn() const
Definition LeafNode.h:332
void merge(const LeafNode &other, const ValueType &, const ValueType &)
Definition LeafNode.h:1681
static bool hasActiveTiles()
Return false since leaf nodes never contain tiles.
Definition LeafNode.h:487
ChildAllCIter cendChildAll() const
Definition LeafNode.h:338
Index64 memUsageIfLoaded() const
Definition LeafNode.h:1469
void combine2(const LeafNode &other, const OtherType &, bool valueIsActive, CombineOp &)
Definition LeafNode.h:1791
void fill(const ValueType &value, bool active)
Set all voxels to the specified value and active state.
Definition LeafNode.h:1221
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
LeafNode(const LeafNode< OtherValueType, Log2Dim > &other, const ValueType &offValue, const ValueType &onValue, TopologyCopy)
Topology copy constructor.
Definition LeafNode.h:1006
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 LeafNode.h:452
ChildAllIter endChildAll()
Definition LeafNode.h:340
size_t streamingSize(bool toHalf=false) const
void setValueMask(Index n, bool on)
Definition LeafNode.h:892
const NodeMaskType & valueMask() const
Definition LeafNode.h:886
Index64 offVoxelCount() const
Return the number of voxels marked Off.
Definition LeafNode.h:145
typename NodeMaskType::OffIterator MaskOffIterator
Definition LeafNode.h:208
void setValueOff(const Coord &xyz, const ValueType &val)
Set the value of the voxel at the given coordinates and mark the voxel as inactive.
Definition LeafNode.h:1108
void swap(Buffer &other)
Exchange this node's data buffer with the given data buffer without changing the active states of the...
Definition LeafNode.h:347
void readBuffers(std::istream &is, bool fromHalf=false)
Read buffers from a stream.
Definition LeafNode.h:1334
bool isConstant(ValueType &firstValue, bool &state, const ValueType &tolerance=zeroVal< ValueType >()) const
Definition LeafNode.h:1505
T BuildType
Definition LeafNode.h:41
ValueAllCIter cendValueAll() const
Definition LeafNode.h:316
friend class LeafNode
Definition LeafNode.h:863
void denseFill(const CoordBBox &bbox, const ValueType &value, bool active=true)
Set all voxels within an axis-aligned box to the specified value and active state.
Definition LeafNode.h:495
static const Index NUM_VALUES
Definition LeafNode.h:52
void negate()
Definition LeafNode.h:1735
Coord offsetToGlobalCoord(Index n) const
Return the global coordinates for a linear table offset.
Definition LeafNode.h:1064
ChildAllCIter beginChildAll() const
Definition LeafNode.h:329
const LeafNode * probeLeafAndCache(const Coord &, AccessorT &) const
Definition LeafNode.h:744
void setActiveStateAndCache(const Coord &xyz, bool on, AccessorT &)
Set the active state of the voxel at the given coordinates without changing its value.
Definition LeafNode.h:598
void getOrigin(Coord &origin) const
Definition LeafNode.h:177
const ValueType & getValue(const Coord &xyz) const
Return the value of the voxel at the given coordinates.
Definition LeafNode.h:1075
void setValuesOn()
Mark all voxels as active but don't change their values.
Definition LeafNode.h:473
void setTransientData(Index32 transientData)
Set the transient data value.
Definition LeafNode.h:192
static Index size()
Return the total number of voxels represented by this LeafNode.
Definition LeafNode.h:122
ChildOffCIter cendChildOff() const
Definition LeafNode.h:335
void skipCompressedValues(bool seekable, std::istream &, bool fromHalf)
Definition LeafNode.h:1318
void fill(const ValueType &value)
Set all voxels to the specified value but don't change their active states.
Definition LeafNode.h:1214
typename NodeMaskType::OnIterator MaskOnIterator
Definition LeafNode.h:207
static const Index LOG2DIM
Definition LeafNode.h:49
bool operator==(const LeafNode &other) const
Check for buffer, state and origin equivalence.
Definition LeafNode.h:1449
static const Index SIZE
Definition LeafNode.h:54
void evalActiveBoundingBox(CoordBBox &bbox, bool visitVoxels=true) const
Definition LeafNode.h:1479
bool isEmpty() const
Return true if this node has no active voxels.
Definition LeafNode.h:151
void combine2(const LeafNode &b0, const OtherNodeT &b1, CombineOp &)
Definition LeafNode.h:1829
ValueIter< MaskOnIterator, LeafNode, const ValueType, ValueOn > ValueOnIter
Definition LeafNode.h:287
void merge(const LeafNode &)
Definition LeafNode.h:1661
ValueIter< MaskOnIterator, const LeafNode, const ValueType, ValueOn > ValueOnCIter
Definition LeafNode.h:288
ValueOffIter beginValueOff()
Definition LeafNode.h:305
const NodeT * probeConstNode(const Coord &) const
Definition LeafNode.h:711
void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition LeafNode.h:420
Buffer & buffer()
Definition LeafNode.h:349
void setValueOnlyAndCache(const Coord &xyz, const ValueType &val, AccessorT &)
Change the value of the voxel at the given coordinates but preserve its state.
Definition LeafNode.h:564
void setValueOnly(Index offset, const ValueType &val)
Set the value of the voxel at the given offset but don't change its active state.
Definition LeafNode.h:1140
void setActiveState(Index offset, bool on)
Set the active state of the voxel at the given offset but don't change its value.
Definition LeafNode.h:402
ChildIter< MaskOnIterator, const LeafNode, ChildOn > ChildOnCIter
Definition LeafNode.h:294
bool allocate()
Allocate memory for this node's buffer if it has not already been allocated.
Definition LeafNode.h:157
const NodeMaskType & getValueMask() const
Definition LeafNode.h:884
void addTileAndCache(Index, const Coord &, const ValueType &, bool, AccessorT &)
Definition LeafNode.h:1627
static const Index TOTAL
Definition LeafNode.h:50
void addLeafAndCache(LeafNode *, AccessorT &)
Definition LeafNode.h:705
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
ValueOffCIter cendValueOff() const
Definition LeafNode.h:313
void setValueMaskOff(Index n)
Definition LeafNode.h:894
Index64 memUsage() const
Return the memory in bytes occupied by this node.
Definition LeafNode.h:1459
bool isDense() const
Return true if this node contains only active voxels.
Definition LeafNode.h:153
ValueOffCIter endValueOff() const
Definition LeafNode.h:314
void setValueAndCache(const Coord &xyz, const ValueType &val, AccessorT &)
Change the value of the voxel at the given coordinates and mark it as active.
Definition LeafNode.h:555
bool isValueOff(const Coord &xyz) const
Return true if the voxel at the given coordinates is inactive.
Definition LeafNode.h:482
std::string str() const
Return a string representation of this node.
Definition LeafNode.h:1027
NodeT * stealNode(const Coord &, const ValueType &, bool)
Definition LeafNode.h:707
void setValueOffUnsafe(Index offset)
Mark the voxel at the given offset as inactive but don't change its value.
Definition LeafNode.h:853
T ValueType
Definition LeafNode.h:42
bool probeValue(const Coord &xyz, ValueType &val) const
Return true if the voxel at the given coordinates is active.
Definition LeafNode.h:1091
ValueOnCIter endValueOn() const
Definition LeafNode.h:311
typename NodeMaskType::DenseIterator MaskDenseIterator
Definition LeafNode.h:209
void voxelizeActiveTiles(bool=true)
No-op.
Definition LeafNode.h:644
void modifyValueAndActiveStateAndCache(const Coord &xyz, const ModifyOp &op, AccessorT &)
Definition LeafNode.h:581
bool isValueOff(Index offset) const
Return true if the voxel at the given offset is inactive.
Definition LeafNode.h:484
LeafNode * touchLeafAndCache(const Coord &, AccessorT &)
Definition LeafNode.h:725
LeafNode(const Coord &coords, const ValueType &value=zeroVal< ValueType >(), bool active=false)
Constructor.
Definition LeafNode.h:941
const ValueType & getLastValue() const
Return a const reference to the last value in the buffer.
Definition LeafNode.h:634
ValueAllCIter beginValueAll() const
Definition LeafNode.h:307
static Index dim()
Return the number of voxels in each coordinate dimension.
Definition LeafNode.h:120
void setValueOffUnsafe(Index offset, const ValueType &value)
Set the value of the voxel at the given coordinates and mark the voxel as active.
Definition LeafNode.h:855
ValueIter< MaskDenseIterator, const LeafNode, const ValueType, ValueAll > ValueAllCIter
Definition LeafNode.h:292
void combine(const ValueType &value, bool valueIsActive, CombineOp &op)
Definition LeafNode.h:1770
DenseIter< LeafNode, ValueType, ChildAll > ChildAllIter
Definition LeafNode.h:297
bool isValueMaskOn(Index n) const
Definition LeafNode.h:880
LeafNode< ValueType, Log2Dim > LeafNodeType
Definition LeafNode.h:44
LeafNode(const LeafNode< OtherValueType, Log2Dim > &other, const ValueType &background, TopologyCopy)
Topology copy constructor.
Definition LeafNode.h:993
ValueAllIter beginValueAll()
Definition LeafNode.h:308
LeafNode(const LeafNode< OtherValueType, Log2Dim > &other)
Value conversion copy constructor.
Definition LeafNode.h:974
Bit mask for the internal and leaf nodes of VDB. This is a 64-bit implementation.
Definition NodeMasks.h:308
OnIterator beginOn() const
Definition NodeMasks.h:352
OffIterator beginOff() const
Definition NodeMasks.h:354
DenseMaskIterator< NodeMask > DenseIterator
Definition NodeMasks.h:350
bool isOn(Index32 n) const
Return true if the nth bit is on.
Definition NodeMasks.h:502
OnMaskIterator< NodeMask > OnIterator
Definition NodeMasks.h:348
void setOn(Index32 n)
Set the nth bit on.
Definition NodeMasks.h:452
OffMaskIterator< NodeMask > OffIterator
Definition NodeMasks.h:349
OPENVDB_API uint32_t getDataCompression(std::ios_base &)
Return a bitwise OR of compression option flags (COMPRESS_ZIP, COMPRESS_ACTIVE_MASK,...
void writeCompressedValues(std::ostream &os, ValueT *srcBuf, Index srcCount, const MaskT &valueMask, const MaskT &childMask, bool toHalf)
Definition Compression.h:646
OPENVDB_API uint32_t getFormatVersion(std::ios_base &)
Return the file format version number associated with the given input stream.
@ COMPRESS_ZIP
Definition Compression.h:55
void readCompressedValues(std::istream &is, ValueT *destBuf, Index destCount, const MaskT &valueMask, bool fromHalf)
Definition Compression.h:466
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...
OPENVDB_API SharedPtr< StreamMetadata > getStreamMetadataPtr(std::ios_base &)
Return a shared pointer to an object that stores metadata (file format, compression scheme,...
void readData(std::istream &is, T *data, Index count, uint32_t compression, DelayedLoadMetadata *metadata=nullptr, size_t metadataOffset=size_t(0))
Read data from a stream.
Definition Compression.h:248
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:406
T negative(const T &val)
Return the unary negation of the given value.
Definition Math.h:128
bool isExactlyEqual(const T0 &a, const T1 &b)
Return true if a is exactly equal to b.
Definition Math.h:443
Definition TreeIterator.h:30
std::ostream & operator<<(std::ostream &os, const typename LeafNode< T, Log2Dim >::Buffer &buf)
Definition LeafNode.h:1851
Index32 Index
Definition Types.h:54
constexpr T zeroVal()
Return the value of type T that corresponds to zero.
Definition Math.h:70
@ OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION
Definition version.h.in:262
uint32_t Index32
Definition Types.h:52
int32_t Int32
Definition Types.h:56
uint64_t Index64
Definition Types.h:53
std::shared_ptr< T > SharedPtr
Definition Types.h:114
@ MERGE_NODES
Definition Types.h:508
@ MERGE_ACTIVE_STATES_AND_NODES
Definition Types.h:509
Definition Exceptions.h:13
static pnanovdb_uint32_t allocate(pnanovdb_uint32_t *poffset, pnanovdb_uint32_t size, pnanovdb_uint32_t alignment)
Definition pnanovdb_validate_strides.h:20
Definition Compression.h:293
typename std::remove_const< ValueT >::type NonConstValueType
Definition Iterator.h:184
DenseIteratorBase()
Definition Iterator.h:188
ChildIter(const MaskIterT &iter, NodeT *parent)
Definition LeafNode.h:255
ChildIter()
Definition LeafNode.h:254
Definition LeafNode.h:213
Definition LeafNode.h:213
DenseIter(const MaskDenseIterator &iter, NodeT *parent)
Definition LeafNode.h:267
void unsetItem(Index pos, const ValueT &value) const
Definition LeafNode.h:280
bool getItem(Index pos, void *&child, NonConstValueT &value) const
Definition LeafNode.h:269
DenseIter()
Definition LeafNode.h:266
typename BaseT::NonConstValueType NonConstValueT
Definition LeafNode.h:264
DenseIteratorBase< MaskDenseIterator, DenseIter, NodeT, void, ValueT > BaseT
Definition LeafNode.h:263
SameConfiguration<OtherNodeType>::value is true if and only if OtherNodeType is the type of a LeafNod...
Definition LeafNode.h:65
static const bool value
Definition LeafNode.h:66
ValueConverter<T>::Type is the type of a LeafNode having the same dimensions as this node but a diffe...
Definition LeafNode.h:60
LeafNode< OtherValueType, Log2Dim > Type
Definition LeafNode.h:60
void setValue(const ValueT &value) const
Definition LeafNode.h:236
void modifyValue(const ModifyOp &op) const
Definition LeafNode.h:246
ValueT & getItem(Index pos) const
Definition LeafNode.h:227
void setItem(Index pos, const ValueT &value) const
Definition LeafNode.h:231
ValueIter(const MaskIterT &iter, NodeT *parent)
Definition LeafNode.h:225
ValueT & getValue() const
Definition LeafNode.h:228
ValueIter()
Definition LeafNode.h:224
void modifyItem(Index n, const ModifyOp &op) const
Definition LeafNode.h:243
SparseIteratorBase< MaskIterT, ValueIter, NodeT, ValueT > BaseT
Definition LeafNode.h:222
Definition LeafNode.h:212
Definition LeafNode.h:212
static const bool value
Definition LeafNode.h:923
Definition LeafNode.h:920
static const bool value
Definition LeafNode.h:920
SparseIteratorBase()
Definition Iterator.h:122
ValueType ValueType
Definition Iterator.h:117
#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:218