I’ve programmed a simulation, which solves a few equations and draws the result in an OpenGL window. The simulation evolves with time continuously. I would like to add points dynamically. I’m using some code like the following:
QwtPlot* plot = new...;
QwtPlotCurve* plotdata = new...;
QVector<QPoint> data = getData();
plotdata->setSamples(data);
This gets the plot to reset all the points. Can I just simply add points?
Thanks for any efforts 🙂
If there’s no way ever to do it, I’d love to hear that. Just tell me, please!
I got it. There’s no way to do it in that abstract way. But one could recall the method:
with a replot(), and this would be the cheapest way to do it. It doesn’t involve any data copying.
Cheers 🙂