2.2.3.2 CategoricalMap


Contents

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

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
Sort the CategoricalMap in ascending order.
Sort the CategoricalMap in descending order..
Default constructor to create an Origin C CategoricalMap object.
Get the CategoricalMap type. Origin currently supports Ordinal maps in which items are sorted(ordered) alphanumerically.
Look up a category in this CategoricalMap and return its index.
Sort this CategoricalMap in user defined order.
Reverse look up an index in this CategoricalMap and return its category.