Find data points inside polygon enclosed by vX, vY, only supported by single XYRange.
int GetIndices( vector<int> & vIndicies, const vector & vX, const vector & vY )
Return the size of vIndices.
//Find data polygon enclosed by vX and vY. void DataRange_GetIndices_Ex1() { //assume the active workbooka sheet and has least two columns before run this code. Worksheet wks = Project.ActiveLayer(); if ( !wks ) { printf("Can not find any active worksheet!"); return; } DataRange dr; dr.Create();//init the object dr.Add("X", wks, 0, 0, -1, 0); dr.Add("Y", wks, 0, 1, -1, 1); vector vX, vY; vX.Uniform(20, 1);//generate random data vY.Uniform(20, 4); vector<int> vIndices; dr.GetIndices(vIndices, vX, vY); return; }
origin.h