Results 1 to 3 of 3

Thread: Dense Qwt curves with dotted or dashed line style generally look solid.

  1. #1
    Join Date
    Jun 2008
    Location
    Boulder, Colorado, USA
    Posts
    70
    Thanks
    16
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default 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

    DenseTestThreeSmall.gif DenseTestThree_01.png DenseTestThree_03.png
    DenseTestThree_04.png DenseTestThree_06.png

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,311
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Dense Qwt curves with dotted or dashed line style generally look solid.

    Quote Originally Posted by philw View Post
    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

  3. #3
    Join Date
    Jun 2008
    Location
    Boulder, Colorado, USA
    Posts
    70
    Thanks
    16
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default 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.
    Last edited by philw; 6th April 2017 at 09:43.

Similar Threads

  1. Replies: 0
    Last Post: 22nd September 2016, 19:17
  2. Replies: 0
    Last Post: 17th November 2015, 12:04
  3. Doubt with dotted line
    By cesroc in forum Qwt
    Replies: 2
    Last Post: 5th March 2012, 08:30
  4. problem with QGraphicsTextItem's black dotted line.
    By jonike in forum Qt Programming
    Replies: 1
    Last Post: 14th August 2011, 18:27
  5. Why there are always dashed-line rectangle on QToolButton?
    By FinderCheng in forum Qt Programming
    Replies: 5
    Last Post: 24th October 2009, 23:56

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.