12#ifndef OPENVDB_POINTS_POINT_DATA_GRID_HAS_BEEN_INCLUDED 
   13#define OPENVDB_POINTS_POINT_DATA_GRID_HAS_BEEN_INCLUDED 
   15#include <openvdb/version.h> 
   34class TestPointDataLeaf;
 
   52    const bool seek = destBuf == 
nullptr;
 
   55    const size_t maximumBytes = std::numeric_limits<uint16_t>::max();
 
   56    if (destBytes >= maximumBytes) {
 
   58                                maximumBytes << 
" bytes in voxel values.")
 
   68        bytes16 = 
static_cast<uint16_t
>(meta->pass());
 
   70        is.seekg(
sizeof(uint16_t), std::ios_base::cur);
 
   74        is.read(
reinterpret_cast<char*
>(&bytes16), 
sizeof(uint16_t));
 
   77    if (bytes16 == std::numeric_limits<uint16_t>::max()) {
 
   80            is.seekg(destBytes, std::ios_base::cur);
 
   83            is.read(
reinterpret_cast<char*
>(destBuf), destBytes);
 
   89            is.seekg(
int(bytes16), std::ios_base::cur);
 
   93            std::unique_ptr<char[]> bloscBuffer(
new char[
int(bytes16)]);
 
   94            is.read(bloscBuffer.get(), bytes16);
 
   95            std::unique_ptr<char[]> buffer = bloscDecompress(   bloscBuffer.get(),
 
   98            std::memcpy(destBuf, buffer.get(), destBytes);
 
 
  114    const size_t maximumBytes = std::numeric_limits<uint16_t>::max();
 
  115    if (srcBytes >= maximumBytes) {
 
  117                                maximumBytes << 
" bytes in voxel values.")
 
  120    const char* charBuffer = 
reinterpret_cast<const char*
>(srcBuf);
 
  122    size_t compressedBytes;
 
  123    std::unique_ptr<char[]> buffer = bloscCompress( charBuffer, srcBytes,
 
  124                                                    compressedBytes, 
false);
 
  126    if (compressedBytes > 0) {
 
  127        auto bytes16 = 
static_cast<uint16_t
>(compressedBytes); 
 
  128        os.write(
reinterpret_cast<const char*
>(&bytes16), 
sizeof(uint16_t));
 
  129        os.write(
reinterpret_cast<const char*
>(buffer.get()), compressedBytes);
 
  132        auto bytes16 = 
static_cast<uint16_t
>(maximumBytes); 
 
  133        os.write(
reinterpret_cast<const char*
>(&bytes16), 
sizeof(uint16_t));
 
  134        os.write(
reinterpret_cast<const char*
>(srcBuf), srcBytes);
 
 
  144    const size_t srcBytes = srcCount*
sizeof(T);
 
  145    const size_t maximumBytes = std::numeric_limits<uint16_t>::max();
 
  146    if (srcBytes >= maximumBytes) {
 
  148                                maximumBytes << 
" bytes in voxel values.")
 
  151    const char* charBuffer = 
reinterpret_cast<const char*
>(srcBuf);
 
  154    size_t compressedBytes = bloscCompressedSize(charBuffer, srcBytes);
 
  156    if (compressedBytes > 0) {
 
  157        auto bytes16 = 
static_cast<uint16_t
>(compressedBytes); 
 
  158        os.write(
reinterpret_cast<const char*
>(&bytes16), 
sizeof(uint16_t));
 
  161        auto bytes16 = 
static_cast<uint16_t
>(maximumBytes); 
 
  162        os.write(
reinterpret_cast<const char*
>(&bytes16), 
sizeof(uint16_t));
 
 
  182template<
typename T, Index Log2Dim> 
class PointDataLeafNode;
 
  187#ifndef OPENVDB_DISABLE_POINT_DATA_TREE_ALIAS 
  206template <
typename Po
intDataTreeT>
 
  220template <
typename Po
intDataTreeT>
 
  231template <
typename Po
intDataTreeT>
 
  233prefetch(PointDataTreeT& 
tree, 
bool position = 
true, 
bool otherAttributes = 
true);
 
  239template <
typename T, Index Log2Dim>
 
  244    using Ptr           = std::shared_ptr<PointDataLeafNode>;
 
  277        , mAttributeSet(new 
AttributeSet(*other.mAttributeSet)) { }
 
 
  288        const T& value = 
zeroVal<T>(), 
bool active = 
false)
 
 
  296    template<
typename OtherValueType>
 
  303    template <
typename ValueType>
 
  310    template <
typename ValueType>
 
  316        const T& value = 
zeroVal<T>(), 
bool active = 
false)
 
 
  351                                        const size_t pos, 
const Index strideOrTotalSize = 1,
 
  352                                        const bool constantStride = 
true,
 
  439    template<
typename OtherType, Index OtherLog2Dim>
 
  447        if(BaseLeaf::operator==(other) != 
true) 
return false;
 
  448        return (*this->mAttributeSet == *other.mAttributeSet);
 
 
  454    template<
typename AccessorT>
 
  460    template<
typename AccessorT>
 
  463    template<
typename NodeT, 
typename AccessorT>
 
  467        if (!(std::is_same<NodeT,PointDataLeafNode>::value)) 
return nullptr;
 
  468        return reinterpret_cast<NodeT*
>(
this);
 
 
  472    template<
typename AccessorT>
 
  479    template<
typename AccessorT>
 
  481    template<
typename AccessorT>
 
  484    template<
typename NodeT, 
typename AccessorT>
 
  488        if (!(std::is_same<NodeT,PointDataLeafNode>::value)) 
return nullptr;
 
  489        return reinterpret_cast<const NodeT*
>(
this);
 
 
  521        OPENVDB_ASSERT(
false && 
"Cannot modify voxel values in a PointDataTree.");
 
 
  554    template<
typename ModifyOp>
 
  557    template<
typename ModifyOp>
 
  560    template<
typename ModifyOp>
 
  570    template<
typename AccessorT>
 
  573    template<
typename ModifyOp, 
typename AccessorT>
 
  578    template<
typename AccessorT>
 
  581    template<
typename AccessorT>
 
  595    friend class ::TestPointDataLeaf;
 
  603    uint16_t mVoxelBufferSize = 0;
 
  675    template<
typename IterT, 
typename FilterT>
 
  679    template<
typename FilterT>
 
  684    template<
typename FilterT>
 
  689    template<
typename FilterT>
 
  699    template<
typename FilterT>
 
  702#define VMASK_ this->getValueMask() 
 
  749template<
typename T, Index Log2Dim>
 
  750inline AttributeSet::UniquePtr
 
  754    std::swap(ptr, mAttributeSet);
 
 
  758template<
typename T, Index Log2Dim>
 
  763    if (descriptor->size() != 1 ||
 
  770    mAttributeSet.reset(
new AttributeSet(descriptor, arrayLength, lock));
 
 
  773template<
typename T, Index Log2Dim>
 
  778    mAttributeSet.reset(
new AttributeSet(*mAttributeSet, 0, lock));
 
 
  789template<
typename T, Index Log2Dim>
 
  793    return pos < mAttributeSet->size();
 
 
  796template<
typename T, Index Log2Dim>
 
  800    const size_t pos = mAttributeSet->find(attributeName);
 
 
  804template<
typename T, Index Log2Dim>
 
  807                                                const size_t pos, 
const Index strideOrTotalSize,
 
  808                                                const bool constantStride,
 
  812    return mAttributeSet->appendAttribute(
 
  813        expected, replacement, pos, strideOrTotalSize, constantStride, metadata, lock);
 
 
  816template<
typename T, Index Log2Dim>
 
  821    mAttributeSet->dropAttributes(pos, expected, replacement);
 
 
  824template<
typename T, Index Log2Dim>
 
  828    mAttributeSet->reorderAttributes(replacement);
 
 
  831template<
typename T, Index Log2Dim>
 
  835    mAttributeSet->renameAttributes(expected, replacement);
 
 
  838template<
typename T, Index Log2Dim>
 
  842    for (
size_t i = 0; i < mAttributeSet->size(); i++) {
 
 
  848template<
typename T, Index Log2Dim>
 
  856    if (!allowMismatchingDescriptors && mAttributeSet->descriptor() != 
attributeSet->descriptor()) {
 
 
  863template<
typename T, Index Log2Dim>
 
  867    mAttributeSet->resetDescriptor(replacement);
 
 
  870template<
typename T, Index Log2Dim>
 
  885template<
typename T, Index Log2Dim>
 
  897    for (
size_t attributeIndex = 1; attributeIndex < mAttributeSet->size(); ++attributeIndex ) {
 
  898        if (mAttributeSet->getConst(attributeIndex-1)->size() != mAttributeSet->getConst(attributeIndex)->size()) {
 
  904    if (mAttributeSet->size() > 0 && this->getValue(
BaseLeaf::SIZE-1) != mAttributeSet->getConst(0)->size()) {
 
 
  909template<
typename T, Index Log2Dim>
 
  914    return *mAttributeSet->get(pos);
 
 
  917template<
typename T, Index Log2Dim>
 
  922    return *mAttributeSet->getConst(pos);
 
 
  925template<
typename T, Index Log2Dim>
 
  932template<
typename T, Index Log2Dim>
 
  936    const size_t pos = mAttributeSet->find(attributeName);
 
  938    return *mAttributeSet->get(pos);
 
 
  941template<
typename T, Index Log2Dim>
 
  945    const size_t pos = mAttributeSet->find(attributeName);
 
  947    return *mAttributeSet->getConst(pos);
 
 
  950template<
typename T, Index Log2Dim>
 
  957template<
typename T, Index Log2Dim>
 
  969template<
typename T, Index Log2Dim>
 
  977template<
typename T, Index Log2Dim>
 
  989template<
typename T, Index Log2Dim>
 
  997template<
typename T, Index Log2Dim>
 
  998template<
typename ValueIterT, 
typename FilterT>
 
 1010    FilterT newFilter(filter);
 
 1011    newFilter.reset(*
this);
 
 1017    ValueIterT valueIter = IterTraitsT::begin(*
this);
 
 
 1022template<
typename T, Index Log2Dim>
 
 1033template<
typename T, Index Log2Dim>
 
 1041template<
typename T, Index Log2Dim>
 
 1042template<
typename FilterT>
 
 1047    FilterT newFilter(filter);
 
 1048    newFilter.reset(*
this);
 
 
 1052template<
typename T, Index Log2Dim>
 
 1059template<
typename T, Index Log2Dim>
 
 1063    if (this->
isEmpty())        
return 0;
 
 
 1068template<
typename T, Index Log2Dim>
 
 1073    else if (this->
isDense())   
return 0;
 
 
 1077template<
typename T, Index Log2Dim>
 
 1081    if (!this->
attributeSet().descriptor().hasGroup(groupName)) {
 
 
 1092template<
typename T, Index Log2Dim>
 
 1104template<
typename T, Index Log2Dim>
 
 1108    this->
buffer().setValue(offset, val);
 
 
 1112template<
typename T, Index Log2Dim>
 
 1116    this->
buffer().setValue(offset, val);
 
 
 1119template<
typename T, Index Log2Dim>
 
 1126template<
typename T, Index Log2Dim>
 
 1133template<
typename T, Index Log2Dim>
 
 1140                        mAttributeSet->size() +
 
 1141                               mAttributeSet->size() +
 
 
 1145template<
typename T, Index Log2Dim>
 
 1152template<
typename T, Index Log2Dim>
 
 1161            std::string key(
"paged:" + std::to_string(
index));
 
 1162            auto it = auxData.find(key);
 
 1163            if (it != auxData.end()) {
 
 1171            std::string key(
"paged:" + std::to_string(
index));
 
 1172            auto it = auxData.find(key);
 
 1173            if (it != auxData.end()) {
 
 1174                return *(std::any_cast<compression::PagedInputStream::Ptr>(it->second));
 
 1179                return *pagedStream;
 
 1185            std::string matchingKey(
"hasMatchingDescriptor");
 
 1186            auto itMatching = auxData.find(matchingKey);
 
 1187            return itMatching != auxData.end();
 
 1192            std::string matchingKey(
"hasMatchingDescriptor");
 
 1193            std::string descriptorKey(
"descriptorPtr");
 
 1194            auto itMatching = auxData.find(matchingKey);
 
 1195            auto itDescriptor = auxData.find(descriptorKey);
 
 1203            std::string descriptorKey(
"descriptorPtr");
 
 1204            std::string matchingKey(
"hasMatchingDescriptor");
 
 1205            auto itMatching = auxData.find(matchingKey);
 
 1206            if (itMatching == auxData.end()) {
 
 1215            std::string descriptorKey(
"descriptorPtr");
 
 1216            auto itDescriptor = auxData.find(descriptorKey);
 
 1218            const Descriptor::Ptr descriptor = std::any_cast<AttributeSet::Descriptor::Ptr>(itDescriptor->second);
 
 1229    const Index pass(
static_cast<uint16_t
>(meta->pass()));
 
 1230    const Index maximumPass(
static_cast<uint16_t
>(meta->pass() >> 16));
 
 1232    const Index attributes = (maximumPass - 4) / 2;
 
 1236        is.read(
reinterpret_cast<char*
>(&mVoxelBufferSize), 
sizeof(uint16_t));
 
 1237        Local::clearMatchingDescriptor(meta->auxData());
 
 1239    else if (pass == 1) {
 
 1241        if (Local::hasMatchingDescriptor(meta->auxData())) {
 
 1243            mAttributeSet->resetDescriptor(descriptor, 
true);
 
 1247            is.read(
reinterpret_cast<char*
>(&header), 
sizeof(uint8_t));
 
 1248            mAttributeSet->readDescriptor(is);
 
 1249            if (header & uint8_t(1)) {
 
 1251                Local::insertDescriptor(meta->auxData(), descriptor);
 
 1255            if (header & uint8_t(2)) {
 
 1256                uint64_t bytesToSkip;
 
 1257                is.read(
reinterpret_cast<char*
>(&bytesToSkip), 
sizeof(uint64_t));
 
 1258                if (bytesToSkip > uint64_t(0)) {
 
 1260                    if (metadata && metadata->seekable()) {
 
 1261                        is.seekg(bytesToSkip, std::ios_base::cur);
 
 1264                        std::vector<uint8_t> tempData(bytesToSkip);
 
 1265                        is.read(
reinterpret_cast<char*
>(&tempData[0]), bytesToSkip);
 
 1270            if (header > uint8_t(3)) {
 
 1274        mAttributeSet->readMetadata(is);
 
 1276    else if (pass < (attributes + 2)) {
 
 1278        const size_t attributeIndex = pass - 2;
 
 1280            mAttributeSet->get(attributeIndex) : 
nullptr;
 
 1283                Local::getOrInsertPagedStream(meta->auxData(), 
static_cast<Index>(attributeIndex));
 
 1289    else if (pass == attributes + 2) {
 
 1292        const Index passValue(meta->pass());
 
 1296        nonConstMeta.
setPass(mVoxelBufferSize);
 
 1302        nonConstMeta.
setPass(passValue);
 
 1304    else if (pass < (attributes*2 + 3)) {
 
 1306        const Index attributeIndex = pass - attributes - 3;
 
 1308            mAttributeSet->get(attributeIndex) : 
nullptr;
 
 1311                Local::getOrInsertPagedStream(meta->auxData(), attributeIndex);
 
 1317        if (pass > attributes + 3) {
 
 1318            Local::destroyPagedStream(meta->auxData(), attributeIndex-1);
 
 1323        const Index attributeIndex = pass - attributes - 4;
 
 1324        Local::destroyPagedStream(meta->auxData(), attributeIndex);
 
 
 1328template<
typename T, Index Log2Dim>
 
 1337            std::string key(
"paged:" + std::to_string(
index));
 
 1338            auto it = auxData.find(key);
 
 1339            if (it != auxData.end()) {
 
 1349            std::string key(
"paged:" + std::to_string(
index));
 
 1350            auto it = auxData.find(key);
 
 1351            if (it != auxData.end()) {
 
 1352                return *(std::any_cast<compression::PagedOutputStream::Ptr>(it->second));
 
 1357                return *pagedStream;
 
 1364            std::string descriptorKey(
"descriptorPtr");
 
 1365            std::string matchingKey(
"hasMatchingDescriptor");
 
 1366            auto itMatching = auxData.find(matchingKey);
 
 1367            auto itDescriptor = auxData.find(descriptorKey);
 
 1368            if (itMatching == auxData.end()) {
 
 1376                bool matching = std::any_cast<bool>(itMatching->second);
 
 1377                if (!matching)    
return;
 
 1381                const Descriptor::Ptr existingDescriptor = std::any_cast<AttributeSet::Descriptor::Ptr>(itDescriptor->second);
 
 1382                if (*existingDescriptor != *descriptor) {
 
 1390            std::string matchingKey(
"hasMatchingDescriptor");
 
 1391            auto itMatching = auxData.find(matchingKey);
 
 1393            if (itMatching == auxData.end())                
return false;
 
 1395            if (!std::any_cast<bool>(itMatching->second)) 
return false;
 
 1401            std::string descriptorKey(
"descriptorPtr");
 
 1402            auto itDescriptor = auxData.find(descriptorKey);
 
 1404            if (itDescriptor == auxData.end())              
return nullptr;
 
 1406            const Descriptor::Ptr descriptor = std::any_cast<AttributeSet::Descriptor::Ptr>(itDescriptor->second);
 
 1413            std::string matchingKey(
"hasMatchingDescriptor");
 
 1414            std::string descriptorKey(
"descriptorPtr");
 
 1415            auto itMatching = auxData.find(matchingKey);
 
 1416            auto itDescriptor = auxData.find(descriptorKey);
 
 1428    const Index pass(
static_cast<uint16_t
>(meta->pass()));
 
 1433    if (meta->countingPasses()) {
 
 1435        if (requiredPasses > pass) {
 
 1436            meta->setPass(requiredPasses);
 
 1441    const Index maximumPass(
static_cast<uint16_t
>(meta->pass() >> 16));
 
 1442    const Index attributes = (maximumPass - 4) / 2;
 
 1448        Local::insertDescriptor(meta->auxData(), mAttributeSet->descriptorPtr());
 
 1450    else if (pass == 1) {
 
 1452        bool matchingDescriptor = Local::hasMatchingDescriptor(meta->auxData());
 
 1453        if (matchingDescriptor) {
 
 1458                os.write(
reinterpret_cast<const char*
>(&header), 
sizeof(uint8_t));
 
 1459                mAttributeSet->writeDescriptor(os, 
false);
 
 1465            os.write(
reinterpret_cast<const char*
>(&header), 
sizeof(uint8_t));
 
 1466            mAttributeSet->writeDescriptor(os, 
false);
 
 1468        mAttributeSet->writeMetadata(os, 
false, 
true);
 
 1470    else if (pass < attributes + 2) {
 
 1472        const Index attributeIndex = pass - 2;
 
 1475            Local::destroyPagedStream(meta->auxData(), attributeIndex-1);
 
 1478            mAttributeSet->getConst(attributeIndex) : 
nullptr;
 
 1481                Local::getOrInsertPagedStream(meta->auxData(), attributeIndex);
 
 1487    else if (pass == attributes + 2) {
 
 1488        const Index attributeIndex = pass - 3;
 
 1489        Local::destroyPagedStream(meta->auxData(), attributeIndex);
 
 1493    else if (pass < (attributes*2 + 3)) {
 
 1495        const Index attributeIndex = pass - attributes - 3;
 
 1497        if (pass > attributes + 2) {
 
 1498            Local::destroyPagedStream(meta->auxData(), attributeIndex-1);
 
 1501            mAttributeSet->getConst(attributeIndex) : 
nullptr;
 
 1504                Local::getOrInsertPagedStream(meta->auxData(), attributeIndex);
 
 1511        Local::clearMatchingDescriptor(meta->auxData());
 
 1513        const Index attributeIndex = pass - attributes - 4;
 
 1514        Local::destroyPagedStream(meta->auxData(), attributeIndex);
 
 
 1518template<
typename T, Index Log2Dim>
 
 1525template<
typename T, Index Log2Dim>
 
 1532template<
typename T, Index Log2Dim>
 
 1539template<
typename T, Index Log2Dim>
 
 1546template<
typename T, Index Log2Dim>
 
 1557        const Index offsetX = (x & (
DIM-1u)) << 2*Log2Dim;
 
 1559            const Index offsetXY = offsetX + ((y & (
DIM-1u)) << Log2Dim);
 
 1561                const Index offset = offsetXY + (z & (
DIM-1u));
 
 
 1568template<
typename T, Index Log2Dim>
 
 1584template <
typename Po
intDataTreeT>
 
 1588    auto leafIter = 
tree.beginLeaf();
 
 1589    if (!leafIter)  
return nullptr;
 
 1592    auto newDescriptor = std::make_shared<AttributeSet::Descriptor>(descriptor);
 
 1593    for (; leafIter; ++leafIter) {
 
 1594        leafIter->resetDescriptor(newDescriptor);
 
 1597    return newDescriptor;
 
 
 1601template <
typename Po
intDataTreeT>
 
 1605    auto leafIter = 
tree.beginLeaf();
 
 1606    for (; leafIter; ++leafIter) {
 
 1607        for (
size_t i = 0; i < leafIter->attributeSet().size(); i++) {
 
 1608            leafIter->attributeArray(i).setStreaming(on);
 
 
 1614template <
typename Po
intDataTreeT>
 
 1621    auto leaf = 
tree.cbeginLeaf();
 
 1624    const auto& attributeSet = leaf->attributeSet();
 
 1628    for ( ; leaf; ++leaf) {
 
 1629        leaf->buffer().data();
 
 1634    size_t positionIndex = attributeSet.find(
"P");
 
 1637        for (leaf = 
tree.cbeginLeaf(); leaf; ++leaf) {
 
 1639            leaf->constAttributeArray(positionIndex).loadData();
 
 1645    if (otherAttributes) {
 
 1646        const size_t attributes = attributeSet.size();
 
 1647        for (
size_t attributeIndex = 0; attributeIndex < attributes; attributeIndex++) {
 
 1648            if (attributeIndex == positionIndex)     
continue;
 
 1649            for (leaf = 
tree.cbeginLeaf(); leaf; ++leaf) {
 
 1651                leaf->constAttributeArray(attributeIndex).loadData();
 
 
 1675template<
typename HeadT, 
int HeadLevel>
 
 1680    using Type = 
typename SubtreeT::template Append<RootNodeT>;
 
 
 1685template <
typename ChildT, Index Log2Dim, 
int HeadLevel>
 
 1690    using Type = 
typename SubtreeT::template Append<InternalNodeT>;
 
 
 1695template <
typename ChildT, Index Log2Dim>
 
 1709template <
typename TreeType>
 
 1728template<Index Dim1, 
typename T2>
 
#define OPENVDB_ASSERT(X)
Definition Assert.h:41
Attribute array storage for string data using Descriptor Metadata.
Attribute Array storage templated on type and compression codec.
Attribute Group access and filtering for iteration.
Set of Attribute Arrays which tracks metadata about each array.
#define VMASK_
Definition PointDataGrid.h:702
Space-partitioning acceleration structure for points. Partitions the points into voxels to accelerate...
Convenience wrappers to using Blosc and reading and writing of Paged data.
static CoordBBox inf()
Return an "infinite" bounding box, as defined by the Coord value range.
Definition Coord.h:322
Container class that associates a tree with a transform and metadata.
Definition Grid.h:571
Definition Exceptions.h:57
Definition Exceptions.h:58
Definition Exceptions.h:60
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
Definition Exceptions.h:65
A Paging wrapper to std::istream that is responsible for reading from a given input stream and creati...
Definition StreamCompression.h:208
void setSizeOnly(bool sizeOnly)
Size-only mode tags the stream as only reading size data.
Definition StreamCompression.h:217
void setInputStream(std::istream &is)
Definition StreamCompression.h:222
std::shared_ptr< PagedInputStream > Ptr
Definition StreamCompression.h:210
A Paging wrapper to std::ostream that is responsible for writing from a given output stream at interv...
Definition StreamCompression.h:245
void setSizeOnly(bool sizeOnly)
Size-only mode tags the stream as only writing size data.
Definition StreamCompression.h:254
void setOutputStream(std::ostream &os)
Definition StreamCompression.h:259
std::shared_ptr< PagedOutputStream > Ptr
Definition StreamCompression.h:247
void flush()
Manually flushes the current page to disk if non-zero.
Axis-aligned bounding box of signed integer coordinates.
Definition Coord.h:252
const Coord & min() const
Definition Coord.h:324
const Coord & max() const
Definition Coord.h:325
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
Int32 z() const
Definition Coord.h:133
Definition AttributeArray.h:120
Base class for storing attribute data.
Definition AttributeArray.h:94
std::shared_ptr< AttributeArray > Ptr
Definition AttributeArray.h:126
virtual Index size() const =0
virtual bool compact()=0
Compact the existing array to become uniform if all values are identical.
virtual void readPagedBuffers(compression::PagedInputStream &)=0
Read attribute buffers from a paged stream.
virtual void writePagedBuffers(compression::PagedOutputStream &, bool outputTransient) const =0
An immutable object that stores name, type and AttributeSet position for a constant collection of att...
Definition AttributeSet.h:311
Util::GroupIndex GroupIndex
Definition AttributeSet.h:317
std::shared_ptr< Descriptor > Ptr
Definition AttributeSet.h:313
Ordered collection of uniquely-named attribute arrays.
Definition AttributeSet.h:40
@ INVALID_POS
Definition AttributeSet.h:42
std::unique_ptr< AttributeSet > UniquePtr
Definition AttributeSet.h:46
std::shared_ptr< Descriptor > DescriptorPtr
Definition AttributeSet.h:50
Index filtering on group membership.
Definition AttributeGroup.h:136
static index::State state()
Definition AttributeGroup.h:146
Definition AttributeGroup.h:74
Definition AttributeGroup.h:103
A forward iterator over array indices with filtering IteratorT can be either IndexIter or ValueIndexI...
Definition IndexIterator.h:141
A no-op filter that can be used when iterating over all indices.
Definition IndexIterator.h:52
Definition PointDataGrid.h:240
ChildOnCIter cbeginChildOn() const
Definition PointDataGrid.h:723
CoordBBox getNodeBoundingBox() const
Return the bounding box of this node, i.e., the full index space spanned by this leaf node.
Definition PointDataGrid.h:1541
IndexIter< ValueAllCIter, NullFilter > IndexAllIter
Definition PointDataGrid.h:654
void setValueOn(Index offset)
Definition PointDataGrid.h:544
void setValueOff(const Coord &, const ValueType &)
Definition PointDataGrid.h:540
ChildOnCIter beginChildOn() const
Definition PointDataGrid.h:724
ChildOnIter beginChildOn()
Definition PointDataGrid.h:725
void setActiveStateAndCache(const Coord &xyz, bool on, AccessorT &parent)
Definition PointDataGrid.h:582
void replaceAttributeSet(AttributeSet *attributeSet, bool allowMismatchingDescriptors=false)
Replace the underlying attribute set with the given attributeSet.
Definition PointDataGrid.h:850
typename BaseLeaf::template ValueIter< MaskOffIterator, const PointDataLeafNode, const ValueType, ValueOff > ValueOffCIter
Definition PointDataGrid.h:634
GroupWriteHandle groupWriteHandle(const Name &name)
Read-write group handle from group name.
Definition PointDataGrid.h:991
const AttributeArray & constAttributeArray(const Name &attributeName) const
Definition PointDataGrid.h:952
IndexIter< ValueOffCIter, NullFilter > IndexOffIter
Definition PointDataGrid.h:656
ValueOnIter endValueOn()
Definition PointDataGrid.h:715
PointDataLeafNode< T, Log2Dim > LeafNodeType
Definition PointDataGrid.h:243
void writeTopology(std::ostream &os, bool toHalf=false) const
Definition PointDataGrid.h:1128
util::NodeMask< Log2Dim > NodeMaskType
Definition PointDataGrid.h:258
AttributeArray::Ptr appendAttribute(const Descriptor &expected, Descriptor::Ptr &replacement, const size_t pos, const Index strideOrTotalSize=1, const bool constantStride=true, const Metadata *metadata=nullptr, const AttributeArray::ScopedRegistryLock *lock=nullptr)
Append an attribute to the leaf.
Definition PointDataGrid.h:806
PointDataLeafNode * touchLeaf(const Coord &)
Return a pointer to this node.
Definition PointDataGrid.h:459
PointDataLeafNode(const tools::PointIndexLeafNode< OtherValueType, Log2Dim > &other)
Definition PointDataGrid.h:297
ValueOffCIter cbeginValueOff() const
Definition PointDataGrid.h:706
PointDataLeafNode * touchLeafAndCache(const Coord &, AccessorT &)
Definition PointDataGrid.h:461
void validateOffsets() const
Throws an error if the voxel values on this leaf are not monotonically increasing or within the bound...
Definition PointDataGrid.h:887
PointDataLeafNode(const PointDataLeafNode &other, const Coord &coords, const T &value=zeroVal< T >(), bool active=false)
Definition PointDataGrid.h:287
bool operator==(const PointDataLeafNode &other) const
Definition PointDataGrid.h:446
const AttributeArray & attributeArray(const size_t pos) const
Definition PointDataGrid.h:919
bool hasSameTopology(const PointDataLeafNode< OtherType, OtherLog2Dim > *other) const
Return true if the given node (which may have a different ValueType than this node) has the same acti...
Definition PointDataGrid.h:440
ChildOnIter endChildOn()
Definition PointDataGrid.h:735
ValueAllIter endValueAll()
Definition PointDataGrid.h:721
GroupWriteHandle groupWriteHandle(const AttributeSet::Descriptor::GroupIndex &index)
Read-write group handle from group index.
Definition PointDataGrid.h:979
typename BaseLeaf::template ChildIter< MaskOnIterator, PointDataLeafNode, ChildOn > ChildOnIter
Definition PointDataGrid.h:640
void modifyValue(Index, const ModifyOp &)
Definition PointDataGrid.h:555
Index64 groupPointCount(const Name &groupName) const
Compute the point count in a specific group for the leaf.
Definition PointDataGrid.h:1079
void setValueOn(Index, const ValueType &)
Definition PointDataGrid.h:547
void setValuesOff()
Definition PointDataGrid.h:552
ValueAllCIter endValueAll() const
Definition PointDataGrid.h:720
const PointDataLeafNode * probeLeaf(const Coord &) const
Definition PointDataGrid.h:483
ChildOffCIter endChildOff() const
Definition PointDataGrid.h:737
void setValueOff(Index, const ValueType &)
Definition PointDataGrid.h:541
PointDataLeafNode(PartialCreate, const Coord &coords, const T &value=zeroVal< T >(), bool active=false)
Definition PointDataGrid.h:315
ValueAllCIter cbeginValueAll() const
Definition PointDataGrid.h:709
typename BaseLeaf::ChildOff ChildOff
Definition PointDataGrid.h:607
AttributeArray & attributeArray(const size_t pos)
Read-write attribute array reference from index.
Definition PointDataGrid.h:911
typename BaseLeaf::template ValueIter< MaskOnIterator, const PointDataLeafNode, const ValueType, ValueOn > ValueOnCIter
Definition PointDataGrid.h:630
void readTopology(std::istream &is, bool fromHalf=false)
Definition PointDataGrid.h:1121
const PointDataLeafNode * probeConstLeaf(const Coord &) const
Return a const pointer to this node.
Definition PointDataGrid.h:478
void setValueOnly(Index, const ValueType &)
Definition PointDataGrid.h:535
tree::LeafNode< T, Log2Dim > BaseLeaf
Definition PointDataGrid.h:257
GroupHandle groupHandle(const Name &group) const
Read-only group handle from group name.
Definition PointDataGrid.h:971
std::shared_ptr< PointDataLeafNode > Ptr
Definition PointDataGrid.h:244
IndexAllIter beginIndexAll() const
Leaf index iterator.
Definition PointDataGrid.h:659
ValueOnCIter beginValueOn() const
Definition PointDataGrid.h:704
void clearAttributes(const bool updateValueMask=true, const AttributeArray::ScopedRegistryLock *lock=nullptr)
Clear the attribute set.
Definition PointDataGrid.h:775
bool hasAttribute(const Name &attributeName) const
Returns true if an attribute with this name exists.
Definition PointDataGrid.h:798
typename BaseLeaf::ChildOn ChildOn
Definition PointDataGrid.h:606
void signedFloodFill(const ValueType &, const ValueType &)
Definition PointDataGrid.h:591
PointDataLeafNode(const PointDataLeafNode &other)
Construct using deep copy of other PointDataLeafNode.
Definition PointDataGrid.h:275
void modifyValueAndActiveState(const Coord &, const ModifyOp &)
Definition PointDataGrid.h:561
typename BaseLeaf::ChildAll ChildAll
Definition PointDataGrid.h:608
IndexIter< IterT, FilterT > beginIndex(const FilterT &filter) const
IndexIter< ValueVoxelCIter, NullFilter > IndexVoxelIter
Definition PointDataGrid.h:653
ValueOnCIter cendValueOn() const
Definition PointDataGrid.h:713
void setOffsetOnly(Index offset, const ValueType &val)
Definition PointDataGrid.h:1114
Index64 pointCount() const
Compute the total point count for the leaf.
Definition PointDataGrid.h:1054
ValueOffCIter beginValueOff() const
Definition PointDataGrid.h:707
void resetDescriptor(const Descriptor::Ptr &replacement)
Replace the descriptor with a new one The new Descriptor must exactly match the old one.
Definition PointDataGrid.h:865
typename BaseLeaf::template ChildIter< MaskOffIterator, PointDataLeafNode, ChildOff > ChildOffIter
Definition PointDataGrid.h:644
IndexOffIter beginIndexOff() const
Definition PointDataGrid.h:669
ChildAllCIter cbeginChildAll() const
Definition PointDataGrid.h:729
ChildOffIter endChildOff()
Definition PointDataGrid.h:738
void modifyValueAndActiveStateAndCache(const Coord &, const ModifyOp &, AccessorT &)
Definition PointDataGrid.h:574
void setValueOnly(const Coord &, const ValueType &)
Definition PointDataGrid.h:534
ChildAllIter beginChildAll()
Definition PointDataGrid.h:731
void renameAttributes(const Descriptor &expected, Descriptor::Ptr &replacement)
Rename attributes in attribute set (order must remain the same).
Definition PointDataGrid.h:833
const PointDataLeafNode * probeConstLeafAndCache(const Coord &, AccessorT &) const
Definition PointDataGrid.h:480
static const Index DIM
Definition LeafNode.h:51
void setActiveState(const Coord &xyz, bool on)
Definition PointDataGrid.h:531
ValueOnIter beginValueOn()
Definition PointDataGrid.h:705
void initializeAttributes(const Descriptor::Ptr &descriptor, const Index arrayLength, const AttributeArray::ScopedRegistryLock *lock=nullptr)
Create a new attribute set. Existing attributes will be removed.
Definition PointDataGrid.h:760
ValueVoxelCIter beginValueVoxel(const Coord &ijk) const
Leaf value voxel iterator.
Definition PointDataGrid.h:1024
NodeT * probeNodeAndCache(const Coord &, AccessorT &)
Definition PointDataGrid.h:464
IndexIter< ValueAllCIter, FilterT > beginIndexAll(const FilterT &filter) const
Filtered leaf index iterator.
Definition PointDataGrid.h:680
void assertNonModifiableUnlessZero(const ValueType &value)
Definition PointDataGrid.h:527
const PointDataLeafNode * probeLeafAndCache(const Coord &, AccessorT &) const
Definition PointDataGrid.h:482
ChildOffCIter cbeginChildOff() const
Definition PointDataGrid.h:726
ChildOffIter beginChildOff()
Definition PointDataGrid.h:728
ChildOffCIter beginChildOff() const
Definition PointDataGrid.h:727
void dropAttributes(const std::vector< size_t > &pos, const Descriptor &expected, Descriptor::Ptr &replacement)
Drop list of attributes.
Definition PointDataGrid.h:818
void compactAttributes()
Compact all attributes in attribute set.
Definition PointDataGrid.h:840
void setValueOff(const Coord &xyz)
Definition PointDataGrid.h:537
bool operator!=(const PointDataLeafNode &other) const
Definition PointDataGrid.h:451
Index buffers() const
Definition PointDataGrid.h:1135
ValueOffIter endValueOff()
Definition PointDataGrid.h:718
void setValueOff(Index offset)
Definition PointDataGrid.h:538
IndexIter< ValueOnCIter, FilterT > beginIndexOn(const FilterT &filter) const
Definition PointDataGrid.h:685
ChildAllCIter endChildAll() const
Definition PointDataGrid.h:740
void setOffsets(const std::vector< ValueType > &offsets, const bool updateValueMask=true)
Sets all of the voxel offset values on this leaf, from the given vector of offsets....
Definition PointDataGrid.h:872
const NodeT * probeConstNodeAndCache(const Coord &, AccessorT &) const
Definition PointDataGrid.h:485
void setOffsetOn(Index offset, const ValueType &val)
Definition PointDataGrid.h:1106
ValueOnCIter cbeginValueOn() const
Definition PointDataGrid.h:703
void writeBuffers(std::ostream &os, bool toHalf=false) const
Definition PointDataGrid.h:1330
IndexIter< ValueOnCIter, NullFilter > IndexOnIter
Definition PointDataGrid.h:655
void clip(const CoordBBox &, const ValueType &value)
Definition PointDataGrid.h:564
ChildOnCIter endChildOn() const
Definition PointDataGrid.h:734
void reorderAttributes(const Descriptor::Ptr &replacement)
Reorder attribute set.
Definition PointDataGrid.h:826
ChildOnCIter cendChildOn() const
Definition PointDataGrid.h:733
void fill(const ValueType &, bool)
Definition PointDataGrid.h:1570
ChildAllCIter cendChildAll() const
Definition PointDataGrid.h:739
PointDataLeafNode()
Default constructor.
Definition PointDataGrid.h:269
const AttributeSet & attributeSet() const
Retrieve the attribute set.
Definition PointDataGrid.h:323
void assertNonmodifiable()
Definition PointDataGrid.h:520
Index64 memUsageIfLoaded() const
Definition PointDataGrid.h:1527
void setValueOffAndCache(const Coord &, const ValueType &, AccessorT &)
Definition PointDataGrid.h:579
ChildAllIter endChildAll()
Definition PointDataGrid.h:741
IndexIter< ValueOffCIter, FilterT > beginIndexOff(const FilterT &filter) const
Definition PointDataGrid.h:690
bool hasAttribute(const size_t pos) const
Returns true if an attribute with this index exists.
Definition PointDataGrid.h:791
GroupHandle groupHandle(const AttributeSet::Descriptor::GroupIndex &index) const
}
Definition PointDataGrid.h:959
void resetBackground(const ValueType &, const ValueType &newBackground)
Definition PointDataGrid.h:586
typename NodeMaskType::OffIterator MaskOffIterator
Definition PointDataGrid.h:611
PointDataLeafNode(const tree::LeafNode< ValueType, Log2Dim > &other, const T &value, TopologyCopy)
Definition PointDataGrid.h:304
AttributeSet::UniquePtr stealAttributeSet()
Steal the attribute set, a new, empty attribute set is inserted in it's place.
Definition PointDataGrid.h:751
void readBuffers(std::istream &is, bool fromHalf=false)
Definition PointDataGrid.h:1147
void setValue(const Coord &, const ValueType &)
Definition PointDataGrid.h:549
ValueAllCIter cendValueAll() const
Definition PointDataGrid.h:719
~PointDataLeafNode()=default
static const Index NUM_VALUES
Definition LeafNode.h:52
void negate()
Definition PointDataGrid.h:593
typename BaseLeaf::template ValueIter< MaskOnIterator, PointDataLeafNode, const ValueType, ValueOn > ValueOnIter
Definition PointDataGrid.h:628
ChildAllCIter beginChildAll() const
Definition PointDataGrid.h:730
typename BaseLeaf::ValueAll ValueAll
Definition PointDataGrid.h:599
std::pair< ValueType, ValueType > ValueTypePair
Definition PointDataGrid.h:247
void setValuesOn()
Definition PointDataGrid.h:551
AttributeSet::Descriptor Descriptor
Definition PointDataGrid.h:250
typename BaseLeaf::template DenseIter< const PointDataLeafNode, const ValueType, ChildAll > ChildAllCIter
Definition PointDataGrid.h:650
typename BaseLeaf::ValueOn ValueOn
Definition PointDataGrid.h:597
ChildOffCIter cendChildOff() const
Definition PointDataGrid.h:736
typename BaseLeaf::template ChildIter< MaskOnIterator, const PointDataLeafNode, ChildOn > ChildOnCIter
Definition PointDataGrid.h:642
void addLeafAndCache(PointDataLeafNode *, AccessorT &)
Definition PointDataGrid.h:455
void setValueOnlyAndCache(const Coord &, const ValueType &, AccessorT &)
Definition PointDataGrid.h:571
IndexIter< ValueVoxelCIter, FilterT > beginIndexVoxel(const Coord &ijk, const FilterT &filter) const
Filtered leaf index iterator from voxel.
Definition PointDataGrid.h:1044
void fill(const ValueType &value)
Definition PointDataGrid.h:567
typename NodeMaskType::OnIterator MaskOnIterator
Definition PointDataGrid.h:610
void addLeaf(PointDataLeafNode *)
Definition PointDataGrid.h:453
static const Index SIZE
Definition LeafNode.h:54
void evalActiveBoundingBox(CoordBBox &bbox, bool visitVoxels=true) const
Definition PointDataGrid.h:1534
const AttributeArray & constAttributeArray(const size_t pos) const
Definition PointDataGrid.h:927
void signedFloodFill(const ValueType &)
Definition PointDataGrid.h:590
typename BaseLeaf::template ValueIter< MaskOffIterator, PointDataLeafNode, const ValueType, ValueOff > ValueOffIter
Definition PointDataGrid.h:632
ValueOffIter beginValueOff()
Definition PointDataGrid.h:708
void setValueOn(const Coord &xyz)
Definition PointDataGrid.h:543
void setActiveState(Index offset, bool on)
Definition PointDataGrid.h:532
AttributeArray & attributeArray(const Name &attributeName)
Read-write attribute array reference from name.
Definition PointDataGrid.h:934
IndexOnIter beginIndexOn() const
Definition PointDataGrid.h:664
typename BaseLeaf::ValueOff ValueOff
Definition PointDataGrid.h:598
typename BaseLeaf::template DenseIter< PointDataLeafNode, ValueType, ChildAll > ChildAllIter
Definition PointDataGrid.h:648
IndexVoxelIter beginIndexVoxel(const Coord &ijk) const
Leaf index iterator from voxel.
Definition PointDataGrid.h:1035
Index64 offPointCount() const
Compute the total inactive (off) point count for the leaf.
Definition PointDataGrid.h:1070
void modifyValue(const Coord &, const ModifyOp &)
Definition PointDataGrid.h:558
ValueOffCIter cendValueOff() const
Definition PointDataGrid.h:716
Index64 memUsage() const
Definition PointDataGrid.h:1520
void fill(const CoordBBox &, const ValueType &, bool)
Definition PointDataGrid.h:1548
Index64 onPointCount() const
Compute the total active (on) point count for the leaf.
Definition PointDataGrid.h:1061
ValueOffCIter endValueOff() const
Definition PointDataGrid.h:717
typename BaseLeaf::template ValueIter< MaskDenseIterator, const PointDataLeafNode, const ValueType, ValueAll > ValueAllCIter
Definition PointDataGrid.h:638
typename BaseLeaf::template ChildIter< MaskOffIterator, const PointDataLeafNode, ChildOff > ChildOffCIter
Definition PointDataGrid.h:646
PointDataLeafNode * probeLeaf(const Coord &)
Definition PointDataGrid.h:471
T ValueType
Definition PointDataGrid.h:246
PointDataLeafNode * probeLeafAndCache(const Coord &, AccessorT &)
Definition PointDataGrid.h:473
ValueOnCIter endValueOn() const
Definition PointDataGrid.h:714
typename NodeMaskType::DenseIterator MaskDenseIterator
Definition PointDataGrid.h:612
ValueAllCIter beginValueAll() const
Definition PointDataGrid.h:710
PointDataLeafNode(const Coord &coords, const T &value=zeroVal< T >(), bool active=false)
Construct using supplied origin, value and active status.
Definition PointDataGrid.h:281
typename BaseLeaf::template ValueIter< MaskDenseIterator, PointDataLeafNode, const ValueType, ValueAll > ValueAllIter
Definition PointDataGrid.h:636
PointDataLeafNode(const tree::LeafNode< ValueType, Log2Dim > &other, const T &, const T &, TopologyCopy)
Definition PointDataGrid.h:311
void readBuffers(std::istream &is, const CoordBBox &, bool fromHalf=false)
Definition PointDataGrid.h:1154
const AttributeArray & attributeArray(const Name &attributeName) const
Definition PointDataGrid.h:943
friend class PointDataLeafNode
Definition PointDataGrid.h:616
void setValueOn(const Coord &, const ValueType &)
Definition PointDataGrid.h:546
ValueAllIter beginValueAll()
Definition PointDataGrid.h:711
std::vector< ValueType > IndexArray
Definition PointDataGrid.h:248
static TypedAttributeArray & cast(AttributeArray &attributeArray)
A forward iterator over array indices in a single voxel.
Definition IndexIterator.h:66
Definition InternalNode.h:35
Base class for iterators over internal and leaf nodes.
Definition Iterator.h:30
Templated block class to hold specific data types and a fixed number of values determined by Log2Dim....
Definition LeafNode.h:39
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
void writeTopology(std::ostream &os, bool toHalf=false) const
Write out just the topology.
Definition LeafNode.h:1306
void setValueMask(const NodeMaskType &mask)
Definition LeafNode.h:887
void setValuesOff()
Mark all voxels as inactive but don't change their values.
Definition LeafNode.h:475
void readTopology(std::istream &is, bool fromHalf=false)
Read in just the topology.
Definition LeafNode.h:1298
const Buffer & buffer() const
Definition LeafNode.h:348
void setValueMaskOn(Index n)
Definition LeafNode.h:893
static const Index NUM_VOXELS
Definition LeafNode.h:53
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
static const Index LEVEL
Definition LeafNode.h:55
static Index coordToOffset(const Coord &xyz)
Return the linear table offset of the given global or local coordinates.
Definition LeafNode.h:1040
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
void writeBuffers(std::ostream &os, bool toHalf=false) const
Write buffers to a stream.
Definition LeafNode.h:1432
Index64 memUsageIfLoaded() const
Definition LeafNode.h:1469
void readBuffers(std::istream &is, bool fromHalf=false)
Read buffers from a stream.
Definition LeafNode.h:1334
static const Index NUM_VALUES
Definition LeafNode.h:52
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
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
static const Index LOG2DIM
Definition LeafNode.h:49
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 setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition LeafNode.h:420
static const Index TOTAL
Definition LeafNode.h:50
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
const ValueType & getLastValue() const
Return a const reference to the last value in the buffer.
Definition LeafNode.h:634
Bit mask for the internal and leaf nodes of VDB. This is a 64-bit implementation.
Definition NodeMasks.h:308
DenseMaskIterator< NodeMask > DenseIterator
Definition NodeMasks.h:350
OnMaskIterator< NodeMask > OnIterator
Definition NodeMasks.h:348
OffMaskIterator< NodeMask > OffIterator
Definition NodeMasks.h:349
OPENVDB_API void bloscDecompress(char *uncompressedBuffer, const size_t expectedBytes, const size_t bufferBytes, const char *compressedBuffer)
Decompress into the supplied buffer. Will throw if decompression fails or uncompressed buffer has ins...
OPENVDB_API size_t bloscCompressedSize(const char *buffer, const size_t uncompressedBytes)
Convenience wrapper to retrieve the compressed size of buffer when compressed.
OPENVDB_API void bloscCompress(char *compressedBuffer, size_t &compressedBytes, const size_t bufferBytes, const char *uncompressedBuffer, const size_t uncompressedBytes)
Compress into the supplied buffer.
void writeCompressedValues(std::ostream &os, ValueT *srcBuf, Index srcCount, const MaskT &valueMask, const MaskT &childMask, bool toHalf)
Definition Compression.h:646
void readCompressedValues(std::istream &is, ValueT *destBuf, Index destCount, const MaskT &valueMask, bool fromHalf)
Definition Compression.h:466
OPENVDB_API SharedPtr< StreamMetadata > getStreamMetadataPtr(std::ios_base &)
Return a shared pointer to an object that stores metadata (file format, compression scheme,...
size_t writeCompressedValuesSize(ValueT *srcBuf, Index srcCount, const MaskT &valueMask, uint8_t maskMetadata, bool toHalf, uint32_t compress)
Definition Compression.h:592
Definition IndexIterator.h:35
@ ALL
Definition IndexIterator.h:44
@ NONE
Definition IndexIterator.h:43
void initialize()
Global registration of point data-related types.
void uninitialize()
Global deregistration of point data-related types.
Definition AttributeArray.h:42
void setStreamingMode(PointDataTreeT &tree, bool on=true)
Toggle the streaming mode on all attributes in the tree to collapse the attributes after deconstructi...
Definition PointDataGrid.h:1603
void prefetch(PointDataTreeT &tree, bool position=true, bool otherAttributes=true)
Sequentially pre-fetch all delayed-load voxel and attribute data from disk in order to accelerate sub...
Definition PointDataGrid.h:1616
tree::Tree< tree::RootNode< tree::InternalNode< tree::InternalNode< PointDataLeafNode< PointDataIndex32, 3 >, 4 >, 5 > > > PointDataTree
Point index tree configured to match the default VDB configurations.
Definition PointDataGrid.h:190
bool isGroup(const AttributeArray &array)
Definition AttributeGroup.h:64
TypedAttributeArray< GroupType, GroupCodec > GroupAttributeArray
Definition AttributeGroup.h:41
Grid< PointDataTree > PointDataGrid
Point data grid.
Definition PointDataGrid.h:195
Index64 iterCount(const IterT &iter)
Count up the number of times the iterator can iterate.
Definition IndexIterator.h:315
AttributeSet::Descriptor::Ptr makeDescriptorUnique(PointDataTreeT &tree)
Deep copy the descriptor across all leaf nodes.
Definition PointDataGrid.h:1586
Definition PointDataGrid.h:170
std::string Name
Definition Name.h:19
Index32 Index
Definition Types.h:54
constexpr T zeroVal()
Return the value of type T that corresponds to zero.
Definition Math.h:70
int32_t Int32
Definition Types.h:56
uint64_t Index64
Definition Types.h:53
const char * typeNameAsString()
Definition Types.h:516
PointIndex< Index32, 1 > PointDataIndex32
Definition Types.h:181
Definition Exceptions.h:13
#define OPENVDB_THROW(exception, message)
Definition Exceptions.h:74
static pnanovdb_uint32_t allocate(pnanovdb_uint32_t *poffset, pnanovdb_uint32_t size, pnanovdb_uint32_t alignment)
Definition pnanovdb_validate_strides.h:20
A list of types (not necessarily unique)
Definition TypeList.h:578
Leaf nodes that require multi-pass I/O must inherit from this struct.
Definition io.h:124
Similiar to ValueConverter, but allows for tree configuration conversion to a PointDataTree....
Definition PointDataGrid.h:1710
tree::Tree< typename NodeChainT::Back > Type
Definition PointDataGrid.h:1713
typename TreeType::RootNodeType RootNodeT
Definition PointDataGrid.h:1711
typename internal::PointDataNodeChain< RootNodeT, RootNodeT::LEVEL >::Type NodeChainT
Definition PointDataGrid.h:1712
typename PointDataNodeChain< ChildT, HeadLevel-1 >::Type SubtreeT
Definition PointDataGrid.h:1688
typename SubtreeT::template Append< InternalNodeT > Type
Definition PointDataGrid.h:1690
tree::InternalNode< typename SubtreeT::Back, Log2Dim > InternalNodeT
Definition PointDataGrid.h:1689
tree::InternalNode< LeafNodeT, Log2Dim > InternalNodeT
Definition PointDataGrid.h:1699
TypeList< LeafNodeT, InternalNodeT > Type
Definition PointDataGrid.h:1700
PointDataLeafNode< PointDataIndex32, ChildT::LOG2DIM > LeafNodeT
Definition PointDataGrid.h:1698
Recursive node chain which generates a openvdb::TypeList value converted types of nodes to PointDataG...
Definition PointDataGrid.h:1677
tree::RootNode< typename SubtreeT::Back > RootNodeT
Definition PointDataGrid.h:1679
typename PointDataNodeChain< typename HeadT::ChildNodeType, HeadLevel-1 >::Type SubtreeT
Definition PointDataGrid.h:1678
typename SubtreeT::template Append< RootNodeT > Type
Definition PointDataGrid.h:1680
Definition TreeIterator.h:61
Definition LeafNode.h:213
Leaf nodes have no children, so their child iterators have no get/set accessors.
Definition LeafNode.h:253
Definition LeafNode.h:213
Definition LeafNode.h:213
Definition LeafNode.h:262
Definition LeafNode.h:212
Definition LeafNode.h:221
Definition LeafNode.h:212
Definition LeafNode.h:212
static const bool value
Definition PointDataGrid.h:1729
Definition LeafNode.h:920
#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