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

The merge map keeps track of information when merging details. More...

#include <GA_MergeMap.h>

Classes

class  AttributeMap
 

Public Member Functions

 GA_MergeMap (GA_Detail &dest, const GA_Detail &src, GA_MergeOptions &opts)
 
 ~GA_MergeMap ()
 
void clear ()
 Clear for multiple iterations. More...
 
void createOffsetMaps ()
 
void createTrivialMaps ()
 
void createGlobalOffsetMap ()
 Create offset maps for merging of global attributes. More...
 
GA_DetailgetDestination () const
 Get the destination geometry. More...
 
const GA_DetailgetSource () const
 Get the source geometry. More...
 
GA_MergeOptionsgetOptions () const
 Get the merging options. More...
 
void setAttributeMap (const GA_Attribute &src, GA_Attribute &dest)
 
const GA_AttributegetSourceAttribute (const GA_Attribute &dest) const
 Retrieve the source attribute mapped to the destination attribute. More...
 
GA_Offset mapDestFromSource (GA_AttributeOwner own, GA_Offset off) const
 Convenience method to get the destination offset from the source offset. More...
 
bool isIdentityMap (GA_AttributeOwner own) const
 Convenience method to check for an identity offset map. More...
 
bool isTrivialMap (GA_AttributeOwner own) const
 Convenience method to check for a trivial offset map. More...
 
GA_Size getTrivialDiff (GA_AttributeOwner own) const
 Convenience method to check for the dest-source of a trivial offset map. More...
 
GA_MergeOptions::MergeStrategy getMergeStrategy (GA_AttributeOwner own) const
 
void buildMergeOptionPrimitiveMaps () const
 
const AttributeMapgetAttributeMap () const
 
GA_Size iterationCount () const
 
void setIterationCount (GA_Size i)
 
GA_MergeOffsetMapgetOffsetMap (GA_AttributeOwner owner) const
 
const GA_RangegetSourceRange (GA_AttributeOwner owner) const
 Convenience method to get iterator over the source elements. More...
 
const GA_RangegetDestRange (GA_AttributeOwner owner) const
 
GA_Offset getDestInitCapacity (GA_AttributeOwner owner) const
 Convenience method to get old destination size. More...
 
GA_Offset getDestCapacity (GA_AttributeOwner owner) const
 Convenience method to get new destination size. More...
 
GA_Offset getDestStart (GA_AttributeOwner owner) const
 
GA_Offset getDestEnd (GA_AttributeOwner owner) const
 

Detailed Description

The merge map keeps track of information when merging details.

Merging details involves merging

  • Attributes
  • Elements This class keeps track of information between the different stages of merging.

When merging attribute data there are two different modes. The mode is per attribute type (i.e. point data might be a full merge while primitives might be a compact merge).

  • full merging will copy the source arrays verbatim. Certain optimizations may be possible using full merging in that it may be possible to share data during the merge.
  • compact merging will compact data data and produce a more compact representation of the data. However, since the data is re-ordered, it may not be possible to share data.

When merging subsets of the source geometry, compact merging is automatically turned on.

See Also
GA_AIFMerge, GA_MergeOptions

Definition at line 53 of file GA_MergeMap.h.

Constructor & Destructor Documentation

GA_MergeMap::GA_MergeMap ( GA_Detail dest,
const GA_Detail src,
GA_MergeOptions opts 
)
GA_MergeMap::~GA_MergeMap ( )

Member Function Documentation

void GA_MergeMap::buildMergeOptionPrimitiveMaps ( ) const

Used to fill out the GA_MergeOptions primitive maps, after the primitives have been merged.

void GA_MergeMap::clear ( )

Clear for multiple iterations.

void GA_MergeMap::createGlobalOffsetMap ( )

Create offset maps for merging of global attributes.

void GA_MergeMap::createOffsetMaps ( )

Before the merge map can be used, the source & destination iterators need to be created. This may also adjust index maps if they need to be interleaved.

void GA_MergeMap::createTrivialMaps ( )

Creates a trivial merge map, and doesn't change the destination detail, because the index maps are assumed to have already been updated.

const AttributeMap& GA_MergeMap::getAttributeMap ( ) const
inline

Access the attribute map that maps between the destination and source attributes. The key is the destination attribute, the value is the source attribute. All values are stored as pointers.

Definition at line 252 of file GA_MergeMap.h.

GA_Offset GA_MergeMap::getDestCapacity ( GA_AttributeOwner  owner) const
inline

Convenience method to get new destination size.

Definition at line 121 of file GA_MergeMap.h.

GA_Offset GA_MergeMap::getDestEnd ( GA_AttributeOwner  owner) const
inline

Get the offset map for a class of elements.

See Also
GA_MergeOffsetMap

Definition at line 130 of file GA_MergeMap.h.

GA_Detail& GA_MergeMap::getDestination ( ) const
inline

Get the destination geometry.

Definition at line 82 of file GA_MergeMap.h.

GA_Offset GA_MergeMap::getDestInitCapacity ( GA_AttributeOwner  owner) const
inline

Convenience method to get old destination size.

Definition at line 117 of file GA_MergeMap.h.

const GA_Range& GA_MergeMap::getDestRange ( GA_AttributeOwner  owner) const
inline

Convenience method to get iterator over the destination elements.

Note
It is more efficient to use mapDestFromSource() with the source range, especially when iterating over both.

Definition at line 113 of file GA_MergeMap.h.

GA_Offset GA_MergeMap::getDestStart ( GA_AttributeOwner  owner) const
inline

Convenience methods to get the destination range where the merged data is to be placed (MERGE_COPY, MERGE_APPEND). This range is inclusive [start..end].

Definition at line 128 of file GA_MergeMap.h.

GA_MergeOptions::MergeStrategy GA_MergeMap::getMergeStrategy ( GA_AttributeOwner  own) const
inline

Convenience method to get the merge strategy

See Also
GA_MergeOptions

Definition at line 154 of file GA_MergeMap.h.

GA_MergeOffsetMap& GA_MergeMap::getOffsetMap ( GA_AttributeOwner  owner) const
inline

Get the offset map for a class of elements.

See Also
GA_MergeOffsetMap

Definition at line 103 of file GA_MergeMap.h.

GA_MergeOptions& GA_MergeMap::getOptions ( ) const
inline

Get the merging options.

Definition at line 88 of file GA_MergeMap.h.

const GA_Detail& GA_MergeMap::getSource ( ) const
inline

Get the source geometry.

Definition at line 85 of file GA_MergeMap.h.

const GA_Attribute* GA_MergeMap::getSourceAttribute ( const GA_Attribute dest) const

Retrieve the source attribute mapped to the destination attribute.

const GA_Range& GA_MergeMap::getSourceRange ( GA_AttributeOwner  owner) const
inline

Convenience method to get iterator over the source elements.

Definition at line 106 of file GA_MergeMap.h.

GA_Size GA_MergeMap::getTrivialDiff ( GA_AttributeOwner  own) const
inline

Convenience method to check for the dest-source of a trivial offset map.

Definition at line 148 of file GA_MergeMap.h.

bool GA_MergeMap::isIdentityMap ( GA_AttributeOwner  own) const
inline

Convenience method to check for an identity offset map.

Definition at line 140 of file GA_MergeMap.h.

bool GA_MergeMap::isTrivialMap ( GA_AttributeOwner  own) const
inline

Convenience method to check for a trivial offset map.

Definition at line 144 of file GA_MergeMap.h.

GA_Size GA_MergeMap::iterationCount ( ) const
inline

When performing multiple merges of a single source geometry, this is set to the iteration count.

Definition at line 65 of file GA_MergeMap.h.

GA_Offset GA_MergeMap::mapDestFromSource ( GA_AttributeOwner  own,
GA_Offset  off 
) const
inline

Convenience method to get the destination offset from the source offset.

Definition at line 135 of file GA_MergeMap.h.

void GA_MergeMap::setAttributeMap ( const GA_Attribute src,
GA_Attribute dest 
)

Store a mapping between a source attribute and a destination attribute. This is built automatically for during attribute processing during merging. The GA_AIFMerge::getDestination() is used to define the map.

See Also
GA_AIFMerge
void GA_MergeMap::setIterationCount ( GA_Size  i)
inline

When performing multiple merges of a single source geometry, this is set to the iteration count.

Definition at line 66 of file GA_MergeMap.h.


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