OpenVDB 11.0.0

Loading...
Searching...
No Matches
StringAttributeWriteHandle Class Reference

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

Inheritance diagram for StringAttributeWriteHandle:

## Public Types
using | Ptr = std::shared_ptr<StringAttributeWriteHandle>
using | UniquePtr = std::unique_ptr<StringAttributeWriteHandle>

## Public Member Functions
| StringAttributeWriteHandle (AttributeArray &array, const MetaMap &metadata, const bool expand=true)
void | expand (bool fill=true)
| If this array is uniform, replace it with an array of length size().
void | collapse ()
| Set membership for the whole array and attempt to collapse.
void | collapse (const Name &name)
| Set membership for the whole array and attempt to collapse.
bool | compact ()
| Compact the existing array to become uniform if all values are identical.
void | fill (const Name &name)
| Fill the existing array with the given value.
void | set (Index n, const Name &name)
| Set the value of the index to name.
void | set (Index n, Index m, const Name &name)
void | resetCache ()
| Reset the value cache from the metadata.
AttributeArray & | array ()
| Returns a reference to the array held in the Write Handle.
bool | contains (const Name &name) const
| Returns whether or not the metadata cache contains a given value.
Index | stride () const
Index | size () const
bool | isUniform () const
bool | hasConstantStride () const
Name | get (Index n, Index m=0) const
void | get (Name &name, Index n, Index m=0) const
const AttributeArray & | array () const
| Returns a reference to the array held in the Handle.

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

## Protected Attributes
AttributeHandle< Index, StringCodec< false > > | mHandle
const MetaMap & | mMetadata

## Member Typedef Documentation

## ◆ Ptr

using Ptr = std::shared_ptr<StringAttributeWriteHandle>

## ◆ UniquePtr

using UniquePtr = std::unique_ptr<StringAttributeWriteHandle>

## Constructor & Destructor Documentation

## ◆ StringAttributeWriteHandle()

StringAttributeWriteHandle | ( | AttributeArray & | array,
|  | const MetaMap & | metadata,
|  | const bool | expand = true )

## Member Function Documentation

## ◆ array() [1/2]

const AttributeArray & array | ( |  | ) | const
| inherited

Returns a reference to the array held in the Handle.

## ◆ array() [2/2]

AttributeArray & array | ( |  | ) |

Returns a reference to the array held in the Write Handle.

## ◆ collapse() [1/2]

void collapse | ( |  | ) |

Set membership for the whole array and attempt to collapse.

## ◆ collapse() [2/2]

void collapse | ( | const Name & | name | ) |

Set membership for the whole array and attempt to collapse.

Parameters

  name | Name of the String

## ◆ compact()

bool compact | ( |  | ) |

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

## ◆ contains()

bool contains | ( | const Name & | name | ) | const

Returns whether or not the metadata cache contains a given value.

Parameters

  name | Name of the String.

## ◆ create() [1/2]

Ptr create | ( | const AttributeArray & | array,
|  | const MetaMap & | metadata,
|  | const bool | preserveCompression = true )
| static inherited

## ◆ create() [2/2]

Ptr create | ( | AttributeArray & | array,
|  | const MetaMap & | metadata,
|  | const bool | expand = true )
| static

## ◆ 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 Name & | name | ) |

Fill the existing array with the given value.

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

## ◆ get() [1/2]

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

## ◆ get() [2/2]

void get | ( | Name & | name,
|  | Index | n,
|  | Index | m = 0 ) const
| inherited

## ◆ hasConstantStride()

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

## ◆ isUniform()

bool isUniform | ( |  | ) | const
| inline inherited

## ◆ resetCache()

void resetCache | ( |  | ) |

Reset the value cache from the metadata.

## ◆ set() [1/2]

void set | ( | Index | n,
|  | const Name & | name )

Set the value of the index to name.

## ◆ set() [2/2]

void set | ( | Index | n,
|  | Index | m,
|  | const Name & | name )

## ◆ size()

Index size | ( |  | ) | const
| inline inherited

## ◆ stride()

Index stride | ( |  | ) | const
| inline inherited

## Member Data Documentation

## ◆ mHandle

AttributeHandle<Index, StringCodec<false> > mHandle
| protected inherited

## ◆ mMetadata

const MetaMap& mMetadata
| protected inherited