HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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...
 
 ~AttributeCompare () override
 Destructor. More...
 
bool initialize (const GA_IndexMap &map) override
 
int compare (const GA_IndexMap &map, GA_Offset item1, GA_Offset item2) override
 
void finish (const GA_IndexMap &map) override
 
- 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;
// Sort by P.z
GA_IndexMap::AttributeCompare cmpPz(points, "P", 2);
points.sortIndices(cmpPz);

Definition at line 375 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.

GA_IndexMap::AttributeCompare::~AttributeCompare ( )
override

Destructor.

Member Function Documentation

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

Methods defined on IndexCompare

Implements GA_IndexMap::IndexCompare.

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

Methods defined on IndexCompare

Implements GA_IndexMap::IndexCompare.

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

Definition at line 401 of file GA_IndexMap.h.

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

Definition at line 399 of file GA_IndexMap.h.

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

Definition at line 397 of file GA_IndexMap.h.

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

Definition at line 405 of file GA_IndexMap.h.

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

Definition at line 403 of file GA_IndexMap.h.

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

Methods defined on IndexCompare

Implements GA_IndexMap::IndexCompare.


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