Results 1 to 4 of 4

Thread: Convert QwtRasterData to QwtSeriesData

  1. #1
    Join Date
    Sep 2007
    Posts
    61
    Thanks
    5
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Convert QwtRasterData to QwtSeriesData

    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

  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: Convert QwtRasterData to QwtSeriesData

    No and the question doesn´t make much sense. QwtRasterData represents values of a rectangle - a series is a series of points.

    Uwe

  3. #3
    Join Date
    Sep 2007
    Posts
    61
    Thanks
    5
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Convert QwtRasterData to QwtSeriesData

    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

  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: Convert QwtRasterData to QwtSeriesData

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

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.