HDK
|
Specify when and how to reuse an existing attribute. More...
#include <GA_ReuseStrategy.h>
Specify when and how to reuse an existing attribute.
When attempting to create a new attribute, we may encounter an existing attribute with the same name. The GA_ReuseStrategy
settings specify when and how to reuse the existing attribute instead of creating the new one.
Definition at line 32 of file GA_ReuseStrategy.h.
The high level strategy for resolving a name collision with an existing attribute.
Definition at line 37 of file GA_ReuseStrategy.h.
This enum specifies whether or not we attempt to copy values from the existing attribute in the event that we fail to reuse it.
Enumerator | |
---|---|
DATACOPY_FALSE | |
DATACOPY_TRUE | |
DATACOPY_DEFAULT |
Definition at line 135 of file GA_ReuseStrategy.h.
This enum specifies how to deal with a failure when applying the CollisionStrategy.
Definition at line 55 of file GA_ReuseStrategy.h.
This enum specifies what to do with the attribute options passed to the creation method in the event that we're going to reuse an attribute.
Definition at line 118 of file GA_ReuseStrategy.h.
This enum specifies how we deal with name collisions across the point and vertex dictionaries.
Definition at line 145 of file GA_ReuseStrategy.h.
For attributes which have storage, this enum specifies what to do if there is a mismatch.
Definition at line 88 of file GA_ReuseStrategy.h.
For attributes which have a tuple size, this enum specifies what to do if there is a mis-match.
Definition at line 104 of file GA_ReuseStrategy.h.
Typically a type mismatch will result in the existing attribute being replaced when an attribute type is explicitly requested, but when the only criteria is that the existing attribute support some expected interface, we can be less restrictive.
Definition at line 74 of file GA_ReuseStrategy.h.
|
inline |
Definition at line 159 of file GA_ReuseStrategy.h.
|
inline |
Definition at line 170 of file GA_ReuseStrategy.h.
bool GA_ReuseStrategy::applyDataCopyStrategy | ( | GA_Attribute * | dest, |
const GA_Attribute * | src | ||
) | const |
Only call this method if getReplaceOnFailure() returns true. Returns true if the copy was successful, or was not needed. False otherwise.
void GA_ReuseStrategy::applyOptionsStrategy | ( | const GA_AttributeOptions * | requested_options, |
GA_AttributeOptions & | current_options | ||
) | const |
Apply getOptionsStrategy().
bool GA_ReuseStrategy::applyPointVertexCollisionDataCopyStrategy | ( | GA_Attribute * | dest, |
bool | replacement, | ||
const GA_Attribute * | src | ||
) | const |
Only call this method if getPointVertexCollisionDict() does not return GA_ATTRIB_GLOBAL. Returns true if the copy was successful, or was not needed. False otherwise.
bool GA_ReuseStrategy::applyStrategiesForArrays | ( | GA_Attribute & | attrib, |
GA_Storage | requested_storage, | ||
int | requested_tuple_size, | ||
const UT_Options * | requested_creation_options, | ||
const GA_AttributeOptions * | requested_attribute_options, | ||
const UT_StringRef & | requested_type | ||
) | const |
Attempt to bring the attribute to compliance as per the strategy. Our TypeStrategy determines whether we care about an exact type match
Returns true on success and false on failure. It is expected that the attribute will be replaced on failure as it may be partially modified by this method.
bool GA_ReuseStrategy::applyStrategiesForTuples | ( | GA_Attribute & | attrib, |
GA_Storage | requested_storage, | ||
int | requested_tuple_size, | ||
const GA_Defaults * | requested_defaults, | ||
const UT_Options * | requested_creation_options, | ||
const GA_AttributeOptions * | requested_attribute_options, | ||
const UT_StringRef & | requested_type | ||
) | const |
Attempt to bring the attribute to compliance as per the strategy. Our TypeStrategy determines whether we care about an exact type match or can work with a tuple AIF.
Returns true on success and false on failure. It is expected that the attribute will be replaced on failure as it may be partially modified by this method.
|
static |
Compare two defaults objects for equality.
GA_Storage GA_ReuseStrategy::computeNumericStorage | ( | GA_Storage | old_storage, |
GA_Storage | requested_storage | ||
) | const |
Applies getStorageStrategy() to return the new numeric storage for the attribute or GA_STORE_INVALID if no resolution is possible. Note that GA_STORE_BOOL is considered a numeric storage type for these purposes.
Helper methods for COLLISION_RECYCLE
Applies getTupleSizeStrategy() to return the new tuple size for the attribute, or -1 if no resolution is possible.
|
inline |
Definition at line 172 of file GA_ReuseStrategy.h.
|
inline |
Definition at line 177 of file GA_ReuseStrategy.h.
|
inline |
Definition at line 197 of file GA_ReuseStrategy.h.
|
inline |
Returns the dictionary that should be checked for a cross dictionary collision (GA_ATTRIB_VERTEX for GA_ATTRIB_POINT and vice versa) and GA_ATTRIB_INVALID when no check is needed.
Definition at line 284 of file GA_ReuseStrategy.h.
|
inline |
Definition at line 211 of file GA_ReuseStrategy.h.
|
inline |
Definition at line 203 of file GA_ReuseStrategy.h.
|
inline |
Definition at line 205 of file GA_ReuseStrategy.h.
|
inline |
Definition at line 187 of file GA_ReuseStrategy.h.
|
inline |
Definition at line 192 of file GA_ReuseStrategy.h.
|
inline |
Definition at line 182 of file GA_ReuseStrategy.h.
|
inline |
Definition at line 174 of file GA_ReuseStrategy.h.
|
inline |
Definition at line 179 of file GA_ReuseStrategy.h.
|
inline |
Definition at line 199 of file GA_ReuseStrategy.h.
|
inline |
Definition at line 213 of file GA_ReuseStrategy.h.
|
inline |
Definition at line 189 of file GA_ReuseStrategy.h.
|
inline |
Definition at line 194 of file GA_ReuseStrategy.h.
|
inline |
Definition at line 184 of file GA_ReuseStrategy.h.