From: Adrian F. <fe...@ma...> - 2001-09-28 16:00:07
|
On Fri, 28 Sep 2001, Conrad Steenberg wrote: > On Wed, 26 Sep 2001, Adrian Feiguin wrote: > > > Hi, > > I've been quite for a while, but I was actually working hard on new > > developments: > > I added a new functionality to gtkplotdata, you can create a > > gtk_plot_data_iterator, which basically has a callback that retrieves the > > values of the datapoints. > > typedef void (*GtkPlotIterator) (GtkPlot *plot, > > GtkPlotData *data, > > gint iter, > > gdouble *x, > > gdouble *y, > > gdouble *z, > > gdouble *a, > > gdouble *dx, > > gdouble *dy, > > gdouble *dz, > > gdouble *da, > > gchar **label, > > gboolean *error); > > > > I changed the model in SG to use this new feature as follows: the > > datasets don't store the points internally anymore: they read directly > > from the worksheet every time they are refreshed (I added a "Refresh" > > button in the plot window). This saves a lot of memory, and you don't need > > to save the datasets points in the files. > > > > On the other hand, when you create a dataset, this is kept in an internal > > list and shared by all the layers/plots. When you add a dataset to a given > > layer, you are actually adding a CLONE of it, generated using > > sg_dataset_clone. The clone is linked to the original dataset using > > data->real_data->link. The original dataset is linked to itself. the clone > > can have its own attributes (symbol, lines, legends) independently of the > > parent. > > Just a quick question: so to get the data, I do: > > my_iterator=(GtkPlotIterator*)data->real_data->link; > my_iterator(myplot,myplot_data,??,&x,&y,&z,&a,&dx,&dy,&dz,&da,&labels,&error); > > Where do I get the iter parameter? > > Cheers! > > Conrad No , it's like this: iterator = (GtkPlotIterator *)data->real_data->iterator. Anyway, the right way is downloading the latest CVS, and using gtk_plot_data_get_point(dataset->real_data, point_i, &x, &y, ...); Where point_i goes from 0 to data->real_data->num_points-1. Does it help? Saludos, <ADRIAN> |