39 #ifndef OPENVDB_POINTS_POINT_DATA_GRID_HAS_BEEN_INCLUDED 40 #define OPENVDB_POINTS_POINT_DATA_GRID_HAS_BEEN_INCLUDED 42 #include <openvdb/version.h> 43 #include <openvdb/Grid.h> 44 #include <openvdb/tree/Tree.h> 45 #include <openvdb/tree/LeafNode.h> 46 #include <openvdb/tools/PointIndexGrid.h> 56 #include <type_traits> 60 #include <boost/mpl/vector.hpp> 61 #include <boost/mpl/push_back.hpp> 62 #include <boost/mpl/back.hpp> 64 class TestPointDataLeaf;
82 const bool seek = destBuf ==
nullptr;
86 if (destBytes >= maximumBytes) {
88 maximumBytes <<
" bytes in voxel values.")
98 bytes16 =
static_cast<uint16_t
>(meta->pass());
100 is.seekg(
sizeof(uint16_t), std::ios_base::cur);
104 is.read(reinterpret_cast<char*>(&bytes16),
sizeof(uint16_t));
110 is.seekg(destBytes, std::ios_base::cur);
113 is.read(reinterpret_cast<char*>(destBuf), destBytes);
119 is.seekg(
int(bytes16), std::ios_base::cur);
123 std::unique_ptr<char[]> bloscBuffer(
new char[
int(bytes16)]);
124 is.read(bloscBuffer.get(), bytes16);
128 std::memcpy(destBuf, buffer.get(), destBytes);
145 if (srcBytes >= maximumBytes) {
147 maximumBytes <<
" bytes in voxel values.")
150 const char* charBuffer =
reinterpret_cast<const char*
>(srcBuf);
152 size_t compressedBytes;
153 std::unique_ptr<char[]> buffer =
bloscCompress( charBuffer, srcBytes,
154 compressedBytes,
false);
156 if (compressedBytes > 0) {
157 auto bytes16 =
static_cast<uint16_t
>(compressedBytes);
158 os.write(reinterpret_cast<const char*>(&bytes16),
sizeof(uint16_t));
159 os.write(reinterpret_cast<const char*>(buffer.get()), compressedBytes);
162 auto bytes16 =
static_cast<uint16_t
>(maximumBytes);
163 os.write(reinterpret_cast<const char*>(&bytes16),
sizeof(uint16_t));
164 os.write(reinterpret_cast<const char*>(srcBuf), srcBytes);
168 template <
typename T>
174 const size_t srcBytes = srcCount*
sizeof(T);
176 if (srcBytes >= maximumBytes) {
178 maximumBytes <<
" bytes in voxel values.")
181 const char* charBuffer =
reinterpret_cast<const char*
>(srcBuf);
186 if (compressedBytes > 0) {
187 auto bytes16 =
static_cast<uint16_t
>(compressedBytes);
188 os.write(reinterpret_cast<const char*>(&bytes16),
sizeof(uint16_t));
191 auto bytes16 =
static_cast<uint16_t
>(maximumBytes);
192 os.write(reinterpret_cast<const char*>(&bytes16),
sizeof(uint16_t));
230 template <
typename Po
intDataTreeT>
231 inline AttributeSet::Descriptor::Ptr
244 template <
typename Po
intDataTreeT>
255 template <
typename Po
intDataTreeT>
257 prefetch(PointDataTreeT& tree,
bool position =
true,
bool otherAttributes =
true);
263 template <
typename T, Index Log2Dim>
268 using Ptr = std::shared_ptr<PointDataLeafNode>;
284 using BaseLeaf::LOG2DIM;
285 using BaseLeaf::TOTAL;
287 using BaseLeaf::NUM_VALUES;
288 using BaseLeaf::NUM_VOXELS;
289 using BaseLeaf::SIZE;
290 using BaseLeaf::LEVEL;
301 , mAttributeSet(new
AttributeSet(*other.mAttributeSet)) { }
307 , mAttributeSet(new
AttributeSet) { assertNonModifiableUnlessZero(value); }
312 const T& value = zeroVal<T>(),
bool active =
false)
316 assertNonModifiableUnlessZero(value);
320 template<
typename OtherValueType>
327 template <
typename ValueType>
330 , mAttributeSet(new
AttributeSet) { assertNonModifiableUnlessZero(value); }
334 template <
typename ValueType>
339 #if OPENVDB_ABI_VERSION_NUMBER >= 3 341 const T& value = zeroVal<T>(),
bool active =
false)
343 , mAttributeSet(new
AttributeSet) { assertNonModifiableUnlessZero(value); }
352 void initializeAttributes(
const Descriptor::Ptr& descriptor,
const Index arrayLength);
354 void clearAttributes(
const bool updateValueMask =
true);
358 bool hasAttribute(
const size_t pos)
const;
361 bool hasAttribute(
const Name& attributeName)
const;
370 const size_t pos,
const Index strideOrTotalSize = 1,
371 const bool constantStride =
true);
378 const Descriptor& expected, Descriptor::Ptr& replacement);
381 void reorderAttributes(
const Descriptor::Ptr& replacement);
394 void replaceAttributeSet(
AttributeSet* attributeSet,
bool allowMismatchingDescriptors =
false);
398 void resetDescriptor(
const Descriptor::Ptr& replacement);
403 void setOffsets(
const std::vector<ValueType>& offsets,
const bool updateValueMask =
true);
407 void validateOffsets()
const;
413 const AttributeArray& constAttributeArray(
const size_t pos)
const;
423 GroupHandle groupHandle(
const AttributeSet::Descriptor::GroupIndex& index)
const;
427 GroupWriteHandle groupWriteHandle(
const AttributeSet::Descriptor::GroupIndex& index);
441 void updateValueMask();
450 template<
typename OtherType, Index OtherLog2Dim>
452 return BaseLeaf::hasSameTopology(other);
458 if(BaseLeaf::operator==(other) !=
true)
return false;
459 return (*this->mAttributeSet == *other.mAttributeSet);
465 template<
typename AccessorT>
471 template<
typename AccessorT>
474 template<
typename NodeT,
typename AccessorT>
478 if (!(std::is_same<NodeT,PointDataLeafNode>::value))
return nullptr;
479 return reinterpret_cast<NodeT*
>(
this);
483 template<
typename AccessorT>
490 template<
typename AccessorT>
492 template<
typename AccessorT>
495 template<
typename NodeT,
typename AccessorT>
499 if (!(std::is_same<NodeT,PointDataLeafNode>::value))
return nullptr;
500 return reinterpret_cast<const NodeT*
>(
this);
507 void readTopology(std::istream& is,
bool fromHalf =
false);
508 void writeTopology(std::ostream& os,
bool toHalf =
false)
const;
510 Index buffers()
const;
512 void readBuffers(std::istream& is,
bool fromHalf =
false);
513 void readBuffers(std::istream& is,
const CoordBBox&,
bool fromHalf =
false);
514 void writeBuffers(std::ostream& os,
bool toHalf =
false)
const;
519 void evalActiveBoundingBox(
CoordBBox& bbox,
bool visitVoxels =
true)
const;
531 assert(
false &&
"Cannot modify voxel values in a PointDataTree.");
538 if (value != zeroVal<T>()) this->assertNonmodifiable();
564 template<
typename ModifyOp>
567 template<
typename ModifyOp>
570 template<
typename ModifyOp>
580 template<
typename AccessorT>
583 template<
typename ModifyOp,
typename AccessorT>
585 assertNonmodifiable();
588 template<
typename AccessorT>
591 template<
typename AccessorT>
593 BaseLeaf::setActiveStateAndCache(xyz, on, parent);
597 assertNonModifiableUnlessZero(newBackground);
605 friend class ::TestPointDataLeaf;
612 std::unique_ptr<AttributeSet> mAttributeSet;
613 uint16_t mVoxelBufferSize = 0;
638 #if defined(_MSC_VER) && (_MSC_VER < 1914) 642 MaskOnIterator,
const PointDataLeafNode,
const ValueType, ValueOn>;
646 MaskOffIterator,
const PointDataLeafNode,
const ValueType,ValueOff>;
650 MaskDenseIterator,
const PointDataLeafNode,
const ValueType,ValueAll>;
652 MaskOnIterator, PointDataLeafNode,
ChildOn>;
654 MaskOnIterator,
const PointDataLeafNode, ChildOn>;
656 MaskOffIterator, PointDataLeafNode,
ChildOff>;
658 MaskOffIterator,
const PointDataLeafNode, ChildOff>;
660 PointDataLeafNode, ValueType,
ChildAll>;
662 const PointDataLeafNode,
const ValueType, ChildAll>;
665 MaskOnIterator, PointDataLeafNode,
const ValueType, ValueOn>;
667 MaskOnIterator,
const PointDataLeafNode,
const ValueType, ValueOn>;
669 MaskOffIterator, PointDataLeafNode,
const ValueType, ValueOff>;
671 MaskOffIterator,
const PointDataLeafNode,
const ValueType,ValueOff>;
673 MaskDenseIterator, PointDataLeafNode,
const ValueType, ValueAll>;
675 MaskDenseIterator,
const PointDataLeafNode,
const ValueType,ValueAll>;
677 MaskOnIterator, PointDataLeafNode, ChildOn>;
679 MaskOnIterator,
const PointDataLeafNode, ChildOn>;
681 MaskOffIterator, PointDataLeafNode, ChildOff>;
683 MaskOffIterator,
const PointDataLeafNode, ChildOff>;
685 PointDataLeafNode, ValueType, ChildAll>;
687 const PointDataLeafNode,
const ValueType, ChildAll>;
699 return this->beginIndex<ValueAllCIter, NullFilter>(filter);
704 return this->beginIndex<ValueOnCIter, NullFilter>(filter);
709 return this->beginIndex<ValueOffCIter, NullFilter>(filter);
712 template<
typename IterT,
typename FilterT>
716 template<
typename FilterT>
719 return this->beginIndex<ValueAllCIter, FilterT>(filter);
721 template<
typename FilterT>
724 return this->beginIndex<ValueOnCIter, FilterT>(filter);
726 template<
typename FilterT>
729 return this->beginIndex<ValueOffCIter, FilterT>(filter);
736 template<
typename FilterT>
739 #define VMASK_ this->getValueMask() 786 template<
typename T, Index Log2Dim>
790 if (descriptor->size() != 1 ||
791 descriptor->find(
"P") == AttributeSet::INVALID_POS ||
797 mAttributeSet.reset(
new AttributeSet(descriptor, arrayLength));
800 template<
typename T, Index Log2Dim>
804 mAttributeSet.reset(
new AttributeSet(*mAttributeSet, 0));
812 if (updateValueMask) this->setValuesOff();
815 template<
typename T, Index Log2Dim>
819 return pos < mAttributeSet->
size();
822 template<
typename T, Index Log2Dim>
826 const size_t pos = mAttributeSet->find(attributeName);
827 return pos != AttributeSet::INVALID_POS;
830 template<
typename T, Index Log2Dim>
833 const size_t pos,
const Index strideOrTotalSize,
834 const bool constantStride)
836 return mAttributeSet->appendAttribute(expected, replacement, pos, strideOrTotalSize, constantStride);
839 template<
typename T, Index Log2Dim>
842 const Descriptor& expected, Descriptor::Ptr& replacement)
844 mAttributeSet->dropAttributes(pos, expected, replacement);
847 template<
typename T, Index Log2Dim>
854 template<
typename T, Index Log2Dim>
858 mAttributeSet->renameAttributes(expected, replacement);
861 template<
typename T, Index Log2Dim>
865 for (
size_t i = 0; i < mAttributeSet->size(); i++) {
871 template<
typename T, Index Log2Dim>
879 if (!allowMismatchingDescriptors && mAttributeSet->descriptor() != attributeSet->
descriptor()) {
883 mAttributeSet.reset(attributeSet);
886 template<
typename T, Index Log2Dim>
893 template<
typename T, Index Log2Dim>
897 if (offsets.size() != LeafNodeType::NUM_VALUES) {
901 for (
Index index = 0; index < offsets.size(); ++index) {
902 setOffsetOnly(index, offsets[index]);
905 if (updateValueMask) this->updateValueMask();
908 template<
typename T, Index Log2Dim>
913 for (
Index index = 1; index < BaseLeaf::SIZE; ++index) {
914 if (this->getValue(index-1) > this->getValue(index)) {
920 for (
size_t attributeIndex = 1; attributeIndex < mAttributeSet->size(); ++attributeIndex ) {
921 if (mAttributeSet->getConst(attributeIndex-1)->size() != mAttributeSet->getConst(attributeIndex)->size()) {
927 if (mAttributeSet->size() > 0 && this->getValue(BaseLeaf::SIZE-1) != mAttributeSet->getConst(0)->size()) {
932 template<
typename T, Index Log2Dim>
937 return *mAttributeSet->get(pos);
940 template<
typename T, Index Log2Dim>
945 return *mAttributeSet->getConst(pos);
948 template<
typename T, Index Log2Dim>
952 return this->attributeArray(pos);
955 template<
typename T, Index Log2Dim>
959 const size_t pos = mAttributeSet->find(attributeName);
961 return *mAttributeSet->get(pos);
964 template<
typename T, Index Log2Dim>
968 const size_t pos = mAttributeSet->find(attributeName);
970 return *mAttributeSet->getConst(pos);
973 template<
typename T, Index Log2Dim>
977 return this->attributeArray(attributeName);
980 template<
typename T, Index Log2Dim>
992 template<
typename T, Index Log2Dim>
996 const AttributeSet::Descriptor::GroupIndex index = this->attributeSet().groupIndex(name);
997 return this->groupHandle(index);
1000 template<
typename T, Index Log2Dim>
1012 template<
typename T, Index Log2Dim>
1016 const AttributeSet::Descriptor::GroupIndex index = this->attributeSet().groupIndex(name);
1017 return this->groupWriteHandle(index);
1020 template<
typename T, Index Log2Dim>
1021 template<
typename ValueIterT,
typename FilterT>
1033 FilterT newFilter(filter);
1034 newFilter.
reset(*
this);
1040 ValueIterT valueIter = IterTraitsT::begin(*
this);
1045 template<
typename T, Index Log2Dim>
1049 const Index index = LeafNodeType::coordToOffset(ijk);
1050 assert(index < BaseLeaf::SIZE);
1051 const ValueType end = this->getValue(index);
1056 template<
typename T, Index Log2Dim>
1064 template<
typename T, Index Log2Dim>
1065 template<
typename FilterT>
1070 FilterT newFilter(filter);
1071 newFilter.reset(*
this);
1075 template<
typename T, Index Log2Dim>
1079 return this->getLastValue();
1082 template<
typename T, Index Log2Dim>
1086 if (this->isEmpty())
return 0;
1087 else if (this->isDense())
return this->
pointCount();
1091 template<
typename T, Index Log2Dim>
1095 if (this->isEmpty())
return this->
pointCount();
1096 else if (this->isDense())
return 0;
1097 return iterCount(this->beginIndexOff());
1100 template<
typename T, Index Log2Dim>
1104 if (!this->attributeSet().descriptor().hasGroup(groupName)) {
1107 GroupFilter filter(groupName, this->attributeSet());
1111 return iterCount(this->beginIndexAll(filter));
1115 template<
typename T, Index Log2Dim>
1120 for (
Index n = 0; n < LeafNodeType::NUM_VALUES; n++) {
1121 end = this->getValue(n);
1122 this->setValueMask(n, (end - start) > 0);
1127 template<
typename T, Index Log2Dim>
1131 this->buffer().
setValue(offset, val);
1132 this->setValueMaskOn(offset);
1135 template<
typename T, Index Log2Dim>
1139 this->buffer().
setValue(offset, val);
1142 template<
typename T, Index Log2Dim>
1146 BaseLeaf::readTopology(is, fromHalf);
1149 template<
typename T, Index Log2Dim>
1153 BaseLeaf::writeTopology(os, toHalf);
1156 template<
typename T, Index Log2Dim>
1163 mAttributeSet->size() +
1164 mAttributeSet->size() +
1168 template<
typename T, Index Log2Dim>
1175 template<
typename T, Index Log2Dim>
1184 std::string key(
"paged:" + std::to_string(index));
1185 auto it = auxData.find(key);
1186 if (it != auxData.end()) {
1194 std::string key(
"paged:" + std::to_string(index));
1195 auto it = auxData.find(key);
1196 if (it != auxData.end()) {
1202 return *pagedStream;
1208 std::string matchingKey(
"hasMatchingDescriptor");
1209 auto itMatching = auxData.find(matchingKey);
1210 return itMatching != auxData.end();
1215 std::string matchingKey(
"hasMatchingDescriptor");
1216 std::string descriptorKey(
"descriptorPtr");
1217 auto itMatching = auxData.find(matchingKey);
1218 auto itDescriptor = auxData.find(descriptorKey);
1219 if (itMatching != auxData.end()) (const_cast<io::StreamMetadata::AuxDataMap&>(auxData)).erase(itMatching);
1220 if (itDescriptor != auxData.end()) (const_cast<io::StreamMetadata::AuxDataMap&>(auxData)).erase(itDescriptor);
1224 const Descriptor::Ptr descriptor)
1226 std::string descriptorKey(
"descriptorPtr");
1227 std::string matchingKey(
"hasMatchingDescriptor");
1228 auto itMatching = auxData.find(matchingKey);
1229 if (itMatching == auxData.end()) {
1238 std::string descriptorKey(
"descriptorPtr");
1239 auto itDescriptor = auxData.find(descriptorKey);
1240 assert(itDescriptor != auxData.end());
1241 const Descriptor::Ptr descriptor = boost::any_cast<AttributeSet::Descriptor::Ptr>(itDescriptor->second);
1252 const Index pass(static_cast<uint16_t>(meta->pass()));
1253 const Index maximumPass(static_cast<uint16_t>(meta->pass() >> 16));
1255 const Index attributes = (maximumPass - 4) / 2;
1259 is.read(reinterpret_cast<char*>(&mVoxelBufferSize),
sizeof(uint16_t));
1260 Local::clearMatchingDescriptor(meta->auxData());
1262 else if (pass == 1) {
1264 if (Local::hasMatchingDescriptor(meta->auxData())) {
1265 AttributeSet::Descriptor::Ptr descriptor = Local::retrieveMatchingDescriptor(meta->auxData());
1266 mAttributeSet->resetDescriptor(descriptor,
true);
1270 is.read(reinterpret_cast<char*>(&header),
sizeof(uint8_t));
1271 mAttributeSet->readDescriptor(is);
1272 if (header & uint8_t(1)) {
1274 Local::insertDescriptor(meta->auxData(), descriptor);
1278 if (header & uint8_t(2)) {
1279 uint64_t bytesToSkip;
1280 is.read(reinterpret_cast<char*>(&bytesToSkip),
sizeof(uint64_t));
1281 if (bytesToSkip > uint64_t(0)) {
1283 if (metadata && metadata->seekable()) {
1284 is.seekg(bytesToSkip, std::ios_base::cur);
1287 std::vector<uint8_t> tempData(bytesToSkip);
1288 is.read(reinterpret_cast<char*>(&tempData[0]), bytesToSkip);
1293 if (header > uint8_t(3)) {
1297 mAttributeSet->readMetadata(is);
1299 else if (pass < (attributes + 2)) {
1301 const size_t attributeIndex = pass - 2;
1303 mAttributeSet->get(attributeIndex) :
nullptr;
1306 Local::getOrInsertPagedStream(meta->auxData(),
static_cast<Index>(attributeIndex));
1312 else if (pass == attributes + 2) {
1315 const Index passValue(meta->pass());
1319 nonConstMeta.
setPass(mVoxelBufferSize);
1322 BaseLeaf::readBuffers(is, fromHalf);
1325 nonConstMeta.setPass(passValue);
1327 else if (pass < (attributes*2 + 3)) {
1329 const Index attributeIndex = pass - attributes - 3;
1331 mAttributeSet->get(attributeIndex) :
nullptr;
1334 Local::getOrInsertPagedStream(meta->auxData(), attributeIndex);
1340 if (pass > attributes + 3) {
1341 Local::destroyPagedStream(meta->auxData(), attributeIndex-1);
1344 else if (pass < buffers()) {
1346 const Index attributeIndex = pass - attributes - 4;
1347 Local::destroyPagedStream(meta->auxData(), attributeIndex);
1351 template<
typename T, Index Log2Dim>
1360 std::string key(
"paged:" + std::to_string(index));
1361 auto it = auxData.find(key);
1362 if (it != auxData.end()) {
1372 std::string key(
"paged:" + std::to_string(index));
1373 auto it = auxData.find(key);
1374 if (it != auxData.end()) {
1380 return *pagedStream;
1385 const Descriptor::Ptr descriptor)
1387 std::string descriptorKey(
"descriptorPtr");
1388 std::string matchingKey(
"hasMatchingDescriptor");
1389 auto itMatching = auxData.find(matchingKey);
1390 auto itDescriptor = auxData.find(descriptorKey);
1391 if (itMatching == auxData.end()) {
1394 assert(itDescriptor == auxData.end());
1399 bool matching = boost::any_cast<
bool>(itMatching->second);
1400 if (!matching)
return;
1401 assert(itDescriptor != auxData.end());
1404 const Descriptor::Ptr existingDescriptor = boost::any_cast<AttributeSet::Descriptor::Ptr>(itDescriptor->second);
1405 if (*existingDescriptor != *descriptor) {
1413 std::string matchingKey(
"hasMatchingDescriptor");
1414 auto itMatching = auxData.find(matchingKey);
1416 if (itMatching == auxData.end())
return false;
1418 if (!boost::any_cast<bool>(itMatching->second))
return false;
1424 std::string descriptorKey(
"descriptorPtr");
1425 auto itDescriptor = auxData.find(descriptorKey);
1427 if (itDescriptor == auxData.end())
return nullptr;
1429 const Descriptor::Ptr descriptor = boost::any_cast<AttributeSet::Descriptor::Ptr>(itDescriptor->second);
1436 std::string matchingKey(
"hasMatchingDescriptor");
1437 std::string descriptorKey(
"descriptorPtr");
1438 auto itMatching = auxData.find(matchingKey);
1439 auto itDescriptor = auxData.find(descriptorKey);
1440 if (itMatching != auxData.end()) (const_cast<io::StreamMetadata::AuxDataMap&>(auxData)).erase(itMatching);
1441 if (itDescriptor != auxData.end()) (const_cast<io::StreamMetadata::AuxDataMap&>(auxData)).erase(itDescriptor);
1451 const Index pass(static_cast<uint16_t>(meta->pass()));
1456 if (meta->countingPasses()) {
1457 const Index requiredPasses = this->buffers();
1458 if (requiredPasses > pass) {
1459 meta->setPass(requiredPasses);
1464 const Index maximumPass(static_cast<uint16_t>(meta->pass() >> 16));
1465 const Index attributes = (maximumPass - 4) / 2;
1471 Local::insertDescriptor(meta->auxData(), mAttributeSet->descriptorPtr());
1473 else if (pass == 1) {
1475 bool matchingDescriptor = Local::hasMatchingDescriptor(meta->auxData());
1476 if (matchingDescriptor) {
1477 AttributeSet::Descriptor::Ptr descriptor = Local::retrieveMatchingDescriptor(meta->auxData());
1481 os.write(reinterpret_cast<const char*>(&header),
sizeof(uint8_t));
1482 mAttributeSet->writeDescriptor(os,
false);
1488 os.write(reinterpret_cast<const char*>(&header),
sizeof(uint8_t));
1489 mAttributeSet->writeDescriptor(os,
false);
1491 mAttributeSet->writeMetadata(os,
false,
true);
1493 else if (pass < attributes + 2) {
1495 const Index attributeIndex = pass - 2;
1498 Local::destroyPagedStream(meta->auxData(), attributeIndex-1);
1501 mAttributeSet->getConst(attributeIndex) :
nullptr;
1504 Local::getOrInsertPagedStream(meta->auxData(), attributeIndex);
1507 array->writePagedBuffers(pagedStream,
false);
1510 else if (pass == attributes + 2) {
1511 const Index attributeIndex = pass - 3;
1512 Local::destroyPagedStream(meta->auxData(), attributeIndex);
1514 BaseLeaf::writeBuffers(os, toHalf);
1516 else if (pass < (attributes*2 + 3)) {
1518 const Index attributeIndex = pass - attributes - 3;
1520 if (pass > attributes + 2) {
1521 Local::destroyPagedStream(meta->auxData(), attributeIndex-1);
1524 mAttributeSet->getConst(attributeIndex) :
nullptr;
1527 Local::getOrInsertPagedStream(meta->auxData(), attributeIndex);
1530 array->writePagedBuffers(pagedStream,
false);
1533 else if (pass < buffers()) {
1534 Local::clearMatchingDescriptor(meta->auxData());
1536 const Index attributeIndex = pass - attributes - 4;
1537 Local::destroyPagedStream(meta->auxData(), attributeIndex);
1541 template<
typename T, Index Log2Dim>
1545 return BaseLeaf::memUsage() + mAttributeSet->
memUsage();
1548 template<
typename T, Index Log2Dim>
1552 BaseLeaf::evalActiveBoundingBox(bbox, visitVoxels);
1555 template<
typename T, Index Log2Dim>
1559 return BaseLeaf::getNodeBoundingBox();
1562 template<
typename T, Index Log2Dim>
1566 #if OPENVDB_ABI_VERSION_NUMBER >= 3 1567 if (!this->allocate())
return;
1570 this->assertNonModifiableUnlessZero(value);
1575 const Index offsetX = (x & (DIM-1u)) << 2*Log2Dim;
1577 const Index offsetXY = offsetX + ((y & (DIM-1u)) << Log2Dim);
1579 const Index offset = offsetXY + (z & (DIM-1u));
1580 this->setValueMask(offset, active);
1586 template<
typename T, Index Log2Dim>
1590 this->assertNonModifiableUnlessZero(value);
1594 if (active) this->setValuesOn();
1595 else this->setValuesOff();
1602 template <
typename Po
intDataTreeT>
1603 inline AttributeSet::Descriptor::Ptr
1606 auto leafIter = tree.beginLeaf();
1607 if (!leafIter)
return nullptr;
1609 const AttributeSet::Descriptor& descriptor = leafIter->attributeSet().descriptor();
1610 auto newDescriptor = std::make_shared<AttributeSet::Descriptor>(descriptor);
1611 for (; leafIter; ++leafIter) {
1612 leafIter->resetDescriptor(newDescriptor);
1615 return newDescriptor;
1619 template <
typename Po
intDataTreeT>
1623 auto leafIter = tree.beginLeaf();
1624 for (; leafIter; ++leafIter) {
1625 for (
size_t i = 0; i < leafIter->attributeSet().size(); i++) {
1626 leafIter->attributeArray(i).setStreaming(on);
1632 template <
typename Po
intDataTreeT>
1634 prefetch(PointDataTreeT& tree,
bool position,
bool otherAttributes)
1639 auto leaf = tree.cbeginLeaf();
1642 const auto& attributeSet = leaf->attributeSet();
1646 for ( ; leaf; ++leaf) {
1647 leaf->buffer().data();
1652 size_t positionIndex = attributeSet.find(
"P");
1654 if (position && positionIndex != AttributeSet::INVALID_POS) {
1655 for (leaf = tree.cbeginLeaf(); leaf; ++leaf) {
1656 assert(leaf->hasAttribute(positionIndex));
1657 leaf->constAttributeArray(positionIndex).loadData();
1663 if (otherAttributes) {
1664 const size_t attributes = attributeSet.size();
1665 for (
size_t attributeIndex = 0; attributeIndex < attributes; attributeIndex++) {
1666 if (attributeIndex == positionIndex)
continue;
1667 for (leaf = tree.cbeginLeaf(); leaf; ++leaf) {
1668 assert(leaf->hasAttribute(attributeIndex));
1669 leaf->constAttributeArray(attributeIndex).loadData();
1676 namespace internal {
1693 template<
typename HeadT,
int HeadLevel>
1698 using Type =
typename boost::mpl::push_back<SubtreeT, RootNodeT>::type;
1703 template <
typename ChildT, Index Log2Dim,
int HeadLevel>
1708 using Type =
typename boost::mpl::push_back<SubtreeT, InternalNodeT>::type;
1713 template <
typename ChildT, Index Log2Dim>
1718 using Type =
typename boost::mpl::vector<LeafNodeT, InternalNodeT>::type;
1727 template <
typename TreeType>
1746 template<Index Dim1,
typename T2>
1747 struct SameLeafConfig<Dim1, points::PointDataLeafNode<T2, Dim1>> {
static const bool value =
true; };
1753 #endif // OPENVDB_POINTS_POINT_DATA_GRID_HAS_BEEN_INCLUDED std::vector< ValueType > IndexArray
Definition: PointDataGrid.h:272
void dropAttributes(PointDataTreeT &tree, const std::vector< size_t > &indices)
Drops attributes from the VDB tree.
Definition: PointAttribute.h:567
ValueAllCIter endValueAll() const
Definition: PointDataGrid.h:757
Axis-aligned bounding box of signed integer coordinates.
Definition: Coord.h:264
Int32 x() const
Definition: Coord.h:157
void renameAttributes(PointDataTreeT &tree, const std::vector< Name > &oldNames, const std::vector< Name > &newNames)
Rename attributes in a VDB tree.
Definition: PointAttribute.h:656
typename BaseLeaf::template ValueIter< MaskDenseIterator, const PointDataLeafNode, const ValueType, ValueAll > ValueAllCIter
Definition: PointDataGrid.h:675
ValueOffCIter beginValueOff() const
Definition: PointDataGrid.h:744
Attribute Group access and filtering for iteration.
Leaf nodes have no children, so their child iterators have no get/set accessors.
Definition: LeafNode.h:271
Similiar to ValueConverter, but allows for tree configuration conversion to a PointDataTree. ValueConverter<PointDataIndex32> cannot be used as a PointDataLeafNode is not a specialization of LeafNode.
Definition: PointDataGrid.h:1728
Definition: PointDataGrid.h:212
A Paging wrapper to std::istream that is responsible for reading from a given input stream and creati...
Definition: StreamCompression.h:225
Definition: LeafNode.h:232
ValueAllCIter cendValueAll() const
Definition: PointDataGrid.h:756
void setValueOn(Index, const ValueType &)
Definition: PointDataGrid.h:557
void reorderAttributes(const Descriptor::Ptr &replacement)
Reorder attribute set.
Definition: PointDataGrid.h:849
ValueOnCIter cendValueOn() const
Definition: PointDataGrid.h:750
PointDataLeafNode(PartialCreate, const Coord &coords, const T &value=zeroVal< T >(), bool active=false)
Definition: PointDataGrid.h:340
typename BaseLeaf::template ValueIter< MaskOnIterator, PointDataLeafNode, const ValueType, ValueOn > ValueOnIter
Definition: PointDataGrid.h:665
OPENVDB_DEPRECATED Index64 groupPointCount(const PointDataTreeT &tree, const Name &name, const bool inCoreOnly=true)
Definition: PointCount.h:262
std::shared_ptr< PagedInputStream > Ptr
Definition: StreamCompression.h:228
ValueOnCIter endValueOn() const
Definition: PointDataGrid.h:751
IndexIter< ValueOffCIter, FilterT > beginIndexOff(const FilterT &filter) const
Definition: PointDataGrid.h:727
Definition: LeafNode.h:233
typename BaseLeaf::ChildOff ChildOff
Definition: PointDataGrid.h:617
PointDataLeafNode()
Default constructor.
Definition: PointDataGrid.h:293
std::pair< ValueType, ValueType > ValueTypePair
Definition: PointDataGrid.h:271
void setValueOnlyAndCache(const Coord &, const ValueType &, AccessorT &)
Definition: PointDataGrid.h:581
const char * typeNameAsString< Vec3f >()
Definition: Types.h:356
OPENVDB_API size_t bloscCompressedSize(const char *buffer, const size_t uncompressedBytes)
Convenience wrapper to retrieve the compressed size of buffer when compressed.
#define VMASK_
Definition: PointDataGrid.h:739
Definition: AttributeGroup.h:102
void setValueOnly(const Coord &, const ValueType &)
Definition: PointDataGrid.h:544
const PointDataLeafNode * probeConstLeafAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: PointDataGrid.h:491
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:888
void clip(const CoordBBox &, const ValueType &value)
Definition: PointDataGrid.h:574
ValueOnIter endValueOn()
Definition: PointDataGrid.h:752
ChildAllCIter cbeginChildAll() const
Definition: PointDataGrid.h:766
#define OPENVDB_THROW(exception, message)
Definition: Exceptions.h:109
void signedFloodFill(const ValueType &)
Definition: PointDataGrid.h:600
Definition: LeafNode.h:233
Attribute Array storage templated on type and compression codec.
void setValuesOn()
Definition: PointDataGrid.h:561
void setValueOn(const Coord &, const ValueType &)
Definition: PointDataGrid.h:556
IndexOnIter beginIndexOn() const
Definition: PointDataGrid.h:701
const Coord & min() const
Definition: Coord.h:337
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:51
std::string Name
Definition: Name.h:44
ValueOffCIter cbeginValueOff() const
Definition: PointDataGrid.h:743
bool operator==(const PointDataLeafNode &other) const
Definition: PointDataGrid.h:457
Definition: Exceptions.h:87
ValueAllCIter cbeginValueAll() const
Definition: PointDataGrid.h:746
NodeT * probeNodeAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: PointDataGrid.h:475
static index::State state()
Definition: AttributeGroup.h:170
ValueAllIter beginValueAll()
Definition: PointDataGrid.h:748
Definition: TreeIterator.h:108
ChildOnCIter endChildOn() const
Definition: PointDataGrid.h:771
void modifyValue(Index, const ModifyOp &)
Definition: PointDataGrid.h:565
Definition: LeafNode.h:233
bool operator!=(const PointDataLeafNode &other) const
Definition: PointDataGrid.h:462
Index64 pointCount(const PointDataTreeT &tree, const FilterT &filter=NullFilter(), const bool inCoreOnly=false, const bool threaded=true)
Count the total number of points in a PointDataTree.
Definition: PointCount.h:115
void addLeafAndCache(PointDataLeafNode *, AccessorT &)
Definition: PointDataGrid.h:466
Index64 memUsage() const
Definition: PointDataGrid.h:1543
ValueOnCIter cbeginValueOn() const
Definition: PointDataGrid.h:740
Base class for iterators over internal and leaf nodes.
Definition: Iterator.h:56
typename BaseLeaf::template ChildIter< MaskOnIterator, const PointDataLeafNode, ChildOn > ChildOnCIter
Definition: PointDataGrid.h:679
void setSizeOnly(bool sizeOnly)
Size-only mode tags the stream as only writing size data.
Definition: StreamCompression.h:272
void appendAttribute(PointDataTreeT &tree, const Name &name, const NamePair &type, const Index strideOrTotalSize=1, const bool constantStride=true, Metadata::Ptr metaDefaultValue=Metadata::Ptr(), const bool hidden=false, const bool transient=false)
Appends a new attribute to the VDB tree (this method does not require a templated AttributeType) ...
Definition: PointAttribute.h:447
Definition: NodeMasks.h:241
ChildOffIter beginChildOff()
Definition: PointDataGrid.h:765
std::shared_ptr< PagedOutputStream > Ptr
Definition: StreamCompression.h:265
Definition: IndexIterator.h:69
void fill(const CoordBBox &, const ValueType &, bool)
Definition: PointDataGrid.h:1564
void setOutputStream(std::ostream &os)
Definition: StreamCompression.h:277
const NodeT * probeConstNodeAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: PointDataGrid.h:496
ValueOffCIter endValueOff() const
Definition: PointDataGrid.h:754
typename boost::mpl::push_back< SubtreeT, InternalNodeT >::type Type
Definition: PointDataGrid.h:1708
typename BaseLeaf::template DenseIter< PointDataLeafNode, ValueType, ChildAll > ChildAllIter
Definition: PointDataGrid.h:685
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 setValueOff(Index, const ValueType &)
Definition: PointDataGrid.h:551
Definition: IndexIterator.h:70
IndexOffIter beginIndexOff() const
Definition: PointDataGrid.h:706
Leaf nodes that require multi-pass I/O must inherit from this struct.
Definition: io.h:140
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...
Convenience wrappers to using Blosc and reading and writing of Paged data.
ChildAllIter endChildAll()
Definition: PointDataGrid.h:778
A forward iterator over array indices in a single voxel.
Definition: IndexIterator.h:91
std::shared_ptr< AttributeArray > Ptr
Definition: AttributeArray.h:142
ChildOffCIter cendChildOff() const
Definition: PointDataGrid.h:773
typename BaseLeaf::template ChildIter< MaskOffIterator, PointDataLeafNode, ChildOff > ChildOffIter
Definition: PointDataGrid.h:681
void setValueOnly(Index, const ValueType &)
Definition: PointDataGrid.h:545
typename NodeMaskType::OnIterator MaskOnIterator
Definition: PointDataGrid.h:620
void resetBackground(const ValueType &, const ValueType &newBackground)
Definition: PointDataGrid.h:596
PointDataLeafNode * touchLeafAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: PointDataGrid.h:472
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:136
const PointDataLeafNode * probeLeaf(const Coord &) const
Return a const pointer to this node.
Definition: PointDataGrid.h:494
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:451
Definition: LeafNode.h:280
ChildAllIter beginChildAll()
Definition: PointDataGrid.h:768
PointDataLeafNode(const PointDataLeafNode &other, const Coord &coords, const T &value=zeroVal< T >(), bool active=false)
Definition: PointDataGrid.h:311
ChildOffCIter beginChildOff() const
Definition: PointDataGrid.h:764
ChildOnIter endChildOn()
Definition: PointDataGrid.h:772
void modifyValueAndActiveState(const Coord &, const ModifyOp &)
Definition: PointDataGrid.h:571
void signedFloodFill(const ValueType &, const ValueType &)
Definition: PointDataGrid.h:601
void modifyValueAndActiveStateAndCache(const Coord &, const ModifyOp &, AccessorT &)
Definition: PointDataGrid.h:584
Definition: Exceptions.h:92
int32_t Int32
Definition: Types.h:63
Int32 z() const
Definition: Coord.h:159
static Index size()
Return the total number of voxels represented by this LeafNode.
Definition: LeafNode.h:151
PointDataLeafNode(const tree::LeafNode< ValueType, Log2Dim > &other, const T &, const T &, TopologyCopy)
Definition: PointDataGrid.h:335
void assertNonModifiableUnlessZero(const ValueType &value)
Definition: PointDataGrid.h:537
bool isGroup(const AttributeArray &array)
Definition: AttributeGroup.h:93
typename boost::mpl::vector< LeafNodeT, InternalNodeT >::type Type
Definition: PointDataGrid.h:1718
Definition: AttributeGroup.h:130
typename BaseLeaf::ValueOff ValueOff
Definition: PointDataGrid.h:608
virtual bool compact()=0
Compact the existing array to become uniform if all values are identical.
void setValueOff(const Coord &, const ValueType &)
Definition: PointDataGrid.h:550
Index64 iterCount(const IterT &iter)
Count up the number of times the iterator can iterate.
Definition: IndexIterator.h:341
typename TreeType::RootNodeType RootNodeT
Definition: PointDataGrid.h:1729
void fill(const ValueType &value)
Definition: PointDataGrid.h:577
void reset(Index32 begin, Index32 end)
Reset the begining and end of the iterator.
Definition: IndexIterator.h:279
PointIndex< Index32, 1 > PointDataIndex32
Definition: Types.h:208
Definition: InternalNode.h:60
ChildAllCIter cendChildAll() const
Definition: PointDataGrid.h:776
PointDataLeafNode * probeLeaf(const Coord &)
Return a pointer to this node.
Definition: PointDataGrid.h:482
Definition: Exceptions.h:40
typename BaseLeaf::ValueOn ValueOn
Definition: PointDataGrid.h:607
Recursive node chain which generates a boost::mpl::vector listing value converted types of nodes to P...
Definition: PointDataGrid.h:1694
ChildOnCIter beginChildOn() const
Definition: PointDataGrid.h:761
const PointDataLeafNode * probeLeafAndCache(const Coord &, AccessorT &) const
Return a const pointer to this node.
Definition: PointDataGrid.h:493
T ValueType
Definition: PointDataGrid.h:270
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:1634
A no-op filter that can be used when iterating over all indices.
Definition: IndexIterator.h:77
void setValueOn(const Coord &xyz)
Definition: PointDataGrid.h:553
typename BaseLeaf::ChildAll ChildAll
Definition: PointDataGrid.h:618
void assertNonmodifiable()
Definition: PointDataGrid.h:530
AttributeSet::Descriptor Descriptor
Definition: PointDataGrid.h:274
Index32 Index
Definition: Types.h:61
typename NodeMaskType::OffIterator MaskOffIterator
Definition: PointDataGrid.h:621
IndexIter< ValueAllCIter, FilterT > beginIndexAll(const FilterT &filter) const
Filtered leaf index iterator.
Definition: PointDataGrid.h:717
void uninitialize()
Global deregistration of point data-related types.
typename PointDataNodeChain< ChildT, HeadLevel-1 >::Type SubtreeT
Definition: PointDataGrid.h:1706
typename boost::mpl::push_back< SubtreeT, RootNodeT >::type Type
Definition: PointDataGrid.h:1698
Int32 y() const
Definition: Coord.h:158
IndexAllIter beginIndexAll() const
Leaf index iterator.
Definition: PointDataGrid.h:696
Base class for storing attribute data.
Definition: AttributeArray.h:118
typename PointDataNodeChain< typename HeadT::ChildNodeType, HeadLevel-1 >::Type SubtreeT
Definition: PointDataGrid.h:1696
Definition: NodeMasks.h:210
Definition: PointDataGrid.h:201
uint64_t Index64
Definition: Types.h:60
OPENVDB_API SharedPtr< StreamMetadata > getStreamMetadataPtr(std::ios_base &)
Return a shared pointer to an object that stores metadata (file format, compression scheme...
static CoordBBox inf()
Return an "infinite" bounding box, as defined by the Coord value range.
Definition: Coord.h:335
void setActiveState(Index offset, bool on)
Definition: PointDataGrid.h:542
PointDataLeafNode * probeLeafAndCache(const Coord &, AccessorT &)
Return a pointer to this node.
Definition: PointDataGrid.h:484
ValueAllCIter beginValueAll() const
Definition: PointDataGrid.h:747
Definition: RootNode.h:70
void addLeaf(PointDataLeafNode *)
Definition: PointDataGrid.h:464
T zeroVal()
Return the value of type T that corresponds to zero.
Definition: Math.h:86
A forward iterator over array indices with filtering IteratorT can be either IndexIter or ValueIndexI...
Definition: IndexIterator.h:166
void flush()
Manually flushes the current page to disk if non-zero.
void setValueOff(Index offset)
Definition: PointDataGrid.h:548
Descriptor & descriptor()
Return a reference to this attribute set's descriptor, which might be shared with other sets...
Definition: AttributeSet.h:121
const AttributeSet & attributeSet() const
Retrieve the attribute set.
Definition: PointDataGrid.h:349
void setValueOff(const Coord &xyz)
Definition: PointDataGrid.h:547
void setValuesOff()
Definition: PointDataGrid.h:562
Integer wrapper, required to distinguish PointIndexGrid and PointDataGrid from Int32Grid and Int64Gri...
Definition: Types.h:183
Definition: Exceptions.h:84
void setActiveState(const Coord &xyz, bool on)
Definition: PointDataGrid.h:541
PointDataLeafNode(const tools::PointIndexLeafNode< OtherValueType, Log2Dim > &other)
Definition: PointDataGrid.h:321
ValueOnIter beginValueOn()
Definition: PointDataGrid.h:742
ChildOffCIter endChildOff() const
Definition: PointDataGrid.h:774
typename BaseLeaf::template ValueIter< MaskDenseIterator, PointDataLeafNode, const ValueType, ValueAll > ValueAllIter
Definition: PointDataGrid.h:673
typename BaseLeaf::template ValueIter< MaskOffIterator, const PointDataLeafNode, const ValueType, ValueOff > ValueOffCIter
Definition: PointDataGrid.h:671
Definition: LeafNode.h:232
ChildOnCIter cbeginChildOn() const
Definition: PointDataGrid.h:760
const Coord & max() const
Definition: Coord.h:338
typename BaseLeaf::ValueAll ValueAll
Definition: PointDataGrid.h:609
std::shared_ptr< PointDataLeafNode > Ptr
Definition: PointDataGrid.h:268
ValueOffIter beginValueOff()
Definition: PointDataGrid.h:745
void setValueOffAndCache(const Coord &, const ValueType &, AccessorT &)
Definition: PointDataGrid.h:589
void writeCompressedValues(std::ostream &os, PointDataIndex32 *srcBuf, Index srcCount, const util::NodeMask< 3 > &, const util::NodeMask< 3 > &, bool)
openvdb::io::writeCompressedValues specialized on PointDataIndex32 arrays to ignore the value mask...
Definition: PointDataGrid.h:137
typename BaseLeaf::template ValueIter< MaskOnIterator, const PointDataLeafNode, const ValueType, ValueOn > ValueOnCIter
Definition: PointDataGrid.h:667
ValueAllIter endValueAll()
Definition: PointDataGrid.h:758
AttributeSet::Descriptor::Ptr makeDescriptorUnique(PointDataTreeT &tree)
Deep copy the descriptor across all leaf nodes.
Definition: PointDataGrid.h:1604
typename internal::PointDataNodeChain< RootNodeT, RootNodeT::LEVEL >::Type NodeChainT
Definition: PointDataGrid.h:1730
Attribute array storage for string data using Descriptor Metadata.
PointDataLeafNode(const Coord &coords, const T &value=zeroVal< T >(), bool active=false)
Construct using supplied origin, value and active status.
Definition: PointDataGrid.h:305
void compactAttributes(PointDataTreeT &tree)
Compact attributes in a VDB tree (if possible).
Definition: PointAttribute.h:715
ValueOffIter endValueOff()
Definition: PointDataGrid.h:755
ValueOffCIter cendValueOff() const
Definition: PointDataGrid.h:753
ChildAllCIter beginChildAll() const
Definition: PointDataGrid.h:767
void writeCompressedValuesSize(std::ostream &os, const T *srcBuf, Index srcCount)
Definition: PointDataGrid.h:170
Container class that associates a tree with a transform and metadata.
Definition: Grid.h:55
Ordered collection of uniquely-named attribute arrays.
Definition: AttributeSet.h:62
virtual Index size() const =0
void setValue(const Coord &, const ValueType &)
Definition: PointDataGrid.h:559
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:188
void negate()
Definition: PointDataGrid.h:603
void setSizeOnly(bool sizeOnly)
Size-only mode tags the stream as only reading size data.
Definition: StreamCompression.h:235
ChildOnIter beginChildOn()
Definition: PointDataGrid.h:762
void readCompressedValues(std::istream &is, PointDataIndex32 *destBuf, Index destCount, const util::NodeMask< 3 > &, bool)
openvdb::io::readCompressedValues specialized on PointDataIndex32 arrays to ignore the value mask...
Definition: PointDataGrid.h:77
typename NodeMaskType::DenseIterator MaskDenseIterator
Definition: PointDataGrid.h:622
Index filtering on group membership.
Definition: AttributeGroup.h:159
ChildOnCIter cendChildOn() const
Definition: PointDataGrid.h:770
Definition: LeafNode.h:236
A Paging wrapper to std::ostream that is responsible for writing from a given output stream at interv...
Definition: StreamCompression.h:262
Tag dispatch class that distinguishes constructors during file input.
Definition: Types.h:520
Templated block class to hold specific data types and a fixed number of values determined by Log2Dim...
Definition: LeafNode.h:64
virtual void readPagedBuffers(compression::PagedInputStream &)=0
Read attribute buffers from a paged stream.
Tag dispatch class that distinguishes topology copy constructors from deep copy constructors.
Definition: Types.h:518
void initialize()
Global registration of point data-related types.
PointDataLeafNode(const tree::LeafNode< ValueType, Log2Dim > &other, const T &value, TopologyCopy)
Definition: PointDataGrid.h:328
Set of Attribute Arrays which tracks metadata about each array.
void setInputStream(std::istream &is)
Definition: StreamCompression.h:240
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:1621
std::shared_ptr< Descriptor > DescriptorPtr
Definition: AttributeSet.h:72
ChildOffCIter cbeginChildOff() const
Definition: PointDataGrid.h:763
Definition: NodeMasks.h:272
typename BaseLeaf::ChildOn ChildOn
Definition: PointDataGrid.h:616
void modifyValue(const Coord &, const ModifyOp &)
Definition: PointDataGrid.h:568
Definition: Exceptions.h:85
ValueOnCIter beginValueOn() const
Definition: PointDataGrid.h:741
PointDataLeafNode(const PointDataLeafNode &other)
Construct using deep copy of other PointDataLeafNode.
Definition: PointDataGrid.h:299
Definition: LeafNode.h:232
ChildOffIter endChildOff()
Definition: PointDataGrid.h:775
typename BaseLeaf::template ChildIter< MaskOffIterator, const PointDataLeafNode, ChildOff > ChildOffCIter
Definition: PointDataGrid.h:683
void setActiveStateAndCache(const Coord &xyz, bool on, AccessorT &parent)
Definition: PointDataGrid.h:592
IndexIter< ValueOnCIter, FilterT > beginIndexOn(const FilterT &filter) const
Definition: PointDataGrid.h:722
typename BaseLeaf::template DenseIter< const PointDataLeafNode, const ValueType, ChildAll > ChildAllCIter
Definition: PointDataGrid.h:687
typename BaseLeaf::template ChildIter< MaskOnIterator, PointDataLeafNode, ChildOn > ChildOnIter
Definition: PointDataGrid.h:677
typename BaseLeaf::template ValueIter< MaskOffIterator, PointDataLeafNode, const ValueType, ValueOff > ValueOffIter
Definition: PointDataGrid.h:669
void setValueOn(Index offset)
Definition: PointDataGrid.h:554
ChildAllCIter endChildAll() const
Definition: PointDataGrid.h:777
Bit mask for the internal and leaf nodes of VDB. This is a 64-bit implementation. ...
Definition: NodeMasks.h:309
Typed class for storing attribute data.
Definition: AttributeArray.h:441