You have 2 options for how to do any type of point weeding:
- weeding the original points, passing the result as curve points
- weeding points after being translated into paint device coordinates ( setCurveFitter )
2) seems to be what you want to do, but as this is done inside every replot cycle it might slow down your performance - depending on the number of points and the order of the weeding algo heavily. In case of Douglas Peucker I recommend to do 1) depending on QwtScaleWidget::scaleDivChanged signals. It should be possible to define a reasonable level of details to limit how often weeding needs to be done.
But as your real motivation is about creating distances between 2 adjacent points, that is above the length of a dot/dash you could consider writing your own type of fitter using a simpler interpolation algo, that takes specific characteristics of your data into count.
Uwe
Bookmarks