2.2.4.8.20 DataPlot::GetRectPoints


Version

Minimum Origin Version Required: Origin 2016 SR0

Description

Get data points that are inside the enclosed rectangle

Syntax

int GetRectPoints( fpoint & fptTopLeft, fpoint & fptBottomRight, vector & vX, vector & vY, vector<int> * pvnIndices = NULL )

Parameters

fptTopLeft
[input] top-left point of specific retangle
fptBottomRight
[input]bottom-right point of specific retangle
vX
[output] x coordinates of the found points
vY
[output] y coordinates of the found points
pvnIndices
[output] indices of the found points

Return

number of data points found or < 0 for error codes

Examples

EX1

void DataPlot_GetRectPoints_Ex1()
{
    GraphLayer gl = Project.ActiveLayer();
    if(!gl)
        return;
    
    DataPlot dp = gl.DataPlots(0);
    if(!dp)
        return;
    
    double left     = gl.X.From;
    double right    = gl.X.To;
    double top         = gl.Y.To;
    double bottom     = gl.Y.From; 
    
    fpoint fptTL(left,top);
    fpoint fptBR(right,bottom);
    vector<double>    vx, vy;
    vector<int>     vIndex; 
    int nSize = dp.GetRectPoints( fptTL, fptBR, vx, vy, &vIndex );
    if(nSize >= 0)
        printf("data point(s) in view: %d\n", nSize);
}

Remark

See Also

Header to Included

origin.h