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

A utility class to amortize overhead from GA_GBElement attribute handling methods. More...

#include <GA_ElementWrangler.h>

+ Inheritance diagram for GA_ElementWrangler:

Public Member Functions

void buildCache ()
 
void clearCache ()
 
void copyAttributeValues (GA_Offset dest, GA_Offset src)
 
void copyAttributeValues (const GA_Range &dest, GA_Offset src)
 
void scaleAttributeValues (GA_Offset dest, fpreal scale)
 
void addAttributeValues (GA_Offset dest, GA_Offset src, fpreal scale=1)
 
void lerpAttributeValues (GA_Offset dest, GA_Offset src0, GA_Offset src1, fpreal bias)
 
bool isValid (GA_Detail &dest) const
 
bool isValid (GA_Detail &dest, const GA_Detail &src) const
 
int getNumAttributes () const
 
void bumpAllDestDataIds ()
 
void hardenAllPages (GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET)
 
GA_AttributeRefMapgetMap ()
 

Protected Member Functions

 GA_ElementWrangler (GA_AttributeOwner owner, GA_Detail &dest, const GA_Attribute *exclude=nullptr)
 
 GA_ElementWrangler (GA_AttributeOwner owner, GA_Detail &dest, const GA_Detail &src, const GA_Attribute *exclude=nullptr)
 
 GA_ElementWrangler (GA_AttributeOwner owner, GA_Detail &dest, const GA_AttributeFilter &filter)
 
 GA_ElementWrangler (GA_AttributeOwner owner, GA_Detail &dest, const GA_Detail &src, const GA_AttributeFilter &filter)
 
 ~GA_ElementWrangler ()
 Protected destructor as we don't support polymorphic destruction. More...
 
GA_AttributeRefMap::Cache * cache ()
 

Detailed Description

A utility class to amortize overhead from GA_GBElement attribute handling methods.

The GA_ElementWrangler class provides a simplified interface for common attribute operations as elements are added or removed.

This class is not thread-safe, so each thread should have its own copy, and any attributes added after its instantiation will not be processed.

Definition at line 38 of file GA_ElementWrangler.h.

Constructor & Destructor Documentation

GA_ElementWrangler::GA_ElementWrangler ( GA_AttributeOwner  owner,
GA_Detail dest,
const GA_Attribute exclude = nullptr 
)
protected
GA_ElementWrangler::GA_ElementWrangler ( GA_AttributeOwner  owner,
GA_Detail dest,
const GA_Detail src,
const GA_Attribute exclude = nullptr 
)
protected
GA_ElementWrangler::GA_ElementWrangler ( GA_AttributeOwner  owner,
GA_Detail dest,
const GA_AttributeFilter filter 
)
protected
GA_ElementWrangler::GA_ElementWrangler ( GA_AttributeOwner  owner,
GA_Detail dest,
const GA_Detail src,
const GA_AttributeFilter filter 
)
protected
GA_ElementWrangler::~GA_ElementWrangler ( )
inlineprotected

Protected destructor as we don't support polymorphic destruction.

Definition at line 109 of file GA_ElementWrangler.h.

Member Function Documentation

void GA_ElementWrangler::addAttributeValues ( GA_Offset  dest,
GA_Offset  src,
fpreal  scale = 1 
)
inline

Definition at line 59 of file GA_ElementWrangler.h.

void GA_ElementWrangler::buildCache ( )
inline

Definition at line 44 of file GA_ElementWrangler.h.

void GA_ElementWrangler::bumpAllDestDataIds ( )
inline

Definition at line 82 of file GA_ElementWrangler.h.

GA_AttributeRefMap::Cache* GA_ElementWrangler::cache ( )
inlineprotected

Definition at line 111 of file GA_ElementWrangler.h.

void GA_ElementWrangler::clearCache ( )
inline

Definition at line 47 of file GA_ElementWrangler.h.

void GA_ElementWrangler::copyAttributeValues ( GA_Offset  dest,
GA_Offset  src 
)
inline
Examples:
tetprim/GEO_PrimTetra.C.

Definition at line 49 of file GA_ElementWrangler.h.

void GA_ElementWrangler::copyAttributeValues ( const GA_Range dest,
GA_Offset  src 
)
GA_AttributeRefMap& GA_ElementWrangler::getMap ( )
inline

Definition at line 95 of file GA_ElementWrangler.h.

int GA_ElementWrangler::getNumAttributes ( ) const
inline

Definition at line 80 of file GA_ElementWrangler.h.

void GA_ElementWrangler::hardenAllPages ( GA_Offset  start_offset = GA_Offset(0),
GA_Offset  end_offset = GA_INVALID_OFFSET 
)

Harden data pages in destination attributes. Will harden all pages overlapping the specified offset range. Once this is done, multiple threads can write to an attribute in parallel at a finer granularity than pages. Note groups are not threadsafe even if hardened.

bool GA_ElementWrangler::isValid ( GA_Detail dest) const
inline

Definition at line 70 of file GA_ElementWrangler.h.

bool GA_ElementWrangler::isValid ( GA_Detail dest,
const GA_Detail src 
) const
inline

Definition at line 75 of file GA_ElementWrangler.h.

void GA_ElementWrangler::lerpAttributeValues ( GA_Offset  dest,
GA_Offset  src0,
GA_Offset  src1,
fpreal  bias 
)
inline

Definition at line 64 of file GA_ElementWrangler.h.

void GA_ElementWrangler::scaleAttributeValues ( GA_Offset  dest,
fpreal  scale 
)
inline

Definition at line 55 of file GA_ElementWrangler.h.


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