• 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
VectorTileModel.h
Go to the documentation of this file.
1 /*
2  This file is part of the Marble Virtual Globe.
3 
4  This program is free software licensed under the GNU LGPL. You can
5  find a copy of this license in LICENSE.txt in the top directory of
6  the source code.
7 
8  Copyright 2012 Ander Pijoan <ander.pijoan@deusto.es>
9  Copyright 2013 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
10 */
11 
12 #ifndef MARBLE_VECTORTILEMAPPER_H
13 #define MARBLE_VECTORTILEMAPPER_H
14 
15 #include <QObject>
16 #include <QRunnable>
17 
18 #include <QCache>
19 
20 #include "TileId.h"
21 
22 class QThreadPool;
23 
24 namespace Marble
25 {
26 
27 class GeoDataDocument;
28 class GeoDataLatLonBox;
29 class GeoDataTreeModel;
30 class GeoSceneVectorTile;
31 class TileLoader;
32 
33 class TileRunner : public QObject, public QRunnable
34 {
35  Q_OBJECT
36 
37 public:
38  TileRunner( TileLoader *loader, const GeoSceneVectorTile *texture, const TileId &id );
39  void run();
40 
41 Q_SIGNALS:
42  void documentLoaded( const TileId &id, GeoDataDocument *document );
43 
44 private:
45  TileLoader *const m_loader;
46  const GeoSceneVectorTile *const m_texture;
47  const TileId m_id;
48 };
49 
50 class VectorTileModel : public QObject
51 {
52  Q_OBJECT
53 
54 public:
55  explicit VectorTileModel( TileLoader *loader, const GeoSceneVectorTile *layer, GeoDataTreeModel *treeModel, QThreadPool *threadPool );
56 
57  void setViewport( const GeoDataLatLonBox &bbox, int radius );
58 
59  QString name() const;
60 
61 public Q_SLOTS:
62  void updateTile( const TileId &id, GeoDataDocument *document );
63 
64  void clear();
65 
66 Q_SIGNALS:
67  void tileCompleted( const TileId &tileId );
68 
69 private:
70  void setViewport( int tileZoomLevel, unsigned int minX, unsigned int minY, unsigned int maxX, unsigned int maxY );
71 
72  static unsigned int lon2tileX( qreal lon, unsigned int maxTileX );
73  static unsigned int lat2tileY( qreal lat, unsigned int maxTileY );
74 
75 private:
76  struct CacheDocument
77  {
79  CacheDocument( GeoDataDocument *doc, GeoDataTreeModel *model );
80 
82  ~CacheDocument();
83 
84  GeoDataDocument *const m_document;
85  GeoDataTreeModel *const m_treeModel;
86 
87  private:
88  Q_DISABLE_COPY( CacheDocument )
89  };
90 
91  TileLoader *const m_loader;
92  const GeoSceneVectorTile *const m_layer;
93  GeoDataTreeModel *const m_treeModel;
94  QThreadPool *const m_threadPool;
95  int m_tileZoomLevel;
96  QCache<TileId, CacheDocument> m_documents;
97 };
98 
99 }
100 
101 #endif // MARBLE_VECTORTILEMAPPER_H
TileId.h
Marble::GeoDataDocument
A container for Features, Styles and in the future Schemas.
Definition: GeoDataDocument.h:65
Marble::GeoSceneVectorTile
Definition: GeoSceneVectorTile.h:23
Marble::GeoDataTreeModel
The representation of GeoData in a model This class represents all available data given by kml-data f...
Definition: GeoDataTreeModel.h:32
Marble::TileRunner::documentLoaded
void documentLoaded(const TileId &id, GeoDataDocument *document)
Marble::VectorTileModel::setViewport
void setViewport(const GeoDataLatLonBox &bbox, int radius)
Definition: VectorTileModel.cpp:66
QThreadPool
Marble::VectorTileModel
Definition: VectorTileModel.h:50
Marble::VectorTileModel::tileCompleted
void tileCompleted(const TileId &tileId)
Marble::TileRunner::run
void run()
Definition: VectorTileModel.cpp:36
QRunnable
Marble::TileRunner
Definition: VectorTileModel.h:33
QObject
Marble::radius
static qreal radius(qreal zoom)
Definition: thumbnailer.cpp:99
Marble::VectorTileModel::VectorTileModel
VectorTileModel(TileLoader *loader, const GeoSceneVectorTile *layer, GeoDataTreeModel *treeModel, QThreadPool *threadPool)
Definition: VectorTileModel.cpp:57
Marble::VectorTileModel::updateTile
void updateTile(const TileId &id, GeoDataDocument *document)
Definition: VectorTileModel.cpp:155
QString
QCache
Marble::TileRunner::TileRunner
TileRunner(TileLoader *loader, const GeoSceneVectorTile *texture, const TileId &id)
Definition: VectorTileModel.cpp:29
Marble::TileId
Definition: TileId.h:27
Marble::VectorTileModel::name
QString name() const
Definition: VectorTileModel.cpp:150
Marble::VectorTileModel::clear
void clear()
Definition: VectorTileModel.cpp:166
Marble::GeoDataLatLonBox
A class that defines a 2D bounding box for geographic data.
Definition: GeoDataLatLonBox.h:51
Marble::TileLoader
Definition: TileLoader.h:44
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