I'm finding, and seeing in Qwt 6.1.3 code, that the QPolygonF QwtCurveFitter::fitCurve(const QPolygonF&) const virtual method is being called only for QwtPlotCurves having the QwtPlotCurve::Lines curve style, and not for the QwtPlotCurve::Steps curve style.

I am seeing a call to fitCurve() in QwtPlotCurve::drawLines (QPainter* ..), but not in QwtPlotCurve::drawSteps (QPainter* ..).

I believe QwtWeedingCurveFitter would work for us in the Steps style, and we do kinda need it. Is there a fundamental reason why the algorithm ("Douglas and Peucker") or this implementation would be fundamentally unworkable for stepped curves?

If I'm seeing this correctly, I think we would have to modify QwtPlotCurve::drawSteps (QPainter* ..) to try this. Yes? But I'm wondering if that's an entirely arithmetically foolish thing to even be trying.

-----

FWIW ... I created a QwtWeedingCurveFitter subclass to do some of our own caching of the QwtWeedingCurveFitter results (also to dynamically track instance life-cycle) -- though I'm finding cache hits to not be especially successful, for apparent reasons.

Qt Code:
  1. class WeedFitter : public QwtWeedingCurveFitter
  2. {
  3. private:
  4. static int _instanceCnt;
  5. const int _instanceNum;
  6.  
  7. QwtPlotCurve* _clientCurve;
  8. mutable QPolygonF _cachedInpPoints;
  9. mutable QPolygonF _cachedFiltPoints;
  10.  
  11. public:
  12. WeedFitter (QwtPlotCurve* clientCurve);
  13. virtual ~WeedFitter();
  14.  
  15. // virtual from QwtWeedingCurveFitter
  16. virtual QPolygonF fitCurve (const QPolygonF&) const override;
  17. };
To copy to clipboard, switch view to plain text mode 
This is coming up in my attempt to address the problem described in this other post ... http://www.qtcentre.org/threads/68094 ("Dense Qwt curves with dotted or dashed line style generally look solid").