Marble

GeoSceneAbstractTileProjection.h
1/*
2 SPDX-FileCopyrightText: 2016 Friedrich W. H. Kossebau <kossebau@kde.org>
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
15namespace Marble
16{
17
18class GeoSceneAbstractTileProjectionPrivate;
19
20class GeoDataLatLonBox;
21class 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 */
30{
31public:
32 enum Type {
35 };
36
37 /**
38 * @brief Construct a new GeoSceneAbstractTileProjection.
39 */
41
43
44public:
45 virtual GeoSceneAbstractTileProjection::Type type() const = 0;
46
47 /**
48 * @return the number of tiles on level 0 in x dimension
49 */
50 int levelZeroColumns() const;
51 /**
52 * @brief Sets the number of tiles on level 0 in x dimension
53 *
54 * @param levelZeroColumns new number of tiles on level 0 in x dimension
55 *
56 * Default value of the levelZeroColumns property is 1.
57 */
58 void setLevelZeroColumns(int levelZeroColumns);
59
60 /**
61 * @return the number of tiles on level 0 in y dimension
62 */
63 int levelZeroRows() const;
64 /**
65 * @brief Sets the number of tiles on level 0 in y dimension
66 *
67 * @param levelZeroRows new number of tiles on level 0 in y dimension
68 *
69 * Default value of the levelZeroRows property is 1.
70 */
71 void setLevelZeroRows(int levelZeroRows);
72
73 /**
74 * @brief Get the tile indexes which cover the given geographical box.
75 * If @p latLonBox or @p zoomLevel have values out-of-bounds, the behaviour is undefined.
76 *
77 * @param latLonBox the geo coordinates of the requested tiles
78 * @param zoomLevel the zoomlevel of the requested tiles
79 *
80 * @return range of tile indexes covering given geographical box at given zoom level
81 */
82 virtual QRect tileIndexes(const GeoDataLatLonBox &latLonBox, int zoomLevel) const = 0;
83
84 /**
85 * @brief Get the boundary geo coordinates corresponding to a tile.
86 * If @p x, @p y or @p zoomLevel have values out-of-bounds, the behaviour is undefined.
87 *
88 * @param zoomLevel the zoomlevel of the tile
89 * @param x the x index of the tile
90 * @param y the y index of the tile
91 *
92 * @return geographic bounding box covered by the given tile
93 */
94 virtual GeoDataLatLonBox geoCoordinates(int zoomLevel, int x, int y) const = 0;
95
96 /**
97 * @brief Get the boundary geo coordinates corresponding to a tile.
98 * If @p tildId has values out-of-bounds, the behaviour is undefined.
99 *
100 * @param tileId the id of the tile
101 *
102 * @return geographic bounding box covered by the given tile
103 */
104 GeoDataLatLonBox geoCoordinates(const TileId &tileId) const;
105
106private:
107 Q_DISABLE_COPY(GeoSceneAbstractTileProjection)
109};
110
111}
112
113#endif
A class that defines a 2D bounding box for geographic data.
A base class for projections between tile indizes and geo coordinates in Marble.
virtual GeoDataLatLonBox geoCoordinates(int zoomLevel, int x, int y) const =0
Get the boundary geo coordinates corresponding to a tile.
virtual QRect tileIndexes(const GeoDataLatLonBox &latLonBox, int zoomLevel) const =0
Get the tile indexes which cover the given geographical box.
Binds a QML item to a specific geodetic location in screen coordinates.
@ Mercator
Mercator projection.
@ Equirectangular
Flat projection ("plate carree")
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:55:53 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.