2
// This file is part of the Marble Virtual Globe.
4
// This program is free software licensed under the GNU LGPL. You can
5
// find a copy of this license in LICENSE.txt in the top directory of
8
// Copyright 2007 Inge Wallin <ingwa@kde.org>
9
// Copyright 2007-2009 Torsten Rahn <rahn@kde.org>
13
#ifndef MARBLE_EQUIRECTPROJECTION_H
14
#define MARBLE_EQUIRECTPROJECTION_H
18
* This file contains the headers for EquirectProjection.
20
* @author Inge Wallin <inge@lysator.liu.se>
21
* @author Torsten Rahn <rahn@kde.org>
25
#include "AbstractProjection.h"
31
class EquirectProjectionPrivate;
34
* @short A class to implement the Equirectangular projection used by the "Flat Map" view.
37
class EquirectProjection : public AbstractProjection
39
// Not a QObject so far because we don't need to send signals.
43
* @brief Construct a new EquirectProjection.
47
virtual ~EquirectProjection();
49
virtual bool repeatableX() const;
50
virtual qreal maxValidLat() const;
51
virtual qreal minValidLat() const;
53
virtual bool traversablePoles() const { return false; }
54
virtual bool traversableDateLine() const { return false; }
56
virtual SurfaceType surfaceType() const { return Cylindrical; }
58
virtual PreservationType preservationType() const { return NoPreservation; }
61
* @brief Get the screen coordinates corresponding to geographical coordinates in the map.
62
* @param lon the lon coordinate of the requested pixel position
63
* @param lat the lat coordinate of the requested pixel position
64
* @param x the x coordinate of the pixel is returned through this parameter
65
* @param y the y coordinate of the pixel is returned through this parameter
66
* @return @c true if the geographical coordinates are visible on the screen
67
* @c false if the geographical coordinates are not visible on the screen
69
bool screenCoordinates( const qreal lon, const qreal lat,
70
const ViewportParams *params,
71
qreal& x, qreal& y ) const;
73
bool screenCoordinates( const GeoDataCoordinates &geopoint,
74
const ViewportParams *params,
75
qreal &x, qreal &y, bool &globeHidesPoint ) const;
77
bool screenCoordinates( const GeoDataCoordinates &coordinates,
78
const ViewportParams *viewport,
79
qreal *x, qreal &y, int &pointRepeatNum,
81
bool &globeHidesPoint ) const;
84
* @brief Get the earth coordinates corresponding to a pixel in the map.
85
* @param x the x coordinate of the pixel
86
* @param y the y coordinate of the pixel
87
* @param lon the longitude angle is returned through this parameter
88
* @param lat the latitude angle is returned through this parameter
89
* @return @c true if the pixel (x, y) is within the globe
90
* @c false if the pixel (x, y) is outside the globe, i.e. in space.
92
bool geoCoordinates( const int x, const int y,
93
const ViewportParams *params,
94
qreal& lon, qreal& lat,
95
GeoDataCoordinates::Unit unit = GeoDataCoordinates::Degree ) const;
97
GeoDataLatLonAltBox latLonAltBox( const QRect& screenRect,
98
const ViewportParams *viewport ) const;
100
bool mapCoversViewport( const ViewportParams *viewport ) const;
102
virtual QPainterPath mapShape( const ViewportParams *viewport ) const;
105
Q_DISABLE_COPY( EquirectProjection )
106
EquirectProjectionPrivate * d;