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

KDE's Doxygen guidelines are available online.