10 #ifndef OPENVDB_POINTS_ATTRIBUTE_ARRAY_HAS_BEEN_INCLUDED 11 #define OPENVDB_POINTS_ATTRIBUTE_ARRAY_HAS_BEEN_INCLUDED 23 #include <tbb/spin_mutex.h> 24 #include <tbb/atomic.h> 29 #include <type_traits> 32 class TestAttributeArray;
48 template <
typename IntegerT,
typename FloatT>
52 static_assert(std::is_unsigned<IntegerT>::value,
"IntegerT must be unsigned");
59 template <
typename FloatT,
typename IntegerT>
63 static_assert(std::is_unsigned<IntegerT>::value,
"IntegerT must be unsigned");
67 template <
typename IntegerVectorT,
typename FloatT>
71 return IntegerVectorT(
72 floatingPointToFixedPoint<typename IntegerVectorT::ValueType>(v.
x()),
73 floatingPointToFixedPoint<typename IntegerVectorT::ValueType>(v.
y()),
74 floatingPointToFixedPoint<typename IntegerVectorT::ValueType>(v.
z()));
77 template <
typename FloatVectorT,
typename IntegerT>
82 fixedPointToFloatingPoint<typename FloatVectorT::ValueType>(v.
x()),
83 fixedPointToFloatingPoint<typename FloatVectorT::ValueType>(v.
y()),
84 fixedPointToFloatingPoint<typename FloatVectorT::ValueType>(v.
z()));
104 CONSTANTSTRIDE = 0x8,
112 WRITEMEMCOMPRESS = 0x4,
120 tbb::spin_mutex::scoped_lock lock;
125 using Ptr = std::shared_ptr<AttributeArray>;
126 using ConstPtr = std::shared_ptr<const AttributeArray>;
137 if (mFlags & PARTIALREAD) mCompressedBytes = 0;
139 #if OPENVDB_ABI_VERSION_NUMBER >= 6 161 virtual Index size()
const = 0;
165 virtual Index stride()
const = 0;
169 virtual Index dataSize()
const = 0;
171 #if OPENVDB_ABI_VERSION_NUMBER >= 6 172 virtual Name valueType()
const = 0;
176 virtual Name codecType()
const = 0;
180 virtual Index valueTypeSize()
const = 0;
184 virtual Index storageTypeSize()
const = 0;
187 virtual bool valueTypeIsFloatingPoint()
const = 0;
190 virtual bool valueTypeIsClass()
const = 0;
193 virtual bool valueTypeIsVector()
const = 0;
196 virtual bool valueTypeIsQuaternion()
const = 0;
199 virtual bool valueTypeIsMatrix()
const = 0;
203 virtual size_t memUsage()
const = 0;
208 static Ptr create(
const NamePair& type, Index length, Index stride = 1,
209 bool constantStride =
true,
222 virtual const NamePair& type()
const = 0;
224 template<
typename AttributeArrayType>
225 bool isType()
const {
return this->type() == AttributeArrayType::attributeType(); }
228 template<
typename ValueType>
229 bool hasValueType()
const {
return this->type().first == typeNameAsString<ValueType>(); }
233 #if OPENVDB_ABI_VERSION_NUMBER >= 6 239 virtual void set(
const Index n,
const AttributeArray& sourceArray,
const Index sourceIndex) = 0;
241 #if OPENVDB_ABI_VERSION_NUMBER >= 6 242 template<
typename IterT>
266 void copyValuesUnsafe(
const AttributeArray& sourceArray,
const IterT& iter);
270 template<
typename IterT>
271 void copyValues(
const AttributeArray& sourceArray,
const IterT& iter,
bool compact =
true);
275 virtual bool isUniform()
const = 0;
278 virtual void expand(
bool fill =
true) = 0;
280 virtual void collapse() = 0;
282 virtual bool compact() = 0;
289 virtual bool compress() = 0;
295 virtual bool decompress() = 0;
301 void setHidden(
bool state);
303 bool isHidden()
const {
return bool(mFlags & HIDDEN); }
308 void setTransient(
bool state);
316 void setStreaming(
bool state);
324 uint8_t
flags()
const {
return mFlags; }
327 virtual void read(std::istream&) = 0;
330 virtual void write(std::ostream&,
bool outputTransient)
const = 0;
332 virtual void write(std::ostream&)
const = 0;
335 virtual void readMetadata(std::istream&) = 0;
339 virtual void writeMetadata(std::ostream&,
bool outputTransient,
bool paged)
const = 0;
342 virtual void readBuffers(std::istream&) = 0;
345 virtual void writeBuffers(std::ostream&,
bool outputTransient)
const = 0;
354 virtual void loadData()
const = 0;
356 #if OPENVDB_ABI_VERSION_NUMBER >= 6 357 virtual bool isDataLoaded()
const = 0;
368 friend class ::TestAttributeArray;
374 #if OPENVDB_ABI_VERSION_NUMBER >= 6 375 virtual char* dataAsByteArray() = 0;
377 virtual const char* dataAsByteArray()
const = 0;
380 template <
typename IterT>
381 void doCopyValues(
const AttributeArray& sourceArray,
const IterT& iter,
382 bool rangeChecking =
true);
386 #if OPENVDB_ABI_VERSION_NUMBER >= 7 391 void setConstantStride(
bool state);
400 static void unregisterType(
const NamePair& type,
403 #if OPENVDB_ABI_VERSION_NUMBER < 6 405 size_t mCompressedBytes = 0;
407 uint8_t mUsePagedRead = 0;
408 tbb::atomic<Index32> mOutOfCore;
411 #else // #if OPENVDB_ABI_VERSION_NUMBER < 6 413 bool mIsUniform =
true;
416 uint8_t mUsePagedRead = 0;
436 template <
typename T>
444 mGetter(getter), mSetter(setter), mCollapser(collapser), mFiller(filler) { }
456 namespace attribute_traits
488 template <
typename T>
491 template<
typename ValueType>
static void decode(
const ValueType&, ValueType&);
492 template<
typename ValueType>
static void encode(
const ValueType&, ValueType&);
493 static const char*
name() {
return "null"; }
499 template <
typename T>
502 template<
typename StorageType,
typename ValueType>
static void decode(
const StorageType&, ValueType&);
503 template<
typename StorageType,
typename ValueType>
static void encode(
const ValueType&, StorageType&);
504 static const char*
name() {
return "trnc"; }
511 static const char*
name() {
return "fxpt"; }
512 template <
typename ValueType>
static ValueType
encode(
const ValueType& value) {
return value + ValueType(0.5); }
513 template <
typename ValueType>
static ValueType
decode(
const ValueType& value) {
return value - ValueType(0.5); }
520 static const char*
name() {
return "ufxpt"; }
521 template <
typename ValueType>
static ValueType
encode(
const ValueType& value) {
return value; }
522 template <
typename ValueType>
static ValueType
decode(
const ValueType& value) {
return value; }
526 template <
bool OneByte,
typename Range=PositionRange>
529 template <
typename T>
532 template<
typename StorageType,
typename ValueType>
static void decode(
const StorageType&, ValueType&);
533 template<
typename StorageType,
typename ValueType>
static void encode(
const ValueType&, StorageType&);
536 static const std::string
Name = std::string(Range::name()) + (OneByte ?
"8" :
"16");
546 template <
typename T>
551 static const char*
name() {
return "uvec"; }
560 template<
typename ValueType_,
typename Codec_ = NullCodec>
561 #if OPENVDB_ABI_VERSION_NUMBER >= 6 // for ABI=6, class is final to allow for de-virtualization 568 using Ptr = std::shared_ptr<TypedAttributeArray>;
569 using ConstPtr = std::shared_ptr<const TypedAttributeArray>;
573 using StorageType =
typename Codec::template Storage<ValueType>::Type;
579 const ValueType& uniformValue = zeroVal<ValueType>());
580 #if OPENVDB_ABI_VERSION_NUMBER >= 7 617 static Ptr create(
Index n,
Index strideOrTotalSize = 1,
bool constantStride =
true,
618 const Metadata* metadata =
nullptr);
627 static const NamePair& attributeType();
632 static bool isRegistered();
634 static void registerType();
636 static void unregisterType();
643 Index stride()
const override {
return hasConstantStride() ? mStrideOrTotalSize : 0; }
647 return hasConstantStride() ? mSize * mStrideOrTotalSize : mStrideOrTotalSize;
650 #if OPENVDB_ABI_VERSION_NUMBER >= 6 651 Name valueType()
const override {
return typeNameAsString<ValueType>(); }
665 bool valueTypeIsFloatingPoint()
const override;
668 bool valueTypeIsClass()
const override;
671 bool valueTypeIsVector()
const override;
674 bool valueTypeIsQuaternion()
const override;
677 bool valueTypeIsMatrix()
const override;
681 size_t memUsage()
const override;
688 template<
typename T>
void getUnsafe(
Index n, T& value)
const;
690 template<
typename T>
void get(
Index n, T& value)
const;
701 template<
typename T>
void setUnsafe(
Index n,
const T& value);
703 template<
typename T>
void set(
Index n,
const T& value);
710 #if OPENVDB_ABI_VERSION_NUMBER >= 6 720 void expand(
bool fill =
true)
override;
722 void collapse()
override;
724 bool compact()
override;
727 void collapse(
const ValueType& uniformValue);
743 void read(std::istream&)
override;
747 void write(std::ostream& os,
bool outputTransient)
const override;
749 void write(std::ostream&)
const override;
752 void readMetadata(std::istream&)
override;
757 void writeMetadata(std::ostream& os,
bool outputTransient,
bool paged)
const override;
760 void readBuffers(std::istream&)
override;
764 void writeBuffers(std::ostream& os,
bool outputTransient)
const override;
774 inline bool isOutOfCore()
const;
777 void loadData()
const override;
779 #if OPENVDB_ABI_VERSION_NUMBER >= 6 780 bool isDataLoaded()
const override;
792 inline bool validData()
const {
return !(isOutOfCore() || (flags() & PARTIALREAD)); }
795 friend class ::TestAttributeArray;
797 #if OPENVDB_ABI_VERSION_NUMBER >= 7 802 inline void doLoad()
const;
805 inline void doLoadUnsafe(
const bool compression =
true)
const;
807 inline bool compressUnsafe();
810 inline void setOutOfCore(
const bool);
815 #if OPENVDB_ABI_VERSION_NUMBER >= 6 816 char* dataAsByteArray()
override;
818 const char* dataAsByteArray()
const override;
821 size_t arrayMemUsage()
const;
828 return TypedAttributeArray::create(n, strideOrTotalSize, constantStride, metadata);
831 static std::unique_ptr<const NamePair> sTypeName;
832 std::unique_ptr<StorageType[]> mData;
834 Index mStrideOrTotalSize;
835 #if OPENVDB_ABI_VERSION_NUMBER < 6 // as of ABI=6, this data lives in the base class to reduce memory 836 bool mIsUniform =
true;
837 mutable tbb::spin_mutex mMutex;
847 template <
typename ValueType,
typename CodecType = UnknownCodec>
852 using Ptr = std::shared_ptr<Handle>;
861 static Ptr create(
const AttributeArray& array,
const bool collapseOnDestruction =
true);
873 bool isUniform()
const;
874 bool hasConstantStride()
const;
891 friend class ::TestAttributeArray;
893 template <
bool IsUnknownCodec>
894 typename std::enable_if<IsUnknownCodec, bool>::type compatibleType()
const;
896 template <
bool IsUnknownCodec>
897 typename std::enable_if<!IsUnknownCodec, bool>::type compatibleType()
const;
899 template <
bool IsUnknownCodec>
900 typename std::enable_if<IsUnknownCodec, ValueType>::type
get(
Index index)
const;
902 template <
bool IsUnknownCodec>
903 typename std::enable_if<!IsUnknownCodec, ValueType>::type
get(
Index index)
const;
908 Index mStrideOrTotalSize;
910 bool mCollapseOnDestruction;
918 template <
typename ValueType,
typename CodecType = UnknownCodec>
923 using Ptr = std::shared_ptr<Handle>;
934 void expand(
bool fill =
true);
938 void collapse(
const ValueType& uniformValue);
945 void fill(
const ValueType& value);
947 void set(
Index n,
const ValueType& value);
948 void set(
Index n,
Index m,
const ValueType& value);
953 friend class ::TestAttributeArray;
955 template <
bool IsUnknownCodec>
956 typename std::enable_if<IsUnknownCodec, void>::type
set(
Index index,
const ValueType& value)
const;
958 template <
bool IsUnknownCodec>
959 typename std::enable_if<!IsUnknownCodec, void>::type
set(
Index index,
const ValueType& value)
const;
969 template<
typename ValueType>
971 NullCodec::decode(
const ValueType& data, ValueType& val)
977 template<
typename ValueType>
979 NullCodec::encode(
const ValueType& val, ValueType& data)
985 template<
typename StorageType,
typename ValueType>
987 TruncateCodec::decode(
const StorageType& data, ValueType& val)
989 val =
static_cast<ValueType
>(data);
993 template<
typename StorageType,
typename ValueType>
995 TruncateCodec::encode(
const ValueType& val, StorageType& data)
997 data =
static_cast<StorageType
>(val);
1001 template <
bool OneByte,
typename Range>
1002 template<
typename StorageType,
typename ValueType>
1006 val = fixedPointToFloatingPoint<ValueType>(data);
1010 val = Range::template decode<ValueType>(val);
1014 template <
bool OneByte,
typename Range>
1015 template<
typename StorageType,
typename ValueType>
1021 const ValueType newVal = Range::template encode<ValueType>(val);
1023 data = floatingPointToFixedPoint<StorageType>(newVal);
1027 template<
typename T>
1031 val = math::QuantizedUnitVec::unpack(data);
1035 template<
typename T>
1039 data = math::QuantizedUnitVec::pack(val);
1047 #if OPENVDB_ABI_VERSION_NUMBER >= 6 1049 template <
typename IterT>
1050 void AttributeArray::doCopyValues(
const AttributeArray& sourceArray,
const IterT& iter,
1056 assert(sourceArray.
isDataLoaded() && this->isDataLoaded());
1058 assert(this->storageTypeSize()*this->stride() ==
1062 const char*
const sourceBuffer = sourceArray.dataAsByteArray();
1063 char*
const targetBuffer = this->dataAsByteArray();
1064 assert(sourceBuffer && targetBuffer);
1066 if (rangeChecking && this->isUniform()) {
1070 const bool sourceIsUniform = sourceArray.
isUniform();
1072 const Index sourceDataSize = rangeChecking ? sourceArray.
dataSize() : 0;
1073 const Index targetDataSize = rangeChecking ? this->dataSize() : 0;
1075 for (IterT it(iter); it; ++it) {
1076 const Index sourceIndex = sourceIsUniform ? 0 : it.sourceIndex();
1077 const Index targetIndex = it.targetIndex();
1079 if (rangeChecking) {
1080 if (sourceIndex >= sourceDataSize) {
1082 "Cannot copy array data as source index exceeds size of source array.");
1084 if (targetIndex >= targetDataSize) {
1086 "Cannot copy array data as target index exceeds size of target array.");
1090 assert(sourceIndex < sourceArray.
dataSize());
1091 assert(targetIndex < this->dataSize());
1092 if (this->isUniform()) assert(targetIndex ==
Index(0));
1095 const size_t targetOffset(targetIndex * bytes);
1096 const size_t sourceOffset(sourceIndex * bytes);
1098 std::memcpy(targetBuffer + targetOffset, sourceBuffer + sourceOffset, bytes);
1102 template <
typename IterT>
1103 void AttributeArray::copyValuesUnsafe(
const AttributeArray& sourceArray,
const IterT& iter)
1105 this->doCopyValues(sourceArray, iter,
false);
1108 template <
typename IterT>
1109 void AttributeArray::copyValues(
const AttributeArray& sourceArray,
const IterT& iter,
1113 if (bytes != this->storageTypeSize()) {
1130 this->doCopyValues(sourceArray, iter,
true);
1144 template<
typename ValueType_,
typename Codec_>
1148 template<
typename ValueType_,
typename Codec_>
1154 , mStrideOrTotalSize(strideOrTotalSize)
1156 if (constantStride) {
1158 if (strideOrTotalSize == 0) {
1160 "stride to be at least one.")
1165 if (mStrideOrTotalSize < n) {
1167 "a total size of at least the number of elements in the array.")
1171 mStrideOrTotalSize =
std::max(
Index(1), mStrideOrTotalSize);
1172 Codec::encode(uniformValue, this->
data()[0]);
1176 #if OPENVDB_ABI_VERSION_NUMBER >= 7 1177 template<
typename ValueType_,
typename Codec_>
1184 template<
typename ValueType_,
typename Codec_>
1186 const tbb::spin_mutex::scoped_lock& lock)
1189 template<
typename ValueType_,
typename Codec_>
1194 , mStrideOrTotalSize(rhs.mStrideOrTotalSize)
1195 #if OPENVDB_ABI_VERSION_NUMBER < 6 1201 std::memcpy(static_cast<void*>(this->
data()), rhs.
data(), this->arrayMemUsage());
1206 template<
typename ValueType_,
typename Codec_>
1212 tbb::spin_mutex::scoped_lock lock(
mMutex);
1213 tbb::spin_mutex::scoped_lock rhsLock(rhs.
mMutex);
1220 mStrideOrTotalSize = rhs.mStrideOrTotalSize;
1225 std::memcpy(static_cast<void*>(this->
data()), rhs.
data(), this->arrayMemUsage());
1233 template<
typename ValueType_,
typename Codec_>
1237 static std::once_flag once;
1238 std::call_once(once, []()
1240 sTypeName.reset(
new NamePair(typeNameAsString<ValueType>(), Codec::name()));
1246 template<
typename ValueType_,
typename Codec_>
1254 template<
typename ValueType_,
typename Codec_>
1262 template<
typename ValueType_,
typename Codec_>
1270 template<
typename ValueType_,
typename Codec_>
1279 typedMetadata ? typedMetadata->
value() : zeroVal<ValueType>()));
1282 template<
typename ValueType_,
typename Codec_>
1292 template<
typename ValueType_,
typename Codec_>
1302 template<
typename ValueType_,
typename Codec_>
1306 #if OPENVDB_ABI_VERSION_NUMBER < 7 1307 tbb::spin_mutex::scoped_lock lock(
mMutex);
1313 template<
typename ValueType_,
typename Codec_>
1317 return this->
copy();
1321 template<
typename ValueType_,
typename Codec_>
1331 template<
typename ValueType_,
typename Codec_>
1347 template<
typename ValueType_,
typename Codec_>
1353 this->setOutOfCore(
false);
1356 if (mData) mData.reset();
1360 #if OPENVDB_ABI_VERSION_NUMBER >= 6 1361 template<
typename ValueType_,
typename Codec_>
1367 if (std::is_same<ValueType, Quats>::value ||
1368 std::is_same<ValueType, Quatd>::value ||
1369 std::is_same<ValueType, Mat3s>::value ||
1370 std::is_same<ValueType, Mat3d>::value ||
1371 std::is_same<ValueType, Mat4s>::value ||
1372 std::is_same<ValueType, Mat4d>::value)
return true;
1377 return std::is_floating_point<ElementT>::value || std::is_same<half, ElementT>::value;
1381 template<
typename ValueType_,
typename Codec_>
1386 return std::is_class<ValueType>::value && !std::is_same<half, ValueType>::value;
1390 template<
typename ValueType_,
typename Codec_>
1398 template<
typename ValueType_,
typename Codec_>
1403 return !this->
valueType().compare(0, 4,
"quat");
1407 template<
typename ValueType_,
typename Codec_>
1412 return !this->
valueType().compare(0, 3,
"mat");
1417 template<
typename ValueType_,
typename Codec_>
1421 return sizeof(*this) + (bool(mData) ? this->arrayMemUsage() : 0);
1425 template<
typename ValueType_,
typename Codec_>
1437 template<
typename ValueType_,
typename Codec_>
1448 template<
typename ValueType_,
typename Codec_>
1449 template<
typename T>
1453 val =
static_cast<T
>(this->
getUnsafe(n));
1457 template<
typename ValueType_,
typename Codec_>
1458 template<
typename T>
1462 val =
static_cast<T
>(this->
get(n));
1466 template<
typename ValueType_,
typename Codec_>
1474 template<
typename ValueType_,
typename Codec_>
1489 template<
typename ValueType_,
typename Codec_>
1501 template<
typename ValueType_,
typename Codec_>
1502 template<
typename T>
1506 this->
setUnsafe(n, static_cast<ValueType>(val));
1510 template<
typename ValueType_,
typename Codec_>
1511 template<
typename T>
1515 this->
set(n,
static_cast<ValueType>(val));
1519 template<
typename ValueType_,
typename Codec_>
1527 template<
typename ValueType_,
typename Codec_>
1534 sourceTypedArray.
get(sourceIndex, sourceValue);
1536 this->
set(n, sourceValue);
1540 template<
typename ValueType_,
typename Codec_>
1549 tbb::spin_mutex::scoped_lock lock(
mMutex);
1561 template<
typename ValueType_,
typename Codec_>
1568 const ValueType_ val = this->
get(0);
1578 template<
typename ValueType_,
typename Codec_>
1582 this->
collapse(zeroVal<ValueType>());
1586 template<
typename ValueType_,
typename Codec_>
1591 tbb::spin_mutex::scoped_lock lock(
mMutex);
1596 Codec::encode(uniformValue, this->
data()[0]);
1600 template<
typename ValueType_,
typename Codec_>
1608 template<
typename ValueType_,
typename Codec_>
1613 tbb::spin_mutex::scoped_lock lock(
mMutex);
1620 Codec::encode(value, this->
data()[i]);
1625 template<
typename ValueType_,
typename Codec_>
1633 template<
typename ValueType_,
typename Codec_>
1641 template<
typename ValueType_,
typename Codec_>
1649 template<
typename ValueType_,
typename Codec_>
1657 template<
typename ValueType_,
typename Codec_>
1665 template<
typename ValueType_,
typename Codec_>
1673 template<
typename ValueType_,
typename Codec_>
1684 tbb::spin_mutex::scoped_lock lock(self->mMutex);
1685 this->doLoadUnsafe();
1689 template<
typename ValueType_,
typename Codec_>
1697 #if OPENVDB_ABI_VERSION_NUMBER >= 6 1698 template<
typename ValueType_,
typename Codec_>
1707 template<
typename ValueType_,
typename Codec_>
1716 template<
typename ValueType_,
typename Codec_>
1723 is.read(reinterpret_cast<char*>(&bytes),
sizeof(
Index64));
1724 bytes = bytes -
sizeof(
Int16) -
sizeof(
Index);
1726 uint8_t
flags = uint8_t(0);
1727 is.read(reinterpret_cast<char*>(&flags),
sizeof(uint8_t));
1730 uint8_t serializationFlags = uint8_t(0);
1731 is.read(reinterpret_cast<char*>(&serializationFlags),
sizeof(uint8_t));
1734 is.read(reinterpret_cast<char*>(&size),
sizeof(
Index));
1743 if (serializationFlags >= 0x10) {
1758 is.read(reinterpret_cast<char*>(&stride),
sizeof(
Index));
1759 mStrideOrTotalSize =
stride;
1762 mStrideOrTotalSize = 1;
1767 template<
typename ValueType_,
typename Codec_>
1776 tbb::spin_mutex::scoped_lock lock(
mMutex);
1780 uint8_t bloscCompressed(0);
1781 if (!
mIsUniform) is.read(reinterpret_cast<char*>(&bloscCompressed),
sizeof(uint8_t));
1786 mCompressedBytes = 0;
1791 if (bloscCompressed == uint8_t(1)) {
1797 if (newBuffer) buffer.reset(newBuffer.release());
1802 mData.reset(reinterpret_cast<StorageType*>(buffer.release()));
1806 template<
typename ValueType_,
typename Codec_>
1818 const bool delayLoad = (mappedFile.get() !=
nullptr);
1832 tbb::spin_mutex::scoped_lock lock(
mMutex);
1836 this->setOutOfCore(delayLoad);
1840 std::unique_ptr<char[]> buffer =
mPageHandle->read();
1841 mData.reset(reinterpret_cast<StorageType*>(buffer.release()));
1850 template<
typename ValueType_,
typename Codec_>
1854 this->
write(os,
false);
1858 template<
typename ValueType_,
typename Codec_>
1867 template<
typename ValueType_,
typename Codec_>
1871 if (!outputTransient && this->
isTransient())
return;
1878 uint8_t serializationFlags(0);
1881 bool strideOfOne(this->
stride() == 1);
1886 if (bloscCompression) this->doLoad();
1888 size_t compressedBytes = 0;
1898 if (bloscCompression && paged) serializationFlags |=
WRITEPAGED;
1900 else if (bloscCompression)
1904 const char* charBuffer =
reinterpret_cast<const char*
>(this->
data());
1905 const size_t inBytes = this->arrayMemUsage();
1912 bytes += (compressedBytes > 0) ? compressedBytes : this->arrayMemUsage();
1916 os.write(reinterpret_cast<const char*>(&bytes),
sizeof(
Index64));
1917 os.write(reinterpret_cast<const char*>(&flags),
sizeof(uint8_t));
1918 os.write(reinterpret_cast<const char*>(&serializationFlags),
sizeof(uint8_t));
1919 os.write(reinterpret_cast<const char*>(&size),
sizeof(
Index));
1922 if (!strideOfOne) os.write(reinterpret_cast<const char*>(&stride),
sizeof(
Index));
1926 template<
typename ValueType_,
typename Codec_>
1930 if (!outputTransient && this->
isTransient())
return;
1939 os.write(reinterpret_cast<const char*>(this->
data()),
sizeof(
StorageType));
1943 std::unique_ptr<char[]> compressedBuffer;
1944 size_t compressedBytes = 0;
1945 const char* charBuffer =
reinterpret_cast<const char*
>(this->
data());
1946 const size_t inBytes = this->arrayMemUsage();
1948 if (compressedBuffer) {
1949 uint8_t bloscCompressed(1);
1950 os.write(reinterpret_cast<const char*>(&bloscCompressed),
sizeof(uint8_t));
1951 os.write(reinterpret_cast<const char*>(compressedBuffer.get()), compressedBytes);
1954 uint8_t bloscCompressed(0);
1955 os.write(reinterpret_cast<const char*>(&bloscCompressed),
sizeof(uint8_t));
1956 os.write(reinterpret_cast<const char*>(this->
data()), inBytes);
1961 uint8_t bloscCompressed(0);
1962 os.write(reinterpret_cast<const char*>(&bloscCompressed),
sizeof(uint8_t));
1963 os.write(reinterpret_cast<const char*>(this->
data()), this->arrayMemUsage());
1968 template<
typename ValueType_,
typename Codec_>
1972 if (!outputTransient && this->
isTransient())
return;
1976 if (!bloscCompression) {
1987 os.
write(reinterpret_cast<const char*>(this->
data()), this->arrayMemUsage());
1991 template<
typename ValueType_,
typename Codec_>
2001 assert(self->mPageHandle);
2004 std::unique_ptr<char[]> buffer =
self->mPageHandle->read();
2006 self->mData.reset(reinterpret_cast<StorageType*>(buffer.release()));
2008 self->mPageHandle.reset();
2012 self->mOutOfCore =
false;
2016 template<
typename ValueType_,
typename Codec_>
2031 template<
typename ValueType_,
typename Codec_>
2036 if(!otherT)
return false;
2037 if(this->mSize != otherT->mSize ||
2038 this->mStrideOrTotalSize != otherT->mStrideOrTotalSize ||
2040 this->attributeType() != this->
attributeType())
return false;
2046 if (!target && !source)
return true;
2047 if (!target || !source)
return false;
2054 #if OPENVDB_ABI_VERSION_NUMBER >= 6 2055 template<
typename ValueType_,
typename Codec_>
2059 return reinterpret_cast<char*
>(this->
data());
2063 template<
typename ValueType_,
typename Codec_>
2067 return reinterpret_cast<const char*
>(this->
data());
2076 template <
typename CodecType,
typename ValueType>
2097 template <
typename ValueType>
2105 return (*functor)(array, n);
2110 (*functor)(array, n, value);
2119 template <
typename ValueType,
typename CodecType>
2127 template <
typename ValueType,
typename CodecType>
2132 , mCollapseOnDestruction(collapseOnDestruction && array.
isStreaming())
2134 if (!this->compatibleType<std::is_same<CodecType, UnknownCodec>::value>()) {
2155 template <
typename ValueType,
typename CodecType>
2162 template <
typename ValueType,
typename CodecType>
2163 template <
bool IsUnknownCodec>
2164 typename std::enable_if<IsUnknownCodec, bool>::type
2172 template <
typename ValueType,
typename CodecType>
2173 template <
bool IsUnknownCodec>
2174 typename std::enable_if<!IsUnknownCodec, bool>::type
2182 template <
typename ValueType,
typename CodecType>
2189 template <
typename ValueType,
typename CodecType>
2193 assert(index < (mSize * mStrideOrTotalSize));
2197 template <
typename ValueType,
typename CodecType>
2200 return this->get<std::is_same<CodecType, UnknownCodec>::value>(this->
index(n, m));
2203 template <
typename ValueType,
typename CodecType>
2204 template <
bool IsUnknownCodec>
2205 typename std::enable_if<IsUnknownCodec, ValueType>::type
2213 template <
typename ValueType,
typename CodecType>
2214 template <
bool IsUnknownCodec>
2215 typename std::enable_if<!IsUnknownCodec, ValueType>::type
2223 template <
typename ValueType,
typename CodecType>
2229 template <
typename ValueType,
typename CodecType>
2239 template <
typename ValueType,
typename CodecType>
2247 template <
typename ValueType,
typename CodecType>
2251 if (expand) array.
expand();
2254 template <
typename ValueType,
typename CodecType>
2257 this->set<std::is_same<CodecType, UnknownCodec>::value>(this->
index(n, 0), value);
2260 template <
typename ValueType,
typename CodecType>
2263 this->set<std::is_same<CodecType, UnknownCodec>::value>(this->
index(n, m), value);
2266 template <
typename ValueType,
typename CodecType>
2272 template <
typename ValueType,
typename CodecType>
2278 template <
typename ValueType,
typename CodecType>
2284 template <
typename ValueType,
typename CodecType>
2290 template <
typename ValueType,
typename CodecType>
2293 this->
mFiller(const_cast<AttributeArray*>(this->
mArray), value);
2296 template <
typename ValueType,
typename CodecType>
2297 template <
bool IsUnknownCodec>
2298 typename std::enable_if<IsUnknownCodec, void>::type
2306 template <
typename ValueType,
typename CodecType>
2307 template <
bool IsUnknownCodec>
2308 typename std::enable_if<!IsUnknownCodec, void>::type
2316 template <
typename ValueType,
typename CodecType>
2328 #endif // OPENVDB_POINTS_ATTRIBUTE_ARRAY_HAS_BEEN_INCLUDED Definition: AttributeArray.h:518
const AttributeArray & array() const
Definition: AttributeArray.h:2183
Index dataSize() const override
Return the size of the data in this array.
Definition: AttributeArray.h:646
static Ptr create(Index n, Index strideOrTotalSize=1, bool constantStride=true, const Metadata *metadata=nullptr)
Return a new attribute array of the given length n and stride with uniform value zero.
Definition: AttributeArray.h:1272
void read(std::istream &) override
Read attribute data from a stream.
Definition: AttributeArray.h:1709
Definition: openvdb/Exceptions.h:64
void setConstantStride(bool state)
Specify whether this attribute has a constant stride or not.
Definition: openvdb/Exceptions.h:57
AttributeWriteHandle(AttributeArray &array, const bool expand=true)
Definition: AttributeArray.h:2248
virtual Index stride() const =0
~TypedAttributeArray() override
Definition: AttributeArray.h:605
Definition: AttributeArray.h:114
A Paging wrapper to std::istream that is responsible for reading from a given input stream and creati...
Definition: StreamCompression.h:208
typename Codec::template Storage< ValueType >::Type StorageType
Definition: AttributeArray.h:573
StorageType * data()
Return the raw data buffer.
Definition: AttributeArray.h:788
T & z()
Definition: Vec3.h:85
SetterPtr mSetter
Definition: AttributeArray.h:447
void write(std::ostream &os, bool outputTransient) const override
Definition: AttributeArray.h:1860
#define OPENVDB_THROW(exception, message)
Definition: openvdb/Exceptions.h:82
Accessor base class for AttributeArray storage where type is not available.
Definition: AttributeArray.h:432
Definition: AttributeArray.h:466
static void registerType(const NamePair &type, FactoryMethod, const ScopedRegistryLock *lock=nullptr)
Register a attribute type along with a factory function.
Definition: AttributeArray.h:96
Accessor to call unsafe get and set methods based on templated Codec and Value.
Definition: AttributeArray.h:2077
tbb::atomic< Index32 > mOutOfCore
Definition: AttributeArray.h:417
std::shared_ptr< AttributeArray > Ptr
Definition: AttributeArray.h:125
void setUnsafe(Index n, const ValueType &value)
Set value at the given index n (assumes in-core)
Definition: AttributeArray.h:1476
virtual void expand(bool fill=true)=0
If this array is uniform, replace it with an array of length size().
bool operator!=(const AttributeArray &other) const
Definition: AttributeArray.h:365
void collapse() override
Replace the existing array with a uniform zero value.
Definition: AttributeArray.h:1580
short Type
Definition: AttributeArray.h:460
bool isTransient() const
Return true if this attribute is not serialized during stream output.
Definition: AttributeArray.h:310
Index size() const
Definition: AttributeArray.h:871
ValuePtr mCollapser
Definition: AttributeArray.h:448
half Type
Definition: AttributeArray.h:459
void set(Index n, const ValueType &value)
Set value at the given index n.
Definition: AttributeArray.h:1491
void(*)(AttributeArray *array, const Index &value) ValuePtr
Definition: AttributeArray.h:858
static const char * name()
Definition: AttributeArray.h:535
void(*)(AttributeArray *array, const Index n, const Index &value) SetterPtr
Definition: AttributeArray.h:857
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.
std::unique_ptr< PageHandle > Ptr
Definition: StreamCompression.h:171
std::istream & getInputStream()
Definition: StreamCompression.h:222
void set(Index n, const ValueType &value)
Definition: AttributeArray.h:2255
bool validData() const
Verify that data is not out-of-core or in a partially-read state.
Definition: AttributeArray.h:792
static const char * name()
Definition: AttributeArray.h:504
virtual bool isDataLoaded() const =0
Return true if all data has been loaded.
Definition: AttributeArray.h:489
bool valueTypeIsQuaternion() const override
Return true if the value type is a quaternion.
Definition: AttributeArray.h:1400
bool isHidden() const
Return true if this attribute is hidden (e.g., from UI or iterators).
Definition: AttributeArray.h:303
int16_t Int16
Definition: openvdb/Types.h:33
ValueType_ ValueType
Definition: AttributeArray.h:571
bool isType() const
Return true if this attribute is of the same type as the template parameter.
Definition: AttributeArray.h:225
AttributeHandle(const AttributeArray &array, const bool collapseOnDestruction=true)
Definition: AttributeArray.h:2128
Definition: AttributeArray.h:110
Index stride() const override
Definition: AttributeArray.h:643
void(*)(AttributeArray *array, const Index n, const T &value) SetterPtr
Definition: AttributeArray.h:440
OPENVDB_API SharedPtr< MappedFile > getMappedFilePtr(std::ios_base &)
Return a shared pointer to the memory-mapped file with which the given stream is associated, or a null pointer if the stream is not associated with a memory-mapped file.
Typed class for storing attribute data.
Definition: AttributeArray.h:562
virtual AccessorBasePtr getAccessor() const =0
Obtain an Accessor that stores getter and setter functors.
T & y()
Definition: Vec3.h:84
typename T::ValueType ElementType
Definition: openvdb/Types.h:186
void fill(const ValueType &value)
Fill the existing array with the given value.
Definition: AttributeArray.h:1610
SerializationFlag
Definition: AttributeArray.h:109
virtual Index dataSize() const =0
void(*)(AttributeArray *array, const Index n, const ValueType &value) SetterPtr
Definition: AttributeArray.h:2101
void expand(bool fill=true)
If this array is uniform, replace it with an array of length size().
Definition: AttributeArray.h:2267
void(*)(AttributeArray *array, const T &value) ValuePtr
Definition: AttributeArray.h:441
StorageType Type
Definition: AttributeArray.h:547
static Ptr create(const AttributeArray &array, const bool collapseOnDestruction=true)
Definition: AttributeArray.h:2121
Definition: AttributeArray.h:118
Definition: AttributeArray.h:497
uint8_t mUsePagedRead
Definition: AttributeArray.h:416
Base class for storing attribute data.
Definition: AttributeArray.h:92
uint64_t Index64
Definition: openvdb/Types.h:31
tbb::spin_mutex mMutex
Definition: AttributeArray.h:414
bool sizeOnly() const
Definition: StreamCompression.h:256
bool hasConstantStride() const
Return true if this attribute has a constant stride.
Definition: AttributeArray.h:321
Definition: openvdb/Exceptions.h:65
bool hasValueType() const
Return true if this attribute has a value type the same as the template parameter.
Definition: AttributeArray.h:229
Convenience wrappers to using Blosc and reading and writing of Paged data.
static const char * name()
Definition: AttributeArray.h:493
Definition: AttributeArray.h:547
ValuePtr mCollapser
Definition: AttributeArray.h:887
static TypedAttributeArray & cast(AttributeArray &attributeArray)
Cast an AttributeArray to TypedAttributeArray<T>
Definition: AttributeArray.h:1284
PagedOutputStream & write(const char *str, std::streamsize n)
Writes the given.
bool isUniform() const
Definition: AttributeArray.h:2224
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:94
typename attribute_traits::UIntTypeTrait< OneByte, T >::Type Type
Definition: AttributeArray.h:530
data is marked as strided when written
Definition: AttributeArray.h:111
static const char * name()
Definition: AttributeArray.h:511
static void unregisterType(const NamePair &type, const ScopedRegistryLock *lock=nullptr)
Remove a attribute type from the registry.
T(*)(const AttributeArray *array, const Index n) GetterPtr
Definition: AttributeArray.h:439
bool hasConstantStride() const
Definition: AttributeArray.h:2230
AccessorBasePtr getAccessor() const override
Obtain an Accessor that stores getter and setter functors.
Definition: AttributeArray.h:2018
bool isDataLoaded() const override
Return true if all data has been loaded.
Definition: AttributeArray.h:1700
Accessor(GetterPtr getter, SetterPtr setter, ValuePtr collapser, ValuePtr filler)
Definition: AttributeArray.h:443
static const char * name()
Definition: AttributeArray.h:520
ValueType get(Index n, Index m=0) const
Definition: AttributeArray.h:2198
TypedAttributeArray & operator=(const TypedAttributeArray &)
Definition: AttributeArray.h:1208
std::unique_ptr< Handle > UniquePtr
Definition: AttributeArray.h:853
Index storageTypeSize() const override
Definition: AttributeArray.h:662
OPENVDB_DEPRECATED AttributeArray::Ptr copyUncompressed() const override
Definition: AttributeArray.h:1315
bool valueTypeIsFloatingPoint() const override
Return true if the value type is floating point.
Definition: AttributeArray.h:1363
Definition: AttributeArray.h:530
static bool isRegistered()
Return true if this attribute type is registered.
Definition: AttributeArray.h:1248
Name valueType() const override
Return the name of the value type of a single element in this array (e.g., "float" or "vec3d")...
Definition: AttributeArray.h:652
void readBuffers(std::istream &) override
Read attribute buffers from a stream.
Definition: AttributeArray.h:1769
virtual bool valueTypeIsFloatingPoint() const =0
Return true if the value type is floating point.
ValueType getUnsafe(Index n) const
Return the value at index n (assumes in-core)
Definition: AttributeArray.h:1427
bool operator==(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Equality operator, does exact floating point comparisons.
Definition: Vec3.h:471
typename attribute_traits::TruncateTrait< T >::Type Type
Definition: AttributeArray.h:500
Definition: openvdb/Exceptions.h:13
GetterPtr mGetter
Definition: AttributeArray.h:446
ValueType(*)(const AttributeArray *array, const Index n) GetterPtr
Definition: AttributeArray.h:2100
virtual ~AttributeHandle()
Definition: AttributeArray.h:2156
static const char * name()
Definition: AttributeArray.h:551
OPENVDB_DEPRECATED bool decompress() override
Uncompress the attribute array.
Definition: AttributeArray.h:1651
static void registerType()
Register this attribute type along with a factory function.
Definition: AttributeArray.h:1256
PageHandle::Ptr createHandle(std::streamsize n)
Creates a PageHandle to access the next.
void writeMetadata(std::ostream &os, bool outputTransient, bool paged) const override
Definition: AttributeArray.h:1869
virtual Index storageTypeSize() const =0
Flag
Definition: AttributeArray.h:101
bool isExactlyEqual(const T0 &a, const T1 &b)
Return true if a is exactly equal to b.
Definition: Math.h:434
Index index(Index n, Index m) const
Definition: AttributeArray.h:2190
bool compact()
Compact the existing array to become uniform if all values are identical.
Definition: AttributeArray.h:2279
void fill(const ValueType &value)
Fill the existing array with the given value.
Definition: AttributeArray.h:2291
T Type
Definition: AttributeArray.h:489
uint16_t StorageType
Definition: AttributeArray.h:544
static ValueType decode(const ValueType &value)
Definition: AttributeArray.h:522
T & x()
Reference to the component, e.g. v.x() = 4.5f;.
Definition: Vec3.h:83
Definition: AttributeArray.h:848
void collapse()
Replace the existing array with a uniform value (zero if none provided).
Definition: AttributeArray.h:2273
AttributeArray & array()
Definition: AttributeArray.h:2317
Definition: openvdb/Types.h:182
static ValueType encode(const ValueType &value)
Definition: AttributeArray.h:521
Definition: AttributeArray.h:527
ValuePtr mFiller
Definition: AttributeArray.h:888
std::pair< Name, Name > NamePair
Definition: AttributeArray.h:39
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...
GetterPtr mGetter
Definition: AttributeArray.h:885
IntegerVectorT floatingPointToFixedPoint(const math::Vec3< FloatT > &v)
Definition: AttributeArray.h:69
OPENVDB_API size_t bloscCompressedSize(const char *buffer, const size_t uncompressedBytes)
Convenience wrapper to retrieve the compressed size of buffer when compressed.
void read(PageHandle::Ptr &pageHandle, std::streamsize n, bool delayed=true)
Takes a pageHandle and updates the referenced page with the current stream pointer position and if de...
virtual void loadData() const =0
Ensures all data is in-core.
std::shared_ptr< TypedAttributeArray > Ptr
Definition: AttributeArray.h:568
std::string Name
Definition: Name.h:17
void expand(bool fill=true) override
Replace the single value storage with an array of length size().
Definition: AttributeArray.h:1542
bool sizeOnly() const
Definition: StreamCompression.h:219
bool mIsUniform
Definition: AttributeArray.h:413
AttributeArray::Ptr copy() const override
Definition: AttributeArray.h:1304
std::ostream & getOutputStream()
Set and get the output stream.
Definition: StreamCompression.h:259
void writePagedBuffers(compression::PagedOutputStream &os, bool outputTransient) const override
Definition: AttributeArray.h:1970
static ValueType encode(const ValueType &value)
Definition: AttributeArray.h:512
const AttributeArray * mArray
Definition: AttributeArray.h:883
virtual ~AttributeArray()
Definition: AttributeArray.h:133
uint8_t flags() const
Retrieve the attribute array flags.
Definition: AttributeArray.h:324
static Ptr create(AttributeArray &array, const bool expand=true)
Definition: AttributeArray.h:2241
Definition: Compression.h:56
void writeBuffers(std::ostream &os, bool outputTransient) const override
Definition: AttributeArray.h:1928
Write-able version of AttributeHandle.
Definition: AttributeArray.h:919
void(*)(AttributeArray *array, const Index n, const ValueType &value) SetterPtr
Definition: AttributeArray.h:2080
AttributeArray()
Definition: AttributeArray.h:132
#define OPENVDB_LOG_WARN(message)
Log a warning message of the form 'someVar << "some text" << ...'.
Definition: logging.h:253
static void unregisterType()
Remove this attribute type from the registry.
Definition: AttributeArray.h:1264
std::shared_ptr< Handle > Ptr
Definition: AttributeArray.h:852
OPENVDB_DEPRECATED bool compress() override
Compress the attribute array.
Definition: AttributeArray.h:1635
Ptr(*)(Index, Index, bool, const Metadata *) FactoryMethod
Definition: AttributeArray.h:128
ValueType(*)(const AttributeArray *array, const Index n) GetterPtr
Definition: AttributeArray.h:2079
bool valueTypeIsClass() const override
Return true if the value type is a class (ie vector, matrix or quaternion return true) ...
Definition: AttributeArray.h:1383
static bool isRegistered(const NamePair &type, const ScopedRegistryLock *lock=nullptr)
Return true if the given attribute type name is registered.
Codec_ Codec
Definition: AttributeArray.h:572
void loadData() const override
Ensures all data is in-core.
Definition: AttributeArray.h:1691
size_t memUsage() const override
Return the number of bytes of memory used by this attribute.
Definition: AttributeArray.h:1419
void readMetadata(std::istream &) override
Read attribute metadata from a stream.
Definition: AttributeArray.h:1718
bool valueTypeIsMatrix() const override
Return true if the value type is a matrix.
Definition: AttributeArray.h:1409
Index size() const override
Return the number of elements in this array.
Definition: AttributeArray.h:639
Definition: AttributeArray.h:486
bool valueTypeIsVector() const override
Return true if the value type is a vector.
Definition: AttributeArray.h:1392
std::shared_ptr< Handle > Ptr
Definition: AttributeArray.h:923
static ValueType decode(const ValueType &value)
Definition: AttributeArray.h:513
TypedAttributeArray(Index n=1, Index strideOrTotalSize=1, bool constantStride=true, const ValueType &uniformValue=zeroVal< ValueType >())
Default constructor, always constructs a uniform attribute.
Definition: AttributeArray.h:1149
uint16_t Type
Definition: AttributeArray.h:468
uint8_t mFlags
Definition: AttributeArray.h:415
uint8_t Type
Definition: AttributeArray.h:467
A Paging wrapper to std::ostream that is responsible for writing from a given output stream at interv...
Definition: StreamCompression.h:245
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:146
Definition: openvdb/Exceptions.h:58
bool isStreaming() const
Return true if this attribute is in streaming mode.
Definition: AttributeArray.h:318
Definition: AttributeArray.h:509
compression::PageHandle::Ptr mPageHandle
Definition: AttributeArray.h:420
std::unique_ptr< Handle > ScopedPtr
Definition: AttributeArray.h:924
size_t mCompressedBytes
Definition: AttributeArray.h:421
Definition: AttributeArray.h:542
ValuePtr mFiller
Definition: AttributeArray.h:449
std::shared_ptr< AccessorBase > AccessorBasePtr
Definition: AttributeArray.h:98
Definition: AttributeArray.h:458
const StorageType * data() const
Definition: AttributeArray.h:789
Index32 Index
Definition: openvdb/Types.h:32
virtual bool isUniform() const =0
Return true if this array is stored as a single uniform value.
Definition: AttributeArray.h:483
OPENVDB_API uint32_t getDataCompression(std::ios_base &)
Return a bitwise OR of compression option flags (COMPRESS_ZIP, COMPRESS_ACTIVE_MASK, etc.) specifying whether and how input data is compressed or output data should be compressed.
SetterPtr mSetter
Definition: AttributeArray.h:886
Index stride() const
Definition: AttributeArray.h:870
SharedPtr< MappedFile > Ptr
Definition: io.h:136
Name codecType() const override
Return the name of the codec used by this array (e.g., "trnc" or "fxpt").
Definition: AttributeArray.h:655
bool isUniform() const override
Return true if this array is stored as a single uniform value.
Definition: AttributeArray.h:716
Index(*)(const AttributeArray *array, const Index n) GetterPtr
Definition: AttributeArray.h:856
ValueType get(Index n) const
Return the value at index n.
Definition: AttributeArray.h:1439
const NamePair & type() const override
Return the name of this attribute's type.
Definition: AttributeArray.h:629
FloatVectorT fixedPointToFloatingPoint(const math::Vec3< IntegerT > &v)
Definition: AttributeArray.h:79
Index OPENVDB_DEPRECATED
Definition: AttributeArrayString.h:33
bool compact() override
Compact the existing array to become uniform if all values are identical.
Definition: AttributeArray.h:1563
void readPagedBuffers(compression::PagedInputStream &) override
Read attribute buffers from a paged stream.
Definition: AttributeArray.h:1808
Definition: AttributeArray.h:500
streaming mode collapses attributes when first accessed
Definition: AttributeArray.h:106
bool isOutOfCore() const
Return true if this buffer's values have not yet been read from disk.
Definition: AttributeArray.h:1659
std::shared_ptr< const AttributeArray > ConstPtr
Definition: AttributeArray.h:126
Index valueTypeSize() const override
Return the size in bytes of the value type of a single element in this array.
Definition: AttributeArray.h:658
static const NamePair & attributeType()
Return the name of this attribute's type (includes codec)
Definition: AttributeArray.h:1235