11 #ifndef __GA_MergeOptions__
12 #define __GA_MergeOptions__
25 template <
typename T>
class UT_Array;
110 TYPE_DEFAULT = TYPE_KEEP_DEST
125 STORAGE_DEFAULT = STORAGE_USE_BEST
141 TUPLE_SIZE_DEFAULT = TUPLE_SIZE_USE_BEST
165 MERGE_DEFAULT = MERGE_OPTIMAL
168 #define IMPL_ENUM(TYPE, DEF) \
169 TYPE get##TYPE() const { \
170 if (my##TYPE[GA_ATTRIB_OWNER_N] >= 0) \
171 return my##TYPE[GA_ATTRIB_OWNER_N]; \
174 TYPE get##TYPE(GA_AttributeOwner owner) const { \
175 if (my##TYPE[owner] >= 0) return my##TYPE[owner]; \
176 return get##TYPE(); \
178 void set##TYPE(TYPE v) { my##TYPE[GA_ATTRIB_OWNER_N] = v; } \
179 void set##TYPE(TYPE v, GA_AttributeOwner owner) { \
180 my##TYPE[owner] = v; \
184 IMPL_ENUM(StorageStrategy, STORAGE_DEFAULT)
185 IMPL_ENUM(TupleSizeStrategy, TUPLE_SIZE_DEFAULT)
195 return getSourcePointRange();
197 return getSourcePrimitiveRange();
210 { myGroupMerge[
type] = state; }
215 myGroupMerge[i] = state;
219 {
return myGroupMerge[
type]; }
221 { myInternalGroupMerge[
type] = state; }
226 myInternalGroupMerge[i] = state;
230 {
return myInternalGroupMerge[
type]; }
245 {
return myPointRange.
getRTI()
246 ? &myPointRange : (
const GA_Range *)NULL; }
248 {
return myPrimitiveRange.
getRTI()
249 ? &myPrimitiveRange : (
const GA_Range *)NULL; }
252 { myPrimitiveRange =
range; }
254 { myPointRange =
range; }
263 {
return myPrimitiveMap; }
308 myMergeCount =
SYSmax(1, nmerges);
309 if (myMergeCount > 1)
310 myForceInterleaved =
true;
329 {
return myAttributeDataIdStrategy; }
331 { myAttributeDataIdStrategy =
s; }
339 {
return myReuseStrategy; }
341 { myReuseStrategy = reuse; }
358 bool myForceInterleaved;
359 bool myMergeThreaded;
360 bool myMergeComputeMissingNormals;
361 bool myMergeAllPoints;
362 bool myMergePointsAtHead;
363 bool myMergePrimitivesAtHead;
void setMergePointsAtHead(bool v)
Only process exact matches on types.
UT_Array< GA_Primitive * > * getPrimitiveMap() const
Specify when and how to reuse an existing attribute.
Disallow mis-matched storage.
void setMergeThreaded(bool v)
const GA_Range * getSourcePrimitiveRange() const
void setMergeAllPoints(bool v)
void setSourcePointRange(const GA_Range &range)
void setMergePrimitivesAtHead(bool v)
void setMergeComputeMissingNormals(bool v)
void setMergeCount(GA_Size nmerges)
GA_DataIdStrategy getAttributeDataIdStrategy() const
exint GA_Size
Defines the bit width for index and offset types in GA.
Keep destination storage (casting source)
Use storage with greatest precision.
A range of elements in an index-map.
Change destination attribute to match source.
void setReuseStrategy(const GA_ReuseStrategy &reuse)
}
const GA_ReuseStrategy & getReuseStrategy() const
Use the largest tuple size.
bool getMergeGroups(GA_GroupType type) const
bool mergePointsAtHead() const
bool mergeAllPoints() const
void setSourcePrimitiveRange(const GA_Range &range)
void setForceInterleaved(bool v)
#define IMPL_ENUM(TYPE, DEF)
const GA_Range * getSourceRange(GA_AttributeOwner owner)
const GA_Range * getSourcePointRange() const
const GA_RangeTypeInterface * getRTI() const
Accessor for RTI.
bool mergeComputeMissingNormals() const
Use the destination tuple size.
bool mergeThreaded() const
bool mergePrimitivesAtHead() const
void setAttributeDataIdStrategy(GA_DataIdStrategy s)
void setMergeGroups(GA_GroupType type, bool state)
bool forceInterleaved() const
void setMergeInternalGroups(GA_GroupType type, bool state)
GA_GroupType
An ordinal enum for the different types of groups in GA.
Disallow mis-matched tuple sizes.
Change destination to match source.
Keep destination unchanged if possible.
Change destination to match storage.
Provide options when performing a merge operation.
Container class for all geometry.
bool getMergeInternalGroups(GA_GroupType type) const
void setAllMergeInternalGroups(bool state)
GA_Size mergeCount() const
void setAllMergeGroups(bool state)