Marble::AbstractProjection

Search for usage in LXR

#include <AbstractProjection.h>

Inheritance diagram for Marble::AbstractProjection:

Public Types

enum  PreservationType { NoPreservation , Conformal , EqualArea }
 
enum  SurfaceType {
  Cylindrical , Pseudocylindrical , Hybrid , Conical ,
  Pseudoconical , Azimuthal
}
 

Public Member Functions

 AbstractProjection ()
 
virtual qreal clippingRadius () const
 
virtual QString description () const =0
 
virtual bool geoCoordinates (const int x, const int y, const ViewportParams *viewport, qreal &lon, qreal &lat, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Degree) const =0
 
virtual QIcon icon () const =0
 
virtual bool isClippedToSphere () const
 
virtual bool isOrientedNormal () const
 
virtual GeoDataLatLonAltBox latLonAltBox (const QRect &screenRect, const ViewportParams *viewport) const
 
virtual bool mapCoversViewport (const ViewportParams *viewport) const =0
 
QRegion mapRegion (const ViewportParams *viewport) const
 
virtual QPainterPath mapShape (const ViewportParams *viewport) const =0
 
qreal maxLat () const
 
virtual qreal maxValidLat () const
 
qreal minLat () const
 
virtual qreal minValidLat () const
 
virtual QString name () const =0
 
virtual PreservationType preservationType () const
 
virtual bool repeatableX () const
 
virtual bool screenCoordinates (const GeoDataCoordinates &coordinates, const ViewportParams *viewport, qreal *x, qreal &y, int &pointRepeatNum, const QSizeF &size, bool &globeHidesPoint) const =0
 
bool screenCoordinates (const GeoDataCoordinates &geopoint, const ViewportParams *viewport, qreal &x, qreal &y) const
 
virtual bool screenCoordinates (const GeoDataCoordinates &geopoint, const ViewportParams *viewport, qreal &x, qreal &y, bool &globeHidesPoint) const =0
 
virtual bool screenCoordinates (const GeoDataLineString &lineString, const ViewportParams *viewport, QList< QPolygonF * > &polygons) const =0
 
bool screenCoordinates (const qreal lon, const qreal lat, const ViewportParams *viewport, qreal &x, qreal &y) const
 
void setMaxLat (qreal maxLat)
 
void setMinLat (qreal minLat)
 
virtual SurfaceType surfaceType () const =0
 
virtual bool traversableDateLine () const
 
virtual bool traversablePoles () const
 

Protected Member Functions

 AbstractProjection (AbstractProjectionPrivate *dd)
 

Protected Attributes

const QScopedPointer< AbstractProjectionPrivate > d_ptr
 

Detailed Description

A base class for all projections in Marble.

Definition at line 44 of file AbstractProjection.h.

Member Enumeration Documentation

◆ PreservationType

enum Marble::AbstractProjection::PreservationType

Definition at line 57 of file AbstractProjection.h.

◆ SurfaceType

enum Marble::AbstractProjection::SurfaceType

Definition at line 48 of file AbstractProjection.h.

Constructor & Destructor Documentation

◆ AbstractProjection() [1/2]

AbstractProjection::AbstractProjection ( )

Construct a new AbstractProjection.

Definition at line 25 of file AbstractProjection.cpp.

◆ AbstractProjection() [2/2]

AbstractProjection::AbstractProjection ( AbstractProjectionPrivate * dd)
explicitprotected

Definition at line 30 of file AbstractProjection.cpp.

Member Function Documentation

◆ clippingRadius()

qreal AbstractProjection::clippingRadius ( ) const
virtual

Definition at line 165 of file AbstractProjection.cpp.

◆ description()

virtual QString Marble::AbstractProjection::description ( ) const
pure virtual

◆ geoCoordinates()

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

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

Parameters
xthe x coordinate of the pixel
ythe y coordinate of the pixel
viewportthe viewport parameters
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.

Implemented in Marble::AzimuthalEquidistantProjection, Marble::EquirectProjection, Marble::GnomonicProjection, Marble::LambertAzimuthalProjection, Marble::MercatorProjection, Marble::SphericalProjection, Marble::StereographicProjection, and Marble::VerticalPerspectiveProjection.

◆ icon()

◆ isClippedToSphere()

bool AbstractProjection::isClippedToSphere ( ) const
virtual

Defines whether a projection is supposed to be clipped to a certain radius.

Example: The Gnomonic projection is clipped to a circle of a certain clipping radius (although it's mathematically defined beyond that radius).

Reimplemented in Marble::AzimuthalProjection.

Definition at line 160 of file AbstractProjection.cpp.

◆ isOrientedNormal()

bool AbstractProjection::isOrientedNormal ( ) const
virtual

Definition at line 155 of file AbstractProjection.cpp.

◆ latLonAltBox()

GeoDataLatLonAltBox AbstractProjection::latLonAltBox ( const QRect & screenRect,
const ViewportParams * viewport ) const
virtual

Returns a GeoDataLatLonAltBox bounding box of the given screenrect inside the given viewport.

Reimplemented in Marble::AzimuthalProjection, Marble::EquirectProjection, and Marble::MercatorProjection.

Definition at line 184 of file AbstractProjection.cpp.

◆ mapCoversViewport()

virtual bool Marble::AbstractProjection::mapCoversViewport ( const ViewportParams * viewport) const
pure virtual

Returns whether the projected data fully obstructs the current viewport.

In this case there are no black areas visible around the actual map. This case allows for performance optimizations.

Implemented in Marble::AzimuthalProjection, Marble::EquirectProjection, and Marble::MercatorProjection.

◆ mapRegion()

QRegion AbstractProjection::mapRegion ( const ViewportParams * viewport) const

Definition at line 254 of file AbstractProjection.cpp.

◆ mapShape()

virtual QPainterPath Marble::AbstractProjection::mapShape ( const ViewportParams * viewport) const
pure virtual

Returns the shape/outline of a map projection.

This call allows e.g. to draw the default background color of the map itself.

Example: For an azimuthal projection a circle is returned at low zoom values.

Implemented in Marble::AzimuthalProjection, and Marble::CylindricalProjection.

◆ maxLat()

qreal AbstractProjection::maxLat ( ) const

Returns the arbitrarily chosen maximum (northern) latitude.

By default this value is equal to the value defined inside maxValidLat(). In general this value can only be smaller or equal to maxValidLat().

Definition at line 96 of file AbstractProjection.cpp.

◆ maxValidLat()

qreal AbstractProjection::maxValidLat ( ) const
virtual

Returns the maximum (northern) latitude that is mathematically defined and reasonable.

Example: For many projections the value will represent +90 degrees in Radian. In the case of Mercator this value will equal +85.05113 degrees in Radian.

Reimplemented in Marble::MercatorProjection.

Definition at line 91 of file AbstractProjection.cpp.

◆ minLat()

qreal AbstractProjection::minLat ( ) const

Returns the arbitrarily chosen minimum (southern) latitude.

By default this value is equal to the value defined inside minValidLat(). In general this value can only be larger or equal to minValidLat().

Definition at line 118 of file AbstractProjection.cpp.

◆ minValidLat()

qreal AbstractProjection::minValidLat ( ) const
virtual

Returns the minimum (southern) latitude that is mathematically defined and reasonable.

Example: For many projections the value will represent -90 degrees in Radian. In the case of Mercator this value will equal -85.05113 degrees in Radian.

Reimplemented in Marble::MercatorProjection.

Definition at line 113 of file AbstractProjection.cpp.

◆ name()

virtual QString Marble::AbstractProjection::name ( ) const
pure virtual

◆ preservationType()

AbstractProjection::PreservationType AbstractProjection::preservationType ( ) const
virtual

Definition at line 150 of file AbstractProjection.cpp.

◆ repeatableX()

bool AbstractProjection::repeatableX ( ) const
virtual

Returns whether the projection allows for wrapping in x direction (along the longitude scale).

Example: Cylindrical projections allow for repeating.

Reimplemented in Marble::AzimuthalProjection, and Marble::CylindricalProjection.

Definition at line 135 of file AbstractProjection.cpp.

◆ screenCoordinates() [1/4]

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

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.
viewportthe viewport parameters
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
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

Implemented in Marble::AzimuthalEquidistantProjection, Marble::AzimuthalProjection, Marble::CylindricalProjection, Marble::EquirectProjection, Marble::GnomonicProjection, Marble::LambertAzimuthalProjection, Marble::MercatorProjection, Marble::SphericalProjection, Marble::StereographicProjection, and Marble::VerticalPerspectiveProjection.

◆ screenCoordinates() [2/4]

bool AbstractProjection::screenCoordinates ( const GeoDataCoordinates & geopoint,
const ViewportParams * viewport,
qreal & x,
qreal & y ) const

Definition at line 177 of file AbstractProjection.cpp.

◆ screenCoordinates() [3/4]

virtual bool Marble::AbstractProjection::screenCoordinates ( const GeoDataCoordinates & geopoint,
const ViewportParams * viewport,
qreal & x,
qreal & y,
bool & globeHidesPoint ) const
pure virtual

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

Parameters
geopointthe point on earth, including altitude, that we want the coordinates for.
viewportthe viewport parameters
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

Implemented in Marble::AzimuthalEquidistantProjection, Marble::AzimuthalProjection, Marble::CylindricalProjection, Marble::EquirectProjection, Marble::GnomonicProjection, Marble::LambertAzimuthalProjection, Marble::MercatorProjection, Marble::SphericalProjection, Marble::StereographicProjection, and Marble::VerticalPerspectiveProjection.

◆ screenCoordinates() [4/4]

bool AbstractProjection::screenCoordinates ( const qreal lon,
const qreal lat,
const ViewportParams * viewport,
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
viewportthe viewport parameters
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 170 of file AbstractProjection.cpp.

◆ setMaxLat()

void AbstractProjection::setMaxLat ( qreal maxLat)

Definition at line 102 of file AbstractProjection.cpp.

◆ setMinLat()

void AbstractProjection::setMinLat ( qreal minLat)

Definition at line 124 of file AbstractProjection.cpp.

◆ traversableDateLine()

bool AbstractProjection::traversableDateLine ( ) const
virtual

Definition at line 145 of file AbstractProjection.cpp.

◆ traversablePoles()

bool AbstractProjection::traversablePoles ( ) const
virtual

Returns whether the projection allows to navigate seamlessly "over" the pole.

Example: Azimuthal projections.

Reimplemented in Marble::AzimuthalProjection, and Marble::CylindricalProjection.

Definition at line 140 of file AbstractProjection.cpp.

Member Data Documentation

◆ d_ptr

const QScopedPointer<AbstractProjectionPrivate> Marble::AbstractProjection::d_ptr
protected

Definition at line 257 of file AbstractProjection.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.