Get data regions that are inside the enclosed graphic object
int GetDataRegions( OriginObject & obj, vector<int> & vBegin, vector<int> & vEnd, vector<int> * pIndeces = NULL, DWORD dwCtrl = 0 )
number of regions found or < 0 for error codes
EX1
// For this example to run, a graph window must exist in the project. // Also, the active layer in the Graph should have a graphic object (such as rectangle) with // the name "Rect" which covers some points void DataPlot_GetDataRegions_ex1() { // Create and attach a graph layer from current Graph: GraphLayer gl = Project.ActiveLayer(); DataPlot dp = gl.DataPlots(0); //get the first dataplot on graphlayer if ( dp ) { GraphObject grobj = gl.GraphObjects("Rect"); vector<int> vBegin; vector<int> vEnd; dp.GetDataRegions(grobj, vBegin, vEnd); for(int nn = 0; nn < vBegin.GetSize(); nn++) { printf("begin: %d, end: %d \n", vBegin[nn], vEnd[nn]); } } }
DataPlot::GetDataPoints
origin.h