Results 1 to 8 of 8

Thread: QwtContouring question

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QwtContouring question

    how can I get the data value at a given (X, Y) point in QwtRasterData? This (x, Y) may not be one of the points in QwtRasterData value( x, y ) interface...In another word, is it possible to do cursor tracking on QwtRasterData?

    Thanks

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

    Default Re: QwtContouring question

    QwtRasterData::value(...) returns a value for all x/y positions inside the bounding rectangle. This is how it is defined - otherwise your implementation is insufficient.

    A QwtRasterData object that sits on a 2 dimensional array always has to do an internal resampling ( in most cases simply next neighbour ) because the pixel positions never meet the raster.

    Uwe

  3. #3
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QwtContouring question

    Quote Originally Posted by Uwe View Post
    QwtRasterData::value(...) returns a value for all x/y positions inside the bounding rectangle. This is how it is defined - otherwise your implementation is insufficient.

    A QwtRasterData object that sits on a 2 dimensional array always has to do an internal resampling ( in most cases simply next neighbour ) because the pixel positions never meet the raster.

    Uwe
    Hmmm, I lost my reply made yesterday...

    From your internal resampling data, can I get back your resampled value at location (x, y)? If so, how?

    Thanks

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

    Default Re: QwtContouring question

    The scaleMaps ( QwtPlot::canvasMap() ) translate between pixel and plot coordinates. If you use a QwtPlotPicker (overload QwtPlotPicker::trackerText() ) the picker does the translation for you.

    Uwe

  5. #5
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QwtContouring question

    Quote Originally Posted by Uwe View Post
    The scaleMaps ( QwtPlot::canvasMap() ) translate between pixel and plot coordinates. If you use a QwtPlotPicker (overload QwtPlotPicker::trackerText() ) the picker does the translation for you.

    Uwe
    I don't need the coordinate, I need the value at the coordinate. That said, I give you the coordinate, and I need the contour or raster data value at that coordinate. Can that be done?

    Thanks.

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

    Default Re: QwtContouring question

    Quote Originally Posted by lni View Post
    That said, I give you the coordinate, and I need the contour or raster data value at that coordinate.
    This is QwtRasterData::value(double, double).

    Uwe

  7. #7
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QwtContouring question

    Quote Originally Posted by Uwe View Post
    This is QwtRasterData::value(double, double).

    Uwe
    What I want to know is if you can return me the sampled value at location not in value(x, y), value( x, y) is what I give to you so there is no reason for me to ask for that.

    I want to know if you can give me value( x + dx, y + dy )...thanks

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

    Default Re: QwtContouring question

    Quote Originally Posted by lni View Post
    I want to know if you can give me value( x + dx, y + dy )
    Qwt has no samples at all. It can't give you no value at no position. The only one who knows them is your implementation of QwtRasterData. What's so hard with accepting this ?

    What Qwt knows is the coordinate system and how to translate it to pixel positions. I don't know what dx/dy is supposed to be, but maybe this is what your question is about ?

    Uwe

Similar Threads

  1. Plugin implementation question
    By JPNaude in forum Qt Programming
    Replies: 12
    Last Post: 27th August 2008, 20:24
  2. SQL Question
    By ^NyAw^ in forum Qt Programming
    Replies: 5
    Last Post: 8th April 2008, 19:36
  3. Access to QSqlTableModel::isDirty Question.
    By patrik08 in forum Qt Programming
    Replies: 3
    Last Post: 12th April 2007, 17:49
  4. QThread exit()/quit() question
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 28th August 2006, 14:38

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
  •  
Qt is a trademark of The Qt Company.