The next neighbor is the point with the shortest distance to QPointF(x, y) in the 2D plane. Of course you could also return a value that is calculated from the z value from all neighbors ( this is the interpolation you are missing ). You can use initRaster/discardRaster to set up some sort of temporary matrix to improve the performance of your interpolation.>1) double QwtRasterData::value(double x, double y)
>Here you have to calculate (f.e next neighbor) the value for a position from the values of >your raster data. The implementation needs to be fast !
What is the next neighbor in this case? Any pointer here?
QwtRasterData ( and all code you have to deal with ) has nothing to do with widget coordinates or any indices for a matrix, where you might have stored your values. All coordinates, rects, sizes are about the coordinate system of the real world ( = what you see on the scales ) !>4) QSize QwtRasterData::rasterHint(const QwtDoubleRect &)
>5) QwtRasterData::setBoundingRect
I am confused between these two. Aren't they the same and pointed to the size of the display, like 600x400, or whatever the size of the QtWidget used to display the contour map?
F.e if you have elevation data of Berlin the bounding rect would be the area of Berlin in geographical coordinates. If the resolution of your elevation data is a value for each 10x10 m you would have to translate this size corresponding to geographical coordinates and return it as raster hint ( better might be to return 5x5 to avoid rounding problems ).
Uwe




Reply With Quote
Bookmarks