HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GA_AttributeOperand Class Reference

#include <GA_AttributeOperand.h>

Public Member Functions

 GA_AttributeOperand (fpreal, const GA_Attribute &attrib)
 Constant value for all iterations/tuples. More...
 
 GA_AttributeOperand (const fpreal32 *value, int tuple_size, const GA_Attribute &attrib)
 Constant tuple of fpreal32 values for all iterations. More...
 
 GA_AttributeOperand (const fpreal64 *value, int tuple_size, const GA_Attribute &attrib)
 Constant tuple of fpreal64 values for all iterations. More...
 
 GA_AttributeOperand (GA_Attribute &attrib, GA_Offset offset)
 Writable attribute for a single iteration. More...
 
 GA_AttributeOperand (const GA_Attribute &attrib, GA_Offset offset)
 Read-only attribute, single value for all iterations. More...
 
 GA_AttributeOperand (GA_Attribute &attrib, const GA_Range &it)
 Writable attribute with a selection of offsets based on the iterator. More...
 
 GA_AttributeOperand (const GA_Attribute &attrib, const GA_Range &it)
 Read-only attribute with a selection of offsets based on the iterator. More...
 
 ~GA_AttributeOperand ()
 Destructor. More...
 
void rewind ()
 Rewind and start iterating. More...
 
bool atEnd () const
 
void advance ()
 
int getTupleSize () const
 
GA_AttributegetAttribute ()
 Raw access to the writable attribute. More...
 
const GA_AttributegetAttribute () const
 Raw access to the read-only attribute. More...
 
bool getIsIntegral () const
 Query whether the underlying attribute, if any, uses integer storage. More...
 
bool getIsWritable () const
 Test to determine whether the operand is writable. More...
 
bool getIsFinite () const
 
bool isIterator () const
 Test whether the operand is responsible for iterating. More...
 
const GA_RangegetRange () const
 
bool getI (GA_Offset off, int64 &v, int tuple_idx=0) const
 
bool getF (GA_Offset off, fpreal &v, int tple_idx=0) const
 
bool setF (GA_Offset off, fpreal v, int tuple_idx=0) const
 
bool getI (const GA_Iterator &it, int64 &v, int tuple_idx=0) const
 
bool getF (const GA_Iterator &it, fpreal &v, int tuple_idx=0) const
 
bool setF (const GA_Iterator &it, fpreal v, int tuple_idx=0) const
 
bool getF (GA_Offset off, fpreal32 *v, int tuple_size) const
 
bool getF (GA_Offset off, fpreal64 *v, int tuple_size) const
 
bool getF (const GA_Iterator &it, fpreal32 *v, int tuple_size) const
 
bool getF (const GA_Iterator &it, fpreal64 *v, int tuple_size) const
 
bool setF (GA_Offset off, const fpreal32 *v, int tuple_size) const
 
bool setF (GA_Offset off, const fpreal64 *v, int tuple_size) const
 
bool setF (const GA_Iterator &it, const fpreal32 *v, int size) const
 
bool setF (const GA_Iterator &it, const fpreal64 *v, int size) const
 

Detailed Description

The GA_AttributeOperand class provides a simple interface to look at data in operations performed on attributes. Accessing the data may be less efficient than direct access. But it allows you to have a trade-off between code complexity and efficiency.

Definition at line 35 of file GA_AttributeOperand.h.

Constructor & Destructor Documentation

GA_AttributeOperand::GA_AttributeOperand ( fpreal  ,
const GA_Attribute attrib 
)

Constant value for all iterations/tuples.

GA_AttributeOperand::GA_AttributeOperand ( const fpreal32 value,
int  tuple_size,
const GA_Attribute attrib 
)

Constant tuple of fpreal32 values for all iterations.

GA_AttributeOperand::GA_AttributeOperand ( const fpreal64 value,
int  tuple_size,
const GA_Attribute attrib 
)

Constant tuple of fpreal64 values for all iterations.

GA_AttributeOperand::GA_AttributeOperand ( GA_Attribute attrib,
GA_Offset  offset 
)

Writable attribute for a single iteration.

GA_AttributeOperand::GA_AttributeOperand ( const GA_Attribute attrib,
GA_Offset  offset 
)

Read-only attribute, single value for all iterations.

GA_AttributeOperand::GA_AttributeOperand ( GA_Attribute attrib,
const GA_Range it 
)

Writable attribute with a selection of offsets based on the iterator.

GA_AttributeOperand::GA_AttributeOperand ( const GA_Attribute attrib,
const GA_Range it 
)

Read-only attribute with a selection of offsets based on the iterator.

GA_AttributeOperand::~GA_AttributeOperand ( )

Destructor.

Member Function Documentation

void GA_AttributeOperand::advance ( )

Advance to the next iteration. This operation is a no-op for operands which don't have an iterator. The exception is the writable attribute with a single offset.

bool GA_AttributeOperand::atEnd ( ) const

Test whether the iterations are complete. This operation will return false for all operands except.

  • Operands with full iterators (dependent on iterator state)
  • Writeable attributes with a single offset. These attributes will return true after the first iteration.
    Note
    Read-only attributes that have a single offset will keep returning the same value and iterate for ever.
GA_Attribute* GA_AttributeOperand::getAttribute ( )
inline

Raw access to the writable attribute.

Definition at line 121 of file GA_AttributeOperand.h.

const GA_Attribute* GA_AttributeOperand::getAttribute ( ) const
inline

Raw access to the read-only attribute.

Definition at line 129 of file GA_AttributeOperand.h.

bool GA_AttributeOperand::getF ( GA_Offset  off,
fpreal v,
int  tple_idx = 0 
) const

Import/Store a value from the given tuple index. The function will return false if the operation fails.

bool GA_AttributeOperand::getF ( const GA_Iterator it,
fpreal v,
int  tuple_idx = 0 
) const
inline

Import/Store a value from the given tuple index. The function will return false if the operation fails.

Definition at line 91 of file GA_AttributeOperand.h.

bool GA_AttributeOperand::getF ( GA_Offset  off,
fpreal32 v,
int  tuple_size 
) const

Extract a full tuple. This will succeed fail if the tuple size of the attribute is smaller than the requested size. Otherwise, the tuple of the attribute may be truncated to the requested size.

bool GA_AttributeOperand::getF ( GA_Offset  off,
fpreal64 v,
int  tuple_size 
) const

Extract a full tuple. This will succeed fail if the tuple size of the attribute is smaller than the requested size. Otherwise, the tuple of the attribute may be truncated to the requested size.

bool GA_AttributeOperand::getF ( const GA_Iterator it,
fpreal32 v,
int  tuple_size 
) const
inline

Extract a full tuple. This will succeed fail if the tuple size of the attribute is smaller than the requested size. Otherwise, the tuple of the attribute may be truncated to the requested size.

Definition at line 103 of file GA_AttributeOperand.h.

bool GA_AttributeOperand::getF ( const GA_Iterator it,
fpreal64 v,
int  tuple_size 
) const
inline

Extract a full tuple. This will succeed fail if the tuple size of the attribute is smaller than the requested size. Otherwise, the tuple of the attribute may be truncated to the requested size.

Definition at line 105 of file GA_AttributeOperand.h.

bool GA_AttributeOperand::getI ( GA_Offset  off,
int64 v,
int  tuple_idx = 0 
) const

Import/Store a value from the given tuple index. The function will return false if the operation fails.

bool GA_AttributeOperand::getI ( const GA_Iterator it,
int64 v,
int  tuple_idx = 0 
) const
inline

Import/Store a value from the given tuple index. The function will return false if the operation fails.

Definition at line 89 of file GA_AttributeOperand.h.

bool GA_AttributeOperand::getIsFinite ( ) const

Test to determine whether the operand has a finite selection. That is, whether it has a finite iterator (i.e. a constant has an infinite number of iterations).

bool GA_AttributeOperand::getIsIntegral ( ) const

Query whether the underlying attribute, if any, uses integer storage.

bool GA_AttributeOperand::getIsWritable ( ) const

Test to determine whether the operand is writable.

const GA_Range& GA_AttributeOperand::getRange ( ) const
inline

Get raw access to the iterator. This is used to prevent multiple iterations of the same iterator.

Definition at line 152 of file GA_AttributeOperand.h.

int GA_AttributeOperand::getTupleSize ( ) const
inline

Query the tuple size. For constant scalar values, the tuplesize will be 2**31-1.

Definition at line 81 of file GA_AttributeOperand.h.

bool GA_AttributeOperand::isIterator ( ) const
inline

Test whether the operand is responsible for iterating.

Definition at line 148 of file GA_AttributeOperand.h.

void GA_AttributeOperand::rewind ( )

Rewind and start iterating.

bool GA_AttributeOperand::setF ( GA_Offset  off,
fpreal  v,
int  tuple_idx = 0 
) const

Import/Store a value from the given tuple index. The function will return false if the operation fails.

bool GA_AttributeOperand::setF ( const GA_Iterator it,
fpreal  v,
int  tuple_idx = 0 
) const
inline

Import/Store a value from the given tuple index. The function will return false if the operation fails.

Definition at line 93 of file GA_AttributeOperand.h.

bool GA_AttributeOperand::setF ( GA_Offset  off,
const fpreal32 v,
int  tuple_size 
) const

Store a tuple of values. The tuple size passed in will be clamped to the tuple size of the underlying attribute.

bool GA_AttributeOperand::setF ( GA_Offset  off,
const fpreal64 v,
int  tuple_size 
) const

Store a tuple of values. The tuple size passed in will be clamped to the tuple size of the underlying attribute.

bool GA_AttributeOperand::setF ( const GA_Iterator it,
const fpreal32 v,
int  size 
) const
inline

Store a tuple of values. The tuple size passed in will be clamped to the tuple size of the underlying attribute.

Definition at line 114 of file GA_AttributeOperand.h.

bool GA_AttributeOperand::setF ( const GA_Iterator it,
const fpreal64 v,
int  size 
) const
inline

Store a tuple of values. The tuple size passed in will be clamped to the tuple size of the underlying attribute.

Definition at line 116 of file GA_AttributeOperand.h.


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