Alexei V. Mezin | 21 Aug 18:12
Favicon

Smooth plot resize?


I use QwtRasterData/QwtPlotSpectrogram to draw color maps with rather 
small resolution (about 256x256 data points). But plot widget sometimes 
is bigger than 256x256 and image is (automatically) resized and looks 
"pixelized". Is it a "nearest neighbor" resize algorithm? How to 
optionally change that algorithm to smooth one?

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
David Stranz | 21 Aug 18:28

RE: Smooth plot resize?

Hello Alexei,

You probably need to derive a new class from QwtRasterData that
uses bilinear interpolation (see Wikipedia) to give an interpolated
z value for every (x,y) point.

Override QwtRasterData::value() to perform the interpolation.

This question has been asked several times recently - search
the archives for code.

Regards,

David

_______________________________________________________________
David Stranz, Ph.D.	david_stranz <at> MassSpec.com

Sierra Analytics, Inc.
5815 Stoddard Road, Suite 601
Modesto, CA  95356

Tel: (209) 545-8508
http://www.massspec.com
_______________________________________________________________

> -----Original Message-----
> From: qwt-interest-bounces <at> lists.sourceforge.net 
> [mailto:qwt-interest-bounces <at> lists.sourceforge.net] On Behalf 
> Of Alexei V. Mezin
(Continue reading)

Uwe Rathmann | 21 Aug 18:31

Re: Smooth plot resize?

On Thursday 21 August 2008 18:14, Alexei V. Mezin wrote:

> Is it a "nearest neighbor" resize algorithm?

Look into your implementation of YourRasterData::value() to see, what type of 
resampling you did.

> How to optionally change that algorithm to smooth one?

Reimplement YourRasterData::value(). Maybe google for the terms "resampling + 
GIS" to find some common algos.

Uwe

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Alexei V. Mezin | 21 Aug 19:55
Favicon

Re: Smooth plot resize?

Uwe Rathmann пишет:
> On Thursday 21 August 2008 18:14, Alexei V. Mezin wrote:
> 
>> Is it a "nearest neighbor" resize algorithm?
> 
> Look into your implementation of YourRasterData::value() to see, what type of 
> resampling you did.
Ok, thnx, I got your idea. I just thought that plot resize (not zoom) 
was implemented through QImage resize methods (antialiased, OpenGL 
accelerated etc.). At least it is reasonable for fixed data set.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qwt-interest mailing list
qwt-interest <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qwt-interest
Darryl Wallace | 25 Aug 22:44
Favicon

Qwt plot in Model/View/Delegate

Just a quick question.  Has anyone implemented a Qwt plot in the 
Model/View/Delegate framework?  I am just about to start on this and was 
wondering if anyone had any tips or examples.

Thanks,
Darryl

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Uwe Rathmann | 26 Aug 00:34

Re: Qwt plot in Model/View/Delegate

On Monday 25 August 2008 22:44, Darryl Wallace wrote:

> Just a quick question.  Has anyone implemented a Qwt plot in the
> Model/View/Delegate framework?

QwtPlot has its own framework. You can compare QwtPlot with the View and 
QAbstractModel with QwtData/QwtRasterData/... . Under the aspect of the 
visualization of data/model you can also compare QwtPlotItem and the 
delegates.

But the only useful connection between both frameworks I can see are the 
model/data objects, so that you could share your values ( f.e. between a 
table widget and a curve. ). Therefore you have to implement a QwtData API on 
top of your model - or if possible on the data behind the model. Of course 
you can also implement a model on top of a QwtData object.

Uwe

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Darryl Wallace | 26 Aug 14:31
Favicon

Re: Qwt plot in Model/View/Delegate

Thanks for the tip.  I'll see what I can come up with.

darryl

Uwe Rathmann wrote:
> On Monday 25 August 2008 22:44, Darryl Wallace wrote:
>
>   
>> Just a quick question.  Has anyone implemented a Qwt plot in the
>> Model/View/Delegate framework?
>>     
>
> QwtPlot has its own framework. You can compare QwtPlot with the View and 
> QAbstractModel with QwtData/QwtRasterData/... . Under the aspect of the 
> visualization of data/model you can also compare QwtPlotItem and the 
> delegates.
>
> But the only useful connection between both frameworks I can see are the 
> model/data objects, so that you could share your values ( f.e. between a 
> table widget and a curve. ). Therefore you have to implement a QwtData API on 
> top of your model - or if possible on the data behind the model. Of course 
> you can also implement a model on top of a QwtData object.
>
> Uwe
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
(Continue reading)

Darryl Wallace | 8 Oct 17:48
Favicon

Re: Qwt plot in Model/View/Delegate

I've thought about this a bit more and I think I'm kind of stuck with 
more of the big picture.

Basically what i want to do is an MDI type of interface where a table of 
data can be displayed along side a plot of the same data.  If the user 
selects a row in the data table, for example, the data points 
corresponding to that row will be highlighted in the plot (and vice 
versa). 

I've implemented  a method for selecting data points on a plot with a 
rubber band, but would I would like is for a selection to be translated 
to all other views of the same data.

My big problem is how to start the interaction between the model/view 
with the qwtdata.  Any further insight to this would be greatly 
appreciated.  You'll have to forgive me as I am a novice with the 
model/view style.

Thanks,
Darryl

> Uwe Rathmann wrote:
>   
>> On Monday 25 August 2008 22:44, Darryl Wallace wrote:
>>
>>   
>>     
>>> Just a quick question.  Has anyone implemented a Qwt plot in the
>>> Model/View/Delegate framework?
>>>     
(Continue reading)

Uwe Rathmann | 8 Oct 22:55

Re: Qwt plot in Model/View/Delegate

On Wednesday 08 October 2008 17:48, Darryl Wallace wrote:

> Basically what i want to do is an MDI type of interface where a table of
> data can be displayed along side a plot of the same data.  If the user
> selects a row in the data table, for example, the data points
> corresponding to that row will be highlighted in the plot (and vice
> versa).

QwtPlotCurve has no concept of selecting/highlighting. 

So first you have to think about how to implement this. If you display your 
curve with symbols only you could split your points into 2 curves with 
different symbols. If not you have to overwrite QwtPlotCurve::drawSymbols and 
paint the symbols with different colors.

QwtData also has no concept of selected points. So you have to look into the 
model to see which points are selected.

Uwe

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

Gmane