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

KDE's Doxygen guidelines are available online.