Marble::ViewportParams

Marble::ViewportParams Class Reference

#include <ViewportParams.h>

Public Member Functions

 ViewportParams (Projection projection, qreal centerLongitude=0, qreal centerLatitude=0, int radius=2000, const QSize &size=QSize(100, 100))
 
qreal angularResolution () const
 
qreal centerLatitude () const
 
qreal centerLongitude () const
 
void centerOn (qreal lon, qreal lat)
 
const AbstractProjectioncurrentProjection () const
 
GeoDataCoordinates focusPoint () const
 
bool geoCoordinates (const int x, const int y, qreal &lon, qreal &lat, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Degree) const
 
qreal heading () const
 
int height () const
 
GeoDataLatLonAltBox latLonAltBox (const QRect &screenRect) const
 
bool mapCoversViewport () const
 
QRegion mapRegion () const
 
QPainterPath mapShape () const
 
Quaternion planetAxis () const
 
const matrix & planetAxisMatrix () const
 
int polarity () const
 
Projection projection () const
 
int radius () const
 
void resetFocusPoint ()
 
bool resolves (const GeoDataLatLonBox &latLonBox, qreal pixel=2.0) const
 
bool resolves (const GeoDataLatLonAltBox &latLonAltBox, qreal pixel=2.0, qreal altitude=10000.0) const
 
bool resolves (const GeoDataCoordinates &coord1, const GeoDataCoordinates &coord2) const
 
bool screenCoordinates (const qreal lon, const qreal lat, qreal &x, qreal &y) const
 
bool screenCoordinates (const GeoDataCoordinates &geopoint, qreal &x, qreal &y, bool &globeHidesPoint) const
 
bool screenCoordinates (const GeoDataCoordinates &geopoint, qreal &x, qreal &y) const
 
bool screenCoordinates (const GeoDataCoordinates &coordinates, qreal *x, qreal &y, int &pointRepeatNum, const QSizeF &size, bool &globeHidesPoint) const
 
bool screenCoordinates (const GeoDataLineString &lineString, QVector< QPolygonF * > &polygons) const
 
void setFocusPoint (const GeoDataCoordinates &focusPoint)
 
void setHeading (qreal heading)
 
void setHeight (int newHeight)
 
void setProjection (Projection newProjection)
 
void setRadius (int radius)
 
void setSize (const QSize &newSize)
 
void setWidth (int newWidth)
 
QSize size () const
 
const GeoDataLatLonAltBoxviewLatLonAltBox () const
 
int width () const
 

Detailed Description

A public class that controls what is visible in the viewport of a Marble map.

Definition at line 46 of file ViewportParams.h.

Member Function Documentation

GeoDataCoordinates Marble::ViewportParams::focusPoint ( ) const
Returns
The current point of focus, e.g. the point that is not moved when changing the zoom level. If not set, it defaults to the center point.
See also
centerCoordinates setFocusPoint resetFocusPoint

Definition at line 461 of file ViewportParams.cpp.

bool Marble::ViewportParams::geoCoordinates ( const int  x,
const int  y,
qreal &  lon,
qreal &  lat,
GeoDataCoordinates::Unit  unit = GeoDataCoordinates::Degree 
) const

Get the earth coordinates corresponding to a pixel in the map.

Parameters
xthe x coordinate of the pixel
ythe y coordinate of the pixel
lonthe longitude angle is returned through this parameter
latthe latitude angle is returned through this parameter
unitthe unit of the angles for lon and lat.
Returns
true if the pixel (x, y) is within the globe false if the pixel (x, y) is outside the globe, i.e. in space.

Definition at line 439 of file ViewportParams.cpp.

void Marble::ViewportParams::resetFocusPoint ( )

Invalidate any focus point set with setFocusPoint.

See also
focusPoint setFocusPoint

Definition at line 480 of file ViewportParams.cpp.

bool Marble::ViewportParams::screenCoordinates ( const qreal  lon,
const qreal  lat,
qreal &  x,
qreal &  y 
) const

Get the screen coordinates corresponding to geographical coordinates in the map.

Parameters
lonthe lon coordinate of the requested pixel position in radians
latthe lat coordinate of the requested pixel position in radians
xthe x coordinate of the pixel is returned through this parameter
ythe y coordinate of the pixel is returned through this parameter
Returns
true if the geographical coordinates are visible on the screen false if the geographical coordinates are not visible on the screen
See also
ViewportParams

Definition at line 405 of file ViewportParams.cpp.

bool Marble::ViewportParams::screenCoordinates ( const GeoDataCoordinates geopoint,
qreal &  x,
qreal &  y,
bool &  globeHidesPoint 
) const

Get the screen coordinates corresponding to geographical coordinates in the map.

Parameters
geopointthe point on earth, including altitude, that we want the coordinates for.
xthe x coordinate of the pixel is returned through this parameter
ythe y coordinate of the pixel is returned through this parameter
globeHidesPointwhether the point gets hidden on the far side of the earth
Returns
true if the geographical coordinates are visible on the screen false if the geographical coordinates are not visible on the screen
See also
ViewportParams

Definition at line 411 of file ViewportParams.cpp.

bool Marble::ViewportParams::screenCoordinates ( const GeoDataCoordinates coordinates,
qreal *  x,
qreal &  y,
int &  pointRepeatNum,
const QSizeF size,
bool &  globeHidesPoint 
) const

Get the coordinates of screen points for geographical coordinates in the map.

Parameters
coordinatesthe point on earth, including altitude, that we want the coordinates for.
xthe x coordinates of the pixels are returned through this parameter
ythe y coordinate of the pixel is returned through this parameter
pointRepeatNumthe amount of times that a single geographical point gets represented on the map
sizethe size of the point
globeHidesPointwhether the point gets hidden on the far side of the earth
Returns
true if the geographical coordinates are visible on the screen false if the geographical coordinates are not visible on the screen
See also
ViewportParams

Definition at line 424 of file ViewportParams.cpp.

void Marble::ViewportParams::setFocusPoint ( const GeoDataCoordinates focusPoint)

Change the point of focus, overridding any previously set focus point.

Parameters
focusPointNew focus point
See also
focusPoint resetFocusPoint

Definition at line 475 of file ViewportParams.cpp.

void Marble::ViewportParams::setRadius ( int  radius)

Change the radius of the planet.

Parameters
radiusSize of the planet radius in pixel. Non-positive values are ignored.

Definition at line 227 of file ViewportParams.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue May 26 2020 22:38:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.