Marble::ViewportParams
#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 AbstractProjection * | currentProjection () 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 GeoDataCoordinates &coord1, const GeoDataCoordinates &coord2) const |
bool | resolves (const GeoDataLatLonAltBox &latLonAltBox, qreal pixel=2.0, qreal altitude=10000.0) const |
bool | resolves (const GeoDataLatLonBox &latLonBox, qreal pixel=2.0) const |
bool | screenCoordinates (const GeoDataCoordinates &coordinates, qreal *x, qreal &y, int &pointRepeatNum, const QSizeF &size, bool &globeHidesPoint) const |
bool | screenCoordinates (const GeoDataCoordinates &geopoint, qreal &x, qreal &y) const |
bool | screenCoordinates (const GeoDataCoordinates &geopoint, qreal &x, qreal &y, bool &globeHidesPoint) const |
bool | screenCoordinates (const GeoDataLineString &lineString, QVector< QPolygonF * > &polygons) const |
bool | screenCoordinates (const qreal lon, const qreal lat, qreal &x, qreal &y) 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 GeoDataLatLonAltBox & | viewLatLonAltBox () const |
int | width () const |
Detailed Description
A public class that controls what is visible in the viewport of a Marble map.
Definition at line 41 of file ViewportParams.h.
Member Function Documentation
◆ focusPoint()
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 456 of file ViewportParams.cpp.
◆ geoCoordinates()
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
-
x the x coordinate of the pixel y the y coordinate of the pixel lon the longitude angle is returned through this parameter lat the latitude angle is returned through this parameter unit the unit of the angles for lon and lat.
- Returns
true
if the pixel (x, y) is within the globefalse
if the pixel (x, y) is outside the globe, i.e. in space.
Definition at line 434 of file ViewportParams.cpp.
◆ resetFocusPoint()
void Marble::ViewportParams::resetFocusPoint | ( | ) |
Invalidate any focus point set with setFocusPoint.
- See also
- focusPoint setFocusPoint
Definition at line 475 of file ViewportParams.cpp.
◆ screenCoordinates() [1/3]
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
-
coordinates the point on earth, including altitude, that we want the coordinates for. x the x coordinates of the pixels are returned through this parameter y the y coordinate of the pixel is returned through this parameter pointRepeatNum the amount of times that a single geographical point gets represented on the map size the size of the point globeHidesPoint whether the point gets hidden on the far side of the earth
- Returns
true
if the geographical coordinates are visible on the screenfalse
if the geographical coordinates are not visible on the screen
- See also
- ViewportParams
Definition at line 419 of file ViewportParams.cpp.
◆ screenCoordinates() [2/3]
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
-
geopoint the point on earth, including altitude, that we want the coordinates for. x the x coordinate of the pixel is returned through this parameter y the y coordinate of the pixel is returned through this parameter globeHidesPoint whether the point gets hidden on the far side of the earth
- Returns
true
if the geographical coordinates are visible on the screenfalse
if the geographical coordinates are not visible on the screen
- See also
- ViewportParams
Definition at line 406 of file ViewportParams.cpp.
◆ screenCoordinates() [3/3]
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
-
lon the lon coordinate of the requested pixel position in radians lat the lat coordinate of the requested pixel position in radians x the x coordinate of the pixel is returned through this parameter y the y coordinate of the pixel is returned through this parameter
- Returns
true
if the geographical coordinates are visible on the screenfalse
if the geographical coordinates are not visible on the screen
- See also
- ViewportParams
Definition at line 400 of file ViewportParams.cpp.
◆ setFocusPoint()
void Marble::ViewportParams::setFocusPoint | ( | const GeoDataCoordinates & | focusPoint | ) |
Change the point of focus, overridding any previously set focus point.
- Parameters
-
focusPoint New focus point
- See also
- focusPoint resetFocusPoint
Definition at line 470 of file ViewportParams.cpp.
◆ setRadius()
void Marble::ViewportParams::setRadius | ( | int | radius | ) |
Change the radius of the planet.
- Parameters
-
radius Size of the planet radius in pixel. Non-positive values are ignored.
Definition at line 222 of file ViewportParams.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Jun 6 2023 03:53:24 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.