OpenVDB: AttributeWriteHandle< ValueType, CodecType > Class Template Reference

OpenVDB 10.0.1

Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
AttributeWriteHandle< ValueType, CodecType > Class Template Reference

Write-able version of AttributeHandle. More...

`#include <openvdb/points/AttributeArray.h>`

Inherits AttributeHandle< ValueType, UnknownCodec >.

## Public Types
using | Handle = AttributeWriteHandle< ValueType, CodecType >
using | Ptr = std::shared_ptr< Handle >
using | ScopedPtr = std::unique_ptr< Handle >
using | UniquePtr = std::unique_ptr< Handle >

## Public Member Functions
| AttributeWriteHandle (AttributeArray &array, const bool expand=true)
virtual | ~AttributeWriteHandle ()=default
void | expand (bool fill=true)
| If this array is uniform, replace it with an array of length size(). More...
void | collapse ()
| Replace the existing array with a uniform value (zero if none provided). More...
void | collapse (const ValueType &uniformValue)
bool | compact ()
| Compact the existing array to become uniform if all values are identical. More...
void | fill (const ValueType &value)
| Fill the existing array with the given value. More...
void | set (Index n, const ValueType &value)
void | set (Index n, Index m, const ValueType &value)
AttributeArray & | array ()
Index | stride () const
Index | size () const
bool | isUniform () const
bool | hasConstantStride () const
ValueType | get (Index n, Index m=0) const
const AttributeArray & | array () const

## Static Public Member Functions
static Ptr | create (AttributeArray &array, const bool expand=true)
static Ptr | create (const AttributeArray &array, const bool collapseOnDestruction=true)

## Protected Types
using | GetterPtr = ValueType(*)(const AttributeArray *array, const Index n)
using | SetterPtr = void(*)(AttributeArray *array, const Index n, const ValueType &value)
using | ValuePtr = void(*)(AttributeArray *array, const ValueType &value)

## Protected Member Functions
Index | index (Index n, Index m) const

## Protected Attributes
const AttributeArray * | mArray
GetterPtr | mGetter
SetterPtr | mSetter
ValuePtr | mCollapser
ValuePtr | mFiller

## Friends
class | ::TestAttributeArray

## Detailed Description

template<typename ValueType, typename CodecType = UnknownCodec>
class openvdb::v10_0::points::AttributeWriteHandle< ValueType, CodecType >

Write-able version of AttributeHandle.

## Member Typedef Documentation

## ◆ GetterPtr

using GetterPtr = ValueType (*)(const AttributeArray* array, const Index n)
| protectedinherited

## ◆ Handle

using Handle = AttributeWriteHandle<ValueType, CodecType>

## ◆ Ptr

using Ptr = std::shared_ptr<Handle>

## ◆ ScopedPtr

using ScopedPtr = std::unique_ptr<Handle>

## ◆ SetterPtr

using SetterPtr = void (*)(AttributeArray* array, const Index n, const ValueType& value)
| protectedinherited

## ◆ UniquePtr

using UniquePtr = std::unique_ptr<Handle>
| inherited

## ◆ ValuePtr

using ValuePtr = void (*)(AttributeArray* array, const ValueType& value)
| protectedinherited

## Constructor & Destructor Documentation

## ◆ AttributeWriteHandle()

AttributeWriteHandle | ( | AttributeArray & | array,
|  | const bool | expand = `true`
| ) |  |

## ◆ ~AttributeWriteHandle()

virtual ~AttributeWriteHandle | ( |  | ) |
| virtualdefault

## Member Function Documentation

## ◆ array() [1/2]

AttributeArray & array

## ◆ array() [2/2]

const AttributeArray & array
| inherited

## ◆ collapse() [1/2]

void collapse

Replace the existing array with a uniform value (zero if none provided).

## ◆ collapse() [2/2]

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

## ◆ compact()

bool compact

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

## ◆ create() [1/2]

AttributeWriteHandle< ValueType, CodecType >::Ptr create | ( | AttributeArray & | array,
|  | const bool | expand = `true`
| ) |  |
| static

## ◆ create() [2/2]

AttributeHandle< ValueType, UnknownCodec >::Ptr create | ( | const AttributeArray & | array,
|  | const bool | collapseOnDestruction = `true`
| ) |  |
| staticinherited

## ◆ expand()

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

If this array is uniform, replace it with an array of length size().

Parameters

  fill | if true, assign the uniform value to each element of the array.

## ◆ fill()

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.

## ◆ get()

ValueType get | ( | Index | n,
|  | Index | m = `0`
| ) |  | const
| inherited

## ◆ hasConstantStride()

bool hasConstantStride
| inherited

## ◆ index()

Index index | ( | Index | n,
|  | Index | m
| ) |  | const
| protectedinherited

## ◆ isUniform()

bool isUniform
| inherited

## ◆ set() [1/2]

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

## ◆ set() [2/2]

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

## ◆ size()

Index size | ( |  | ) | const
| inlineinherited

## ◆ stride()

Index stride | ( |  | ) | const
| inlineinherited

## Friends And Related Function Documentation

## ◆ ::TestAttributeArray

friend class ::TestAttributeArray
| friend

## Member Data Documentation

## ◆ mArray

const AttributeArray* mArray
| protectedinherited

## ◆ mCollapser

ValuePtr mCollapser
| protectedinherited

## ◆ mFiller

ValuePtr mFiller
| protectedinherited

## ◆ mGetter

GetterPtr mGetter
| protectedinherited

## ◆ mSetter

SetterPtr mSetter
| protectedinherited