DataPlot::GetGroupPlot

 

Description

Get group plot from data plot -- TEST

Syntax

GroupPlot GetGroupPlot( int * pnIndex = NULL )

Parameters

pnIndex
[output] optional pointer of index of dataplot in the group plot

Return

Group plot object, NULL if dataplot is not groupped. This is a temporary object and should not be stored.

Typical usage is on stack to get/set group plot theme. See example below.

Examples

EX1

void    get_active_plot_format()
{
    GraphLayer gl = Project.ActiveLayer();
    if( gl )
    {
        DataPlot dp = gl.DataPlots();
        if( dp )
        {
            GroupPlot gp = dp.GetGroupPlot();
            Tree trFmt;
            if( gp )
                trFmt = gp.GetFormat(FPB_ALL, FOB_ALL, TRUE, TRUE);
            else
                trFmt = dp.GetFormat(FPB_ALL, FOB_ALL, TRUE, TRUE);
            out_tree(trFmt);
        }
    }
}

EX2 This example shows how to find out if a plot group is incrementing edge/line color

bool is_active_group_plot_property_incremented(int nIndex = OEGI_COLOR)
{
        GraphLayer gl = Project.ActiveLayer();
        if(!gl)
                return false;
        DataPlot dp = gl.DataPlots(0);
        if(!dp)
                return false;
        GroupPlot gp = dp.GetGroupPlot();
        if(!gp)
                return false;
        Tree tr;
        tr = gp.GetFormat(FPB_ALL, FOB_ALL, TRUE, TRUE);
        if(!tr || !tr.Root)
                return false;
        TreeNode trIncrement = tr.Root.Increment;
        if(!tr.Root.Increment)
                return false;
        TreeNode trStretch = trIncrement.Stretch;
        if(!trStretch)
                return false;
        vector<int> props;
        props = trStretch.nVals;
        if(nIndex >= props.GetSize())
                return false;
        if(props[nIndex] == ISM_NONE)
                return false;
        return true;
}

void test()
{
        if(is_active_group_plot_property_incremented())
                out_str("yes");
        else
                out_str("no");
}

Remark

See Also

Header to Included

origin.h