Marble

GeoSceneTileDataset.h
1/*
2 SPDX-FileCopyrightText: 2008 Torsten Rahn <rahn@kde.org>
3 SPDX-FileCopyrightText: 2008 Jens-Michael Hoffmann <jensmh@gmx.de>
4 SPDX-FileCopyrightText: 2012 Ander Pijoan <ander.pijoan@deusto.es>
5
6 SPDX-License-Identifier: LGPL-2.1-or-later
7*/
8
9#ifndef MARBLE_GEOSCENETILEDATASET_H
10#define MARBLE_GEOSCENETILEDATASET_H
11
12#include <QList>
13#include <QSize>
14#include <QStringList>
15#include <QUrl>
16
17#include "GeoDataLatLonBox.h"
18#include "GeoSceneAbstractDataset.h"
19#include "GeoSceneAbstractTileProjection.h"
20#include "MarbleGlobal.h"
21
22/**
23 * @short Tiled dataset stored in a layer. TextureTile and VectorTile layes inherit from this class.
24 */
25
26/* In order to make Marble able to manage vector tiles,
27 * now there is GeoSceneTileDataset and then GeoSceneTextureTileDataset
28 * (for the tag <texture> in dgml) or GeoSceneVectorTileDataset
29 * (for <vectortile>) are created, which inherit from this class */
30
31namespace Marble
32{
33class DownloadPolicy;
34class ServerLayout;
35class TileId;
36
37class GEODATA_EXPORT GeoSceneTileDataset : public GeoSceneAbstractDataset
38{
39public:
40 enum StorageLayout {
41 Marble,
42 OpenStreetMap,
43 TileMapService
44 };
45
46 explicit GeoSceneTileDataset(const QString &name);
47 ~GeoSceneTileDataset() override;
48 const char *nodeType() const override;
49
50 QString sourceDir() const;
51 void setSourceDir(const QString &sourceDir);
52
53 QString installMap() const;
54 void setInstallMap(const QString &installMap);
55
56 StorageLayout storageLayout() const;
57 void setStorageLayout(const StorageLayout);
58
59 void setServerLayout(const ServerLayout *);
60 const ServerLayout *serverLayout() const;
61
62 int levelZeroColumns() const;
63 void setLevelZeroColumns(const int);
64
65 int levelZeroRows() const;
66 void setLevelZeroRows(const int);
67
68 bool hasMaximumTileLevel() const;
69 int maximumTileLevel() const;
70 void setMaximumTileLevel(const int);
71
72 int minimumTileLevel() const;
73 void setMinimumTileLevel(int level);
74
75 void setTileLevels(const QString &tileLevels);
76 QList<int> tileLevels() const;
77
78 QList<QUrl> downloadUrls() const;
79
80 const QSize tileSize() const;
81 void setTileSize(const QSize &tileSize);
82
83 /**
84 * @brief set bounds for the texture. Tiles outside of these bounds won't be searched in this texture.
85 * Null box means no bounds.
86 */
87 void setLatLonBox(const GeoDataLatLonBox &box);
88 GeoDataLatLonBox latLonBox() const;
89
90 void setTileProjection(GeoSceneAbstractTileProjection::Type projectionType);
91
92 const GeoSceneAbstractTileProjection *tileProjection() const;
93 GeoSceneAbstractTileProjection::Type tileProjectionType() const;
94
95 QString blending() const;
96 void setBlending(const QString &name);
97
98 /**
99 * Creates a download URL for the given tile id.
100 *
101 * It implements the round robin for the tile servers.
102 * On each invocation the next url is returned.
103 */
104 QUrl downloadUrl(const TileId &) const;
105 void addDownloadUrl(const QUrl &);
106
107 QString relativeTileFileName(const TileId &) const;
108
109 QString themeStr() const;
110
111 QList<const DownloadPolicy *> downloadPolicies() const;
112 void addDownloadPolicy(const DownloadUsage usage, const int maximumConnections);
113
114private:
115 Q_DISABLE_COPY(GeoSceneTileDataset)
116 QStringList hostNames() const;
117
118 QString m_sourceDir;
119 QString m_installMap;
120 StorageLayout m_storageLayoutMode;
121 const ServerLayout *m_serverLayout;
122 int m_levelZeroColumns;
123 int m_levelZeroRows;
124 int m_minimumTileLevel;
125 int m_maximumTileLevel;
126 QList<int> m_tileLevels;
127 mutable QSize m_tileSize;
128 GeoDataLatLonBox m_latLonBox;
129 GeoSceneAbstractTileProjection *m_tileProjection;
130 QString m_blending;
131
132 /// List of Urls which are used in a round robin fashion
133 QList<QUrl> m_downloadUrls;
134
135 /// Points to next Url for the round robin algorithm
136 mutable QList<QUrl>::const_iterator m_nextUrl;
137 QList<const DownloadPolicy *> m_downloadPolicies;
138};
139
140inline bool GeoSceneTileDataset::hasMaximumTileLevel() const
141{
142 return m_maximumTileLevel != -1;
143}
144
145inline QString GeoSceneTileDataset::blending() const
146{
147 return m_blending;
148}
149
150inline void GeoSceneTileDataset::setBlending(const QString &name)
151{
152 m_blending = name;
153}
154
155}
156
157#endif
QString name(StandardAction id)
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 Mon Nov 18 2024 12:15:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.