Originally Posted by
lwz
If one curve's about 300,000 samples, with 3,4 curves in a plot ...
There are several ways how to improve the performance for drawing of a curve, but before going into details you should have an idea about what is consuming the time in your plot. So try the following:
{
....
virtual void drawSeries
( QPainter *painter,
const QRectF &canvasRect,
int from,
int to
) const {
QElapsedTimer timer;
timer.start();
QwtPlotCurve::drawSeries( painter, xMap, yMap, canvasRect, from, to
);
qDebug() << "Elapsed: #" << to - from << timer.elapsed();
}
};
class YourCurve: public QwtPlotCurve
{
....
virtual void drawSeries( QPainter *painter,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRectF &canvasRect, int from, int to ) const
{
QElapsedTimer timer;
timer.start();
QwtPlotCurve::drawSeries( painter, xMap, yMap, canvasRect, from, to );
qDebug() << "Elapsed: #" << to - from << timer.elapsed();
}
};
To copy to clipboard, switch view to plain text mode
Then:
- disable antialiasing
- set "no symbols"
- use a curve line width of 0
Now you will know if rendering of the curves is the main factor of the time used in a replot cycle.
Uwe
Bookmarks