HDK
|
Attribute Interface for merging attribute data between details. More...
#include <GA_AIFMerge.h>
Public Member Functions | |
GA_AIFMerge () | |
virtual | ~GA_AIFMerge () |
virtual void | destroyDestination (const GA_MergeMap &map, GA_Attribute *dattrib, const GA_Attribute &sattrib) const =0 |
virtual GA_Attribute * | addDestination (const GA_MergeMap &map, GA_Attribute *dattrib, const GA_Attribute &sattrib) const =0 |
virtual void | growArray (const GA_MergeMap &map, GA_Attribute &dattrib, const GA_Attribute *sattrib) const |
virtual bool | copyArray (const GA_MergeMap &map, GA_Attribute &dattrib, const GA_Attribute *sattrib) const =0 |
Static Public Member Functions | |
static bool | destroyMismatchedType (const GA_MergeMap &map, GA_Attribute *dest) |
static GA_Attribute * | addMismatchedType (const GA_MergeMap &map, GA_Attribute *dest, const GA_Attribute &src) |
static bool | checkTupleStorage (const GA_MergeMap &map, GA_Attribute &dest, const GA_Attribute &src) |
static bool | checkTupleSize (const GA_MergeMap &map, GA_Attribute &dest, const GA_Attribute &src) |
Attribute Interface for merging attribute data between details.
This class provides an interface used to copy attribute data from one detail to another detail. The source detail is const and contains the geometry which will be merged into the destination detail.
Merging is done in stages:
destroyDestination()
method is called.map.getMergeStrategy()
is not GA_MergeOptions::MERGE_INTERLEAVE
, then, the growArray()
method is called. By default, this will simply call GA_Attribute::setArraySize()
with the new size. However, this method provides the opportunity to perform optimizations in copying data from the source.addDestination()
method will be called to create new attributes on the desintion detail. The method will be called for each attribute on the source detail.copyArray()
method. At this point, the attribute should have all the storage allocated and it should be as simple as using the source and destination iterators to copy the data. If optimizations are made in the growArray()
method, you will most likely have to alter behaviour based on the map.getMergeStrategy()
. Definition at line 56 of file GA_AIFMerge.h.
GA_AIFMerge::GA_AIFMerge | ( | ) |
|
virtual |
|
pure virtual |
The addDestination()
method is used to either create or modify attributes on the destination. For example, this method can be used to change storage, tuple size, etc. on an attribute, or to create an entirely new attribute. The dattrib parameter will be set to point to an existing attribute on the destination detail.
map | The merge options |
dattrib | NULL or the existing destination attribute |
sattrib | The source attribute |
|
static |
The addMismatchedType()
function is a convenience function to use the options in GA_MergeMap to handle attributes of different types. There are three possible types of return values:
clone()
on the source attribute.The method should only be called if the dest and src attributes are different.
This should only be called from within addDestination()
Note: It's possible for dest to be NULL.
map | The merge options |
dest | NULL or the existing destination attribute |
src | The source attribute |
|
static |
Convenience function to deal with changing tuple storage (based on merging strategy). The function returns true if the tuple sizes match, false if there's an irreconcilable difference. This should be called from within addDestination()
. If the function returns false, then no attribute should be returned from addDestination()
(indicating no merging).
map | The merge options |
dest | The existing destination attribute |
src | The source attribute |
|
static |
Convenience function to deal with changing tuple sizes (based on merging strategy) The function returns true if the tuple storage match, false if there's an irreconcilable difference. This should be called from within addDestination()
. If the function returns false, then no attribute should be returned from addDestination()
(indicating no merging).
map | The merge options |
dest | The existing destination attribute |
src | The source attribute |
|
pure virtual |
The copyArray()
method is responsible for copying the data from the source to the destination attribute. The GA_MergeMap
provides all the information necessary for mapping the source data to the destination.
Note: The destination attribute's AIFMerge is used, and it's possible that the source attribute is NULL (indicating that there's no data to copy).
map | The merge options |
dattrib | NULL or the existing destination attribute |
sattrib | The source attribute |
|
pure virtual |
The destroyDestination()
method is used to delete attributes on the destination (dattrib). These are attributes which will not survive the merge.
map | The merge options |
dattrib | NULL or the existing destination attribute |
sattrib | The source attribute |
|
static |
The destroyMismatchedType()
function is a convenience function to use the options in GA_MergeMap to handle attributes of different types.
The method should only be called if the dest and src attributes are different.
This should only be called from within destroyDestination()
Note: It's possible for dest to be NULL.
map | The merge options |
dest | NULL or the existing destination attribute |
|
virtual |
The growArray()
method is responsible for growing the array. The default behaviour is to call GA_Attribute::setArraySize()
. This method is only called if the merge strategy is not set to GA_MergeOptions::MERGE_INTERLEAVE
. It may be possible to perform optimizations depending on how data is stored.
map | The merge options |
dattrib | NULL or the existing destination attribute |
sattrib | The source attribute |
The default behaviour is to call: