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>
36#if OPENVDB_ABI_VERSION_NUMBER < 14
40class TestPointDataLeaf;
60template<
typename T, Index Log2Dim>
class PointDataLeafNode;
65#ifndef OPENVDB_DISABLE_POINT_DATA_TREE_ALIAS
84template <
typename Po
intDataTreeT>
94template <
typename T, Index Log2Dim>
99 using Ptr = std::shared_ptr<PointDataLeafNode>;
132 , mAttributeSet(new
AttributeSet(*other.mAttributeSet)) { }
143 const T& value =
zeroVal<T>(),
bool active =
false)
151 template<
typename OtherValueType>
158 template <
typename ValueType>
165 template <
typename ValueType>
171 const T& value =
zeroVal<T>(),
bool active =
false)
206 const size_t pos,
const Index strideOrTotalSize = 1,
207 const bool constantStride =
true,
294 template<
typename OtherType, Index OtherLog2Dim>
302 if(BaseLeaf::operator==(other) !=
true)
return false;
303 return (*this->mAttributeSet == *other.mAttributeSet);
309 template<
typename AccessorT>
315 template<
typename AccessorT>
318 template<
typename NodeT,
typename AccessorT>
322 if (!(std::is_same<NodeT,PointDataLeafNode>::value))
return nullptr;
323 return reinterpret_cast<NodeT*
>(
this);
327 template<
typename AccessorT>
334 template<
typename AccessorT>
336 template<
typename AccessorT>
339 template<
typename NodeT,
typename AccessorT>
343 if (!(std::is_same<NodeT,PointDataLeafNode>::value))
return nullptr;
344 return reinterpret_cast<const NodeT*
>(
this);
351#if OPENVDB_ABI_VERSION_NUMBER < 14
352 void readTopology(std::istream& is,
bool fromHalf =
false);
353 void writeTopology(std::ostream& os,
bool toHalf =
false)
const;
355 Index buffers()
const;
357 void readBuffers(std::istream& is,
bool fromHalf =
false);
358 void readBuffers(std::istream& is,
const CoordBBox&,
bool fromHalf =
false);
359 void writeBuffers(std::ostream& os,
bool toHalf =
false)
const;
361 OPENVDB_DEPRECATED_MESSAGE(
"Use memUsage() instead. This method is deprecated and will be removed. Delayed loading is no longer supported.")
362 Index64 memUsageIfLoaded()
const {
return memUsage(); }
379 OPENVDB_ASSERT(
false &&
"Cannot modify voxel values in a PointDataTree.");
412 template<
typename ModifyOp>
415 template<
typename ModifyOp>
418 template<
typename ModifyOp>
428 template<
typename AccessorT>
431 template<
typename ModifyOp,
typename AccessorT>
436 template<
typename AccessorT>
439 template<
typename AccessorT>
453 friend class ::TestPointDataLeaf;
461 uint16_t mVoxelBufferSize = 0;
533 template<
typename IterT,
typename FilterT>
537 template<
typename FilterT>
542 template<
typename FilterT>
547 template<
typename FilterT>
557 template<
typename FilterT>
560#define VMASK_ this->getValueMask()
607template<
typename T, Index Log2Dim>
608inline AttributeSet::UniquePtr
612 std::swap(ptr, mAttributeSet);
616template<
typename T, Index Log2Dim>
621 if (descriptor->size() != 1 ||
628 mAttributeSet.reset(
new AttributeSet(descriptor, arrayLength, lock));
631template<
typename T, Index Log2Dim>
636 mAttributeSet.reset(
new AttributeSet(*mAttributeSet, 0, lock));
647template<
typename T, Index Log2Dim>
651 return pos < mAttributeSet->size();
654template<
typename T, Index Log2Dim>
658 const size_t pos = mAttributeSet->find(attributeName);
662template<
typename T, Index Log2Dim>
665 const size_t pos,
const Index strideOrTotalSize,
666 const bool constantStride,
670 return mAttributeSet->appendAttribute(
671 expected, replacement, pos, strideOrTotalSize, constantStride, metadata, lock);
674template<
typename T, Index Log2Dim>
679 mAttributeSet->dropAttributes(pos, expected, replacement);
682template<
typename T, Index Log2Dim>
686 mAttributeSet->reorderAttributes(replacement);
689template<
typename T, Index Log2Dim>
693 mAttributeSet->renameAttributes(expected, replacement);
696template<
typename T, Index Log2Dim>
700 for (
size_t i = 0; i < mAttributeSet->size(); i++) {
706template<
typename T, Index Log2Dim>
714 if (!allowMismatchingDescriptors && mAttributeSet->descriptor() !=
attributeSet->descriptor()) {
721template<
typename T, Index Log2Dim>
725 mAttributeSet->resetDescriptor(replacement);
728template<
typename T, Index Log2Dim>
743template<
typename T, Index Log2Dim>
755 for (
size_t attributeIndex = 1; attributeIndex < mAttributeSet->size(); ++attributeIndex ) {
756 if (mAttributeSet->getConst(attributeIndex-1)->size() != mAttributeSet->getConst(attributeIndex)->size()) {
762 if (mAttributeSet->size() > 0 && this->getValue(
BaseLeaf::SIZE-1) != mAttributeSet->getConst(0)->size()) {
767template<
typename T, Index Log2Dim>
772 return *mAttributeSet->get(pos);
775template<
typename T, Index Log2Dim>
780 return *mAttributeSet->getConst(pos);
783template<
typename T, Index Log2Dim>
790template<
typename T, Index Log2Dim>
794 const size_t pos = mAttributeSet->find(attributeName);
796 return *mAttributeSet->get(pos);
799template<
typename T, Index Log2Dim>
803 const size_t pos = mAttributeSet->find(attributeName);
805 return *mAttributeSet->getConst(pos);
808template<
typename T, Index Log2Dim>
815template<
typename T, Index Log2Dim>
827template<
typename T, Index Log2Dim>
835template<
typename T, Index Log2Dim>
847template<
typename T, Index Log2Dim>
855template<
typename T, Index Log2Dim>
856template<
typename ValueIterT,
typename FilterT>
868 FilterT newFilter(filter);
869 newFilter.reset(*
this);
875 ValueIterT valueIter = IterTraitsT::begin(*
this);
880template<
typename T, Index Log2Dim>
891template<
typename T, Index Log2Dim>
899template<
typename T, Index Log2Dim>
900template<
typename FilterT>
905 FilterT newFilter(filter);
906 newFilter.reset(*
this);
910template<
typename T, Index Log2Dim>
917template<
typename T, Index Log2Dim>
926template<
typename T, Index Log2Dim>
931 else if (this->
isDense())
return 0;
935template<
typename T, Index Log2Dim>
939 if (!this->
attributeSet().descriptor().hasGroup(groupName)) {
950template<
typename T, Index Log2Dim>
962template<
typename T, Index Log2Dim>
966 this->
buffer().setValue(offset, val);
970template<
typename T, Index Log2Dim>
974 this->
buffer().setValue(offset, val);
977#if OPENVDB_ABI_VERSION_NUMBER < 14
983template <
typename LeafT>
984inline void validateReadOffsets(
const LeafT& leaf)
987 const Index64 lastOffset(leaf.getValue(LeafT::SIZE-1));
991 <<
" exceeds the last voxel offset " << lastOffset <<
".");
995 const AttributeSet& attributeSet = leaf.attributeSet();
996 for (
size_t attributeIndex = 0; attributeIndex < attributeSet.size(); ++attributeIndex) {
997 const AttributeArray* array = attributeSet.getConst(attributeIndex);
998 if (array->flags() & AttributeArray::PARTIALREAD) {
1001 if (lastOffset > array->size()) {
1002 OPENVDB_THROW(IoError,
"PointDataGrid voxel offset " << lastOffset
1003 <<
" exceeds attribute array size " << array->size() <<
".");
1010template<
typename T, Index Log2Dim>
1012PointDataLeafNode<T, Log2Dim>::readTopology(std::istream& is,
bool fromHalf)
1014 BaseLeaf::readTopology(is, fromHalf);
1017template<
typename T, Index Log2Dim>
1019PointDataLeafNode<T, Log2Dim>::writeTopology(std::ostream& os,
bool toHalf)
const
1021 BaseLeaf::writeTopology(os, toHalf);
1024template<
typename T, Index Log2Dim>
1026PointDataLeafNode<T, Log2Dim>::buffers()
const
1031 mAttributeSet->size() +
1032 mAttributeSet->size() +
1036template<
typename T, Index Log2Dim>
1038PointDataLeafNode<T, Log2Dim>::readBuffers(std::istream& is,
bool fromHalf)
1040 this->readBuffers(is, CoordBBox::inf(), fromHalf);
1043template<
typename T, Index Log2Dim>
1045PointDataLeafNode<T, Log2Dim>::readBuffers(std::istream& is,
const CoordBBox& ,
bool fromHalf)
1049 static void destroyPagedStream(
const io::StreamMetadata::AuxDataMap& auxData,
const Index index)
1052 std::string key(
"paged:" + std::to_string(index));
1053 auto it = auxData.find(key);
1054 if (it != auxData.end()) {
1055 (
const_cast<io::StreamMetadata::AuxDataMap&
>(auxData)).erase(it);
1059 static compression::PagedInputStream& getOrInsertPagedStream(
const io::StreamMetadata::AuxDataMap& auxData,
1062 std::string key(
"paged:" + std::to_string(index));
1063 auto it = auxData.find(key);
1064 if (it != auxData.end()) {
1065 return *(std::any_cast<compression::PagedInputStream::Ptr>(it->second));
1068 compression::PagedInputStream::Ptr pagedStream = std::make_shared<compression::PagedInputStream>();
1069 (
const_cast<io::StreamMetadata::AuxDataMap&
>(auxData))[key] = pagedStream;
1070 return *pagedStream;
1074 static bool hasMatchingDescriptor(
const io::StreamMetadata::AuxDataMap& auxData)
1076 std::string matchingKey(
"hasMatchingDescriptor");
1077 auto itMatching = auxData.find(matchingKey);
1078 return itMatching != auxData.end();
1081 static void clearMatchingDescriptor(
const io::StreamMetadata::AuxDataMap& auxData)
1083 std::string matchingKey(
"hasMatchingDescriptor");
1084 std::string descriptorKey(
"descriptorPtr");
1085 auto itMatching = auxData.find(matchingKey);
1086 auto itDescriptor = auxData.find(descriptorKey);
1087 if (itMatching != auxData.end()) (
const_cast<io::StreamMetadata::AuxDataMap&
>(auxData)).erase(itMatching);
1088 if (itDescriptor != auxData.end()) (
const_cast<io::StreamMetadata::AuxDataMap&
>(auxData)).erase(itDescriptor);
1091 static void insertDescriptor(
const io::StreamMetadata::AuxDataMap& auxData,
1092 const Descriptor::Ptr descriptor)
1094 std::string descriptorKey(
"descriptorPtr");
1095 std::string matchingKey(
"hasMatchingDescriptor");
1096 auto itMatching = auxData.find(matchingKey);
1097 if (itMatching == auxData.end()) {
1099 (
const_cast<io::StreamMetadata::AuxDataMap&
>(auxData))[matchingKey] =
true;
1100 (
const_cast<io::StreamMetadata::AuxDataMap&
>(auxData))[descriptorKey] = descriptor;
1104 static AttributeSet::Descriptor::Ptr retrieveMatchingDescriptor(
const io::StreamMetadata::AuxDataMap& auxData)
1106 std::string descriptorKey(
"descriptorPtr");
1107 auto itDescriptor = auxData.find(descriptorKey);
1109 const Descriptor::Ptr descriptor = std::any_cast<AttributeSet::Descriptor::Ptr>(itDescriptor->second);
1114 const io::StreamMetadata::Ptr meta = io::getStreamMetadataPtr(is);
1117 OPENVDB_THROW(IoError,
"Cannot read in a PointDataLeaf without StreamMetadata.");
1120 const Index pass(
static_cast<uint16_t
>(meta->pass()));
1121 const Index maximumPass(
static_cast<uint16_t
>(meta->pass() >> 16));
1124 const Index attributes = maximumPass >= 4 ? (maximumPass - 4) / 2 : 0;
1128 is.read(
reinterpret_cast<char*
>(&mVoxelBufferSize),
sizeof(uint16_t));
1129 Local::clearMatchingDescriptor(meta->auxData());
1131 else if (pass == 1) {
1133 if (Local::hasMatchingDescriptor(meta->auxData())) {
1134 AttributeSet::Descriptor::Ptr descriptor = Local::retrieveMatchingDescriptor(meta->auxData());
1135 mAttributeSet->resetDescriptor(descriptor,
true);
1139 is.read(
reinterpret_cast<char*
>(&header),
sizeof(uint8_t));
1140 mAttributeSet->readDescriptor(is);
1141 if (header & uint8_t(1)) {
1142 AttributeSet::DescriptorPtr descriptor = mAttributeSet->descriptorPtr();
1143 Local::insertDescriptor(meta->auxData(), descriptor);
1147 if (header & uint8_t(2)) {
1148 uint64_t bytesToSkip;
1149 is.read(
reinterpret_cast<char*
>(&bytesToSkip),
sizeof(uint64_t));
1150 if (bytesToSkip > uint64_t(0)) {
1151 auto metadata = io::getStreamMetadataPtr(is);
1152 if (metadata && metadata->seekable()) {
1153 is.seekg(bytesToSkip, std::ios_base::cur);
1156 std::vector<uint8_t> tempData(bytesToSkip);
1157 is.read(
reinterpret_cast<char*
>(&tempData[0]), bytesToSkip);
1162 if (header > uint8_t(3)) {
1163 OPENVDB_THROW(IoError,
"Unrecognised header flags in PointDataLeafNode");
1166 mAttributeSet->readMetadata(is);
1168 if (mAttributeSet->size() > attributes) {
1169 OPENVDB_THROW(IoError,
"PointDataGrid declares " << mAttributeSet->size()
1170 <<
" attributes, but only " << attributes <<
" can be read.");
1173 else if (pass < (attributes + 2)) {
1175 const size_t attributeIndex = pass - 2;
1177 mAttributeSet->get(attributeIndex) :
nullptr;
1179 compression::PagedInputStream& pagedStream =
1180 Local::getOrInsertPagedStream(meta->auxData(),
static_cast<Index>(attributeIndex));
1181 pagedStream.setInputStream(is);
1182 pagedStream.setSizeOnly(
true);
1183 array->readPagedBuffers(pagedStream);
1186 else if (pass == attributes + 2) {
1189 const Index passValue(meta->pass());
1192 io::StreamMetadata& nonConstMeta =
const_cast<io::StreamMetadata&
>(*meta);
1193 nonConstMeta.setPass(mVoxelBufferSize);
1196 BaseLeaf::readBuffers(is, fromHalf);
1199 nonConstMeta.setPass(passValue);
1201 else if (pass < (attributes*2 + 3)) {
1203 const Index attributeIndex = pass - attributes - 3;
1205 mAttributeSet->get(attributeIndex) :
nullptr;
1207 compression::PagedInputStream& pagedStream =
1208 Local::getOrInsertPagedStream(meta->auxData(), attributeIndex);
1209 pagedStream.setInputStream(is);
1210 pagedStream.setSizeOnly(
false);
1211 array->readPagedBuffers(pagedStream);
1214 if (pass > attributes + 3) {
1215 Local::destroyPagedStream(meta->auxData(), attributeIndex-1);
1218 else if (pass < buffers()) {
1220 const Index attributeIndex = pass - attributes - 4;
1221 Local::destroyPagedStream(meta->auxData(), attributeIndex);
1225 if (pass + 1 == maximumPass) {
1226 internal::validateReadOffsets(*
this);
1230template<
typename T, Index Log2Dim>
1232PointDataLeafNode<T, Log2Dim>::writeBuffers(std::ostream& os,
bool toHalf)
const
1236 static void destroyPagedStream(
const io::StreamMetadata::AuxDataMap& auxData,
const Index index)
1239 std::string key(
"paged:" + std::to_string(index));
1240 auto it = auxData.find(key);
1241 if (it != auxData.end()) {
1242 compression::PagedOutputStream& stream = *(std::any_cast<compression::PagedOutputStream::Ptr>(it->second));
1244 (
const_cast<io::StreamMetadata::AuxDataMap&
>(auxData)).erase(it);
1248 static compression::PagedOutputStream& getOrInsertPagedStream(
const io::StreamMetadata::AuxDataMap& auxData,
1251 std::string key(
"paged:" + std::to_string(index));
1252 auto it = auxData.find(key);
1253 if (it != auxData.end()) {
1254 return *(std::any_cast<compression::PagedOutputStream::Ptr>(it->second));
1257 compression::PagedOutputStream::Ptr pagedStream = std::make_shared<compression::PagedOutputStream>();
1258 (
const_cast<io::StreamMetadata::AuxDataMap&
>(auxData))[key] = pagedStream;
1259 return *pagedStream;
1263 static void insertDescriptor(
const io::StreamMetadata::AuxDataMap& auxData,
1264 const Descriptor::Ptr descriptor)
1266 std::string descriptorKey(
"descriptorPtr");
1267 std::string matchingKey(
"hasMatchingDescriptor");
1268 auto itMatching = auxData.find(matchingKey);
1269 auto itDescriptor = auxData.find(descriptorKey);
1270 if (itMatching == auxData.end()) {
1272 (
const_cast<io::StreamMetadata::AuxDataMap&
>(auxData))[matchingKey] =
true;
1274 (
const_cast<io::StreamMetadata::AuxDataMap&
>(auxData))[descriptorKey] = descriptor;
1278 bool matching = std::any_cast<bool>(itMatching->second);
1279 if (!matching)
return;
1283 const Descriptor::Ptr existingDescriptor = std::any_cast<AttributeSet::Descriptor::Ptr>(itDescriptor->second);
1284 if (*existingDescriptor != *descriptor) {
1285 (
const_cast<io::StreamMetadata::AuxDataMap&
>(auxData))[matchingKey] =
false;
1290 static bool hasMatchingDescriptor(
const io::StreamMetadata::AuxDataMap& auxData)
1292 std::string matchingKey(
"hasMatchingDescriptor");
1293 auto itMatching = auxData.find(matchingKey);
1295 if (itMatching == auxData.end())
return false;
1297 if (!std::any_cast<bool>(itMatching->second))
return false;
1301 static AttributeSet::Descriptor::Ptr retrieveMatchingDescriptor(
const io::StreamMetadata::AuxDataMap& auxData)
1303 std::string descriptorKey(
"descriptorPtr");
1304 auto itDescriptor = auxData.find(descriptorKey);
1306 if (itDescriptor == auxData.end())
return nullptr;
1308 const Descriptor::Ptr descriptor = std::any_cast<AttributeSet::Descriptor::Ptr>(itDescriptor->second);
1309 (
const_cast<io::StreamMetadata::AuxDataMap&
>(auxData)).erase(itDescriptor);
1313 static void clearMatchingDescriptor(
const io::StreamMetadata::AuxDataMap& auxData)
1315 std::string matchingKey(
"hasMatchingDescriptor");
1316 std::string descriptorKey(
"descriptorPtr");
1317 auto itMatching = auxData.find(matchingKey);
1318 auto itDescriptor = auxData.find(descriptorKey);
1319 if (itMatching != auxData.end()) (
const_cast<io::StreamMetadata::AuxDataMap&
>(auxData)).erase(itMatching);
1320 if (itDescriptor != auxData.end()) (
const_cast<io::StreamMetadata::AuxDataMap&
>(auxData)).erase(itDescriptor);
1324 const io::StreamMetadata::Ptr meta = io::getStreamMetadataPtr(os);
1327 OPENVDB_THROW(IoError,
"Cannot write out a PointDataLeaf without StreamMetadata.");
1330 const Index pass(
static_cast<uint16_t
>(meta->pass()));
1335 if (meta->countingPasses()) {
1336 const Index requiredPasses = this->buffers();
1337 if (requiredPasses > pass) {
1338 meta->setPass(requiredPasses);
1343 const Index maximumPass(
static_cast<uint16_t
>(meta->pass() >> 16));
1344 const Index attributes = (maximumPass - 4) / 2;
1348 io::writeCompressedValuesSize(os, this->buffer().data(), SIZE);
1350 Local::insertDescriptor(meta->auxData(), mAttributeSet->descriptorPtr());
1352 else if (pass == 1) {
1354 bool matchingDescriptor = Local::hasMatchingDescriptor(meta->auxData());
1355 if (matchingDescriptor) {
1356 AttributeSet::Descriptor::Ptr descriptor = Local::retrieveMatchingDescriptor(meta->auxData());
1360 os.write(
reinterpret_cast<const char*
>(&header),
sizeof(uint8_t));
1361 mAttributeSet->writeDescriptor(os,
false);
1367 os.write(
reinterpret_cast<const char*
>(&header),
sizeof(uint8_t));
1368 mAttributeSet->writeDescriptor(os,
false);
1370 mAttributeSet->writeMetadata(os,
false,
true);
1372 else if (pass < attributes + 2) {
1374 const Index attributeIndex = pass - 2;
1377 Local::destroyPagedStream(meta->auxData(), attributeIndex-1);
1379 const AttributeArray* array = attributeIndex < mAttributeSet->size() ?
1380 mAttributeSet->getConst(attributeIndex) :
nullptr;
1382 compression::PagedOutputStream& pagedStream =
1383 Local::getOrInsertPagedStream(meta->auxData(), attributeIndex);
1384 pagedStream.setOutputStream(os);
1385 pagedStream.setSizeOnly(
true);
1386 array->writePagedBuffers(pagedStream,
false);
1389 else if (pass == attributes + 2) {
1390 const Index attributeIndex = pass - 3;
1391 Local::destroyPagedStream(meta->auxData(), attributeIndex);
1393 BaseLeaf::writeBuffers(os, toHalf);
1395 else if (pass < (attributes*2 + 3)) {
1397 const Index attributeIndex = pass - attributes - 3;
1399 if (pass > attributes + 2) {
1400 Local::destroyPagedStream(meta->auxData(), attributeIndex-1);
1402 const AttributeArray* array = attributeIndex < mAttributeSet->size() ?
1403 mAttributeSet->getConst(attributeIndex) :
nullptr;
1405 compression::PagedOutputStream& pagedStream =
1406 Local::getOrInsertPagedStream(meta->auxData(), attributeIndex);
1407 pagedStream.setOutputStream(os);
1408 pagedStream.setSizeOnly(
false);
1409 array->writePagedBuffers(pagedStream,
false);
1412 else if (pass < buffers()) {
1413 Local::clearMatchingDescriptor(meta->auxData());
1415 const Index attributeIndex = pass - attributes - 4;
1416 Local::destroyPagedStream(meta->auxData(), attributeIndex);
1422template<
typename T, Index Log2Dim>
1429template<
typename T, Index Log2Dim>
1436template<
typename T, Index Log2Dim>
1443template<
typename T, Index Log2Dim>
1454 const Index offsetX = (x & (
DIM-1u)) << 2*Log2Dim;
1456 const Index offsetXY = offsetX + ((y & (
DIM-1u)) << Log2Dim);
1458 const Index offset = offsetXY + (z & (
DIM-1u));
1465template<
typename T, Index Log2Dim>
1481template <
typename Po
intDataTreeT>
1485 auto leafIter =
tree.beginLeaf();
1486 if (!leafIter)
return nullptr;
1489 auto newDescriptor = std::make_shared<AttributeSet::Descriptor>(descriptor);
1490 for (; leafIter; ++leafIter) {
1491 leafIter->resetDescriptor(newDescriptor);
1494 return newDescriptor;
1515template<
typename HeadT,
int HeadLevel>
1516struct PointDataNodeChain
1518 using SubtreeT =
typename PointDataNodeChain<
typename HeadT::ChildNodeType, HeadLevel-1>::Type;
1520 using Type =
typename SubtreeT::template Append<RootNodeT>;
1525template <
typename ChildT, Index Log2Dim,
int HeadLevel>
1526struct PointDataNodeChain<
tree::InternalNode<ChildT, Log2Dim>, HeadLevel>
1528 using SubtreeT =
typename PointDataNodeChain<ChildT, HeadLevel-1>::Type;
1530 using Type =
typename SubtreeT::template Append<InternalNodeT>;
1535template <
typename ChildT, Index Log2Dim>
1536struct PointDataNodeChain<tree::InternalNode<ChildT, Log2Dim>, 1>
1538 using LeafNodeT = PointDataLeafNode<PointDataIndex32, ChildT::LOG2DIM>;
1539 using InternalNodeT = tree::InternalNode<LeafNodeT, Log2Dim>;
1540 using Type = TypeList<LeafNodeT, InternalNodeT>;
1549template <
typename TreeType>
1552 using NodeChainT =
typename internal::PointDataNodeChain<RootNodeT, RootNodeT::LEVEL>::Type;
1568template<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:560
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.
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:760
Tag dispatch class that distinguishes topology copy constructors from deep copy constructors.
Definition Types.h:754
Definition Exceptions.h:65
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 bool compact()=0
Compact the existing array to become uniform if all values are identical.
An immutable object that stores name, type and AttributeSet position for a constant collection of att...
Definition AttributeSet.h:306
Util::GroupIndex GroupIndex
Definition AttributeSet.h:312
std::shared_ptr< Descriptor > Ptr
Definition AttributeSet.h:308
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
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:95
ChildOnCIter cbeginChildOn() const
Definition PointDataGrid.h:581
CoordBBox getNodeBoundingBox() const
Return the bounding box of this node, i.e., the full index space spanned by this leaf node.
Definition PointDataGrid.h:1438
IndexIter< ValueAllCIter, NullFilter > IndexAllIter
Definition PointDataGrid.h:512
void setValueOn(Index offset)
Definition PointDataGrid.h:402
void setValueOff(const Coord &, const ValueType &)
Definition PointDataGrid.h:398
ChildOnCIter beginChildOn() const
Definition PointDataGrid.h:582
ChildOnIter beginChildOn()
Definition PointDataGrid.h:583
void setActiveStateAndCache(const Coord &xyz, bool on, AccessorT &parent)
Definition PointDataGrid.h:440
void replaceAttributeSet(AttributeSet *attributeSet, bool allowMismatchingDescriptors=false)
Replace the underlying attribute set with the given attributeSet.
Definition PointDataGrid.h:708
typename BaseLeaf::template ValueIter< MaskOffIterator, const PointDataLeafNode, const ValueType, ValueOff > ValueOffCIter
Definition PointDataGrid.h:492
GroupWriteHandle groupWriteHandle(const Name &name)
Read-write group handle from group name.
Definition PointDataGrid.h:849
const AttributeArray & constAttributeArray(const Name &attributeName) const
Definition PointDataGrid.h:810
IndexIter< ValueOffCIter, NullFilter > IndexOffIter
Definition PointDataGrid.h:514
ValueOnIter endValueOn()
Definition PointDataGrid.h:573
PointDataLeafNode< T, Log2Dim > LeafNodeType
Definition PointDataGrid.h:98
util::NodeMask< Log2Dim > NodeMaskType
Definition PointDataGrid.h:113
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:664
PointDataLeafNode * touchLeaf(const Coord &)
Return a pointer to this node.
Definition PointDataGrid.h:314
PointDataLeafNode(const tools::PointIndexLeafNode< OtherValueType, Log2Dim > &other)
Definition PointDataGrid.h:152
ValueOffCIter cbeginValueOff() const
Definition PointDataGrid.h:564
PointDataLeafNode * touchLeafAndCache(const Coord &, AccessorT &)
Definition PointDataGrid.h:316
void validateOffsets() const
Throws an error if the voxel values on this leaf are not monotonically increasing or within the bound...
Definition PointDataGrid.h:745
PointDataLeafNode(const PointDataLeafNode &other, const Coord &coords, const T &value=zeroVal< T >(), bool active=false)
Definition PointDataGrid.h:142
bool operator==(const PointDataLeafNode &other) const
Definition PointDataGrid.h:301
const AttributeArray & attributeArray(const size_t pos) const
Definition PointDataGrid.h:777
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:295
ChildOnIter endChildOn()
Definition PointDataGrid.h:593
ValueAllIter endValueAll()
Definition PointDataGrid.h:579
GroupWriteHandle groupWriteHandle(const AttributeSet::Descriptor::GroupIndex &index)
Read-write group handle from group index.
Definition PointDataGrid.h:837
typename BaseLeaf::template ChildIter< MaskOnIterator, PointDataLeafNode, ChildOn > ChildOnIter
Definition PointDataGrid.h:498
void modifyValue(Index, const ModifyOp &)
Definition PointDataGrid.h:413
Index64 groupPointCount(const Name &groupName) const
Compute the point count in a specific group for the leaf.
Definition PointDataGrid.h:937
void setValueOn(Index, const ValueType &)
Definition PointDataGrid.h:405
void setValuesOff()
Definition PointDataGrid.h:410
ValueAllCIter endValueAll() const
Definition PointDataGrid.h:578
const PointDataLeafNode * probeLeaf(const Coord &) const
Definition PointDataGrid.h:338
ChildOffCIter endChildOff() const
Definition PointDataGrid.h:595
void setValueOff(Index, const ValueType &)
Definition PointDataGrid.h:399
PointDataLeafNode(PartialCreate, const Coord &coords, const T &value=zeroVal< T >(), bool active=false)
Definition PointDataGrid.h:170
ValueAllCIter cbeginValueAll() const
Definition PointDataGrid.h:567
typename BaseLeaf::ChildOff ChildOff
Definition PointDataGrid.h:465
AttributeArray & attributeArray(const size_t pos)
Read-write attribute array reference from index.
Definition PointDataGrid.h:769
typename BaseLeaf::template ValueIter< MaskOnIterator, const PointDataLeafNode, const ValueType, ValueOn > ValueOnCIter
Definition PointDataGrid.h:488
const PointDataLeafNode * probeConstLeaf(const Coord &) const
Return a const pointer to this node.
Definition PointDataGrid.h:333
void setValueOnly(Index, const ValueType &)
Definition PointDataGrid.h:393
tree::LeafNode< T, Log2Dim > BaseLeaf
Definition PointDataGrid.h:112
GroupHandle groupHandle(const Name &group) const
Read-only group handle from group name.
Definition PointDataGrid.h:829
std::shared_ptr< PointDataLeafNode > Ptr
Definition PointDataGrid.h:99
IndexAllIter beginIndexAll() const
Leaf index iterator.
Definition PointDataGrid.h:517
ValueOnCIter beginValueOn() const
Definition PointDataGrid.h:562
void clearAttributes(const bool updateValueMask=true, const AttributeArray::ScopedRegistryLock *lock=nullptr)
Clear the attribute set.
Definition PointDataGrid.h:633
bool hasAttribute(const Name &attributeName) const
Returns true if an attribute with this name exists.
Definition PointDataGrid.h:656
typename BaseLeaf::ChildOn ChildOn
Definition PointDataGrid.h:464
void signedFloodFill(const ValueType &, const ValueType &)
Definition PointDataGrid.h:449
PointDataLeafNode(const PointDataLeafNode &other)
Construct using deep copy of other PointDataLeafNode.
Definition PointDataGrid.h:130
void modifyValueAndActiveState(const Coord &, const ModifyOp &)
Definition PointDataGrid.h:419
typename BaseLeaf::ChildAll ChildAll
Definition PointDataGrid.h:466
IndexIter< IterT, FilterT > beginIndex(const FilterT &filter) const
IndexIter< ValueVoxelCIter, NullFilter > IndexVoxelIter
Definition PointDataGrid.h:511
ValueOnCIter cendValueOn() const
Definition PointDataGrid.h:571
void setOffsetOnly(Index offset, const ValueType &val)
Definition PointDataGrid.h:972
Index64 pointCount() const
Compute the total point count for the leaf.
Definition PointDataGrid.h:912
ValueOffCIter beginValueOff() const
Definition PointDataGrid.h:565
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:723
typename BaseLeaf::template ChildIter< MaskOffIterator, PointDataLeafNode, ChildOff > ChildOffIter
Definition PointDataGrid.h:502
IndexOffIter beginIndexOff() const
Definition PointDataGrid.h:527
ChildAllCIter cbeginChildAll() const
Definition PointDataGrid.h:587
ChildOffIter endChildOff()
Definition PointDataGrid.h:596
void modifyValueAndActiveStateAndCache(const Coord &, const ModifyOp &, AccessorT &)
Definition PointDataGrid.h:432
void setValueOnly(const Coord &, const ValueType &)
Definition PointDataGrid.h:392
ChildAllIter beginChildAll()
Definition PointDataGrid.h:589
void renameAttributes(const Descriptor &expected, Descriptor::Ptr &replacement)
Rename attributes in attribute set (order must remain the same).
Definition PointDataGrid.h:691
const PointDataLeafNode * probeConstLeafAndCache(const Coord &, AccessorT &) const
Definition PointDataGrid.h:335
static const Index DIM
Definition LeafNode.h:51
void setActiveState(const Coord &xyz, bool on)
Definition PointDataGrid.h:389
ValueOnIter beginValueOn()
Definition PointDataGrid.h:563
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:618
ValueVoxelCIter beginValueVoxel(const Coord &ijk) const
Leaf value voxel iterator.
Definition PointDataGrid.h:882
NodeT * probeNodeAndCache(const Coord &, AccessorT &)
Definition PointDataGrid.h:319
IndexIter< ValueAllCIter, FilterT > beginIndexAll(const FilterT &filter) const
Filtered leaf index iterator.
Definition PointDataGrid.h:538
void assertNonModifiableUnlessZero(const ValueType &value)
Definition PointDataGrid.h:385
const PointDataLeafNode * probeLeafAndCache(const Coord &, AccessorT &) const
Definition PointDataGrid.h:337
ChildOffCIter cbeginChildOff() const
Definition PointDataGrid.h:584
ChildOffIter beginChildOff()
Definition PointDataGrid.h:586
ChildOffCIter beginChildOff() const
Definition PointDataGrid.h:585
void dropAttributes(const std::vector< size_t > &pos, const Descriptor &expected, Descriptor::Ptr &replacement)
Drop list of attributes.
Definition PointDataGrid.h:676
void compactAttributes()
Compact all attributes in attribute set.
Definition PointDataGrid.h:698
void setValueOff(const Coord &xyz)
Definition PointDataGrid.h:395
bool operator!=(const PointDataLeafNode &other) const
Definition PointDataGrid.h:306
ValueOffIter endValueOff()
Definition PointDataGrid.h:576
void setValueOff(Index offset)
Definition PointDataGrid.h:396
IndexIter< ValueOnCIter, FilterT > beginIndexOn(const FilterT &filter) const
Definition PointDataGrid.h:543
ChildAllCIter endChildAll() const
Definition PointDataGrid.h:598
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:730
const NodeT * probeConstNodeAndCache(const Coord &, AccessorT &) const
Definition PointDataGrid.h:340
void setOffsetOn(Index offset, const ValueType &val)
Definition PointDataGrid.h:964
ValueOnCIter cbeginValueOn() const
Definition PointDataGrid.h:561
IndexIter< ValueOnCIter, NullFilter > IndexOnIter
Definition PointDataGrid.h:513
void clip(const CoordBBox &, const ValueType &value)
Definition PointDataGrid.h:422
ChildOnCIter endChildOn() const
Definition PointDataGrid.h:592
void reorderAttributes(const Descriptor::Ptr &replacement)
Reorder attribute set.
Definition PointDataGrid.h:684
ChildOnCIter cendChildOn() const
Definition PointDataGrid.h:591
void fill(const ValueType &, bool)
Definition PointDataGrid.h:1467
ChildAllCIter cendChildAll() const
Definition PointDataGrid.h:597
PointDataLeafNode()
Default constructor.
Definition PointDataGrid.h:124
const AttributeSet & attributeSet() const
Retrieve the attribute set.
Definition PointDataGrid.h:178
void assertNonmodifiable()
Definition PointDataGrid.h:378
void setValueOffAndCache(const Coord &, const ValueType &, AccessorT &)
Definition PointDataGrid.h:437
ChildAllIter endChildAll()
Definition PointDataGrid.h:599
IndexIter< ValueOffCIter, FilterT > beginIndexOff(const FilterT &filter) const
Definition PointDataGrid.h:548
bool hasAttribute(const size_t pos) const
Returns true if an attribute with this index exists.
Definition PointDataGrid.h:649
GroupHandle groupHandle(const AttributeSet::Descriptor::GroupIndex &index) const
}
Definition PointDataGrid.h:817
void resetBackground(const ValueType &, const ValueType &newBackground)
Definition PointDataGrid.h:444
typename NodeMaskType::OffIterator MaskOffIterator
Definition PointDataGrid.h:469
PointDataLeafNode(const tree::LeafNode< ValueType, Log2Dim > &other, const T &value, TopologyCopy)
Definition PointDataGrid.h:159
AttributeSet::UniquePtr stealAttributeSet()
Steal the attribute set, a new, empty attribute set is inserted in it's place.
Definition PointDataGrid.h:609
void setValue(const Coord &, const ValueType &)
Definition PointDataGrid.h:407
ValueAllCIter cendValueAll() const
Definition PointDataGrid.h:577
~PointDataLeafNode()=default
static const Index NUM_VALUES
Definition LeafNode.h:52
void negate()
Definition PointDataGrid.h:451
typename BaseLeaf::template ValueIter< MaskOnIterator, PointDataLeafNode, const ValueType, ValueOn > ValueOnIter
Definition PointDataGrid.h:486
ChildAllCIter beginChildAll() const
Definition PointDataGrid.h:588
typename BaseLeaf::ValueAll ValueAll
Definition PointDataGrid.h:457
std::pair< ValueType, ValueType > ValueTypePair
Definition PointDataGrid.h:102
void setValuesOn()
Definition PointDataGrid.h:409
AttributeSet::Descriptor Descriptor
Definition PointDataGrid.h:105
typename BaseLeaf::template DenseIter< const PointDataLeafNode, const ValueType, ChildAll > ChildAllCIter
Definition PointDataGrid.h:508
typename BaseLeaf::ValueOn ValueOn
Definition PointDataGrid.h:455
ChildOffCIter cendChildOff() const
Definition PointDataGrid.h:594
typename BaseLeaf::template ChildIter< MaskOnIterator, const PointDataLeafNode, ChildOn > ChildOnCIter
Definition PointDataGrid.h:500
void addLeafAndCache(PointDataLeafNode *, AccessorT &)
Definition PointDataGrid.h:310
void setValueOnlyAndCache(const Coord &, const ValueType &, AccessorT &)
Definition PointDataGrid.h:429
IndexIter< ValueVoxelCIter, FilterT > beginIndexVoxel(const Coord &ijk, const FilterT &filter) const
Filtered leaf index iterator from voxel.
Definition PointDataGrid.h:902
void fill(const ValueType &value)
Definition PointDataGrid.h:425
typename NodeMaskType::OnIterator MaskOnIterator
Definition PointDataGrid.h:468
void addLeaf(PointDataLeafNode *)
Definition PointDataGrid.h:308
void evalActiveBoundingBox(CoordBBox &bbox, bool visitVoxels=true) const
Definition PointDataGrid.h:1431
const AttributeArray & constAttributeArray(const size_t pos) const
Definition PointDataGrid.h:785
void signedFloodFill(const ValueType &)
Definition PointDataGrid.h:448
typename BaseLeaf::template ValueIter< MaskOffIterator, PointDataLeafNode, const ValueType, ValueOff > ValueOffIter
Definition PointDataGrid.h:490
ValueOffIter beginValueOff()
Definition PointDataGrid.h:566
void setValueOn(const Coord &xyz)
Definition PointDataGrid.h:401
void setActiveState(Index offset, bool on)
Definition PointDataGrid.h:390
AttributeArray & attributeArray(const Name &attributeName)
Read-write attribute array reference from name.
Definition PointDataGrid.h:792
IndexOnIter beginIndexOn() const
Definition PointDataGrid.h:522
typename BaseLeaf::ValueOff ValueOff
Definition PointDataGrid.h:456
typename BaseLeaf::template DenseIter< PointDataLeafNode, ValueType, ChildAll > ChildAllIter
Definition PointDataGrid.h:506
IndexVoxelIter beginIndexVoxel(const Coord &ijk) const
Leaf index iterator from voxel.
Definition PointDataGrid.h:893
Index64 offPointCount() const
Compute the total inactive (off) point count for the leaf.
Definition PointDataGrid.h:928
void modifyValue(const Coord &, const ModifyOp &)
Definition PointDataGrid.h:416
ValueOffCIter cendValueOff() const
Definition PointDataGrid.h:574
Index64 memUsage() const
Definition PointDataGrid.h:1424
void fill(const CoordBBox &, const ValueType &, bool)
Definition PointDataGrid.h:1445
Index64 onPointCount() const
Compute the total active (on) point count for the leaf.
Definition PointDataGrid.h:919
ValueOffCIter endValueOff() const
Definition PointDataGrid.h:575
typename BaseLeaf::template ValueIter< MaskDenseIterator, const PointDataLeafNode, const ValueType, ValueAll > ValueAllCIter
Definition PointDataGrid.h:496
typename BaseLeaf::template ChildIter< MaskOffIterator, const PointDataLeafNode, ChildOff > ChildOffCIter
Definition PointDataGrid.h:504
PointDataLeafNode * probeLeaf(const Coord &)
Definition PointDataGrid.h:326
T ValueType
Definition PointDataGrid.h:101
PointDataLeafNode * probeLeafAndCache(const Coord &, AccessorT &)
Definition PointDataGrid.h:328
ValueOnCIter endValueOn() const
Definition PointDataGrid.h:572
typename NodeMaskType::DenseIterator MaskDenseIterator
Definition PointDataGrid.h:470
ValueAllCIter beginValueAll() const
Definition PointDataGrid.h:568
PointDataLeafNode(const Coord &coords, const T &value=zeroVal< T >(), bool active=false)
Construct using supplied origin, value and active status.
Definition PointDataGrid.h:136
typename BaseLeaf::template ValueIter< MaskDenseIterator, PointDataLeafNode, const ValueType, ValueAll > ValueAllIter
Definition PointDataGrid.h:494
PointDataLeafNode(const tree::LeafNode< ValueType, Log2Dim > &other, const T &, const T &, TopologyCopy)
Definition PointDataGrid.h:166
const AttributeArray & attributeArray(const Name &attributeName) const
Definition PointDataGrid.h:801
friend class PointDataLeafNode
Definition PointDataGrid.h:474
void setValueOn(const Coord &, const ValueType &)
Definition PointDataGrid.h:404
ValueAllIter beginValueAll()
Definition PointDataGrid.h:569
std::vector< ValueType > IndexArray
Definition PointDataGrid.h:103
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
const ValueType & getValue(const Coord &xyz) const
Return the value of the voxel at the given coordinates.
Definition LeafNode.h:1111
void setValueMask(const NodeMaskType &mask)
Definition LeafNode.h:916
void setValuesOff()
Mark all voxels as inactive but don't change their values.
Definition LeafNode.h:504
const Buffer & buffer() const
Definition LeafNode.h:377
void setValueMaskOn(Index n)
Definition LeafNode.h:922
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:1161
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:1076
void setValueOff(const Coord &xyz)
Mark the voxel at the given coordinates as inactive but don't change its value.
Definition LeafNode.h:441
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:1488
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:627
void setValuesOn()
Mark all voxels as active but don't change their values.
Definition LeafNode.h:502
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:1470
bool isEmpty() const
Return true if this node has no active voxels.
Definition LeafNode.h:152
void setValueOn(const Coord &xyz)
Mark the voxel at the given coordinates as active but don't change its value.
Definition LeafNode.h:451
bool allocate()
Allocate memory for this node's buffer if it has not already been allocated.
Definition LeafNode.h:158
static const Index TOTAL
Definition LeafNode.h:50
Index64 memUsage() const
Return the memory in bytes occupied by this node.
Definition LeafNode.h:1460
bool isDense() const
Return true if this node contains only active voxels.
Definition LeafNode.h:154
const ValueType & getLastValue() const
Return a const reference to the last value in the buffer.
Definition LeafNode.h:663
Bit mask for the internal and leaf nodes of VDB. This is a 64-bit implementation.
Definition NodeMasks.h:309
DenseMaskIterator< NodeMask > DenseIterator
Definition NodeMasks.h:351
OnMaskIterator< NodeMask > OnIterator
Definition NodeMasks.h:349
OffMaskIterator< NodeMask > OffIterator
Definition NodeMasks.h:350
@ AttributeArray
Definition NanoVDB.h:416
Definition IndexIterator.h:35
@ ALL
Definition IndexIterator.h:44
@ NONE
Definition IndexIterator.h:43
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:68
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:73
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:1483
Definition PointDataGrid.h:48
std::string Name
Definition Name.h:19
Index32 Index
Definition Types.h:34
void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types.
constexpr T zeroVal()
Return the value of type T that corresponds to zero.
Definition Math.h:71
void uninitialize()
Global deregistration of native Grid, Transform, Metadata and Point attribute types.
int32_t Int32
Definition Types.h:36
uint64_t Index64
Definition Types.h:33
const char * typeNameAsString()
Definition Types.h:587
Definition Exceptions.h:13
#define OPENVDB_THROW(exception, message)
Definition Exceptions.h:74
Tag for multi-pass I/O. Only points::PointDataLeafNode may inherit from this.
Definition io.h:124
Similiar to ValueConverter, but allows for tree configuration conversion to a PointDataTree....
Definition PointDataGrid.h:1550
tree::Tree< typename NodeChainT::Back > Type
Definition PointDataGrid.h:1553
typename TreeType::RootNodeType RootNodeT
Definition PointDataGrid.h:1551
typename internal::PointDataNodeChain< RootNodeT, RootNodeT::LEVEL >::Type NodeChainT
Definition PointDataGrid.h:1552
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:282
Definition LeafNode.h:213
Definition LeafNode.h:213
Definition LeafNode.h:291
Definition LeafNode.h:212
Definition LeafNode.h:221
Definition LeafNode.h:212
Definition LeafNode.h:212
static const bool value
Definition PointDataGrid.h:1569
Definition LeafNode.h:952
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition version.h.in:121
#define OPENVDB_USE_VERSION_NAMESPACE
Definition version.h.in:291