HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_MergeOptions Class Reference

Provide options when performing a merge operation. More...

#include <GA_MergeOptions.h>

Public Types

enum  TypeStrategy { TYPE_DISALLOW, TYPE_KEEP_DEST, TYPE_CHANGE_DEST, TYPE_DEFAULT = TYPE_KEEP_DEST }
 
enum  StorageStrategy {
  STORAGE_DISALLOW, STORAGE_KEEP_DEST, STORAGE_CHANGE_DEST, STORAGE_USE_BEST,
  STORAGE_DEFAULT = STORAGE_USE_BEST
}
 
enum  TupleSizeStrategy {
  TUPLE_SIZE_DISALLOW, TUPLE_SIZE_KEEP_DEST, TUPLE_SIZE_CHANGE_DEST, TUPLE_SIZE_USE_BEST,
  TUPLE_SIZE_DEFAULT = TUPLE_SIZE_USE_BEST
}
 
enum  MergeStrategy {
  MERGE_OPTIMAL, MERGE_COPY, MERGE_APPEND, MERGE_INTERLEAVE,
  MERGE_DEFAULT = MERGE_OPTIMAL
}
 

Public Member Functions

 GA_MergeOptions ()
 
const GA_RangegetSourceRange (GA_AttributeOwner owner)
 
void setMergeGroups (GA_GroupType type, bool state)
 
void setAllMergeGroups (bool state)
 
bool getMergeGroups (GA_GroupType type) const
 
void setMergeInternalGroups (GA_GroupType type, bool state)
 
void setAllMergeInternalGroups (bool state)
 
bool getMergeInternalGroups (GA_GroupType type) const
 
const GA_RangegetSourcePointRange () const
 
const GA_RangegetSourcePrimitiveRange () const
 
void setSourcePrimitiveRange (const GA_Range &range)
 
void setSourcePointRange (const GA_Range &range)
 
void setPrimitiveMap (UT_Array< GA_Primitive * > *prims)
 
UT_Array< GA_Primitive * > * getPrimitiveMap () const
 
bool mergeThreaded () const
 
void setMergeThreaded (bool v)
 
bool mergeComputeMissingNormals () const
 
void setMergeComputeMissingNormals (bool v)
 
bool mergeAllPoints () const
 
void setMergeAllPoints (bool v)
 
bool mergePointsAtHead () const
 
void setMergePointsAtHead (bool v)
 
bool mergePrimitivesAtHead () const
 
void setMergePrimitivesAtHead (bool v)
 
GA_Size mergeCount () const
 
void setMergeCount (GA_Size nmerges)
 
bool forceInterleaved () const
 
void setForceInterleaved (bool v)
 
GA_DataIdStrategy getAttributeDataIdStrategy () const
 
void setAttributeDataIdStrategy (GA_DataIdStrategy s)
 
const GA_ReuseStrategygetReuseStrategy () const
 
void setReuseStrategy (const GA_ReuseStrategy &reuse)
 } More...
 

Detailed Description

Provide options when performing a merge operation.

This class stores generic options which can be set/accessed when merging.

Some common options are implemented using the IMPL_ENUM define.

  • TYPE = the name of the enum
  • DEF = the default enum (used if no option is found)
  • GENERAL = the name of the general option (i.e. "storagestrategy")
  • VERTEX = speicific name for vertex attribs (i.e. "vertex:storagestrategy) - POINT = specific name for point (i.e. "point:storagestrategy)
  • PRIMITIVE = specifid name for primitive (i.e. "primitive:storagestrategy) - GLOBAL = specific name for global (i.e. "global:storagestrategy)

The methods provided are:

TypeStrategy getTypeStrategy()
TypeStrategy getTypeStrategy(GA_AttributeOwner owner)
void setTypeStrategy(TypeStrategy value)
void setTypeStrategy(TypeStrategy value, GA_AttributeOwner owner)
StorageStrategy getStorageStrategy()
StorageStrategy getStorageStrategy(GA_AttributeOwner owner)
void setStorageStrategy(StorageStrategy value)
void setStorageStrategy(StorageStrategy value, GA_AttributeOwner owner)
TupleSizeStrategy getTupleSizeStrategy()
TupleSizeStrategy getTupleSizeStrategy(GA_AttributeOwner owner)
void setTupleSizeStrategy(TupleSizeStrategy value)
void setTupleSizeStrategy(TupleSizeStrategy value, GA_AttributeOwner owner)
MergeStrategy getMergeStrategy()
MergeStrategy getMergeStrategy(GA_AttributeOwner owner)
void setMergeStrategy(MergeStrategy value)
void setMergeStrategy(MergeStrategy value, GA_AttributeOwner owner)

List of all well defined options:

  • [point|vertex|primitive|global:]typestrategy
    What to do when the attribute type on the source & destination of the merge don't match.
  • [point|vertex|primitive|global:]storagestrategy
    What to do when the attribute storage on the source & destination of the merge don't match.
  • [point|vertex|primitive|global:]tuplesizestrategy
    What to do when the attribute tuple size on the source & destination of the merge don't match.
  • [point|vertex|primitive|global:]mergestrategy
    What approach should be taken when laying out data in the index maps when merging data. Optimize for either space or speed.
  • point|primitive:insert_at_head
    Insert primitives/points at head of ordered list rather than appending
  • point|primitive|vertex|edge|breakpoint:mergegroups Whether to merge groups from source detail. Defaults to true.
  • point|primitive|vertex|edge|breakpoint:mergeinternalgroups Whether to merge internal groups from source detail. Defaults to true.
  • point:mergeallpoints
    When specifying a primitive group, by default only the points referenced by the primitives will be merged. Setting this option will cause all points to be merged.
  • merge:threaded Perform threaded merging of data

Definition at line 91 of file GA_MergeOptions.h.

Member Enumeration Documentation

The MergeStrategy is used to give a hint as to how the merge should append data after the existing data or whether the source data should be interleaved with the existing data. The merge operation may change this "hint" for the actual operation.

Enumerator
MERGE_OPTIMAL 

The optimal mode will use simple heuristics to determine whether elements should be appended or interleaved.

MERGE_COPY 

MERGE_COPY is very similar to MERGE_APPEND. However, this is done when the original destination list has no elements allocated before the merge (i.e. the merge acts as a copy).

MERGE_APPEND 

All data is appended to the end of the existing destination data. This offers attributes the opportunity to share data.

MERGE_INTERLEAVE 

In this mode, the source data is merged and mixed in with the destination data. This will result in the most compact storage, but may result in non-shared data after the merge.

MERGE_DEFAULT 

Definition at line 148 of file GA_MergeOptions.h.

For attributes which have storage, this enum gives a hint of what to do if there's a mis-match on storage types.

Enumerator
STORAGE_DISALLOW 

Disallow mis-matched storage.

STORAGE_KEEP_DEST 

Keep destination storage (casting source)

STORAGE_CHANGE_DEST 

Change destination to match storage.

STORAGE_USE_BEST 

Use storage with greatest precision.

STORAGE_DEFAULT 

Definition at line 114 of file GA_MergeOptions.h.

For attributes which have a tuple size, this enum gives a hint of what to do if there's a mis-match on storage types.

Enumerator
TUPLE_SIZE_DISALLOW 

Disallow mis-matched tuple sizes.

TUPLE_SIZE_KEEP_DEST 

Use the destination tuple size.

TUPLE_SIZE_CHANGE_DEST 

Change destination to match source.

TUPLE_SIZE_USE_BEST 

Use the largest tuple size.

TUPLE_SIZE_DEFAULT 

Definition at line 130 of file GA_MergeOptions.h.

The TypeStrategy is used to give a hint to the AIFMerge if it encounters a type difference on the attributes. For example, if the destination is a string attribute, but the source has a boolean attribute, the attribute can either keep or change the destination to match the source.

Enumerator
TYPE_DISALLOW 

Only process exact matches on types.

TYPE_KEEP_DEST 

Keep destination unchanged if possible.

TYPE_CHANGE_DEST 

Change destination attribute to match source.

TYPE_DEFAULT 

Definition at line 101 of file GA_MergeOptions.h.

Constructor & Destructor Documentation

GA_MergeOptions::GA_MergeOptions ( )

Member Function Documentation

bool GA_MergeOptions::forceInterleaved ( ) const
inline

Whether the "copy" style of merging should force interleaving instead of verbatim copying. This is often useful when merging multiple different details.

Definition at line 318 of file GA_MergeOptions.h.

GA_DataIdStrategy GA_MergeOptions::getAttributeDataIdStrategy ( ) const
inline

Strategy to use for attribute data ids during the merge, defaulting to GA_DATA_ID_BUMP. GA_DATA_ID_CLONE is useful when copying a source detail in order to perform a partial update without always blindly invalidating any external caches tied to data ids. The data id must be manually bumped when an attribute is later modified.

Definition at line 328 of file GA_MergeOptions.h.

bool GA_MergeOptions::getMergeGroups ( GA_GroupType  type) const
inline

Set whether the merge should copy over group membership for the given attribute type. By default, all groups are copied.

Note that only a single type should be passed in (don't use bit-masks)

Definition at line 218 of file GA_MergeOptions.h.

bool GA_MergeOptions::getMergeInternalGroups ( GA_GroupType  type) const
inline

Set whether the merge should copy over group membership for the given attribute type. By default, all groups are copied.

Note that only a single type should be passed in (don't use bit-masks)

Definition at line 229 of file GA_MergeOptions.h.

UT_Array<GA_Primitive*>* GA_MergeOptions::getPrimitiveMap ( ) const
inline

For backward compatibility with the GEO library, we provide a method to control the "mapping" from source primitives to the newly created merged primitives.

Definition at line 262 of file GA_MergeOptions.h.

const GA_ReuseStrategy& GA_MergeOptions::getReuseStrategy ( ) const
inline

Strategy to use for handling point attributes and vertex attributes of the same name, defaulting to override a previous point/vertex attribute with the requested vertex/point attribute.

Definition at line 338 of file GA_MergeOptions.h.

const GA_Range* GA_MergeOptions::getSourcePointRange ( ) const
inline

There are two iterators that can be specified in the options. This allows the merge operation to operate on a subset of primitives & points.

  • If neither range is set, all source primitives, vertices and points will be merged.
  • If the primitive range is set, only the primitives in the range will be merged. Only the points used by the primitives will be merged unless the bool option: "point:mergeallpoints" is set.
  • If the point range is set, no primitives will be merge, and only the points in the range will be merged.

Definition at line 244 of file GA_MergeOptions.h.

const GA_Range* GA_MergeOptions::getSourcePrimitiveRange ( ) const
inline

There are two iterators that can be specified in the options. This allows the merge operation to operate on a subset of primitives & points.

  • If neither range is set, all source primitives, vertices and points will be merged.
  • If the primitive range is set, only the primitives in the range will be merged. Only the points used by the primitives will be merged unless the bool option: "point:mergeallpoints" is set.
  • If the point range is set, no primitives will be merge, and only the points in the range will be merged.

Definition at line 247 of file GA_MergeOptions.h.

const GA_Range* GA_MergeOptions::getSourceRange ( GA_AttributeOwner  owner)
inline

Definition at line 190 of file GA_MergeOptions.h.

bool GA_MergeOptions::mergeAllPoints ( ) const
inline

When merging a range of primitives, check whether to merge all points (or just the referenced points). Default: false

Definition at line 285 of file GA_MergeOptions.h.

bool GA_MergeOptions::mergeComputeMissingNormals ( ) const
inline

Whether to compute missing normal attributes if they are on one of the geometries and not the other. Default: true

Definition at line 277 of file GA_MergeOptions.h.

GA_Size GA_MergeOptions::mergeCount ( ) const
inline

Merge the input detail multiple times.

Definition at line 305 of file GA_MergeOptions.h.

bool GA_MergeOptions::mergePointsAtHead ( ) const
inline

Whether to insert points at the head when merging. Default: false

Definition at line 292 of file GA_MergeOptions.h.

bool GA_MergeOptions::mergePrimitivesAtHead ( ) const
inline

Whether to insert primitives at the head when merging. Default: false

Definition at line 299 of file GA_MergeOptions.h.

bool GA_MergeOptions::mergeThreaded ( ) const
inline

Whether to perform threaded merging of attributes Default: true

Definition at line 269 of file GA_MergeOptions.h.

void GA_MergeOptions::setAllMergeGroups ( bool  state)
inline

Set whether the merge should copy over group membership for the given attribute type. By default, all groups are copied.

Note that only a single type should be passed in (don't use bit-masks)

Definition at line 211 of file GA_MergeOptions.h.

void GA_MergeOptions::setAllMergeInternalGroups ( bool  state)
inline

Set whether the merge should copy over group membership for the given attribute type. By default, all groups are copied.

Note that only a single type should be passed in (don't use bit-masks)

Definition at line 222 of file GA_MergeOptions.h.

void GA_MergeOptions::setAttributeDataIdStrategy ( GA_DataIdStrategy  s)
inline

Strategy to use for attribute data ids during the merge, defaulting to GA_DATA_ID_BUMP. GA_DATA_ID_CLONE is useful when copying a source detail in order to perform a partial update without always blindly invalidating any external caches tied to data ids. The data id must be manually bumped when an attribute is later modified.

Definition at line 330 of file GA_MergeOptions.h.

void GA_MergeOptions::setForceInterleaved ( bool  v)
inline

Whether the "copy" style of merging should force interleaving instead of verbatim copying. This is often useful when merging multiple different details.

Definition at line 319 of file GA_MergeOptions.h.

void GA_MergeOptions::setMergeAllPoints ( bool  v)
inline

When merging a range of primitives, check whether to merge all points (or just the referenced points). Default: false

Definition at line 286 of file GA_MergeOptions.h.

void GA_MergeOptions::setMergeComputeMissingNormals ( bool  v)
inline

Whether to compute missing normal attributes if they are on one of the geometries and not the other. Default: true

Definition at line 278 of file GA_MergeOptions.h.

void GA_MergeOptions::setMergeCount ( GA_Size  nmerges)
inline

Merge the input detail multiple times.

Definition at line 306 of file GA_MergeOptions.h.

void GA_MergeOptions::setMergeGroups ( GA_GroupType  type,
bool  state 
)
inline

Set whether the merge should copy over group membership for the given attribute type. By default, all groups are copied.

Note that only a single type should be passed in (don't use bit-masks)

Definition at line 209 of file GA_MergeOptions.h.

void GA_MergeOptions::setMergeInternalGroups ( GA_GroupType  type,
bool  state 
)
inline

Set whether the merge should copy over group membership for the given attribute type. By default, all groups are copied.

Note that only a single type should be passed in (don't use bit-masks)

Definition at line 220 of file GA_MergeOptions.h.

void GA_MergeOptions::setMergePointsAtHead ( bool  v)
inline

Whether to insert points at the head when merging. Default: false

Definition at line 293 of file GA_MergeOptions.h.

void GA_MergeOptions::setMergePrimitivesAtHead ( bool  v)
inline

Whether to insert primitives at the head when merging. Default: false

Definition at line 300 of file GA_MergeOptions.h.

void GA_MergeOptions::setMergeThreaded ( bool  v)
inline

Whether to perform threaded merging of attributes Default: true

Definition at line 270 of file GA_MergeOptions.h.

void GA_MergeOptions::setPrimitiveMap ( UT_Array< GA_Primitive * > *  prims)

For backward compatibility with the GEO library, we provide a method to control the "mapping" from source primitives to the newly created merged primitives.

void GA_MergeOptions::setReuseStrategy ( const GA_ReuseStrategy reuse)
inline

}

Definition at line 340 of file GA_MergeOptions.h.

void GA_MergeOptions::setSourcePointRange ( const GA_Range range)
inline

There are two iterators that can be specified in the options. This allows the merge operation to operate on a subset of primitives & points.

  • If neither range is set, all source primitives, vertices and points will be merged.
  • If the primitive range is set, only the primitives in the range will be merged. Only the points used by the primitives will be merged unless the bool option: "point:mergeallpoints" is set.
  • If the point range is set, no primitives will be merge, and only the points in the range will be merged.

Definition at line 253 of file GA_MergeOptions.h.

void GA_MergeOptions::setSourcePrimitiveRange ( const GA_Range range)
inline

There are two iterators that can be specified in the options. This allows the merge operation to operate on a subset of primitives & points.

  • If neither range is set, all source primitives, vertices and points will be merged.
  • If the primitive range is set, only the primitives in the range will be merged. Only the points used by the primitives will be merged unless the bool option: "point:mergeallpoints" is set.
  • If the point range is set, no primitives will be merge, and only the points in the range will be merged.

Definition at line 251 of file GA_MergeOptions.h.


The documentation for this class was generated from the following file: