OpenVDB  8.1.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 <AttributeArray.h>

Inherits AttributeHandle< ValueType, CodecType >.

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)
AttributeArrayarray ()
Index stride () const
Index size () const
bool isUniform () const
bool hasConstantStride () const
ValueType get (Index n, Index m=0) const
const AttributeArrayarray () 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 AttributeArraymArray
GetterPtr mGetter
SetterPtr mSetter
ValuePtr mCollapser
ValuePtr mFiller


class ::TestAttributeArray

Detailed Description

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

Write-able version of AttributeHandle.

Member Typedef Documentation

using GetterPtr = ValueType (*)(const AttributeArray* array, const Index n)
using Handle = AttributeWriteHandle<ValueType, CodecType>
using Ptr = std::shared_ptr<Handle>
using ScopedPtr = std::unique_ptr<Handle>
using SetterPtr = void (*)(AttributeArray* array, const Index n, const ValueType& value)
using UniquePtr = std::unique_ptr<Handle>
using ValuePtr = void (*)(AttributeArray* array, const ValueType& value)

Constructor & Destructor Documentation

AttributeWriteHandle ( AttributeArray array,
const bool  expand = true 
virtual ~AttributeWriteHandle ( )

Member Function Documentation

const AttributeArray & array ( ) const
AttributeArray & array ( )
void collapse ( )

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

void collapse ( const ValueType &  uniformValue)
bool compact ( )

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

AttributeHandle< ValueType, CodecType >::Ptr create ( const AttributeArray array,
const bool  collapseOnDestruction = true 
AttributeWriteHandle< ValueType, CodecType >::Ptr create ( AttributeArray array,
const bool  expand = true 
void expand ( bool  fill = true)

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

fillif true, assign the uniform value to each element of the array.
void fill ( const ValueType &  value)

Fill the existing array with the given value.

Identical to collapse() except a non-uniform array will not become uniform.
ValueType get ( Index  n,
Index  m = 0 
) const
bool hasConstantStride ( ) const
Index index ( Index  n,
Index  m 
) const
bool isUniform ( ) const
void set ( Index  n,
const ValueType &  value 
void set ( Index  n,
Index  m,
const ValueType &  value 
Index size ( ) const
Index stride ( ) const

Friends And Related Function Documentation

friend class ::TestAttributeArray

Member Data Documentation

const AttributeArray* mArray
ValuePtr mCollapser
ValuePtr mFiller
GetterPtr mGetter
SetterPtr mSetter

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