• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • marble
TileLoader.h
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // Copyright 2010 Jens-Michael Hoffmann <jmho@c-xx.com>
5 // Copyright 2010-2012 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
6 //
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 //
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // Lesser General Public License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public
18 // License along with this library. If not, see <http://www.gnu.org/licenses/>.
19 
20 #ifndef MARBLE_TILELOADER_H
21 #define MARBLE_TILELOADER_H
22 
23 #include <QObject>
24 #include <QString>
25 #include <QImage>
26 
27 #include "TileId.h"
28 #include "GeoDataContainer.h"
29 #include "PluginManager.h"
30 #include "MarbleGlobal.h"
31 
32 class QByteArray;
33 class QImage;
34 class QUrl;
35 
36 namespace Marble
37 {
38 class HttpDownloadManager;
39 class GeoDataDocument;
40 class GeoSceneTiled;
41 class GeoSceneTextureTile;
42 class GeoSceneVectorTile;
43 
44 class TileLoader: public QObject
45 {
46  Q_OBJECT
47 
48  public:
49  enum TileStatus {
50  Missing,
51  Expired,
52  Available
53  };
54 
55  explicit TileLoader(HttpDownloadManager * const, const PluginManager * );
56 
57  QImage loadTileImage( GeoSceneTextureTile const *textureLayer, TileId const & tileId, DownloadUsage const );
58  GeoDataDocument* loadTileVectorData( GeoSceneVectorTile const *textureLayer, TileId const & tileId, DownloadUsage const usage );
59  void downloadTile( GeoSceneTiled const *textureLayer, TileId const &, DownloadUsage const );
60 
61  static int maximumTileLevel( GeoSceneTiled const & texture );
62 
67  static bool baseTilesAvailable( GeoSceneTiled const & texture );
68 
75  static TileStatus tileStatus( GeoSceneTiled const *textureLayer, const TileId &tileId );
76 
77  public Q_SLOTS:
78  void updateTile( QByteArray const & imageData, QString const & tileId );
79 
80  Q_SIGNALS:
81  void downloadTile( QUrl const & sourceUrl, QString const & destinationFileName,
82  QString const & id, DownloadUsage );
83 
84  void tileCompleted( TileId const & tileId, QImage const & tileImage );
85 
86  void tileCompleted( TileId const & tileId, GeoDataDocument * document, QString const & format );
87 
88  private:
89  static QString tileFileName( GeoSceneTiled const * textureLayer, TileId const & );
90  void triggerDownload( GeoSceneTiled const *textureLayer, TileId const &, DownloadUsage const );
91  static QImage scaledLowerLevelTile( GeoSceneTextureTile const * textureLayer, TileId const & );
92 
93  // For vectorTile parsing
94  const PluginManager * m_pluginManager;
95 };
96 
97 }
98 
99 #endif
TileId.h
Marble::PluginManager
The class that handles Marble's plugins.
Definition: PluginManager.h:45
Marble::GeoDataDocument
A container for Features, Styles and in the future Schemas.
Definition: GeoDataDocument.h:65
Marble::GeoSceneVectorTile
Definition: GeoSceneVectorTile.h:23
Marble::TileLoader::TileStatus
TileStatus
Definition: TileLoader.h:49
Marble::DownloadUsage
DownloadUsage
This enum is used to describe the type of download.
Definition: MarbleGlobal.h:164
QByteArray
GeoDataContainer.h
Marble::TileLoader::tileStatus
static TileStatus tileStatus(GeoSceneTiled const *textureLayer, const TileId &tileId)
Returns the status of the downloaded tile file:
Definition: TileLoader.cpp:191
Marble::TileLoader::baseTilesAvailable
static bool baseTilesAvailable(GeoSceneTiled const &texture)
Returns whether the mandatory most basic tile level is fully available for the given texture layer...
Definition: TileLoader.cpp:168
Marble::TileLoader::maximumTileLevel
static int maximumTileLevel(GeoSceneTiled const &texture)
Definition: TileLoader.cpp:138
Marble::GeoSceneTiled
Definition: GeoSceneTiled.h:43
Marble::TileLoader::loadTileVectorData
GeoDataDocument * loadTileVectorData(GeoSceneVectorTile const *textureLayer, TileId const &tileId, DownloadUsage const usage)
Definition: TileLoader.cpp:90
Marble::TileLoader::updateTile
void updateTile(QByteArray const &imageData, QString const &tileId)
Definition: TileLoader.cpp:205
Marble::TileLoader::Expired
Definition: TileLoader.h:51
Marble::TileLoader::tileCompleted
void tileCompleted(TileId const &tileId, QImage const &tileImage)
QObject
Marble::TileLoader::Missing
Definition: TileLoader.h:50
Marble::TileLoader::TileLoader
TileLoader(HttpDownloadManager *const, const PluginManager *)
Definition: TileLoader.cpp:43
QString
MarbleGlobal.h
QUrl
QImage
Marble::TileId
Definition: TileId.h:27
PluginManager.h
Marble::TileLoader::downloadTile
void downloadTile(GeoSceneTiled const *textureLayer, TileId const &, DownloadUsage const )
Definition: TileLoader.cpp:133
Marble::TileLoader::Available
Definition: TileLoader.h:52
Marble::GeoSceneTextureTile
Definition: GeoSceneTextureTile.h:23
Marble::TileLoader::loadTileImage
QImage loadTileImage(GeoSceneTextureTile const *textureLayer, TileId const &tileId, DownloadUsage const )
Definition: TileLoader.cpp:56
Marble::HttpDownloadManager
This class manages scheduled downloads.
Definition: HttpDownloadManager.h:44
Marble::TileLoader
Definition: TileLoader.h:44
usage
void usage(const QString &app)
Definition: merge_ts_po.cpp:16
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:42 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal