Hello,

i am drawing a QwtPlotCurve (curve) with many Samples. When i go with my Mouse over that curve, i use a QwtPlotPicker who plots a QwtPlotMarker (marker_curve) with a QwtSymbol who follows the curve.

My Picker function calls at moved(QPoint):

Qt Code:
  1. void CreateWave::moveSymbolOnCurve(QPoint point)
  2. {
  3. double x = curve->closestPoint(point, NULL);
  4. marker_curve->setValue(x,curve->sample(x).y());
  5. plot->replot();
  6. }
To copy to clipboard, switch view to plain text mode 

This works well. As long as the Samples are not much (<500 000). But some curves i draw have Samples ~10 000 000. When the samples are over 500 000 and i move my cursor over the plot, the drawn markers are delayed and its lagging pretty hard.
The reason i guess is because closestPoint() and replot() take much time then.

So i thought about to reduce the drawn samples with QwtWeedingCurveFitter. This worked and the drawn curve has less points, but the closesPoint() and replot() (as well as curve->sample(x).y())) uses all Samples so the performance is not better at all.
Is there a posibility to draw the curve with a maximum amount of samples on which i can use closestpoint(), but when i zoom in, the amount of samples in that zoom should redraw to the same amount, so i can catch details?