[Marble-devel] Re: Draw a lon/lat rectangle

Torsten Rahn tackat at t-online.de
Tue Jun 7 23:08:53 CEST 2011


If it's just about drawing the rectangle alone (but not the image) then you 
can just use

void GeoPainter::drawRect ( const GeoDataCoordinates & centerPosition,
                    qreal width, qreal height,
                    bool isGeoProjected = false )

and do it just like in the test render plugin (located in 
marble/src/plugins/render/test):

    GeoDataCoordinates rectCenter( -45.0, 20.0, 0.0, 
GeoDataCoordinates::Degree );
    painter->drawRect( rectCenter, 20.0, 20.0, true ); 

Note that the "true" is needed in order to let the rectangle follow the 
ground! ! !

Best Regards,
Torsten



On Tuesday, 7. June 2011 19:20:14 Kyle Shannon wrote:
> Hello,
> I am brand new to marble and I am interested in using it do display some
> data for my application.  To get my feet wet, I would like to display the
> boundary of an image that the user inputs.  I know the lon/lat of the
> boundaries of the image, and I want to paint that boundary in my marble
> widget.  I saw the example for the GeoPainter and the ellipse, and I looked
> at the documentation for drawRect(), but I can't seem to figure out how to
> add coordinates to whatever geometry I need to use.  Any pointers?  Thanks.
> 
> kss
> 
> /**
>  *
>  * Kyle Shannon
>  * ksshannon at gmail.com
>  *
>  */



More information about the Marble-devel mailing list