HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GA_IndexMap::AttributeCompare Class Reference

#include <GA_IndexMap.h>

+ Inheritance diagram for GA_IndexMap::AttributeCompare:

Public Member Functions

 AttributeCompare (const GA_Attribute *attribute, int tuple_index=0)
 
 AttributeCompare (const GA_IndexMap &map, const char *attribute_name, int tuple_index=0)
 Construct given an index map and an attribute name. More...
 
virtual ~AttributeCompare ()
 Destructor. More...
 
virtual bool initialize (const GA_IndexMap &map)
 
virtual int compare (const GA_IndexMap &map, GA_Offset item1, GA_Offset item2)
 
virtual void finish (const GA_IndexMap &map)
 
- Public Member Functions inherited from GA_IndexMap::IndexCompare
 IndexCompare ()
 
virtual ~IndexCompare ()
 

Protected Member Functions

const GA_AttributegetAttribute () const
 
const GA_AIFTuplegetAIFTuple () const
 
const GA_AIFStringTuplegetAIFStringTuple () const
 
int getTupleIndex () const
 
bool getIsFloat () const
 

Detailed Description

Convenience class which can be used to sort an index map based on an attribute value. The attribute should either provide an AIFTuple or AIFStringTuple interface. If neither interfaces are provided, this class won't do any sorting. Example:

GA_Detail &gdp;
GA_IndexMap &points = gdp.getIndexMap(GA_ATTRIB_POINT);
// Sort by P.z
GA_IndexMap::AttributeCompare cmpPz(points, "P", 2);
points.sortIndices(cmpPz);

Definition at line 373 of file GA_IndexMap.h.

Constructor & Destructor Documentation

GA_IndexMap::AttributeCompare::AttributeCompare ( const GA_Attribute attribute,
int  tuple_index = 0 
)

Sort the index map based on the values in the attribute. For tuple attributes, compare the value for the given index.

GA_IndexMap::AttributeCompare::AttributeCompare ( const GA_IndexMap map,
const char *  attribute_name,
int  tuple_index = 0 
)

Construct given an index map and an attribute name.

virtual GA_IndexMap::AttributeCompare::~AttributeCompare ( )
virtual

Destructor.

Member Function Documentation

virtual int GA_IndexMap::AttributeCompare::compare ( const GA_IndexMap map,
GA_Offset  item1,
GA_Offset  item2 
)
virtual

Methods defined on IndexCompare

Implements GA_IndexMap::IndexCompare.

virtual void GA_IndexMap::AttributeCompare::finish ( const GA_IndexMap map)
virtual

Methods defined on IndexCompare

Implements GA_IndexMap::IndexCompare.

const GA_AIFStringTuple* GA_IndexMap::AttributeCompare::getAIFStringTuple ( ) const
inlineprotected

Definition at line 399 of file GA_IndexMap.h.

const GA_AIFTuple* GA_IndexMap::AttributeCompare::getAIFTuple ( ) const
inlineprotected

Definition at line 397 of file GA_IndexMap.h.

const GA_Attribute* GA_IndexMap::AttributeCompare::getAttribute ( ) const
inlineprotected

Definition at line 395 of file GA_IndexMap.h.

bool GA_IndexMap::AttributeCompare::getIsFloat ( ) const
inlineprotected

Definition at line 403 of file GA_IndexMap.h.

int GA_IndexMap::AttributeCompare::getTupleIndex ( ) const
inlineprotected

Definition at line 401 of file GA_IndexMap.h.

virtual bool GA_IndexMap::AttributeCompare::initialize ( const GA_IndexMap map)
virtual

Methods defined on IndexCompare

Implements GA_IndexMap::IndexCompare.


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