PDA

View Full Version : QwtPolarCurve setData()---help needed



swamyonline
5th August 2008, 09:39
hi,
im not able to set data in QwtPolarCurve. rather, im a little bit confused to use setData function in QwtPolarCurve. in QwtPlot, its easy to set data as there r enough overloading functions to set data. but the only option available in QwtPolarCurve to set data is setData(const QwtData &);. i referred demo example where RoseData and SpiralData curves r drawn. but i am not able to understand QwtData interfacing and not able to apply that derivation for my own derived class.

my requirement is, i want to set my own curve containing set of radius and azimuth values. how can i set data like
myPolarPlotCurve->setData(radius,azimuth). i tried to use QwtData interface, but im not succeeding, rather i am confused to how to assign set of radius and azimuth values.

im putting problem in code form here.


myPolarCurve->setData(MyQwtData(azAngle,radius,numPoints));

where MyQwtData is derived from QwtData.

will u pls suggest how can i derive QwtData class to plot my own set of azimuth and radius values on QwtPolarCurve. pls put sample code, that will be of great help to me.

Uwe
5th August 2008, 20:31
You can use the same type of data classes for a QwtPolarCurve as for a QwtPlotCurve. Look in the Qwt docs which classes derived from QwtData are available. Of course you can also derive your own type of data class, but in most cases you don't need to.

The x-value is the azimuth, the y value repesents the radius.

Uwe

swamyonline
6th August 2008, 08:30
thanks Uwe,

ya, i derived the data class from QwtArrayData. it worked fine. thanks again..
bye