Results 1 to 6 of 6

Thread: How to draw curve between two points in qwt polar?

  1. #1
    Join Date
    Jun 2008
    Posts
    18
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default How to draw curve between two points in qwt polar?

    setting QwtPolarCurve::setStyle() to line gives me the plot showing in attached file line.gif, anybody knows how to draw curve between two points, like the plot in attached file curve.gif?

    Thank you.
    Attached Images Attached Images

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

    Default Re: How to draw curve between two points in qwt polar?

    The code that is responsible for painting the connection lines is in QwtPolarCurve::drawLines(). You can overload and replace it in your derived class.

    If you know a algo how to calculate "rounded" connection please send it ( or the code ) to me.

    Uwe

  3. #3
    Join Date
    Sep 2008
    Posts
    15

    Default Re: How to draw curve between two points in qwt polar?

    Uwe -

    We do have some code in an old, Motif-based executable as well as an old, Openlook-based executable that does "linear" interpolation on a polar scale (which results in the "rounded connection" between points). Once we locate the source for it, we'll be happy to send it to you to include in QWT.

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

    Default Re: How to draw curve between two points in qwt polar?

    Please do so.

    Uwe

  5. #5
    Join Date
    Sep 2008
    Posts
    15

    Default Re: How to draw curve between two points in qwt polar?

    After some investigation of the legacy code we have, we determined that the solution done in the past was simply to interpolate the original set of data (in rectangular coordinates) and create a uniform data set of 700 points. Then we plot those 700 points in polar form and it makes the plot display with the appropriate "smoothed-out" curves.

    We implemented this in our new code with QWT and it is an acceptable solution.

    Unfortunately, we don't have a more elegant algorithm for this Uwe.

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

    Default Re: How to draw curve between two points in qwt polar?

    In the meantime I have added a new class QwtPolarFitter, that also simply adds a couple of equidistant points, that makes the lines "rounded". But QwtPolarCurve also allows to add more advanved algorithms by implementing an individual fitter object.

    Available from SVN ( which is very close to QwtPolar 0.0.3 )

    Uwe

Similar Threads

  1. Want to draw Curve
    By santhoshv84 in forum Qt Programming
    Replies: 1
    Last Post: 12th September 2008, 08:14
  2. want to draw points in QGraphicsScene
    By ntp in forum Qt Programming
    Replies: 2
    Last Post: 10th April 2008, 19:14

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.