Marble

MarbleGlobal.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2007-2009 Torsten Rahn <tackat@kde.org>
4// SPDX-FileCopyrightText: 2007 Inge Wallin <ingwa@kde.org>
5//
6
7#ifndef MARBLE_GLOBAL_H
8#define MARBLE_GLOBAL_H
9
10#include <cmath>
11
12#include <QString>
13
14#include "marble_export.h"
15#include "marble_version.h"
16
17// #define QT_STRICT_ITERATORS
18
19/* M_PI is a #define that may or may not be handled in <cmath> */
20#ifndef M_PI
21#define M_PI 3.14159265358979323846264338327950288419717
22#endif
23
24namespace Marble
25{
26
27enum TessellationFlag {
28 NoTessellation = 0x0,
29 Tessellate = 0x1,
30 RespectLatitudeCircle = 0x2,
31 FollowGround = 0x4,
32 PreventNodeFiltering = 0x8
33};
34
35Q_DECLARE_FLAGS(TessellationFlags, TessellationFlag)
36
37/**
38 * @brief This enum is used to choose the projection shown in the view.
39 */
41 Spherical, ///< Spherical projection ("Orthographic")
42 Equirectangular, ///< Flat projection ("plate carree")
43 Mercator, ///< Mercator projection
44 Gnomonic, ///< Gnomonic projection
45 Stereographic, ///< Stereographic projection
46 LambertAzimuthal, ///< Lambert Azimuthal Equal-Area projection
47 AzimuthalEquidistant, ///< Azimuthal Equidistant projection
48 VerticalPerspective ///< Vertical perspective projection
49 // NOTE: MarbleWidget::setProjection(int) relies on VerticalPerspective being the last
50 // value above. Adjust that method if you do changes here
51};
52
53/**
54 * @brief This enum is used to choose the unit chosen to measure angles.
55 */
57 DMSDegree, ///< Degrees in DMS notation
58 DecimalDegree, ///< Degrees in decimal notation
59 UTM ///< UTM
60};
61
62/**
63 * @brief This enum is used to choose context in which map quality gets used.
64 */
66 Still, ///< still image
67 Animation ///< animated view (e.g. while rotating the globe)
68};
69
70/**
71 * @brief This enum is used to choose the map quality shown in the view.
72 */
74 OutlineQuality, ///< Only a wire representation is drawn
75 LowQuality, ///< Low resolution (e.g. interlaced)
76 NormalQuality, ///< Normal quality
77 HighQuality, ///< High quality (e.g. antialiasing for lines)
78 PrintQuality ///< Print quality
79};
80
81/**
82 * @brief This enum is used to specify the proxy that is used.
83 */
85 HttpProxy, ///< Uses an Http proxy
86 Socks5Proxy ///< Uses a Socks5Proxy
87};
88
89/**
90 * @brief This enum is used to choose the localization of the labels.
91 */
93 NoLabel = 0x0,
94 LineStart = 0x1,
95 LineCenter = 0x2,
96 LineEnd = 0x4,
97 IgnoreXMargin = 0x8,
98 IgnoreYMargin = 0x10,
99 FollowLine = 0x20
100};
101
102Q_DECLARE_FLAGS(LabelPositionFlags, LabelPositionFlag)
103
104/**
105 * @brief This enum is used to choose the localization of the labels.
106 */
108 CustomAndNative, ///< Custom and native labels
109 Custom, ///< Shows the name in the user's language
110 Native ///< Display the name in the official language and
111 /// glyphs of the labeled place.
113
114/**
115 * @brief This enum is used to choose how the globe behaves while dragging.
116 */
118 KeepAxisVertically, ///< Keep planet axis vertically
119 FollowMousePointer ///< Follow mouse pointer exactly
121
122/**
123 * @brief This enum is used to choose how the globe behaves while dragging.
124 */
126 ShowHomeLocation, ///< Show home location on startup
127 LastLocationVisited ///< Show last location visited on quit
129
131 ClampToGround, ///< Altitude always sticks to ground level
132 RelativeToGround, ///< Altitude is always given relative to ground level
133 Absolute, ///< Altitude is given relative to the sealevel
134 RelativeToSeaFloor, ///< Altitude is given relative to the sea floor
135 ClampToSeaFloor ///< Altitude always sticks to sea floor
137
138enum Pole {
139 AnyPole, ///< Any pole
140 NorthPole, ///< Only North Pole
141 SouthPole ///< Only South Pole
143
145 TextureTileType, ///< Tiles that consist of bitmap data
146 VectorTileType ///< Tiles that consist of vector data
148
149/**
150 * @brief This enum is used to describe the type of download
151 */
153 DownloadBulk, ///< Bulk download, for example "File/Download region"
154 DownloadBrowse ///< Browsing mode, normal operation of Marble, like a web browser
156
157/**
158 * @brief Describes possible flight mode (interpolation between source
159 * and target camera positions)
160 */
162 Automatic, ///< A sane value is chosen automatically depending on animation settings and the action
163 Instant, ///< Change camera position immediately (no interpolation)
164 Linear, ///< Linear interpolation of lon, lat and distance to ground
165 Jump ///< Linear interpolation of lon and lat, distance increases towards the middle point, then decreases
167
168/**
169 * @brief Search mode: Global (worldwide) versus area (local, regional) search
170 */
172 GlobalSearch, ///< Search a whole planet
173 AreaSearch ///< Search a certain region of a planet (e.g. visible region)
175
176/**
177 * @brief
178 */
180 Complete, ///< All data is there and up to date
181 WaitingForUpdate, ///< Rendering is based on complete, but outdated data, data update was requested
182 WaitingForData, ///< Rendering is based on no or partial data, more data was requested (e.g. pending network queries)
183 Incomplete ///< Data is missing and some error occurred when trying to retrieve it (e.g. network failure)
185
186const int defaultLevelZeroColumns = 2;
187const int defaultLevelZeroRows = 1;
188
189// Conversion Metric / Imperial System: km vs. miles
190const qreal MI2KM = 1.609344;
191const qreal KM2MI = 1.0 / MI2KM;
192
193// Conversion Nautical / Imperial System: nm vs. km
194const qreal NM2KM = 1.852;
195const qreal KM2NM = 1.0 / NM2KM;
196const qreal NM2FT = 6080; // nm feet
197
198// Conversion Metric / Imperial System: meter vs. feet
199const qreal M2FT = 3.2808;
200const qreal FT2M = 1.0 / M2FT;
201
202// Conversion Metric / Imperial System: meter vs inch
203const qreal M2IN = 39.3701;
204const qreal IN2M = 1.0 / M2IN;
205
206// Interconversion between Imperial System: feet vs inch
207const qreal FT2IN = 12.0;
208
209// Conversion Metric / Imperial System: meter vs yard
210const qreal M2YD = 1.09361;
211const qreal YD2M = 1.0 / M2YD;
212
213// Conversion meter vs millimeter
214const qreal M2MM = 1000.0;
215const qreal MM2M = 1.0 / M2MM;
216
217// Conversion meter vs centimeter
218const qreal M2CM = 100.0;
219const qreal CM2M = 1.0 / M2CM;
220
221// Conversion degree vs. radians
222const qreal DEG2RAD = M_PI / 180.0;
223const qreal RAD2DEG = 180.0 / M_PI;
224
225// Conversion meter vs kilometer
226const qreal KM2METER = 1000.0;
227const qreal METER2KM = 1.0 / KM2METER;
228
229// Conversion hour vs minute
230const qreal HOUR2MIN = 60.0;
231const qreal MIN2HOUR = 1.0 / HOUR2MIN;
232
233// Conversion (time) minute vs second
234const qreal MIN2SEC = 60.0;
235const qreal SEC2MIN = 1.0 / MIN2SEC;
236
237// Conversion hour vs second
238const qreal HOUR2SEC = 3600.0;
239const qreal SEC2HOUR = 1.0 / HOUR2SEC;
240
241const qreal TWOPI = 2 * M_PI;
242
243static const char NOT_AVAILABLE[] = QT_TRANSLATE_NOOP("Marble", "not available");
244
245const int tileDigits = 6;
246
247// Average earth radius in m
248// Deprecated: Please use model()->planetRadius() instead.
249const qreal EARTH_RADIUS = 6378137.0;
250
251// Maximum level of base tiles
252const int maxBaseTileLevel = 4;
253
254// Default size (width and height) of tiles
255const unsigned int c_defaultTileSize = 675;
256
257class MarbleGlobalPrivate;
258class MarbleLocale;
259
260class MARBLE_EXPORT MarbleGlobal
261{
262public:
263 static MarbleGlobal *getInstance();
264 ~MarbleGlobal();
265
266 MarbleLocale *locale() const;
267
268 enum Profile {
269 Default = 0x0,
270 SmallScreen = 0x1,
271 HighResolution = 0x2
272 };
273
274 Q_DECLARE_FLAGS(Profiles, Profile)
275
276 Profiles profiles() const;
277 void setProfiles(Profiles profiles);
278
279 /** @deprecated Profiles are detected automatically now. This only returns profiles() anymore */
280 MARBLE_DEPRECATED static Profiles detectProfiles();
281
282private:
283 MarbleGlobal();
284
285 Q_DISABLE_COPY(MarbleGlobal)
286 MarbleGlobalPrivate *const d;
287};
288
289}
290
291Q_DECLARE_OPERATORS_FOR_FLAGS(Marble::TessellationFlags)
292Q_DECLARE_OPERATORS_FOR_FLAGS(Marble::LabelPositionFlags)
293Q_DECLARE_OPERATORS_FOR_FLAGS(Marble::MarbleGlobal::Profiles)
294
295#endif
Binds a QML item to a specific geodetic location in screen coordinates.
FlyToMode
Describes possible flight mode (interpolation between source and target camera positions)
@ Automatic
A sane value is chosen automatically depending on animation settings and the action.
@ Instant
Change camera position immediately (no interpolation)
@ Linear
Linear interpolation of lon, lat and distance to ground.
@ Jump
Linear interpolation of lon and lat, distance increases towards the middle point, then decreases.
ViewContext
This enum is used to choose context in which map quality gets used.
@ Still
still image
@ Animation
animated view (e.g. while rotating the globe)
ProxyType
This enum is used to specify the proxy that is used.
@ HttpProxy
Uses an Http proxy.
@ Socks5Proxy
Uses a Socks5Proxy.
@ RelativeToGround
Altitude is always given relative to ground level.
@ ClampToSeaFloor
Altitude always sticks to sea floor.
@ ClampToGround
Altitude always sticks to ground level.
@ RelativeToSeaFloor
Altitude is given relative to the sea floor.
@ Absolute
Altitude is given relative to the sealevel.
AngleUnit
This enum is used to choose the unit chosen to measure angles.
@ UTM
UTM.
@ DMSDegree
Degrees in DMS notation.
@ DecimalDegree
Degrees in decimal notation.
DragLocation
This enum is used to choose how the globe behaves while dragging.
@ KeepAxisVertically
Keep planet axis vertically.
@ FollowMousePointer
Follow mouse pointer exactly.
@ SouthPole
Only South Pole.
@ NorthPole
Only North Pole.
@ AnyPole
Any pole.
Projection
This enum is used to choose the projection shown in the view.
@ Mercator
Mercator projection.
@ VerticalPerspective
Vertical perspective projection.
@ AzimuthalEquidistant
Azimuthal Equidistant projection.
@ Gnomonic
Gnomonic projection.
@ LambertAzimuthal
Lambert Azimuthal Equal-Area projection.
@ Equirectangular
Flat projection ("plate carree")
@ Spherical
Spherical projection ("Orthographic")
@ Stereographic
Stereographic projection.
LabelPositionFlag
This enum is used to choose the localization of the labels.
SearchMode
Search mode: Global (worldwide) versus area (local, regional) search.
@ AreaSearch
Search a certain region of a planet (e.g. visible region)
@ GlobalSearch
Search a whole planet.
OnStartup
This enum is used to choose how the globe behaves while dragging.
@ ShowHomeLocation
Show home location on startup.
@ LastLocationVisited
Show last location visited on quit.
LabelLocalization
This enum is used to choose the localization of the labels.
@ CustomAndNative
Custom and native labels.
@ Custom
Shows the name in the user's language.
@ Native
Display the name in the official language and glyphs of the labeled place.
@ TextureTileType
Tiles that consist of bitmap data.
@ VectorTileType
Tiles that consist of vector data.
DownloadUsage
This enum is used to describe the type of download.
@ DownloadBrowse
Browsing mode, normal operation of Marble, like a web browser.
@ DownloadBulk
Bulk download, for example "File/Download region".
@ Incomplete
Data is missing and some error occurred when trying to retrieve it (e.g. network failure)
@ WaitingForData
Rendering is based on no or partial data, more data was requested (e.g. pending network queries)
@ Complete
All data is there and up to date.
@ WaitingForUpdate
Rendering is based on complete, but outdated data, data update was requested.
MapQuality
This enum is used to choose the map quality shown in the view.
@ OutlineQuality
Only a wire representation is drawn.
@ HighQuality
High quality (e.g. antialiasing for lines)
@ PrintQuality
Print quality.
@ NormalQuality
Normal quality.
@ LowQuality
Low resolution (e.g. interlaced)
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.