Marble

TextureLayer.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2010, 2011 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
4//
5
6#ifndef MARBLE_MARBLETEXTURELAYER_H
7#define MARBLE_MARBLETEXTURELAYER_H
8
9#include "TileLayer.h"
10
11#include "MarbleGlobal.h"
12
14class QImage;
15class QSize;
16
17namespace Marble
18{
19
20class GeoPainter;
21class GeoDataDocument;
22class GeoSceneGroup;
23class GeoSceneAbstractTileProjection;
24class GeoSceneTextureTileDataset;
25class HttpDownloadManager;
26class SunLocator;
27class TileId;
28class ViewportParams;
29class PluginManager;
30
31class MARBLE_EXPORT TextureLayer : public TileLayer
32{
33 Q_OBJECT
34
35public:
36 TextureLayer(HttpDownloadManager *downloadManager, PluginManager *pluginManager, const SunLocator *sunLocator, QAbstractItemModel *groundOverlayModel);
37
38 ~TextureLayer() override;
39
40 void addSeaDocument(const GeoDataDocument *seaDocument);
41
42 void addLandDocument(const GeoDataDocument *landDocument);
43
44 int layerCount() const override;
45
46 /**
47 * @brief Adds texture sublayer, taking ownership of the object's memory
48 * Does nothing if a texture with the same source directory was already
49 * added with this method.
50 * @return returned string is the key for the texture that can be later used to remove it
51 */
52 QString addTextureLayer(GeoSceneTextureTileDataset *texture);
53
54 /**
55 * @brief Removes texture sublayer identified by a key.
56 * Deletes the texture object. Does nothing if key is not found.
57 * @param A key to identify the texture, returned from addTextureLayer
58 */
59 void removeTextureLayer(const QString &key);
60
61 bool showSunShading() const;
62 bool showCityLights() const;
63
64 /**
65 * @brief Return the current tile zoom level. For example for OpenStreetMap
66 * possible values are 1..18, for BlueMarble 0..6.
67 */
68 int tileZoomLevel() const;
69
70 QSize tileSize() const override;
71
72 const GeoSceneAbstractTileProjection *tileProjection() const override;
73
74 int tileColumnCount(int level) const override;
75 int tileRowCount(int level) const override;
76
77 quint64 volatileCacheLimit() const;
78
79 int preferredRadiusCeil(int radius) const;
80 int preferredRadiusFloor(int radius) const;
81
82 RenderState renderState() const override;
83
84 QString runtimeTrace() const override;
85
86 bool render(GeoPainter *painter, ViewportParams *viewport, const QString &renderPos = QLatin1String("NONE"), GeoSceneLayer *layer = nullptr) override;
87
88public Q_SLOTS:
89 void setShowRelief(bool show);
90
91 void setShowSunShading(bool show);
92
93 void setShowCityLights(bool show);
94
95 void setShowTileId(bool show);
96
97 /**
98 * @brief Set the Projection used for the map
99 * @param projection projection type (e.g. Spherical, Equirectangular, Mercator)
100 */
101 void setProjection(Projection projection);
102
103 void setNeedsUpdate();
104
105 void setMapTheme(const QList<const GeoSceneTextureTileDataset *> &textures,
106 const GeoSceneGroup *textureLayerSettings,
107 const QString &seaFile,
108 const QString &landFile);
109
110 void setVolatileCacheLimit(quint64 kilobytes);
111
112 void reset();
113
114 void reload();
115
116 void downloadStackedTile(const TileId &stackedTileId);
117
118Q_SIGNALS:
119 void tileLevelChanged(int);
120 void repaintNeeded();
121
122private:
123 Q_PRIVATE_SLOT(d, void requestDelayedRepaint())
124 Q_PRIVATE_SLOT(d, void updateTextureLayers())
125 Q_PRIVATE_SLOT(d, void updateTile(const TileId &tileId, const QImage &tileImage))
126 Q_PRIVATE_SLOT(d, void addGroundOverlays(const QModelIndex &parent, int first, int last))
127 Q_PRIVATE_SLOT(d, void removeGroundOverlays(const QModelIndex &parent, int first, int last))
128 Q_PRIVATE_SLOT(d, void resetGroundOverlaysCache())
129
130private:
131 class Private;
132 Private *const d;
133};
134
135}
136
137#endif
Q_INVOKABLE void setProjection(uint proj)
KGuiItem reset()
const QList< QKeySequence > & reload()
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:02:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.