Hi all,
QwtSeriesData<QPointF>* coordinates = new FunctionData(::sin);
QwtSeriesData<QPointF>* coordinates = new FunctionData(::sin);
To copy to clipboard, switch view to plain text mode
Considering the line above, I have a question on how to read the values from the QwtSeriesData<QPointF> object. The code I am dealing with accept both constructions below, but the second one is preferable.
MyPlotCurve *sinCurve = guiComVisGraf->createCurve("Seno", coordinates );
MyPlotCurve *sinCurve = guiComVisGraf->createCurve("Seno", size, x, y);
MyPlotCurve *sinCurve = guiComVisGraf->createCurve("Seno", coordinates );
MyPlotCurve *sinCurve = guiComVisGraf->createCurve("Seno", size, x, y);
To copy to clipboard, switch view to plain text mode
So I am trying this
int size = coordinates->size();
double *x = new double[size];
double *y = new double[size];
for(int i = 0; i < size; i++){
x[i] = coordinates->sample(i).x();
y[i] = coordinates->sample(i).y();
}
MyPlotCurve *sinCurve = guiComVisGraf->createCurve("Seno", size, x, y);
int size = coordinates->size();
double *x = new double[size];
double *y = new double[size];
for(int i = 0; i < size; i++){
x[i] = coordinates->sample(i).x();
y[i] = coordinates->sample(i).y();
}
MyPlotCurve *sinCurve = guiComVisGraf->createCurve("Seno", size, x, y);
To copy to clipboard, switch view to plain text mode
This way I am reading "0" for all "i". There is probably a neat misunderstanding in my code, I would like to ask for help in find it. Thanks in advance.
Bookmarks