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
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
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
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
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
Bookmarks