Marble

SphericalProjection.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_SPHERICALPROJECTION_H
8#define MARBLE_SPHERICALPROJECTION_H
9
10/** @file
11 * This file contains the headers for SphericalProjection.
12 *
13 * @author Inge Wallin <inge@lysator.liu.se>
14 * @author Torsten Rahn <rahn@kde.org>
15 */
16
17#include "AbstractProjection.h"
18#include "AzimuthalProjection.h"
19
20namespace Marble
21{
22
23class SphericalProjectionPrivate;
24
25/**
26 * @short A class to implement the spherical projection used by the "Globe" view.
27 */
28
30{
31 // Not a QObject so far because we don't need to send signals.
32public:
33 /**
34 * @brief Construct a new SphericalProjection.
35 */
37
38 ~SphericalProjection() override;
39
40 /**
41 * @brief Returns the user-visible name of the projection.
42 */
43 QString name() const override;
44
45 /**
46 * @brief Returns a short user description of the projection
47 * that can be used in tooltips or dialogs.
48 */
49 QString description() const override;
50
51 /**
52 * @brief Returns an icon for the projection.
53 */
54 QIcon icon() const override;
55
56 /**
57 * @brief Get the screen coordinates corresponding to geographical coordinates in the map.
58 * @param coordinates the coordinates of the requested pixel position
59 * @param params the viewport parameters
60 * @param x the x coordinate of the pixel is returned through this parameter
61 * @param y the y coordinate of the pixel is returned through this parameter
62 * @param globeHidesPoint whether the globe hides the point
63 * @return @c true if the geographical coordinates are visible on the screen
64 * @c false if the geographical coordinates are not visible on the screen
65 */
66 bool screenCoordinates(const GeoDataCoordinates &coordinates, const ViewportParams *params, qreal &x, qreal &y, bool &globeHidesPoint) const override;
67
68 bool screenCoordinates(const GeoDataCoordinates &coordinates,
69 const ViewportParams *viewport,
70 qreal *x,
71 qreal &y,
72 int &pointRepeatNum,
73 const QSizeF &size,
74 bool &globeHidesPoint) const override;
75
77
78 /**
79 * @brief Get the earth coordinates corresponding to a pixel in the map.
80 * @param x the x coordinate of the pixel
81 * @param y the y coordinate of the pixel
82 * @param params parameters of the viewport
83 * @param lon the longitude angle is returned through this parameter
84 * @param lat the latitude angle is returned through this parameter
85 * @param unit the unit
86 * @return @c true if the pixel (x, y) is within the globe
87 * @c false if the pixel (x, y) is outside the globe, i.e. in space.
88 */
89 bool geoCoordinates(const int x,
90 const int y,
91 const ViewportParams *params,
92 qreal &lon,
93 qreal &lat,
94 GeoDataCoordinates::Unit unit = GeoDataCoordinates::Degree) const override;
95
96protected:
97 explicit SphericalProjection(SphericalProjectionPrivate *dd);
98
99private:
100 Q_DECLARE_PRIVATE(SphericalProjection)
101 Q_DISABLE_COPY(SphericalProjection)
102};
103
104}
105
106#endif
This file contains the headers for AbstractProjection.
This file contains the headers for AzimuthalProjection.
bool 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.
A base class for the Gnomonic and Orthographic (Globe) projections in Marble.
A 3d point representation.
Unit
enum used constructor to specify the units used
A class to implement the spherical projection used by the "Globe" view.
QString description() const override
Returns a short user description of the projection that can be used in tooltips or dialogs.
SphericalProjection()
Construct a new SphericalProjection.
QString name() const override
Returns the user-visible name of the projection.
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.
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.
QIcon icon() const override
Returns an icon for the projection.
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 Fri Nov 8 2024 12:02:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.