OpenVDB: StringAttributeWriteHandle Class Reference

OpenVDB 7.0.0

Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
StringAttributeWriteHandle Class Reference

`#include <AttributeArrayString.h>`

Inherits StringAttributeHandle.

## Public Types
using | Ptr = std::shared_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(). More...
void | collapse ()
| Set membership for the whole array and attempt to collapse. More...
void | collapse (const Name &name)
| Set membership for the whole array and attempt to collapse. More...
bool | compact ()
| Compact the existing array to become uniform if all values are identical. More...
void | fill (const Name &name)
| Fill the existing array with the given value. More...
void | set (Index n, const Name &name)
| Set the value of the index to name. More...
void | set (Index n, Index m, const Name &name)
void | resetCache ()
| Reset the value cache from the metadata. More...
AttributeArray & | array ()
| Returns a reference to the array held in the Write Handle. More...
bool | contains (const Name &name) const
| Returns whether or not the metadata cache contains a given value. More...
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. More...

## 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< StringIndexType, StringCodec< false > > | mHandle
const MetaMap & | mMetadata

## Member Typedef Documentation

## ◆ Ptr

using Ptr = std::shared_ptr<StringAttributeWriteHandle>

## Constructor & Destructor Documentation

## ◆ StringAttributeWriteHandle()

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

## Member Function Documentation

## ◆ array() [1/2]

AttributeArray& array | ( |  | ) |

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

## ◆ array() [2/2]

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

Returns a reference to the array held in the 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]

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

## ◆ create() [2/2]

static Ptr create | ( | const AttributeArray & | array,
|  | const MetaMap & | metadata,
|  | const bool | preserveCompression = `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 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
| inlineinherited

## ◆ isUniform()

bool isUniform | ( |  | ) | const
| inlineinherited

## ◆ 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
| inlineinherited

## ◆ stride()

Index stride | ( |  | ) | const
| inlineinherited

## Member Data Documentation

## ◆ mHandle

AttributeHandle<StringIndexType, StringCodec<false> > mHandle
| protectedinherited

## ◆ mMetadata

const MetaMap& mMetadata
| protectedinherited

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

- AttributeArrayString.h