Uwe Rathmann | 17 Apr 10:26

Re: Help with understanding QwtRasterData needed

On Thursday 17 April 2008 09:47, Matthias Pospiech wrote:

> It however requires to set the Range of the Data bevor setting the data
> which is not nice in term of the implementation.

Qwt has no setRange(). It is all your design and if you don't like something: 
change it.

The range should be related to your type of data - not to a specific set of 
samples. F.e. if you want to display temperature you might have a color map 
from blue to red, and a range from 0 to 100. 

Nice or not: it's not possible to map a value into a color, when the colors 
are related to nothing.

> I however still have the problem that the axis do not match the Data
> size (goes from -0.6 to 0.6 instead of 0-1024) and therefore no data is
> displayed since the value of alwyas 0.

In case of autoscaling the scales are calculated from the boundingRect. 
The values itsself have no meaning for the axes.

> It is defined as
>     void initRaster(const QwtDoubleRect &, const QSize &
> but I have no idea what I should do. 

If your array is already prepared for the following value() requests, then do 
nothing and don't reimplement this method.

> > d) YourRasterData::discardRaster()
> >
> > The item tells the data object, that the rendering of the image is
> > complete. So you can do some cleanups here.
>
> How do I know when the image is complete?

When discardRaster is called. But if you don't need initRaster() I guess you 
don't need this hook too. 

> I however do not know what the parameter QwtDoubleRect contains.
> Is it the real position of the data (in the coordinates of the data) ?

This is is an area in data coordinates. rasterHint() is always called for the 
area, that is currently displayed on the canvas, before the image is 
rendered. F.e. when you zoom in the area will be a subset of your bounding 
rect.

Uwe

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

Gmane