[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Fwd: Re: seeking QGraphicsView wisdom
From:       Jason Harris <kstars () 30doradus ! org>
Date:       2006-05-31 13:45:40
Message-ID: 200605310645.40715.kstars () 30doradus ! org
[Download RAW message or body]

On Tuesday 30 May 2006 06:43, Andreas Aardal Hanssen wrote:
> On Monday 29 May 2006 17:29, Thiago Macieira wrote:
> > Wouldn't you just put the transformations into a function that can be
> > subclassed?
>
> GraphicsView operates on cartesian shapes. So unless you can
> find a way to map Qt's rectangles (for rubberband selection),
> painterpaths, ellipses, polygons and so on, to spherical
> coordinates, I'm going to claim the two are different. :-)
>
http://edu.kde.org/kstars/screens/scorpius.png
http://edu.kde.org/kstars/screens/m31.png

As long as the shapes are small compared to the radius of the sphere, you can 
trivially use the local tangent plane to draw these shapes in the normal way.  
If one needed a larger shape that conforms to the sphere, then a custom draw 
function can be easily defined (as seen in the circles of the spherical 
coordinate grid here, which are just a series of connected line segments 
between points along each circle):
http://edu.kde.org/kstars/screens/fullofstars.png

For rubber-banding, you'd just use the screen coordinate system anyway (try 
Ctrl-dragging in KStars, we already use rubber-banding rectangles this way).  
Actually, one could easily implement rubber-banding using a "spherical 
rectangle", but like the coordinate grid, it would be composed of a series of 
connected line segments.

What about my original question: is it possible to have 
toScreen()/fromScreen() functions in QGraphicsView that can be overridden, or 
is that infeasible/slow/morally outrageous/inconsistent with QGV's design ?

thanks,
Jason

-- 
KStars: http://edu.kde.org/kstars
Community Forums: http://kstars.30doradus.org
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic