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 <[email protected]>
4 // SPDX-FileCopyrightText: 2007-2012 Torsten Rahn <[email protected]>
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 <[email protected]>
16  * @author Torsten Rahn <[email protected]>
17  */
18 
19 
20 #include "AbstractProjection.h"
21 #include "AzimuthalProjection.h"
22 
23 namespace Marble
24 {
25 
26 class 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
A 3d point representation.
QIcon icon() const override
Returns an icon for the projection.
A base class for the Gnomonic and Orthographic (Globe) projections in Marble.
SphericalProjection()
Construct a new SphericalProjection.
A public class that controls what is visible in the viewport of a Marble map.
QString name() const override
Returns the user-visible name of the projection.
Binds a QML item to a specific geodetic location in screen coordinates.
QString description() const override
Returns a short user description of the projection that can be used in tooltips or dialogs.
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.
Unit
enum used constructor to specify the units used
A class to implement the spherical projection used by the "Globe" view.
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.
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.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:53:22 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.