The following code will show you how, but I notice a problem. After the correct integration, this line
crvMyCurve.SetLowerBound(save_i1);
is not restoring the plot lower bound to the original, looks like a bug.
CP
void integ_all(int i1 = 0, int i2 = -1)
{
GraphLayer gl = Project.ActiveLayer();
if(!gl)
return;
printf("Plot\tName\tArea\n");
int nPlot = 1;
int save_i1, save_i2;
foreach(DataPlot dp in gl.DataPlots)
{
Curve crvMyCurve(dp);
if(i2 > i1)
{
save_i1 = crvMyCurve.GetLowerBound();
save_i2 = crvMyCurve.GetUpperBound();
crvMyCurve.SetLowerBound(i1);
crvMyCurve.SetUpperBound(i2);
}
IntegrationResult irMyResults; // Origin C structure to store integration results
Curve_integrate( &crvMyCurve, &irMyResults); // Perform integration
printf("%d\t%s\t%f\n", nPlot++, crvMyCurve.GetName(), irMyResults.Area );
if(i2 > i1)
{
crvMyCurve.SetLowerBound(save_i1);
crvMyCurve.SetUpperBound(save_i2);
}
}
}