PDA

View Full Version : How to draw curve between two points in qwt polar?



qmonkey
25th September 2008, 20:21
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.

Uwe
26th September 2008, 07:55
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

ike
29th September 2008, 16:46
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.

Uwe
30th September 2008, 00:24
Please do so.

Uwe

ike
9th October 2008, 18:31
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.

Uwe
10th October 2008, 07:44
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