Is there a way to bridge a QwtRasterData to a QwtSeriesData so that I can make a QwtPlotCurve from the values of a QwtRasterData object?
Thanks,
Joey
Is there a way to bridge a QwtRasterData to a QwtSeriesData so that I can make a QwtPlotCurve from the values of a QwtRasterData object?
Thanks,
Joey
No and the question doesn´t make much sense. QwtRasterData represents values of a rectangle - a series is a series of points.
Uwe
Let me try again then.
What I want to do is create a "slice" into a spectrogram which is basically constructing a QwtSeriesData from the contents of the spectrogram. In the mailing list, your advice was as follows:
>> The X axis of the line plot is the Y axis of the spectrogram
>> plot. The Y axis of the line plot is based on the color value of the
>> spectrogram plot.
> I would derive a QwtData class, that sits on the same data as the
> QwtRasterData of the spectrogram.
Now that QwtData is gone, I was trying to use QwtSeriesData. The data already exists as a series of spectrogram so now I am trying to convert the X, Y, and colors array to something from which I can plot a line.
Does that make more sense? Ideally, I like it generic to where either the X, Y, or colors array could be the any of the X/Y of my line plot.
Thanks for any advice!
Joey
Qwt 5.2 offers curve items for displaying series of 2D points. Unfortunately you have to reimplement much of its code (or do a lot behind its back) if you want to display different types of samples. That's why I shifted the code that doesn't depend on the type of the samples into QwtSeriesData/QwtPlotSeriesItem.
What you need to do is:
a) Implement a class for a 3D point
b) Implement QwtSeriesData<Your3DPoint> on top of your array.
c) Implement QwtPlotSeriesItem<Your3DPoint>
In c) you need to introduce a setter/getter for a QwtColorMap. Then implement QwtPlotSeriesItem<Your3DPoint>::drawSeries(...) using the color map. ( Look at the implementation of QwtPlotCurve::drawSeries ).
Such an implementation is on my TODO list planned for 5.3 - but I'm not 100% sure if it will be 5.3 or a later release.
Uwe
Bookmarks