2.2.3.2 CategoricalMap


Name

CategoricalMap

Remark

An Origin C CategoricalMap is a dynamically allocated and sized array of text values that is not tied to an internal Origin data set. A CategoricalMap contains a set of unique and alpha-numerically sorted text values which are typically referenced by the elements of an associated object of type CategoricalData. The CategoricalMap class contains additional class methods and is not derived from the vector<string> class, so an object of type CategoricalMap is not technically equivalent to an object of type vector<string>, but the data elements of each are functionally equivalent and the types can be explicitly cast.

Hierarchy

  • CategoricalMap

Examples

EX1

void CategoricalMap_ex1()
{
    // a Worksheet with at least 1 column must exist prior to execution
    Worksheet wks=Project.ActiveLayer();
    if (wks)
    { 
        string strWksColname = wks.Columns(0).GetName();
        strWksColname = wks.GetPage().GetName() + "_" + strWksColname;
        
        StringArray vMyCatMap;
        CategoricalData cdMyCatData(strWksColname);
        CategoricalMap cmMyCatMap;
        cmMyCatMap = cdMyCatData.Map;
        vMyCatMap = (StringArray) cmMyCatMap; // Requires explicit cast
    }
}

Header to Include

origin.h

Reference

Members

Name Brief Example
ArrangeAZ Sort the CategoricalMap in ascending order. Examples
ArrangeZA Sort the CategoricalMap in descending order.. Examples
CategoricalMap Default constructor to create an Origin C CategoricalMap object. Examples
GetMapType Get the CategoricalMap type. Origin currently supports Ordinal maps in which items are sorted(ordered) alphanumerically. Examples
LookUp Look up a category in this CategoricalMap and return its index. Examples
ReplaceMap Sort this CategoricalMap in user defined order. Examples
ReverseLookUp Reverse look up an index in this CategoricalMap and return its category. Examples