5 Attachment(s)
Dense Qwt curves with dotted or dashed line style generally look solid.
Curves with many points plotted with a Dotted or Dashed line style display as SOLID lines (not dotted or dashed) at normal zoom levels. We're using Qwt 6.1.3 and Qt 5.5.1 on Windows.
One thing I thought to try was turning ON the "FilterPoints" PaintAttribute on the QwtPlotCurves. But I found that these curves already had it on (by default). (And turning it off didn't fix the problem).
The images below show one "Step" curve and one "Line" curve with many points. This sequence of seven images progressively zooms in. Point symbols are turned on half-way through to show the density of the series data.
Is there any way of having the Dotted and Dashed line styles work for dense curve data?
See this webpage, or some attached images below.
http://cadswes2.colorado.edu/~philw/...robImages.html
Attachment 12427 Attachment 12428 Attachment 12429
Attachment 12430 Attachment 12431
Re: Dense Qwt curves with dotted or dashed line style generally look solid.
Quote:
Originally Posted by
philw
Curves with many points plotted with a Dotted or Dashed line style display as SOLID lines (not dotted or dashed) at normal zoom levels. We're using Qwt 6.1.3 and Qt 5.5.1 on Windows.
If your points are closer than the widths of the dashes/dots it is like this - that's how QPainter works.
So what you need is a curve interpolation, that weeds out points. In general QwtWeedingCurveFitter offers such an algo ( Douglas-Peucker ), but is an expensive one and should better be used in advance outside of the replot cycle, when having many points.
Uwe
Re: Dense Qwt curves with dotted or dashed line style generally look solid.
Uwe, thanks so much again. Yeah, we can do that sort of thing.
I guess there'd be a tradeoff on pen style (pattern) effectiveness and curve "precision". Is the idea that points shouldn't be closer together than the length of one "period" of the pen style (pattern), given the pen width? (Might that be excessively coarse, in terms of the actual path of the curve?).
In any case ... I'd like to give it a try ...
We'd skip use of the QwtWeedingCurveFitter if the pen style is solid, or if, I guess, point symbols are shown. And we'd use caching to avoid redundant use of the fitter.
I am confused about a couple things ...
Is it valid (or good enough) to use the fitter in the application (axis) coordinates (units)? Or do you recommend going to the trouble of giving the series to QwtWeedingCurveFitter in screen (pixel) coordinates, and then convert the returned series back out to application coordinates before giving it to the QwtPlotCurve (via setSamples()). (I think I'm understanding this correctly, is there a better way?).
If that application/pixel unit conversion is prudent for the fitter, what's the best way to do that? -- translate series values to and from pixel coordinates? (given the X and Y axes associated with a curve).
Do you have any guidance for how to compute a workable QwtWeedingCurveFitter "tolerance" value? (That would depend on the above, I imagine). (If we DO convert to pixel coordinates for the fitting, would the tolerance be based on the length of one period of the pen pattern, given the pen width?).
That was a lot.
Thanks again.
- Phil
Added after 38 minutes:
P.S. I hadn't understood that the Fitter is installed on QwtPlotCurve ...
void QwtPlotCurve::setCurveFitter (QwtCurveFitter*)
http://qwt.sourceforge.net/class_qwt...0de501b4dd7957
... and it IS given widget (pixel) coordinates.
I still have yet to understand how to devise / compute the QwtWeedingCurveFitter "tolerance" value. And now it's unclear to me how to do the caching, or whatever we need to do to "throttle" the fitter computation.