OpenVDB 7.0.0

Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
TypedAttributeArray< ValueType_, Codec_ > Class Template Referencefinal

Typed class for storing attribute data. More...

`#include <AttributeArray.h>`

Inherits AttributeArray.

## Public Types
using | Ptr = std::shared_ptr< TypedAttributeArray >
using | ConstPtr = std::shared_ptr< const TypedAttributeArray >
using | ValueType = ValueType_
using | Codec = Codec_
using | StorageType = typename Codec::template Storage< ValueType >::Type
enum | Flag { TRANSIENT = 0x1, HIDDEN = 0x2, OUTOFCORE = 0x4, CONSTANTSTRIDE = 0x8, STREAMING = 0x10, PARTIALREAD = 0x20 }
enum | SerializationFlag { WRITESTRIDED = 0x1, WRITEUNIFORM = 0x2, WRITEMEMCOMPRESS = 0x4, WRITEPAGED = 0x8 }
using | FactoryMethod = Ptr(*)(Index, Index, bool)

## Public Member Functions
| TypedAttributeArray (Index n=1, Index strideOrTotalSize=1, bool constantStride=true, const ValueType &uniformValue=zeroVal< ValueType >())
| Default constructor, always constructs a uniform attribute. More...
| TypedAttributeArray (const TypedAttributeArray &)
OPENVDB_DEPRECATED | TypedAttributeArray (const TypedAttributeArray &, bool)
TypedAttributeArray & | operator= (const TypedAttributeArray &)
| TypedAttributeArray (TypedAttributeArray &&)=delete
| Move constructor disabled. More...
TypedAttributeArray & | operator= (TypedAttributeArray &&)=delete
| Move assignment operator disabled. More...
| ~TypedAttributeArray () override
AttributeArray::Ptr | copy () const override
OPENVDB_DEPRECATED AttributeArray::Ptr | copyUncompressed () const override
const NamePair & | type () const override
| Return the name of this attribute's type. More...
Index | size () const override
| Return the number of elements in this array. More...
Index | stride () const override
Index | dataSize () const override
| Return the size of the data in this array. More...
Name | valueType () const override
| Return the name of the value type of a single element in this array (e.g., "float" or "vec3d"). More...
Name | codecType () const override
| Return the name of the codec used by this array (e.g., "trnc" or "fxpt"). More...
Index | valueTypeSize () const override
| Return the size in bytes of the value type of a single element in this array. More...
Index | storageTypeSize () const override
bool | valueTypeIsFloatingPoint () const override
| Return `true` if the value type is floating point. More...
bool | valueTypeIsClass () const override
| Return `true` if the value type is a class (ie vector, matrix or quaternion return true) More...
bool | valueTypeIsVector () const override
| Return `true` if the value type is a vector. More...
bool | valueTypeIsQuaternion () const override
| Return `true` if the value type is a quaternion. More...
bool | valueTypeIsMatrix () const override
| Return `true` if the value type is a matrix. More...
size_t | memUsage () const override
| Return the number of bytes of memory used by this attribute. More...
ValueType | getUnsafe (Index n) const
| Return the value at index n (assumes uncompressed and in-core) More...
ValueType | get (Index n) const
| Return the value at index n. More...
template<typename T >
void | getUnsafe (Index n, T &value) const
| Return the value at index n (assumes uncompressed and in-core) More...
template<typename T >
void | get (Index n, T &value) const
| Return the value at index n. More...
void | setUnsafe (Index n, const ValueType &value)
| Set value at the given index n (assumes uncompressed and in-core) More...
void | set (Index n, const ValueType &value)
| Set value at the given index n. More...
template<typename T >
void | setUnsafe (Index n, const T &value)
| Set value at the given index n (assumes uncompressed and in-core) More...
template<typename T >
void | set (Index n, const T &value)
| Set value at the given index n. More...
OPENVDB_DEPRECATED void | set (const Index n, const AttributeArray &sourceArray, const Index sourceIndex) override
| Set value at given index n from sourceIndex of another sourceArray. More...
bool | isUniform () const override
| Return `true` if this array is stored as a single uniform value. More...
void | expand (bool fill=true) override
| Replace the single value storage with an array of length size(). More...
void | collapse () override
| Replace the existing array with a uniform zero value. More...
bool | compact () override
| Compact the existing array to become uniform if all values are identical. More...
void | collapse (const ValueType &uniformValue)
| Replace the existing array with the given uniform value. More...
void | fill (const ValueType &value)
| Fill the existing array with the given value. More...
OPENVDB_DEPRECATED bool | compress () override
| Compress the attribute array. More...
OPENVDB_DEPRECATED bool | decompress () override
| Uncompress the attribute array. More...
void | read (std::istream &) override
| Read attribute data from a stream. More...
void | write (std::ostream &os, bool outputTransient) const override
void | write (std::ostream &) const override
| Write attribute data to a stream, don't write transient attributes. More...
void | readMetadata (std::istream &) override
| Read attribute metadata from a stream. More...
void | writeMetadata (std::ostream &os, bool outputTransient, bool paged) const override
void | readBuffers (std::istream &) override
| Read attribute buffers from a stream. More...
void | writeBuffers (std::ostream &os, bool outputTransient) const override
void | readPagedBuffers (compression::PagedInputStream &) override
| Read attribute buffers from a paged stream. More...
void | writePagedBuffers (compression::PagedOutputStream &os, bool outputTransient) const override
bool | isOutOfCore () const
| Return `true` if this buffer's values have not yet been read from disk. More...
void | loadData () const override
| Ensures all data is in-core. More...
bool | isDataLoaded () const override
| Return `true` if all data has been loaded. More...
template<typename AttributeArrayType >
bool | isType () const
| Return `true` if this attribute is of the same type as the template parameter. More...
template<typename ValueType >
bool | hasValueType () const
| Return `true` if this attribute has a value type the same as the template parameter. More...
template<typename IterT >
void | copyValuesUnsafe (const AttributeArray &sourceArray, const IterT &iter)
| Copy values into this array from a source array to a target array as referenced by an iterator. More...
template<typename IterT >
void | copyValues (const AttributeArray &sourceArray, const IterT &iter, bool compact=true)
| Like copyValuesUnsafe(), but if compact is true, attempt to collapse this array. More...
OPENVDB_DEPRECATED bool | isCompressed () const
void | setHidden (bool state)
| Specify whether this attribute should be hidden (e.g., from UI or iterators). More...
bool | isHidden () const
| Return `true` if this attribute is hidden (e.g., from UI or iterators). More...
void | setTransient (bool state)
| Specify whether this attribute should only exist in memory and not be serialized during stream output. More...
bool | isTransient () const
| Return `true` if this attribute is not serialized during stream output. More...
void | setStreaming (bool state)
| Specify whether this attribute is to be streamed off disk, in which case, the attributes are collapsed after being first loaded leaving them in a destroyed state. More...
bool | isStreaming () const
| Return `true` if this attribute is in streaming mode. More...
bool | hasConstantStride () const
| Return `true` if this attribute has a constant stride. More...
uint8_t | flags () const
| Retrieve the attribute array flags. More...
bool | operator== (const AttributeArray &other) const
bool | operator!= (const AttributeArray &other) const

## Static Public Member Functions
static Ptr | create (Index n, Index strideOrTotalSize=1, bool constantStride=true)
| Return a new attribute array of the given length n and stride with uniform value zero. More...
static TypedAttributeArray & | cast (AttributeArray &attributeArray)
| Cast an AttributeArray to TypedAttributeArray<T> More...
static const TypedAttributeArray & | cast (const AttributeArray &attributeArray)
| Cast an AttributeArray to TypedAttributeArray<T> More...
static const NamePair & | attributeType ()
| Return the name of this attribute's type (includes codec) More...
static bool | isRegistered ()
| Return `true` if this attribute type is registered. More...
static void | registerType ()
| Register this attribute type along with a factory function. More...
static void | unregisterType ()
| Remove this attribute type from the registry. More...
static ValueType | getUnsafe (const AttributeArray *array, const Index n)
static void | setUnsafe (AttributeArray *array, const Index n, const ValueType &value)
static void | collapse (AttributeArray *array, const ValueType &value)
| Non-member equivalent to collapse() that static_casts array to this TypedAttributeArray. More...
static void | fill (AttributeArray *array, const ValueType &value)
| Non-member equivalent to fill() that static_casts array to this TypedAttributeArray. More...
static Ptr | create (const NamePair &type, Index length, Index stride=1, bool constantStride=true, const ScopedRegistryLock *lock=nullptr)
static bool | isRegistered (const NamePair &type, const ScopedRegistryLock *lock=nullptr)
| Return `true` if the given attribute type name is registered. More...
static void | clearRegistry (const ScopedRegistryLock *lock=nullptr)
| Clear the attribute type registry. More...

## Protected Types
using | AccessorBasePtr = std::shared_ptr< AccessorBase >

## Protected Member Functions
AccessorBasePtr | getAccessor () const override
| Obtain an Accessor that stores getter and setter functors. More...
StorageType * | data ()
| Return the raw data buffer. More...
const StorageType * | data () const
bool | validData () const
| Verify that data is not out-of-core or in a partially-read state. More...
void | setConstantStride (bool state)
| Specify whether this attribute has a constant stride or not. More...

## Static Protected Member Functions
static void | registerType (const NamePair &type, FactoryMethod, const ScopedRegistryLock *lock=nullptr)
| Register a attribute type along with a factory function. More...
static void | unregisterType (const NamePair &type, const ScopedRegistryLock *lock=nullptr)
| Remove a attribute type from the registry. More...

## Protected Attributes
bool | mIsUniform = true
tbb::spin_mutex | mMutex
uint8_t | mFlags = 0
uint8_t | mUsePagedRead = 0
tbb::atomic< Index32 > | mOutOfCore
union {
compression::PageHandle::Ptr mPageHandle
size_t mCompressedBytes
}; |
| used for out-of-core, paged reading More...

## Friends
class | ::TestAttributeArray

## Detailed Description

### template<typename ValueType_, typename Codec_ = NullCodec>
class openvdb::v7_0::points::TypedAttributeArray< ValueType_, Codec_ >

Typed class for storing attribute data.

## Member Typedef Documentation

## ◆ AccessorBasePtr

using AccessorBasePtr = std::shared_ptr<AccessorBase>
| protected inherited

## ◆ Codec

using Codec = Codec_

## ◆ ConstPtr

using ConstPtr = std::shared_ptr<const TypedAttributeArray>

## ◆ FactoryMethod

using FactoryMethod = Ptr (*)(Index, Index, bool)
| inherited

## ◆ Ptr

using Ptr = std::shared_ptr<TypedAttributeArray>

## ◆ StorageType

using StorageType = typename Codec::template Storage<ValueType>::Type

## ◆ ValueType

using ValueType = ValueType_

## Member Enumeration Documentation

## ◆ Flag

enum Flag
| inherited

Enumerator
TRANSIENT |
HIDDEN | by default not written to disk
OUTOFCORE | hidden from UIs or iterators
CONSTANTSTRIDE | data not yet loaded from disk (deprecated flag as of ABI=5)
STREAMING | stride size does not vary in the array
PARTIALREAD | streaming mode collapses attributes when first accessed

## ◆ SerializationFlag

enum SerializationFlag
| inherited

Enumerator
WRITESTRIDED |
WRITEUNIFORM | data is marked as strided when written
WRITEMEMCOMPRESS | data is marked as uniform when written
WRITEPAGED | data is marked as compressed in-memory when written (deprecated flag as of ABI=6)

## Constructor & Destructor Documentation

## ◆ TypedAttributeArray() [1/4]

TypedAttributeArray | ( | Index | n = `1`,
|  | Index | strideOrTotalSize = `1`,
|  | bool | constantStride = `true`,
|  | const ValueType & | uniformValue = `zeroVal<ValueType>()`
| ) |  |
| explicit

Default constructor, always constructs a uniform attribute.

## ◆ TypedAttributeArray() [2/4]

TypedAttributeArray | ( | const TypedAttributeArray< ValueType_, Codec_ > & | rhs | ) |

Deep copy constructor.

Note
  This method is thread-safe (as of ABI=7) for concurrently reading from the source attribute array while being deep-copied. Specifically, this means that the attribute array being deep-copied can be out-of-core and safely loaded in one thread while being copied using this copy-constructor in another thread. It is not thread-safe for write.

## ◆ TypedAttributeArray() [3/4]

OPENVDB_DEPRECATED TypedAttributeArray | ( | const TypedAttributeArray< ValueType_, Codec_ > & | ,
|  | bool |
| ) |  |

Deep copy constructor.

Deprecated:
  Use copy-constructor without unused bool parameter

## ◆ TypedAttributeArray() [4/4]

TypedAttributeArray | ( | TypedAttributeArray< ValueType_, Codec_ > && |  | ) |
| delete

Move constructor disabled.

## ◆ ~TypedAttributeArray()

~TypedAttributeArray | ( |  | ) |
| inline override

## Member Function Documentation

## ◆ attributeType()

const NamePair & attributeType | ( |  | ) |
| inline static

Return the name of this attribute's type (includes codec)

## ◆ cast() [1/2]

TypedAttributeArray< ValueType_, Codec_ > & cast | ( | AttributeArray & | attributeArray | ) |
| inline static

Cast an AttributeArray to TypedAttributeArray<T>

## ◆ cast() [2/2]

const TypedAttributeArray< ValueType_, Codec_ > & cast | ( | const AttributeArray & | attributeArray | ) |
| inline static

Cast an AttributeArray to TypedAttributeArray<T>

## ◆ clearRegistry()

static void clearRegistry | ( | const ScopedRegistryLock * | lock = `nullptr` | ) |
| static inherited

Clear the attribute type registry.

## ◆ codecType()

Name codecType | ( |  | ) | const
| inline override virtual

Return the name of the codec used by this array (e.g., "trnc" or "fxpt").

Implements AttributeArray.

## ◆ collapse() [1/3]

void collapse | ( |  | ) |
| override virtual

Replace the existing array with a uniform zero value.

Implements AttributeArray.

## ◆ collapse() [2/3]

void collapse | ( | AttributeArray * | array,
|  | const ValueType & | value
| ) |  |
| static

Non-member equivalent to collapse() that static_casts array to this TypedAttributeArray.

## ◆ collapse() [3/3]

void collapse | ( | const ValueType & | uniformValue | ) |

Replace the existing array with the given uniform value.

## ◆ compact()

bool compact | ( |  | ) |
| override virtual

Compact the existing array to become uniform if all values are identical.

Implements AttributeArray.

## ◆ compress()

bool compress | ( |  | ) |
| inline override virtual

Compress the attribute array.

Implements AttributeArray.

## ◆ copy()

AttributeArray::Ptr copy | ( |  | ) | const
| override virtual

Return a copy of this attribute.

Note
  This method is thread-safe.

Implements AttributeArray.

## ◆ copyUncompressed()

AttributeArray::Ptr copyUncompressed | ( |  | ) | const
| override virtual

Return an uncompressed copy of this attribute (will just return a copy if not compressed).

Note
  This method is thread-safe.

Implements AttributeArray.

## ◆ copyValues()

void copyValues | ( | const AttributeArray & | sourceArray,
|  | const IterT & | iter,
|  | bool | compact = `true`
| ) |  |
| inherited

Like copyValuesUnsafe(), but if compact is true, attempt to collapse this array.

Note
  This method is not thread-safe, it must be guaranteed that this array is not concurrently modified by another thread and that the source array is also not modified.

## ◆ copyValuesUnsafe()

void copyValuesUnsafe | ( | const AttributeArray & | sourceArray,
|  | const IterT & | iter
| ) |  |
| inherited

Copy values into this array from a source array to a target array as referenced by an iterator.

Iterators must adhere to the ForwardIterator interface described in the example below:

struct MyIterator
{
// returns true if the iterator is referencing valid copying indices
operator bool() const;
// increments the iterator
MyIterator& operator++();
// returns the source index that the iterator is referencing for copying
Index sourceIndex() const;
// returns the target index that the iterator is referencing for copying
Index targetIndex() const;
};

Note
  It is assumed that the strided storage sizes match, the arrays are both in-core, and both value types are floating-point or both integer.
  It is possible to use this method to write to a uniform target array if the iterator does not have non-zero target indices.
  This method is not thread-safe, it must be guaranteed that this array is not concurrently modified by another thread and that the source array is also not modified.

## ◆ create() [1/2]

static Ptr create | ( | const NamePair & | type,
|  | Index | length,
|  | Index | stride = `1`,
|  | bool | constantStride = `true`,
|  | const ScopedRegistryLock * | lock = `nullptr`
| ) |  |
| static inherited

Create a new attribute array of the given (registered) type, length and stride.

If lock is non-null, the AttributeArray registry mutex has already been locked

## ◆ create() [2/2]

TypedAttributeArray< ValueType_, Codec_ >::Ptr create | ( | Index | n,
|  | Index | strideOrTotalSize = `1`,
|  | bool | constantStride = `true`
| ) |  |
| inline static

Return a new attribute array of the given length n and stride with uniform value zero.

## ◆ data() [1/2]

StorageType* data | ( |  | ) |
| inline protected

Return the raw data buffer.

## ◆ data() [2/2]

const StorageType* data | ( |  | ) | const
| inline protected

## ◆ dataSize()

Index dataSize | ( |  | ) | const
| inline override virtual

Return the size of the data in this array.

Implements AttributeArray.

## ◆ decompress()

bool decompress | ( |  | ) |
| inline override virtual

Uncompress the attribute array.

Implements AttributeArray.

## ◆ expand()

void expand | ( | bool | fill = `true` | ) |
| override virtual

Replace the single value storage with an array of length size().

Note
  Non-uniform attributes are unchanged.

Parameters

  fill | toggle to initialize the array elements with the pre-expanded value.

Implements AttributeArray.

## ◆ fill() [1/2]

void fill | ( | AttributeArray * | array,
|  | const ValueType & | value
| ) |  |
| static

Non-member equivalent to fill() that static_casts array to this TypedAttributeArray.

## ◆ fill() [2/2]

void fill | ( | const ValueType & | value | ) |

Fill the existing array with the given value.

Note
  Identical to collapse() except a non-uniform array will not become uniform.

## ◆ flags()

uint8_t flags | ( |  | ) | const
| inline inherited

Retrieve the attribute array flags.

## ◆ get() [1/2]

TypedAttributeArray< ValueType_, Codec_ >::ValueType get | ( | Index | n | ) | const

Return the value at index n.

## ◆ get() [2/2]

void get | ( | Index | n,
|  | T & | value
| ) |  | const

Return the value at index n.

## ◆ getAccessor()

AttributeArray::AccessorBasePtr getAccessor | ( |  | ) | const
| override protected virtual

Obtain an Accessor that stores getter and setter functors.

Implements AttributeArray.

## ◆ getUnsafe() [1/3]

TypedAttributeArray< ValueType_, Codec_ >::ValueType getUnsafe | ( | const AttributeArray * | array,
|  | const Index | n
| ) |  |
| static

Non-member equivalent to getUnsafe() that static_casts array to this TypedAttributeArray (assumes uncompressed and in-core)

## ◆ getUnsafe() [2/3]

TypedAttributeArray< ValueType_, Codec_ >::ValueType getUnsafe | ( | Index | n | ) | const

Return the value at index n (assumes uncompressed and in-core)

## ◆ getUnsafe() [3/3]

void getUnsafe | ( | Index | n,
|  | T & | value
| ) |  | const

Return the value at index n (assumes uncompressed and in-core)

## ◆ hasConstantStride()

bool hasConstantStride | ( |  | ) | const
| inline inherited

Return `true` if this attribute has a constant stride.

## ◆ hasValueType()

bool hasValueType | ( |  | ) | const
| inline inherited

Return `true` if this attribute has a value type the same as the template parameter.

## ◆ isCompressed()

OPENVDB_DEPRECATED bool isCompressed | ( |  | ) | const
| inline inherited

Deprecated:
  Previously this returned `true` if the array was compressed, now it always returns `false`.

## ◆ isDataLoaded()

bool isDataLoaded | ( |  | ) | const
| override virtual

Return `true` if all data has been loaded.

Implements AttributeArray.

## ◆ isHidden()

bool isHidden | ( |  | ) | const
| inline inherited

Return `true` if this attribute is hidden (e.g., from UI or iterators).

## ◆ isOutOfCore()

bool isOutOfCore | ( |  | ) | const
| inline

Return `true` if this buffer's values have not yet been read from disk.

## ◆ isRegistered() [1/2]

bool isRegistered | ( |  | ) |
| inline static

Return `true` if this attribute type is registered.

## ◆ isRegistered() [2/2]

static bool isRegistered | ( | const NamePair & | type,
|  | const ScopedRegistryLock * | lock = `nullptr`
| ) |  |
| static inherited

Return `true` if the given attribute type name is registered.

## ◆ isStreaming()

bool isStreaming | ( |  | ) | const
| inline inherited

Return `true` if this attribute is in streaming mode.

## ◆ isTransient()

bool isTransient | ( |  | ) | const
| inline inherited

Return `true` if this attribute is not serialized during stream output.

## ◆ isType()

bool isType | ( |  | ) | const
| inline inherited

Return `true` if this attribute is of the same type as the template parameter.

## ◆ isUniform()

bool isUniform | ( |  | ) | const
| inline override virtual

Return `true` if this array is stored as a single uniform value.

Implements AttributeArray.

## ◆ loadData()

void loadData | ( |  | ) | const
| override virtual

Ensures all data is in-core.

Implements AttributeArray.

## ◆ memUsage()

size_t memUsage | ( |  | ) | const
| override virtual

Return the number of bytes of memory used by this attribute.

Implements AttributeArray.

## ◆ operator!=()

bool operator!= | ( | const AttributeArray & | other | ) | const
| inline inherited

## ◆ operator=() [1/2]

TypedAttributeArray< ValueType_, Codec_ > & operator= | ( | const TypedAttributeArray< ValueType_, Codec_ > & | rhs | ) |

Deep copy assignment operator.

Note
  this operator is thread-safe.

## ◆ operator=() [2/2]

TypedAttributeArray& operator= | ( | TypedAttributeArray< ValueType_, Codec_ > && |  | ) |
| delete

Move assignment operator disabled.

## ◆ operator==()

bool operator== | ( | const AttributeArray & | other | ) | const
| inherited

Check the compressed bytes and flags. If they are equal, perform a deeper comparison check necessary on the inherited types (TypedAttributeArray) Requires non operator implementation due to inheritance

## ◆ read()

void read | ( | std::istream & | is | ) |
| override virtual

Read attribute data from a stream.

Implements AttributeArray.

## ◆ readBuffers()

void readBuffers | ( | std::istream & | is | ) |
| override virtual

Read attribute buffers from a stream.

Implements AttributeArray.

## ◆ readMetadata()

void readMetadata | ( | std::istream & | is | ) |
| override virtual

Read attribute metadata from a stream.

Implements AttributeArray.

## ◆ readPagedBuffers()

void readPagedBuffers | ( | compression::PagedInputStream & | is | ) |
| override virtual

Read attribute buffers from a paged stream.

Implements AttributeArray.

## ◆ registerType() [1/2]

void registerType | ( |  | ) |
| inline static

Register this attribute type along with a factory function.

## ◆ registerType() [2/2]

static void registerType | ( | const NamePair & | type,
|  | FactoryMethod | ,
|  | const ScopedRegistryLock * | lock = `nullptr`
| ) |  |
| static protected inherited

Register a attribute type along with a factory function.

## ◆ set() [1/3]

void set | ( | const Index | n,
|  | const AttributeArray & | sourceArray,
|  | const Index | sourceIndex
| ) |  |
| override virtual

Set value at given index n from sourceIndex of another sourceArray.

Implements AttributeArray.

## ◆ set() [2/3]

void set | ( | Index | n,
|  | const T & | value
| ) |  |

Set value at the given index n.

## ◆ set() [3/3]

void set | ( | Index | n,
|  | const ValueType & | value
| ) |  |

Set value at the given index n.

## ◆ setConstantStride()

void setConstantStride | ( | bool | state | ) |
| protected inherited

Specify whether this attribute has a constant stride or not.

## ◆ setHidden()

void setHidden | ( | bool | state | ) |
| inherited

Specify whether this attribute should be hidden (e.g., from UI or iterators).

This is useful if the attribute is used for blind data or as scratch space for a calculation.

Note
  Attributes are not hidden by default.

## ◆ setStreaming()

void setStreaming | ( | bool | state | ) |
| inherited

Specify whether this attribute is to be streamed off disk, in which case, the attributes are collapsed after being first loaded leaving them in a destroyed state.

Note
  This operation is not thread-safe.

## ◆ setTransient()

void setTransient | ( | bool | state | ) |
| inherited

Specify whether this attribute should only exist in memory and not be serialized during stream output.

Note
  Attributes are not transient by default.

## ◆ setUnsafe() [1/3]

void setUnsafe | ( | AttributeArray * | array,
|  | const Index | n,
|  | const ValueType & | value
| ) |  |
| static

Non-member equivalent to setUnsafe() that static_casts array to this TypedAttributeArray (assumes uncompressed and in-core)

## ◆ setUnsafe() [2/3]

void setUnsafe | ( | Index | n,
|  | const T & | value
| ) |  |

Set value at the given index n (assumes uncompressed and in-core)

## ◆ setUnsafe() [3/3]

void setUnsafe | ( | Index | n,
|  | const ValueType & | value
| ) |  |

Set value at the given index n (assumes uncompressed and in-core)

## ◆ size()

Index size | ( |  | ) | const
| inline override virtual

Return the number of elements in this array.

Implements AttributeArray.

## ◆ storageTypeSize()

Index storageTypeSize | ( |  | ) | const
| inline override virtual

Return the size in bytes of the storage type of a single element of this array.

Note
  If the Codec is a NullCodec, valueSize() == storageSize()

Implements AttributeArray.

## ◆ stride()

Index stride | ( |  | ) | const
| inline override virtual

Return the stride of this array.

Note
  A return value of zero means a variable stride

Implements AttributeArray.

## ◆ type()

const NamePair& type | ( |  | ) | const
| inline override virtual

Return the name of this attribute's type.

Implements AttributeArray.

## ◆ unregisterType() [1/2]

void unregisterType | ( |  | ) |
| inline static

Remove this attribute type from the registry.

## ◆ unregisterType() [2/2]

static void unregisterType | ( | const NamePair & | type,
|  | const ScopedRegistryLock * | lock = `nullptr`
| ) |  |
| static protected inherited

Remove a attribute type from the registry.

## ◆ validData()

bool validData | ( |  | ) | const
| inline protected

Verify that data is not out-of-core or in a partially-read state.

## ◆ valueType()

Name valueType | ( |  | ) | const
| inline override virtual

Return the name of the value type of a single element in this array (e.g., "float" or "vec3d").

Implements AttributeArray.

## ◆ valueTypeIsClass()

bool valueTypeIsClass | ( |  | ) | const
| override virtual

Return `true` if the value type is a class (ie vector, matrix or quaternion return true)

Implements AttributeArray.

## ◆ valueTypeIsFloatingPoint()

bool valueTypeIsFloatingPoint | ( |  | ) | const
| override virtual

Return `true` if the value type is floating point.

Implements AttributeArray.

## ◆ valueTypeIsMatrix()

bool valueTypeIsMatrix | ( |  | ) | const
| override virtual

Return `true` if the value type is a matrix.

Implements AttributeArray.

## ◆ valueTypeIsQuaternion()

bool valueTypeIsQuaternion | ( |  | ) | const
| override virtual

Return `true` if the value type is a quaternion.

Implements AttributeArray.

## ◆ valueTypeIsVector()

bool valueTypeIsVector | ( |  | ) | const
| override virtual

Return `true` if the value type is a vector.

Implements AttributeArray.

## ◆ valueTypeSize()

Index valueTypeSize | ( |  | ) | const
| inline override virtual

Return the size in bytes of the value type of a single element in this array.

Implements AttributeArray.

## ◆ write() [1/2]

void write | ( | std::ostream & | os | ) | const
| override virtual

Write attribute data to a stream, don't write transient attributes.

Implements AttributeArray.

## ◆ write() [2/2]

void write | ( | std::ostream & | os,
|  | bool | outputTransient
| ) |  | const
| override virtual

Write attribute data to a stream.

Parameters

  os | the output stream
  outputTransient | if true, write out transient attributes

Implements AttributeArray.

## ◆ writeBuffers()

void writeBuffers | ( | std::ostream & | os,
|  | bool | outputTransient
| ) |  | const
| override virtual

Write attribute buffers to a stream.

Parameters

  os | the output stream
  outputTransient | if true, write out transient attributes

Implements AttributeArray.

## ◆ writeMetadata()

void writeMetadata | ( | std::ostream & | os,
|  | bool | outputTransient,
|  | bool | paged
| ) |  | const
| override virtual

Write attribute metadata to a stream.

Parameters

  os | the output stream
  outputTransient | if true, write out transient attributes
  paged | if true, data is written out in pages

Implements AttributeArray.

## ◆ writePagedBuffers()

void writePagedBuffers | ( | compression::PagedOutputStream & | os,
|  | bool | outputTransient
| ) |  | const
| override virtual

Write attribute buffers to a paged stream.

Parameters

  os | the output stream
  outputTransient | if true, write out transient attributes

Implements AttributeArray.

## Friends And Related Function Documentation

## ◆ ::TestAttributeArray

friend class ::TestAttributeArray
| friend

## Member Data Documentation

## ◆ @292

union { ... }

used for out-of-core, paged reading

## ◆ mCompressedBytes

size_t mCompressedBytes
| inherited

## ◆ mFlags

uint8_t mFlags = 0
| protected inherited

## ◆ mIsUniform

bool mIsUniform = true
| protected inherited

## ◆ mMutex

tbb::spin_mutex mMutex
| mutable protected inherited

## ◆ mOutOfCore

tbb::atomic<Index32> mOutOfCore
| protected inherited

## ◆ mPageHandle

compression::PageHandle::Ptr mPageHandle
| inherited

## ◆ mUsePagedRead

uint8_t mUsePagedRead = 0
| protected inherited

The documentation for this class was generated from the following file:

- AttributeArray.h

openvdb::v7_0::Index
Index32 Index
Definition: Types.h:31