Marble

GeoSceneAbstractTileProjection.h
1 /*
2  SPDX-FileCopyrightText: 2016 Friedrich W. H. Kossebau <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef MARBLE_GEOSCENEABSTRACTTILEPROJECTION_H
8 #define MARBLE_GEOSCENEABSTRACTTILEPROJECTION_H
9 
10 #include "geodata_export.h"
11 
12 #include <QRect>
13 #include <QScopedPointer>
14 
15 namespace Marble
16 {
17 
18 class GeoSceneAbstractTileProjectionPrivate;
19 
20 class GeoDataLatLonBox;
21 class TileId;
22 
23 /**
24  * @short A base class for projections between tile indizes and geo coordinates in Marble.
25  *
26  * For map tiling with indizes in x and y dimensions and 1 or multiple zoomlevels.
27  * The lowest zoomlevel is 0.
28  */
29 class GEODATA_EXPORT GeoSceneAbstractTileProjection
30 {
31 public:
32  enum Type { Equirectangular, Mercator };
33 
34  /**
35  * @brief Construct a new GeoSceneAbstractTileProjection.
36  */
38 
40 
41 public:
42  virtual GeoSceneAbstractTileProjection::Type type() const = 0;
43 
44  /**
45  * @return the number of tiles on level 0 in x dimension
46  */
47  int levelZeroColumns() const;
48  /**
49  * @brief Sets the number of tiles on level 0 in x dimension
50  *
51  * @param levelZeroColumns new number of tiles on level 0 in x dimension
52  *
53  * Default value of the levelZeroColumns property is 1.
54  */
55  void setLevelZeroColumns(int levelZeroColumns);
56 
57  /**
58  * @return the number of tiles on level 0 in y dimension
59  */
60  int levelZeroRows() const;
61  /**
62  * @brief Sets the number of tiles on level 0 in y dimension
63  *
64  * @param levelZeroRows new number of tiles on level 0 in y dimension
65  *
66  * Default value of the levelZeroRows property is 1.
67  */
68  void setLevelZeroRows(int levelZeroRows);
69 
70  /**
71  * @brief Get the tile indexes which cover the given geographical box.
72  * If @p latLonBox or @p zoomLevel have values out-of-bounds, the behaviour is undefined.
73  *
74  * @param latLonBox the geo coordinates of the requested tiles
75  * @param zoomLevel the zoomlevel of the requested tiles
76  *
77  * @return range of tile indexes covering given geographical box at given zoom level
78  */
79  virtual QRect tileIndexes(const GeoDataLatLonBox &latLonBox, int zoomLevel) const = 0;
80 
81  /**
82  * @brief Get the boundary geo coordinates corresponding to a tile.
83  * If @p x, @p y or @p zoomLevel have values out-of-bounds, the behaviour is undefined.
84  *
85  * @param zoomLevel the zoomlevel of the tile
86  * @param x the x index of the tile
87  * @param y the y index of the tile
88  *
89  * @return geographic bounding box covered by the given tile
90  */
91  virtual GeoDataLatLonBox geoCoordinates(int zoomLevel, int x, int y) const = 0;
92 
93  /**
94  * @brief Get the boundary geo coordinates corresponding to a tile.
95  * If @p tildId has values out-of-bounds, the behaviour is undefined.
96  *
97  * @param tileId the id of the tile
98  *
99  * @return geographic bounding box covered by the given tile
100  */
101  GeoDataLatLonBox geoCoordinates(const TileId &tileId) const;
102 
103  private:
104  Q_DISABLE_COPY(GeoSceneAbstractTileProjection)
106 };
107 
108 }
109 
110 #endif
A class that defines a 2D bounding box for geographic data.
Binds a QML item to a specific geodetic location in screen coordinates.
@ Mercator
Mercator projection.
Definition: MarbleGlobal.h:44
A base class for projections between tile indizes and geo coordinates in Marble.
@ Equirectangular
Flat projection ("plate carree")
Definition: MarbleGlobal.h:43
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Sep 27 2023 04:09:06 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.