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

marble

  • sources
  • kde-4.12
  • kdeedu
  • marble
  • src
  • lib
  • marble
MarbleModel.cpp
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 2006-2007 Torsten Rahn <tackat@kde.org>
9 // Copyright 2007 Inge Wallin <ingwa@kde.org>
10 // Copyright 2008, 2009, 2010 Jens-Michael Hoffmann <jmho@c-xx.com>
11 // Copyright 2008-2009 Patrick Spendrin <ps_ml@gmx.de>
12 // Copyright 2010-2013 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
13 //
14 
15 #include "MarbleModel.h"
16 
17 #include <cmath>
18 
19 #include <QAtomicInt>
20 #include <QPointer>
21 #include <QTime>
22 #include <QTimer>
23 #include <QAbstractItemModel>
24 #include <QSet>
25 #include <QItemSelectionModel>
26 #include <QSortFilterProxyModel>
27 
28 #if (QT_VERSION >= 0x040700 && QT_VERSION < 0x040800)
29 // See comment below why this is needed
30 #include <QNetworkConfigurationManager>
31 #endif
32 
33 #include "kdescendantsproxymodel.h"
34 
35 #include "MapThemeManager.h"
36 #include "MarbleGlobal.h"
37 #include "MarbleDebug.h"
38 
39 #include "GeoSceneDocument.h"
40 #include "GeoSceneGeodata.h"
41 #include "GeoSceneHead.h"
42 #include "GeoSceneLayer.h"
43 #include "GeoSceneMap.h"
44 #include "GeoScenePalette.h"
45 #include "GeoSceneTiled.h"
46 #include "GeoSceneVector.h"
47 
48 #include "GeoDataDocument.h"
49 #include "GeoDataStyle.h"
50 #include "GeoDataTypes.h"
51 
52 #include "DgmlAuxillaryDictionary.h"
53 #include "MarbleClock.h"
54 #include "FileStoragePolicy.h"
55 #include "FileStorageWatcher.h"
56 #include "PositionTracking.h"
57 #include "HttpDownloadManager.h"
58 #include "MarbleDirs.h"
59 #include "FileManager.h"
60 #include "GeoDataTreeModel.h"
61 #include "Planet.h"
62 #include "PluginManager.h"
63 #include "StoragePolicy.h"
64 #include "SunLocator.h"
65 #include "TileCreator.h"
66 #include "TileCreatorDialog.h"
67 #include "TileLoader.h"
68 #include "routing/RoutingManager.h"
69 #include "BookmarkManager.h"
70 #include "ElevationModel.h"
71 
72 namespace Marble
73 {
74 
75 class MarbleModelPrivate
76 {
77  public:
78  MarbleModelPrivate()
79  : m_clock(),
80  m_planet( new Planet( "earth" ) ),
81  m_sunLocator( &m_clock, m_planet ),
82  m_pluginManager(),
83  m_homePoint( -9.4, 54.8, 0.0, GeoDataCoordinates::Degree ), // Some point that tackat defined. :-)
84  m_homeZoom( 1050 ),
85  m_mapTheme( 0 ),
86  m_storagePolicy( MarbleDirs::localPath() ),
87  m_downloadManager( &m_storagePolicy ),
88  m_storageWatcher( MarbleDirs::localPath() ),
89  m_fileManager( 0 ),
90  m_treeModel(),
91  m_descendantProxy(),
92  m_placemarkProxyModel(),
93  m_placemarkSelectionModel( 0 ),
94  m_positionTracking( &m_treeModel ),
95  m_trackedPlacemark( 0 ),
96  m_bookmarkManager( &m_treeModel ),
97  m_routingManager( 0 ),
98  m_legend( 0 ),
99  m_workOffline( false )
100  {
101  m_descendantProxy.setSourceModel( &m_treeModel );
102 
103  m_placemarkProxyModel.setFilterFixedString( GeoDataTypes::GeoDataPlacemarkType );
104  m_placemarkProxyModel.setFilterKeyColumn( 1 );
105  m_placemarkProxyModel.setSourceModel( &m_descendantProxy );
106 
107  m_groundOverlayProxyModel.setFilterFixedString( GeoDataTypes::GeoDataGroundOverlayType );
108  m_groundOverlayProxyModel.setFilterKeyColumn( 1 );
109  m_groundOverlayProxyModel.setSourceModel( &m_descendantProxy );
110  }
111 
112  ~MarbleModelPrivate()
113  {
114  }
115 
116  // Misc stuff.
117  MarbleClock m_clock;
118  Planet *m_planet;
119  SunLocator m_sunLocator;
120 
121  PluginManager m_pluginManager;
122 
123  // The home position
124  GeoDataCoordinates m_homePoint;
125  int m_homeZoom;
126 
127  // View and paint stuff
128  GeoSceneDocument *m_mapTheme;
129 
130  FileStoragePolicy m_storagePolicy;
131  HttpDownloadManager m_downloadManager;
132 
133  // Cache related
134  FileStorageWatcher m_storageWatcher;
135 
136  // Places on the map
137  FileManager *m_fileManager;
138 
139  GeoDataTreeModel m_treeModel;
140  KDescendantsProxyModel m_descendantProxy;
141  QSortFilterProxyModel m_placemarkProxyModel;
142  QSortFilterProxyModel m_groundOverlayProxyModel;
143 
144  // Selection handling
145  QItemSelectionModel m_placemarkSelectionModel;
146 
147  //Gps Stuff
148  PositionTracking m_positionTracking;
149 
150  const GeoDataPlacemark *m_trackedPlacemark;
151 
152  BookmarkManager m_bookmarkManager;
153  RoutingManager *m_routingManager;
154  QTextDocument *m_legend;
155 
156  bool m_workOffline;
157 
158  ElevationModel *m_elevationModel;
159 };
160 
161 MarbleModel::MarbleModel( QObject *parent )
162  : QObject( parent ),
163  d( new MarbleModelPrivate() )
164 {
165 #if (QT_VERSION >= 0x040700 && QT_VERSION < 0x040800)
166  // fix for KDE bug 288612
167  // Due to a race condition in Qt 4.7 (https://bugreports.qt-project.org/browse/QTBUG-22107),
168  // a segfault might occur at startup when e.g. reverse geocoding is called very early.
169  // The race condition can be avoided by instantiating QNetworkConfigurationManager
170  // when only one thread is running (i.e. here).
171  // QNetworkConfigurationManager was introduced in Qt 4.7, the bug is fixed
172  // in 4.8, thus the Qt version check.
173  new QNetworkConfigurationManager( this );
174 #endif
175 
176  // The thread will be started at setting persistent tile cache size.
177  connect( this, SIGNAL(themeChanged(QString)),
178  &d->m_storageWatcher, SLOT(updateTheme(QString)) );
179 
180  // connect the StoragePolicy used by the download manager to the FileStorageWatcher
181  connect( &d->m_storagePolicy, SIGNAL(cleared()),
182  &d->m_storageWatcher, SLOT(resetCurrentSize()) );
183  connect( &d->m_storagePolicy, SIGNAL(sizeChanged(qint64)),
184  &d->m_storageWatcher, SLOT(addToCurrentSize(qint64)) );
185 
186  d->m_fileManager = new FileManager( this );
187 
188  d->m_routingManager = new RoutingManager( this, this );
189 
190  connect(&d->m_clock, SIGNAL(timeChanged()),
191  &d->m_sunLocator, SLOT(update()) );
192 
193  d->m_elevationModel = new ElevationModel( this );
194 }
195 
196 MarbleModel::~MarbleModel()
197 {
198  delete d->m_fileManager;
199  delete d->m_mapTheme;
200  delete d->m_planet;
201  delete d;
202 
203  mDebug() << "Model deleted:" << this;
204 }
205 
206 BookmarkManager *MarbleModel::bookmarkManager()
207 {
208  return &d->m_bookmarkManager;
209 }
210 
211 QString MarbleModel::mapThemeId() const
212 {
213  QString mapThemeId = "";
214 
215  if (d->m_mapTheme)
216  mapThemeId = d->m_mapTheme->head()->mapThemeId();
217 
218  return mapThemeId;
219 }
220 
221 GeoSceneDocument *MarbleModel::mapTheme()
222 {
223  return d->m_mapTheme;
224 }
225 
226 const GeoSceneDocument *MarbleModel::mapTheme() const
227 {
228  return d->m_mapTheme;
229 }
230 
231 // Set a particular theme for the map and load the appropriate tile level.
232 // If the tiles (for the lowest tile level) haven't been created already
233 // then create them here and now.
234 //
235 // FIXME: Move the tile creation dialogs out of this function. Change
236 // them into signals instead.
237 // FIXME: Get rid of 'currentProjection' here. It's totally misplaced.
238 //
239 
240 void MarbleModel::setMapThemeId( const QString &mapThemeId )
241 {
242  if ( !mapThemeId.isEmpty() && mapThemeId == this->mapThemeId() )
243  return;
244 
245  GeoSceneDocument *mapTheme = MapThemeManager::loadMapTheme( mapThemeId );
246  if ( !mapTheme ) {
247  // Check whether the previous theme works
248  if ( d->m_mapTheme ){
249  qWarning() << "Selected theme doesn't work, so we stick to the previous one";
250  return;
251  }
252 
253  // Fall back to default theme
254  QString defaultTheme = "earth/srtm/srtm.dgml";
255  qWarning() << "Falling back to default theme:" << defaultTheme;
256  mapTheme = MapThemeManager::loadMapTheme( defaultTheme );
257  }
258 
259  // If this last resort doesn't work either shed a tear and exit
260  if ( !mapTheme ) {
261  qWarning() << "Couldn't find a valid DGML map.";
262  return;
263  }
264 
265  // find the list of previous theme's geodata
266  QList<GeoSceneGeodata> currentDatasets;
267  if ( d->m_mapTheme ) {
268  foreach ( GeoSceneLayer *layer, d->m_mapTheme->map()->layers() ) {
269  if ( layer->backend() != dgml::dgmlValue_geodata )
270  continue;
271 
272  // look for documents
273  foreach ( GeoSceneAbstractDataset *dataset, layer->datasets() ) {
274  GeoSceneGeodata *data = dynamic_cast<GeoSceneGeodata*>( dataset );
275  Q_ASSERT( data );
276  currentDatasets << *data;
277  }
278  }
279  }
280 
281  delete d->m_mapTheme;
282  d->m_mapTheme = mapTheme;
283 
284  addDownloadPolicies( d->m_mapTheme );
285 
286  // Some output to show how to use this stuff ...
287  mDebug() << "DGML2 Name : " << d->m_mapTheme->head()->name();
288 /*
289  mDebug() << "DGML2 Description: " << d->m_mapTheme->head()->description();
290 
291  if ( d->m_mapTheme->map()->hasTextureLayers() )
292  mDebug() << "Contains texture layers! ";
293  else
294  mDebug() << "Does not contain any texture layers! ";
295 
296  mDebug() << "Number of SRTM textures: " << d->m_mapTheme->map()->layer("srtm")->datasets().count();
297 
298  if ( d->m_mapTheme->map()->hasVectorLayers() )
299  mDebug() << "Contains vector layers! ";
300  else
301  mDebug() << "Does not contain any vector layers! ";
302 */
303  //Don't change the planet unless we have to...
304  qreal const radiusAttributeValue = d->m_mapTheme->head()->radius();
305  if( d->m_mapTheme->head()->target().toLower() != d->m_planet->id() || radiusAttributeValue != d->m_planet->radius() ) {
306  mDebug() << "Changing Planet";
307  *(d->m_planet) = Planet( d->m_mapTheme->head()->target().toLower() );
308  if ( radiusAttributeValue > 0.0 ) {
309  d->m_planet->setRadius( radiusAttributeValue );
310  }
311  sunLocator()->setPlanet(d->m_planet);
312  }
313 
314  QStringList fileList;
315  QStringList propertyList;
316  QList<GeoDataStyle*> styleList;
317 
318  foreach ( GeoSceneLayer *layer, d->m_mapTheme->map()->layers() ) {
319  if ( layer->backend() != dgml::dgmlValue_geodata )
320  continue;
321 
322  GeoSceneGeodata emptyData("empty");
323  // look for datasets which are different from currentDatasets
324  foreach ( GeoSceneAbstractDataset *dataset, layer->datasets() ) {
325  GeoSceneGeodata *data = dynamic_cast<GeoSceneGeodata*>( dataset );
326  Q_ASSERT( data );
327  if( currentDatasets.removeOne( *data ) ) {
328  continue;
329  }
330  QString filename = data->sourceFile();
331  QString property = data->property();
332  QPen pen = data->pen();
333  QBrush brush = data->brush();
334  GeoDataLineStyle *lineStyle = 0;
335  GeoDataPolyStyle* polyStyle = 0;
336  GeoDataStyle* style = 0;
337 
338  if( pen != emptyData.pen() ) {
339  lineStyle = new GeoDataLineStyle( pen.color() );
340  lineStyle->setPenStyle( pen.style() );
341  lineStyle->setWidth( pen.width() );
342  }
343 
344  if( brush != emptyData.brush() ) {
345  polyStyle = new GeoDataPolyStyle( brush.color() );
346  polyStyle->setFill( true );
347  }
348 
349  if( lineStyle || polyStyle ) {
350  style = new GeoDataStyle;
351  if( lineStyle ) {
352  style->setLineStyle( *lineStyle );
353  }
354  if( polyStyle ) {
355  style->setPolyStyle( *polyStyle );
356  }
357  style->setStyleId( "default" );
358  }
359 
360  fileList << filename;
361  propertyList << property;
362  styleList << style;
363  }
364  }
365  // unload old currentDatasets which are not part of the new map
366  foreach(const GeoSceneGeodata data, currentDatasets) {
367  d->m_fileManager->removeFile( data.sourceFile() );
368  }
369  // load new datasets
370  d->m_fileManager->addFile( fileList, propertyList, styleList, MapDocument );
371 
372  mDebug() << "THEME CHANGED: ***" << mapTheme->head()->mapThemeId();
373  emit themeChanged( mapTheme->head()->mapThemeId() );
374 }
375 
376 void MarbleModel::home( qreal &lon, qreal &lat, int& zoom ) const
377 {
378  d->m_homePoint.geoCoordinates( lon, lat, GeoDataCoordinates::Degree );
379  zoom = d->m_homeZoom;
380 }
381 
382 void MarbleModel::setHome( qreal lon, qreal lat, int zoom )
383 {
384  d->m_homePoint = GeoDataCoordinates( lon, lat, 0, GeoDataCoordinates::Degree );
385  d->m_homeZoom = zoom;
386  emit homeChanged( d->m_homePoint );
387 }
388 
389 void MarbleModel::setHome( const GeoDataCoordinates& homePoint, int zoom )
390 {
391  d->m_homePoint = homePoint;
392  d->m_homeZoom = zoom;
393  emit homeChanged( d->m_homePoint );
394 }
395 
396 HttpDownloadManager *MarbleModel::downloadManager()
397 {
398  return &d->m_downloadManager;
399 }
400 
401 const HttpDownloadManager *MarbleModel::downloadManager() const
402 {
403  return &d->m_downloadManager;
404 }
405 
406 
407 GeoDataTreeModel *MarbleModel::treeModel()
408 {
409  return &d->m_treeModel;
410 }
411 
412 const GeoDataTreeModel *MarbleModel::treeModel() const
413 {
414  return &d->m_treeModel;
415 }
416 
417 QAbstractItemModel *MarbleModel::placemarkModel()
418 {
419  return &d->m_placemarkProxyModel;
420 }
421 
422 const QAbstractItemModel *MarbleModel::placemarkModel() const
423 {
424  return &d->m_placemarkProxyModel;
425 }
426 
427 QAbstractItemModel *MarbleModel::groundOverlayModel()
428 {
429  return &d->m_groundOverlayProxyModel;
430 }
431 
432 const QAbstractItemModel *MarbleModel::groundOverlayModel() const
433 {
434  return &d->m_groundOverlayProxyModel;
435 }
436 
437 QItemSelectionModel *MarbleModel::placemarkSelectionModel()
438 {
439  return &d->m_placemarkSelectionModel;
440 }
441 
442 PositionTracking *MarbleModel::positionTracking() const
443 {
444  return &d->m_positionTracking;
445 }
446 
447 FileManager *MarbleModel::fileManager()
448 {
449  return d->m_fileManager;
450 }
451 
452 qreal MarbleModel::planetRadius() const
453 {
454  return d->m_planet->radius();
455 }
456 
457 QString MarbleModel::planetName() const
458 {
459  return d->m_planet->name();
460 }
461 
462 QString MarbleModel::planetId() const
463 {
464  return d->m_planet->id();
465 }
466 
467 MarbleClock *MarbleModel::clock()
468 {
469  return &d->m_clock;
470 }
471 
472 const MarbleClock *MarbleModel::clock() const
473 {
474  return &d->m_clock;
475 }
476 
477 SunLocator *MarbleModel::sunLocator()
478 {
479  return &d->m_sunLocator;
480 }
481 
482 const SunLocator *MarbleModel::sunLocator() const
483 {
484  return &d->m_sunLocator;
485 }
486 
487 quint64 MarbleModel::persistentTileCacheLimit() const
488 {
489  return d->m_storageWatcher.cacheLimit() / 1024;
490 }
491 
492 void MarbleModel::clearPersistentTileCache()
493 {
494  d->m_storagePolicy.clearCache();
495 
496  // Now create base tiles again if needed
497  if ( d->m_mapTheme->map()->hasTextureLayers() || d->m_mapTheme->map()->hasVectorLayers() ) {
498  // If the tiles aren't already there, put up a progress dialog
499  // while creating them.
500 
501  // As long as we don't have an Layer Management Class we just lookup
502  // the name of the layer that has the same name as the theme ID
503  QString themeID = d->m_mapTheme->head()->theme();
504 
505  const GeoSceneLayer *layer =
506  static_cast<const GeoSceneLayer*>( d->m_mapTheme->map()->layer( themeID ) );
507  const GeoSceneTiled *texture =
508  static_cast<const GeoSceneTiled*>( layer->groundDataset() );
509 
510  QString sourceDir = texture->sourceDir();
511  QString installMap = texture->installMap();
512  QString role = d->m_mapTheme->map()->layer( themeID )->role();
513 
514  if ( !TileLoader::baseTilesAvailable( *texture )
515  && !installMap.isEmpty() )
516  {
517  mDebug() << "Base tiles not available. Creating Tiles ... \n"
518  << "SourceDir: " << sourceDir << "InstallMap:" << installMap;
519  MarbleDirs::debug();
520 
521  TileCreator *tileCreator = new TileCreator(
522  sourceDir,
523  installMap,
524  (role == "dem") ? "true" : "false" );
525  tileCreator->setTileFormat( texture->fileFormat().toLower() );
526 
527  QPointer<TileCreatorDialog> tileCreatorDlg = new TileCreatorDialog( tileCreator, 0 );
528  tileCreatorDlg->setSummary( d->m_mapTheme->head()->name(),
529  d->m_mapTheme->head()->description() );
530  tileCreatorDlg->exec();
531  qDebug("Tile creation completed");
532  delete tileCreatorDlg;
533  }
534  }
535 }
536 
537 void MarbleModel::setPersistentTileCacheLimit(quint64 kiloBytes)
538 {
539  d->m_storageWatcher.setCacheLimit( kiloBytes * 1024 );
540 
541  if( kiloBytes != 0 )
542  {
543  if( !d->m_storageWatcher.isRunning() )
544  d->m_storageWatcher.start( QThread::IdlePriority );
545  }
546  else
547  {
548  d->m_storageWatcher.quit();
549  }
550  // TODO: trigger update
551 }
552 
553 void MarbleModel::setTrackedPlacemark( const GeoDataPlacemark *placemark )
554 {
555  d->m_trackedPlacemark = placemark;
556  emit trackedPlacemarkChanged( placemark );
557 }
558 
559 const GeoDataPlacemark* MarbleModel::trackedPlacemark() const
560 {
561  return d->m_trackedPlacemark;
562 }
563 
564 const PluginManager* MarbleModel::pluginManager() const
565 {
566  return &d->m_pluginManager;
567 }
568 
569 PluginManager* MarbleModel::pluginManager()
570 {
571  return &d->m_pluginManager;
572 }
573 
574 const Planet *MarbleModel::planet() const
575 {
576  return d->m_planet;
577 }
578 
579 void MarbleModel::addDownloadPolicies( const GeoSceneDocument *mapTheme )
580 {
581  if ( !mapTheme )
582  return;
583  if ( !mapTheme->map()->hasTextureLayers() && !mapTheme->map()->hasVectorLayers() )
584  return;
585 
586  // As long as we don't have an Layer Management Class we just lookup
587  // the name of the layer that has the same name as the theme ID
588  const QString themeId = mapTheme->head()->theme();
589  const GeoSceneLayer * const layer = static_cast<const GeoSceneLayer*>( mapTheme->map()->layer( themeId ));
590  if ( !layer )
591  return;
592 
593  const GeoSceneTiled * const texture = static_cast<const GeoSceneTiled*>( layer->groundDataset() );
594  if ( !texture )
595  return;
596 
597  QList<const DownloadPolicy *> policies = texture->downloadPolicies();
598  QList<const DownloadPolicy *>::const_iterator pos = policies.constBegin();
599  QList<const DownloadPolicy *>::const_iterator const end = policies.constEnd();
600  for (; pos != end; ++pos ) {
601  d->m_downloadManager.addDownloadPolicy( **pos );
602  }
603 }
604 
605 RoutingManager* MarbleModel::routingManager()
606 {
607  return d->m_routingManager;
608 }
609 
610 const RoutingManager* MarbleModel::routingManager() const
611 {
612  return d->m_routingManager;
613 }
614 
615 void MarbleModel::setClockDateTime( const QDateTime& datetime )
616 {
617  d->m_clock.setDateTime( datetime );
618 }
619 
620 QDateTime MarbleModel::clockDateTime() const
621 {
622  return d->m_clock.dateTime();
623 }
624 
625 int MarbleModel::clockSpeed() const
626 {
627  return d->m_clock.speed();
628 }
629 
630 void MarbleModel::setClockSpeed( int speed )
631 {
632  d->m_clock.setSpeed( speed );
633 }
634 
635 void MarbleModel::setClockTimezone( int timeInSec )
636 {
637  d->m_clock.setTimezone( timeInSec );
638 }
639 
640 int MarbleModel::clockTimezone() const
641 {
642  return d->m_clock.timezone();
643 }
644 
645 QTextDocument * MarbleModel::legend()
646 {
647  return d->m_legend;
648 }
649 
650 void MarbleModel::setLegend( QTextDocument * legend )
651 {
652  d->m_legend = legend;
653 }
654 
655 void MarbleModel::addGeoDataFile( const QString& filename )
656 {
657  GeoDataStyle* dummyStyle = new GeoDataStyle;
658  d->m_fileManager->addFile( filename, filename, dummyStyle, UserDocument, true );
659 }
660 
661 void MarbleModel::addGeoDataString( const QString& data, const QString& key )
662 {
663  d->m_fileManager->addData( key, data, UserDocument );
664 }
665 
666 void MarbleModel::removeGeoData( const QString& fileName )
667 {
668  d->m_fileManager->removeFile( fileName );
669 }
670 
671 void MarbleModel::updateProperty( const QString &property, bool value )
672 {
673  foreach( GeoDataFeature *feature, d->m_treeModel.rootDocument()->featureList()) {
674  if( feature->nodeType() == GeoDataTypes::GeoDataDocumentType ) {
675  GeoDataDocument *document = static_cast<GeoDataDocument*>( feature );
676  if( document->property() == property ){
677  document->setVisible( value );
678  d->m_treeModel.updateFeature( document );
679  }
680  }
681  }
682 }
683 
684 bool MarbleModel::workOffline() const
685 {
686  return d->m_workOffline;
687 }
688 
689 void MarbleModel::setWorkOffline( bool workOffline )
690 {
691  if ( d->m_workOffline != workOffline ) {
692  downloadManager()->setDownloadEnabled( !workOffline );
693 
694  d->m_workOffline = workOffline;
695  emit workOfflineChanged();
696  }
697 }
698 
699 ElevationModel* MarbleModel::elevationModel()
700 {
701  return d->m_elevationModel;
702 }
703 
704 const ElevationModel* MarbleModel::elevationModel() const
705 {
706  return d->m_elevationModel;
707 }
708 
709 }
710 
711 #include "MarbleModel.moc"
GeoSceneHead.h
GeoDataDocument.h
Marble::MarbleModel::clearPersistentTileCache
void clearPersistentTileCache()
Definition: MarbleModel.cpp:492
Marble::GeoSceneLayer::groundDataset
const GeoSceneAbstractDataset * groundDataset() const
Definition: GeoSceneLayer.cpp:108
Marble::GeoDataLineStyle
specifies the style how lines are drawn
Definition: GeoDataLineStyle.h:36
TileLoader.h
Marble::GeoDataDocument::property
QString property() const
Definition: GeoDataDocument.cpp:67
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
Marble::GeoSceneTiled::installMap
QString installMap() const
Definition: GeoSceneTiled.cpp:66
FileStoragePolicy.h
Marble::GeoSceneDocument::map
const GeoSceneMap * map() const
Definition: GeoSceneDocument.cpp:96
GeoScenePalette.h
FileManager.h
Marble::GeoDataStyleSelector::setStyleId
void setStyleId(const QString &value)
Set a new style id.
Definition: GeoDataStyleSelector.cpp:60
Marble::PluginManager
The class that handles Marble's plugins.
Definition: PluginManager.h:45
Marble::MarbleModel::setPersistentTileCacheLimit
void setPersistentTileCacheLimit(quint64 kiloBytes)
Set the limit of the persistent (on hard disc) tile cache.
Definition: MarbleModel.cpp:537
Marble::GeoDataDocument
A container for Features, Styles and in the future Schemas.
Definition: GeoDataDocument.h:64
Marble::MarbleModel::removeGeoData
void removeGeoData(const QString &key)
Remove the file or raw data from the treeModel.
Definition: MarbleModel.cpp:666
Marble::MarbleModel::setMapThemeId
void setMapThemeId(const QString &mapThemeId)
Set a new map theme to use.
Definition: MarbleModel.cpp:240
Marble::MarbleModel::mapTheme
GeoSceneDocument * mapTheme()
Definition: MarbleModel.cpp:221
Marble::GeoDataTreeModel
The representation of GeoData in a model This class represents all available data given by kml-data f...
Definition: GeoDataTreeModel.h:32
GeoSceneGeodata.h
Marble::MarbleModel::workOffline
bool workOffline() const
KDescendantsProxyModel
Proxy Model for restructuring a Tree into a list.
Definition: kdescendantsproxymodel.h:69
Marble::GeoSceneHead::mapThemeId
QString mapThemeId() const
Definition: GeoSceneHead.cpp:116
Marble::MarbleModel::workOfflineChanged
void workOfflineChanged()
TileCreator.h
DgmlAuxillaryDictionary.h
Marble::MarbleModel::placemarkSelectionModel
QItemSelectionModel * placemarkSelectionModel()
Definition: MarbleModel.cpp:437
Marble::MarbleModel::treeModel
GeoDataTreeModel * treeModel()
Return the list of Placemarks as a QAbstractItemModel *.
Definition: MarbleModel.cpp:407
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::MarbleModel::clockTimezone
int clockTimezone() const
Definition: MarbleModel.cpp:640
Marble::MarbleModel::fileManager
FileManager * fileManager()
Definition: MarbleModel.cpp:447
MarbleModel.h
This file contains the headers for MarbleModel.
Marble::GeoSceneGeodata::pen
QPen pen() const
Definition: GeoSceneGeodata.cpp:72
Marble::HttpDownloadManager::setDownloadEnabled
void setDownloadEnabled(const bool enable)
Switches loading on/off, useful for offline mode.
Definition: HttpDownloadManager.cpp:110
Marble::GeoSceneMap::layer
GeoSceneLayer * layer(const QString &name)
Return a layer by its name.
Definition: GeoSceneMap.cpp:102
Marble::MarbleModel::sunLocator
SunLocator * sunLocator()
Definition: MarbleModel.cpp:477
Marble::MarbleModel::planetId
QString planetId() const
Definition: MarbleModel.cpp:462
Marble::TileCreatorDialog
Definition: TileCreatorDialog.h:31
Marble::GeoDataTypes::GeoDataPlacemarkType
const char * GeoDataPlacemarkType
Definition: GeoDataTypes.cpp:62
Marble::MarbleModel::clock
MarbleClock * clock()
Definition: MarbleModel.cpp:467
Marble::GeoDataTypes::GeoDataDocumentType
const char * GeoDataDocumentType
Definition: GeoDataTypes.cpp:34
Marble::GeoSceneGeodata::brush
QBrush brush() const
Definition: GeoSceneGeodata.cpp:82
Marble::GeoSceneGeodata::sourceFile
QString sourceFile() const
Definition: GeoSceneGeodata.cpp:52
HttpDownloadManager.h
GeoDataStyle.h
Marble::MarbleModel::addGeoDataString
void addGeoDataString(const QString &data, const QString &key="data")
Handle raw data loading into the treeModel.
Definition: MarbleModel.cpp:661
Marble::GeoSceneAbstractDataset::fileFormat
QString fileFormat() const
Definition: GeoSceneAbstractDataset.cpp:43
Marble::MarbleModel::setTrackedPlacemark
void setTrackedPlacemark(const GeoDataPlacemark *placemark)
Change the placemark tracked by this model.
Definition: MarbleModel.cpp:553
Marble::GeoSceneTiled
Definition: GeoSceneTiled.h:43
GeoSceneDocument.h
Marble::GeoDataTypes::GeoDataGroundOverlayType
const char * GeoDataGroundOverlayType
Definition: GeoDataTypes.cpp:40
SunLocator.h
Marble::MarbleModel::pluginManager
const PluginManager * pluginManager() const
Definition: MarbleModel.cpp:564
Planet.h
Marble::MarbleModel::planet
const Planet * planet() const
Returns the planet object for the current map.
Definition: MarbleModel.cpp:574
QObject
Marble::GeoSceneGeodata::property
QString property() const
Definition: GeoSceneGeodata.cpp:42
Marble::MarbleModel::trackedPlacemark
const GeoDataPlacemark * trackedPlacemark() const
Returns the placemark being tracked by this model or 0 if no placemark is currently tracked...
Definition: MarbleModel.cpp:559
MarbleDebug.h
FileStorageWatcher.h
Marble::GeoDataCoordinates::Degree
Definition: GeoDataCoordinates.h:66
BookmarkManager.h
Marble::GeoSceneAbstractDataset
Contents used inside a layer.
Definition: GeoSceneAbstractDataset.h:37
Marble::PositionTracking
Definition: PositionTracking.h:31
Marble::GeoSceneTiled::downloadPolicies
QList< const DownloadPolicy * > downloadPolicies() const
Definition: GeoSceneTiled.cpp:248
Marble::BookmarkManager
This class is responsible for loading the book mark objects from the files and various book mark oper...
Definition: BookmarkManager.h:35
Marble::GeoDataStyle
an addressable style group
Definition: GeoDataStyle.h:55
Marble::MarbleModel::mapThemeId
QString mapThemeId() const
Return the name of the current map theme.
Marble::SunLocator
Definition: SunLocator.h:33
Marble::MarbleModel::addGeoDataFile
void addGeoDataFile(const QString &filename)
Handle file loading into the treeModel.
Definition: MarbleModel.cpp:655
StoragePolicy.h
RoutingManager.h
Marble::MarbleModel::MarbleModel
MarbleModel(QObject *parent=0)
Construct a new MarbleModel.
Definition: MarbleModel.cpp:161
Marble::GeoSceneLayer
Layer of a GeoScene document.
Definition: GeoSceneLayer.h:43
Marble::MarbleModel::setWorkOffline
void setWorkOffline(bool workOffline)
Definition: MarbleModel.cpp:689
Marble::MarbleModel::routingManager
RoutingManager * routingManager()
Definition: MarbleModel.cpp:605
Marble::MarbleModel::themeChanged
void themeChanged(QString mapTheme)
Signal that the map theme has changed, and to which theme.
Marble::MarbleModel::home
void home(qreal &lon, qreal &lat, int &zoom) const
get the home point
Definition: MarbleModel.cpp:376
Marble::UserDocument
Definition: GeoDataDocument.h:42
Marble::TileCreator
Definition: TileCreator.h:53
Marble::MarbleModel::clockSpeed
int clockSpeed() const
Definition: MarbleModel.cpp:625
MarbleDirs.h
Marble::GeoSceneLayer::backend
QString backend() const
Definition: GeoSceneLayer.cpp:134
Marble::FileManager
This class is responsible for loading the different files into Geodata model.
Definition: FileManager.h:36
Marble::GeoDataLineStyle::setWidth
void setWidth(const float &width)
Set the width of the line.
Definition: GeoDataLineStyle.cpp:76
Marble::GeoDataPolyStyle::setFill
void setFill(const bool &fill)
Set whether to fill the polygon.
Definition: GeoDataPolyStyle.cpp:72
Marble::MarbleModel::positionTracking
PositionTracking * positionTracking() const
Definition: MarbleModel.cpp:442
Marble::Planet
Definition: Planet.h:25
GeoSceneVector.h
Marble::MapThemeManager::loadMapTheme
static GeoSceneDocument * loadMapTheme(const QString &mapThemeStringID)
Returns the map theme as a GeoSceneDocument object.
Definition: MapThemeManager.cpp:155
Marble::MarbleModel::persistentTileCacheLimit
quint64 persistentTileCacheLimit() const
Returns the limit in kilobytes of the persistent (on hard disc) tile cache.
Definition: MarbleModel.cpp:487
Marble::GeoDataLineStyle::setPenStyle
void setPenStyle(Qt::PenStyle style)
Set pen cap style.
Definition: GeoDataLineStyle.cpp:111
Marble::SunLocator::setPlanet
void setPlanet(const Planet *planet)
Definition: SunLocator.cpp:235
Marble::MarbleModel::updateProperty
void updateProperty(const QString &property, bool value)
Definition: MarbleModel.cpp:671
Marble::MarbleModel::setClockTimezone
void setClockTimezone(int timeInSec)
Definition: MarbleModel.cpp:635
kdescendantsproxymodel.h
MarbleGlobal.h
Marble::MarbleModel::setClockDateTime
void setClockDateTime(const QDateTime &datetime)
Definition: MarbleModel.cpp:615
Marble::MarbleModel::elevationModel
ElevationModel * elevationModel()
Definition: MarbleModel.cpp:699
GeoDataTreeModel.h
Marble::GeoSceneHead::theme
QString theme() const
Definition: GeoSceneHead.cpp:111
Marble::dgml::dgmlValue_geodata
const char * dgmlValue_geodata
Definition: DgmlAuxillaryDictionary.cpp:41
Marble::GeoSceneTiled::sourceDir
QString sourceDir() const
Definition: GeoSceneTiled.cpp:56
QAbstractItemModel
Marble::GeoSceneDocument::head
const GeoSceneHead * head() const
Definition: GeoSceneDocument.cpp:86
Marble::ElevationModel
Definition: ElevationModel.h:33
Marble::RoutingManager
Delegates data retrieval and model updates to the appropriate routing provider.
Definition: RoutingManager.h:37
Marble::MarbleDirs::debug
static void debug()
Definition: MarbleDirs.cpp:317
Marble::TileCreator::setTileFormat
void setTileFormat(const QString &format)
Definition: TileCreator.cpp:581
Marble::GeoSceneDocument
A container for features parsed from the DGML file.
Definition: GeoSceneDocument.h:44
MarbleClock.h
Marble::MarbleModel::clockDateTime
QDateTime clockDateTime() const
Definition: MarbleModel.cpp:620
Marble::MarbleModel::setHome
void setHome(qreal lon, qreal lat, int zoom=1050)
Set the home point.
Definition: MarbleModel.cpp:382
Marble::GeoDataFeature::setVisible
void setVisible(bool value)
Set a new value for visibility.
Definition: GeoDataFeature.cpp:586
Marble::MapDocument
Definition: GeoDataDocument.h:41
Marble::MarbleModel::homeChanged
void homeChanged(const GeoDataCoordinates newHomePoint)
Emitted when the home location is changed.
Marble::GeoDataStyle::setLineStyle
void setLineStyle(const GeoDataLineStyle &style)
set the line style
Definition: GeoDataStyle.cpp:88
ElevationModel.h
Marble::MarbleModel::groundOverlayModel
QAbstractItemModel * groundOverlayModel()
Definition: MarbleModel.cpp:427
GeoSceneTiled.h
Marble::MarbleModel::~MarbleModel
virtual ~MarbleModel()
Definition: MarbleModel.cpp:196
Marble::GeoSceneMap::hasVectorLayers
bool hasVectorLayers() const
Checks for valid layers that contain vector data.
Definition: GeoSceneMap.cpp:203
Marble::GeoSceneLayer::datasets
QVector< GeoSceneAbstractDataset * > datasets() const
Definition: GeoSceneLayer.cpp:124
Marble::GeoDataFeature
A base class for all geodata features.
Definition: GeoDataFeature.h:55
PluginManager.h
Marble::MarbleModel::bookmarkManager
BookmarkManager * bookmarkManager()
return instance of BookmarkManager
Definition: MarbleModel.cpp:206
Marble::MarbleModel::planetRadius
qreal planetRadius() const
Definition: MarbleModel.cpp:452
Marble::MarbleModel::legend
QTextDocument * legend()
Definition: MarbleModel.cpp:645
Marble::MarbleModel::downloadManager
HttpDownloadManager * downloadManager()
Return the downloadmanager to load missing tiles.
Definition: MarbleModel.cpp:396
GeoDataTypes.h
PositionTracking.h
Marble::MarbleClock
Definition: MarbleClock.h:25
Marble::GeoDataPolyStyle
specifies the style how polygons are drawn
Definition: GeoDataPolyStyle.h:34
Marble::MarbleModel::setLegend
void setLegend(QTextDocument *document)
Definition: MarbleModel.cpp:650
Marble::GeoDataFeature::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoData.
Definition: GeoDataFeature.cpp:94
Marble::MarbleModel::trackedPlacemarkChanged
void trackedPlacemarkChanged(const GeoDataPlacemark *placemark)
Emitted when the placemark tracked by this model has changed.
Marble::GeoDataPlacemark
a class representing a point of interest on the map
Definition: GeoDataPlacemark.h:54
Marble::mDebug
QDebug mDebug()
a function to replace qDebug() in Marble library code
Definition: MarbleDebug.cpp:31
Marble::GeoDataStyle::setPolyStyle
void setPolyStyle(const GeoDataPolyStyle &style)
set the poly style
Definition: GeoDataStyle.cpp:98
Marble::MarbleModel::planetName
QString planetName() const
Definition: MarbleModel.cpp:457
GeoSceneMap.h
MapThemeManager.h
Marble::MarbleModel::setClockSpeed
void setClockSpeed(int speed)
Definition: MarbleModel.cpp:630
Marble::MarbleModel::placemarkModel
QAbstractItemModel * placemarkModel()
Definition: MarbleModel.cpp:417
TileCreatorDialog.h
Marble::GeoSceneMap::hasTextureLayers
bool hasTextureLayers() const
Checks for valid layers that contain texture data.
Definition: GeoSceneMap.cpp:190
GeoSceneLayer.h
Marble::HttpDownloadManager
This class manages scheduled downloads.
Definition: HttpDownloadManager.h:44
Marble::GeoSceneGeodata
Definition: GeoSceneGeodata.h:24
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:51 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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