HDK
|
A handle to simplify manipulation of multiple attributes. More...
#include <GA_AttributeRefMap.h>
Classes | |
class | FilterPattern |
Public Types | |
typedef GA_AttributeRefMapOffsetMap | OffsetMap |
A handle to simplify manipulation of multiple attributes.
The GA_AttributeRefMap class maintains a list of attributes. Operations can be done on all attributes at one time. The handle keeps a mapping between destination and (const) attributes. All destination attributes need to be in one GA_Detail. All source attributes must be from one GA_Detail. Often, the source and destination details are the same.
When performing operations on object elements, all attribute classes which are uniquely identified by the owner of the object will be operated on. For example, when operating on a vertex, it is possible to uniquely identify a point object. Thus, when addValue()
is called with a vertex source offset, vertex and point attributes on the source detail will be processed. When addValue()
is called with a point source offset, there may be multiple vertices which share the point. So, only point attributes will be processed.
This can be summarized by:
addValue()
with source point offset: addValue()
with source vertex offset: addValue()
with source primitive offset: addValue()
with source detail offset: The same semantics are used for the destination offset. For example, if a primitive offset is supplied, destination primitive and global attributes will be modified.
By default, operations on "P" are performed as with any other attribute. However, it's possible to turn on the homogeneous flag which will ensure that operations are done using homogeneous coordinates.
Definition at line 79 of file GA_AttributeRefMap.h.
Definition at line 95 of file GA_AttributeRefMap.h.
GA_AttributeRefMap::GA_AttributeRefMap | ( | ) |
Default constructor.
GA_AttributeRefMap::GA_AttributeRefMap | ( | const GA_AttributeRefMap & | src | ) |
Copy constructor.
Construct and bind details.
GA_AttributeRefMap::GA_AttributeRefMap | ( | const GA_Detail & | src | ) |
Construct a handle from a const detail. This will create a temporary detail. All temporary vertices will be allocated from the temporary detail (rather than the source).
GA_AttributeRefMap::~GA_AttributeRefMap | ( | ) |
Destructor.
void GA_AttributeRefMap::addDestValue | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | offset | ||
) | const |
Standard operations read the source and write to the destination. However. These operations operate by reading and writing the destination.
void GA_AttributeRefMap::addDestValue | ( | OffsetMap & | dest, |
GA_AttributeOwner | owner, | ||
GA_Offset | offset | ||
) | const |
Standard operations read the source and write to the destination. However. These operations operate by reading and writing the destination.
void GA_AttributeRefMap::addHSumDestValue | ( | GA_WeightedSum & | sum, |
GA_AttributeOwner | downer, | ||
GA_Offset | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | offset, | ||
fpreal | w | ||
) | const |
Standard operations read the source and write to the destination. However. These operations operate by reading and writing the destination.
void GA_AttributeRefMap::addHSumDestValue | ( | GA_WeightedSum & | sum, |
OffsetMap & | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | offset, | ||
fpreal | w | ||
) | const |
Standard operations read the source and write to the destination. However. These operations operate by reading and writing the destination.
void GA_AttributeRefMap::addHSumValue | ( | GA_WeightedSum & | sum, |
GA_AttributeOwner | downer, | ||
GA_Offset | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | source_index, | ||
fpreal | w | ||
) | const |
void GA_AttributeRefMap::addHSumValue | ( | GA_WeightedSum & | sum, |
OffsetMap & | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | source_index, | ||
fpreal | w | ||
) | const |
void GA_AttributeRefMap::addSumDestValue | ( | GA_WeightedSum & | sum, |
GA_AttributeOwner | downer, | ||
GA_Offset | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | offset, | ||
fpreal | w | ||
) | const |
Standard operations read the source and write to the destination. However. These operations operate by reading and writing the destination.
void GA_AttributeRefMap::addSumDestValue | ( | GA_WeightedSum & | sum, |
OffsetMap & | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | offset, | ||
fpreal | w | ||
) | const |
Standard operations read the source and write to the destination. However. These operations operate by reading and writing the destination.
void GA_AttributeRefMap::addSumValue | ( | GA_WeightedSum & | sum, |
GA_AttributeOwner | downer, | ||
GA_Offset | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | source_index, | ||
fpreal | w | ||
) | const |
Add a value into the weighted sum. This advances the weighted sum with the weight given.
void GA_AttributeRefMap::addSumValue | ( | GA_WeightedSum & | sum, |
OffsetMap & | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | source_index, | ||
fpreal | w | ||
) | const |
void GA_AttributeRefMap::addValue | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | source_index, | ||
fpreal | scale = 1 |
||
) | const |
void GA_AttributeRefMap::addValue | ( | OffsetMap & | dest, |
GA_AttributeOwner | owner, | ||
GA_Offset | source_index, | ||
fpreal | scale = 1 |
||
) | const |
void GA_AttributeRefMap::appendAndCreateAllSource | ( | GA_AttributeOwner | destowner, |
GA_AttributeOwner | sourceowner, | ||
const char * | matchpattern, | ||
UT_ArraySet< const GA_Attribute * > * | alreadymappeddest = nullptr , |
||
bool | includegroups = true |
||
) |
Appends all sourceowner source attributes matching matchpattern to this attribute map. If the attribute doesn't exist on the destination, it will be created based on the source attribute. If alreadymappeddest is non-null and the destination attribute is in alreadymappeddest, it won't be appended, and all appended attributes will be added to alreadymappeddest, to help avoid collisions.
void GA_AttributeRefMap::barycentricValue | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | p0, | ||
GA_Offset | p1, | ||
GA_Offset | p2, | ||
fpreal | u, | ||
fpreal | v | ||
) | const |
void GA_AttributeRefMap::barycentricValue | ( | OffsetMap & | dest, |
GA_AttributeOwner | owner, | ||
GA_Offset | p0, | ||
GA_Offset | p1, | ||
GA_Offset | p2, | ||
fpreal | u, | ||
fpreal | v | ||
) | const |
void GA_AttributeRefMap::barycentricValue | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | p0, | ||
GA_Offset | p1, | ||
GA_Offset | p2, | ||
GA_Offset | p3, | ||
fpreal | u, | ||
fpreal | v, | ||
fpreal | w | ||
) | const |
void GA_AttributeRefMap::barycentricValue | ( | OffsetMap & | dest, |
GA_AttributeOwner | owner, | ||
GA_Offset | p0, | ||
GA_Offset | p1, | ||
GA_Offset | p2, | ||
GA_Offset | p3, | ||
fpreal | u, | ||
fpreal | v, | ||
fpreal | w | ||
) | const |
void GA_AttributeRefMap::bilinearValue | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | u0v0, | ||
GA_Offset | u1v0, | ||
GA_Offset | u0v1, | ||
GA_Offset | u1v1, | ||
fpreal | u, | ||
fpreal | v | ||
) | const |
Compute bilinear interpolation over 4 values of a quadrilateral. The math is the same as SYSbilerp():
void GA_AttributeRefMap::bilinearValue | ( | OffsetMap & | dest, |
GA_AttributeOwner | owner, | ||
GA_Offset | u0v0, | ||
GA_Offset | u1v0, | ||
GA_Offset | u0v1, | ||
GA_Offset | u1v1, | ||
fpreal | u, | ||
fpreal | v | ||
) | const |
void GA_AttributeRefMap::copyDestValue | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | offset | ||
) | const |
Standard operations read the source and write to the destination. However. These operations operate by reading and writing the destination.
void GA_AttributeRefMap::copyDestValue | ( | OffsetMap & | dest, |
GA_AttributeOwner | owner, | ||
GA_Offset | offset | ||
) | const |
Standard operations read the source and write to the destination. However. These operations operate by reading and writing the destination.
void GA_AttributeRefMap::copyExplicitPosition | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
const UT_Vector2 & | p | ||
) | const |
Copy operations:
Sets any attributes that read the position attribute to an explicit value.
void GA_AttributeRefMap::copyExplicitPosition | ( | OffsetMap & | dest, |
const UT_Vector2 & | p | ||
) | const |
Copy operations:
Sets any attributes that read the position attribute to an explicit value.
void GA_AttributeRefMap::copyExplicitPosition | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
const UT_Vector2D & | p | ||
) | const |
Copy operations:
Sets any attributes that read the position attribute to an explicit value.
void GA_AttributeRefMap::copyExplicitPosition | ( | OffsetMap & | dest, |
const UT_Vector2D & | p | ||
) | const |
Copy operations:
Sets any attributes that read the position attribute to an explicit value.
void GA_AttributeRefMap::copyExplicitPosition | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
const UT_Vector3 & | p | ||
) | const |
Copy operations:
Sets any attributes that read the position attribute to an explicit value.
void GA_AttributeRefMap::copyExplicitPosition | ( | OffsetMap & | dest, |
const UT_Vector3 & | p | ||
) | const |
Copy operations:
Sets any attributes that read the position attribute to an explicit value.
void GA_AttributeRefMap::copyExplicitPosition | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
const UT_Vector3D & | p | ||
) | const |
Copy operations:
Sets any attributes that read the position attribute to an explicit value.
void GA_AttributeRefMap::copyExplicitPosition | ( | OffsetMap & | dest, |
const UT_Vector3D & | p | ||
) | const |
Copy operations:
Sets any attributes that read the position attribute to an explicit value.
void GA_AttributeRefMap::copyExplicitPosition | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
const UT_Vector4 & | p | ||
) | const |
Copy operations:
Sets any attributes that read the position attribute to an explicit value.
void GA_AttributeRefMap::copyExplicitPosition | ( | OffsetMap & | dest, |
const UT_Vector4 & | p | ||
) | const |
Copy operations:
Sets any attributes that read the position attribute to an explicit value.
void GA_AttributeRefMap::copyExplicitPosition | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
const UT_Vector4D & | p | ||
) | const |
Copy operations:
Sets any attributes that read the position attribute to an explicit value.
void GA_AttributeRefMap::copyExplicitPosition | ( | OffsetMap & | dest, |
const UT_Vector4D & | p | ||
) | const |
Copy operations:
Sets any attributes that read the position attribute to an explicit value.
void GA_AttributeRefMap::copyValue | ( | GA_AttributeOwner | downer, |
GA_Offset | doffset, | ||
GA_AttributeOwner | sowner, | ||
GA_Offset | soffset, | ||
Cache * | cache = 0 |
||
) | const |
Automatically expand attribute data pages for threading.
Normally, threading is allowed only if each thread is guaranteed to write to an individual page of data. Not all algorithms are amenable to this constraint. Using the ThreadHarden class will force the attribute map to harden all write attributes so their data pages can be written to by multiple threads across page boundaries. Multiple threads are still prohibited from writing to the same offset. In its destructor, the class will automatically call the compress method to regain memory efficiency. For example:
This is the generic copy operation
void GA_AttributeRefMap::copyValue | ( | OffsetMap & | dest, |
GA_AttributeOwner | sowner, | ||
GA_Offset | soffset, | ||
Cache * | cache = 0 |
||
) | const |
void GA_AttributeRefMap::dump | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
const char * | msg, | ||
... | |||
) | const |
Debug statement to dump all the attributes to stdout.
void GA_AttributeRefMap::finishHSum | ( | const GA_WeightedSum & | sum, |
GA_AttributeOwner | downer, | ||
GA_Offset | dest, | ||
fpreal | normalization = 1 |
||
) | const |
Weighted sum operation:
void GA_AttributeRefMap::finishHSum | ( | const GA_WeightedSum & | sum, |
OffsetMap & | dest, | ||
fpreal | normalization = 1 |
||
) | const |
Weighted sum operation:
void GA_AttributeRefMap::finishSum | ( | const GA_WeightedSum & | sum, |
GA_AttributeOwner | downer, | ||
GA_Offset | dest, | ||
fpreal | normalization = 1 |
||
) | const |
Weighted sum operation:
void GA_AttributeRefMap::finishSum | ( | const GA_WeightedSum & | sum, |
OffsetMap & | dest, | ||
fpreal | normalization = 1 |
||
) | const |
Weighted sum operation:
|
inline |
Definition at line 771 of file GA_AttributeRefMap.h.
|
inline |
Definition at line 772 of file GA_AttributeRefMap.h.
bool GA_AttributeRefMap::isAlmostEqual | ( | GA_AttributeOwner | aowner, |
GA_Offset | aoffset, | ||
GA_AttributeOwner | bowner, | ||
GA_Offset | boffset | ||
) | const |
Compare value with another elements
bool GA_AttributeRefMap::isAlmostEqual | ( | OffsetMap & | a, |
GA_AttributeOwner | bowner, | ||
GA_Offset | boffset | ||
) | const |
Compare value with another elements
bool GA_AttributeRefMap::isEqual | ( | GA_AttributeOwner | aowner, |
GA_Offset | aoffset, | ||
GA_AttributeOwner | bowner, | ||
GA_Offset | boffset | ||
) | const |
Compare value with another elements
bool GA_AttributeRefMap::isEqual | ( | OffsetMap & | a, |
GA_AttributeOwner | bowner, | ||
GA_Offset | boffset | ||
) | const |
Compare value with another elements
void GA_AttributeRefMap::lerpDestValue | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | s0, | ||
GA_Offset | s1, | ||
fpreal | t | ||
) | const |
Standard operations read the source and write to the destination. However. These operations operate by reading and writing the destination.
void GA_AttributeRefMap::lerpDestValue | ( | OffsetMap & | dest, |
GA_AttributeOwner | owner, | ||
GA_Offset | s0, | ||
GA_Offset | s1, | ||
fpreal | t | ||
) | const |
Standard operations read the source and write to the destination. However. These operations operate by reading and writing the destination.
void GA_AttributeRefMap::lerpHValue | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | s0, | ||
GA_Offset | s1, | ||
fpreal | t | ||
) | const |
void GA_AttributeRefMap::lerpHValue | ( | OffsetMap & | dest, |
GA_AttributeOwner | owner, | ||
GA_Offset | s0, | ||
GA_Offset | s1, | ||
fpreal | t | ||
) | const |
void GA_AttributeRefMap::lerpValue | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | s0, | ||
GA_Offset | s1, | ||
fpreal | t | ||
) | const |
Linear interpolation operation:
Generic linear interpolation between two of the same elements
void GA_AttributeRefMap::lerpValue | ( | OffsetMap & | dest, |
GA_AttributeOwner | owner, | ||
GA_Offset | s0, | ||
GA_Offset | s1, | ||
fpreal | t | ||
) | const |
void GA_AttributeRefMap::multiply | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
fpreal | scale | ||
) | const |
Multiply operation:
void GA_AttributeRefMap::mulValue | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | source_index | ||
) | const |
void GA_AttributeRefMap::mulValue | ( | OffsetMap & | dest, |
GA_AttributeOwner | owner, | ||
GA_Offset | source_index | ||
) | const |
|
inline |
Weighted sum operation:
Definition at line 616 of file GA_AttributeRefMap.h.
|
inline |
Weighted sum operation:
Definition at line 618 of file GA_AttributeRefMap.h.
void GA_AttributeRefMap::startSum | ( | const GA_WeightedSum & | sum, |
GA_AttributeOwner | downer, | ||
GA_Offset | dest | ||
) | const |
Weighted sum operation:
void GA_AttributeRefMap::startSum | ( | const GA_WeightedSum & | sum, |
OffsetMap & | dest | ||
) | const |
Weighted sum operation:
void GA_AttributeRefMap::subDestValue | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | offset | ||
) | const |
Standard operations read the source and write to the destination. However. These operations operate by reading and writing the destination.
void GA_AttributeRefMap::subDestValue | ( | OffsetMap & | dest, |
GA_AttributeOwner | owner, | ||
GA_Offset | offset | ||
) | const |
Standard operations read the source and write to the destination. However. These operations operate by reading and writing the destination.
void GA_AttributeRefMap::subValue | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
GA_AttributeOwner | owner, | ||
GA_Offset | source_index | ||
) | const |
void GA_AttributeRefMap::subValue | ( | OffsetMap & | dest, |
GA_AttributeOwner | owner, | ||
GA_Offset | source_index | ||
) | const |
void GA_AttributeRefMap::transform | ( | const UT_Matrix4 & | m, |
const UT_Matrix4 & | im, | ||
GA_AttributeOwner | downer, | ||
GA_Offset | dest | ||
) | const |
Transform attributes. This uses tags on the attribute to determine how to perform the transform.
m | The transform matrix |
im | The inverse of (i.e. m.invert(im) ) Transforms are independent of the source geometry. |
void GA_AttributeRefMap::transform | ( | const UT_Matrix4 & | m, |
const UT_Matrix4 & | im, | ||
OffsetMap & | dest | ||
) | const |
Transform attributes. This uses tags on the attribute to determine how to perform the transform.
m | The transform matrix |
im | The inverse of (i.e. m.invert(im) ) Transforms are independent of the source geometry. |
void GA_AttributeRefMap::transform | ( | const UT_DMatrix4 & | m, |
const UT_DMatrix4 & | im, | ||
GA_AttributeOwner | downer, | ||
GA_Offset | dest | ||
) | const |
Transform attributes. This uses tags on the attribute to determine how to perform the transform.
m | The transform matrix |
im | The inverse of (i.e. m.invert(im) ) Transforms are independent of the source geometry. |
void GA_AttributeRefMap::transform | ( | const UT_DMatrix4 & | m, |
const UT_DMatrix4 & | im, | ||
OffsetMap & | dest | ||
) | const |
Transform attributes. This uses tags on the attribute to determine how to perform the transform.
m | The transform matrix |
im | The inverse of (i.e. m.invert(im) ) Transforms are independent of the source geometry. |
void GA_AttributeRefMap::vdump | ( | GA_AttributeOwner | downer, |
GA_Offset | dest, | ||
const char * | msg, | ||
va_list | args | ||
) | const |
void GA_AttributeRefMap::zeroElement | ( | GA_AttributeOwner | downer, |
GA_Offset | dest | ||
) | const |
Zero an attribute. This is equivalent to a weighted sum of 0 elements.