Origin Ver. and Service Release (Select Help-->About Origin): Origin 2015 sr2
Operating System:Windows
I used GetGraphPoints to select a number of points, however the red circles that show each selection point remain after my code has finished. They do not appear while printing, but I would like to not have them showing at all when the code finishes. Here is the relevant section of code:
class MyGetGraphPoints : public GetGraphPoints
{
virtual void OnStart()
{
out_str("Pick points");
}
virtual void OnFinish()
{
out_str("Done");
}
virtual void OnNewPoint(int nPoint)
{
out_int("You have sucessfully selected point ",nPoint+1);
}
virtual void OnDisplay(string& str, int nPoint)
{
if( nPoint >=0 && !str.IsEmpty() )
{
str += "\nHello"; // Hello display on the second line in Data Display bar
}
}
virtual void OnCancel()
{
out_str("You cancelled the operation");
}
};
void Test_code()
{
GraphPage gp;
gp.Create("Line"); // create a graph using the Line template
GraphLayer gl = Project.ActiveLayer();
//Plots the line
Curve crv(wks, 0, 1);
int nPlot = gl.AddPlot(crv, IDM_PLOT_LINE);
DataPlot dp = gl.DataPlots(nPlot);
int nNumPoints = 100; //arbitrary high number so that user can pick exact number of points on graph, then hit esc to continue
MyGetGraphPoints sp;
sp.SetFollowData(true, nPlot);
sp.GetPoints(nNumPoints, gl);
vector xData, yData;
vector<int> vnIndices;
sp.GetData(xData, yData, vnIndices);
out_str("You have selected the following points:");
for(int ii = 0; ii < xData.GetSize(); ii++)
{
printf("Point %d: X=%f, Y=%f\n", ii+1, xData[ii], yData[ii]);
}
}
I have tried adding lines such as gl.Update; gl.Refresh; but can not get the red selection circles to disappear.