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

Keeps track of offset mapping when merging index lists. More...

#include <GA_MergeOffsetMap.h>

Public Member Functions

 GA_MergeOffsetMap (GA_MergeMap &map, const GA_Range *sit, GA_AttributeOwner owner)
 
 ~GA_MergeOffsetMap ()
 
GA_MergeOptions::MergeStrategy getMergeStrategy () const
 
const GA_RangegetSourceRange () const
 
const GA_RangegetDestRange () const
 
GA_Offset getDestInitCapacity () const
 
GA_Offset getDestCapacity () const
 
void setDetail ()
 Sets map to be a detail map (GA_Offset(0)–>GA_Offset(0)) More...
 
void setDestForSourceRange (GA_Offset d)
 Set destination offsets for source range. More...
 
GA_Offset mapDestFromSource (GA_Offset source_offset) const
 Given the source offset, find the corresponding destination offset. More...
 
bool isIdentityMap () const
 
bool isTrivial () const
 Returns true if the map is trivial. More...
 
GA_Size getTrivialDiff () const
 
GA_Offset getDestStart () const
 
GA_Offset getDestEnd () const
 

Protected Member Functions

void buildSourceToDestMap (GA_Offset d)
 
void setDestEnd (GA_Offset e)
 

Detailed Description

Keeps track of offset mapping when merging index lists.

When an index map is merged with an existing index map, there are several different ways the index lists can be merged.

A simple merge. This happens when the destination index map is empty.

A full append merge. The source list is appended to the destination

A full interleaved merge. Source elements use up holes in the dest.

A selected merge. Only selected elements from the source are merged

See Also
GA_MergeMap, GA_MergeOptions

Definition at line 36 of file GA_MergeOffsetMap.h.

Constructor & Destructor Documentation

GA_MergeOffsetMap::GA_MergeOffsetMap ( GA_MergeMap map,
const GA_Range sit,
GA_AttributeOwner  owner 
)
GA_MergeOffsetMap::~GA_MergeOffsetMap ( )

Member Function Documentation

void GA_MergeOffsetMap::buildSourceToDestMap ( GA_Offset  d)
protected

Builds the myOffsetArray or myOffsetTable Assumes already guaranteed not trivial.

GA_Offset GA_MergeOffsetMap::getDestCapacity ( ) const
inline

The array capacity is the required capacity of attribute arrays to perform the merge. This is set for MERGE_COPY, MERGE_APPEND and MERGE_INTERLEAVE, though in the MERGE_INTERLEAVE scenario, the additional capacity will already have been allocated.

Definition at line 67 of file GA_MergeOffsetMap.h.

GA_Offset GA_MergeOffsetMap::getDestEnd ( ) const
inline

Set for MERGE_COPY and MERGE_APPEND. Specify where in the attribute arrays to place the merged source data.

Definition at line 73 of file GA_MergeOffsetMap.h.

GA_Offset GA_MergeOffsetMap::getDestInitCapacity ( ) const
inline

The array capacity is the original capacity of attribute arrays. This is set for MERGE_COPY, MERGE_APPEND and MERGE_INTERLEAVE.

Definition at line 60 of file GA_MergeOffsetMap.h.

const GA_Range& GA_MergeOffsetMap::getDestRange ( ) const
inline

Create a merge-iterator. The merge iterator will iterate over the elements which were created in the destination detail.

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

Definition at line 56 of file GA_MergeOffsetMap.h.

GA_Offset GA_MergeOffsetMap::getDestStart ( ) const
inline

Set for MERGE_COPY and MERGE_APPEND. Specify where in the attribute arrays to place the merged source data.

Definition at line 72 of file GA_MergeOffsetMap.h.

GA_MergeOptions::MergeStrategy GA_MergeOffsetMap::getMergeStrategy ( ) const
inline

Definition at line 44 of file GA_MergeOffsetMap.h.

const GA_Range& GA_MergeOffsetMap::getSourceRange ( ) const
inline

Create a merge-iterator. The merge iterator will iterate over the source elements which are to be merged into the destination

Definition at line 49 of file GA_MergeOffsetMap.h.

GA_Size GA_MergeOffsetMap::getTrivialDiff ( ) const
inline

Returns the value that should be added to source indices to map onto destination indices

Definition at line 121 of file GA_MergeOffsetMap.h.

bool GA_MergeOffsetMap::isIdentityMap ( ) const

An identity map means mapDestFromSource(i) == i for all elements.

Note
A false return value doesn't necessarily mean this map is not an identity map, but only that our simple detection failed.
bool GA_MergeOffsetMap::isTrivial ( ) const
inline

Returns true if the map is trivial.

Definition at line 117 of file GA_MergeOffsetMap.h.

GA_Offset GA_MergeOffsetMap::mapDestFromSource ( GA_Offset  source_offset) const

Given the source offset, find the corresponding destination offset.

void GA_MergeOffsetMap::setDestEnd ( GA_Offset  e)
inline

Used by the index map to set the destination range where the merged data is to be placed (MERGE_COPY, MERGE_APPEND). This range is inclusive [start..end].

Definition at line 104 of file GA_MergeOffsetMap.h.

void GA_MergeOffsetMap::setDestForSourceRange ( GA_Offset  d)

Set destination offsets for source range.

void GA_MergeOffsetMap::setDetail ( )

Sets map to be a detail map (GA_Offset(0)–>GA_Offset(0))


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