The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Remove red data selection circles
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

michaelbraun

USA
21 Posts

Posted - 07/15/2015 :  11:22:03 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.

Edited by - michaelbraun on 07/15/2015 11:23:54 AM

cdrozdowski111

USA
247 Posts

Posted - 07/15/2015 :  12:58:03 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Michael,

Try adding the following two lines to the very end of your Test_code() function:

gp.Refresh();
out_str("GraphPage Obj Refreshed"); // Debug


you wan to refresh your entire page not layer.
Go to Top of Page

michaelbraun

USA
21 Posts

Posted - 07/15/2015 :  2:03:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ahhh, yes I missed that thank you, it worked.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000