11 #ifndef __GA_ReuseStrategy__
12 #define __GA_ReuseStrategy__
50 COLLISION_DEFAULT = COLLISION_RECYCLE
67 FAILURE_DEFAULT = FAILURE_REPLACE_AND_COPY
83 TYPE_DEFAULT = TYPE_KEEP_COMPATIBLE
99 STORAGE_DEFAULT = STORAGE_USE_BEST
113 TUPLE_SIZE_DEFAULT = TUPLE_SIZE_USE_BEST
130 OPTIONS_DEFAULT = OPTIONS_MERGE_MISSING
140 DATACOPY_DEFAULT = DATACOPY_TRUE
155 PT_VTX_COLLISION_DEFAULT = PT_VTX_COLLISION_INHERIT_VALUES_AND_DESTROY
164 : myCollisionStrategy(COLLISION_RECYCLE),
165 myFailureStrategy(fail_strategy),
166 myTypeStrategy(type_strategy), myStorageStrategy(storage_strategy),
167 myTupleSizeStrategy(size_strategy), myOptionsStrategy(opts_strategy),
168 myPointVertexCollisionStrategy(PT_VTX_COLLISION_DEFAULT)
173 {
return myCollisionStrategy; }
175 { myCollisionStrategy =
s; }
178 {
return myFailureStrategy; }
180 { myFailureStrategy =
s; }
183 {
return myTypeStrategy; }
185 { myTypeStrategy =
s; }
188 {
return myStorageStrategy; }
190 { myStorageStrategy =
s; }
193 {
return myTupleSizeStrategy; }
195 { myTupleSizeStrategy =
s; }
198 {
return myOptionsStrategy; }
200 { myOptionsStrategy =
s; }
204 {
return myCollisionStrategy == COLLISION_RECYCLE; }
207 return myFailureStrategy == FAILURE_REPLACE ||
208 myFailureStrategy == FAILURE_REPLACE_AND_COPY;
212 {
return myPointVertexCollisionStrategy; }
216 myPointVertexCollisionStrategy =
s;
227 bool applyStrategiesForTuples(
229 int requested_tuple_size,
241 bool applyStrategiesForArrays(
243 int requested_tuple_size,
250 bool applyDataCopyStrategy(
259 int computeTupleSize(
int old_size,
260 int requested_size)
const;
270 static bool areEqual(
const GA_Defaults &a_defaults,
275 void applyOptionsStrategy(
287 if (myPointVertexCollisionStrategy != PT_VTX_COLLISION_IGNORE)
300 bool applyPointVertexCollisionDataCopyStrategy(
305 CollisionStrategy myCollisionStrategy;
306 FailureStrategy myFailureStrategy;
307 TypeStrategy myTypeStrategy;
308 StorageStrategy myStorageStrategy;
309 TupleSizeStrategy myTupleSizeStrategy;
310 OptionsStrategy myOptionsStrategy;
311 PointVertexCollisionStrategy myPointVertexCollisionStrategy;
OptionsStrategy getOptionsStrategy() const
Destroy the attribute in the other dictionary.
TupleSizeStrategy getTupleSizeStrategy() const
GA_ReuseStrategy(FailureStrategy fail_strategy=FAILURE_DEFAULT, TypeStrategy type_strategy=TYPE_DEFAULT, StorageStrategy storage_strategy=STORAGE_DEFAULT, TupleSizeStrategy size_strategy=TUPLE_SIZE_DEFAULT, OptionsStrategy opts_strategy=OPTIONS_DEFAULT)
Definition of a geometry attribute.
void setStorageStrategy(StorageStrategy s)
Specify when and how to reuse an existing attribute.
Return the conflicting attribute.
void setOptionsStrategy(OptionsStrategy s)
Set the new tuple size to be no larger than the old size.
Replace the conflicting attribute.
Disallow mis-matched storage.
Class which stores the default values for a GA_Attribute.
Keep existing storage (if compatible)
getFileOption("OpenEXR:storage") storage
CollisionStrategy getCollisionStrategy() const
Keep existing attribute's options.
bool getRecycleOnCollision() const
Disallow mis-matched tuple sizes.
Ignore the attribute in the other dictionary.
Keep any existing options, but merge in any missing options.
GA_AttributeOwner getPointVertexCollisionDict(GA_AttributeOwner dict) const
Reduce existing storage to that desired.
void setCollisionStrategy(CollisionStrategy s)
Disallow mis-matched type.
StorageStrategy getStorageStrategy() const
FailureStrategy getFailureStrategy() const
PointVertexCollisionStrategy getPointVertexCollisionStrategy() const
TypeStrategy getTypeStrategy() const
bool getReplaceOnFailure() const
void setTupleSizeStrategy(TupleSizeStrategy s)
void setPointVertexCollisionStrategy(PointVertexCollisionStrategy s)
Use storage with greatest precision (float > int)
void setFailureStrategy(FailureStrategy s)
Use the larger of the two tuple sizes.
A map of string to various well defined value types.
void setTypeStrategy(TypeStrategy s)
PointVertexCollisionStrategy
Replace existing attribute's options entirely.
Return an invalid result (NULL pointer or invalid reference)