HDK
|
#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_Attribute * | getAttribute () |
Raw access to the writable attribute. More... | |
const GA_Attribute * | getAttribute () 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_Range & | getRange () 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 |
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.
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.
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.
|
inline |
Raw access to the writable attribute.
Definition at line 121 of file GA_AttributeOperand.h.
|
inline |
Raw access to the read-only attribute.
Definition at line 129 of file GA_AttributeOperand.h.
Import/Store a value from the given tuple index. The function will return false if the operation fails.
|
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.
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.
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.
|
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.
|
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.
Import/Store a value from the given tuple index. The function will return false if the operation fails.
|
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.
|
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.
|
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.
|
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.
Import/Store a value from the given tuple index. The function will return false if the operation fails.
|
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.
Store a tuple of values. The tuple size passed in will be clamped to the tuple size of the underlying attribute.
Store a tuple of values. The tuple size passed in will be clamped to the tuple size of the underlying attribute.
|
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.
|
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.