Marble

EquirectProjection.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2007 Inge Wallin <ingwa@kde.org>
4// SPDX-FileCopyrightText: 2007-2012 Torsten Rahn <rahn@kde.org>
5//
6
7#ifndef MARBLE_EQUIRECTPROJECTION_H
8#define MARBLE_EQUIRECTPROJECTION_H
9
10/** @file
11 * This file contains the headers for EquirectProjection.
12 *
13 * @author Inge Wallin <inge@lysator.liu.se>
14 * @author Torsten Rahn <rahn@kde.org>
15 */
16
18
19namespace Marble
20{
21
22/**
23 * @short A class to implement the Equirectangular projection used by the "Flat Map" view.
24 */
25
27{
28 // Not a QObject so far because we don't need to send signals.
29public:
30 /**
31 * @brief Construct a new EquirectProjection.
32 */
34
35 ~EquirectProjection() override;
36
37 /**
38 * @brief Returns the user-visible name of the projection.
39 */
40 QString name() const override;
41
42 /**
43 * @brief Returns a short user description of the projection
44 * that can be used in tooltips or dialogs.
45 */
46 QString description() const override;
47
48 /**
49 * @brief Returns an icon for the projection.
50 */
51 QIcon icon() const override;
52
53 PreservationType preservationType() const override
54 {
55 return NoPreservation;
56 }
57
58 /**
59 * @brief Get the screen coordinates corresponding to geographical coordinates in the map.
60 * @param coordinates the coordinates of the requested pixel position
61 * @param params the viewport parameters
62 * @param x the x coordinate of the pixel is returned through this parameter
63 * @param y the y coordinate of the pixel is returned through this parameter
64 * @param globeHidesPoint whether the globe hides the point
65 * @return @c true if the geographical coordinates are visible on the screen
66 * @c false if the geographical coordinates are not visible on the screen
67 */
68 bool screenCoordinates(const GeoDataCoordinates &coordinates, const ViewportParams *params, qreal &x, qreal &y, bool &globeHidesPoint) const override;
69
70 bool screenCoordinates(const GeoDataCoordinates &coordinates,
71 const ViewportParams *viewport,
72 qreal *x,
73 qreal &y,
74 int &pointRepeatNum,
75 const QSizeF &size,
76 bool &globeHidesPoint) const override;
77
78 using CylindricalProjection::screenCoordinates;
79
80 /**
81 * @brief Get the earth coordinates corresponding to a pixel in the map.
82 *
83 * If the pixel (x, y) is outside the globe, only @p lon will be calculated,
84 * and lat will be unchanged.
85 *
86 * @param x the x coordinate of the pixel
87 * @param y the y coordinate of the pixel
88 * @param params parameters of the viewport
89 * @param lon the longitude angle is returned through this parameter
90 * @param lat the latitude angle is returned through this parameter
91 * @param unit the unit
92 * @return @c true if the pixel (x, y) is within the map
93 * @c false if the pixel (x, y) is above or underneath the map
94 */
95 bool geoCoordinates(const int x,
96 const int y,
97 const ViewportParams *params,
98 qreal &lon,
99 qreal &lat,
100 GeoDataCoordinates::Unit unit = GeoDataCoordinates::Degree) const override;
101
102 GeoDataLatLonAltBox latLonAltBox(const QRect &screenRect, const ViewportParams *viewport) const override;
103
104 bool mapCoversViewport(const ViewportParams *viewport) const override;
105
106private:
107 Q_DISABLE_COPY(EquirectProjection)
108};
109
110}
111
112#endif
This file contains the headers for CylindricalProjection.
A base class for the Equirectangular and Mercator projections in Marble.
A class to implement the Equirectangular projection used by the "Flat Map" view.
bool mapCoversViewport(const ViewportParams *viewport) const override
Returns whether the projected data fully obstructs the current viewport.
bool screenCoordinates(const GeoDataCoordinates &coordinates, const ViewportParams *params, qreal &x, qreal &y, bool &globeHidesPoint) const override
Get the screen coordinates corresponding to geographical coordinates in the map.
GeoDataLatLonAltBox latLonAltBox(const QRect &screenRect, const ViewportParams *viewport) const override
Returns a GeoDataLatLonAltBox bounding box of the given screenrect inside the given viewport.
QIcon icon() const override
Returns an icon for the projection.
QString description() const override
Returns a short user description of the projection that can be used in tooltips or dialogs.
QString name() const override
Returns the user-visible name of the projection.
bool geoCoordinates(const int x, const int y, const ViewportParams *params, qreal &lon, qreal &lat, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Degree) const override
Get the earth coordinates corresponding to a pixel in the map.
EquirectProjection()
Construct a new EquirectProjection.
A 3d point representation.
Unit
enum used constructor to specify the units used
A class that defines a 3D bounding box for geographic data.
A public class that controls what is visible in the viewport of a Marble map.
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.