• 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
MarbleWidget.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 2010-2012 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
11 // Copyright 2012 Mohammed Nafees <nafees.technocool@gmail.com>
12 //
13 
14 #include "MarbleWidget.h"
15 
16 #include <qmath.h>
17 #include <QAbstractItemModel>
18 #include <QHash>
19 #include <QSettings>
20 #include <QTime>
21 #include <QItemSelectionModel>
22 #include <QPaintEvent>
23 #include <QRegion>
24 #include <QSizePolicy>
25 #include <QNetworkProxy>
26 #include <QMetaMethod>
27 
28 #ifdef MARBLE_DBUS
29 #include <QDBusConnection>
30 #endif
31 
32 #include "DataMigration.h"
33 #include "FpsLayer.h"
34 #include "FileManager.h"
35 #include "GeoDataLatLonAltBox.h"
36 #include "GeoDataPlacemark.h"
37 #include "GeoPainter.h"
38 #include "MarbleClock.h"
39 #include "MarbleDebug.h"
40 #include "MarbleDirs.h"
41 #include "MarbleLocale.h"
42 #include "MarbleMap.h"
43 #include "MarbleModel.h"
44 #include "MarblePhysics.h"
45 #include "MarbleWidgetInputHandler.h"
46 #include "MarbleWidgetPopupMenu.h"
47 #include "Planet.h"
48 #include "PopupLayer.h"
49 #include "RenderPlugin.h"
50 #include "SunLocator.h"
51 #include "TileCreatorDialog.h"
52 #include "ViewportParams.h"
53 #include "routing/RoutingLayer.h"
54 #include "MarbleAbstractPresenter.h"
55 
56 namespace Marble
57 {
58 
59 class MarbleWidget::CustomPaintLayer : public LayerInterface
60 {
61  public:
62  CustomPaintLayer( MarbleWidget *widget )
63  : m_widget( widget )
64  {
65  }
66 
67  virtual QStringList renderPosition() const { return QStringList() << "USER_TOOLS"; }
68 
69  virtual bool render( GeoPainter *painter, ViewportParams *viewport,
70  const QString &renderPos, GeoSceneLayer *layer )
71  {
72  Q_UNUSED( viewport );
73  Q_UNUSED( renderPos );
74  Q_UNUSED( layer );
75 
76  painter->setPen( Qt::black );
77  m_widget->customPaint( painter );
78 
79  return true;
80  }
81 
82  virtual qreal zValue() const { return 1.0e7; }
83 
84  RenderState renderState() const { return RenderState( "Custom Widget Paint" ); }
85 
86  private:
87  MarbleWidget *const m_widget;
88 };
89 
90 
91 class MarbleWidgetPrivate : public MarbleAbstractPresenter
92 {
93  public:
94  MarbleWidgetPrivate( MarbleWidget *parent )
95  : MarbleAbstractPresenter(),
96  m_widget( parent ),
97  m_inputhandler( 0 ),
98  m_physics( this ),
99  m_routingLayer( 0 ),
100  m_mapInfoDialog( 0 ),
101  m_customPaintLayer( parent ),
102  m_popupmenu( 0 ),
103  m_showFrameRate( false )
104  {
105  }
106 
107  ~MarbleWidgetPrivate()
108  {
109  map()->removeLayer( &m_customPaintLayer );
110  map()->removeLayer( m_mapInfoDialog );
111  delete m_mapInfoDialog;
112  delete m_popupmenu;
113  }
114 
115  void construct();
116 
117  void updateMapTheme();
118 
119  void setInputHandler();
120  void setInputHandler( MarbleWidgetInputHandler *handler );
121 
128  void updateSystemBackgroundAttribute();
129 
130  MarbleWidget *const m_widget;
131 
132  MarbleWidgetInputHandler *m_inputhandler;
133 
134  MarblePhysics m_physics;
135 
136  RoutingLayer *m_routingLayer;
137  PopupLayer *m_mapInfoDialog;
138  MarbleWidget::CustomPaintLayer m_customPaintLayer;
139 
140  MarbleWidgetPopupMenu *m_popupmenu;
141 
142  bool m_showFrameRate;
143 };
144 
145 
146 
147 MarbleWidget::MarbleWidget(QWidget *parent)
148  : QWidget( parent ),
149  d( new MarbleWidgetPrivate( this ) )
150 {
151 // setAttribute( Qt::WA_PaintOnScreen, true );
152  d->construct();
153 }
154 
155 MarbleWidget::~MarbleWidget()
156 {
157  // Remove and delete an existing InputHandler
158  // initialized in d->construct()
159  setInputHandler( 0 );
160 
161  delete d;
162 }
163 
164 void MarbleWidgetPrivate::construct()
165 {
166  QPointer<DataMigration> dataMigration = new DataMigration( m_widget );
167  dataMigration->exec();
168  delete dataMigration;
169 
170 #ifdef MARBLE_DBUS
171  QDBusConnection::sessionBus().registerObject( "/MarbleWidget", m_widget,
172  QDBusConnection::ExportAllSlots
173  | QDBusConnection::ExportAllSignals
174  | QDBusConnection::ExportAllProperties );
175 #endif
176 
177  // Widget settings
178  m_widget->setMinimumSize( 200, 300 );
179  m_widget->setFocusPolicy( Qt::WheelFocus );
180  m_widget->setFocus( Qt::OtherFocusReason );
181 
182  // Set background: black.
183  m_widget->setPalette( QPalette ( Qt::black ) );
184 
185  // Set whether the black space gets displayed or the earth gets simply
186  // displayed on the widget background.
187  m_widget->setAutoFillBackground( true );
188 
189  // Initialize the map and forward some signals.
190  map()->setSize( m_widget->width(), m_widget->height() );
191  map()->setShowFrameRate( false ); // never let the map draw the frame rate,
192  // we do this differently here in the widget
193 
194  m_widget->connect(this, SIGNAL(regionSelected(QList<double>)), m_widget, SIGNAL(regionSelected(QList<double>)));
195 
196  m_widget->connect(this, SIGNAL(updateRequired()),
197  m_widget, SLOT(update()));
198  m_widget->connect(this, SIGNAL(zoomChanged(int)), m_widget, SIGNAL(zoomChanged(int)));
199  m_widget->connect(this, SIGNAL(distanceChanged(QString)), m_widget, SIGNAL(distanceChanged(QString)));
200 
201  // forward some signals of m_map
202  m_widget->connect( map(), SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)),
203  m_widget, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)) );
204  m_widget->connect( map(), SIGNAL(projectionChanged(Projection)),
205  m_widget, SIGNAL(projectionChanged(Projection)) );
206  m_widget->connect( map(), SIGNAL(tileLevelChanged(int)),
207  m_widget, SIGNAL(tileLevelChanged(int)) );
208  m_widget->connect( map(), SIGNAL(framesPerSecond(qreal)),
209  m_widget, SIGNAL(framesPerSecond(qreal)) );
210 
211  m_widget->connect( map(), SIGNAL(pluginSettingsChanged()),
212  m_widget, SIGNAL(pluginSettingsChanged()) );
213  m_widget->connect( map(), SIGNAL(renderPluginInitialized(RenderPlugin*)),
214  m_widget, SIGNAL(renderPluginInitialized(RenderPlugin*)) );
215 
216  // react to some signals of m_map
217  m_widget->connect( map(), SIGNAL(themeChanged(QString)),
218  m_widget, SLOT(updateMapTheme()) );
219  m_widget->connect( map(), SIGNAL(repaintNeeded(QRegion)),
220  m_widget, SLOT(update()) );
221  m_widget->connect( map(), SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)),
222  m_widget, SLOT(updateSystemBackgroundAttribute()) );
223  m_widget->connect( map(), SIGNAL(renderStatusChanged(RenderStatus)),
224  m_widget, SIGNAL(renderStatusChanged(RenderStatus)) );
225  m_widget->connect( map(), SIGNAL(renderStateChanged(RenderState)),
226  m_widget, SIGNAL(renderStateChanged(RenderState)) );
227 
228  m_widget->connect( model()->fileManager(), SIGNAL(centeredDocument(GeoDataLatLonBox)),
229  m_widget, SLOT(centerOn(GeoDataLatLonBox)) );
230 
231 
232  // Show a progress dialog when the model calculates new map tiles.
233  m_widget->connect( model(), SIGNAL( creatingTilesStart( TileCreator*, const QString&,
234  const QString& ) ),
235  m_widget, SLOT( creatingTilesStart( TileCreator*, const QString&,
236  const QString& ) ) );
237 
238  m_popupmenu = new MarbleWidgetPopupMenu( m_widget, model() );
239 
240  m_routingLayer = new RoutingLayer( m_widget, m_widget );
241  m_routingLayer->setPlacemarkModel( 0 );
242  QObject::connect( m_routingLayer, SIGNAL(repaintNeeded(QRect)),
243  m_widget, SLOT(update()) );
244 
245  m_mapInfoDialog = new PopupLayer( m_widget, m_widget );
246  m_mapInfoDialog->setVisible( false );
247  m_widget->connect( m_mapInfoDialog, SIGNAL(repaintNeeded()), m_widget, SLOT(update()) );
248  map()->addLayer( m_mapInfoDialog );
249 
250  setInputHandler();
251  m_widget->setMouseTracking( true );
252 
253  map()->addLayer( &m_customPaintLayer );
254 }
255 
256 void MarbleWidgetPrivate::setInputHandler()
257 {
258  setInputHandler(new MarbleWidgetInputHandler(this, m_widget));
259 }
260 
261 void MarbleWidgetPrivate::setInputHandler( MarbleWidgetInputHandler *handler )
262 {
263  delete m_inputhandler;
264  m_inputhandler = handler;
265 
266  if ( m_inputhandler )
267  {
268  m_widget->installEventFilter( m_inputhandler );
269 
270  connect( m_inputhandler, SIGNAL(mouseClickScreenPosition(int,int)),
271  m_widget, SLOT(notifyMouseClick(int,int)) );
272 
273  connect( m_inputhandler, SIGNAL(mouseMoveGeoPosition(QString)),
274  m_widget, SIGNAL(mouseMoveGeoPosition(QString)) );
275  }
276 }
277 
278 void MarbleWidgetPrivate::updateSystemBackgroundAttribute()
279 {
280  // We only have to repaint the background every time if the earth
281  // doesn't cover the whole image.
282  const bool isOn = map()->viewport()->mapCoversViewport() && !model()->mapThemeId().isEmpty();
283  m_widget->setAttribute( Qt::WA_NoSystemBackground, isOn );
284 }
285 
286 // ----------------------------------------------------------------
287 
288 
289 MarbleModel *MarbleWidget::model()
290 {
291  return d->model();
292 }
293 
294 const MarbleModel *MarbleWidget::model() const
295 {
296  return d->model();
297 }
298 
299 ViewportParams* MarbleWidget::viewport()
300 {
301  return d->viewport();
302 }
303 
304 const ViewportParams* MarbleWidget::viewport() const
305 {
306  return d->viewport();
307 }
308 
309 MarbleWidgetPopupMenu *MarbleWidget::popupMenu()
310 {
311  return d->m_popupmenu;
312 }
313 
314 
315 void MarbleWidget::setInputHandler( MarbleWidgetInputHandler *handler )
316 {
317  d->setInputHandler(handler);
318 }
319 
320 MarbleWidgetInputHandler *MarbleWidget::inputHandler() const
321 {
322  return d->m_inputhandler;
323 }
324 
325 int MarbleWidget::radius() const
326 {
327  return d->radius();
328 }
329 
330 void MarbleWidget::setRadius( int radius )
331 {
332  d->setRadius(radius);
333 }
334 
335 qreal MarbleWidget::moveStep() const
336 {
337  return d->moveStep();
338 }
339 
340 int MarbleWidget::zoom() const
341 {
342  return d->logzoom();
343 }
344 
345 int MarbleWidget::tileZoomLevel() const
346 {
347  return d->map()->tileZoomLevel();
348 }
349 
350 int MarbleWidget::minimumZoom() const
351 {
352  return d->minimumZoom();
353 }
354 
355 int MarbleWidget::maximumZoom() const
356 {
357  return d->maximumZoom();
358 }
359 
360 QVector<const GeoDataPlacemark*> MarbleWidget::whichFeatureAt( const QPoint &curpos ) const
361 {
362  return d->map()->whichFeatureAt( curpos );
363 }
364 
365 QList<AbstractDataPluginItem*> MarbleWidget::whichItemAt( const QPoint &curpos ) const
366 {
367  return d->map()->whichItemAt( curpos );
368 }
369 
370 void MarbleWidget::addLayer( LayerInterface *layer )
371 {
372  d->map()->addLayer( layer );
373 }
374 
375 void MarbleWidget::removeLayer( LayerInterface *layer )
376 {
377  d->map()->removeLayer( layer );
378 }
379 
380 Marble::TextureLayer* MarbleWidget::textureLayer() const
381 {
382  return d->map()->textureLayer();
383 }
384 
385 QPixmap MarbleWidget::mapScreenShot()
386 {
387  return QPixmap::grabWidget( this );
388 }
389 
390 RenderStatus MarbleWidget::renderStatus() const
391 {
392  return d->map()->renderStatus();
393 }
394 
395 RenderState MarbleWidget::renderState() const
396 {
397  return d->map()->renderState();
398 }
399 
400 bool MarbleWidget::showOverviewMap() const
401 {
402  return d->map()->showOverviewMap();
403 }
404 
405 bool MarbleWidget::showScaleBar() const
406 {
407  return d->map()->showScaleBar();
408 }
409 
410 bool MarbleWidget::showCompass() const
411 {
412  return d->map()->showCompass();
413 }
414 
415 bool MarbleWidget::showClouds() const
416 {
417  return d->map()->showClouds();
418 }
419 
420 bool MarbleWidget::showSunShading() const
421 {
422  return d->map()->showSunShading();
423 }
424 
425 bool MarbleWidget::showCityLights() const
426 {
427  return d->map()->showCityLights();
428 }
429 
430 bool MarbleWidget::isLockedToSubSolarPoint() const
431 {
432  return d->map()->isLockedToSubSolarPoint();
433 }
434 
435 bool MarbleWidget::isSubSolarPointIconVisible() const
436 {
437  return d->map()->isSubSolarPointIconVisible();
438 }
439 
440 bool MarbleWidget::showAtmosphere() const
441 {
442  return d->map()->showAtmosphere();
443 }
444 
445 bool MarbleWidget::showCrosshairs() const
446 {
447  return d->map()->showCrosshairs();
448 }
449 
450 bool MarbleWidget::showGrid() const
451 {
452  return d->map()->showGrid();
453 }
454 
455 bool MarbleWidget::showPlaces() const
456 {
457  return d->map()->showPlaces();
458 }
459 
460 bool MarbleWidget::showCities() const
461 {
462  return d->map()->showCities();
463 }
464 
465 bool MarbleWidget::showTerrain() const
466 {
467  return d->map()->showTerrain();
468 }
469 
470 bool MarbleWidget::showOtherPlaces() const
471 {
472  return d->map()->showOtherPlaces();
473 }
474 
475 bool MarbleWidget::showRelief() const
476 {
477  return d->map()->showRelief();
478 }
479 
480 bool MarbleWidget::showIceLayer() const
481 {
482  return d->map()->showIceLayer();
483 }
484 
485 bool MarbleWidget::showBorders() const
486 {
487  return d->map()->showBorders();
488 }
489 
490 bool MarbleWidget::showRivers() const
491 {
492  return d->map()->showRivers();
493 }
494 
495 bool MarbleWidget::showLakes() const
496 {
497  return d->map()->showLakes();
498 }
499 
500 bool MarbleWidget::showFrameRate() const
501 {
502  return d->m_showFrameRate;
503 }
504 
505 bool MarbleWidget::showBackground() const
506 {
507  return d->map()->showBackground();
508 }
509 
510 quint64 MarbleWidget::volatileTileCacheLimit() const
511 {
512  return d->map()->volatileTileCacheLimit();
513 }
514 
515 
516 void MarbleWidget::setZoom( int newZoom, FlyToMode mode )
517 {
518  d->setZoom(newZoom, mode);
519 }
520 
521 void MarbleWidget::zoomView( int zoom, FlyToMode mode )
522 {
523  d->zoomView(zoom, mode);
524 }
525 
526 
527 void MarbleWidget::zoomViewBy( int zoomStep, FlyToMode mode )
528 {
529  d->zoomViewBy(zoomStep, mode);
530 }
531 
532 
533 void MarbleWidget::zoomIn( FlyToMode mode )
534 {
535  d->zoomIn(mode);
536 }
537 
538 void MarbleWidget::zoomOut( FlyToMode mode )
539 {
540  d->zoomOut(mode);
541 }
542 
543 void MarbleWidget::rotateBy( const qreal deltaLon, const qreal deltaLat, FlyToMode mode )
544 {
545  d->rotateBy(deltaLon, deltaLat, mode);
546 }
547 
548 
549 void MarbleWidget::centerOn( const qreal lon, const qreal lat, bool animated )
550 {
551  d->centerOn(lon, lat, animated);
552 }
553 
554 void MarbleWidget::centerOn( const GeoDataCoordinates &position, bool animated )
555 {
556  d->centerOn(position, animated);
557 }
558 
559 void MarbleWidget::centerOn( const GeoDataLatLonBox &box, bool animated )
560 {
561  d->centerOn(box, animated);
562 }
563 
564 void MarbleWidget::centerOn( const GeoDataPlacemark& placemark, bool animated )
565 {
566  d->centerOn(placemark, animated);
567 }
568 
569 void MarbleWidget::setCenterLatitude( qreal lat, FlyToMode mode )
570 {
571  d->setCenterLatitude(lat, mode);
572 }
573 
574 void MarbleWidget::setCenterLongitude( qreal lon, FlyToMode mode )
575 {
576  d->setCenterLongitude(lon, mode);
577 }
578 
579 Projection MarbleWidget::projection() const
580 {
581  return d->map()->projection();
582 }
583 
584 void MarbleWidget::setProjection( Projection projection )
585 {
586  d->map()->setProjection( projection );
587 
588  update();
589 }
590 
591 void MarbleWidget::setProjection( int projection )
592 {
593  setProjection( Projection( qAbs( projection ) % (Mercator+1) ) );
594 }
595 
596 void MarbleWidget::moveLeft( FlyToMode mode )
597 {
598  d->moveByStep( -1, 0, mode );
599 }
600 
601 void MarbleWidget::moveRight( FlyToMode mode )
602 {
603  d->moveByStep( 1, 0, mode );
604 }
605 
606 void MarbleWidget::moveUp( FlyToMode mode )
607 {
608  d->moveByStep( 0, -1, mode );
609 }
610 
611 void MarbleWidget::moveDown( FlyToMode mode )
612 {
613  d->moveByStep( 0, 1, mode );
614 }
615 
616 void MarbleWidget::leaveEvent( QEvent* )
617 {
618  emit mouseMoveGeoPosition( tr( NOT_AVAILABLE ) );
619 }
620 
621 void MarbleWidget::resizeEvent( QResizeEvent *event )
622 {
623  setUpdatesEnabled( false );
624  d->map()->setSize( event->size() );
625  setUpdatesEnabled( true );
626 
627  QWidget::resizeEvent( event );
628 }
629 
630 #if QT_VERSION < 0x050000
631 void MarbleWidget::connectNotify( const char * signal )
632 {
633  if ( QByteArray( signal ) ==
634  QMetaObject::normalizedSignature ( SIGNAL(mouseMoveGeoPosition(QString)) ) )
635  if ( d->m_inputhandler )
636  d->m_inputhandler->setPositionSignalConnected( true );
637 }
638 
639 void MarbleWidget::disconnectNotify( const char * signal )
640 {
641  if ( QByteArray( signal ) ==
642  QMetaObject::normalizedSignature ( SIGNAL(mouseMoveGeoPosition(QString)) ) )
643  if ( d->m_inputhandler )
644  d->m_inputhandler->setPositionSignalConnected( false );
645 }
646 #else
647 void MarbleWidget::connectNotify( const QMetaMethod &signal )
648 {
649  if ( d->m_inputhandler && signal == QMetaMethod::fromSignal( &MarbleWidget::mouseMoveGeoPosition ) ) {
650  d->m_inputhandler->setPositionSignalConnected( true );
651  }
652 }
653 
654 void MarbleWidget::disconnectNotify( const QMetaMethod &signal )
655 {
656  if ( d->m_inputhandler && signal == QMetaMethod::fromSignal( &MarbleWidget::mouseMoveGeoPosition ) ) {
657  d->m_inputhandler->setPositionSignalConnected( false );
658  }
659 }
660 #endif
661 
662 bool MarbleWidget::screenCoordinates( qreal lon, qreal lat,
663  qreal& x, qreal& y ) const
664 {
665  return d->map()->screenCoordinates( lon, lat, x, y );
666 }
667 
668 bool MarbleWidget::geoCoordinates( int x, int y,
669  qreal& lon, qreal& lat,
670  GeoDataCoordinates::Unit unit ) const
671 {
672  return d->map()->geoCoordinates( x, y, lon, lat, unit );
673 }
674 
675 qreal MarbleWidget::centerLatitude() const
676 {
677  return d->centerLatitude();
678 }
679 
680 qreal MarbleWidget::centerLongitude() const
681 {
682  return d->centerLongitude();
683 }
684 
685 QRegion MarbleWidget::mapRegion() const
686 {
687  return viewport()->mapRegion();
688 }
689 
690 void MarbleWidget::paintEvent( QPaintEvent *evt )
691 {
692  QTime t;
693  t.start();
694 
695  QPaintDevice *paintDevice = this;
696  QImage image;
697  if (!isEnabled())
698  {
699  // If the globe covers fully the screen then we can use the faster
700  // RGB32 as there are no translucent areas involved.
701  QImage::Format imageFormat = ( d->map()->viewport()->mapCoversViewport() )
702  ? QImage::Format_RGB32
703  : QImage::Format_ARGB32_Premultiplied;
704  // Paint to an intermediate image
705  image = QImage( rect().size(), imageFormat );
706  image.fill( Qt::transparent );
707  paintDevice = &image;
708  }
709 
710  {
711  // FIXME: Better way to get the GeoPainter
712  // Create a painter that will do the painting.
713  GeoPainter geoPainter( paintDevice, d->map()->viewport(), d->map()->mapQuality() );
714 
715  d->map()->paint( geoPainter, evt->rect() );
716  }
717 
718  if ( !isEnabled() )
719  {
720  // Draw a grayscale version of the intermediate image
721  QRgb* pixel = reinterpret_cast<QRgb*>( image.scanLine( 0 ));
722  for (int i=0; i<image.width()*image.height(); ++i, ++pixel) {
723  int gray = qGray( *pixel );
724  *pixel = qRgb( gray, gray, gray );
725  }
726 
727  QPainter widgetPainter( this );
728  widgetPainter.drawImage( rect(), image );
729  }
730 
731  if ( d->m_showFrameRate )
732  {
733  QPainter painter( this );
734  FpsLayer fpsPainter( &t );
735  fpsPainter.paint( &painter );
736 
737  const qreal fps = 1000.0 / (qreal)( t.elapsed() + 1 );
738  emit framesPerSecond( fps );
739  }
740 }
741 
742 void MarbleWidget::customPaint( GeoPainter *painter )
743 {
744  Q_UNUSED( painter );
745  /* This is a NOOP in the base class*/
746 }
747 
748 
749 void MarbleWidget::goHome( FlyToMode mode )
750 {
751  d->goHome(mode);
752 }
753 
754 QString MarbleWidget::mapThemeId() const
755 {
756  return d->model()->mapThemeId();
757 }
758 
759 void MarbleWidget::setMapThemeId( const QString& mapThemeId )
760 {
761  d->map()->setMapThemeId( mapThemeId );
762 }
763 
764 void MarbleWidgetPrivate::updateMapTheme()
765 {
766  map()->removeLayer( m_routingLayer );
767 
768  m_widget->setRadius( m_widget->radius() ); // Corrects zoom range, if needed
769 
770  if ( model()->planetId() == "earth" ) {
771  map()->addLayer( m_routingLayer );
772  }
773 
774  emit m_widget->themeChanged( map()->mapThemeId() );
775 
776  // Now we want a full repaint as the atmosphere might differ
777  m_widget->setAttribute( Qt::WA_NoSystemBackground, false );
778 
779  m_widget->update();
780 }
781 
782 GeoSceneDocument *MarbleWidget::mapTheme() const
783 {
784  return d->model()->mapTheme();
785 }
786 
787 void MarbleWidget::setPropertyValue( const QString& name, bool value )
788 {
789  mDebug() << "In MarbleWidget the property " << name << "was set to " << value;
790  d->map()->setPropertyValue( name, value );
791 
792  update();
793 }
794 
795 void MarbleWidget::setShowOverviewMap( bool visible )
796 {
797  d->map()->setShowOverviewMap( visible );
798 
799  update();
800 }
801 
802 void MarbleWidget::setShowScaleBar( bool visible )
803 {
804  d->map()->setShowScaleBar( visible );
805 
806  update();
807 }
808 
809 void MarbleWidget::setShowCompass( bool visible )
810 {
811  d->map()->setShowCompass( visible );
812 
813  update();
814 }
815 
816 void MarbleWidget::setShowClouds( bool visible )
817 {
818  d->map()->setShowClouds( visible );
819 
820  update();
821 }
822 
823 void MarbleWidget::setShowSunShading( bool visible )
824 {
825  d->map()->setShowSunShading( visible );
826 
827  update();
828 }
829 
830 void MarbleWidget::setShowCityLights( bool visible )
831 {
832  d->map()->setShowCityLights( visible );
833 
834  update();
835 }
836 
837 void MarbleWidget::setLockToSubSolarPoint( bool visible )
838 {
839  if ( d->map()->isLockedToSubSolarPoint() != visible ) { // Toggling input modifies event filters, so avoid that if not needed
840  d->map()->setLockToSubSolarPoint( visible );
841  setInputEnabled( !d->map()->isLockedToSubSolarPoint() );
842  }
843 }
844 
845 void MarbleWidget::setSubSolarPointIconVisible( bool visible )
846 {
847  if ( d->map()->isSubSolarPointIconVisible() != visible ) {
848  d->map()->setSubSolarPointIconVisible( visible );
849  }
850 
851  QList<RenderPlugin *> pluginList = renderPlugins();
852  QList<RenderPlugin *>::const_iterator i = pluginList.constBegin();
853  QList<RenderPlugin *>::const_iterator const end = pluginList.constEnd();
854  for (; i != end; ++i ) {
855  if ( (*i)->nameId() == "sun" ) {
856  (*i)->setVisible( visible );
857  }
858  }
859 }
860 
861 void MarbleWidget::setShowAtmosphere( bool visible )
862 {
863  d->map()->setShowAtmosphere( visible );
864 
865  update();
866 }
867 
868 void MarbleWidget::setShowCrosshairs( bool visible )
869 {
870  d->map()->setShowCrosshairs( visible );
871 
872  update();
873 }
874 
875 void MarbleWidget::setShowGrid( bool visible )
876 {
877  d->map()->setShowGrid( visible );
878 
879  update();
880 }
881 
882 void MarbleWidget::setShowPlaces( bool visible )
883 {
884  d->map()->setShowPlaces( visible );
885 
886  update();
887 }
888 
889 void MarbleWidget::setShowCities( bool visible )
890 {
891  d->map()->setShowCities( visible );
892 
893  update();
894 }
895 
896 void MarbleWidget::setShowTerrain( bool visible )
897 {
898  d->map()->setShowTerrain( visible );
899 
900  update();
901 }
902 
903 void MarbleWidget::setShowOtherPlaces( bool visible )
904 {
905  d->map()->setShowOtherPlaces( visible );
906 
907  update();
908 }
909 
910 void MarbleWidget::setShowRelief( bool visible )
911 {
912  d->map()->setShowRelief( visible );
913 
914  update();
915 }
916 
917 void MarbleWidget::setShowIceLayer( bool visible )
918 {
919  d->map()->setShowIceLayer( visible );
920 
921  update();
922 }
923 
924 void MarbleWidget::setShowBorders( bool visible )
925 {
926  d->map()->setShowBorders( visible );
927 
928  update();
929 }
930 
931 void MarbleWidget::setShowRivers( bool visible )
932 {
933  d->map()->setShowRivers( visible );
934 
935  update();
936 }
937 
938 void MarbleWidget::setShowLakes( bool visible )
939 {
940  d->map()->setShowLakes( visible );
941 
942  update();
943 }
944 
945 void MarbleWidget::setShowFrameRate( bool visible )
946 {
947  d->m_showFrameRate = visible;
948 
949  update();
950 }
951 
952 void MarbleWidget::setShowBackground( bool visible )
953 {
954  d->map()->setShowBackground( visible );
955 
956  update();
957 }
958 
959 void MarbleWidget::setShowRuntimeTrace( bool visible )
960 {
961  d->map()->setShowRuntimeTrace( visible );
962 }
963 
964 void MarbleWidget::setShowTileId( bool visible )
965 {
966  d->map()->setShowTileId( visible );
967 }
968 
969 void MarbleWidget::notifyMouseClick( int x, int y)
970 {
971  qreal lon = 0;
972  qreal lat = 0;
973 
974  bool const valid = geoCoordinates( x, y, lon, lat, GeoDataCoordinates::Radian );
975 
976  if ( valid ) {
977  emit mouseClickGeoPosition( lon, lat, GeoDataCoordinates::Radian );
978  }
979 }
980 
981 void MarbleWidget::clearVolatileTileCache()
982 {
983  mDebug() << "About to clear VolatileTileCache";
984  d->map()->clearVolatileTileCache();
985 }
986 
987 void MarbleWidget::setVolatileTileCacheLimit( quint64 kiloBytes )
988 {
989  d->map()->setVolatileTileCacheLimit( kiloBytes );
990 }
991 
992 // This slot will called when the Globe starts to create the tiles.
993 
994 void MarbleWidget::creatingTilesStart( TileCreator *creator,
995  const QString &name,
996  const QString &description )
997 {
998  QPointer<TileCreatorDialog> dialog = new TileCreatorDialog( creator, this );
999  dialog->setSummary( name, description );
1000  dialog->exec();
1001  delete dialog;
1002 }
1003 
1004 MapQuality MarbleWidget::mapQuality( ViewContext viewContext ) const
1005 {
1006  return d->map()->mapQuality( viewContext );
1007 }
1008 
1009 void MarbleWidget::setMapQualityForViewContext( MapQuality quality, ViewContext viewContext )
1010 {
1011  const MapQuality oldQuality = d->map()->mapQuality();
1012 
1013  d->map()->setMapQualityForViewContext( quality, viewContext );
1014 
1015  if ( d->map()->mapQuality() != oldQuality )
1016  update();
1017 }
1018 
1019 ViewContext MarbleWidget::viewContext() const
1020 {
1021  return d->viewContext();
1022 }
1023 
1024 void MarbleWidget::setViewContext( ViewContext viewContext )
1025 { //TODO - move to MarbleAbstractPresenter as soon as RoutingLayer is ported there, replace with pImpl call
1026  if ( d->map()->viewContext() != viewContext ) {
1027  const MapQuality oldQuality = d->map()->mapQuality();
1028  d->map()->setViewContext( viewContext );
1029  d->m_routingLayer->setViewContext( viewContext );
1030 
1031  if ( d->map()->mapQuality() != oldQuality )
1032  update();
1033  }
1034 }
1035 
1036 bool MarbleWidget::animationsEnabled() const
1037 {
1038  return d->animationsEnabled();
1039 }
1040 
1041 void MarbleWidget::setAnimationsEnabled( bool enabled )
1042 {
1043  d->setAnimationsEnabled(enabled);
1044 }
1045 
1046 AngleUnit MarbleWidget::defaultAngleUnit() const
1047 {
1048  return d->map()->defaultAngleUnit();
1049 }
1050 
1051 void MarbleWidget::setDefaultAngleUnit( AngleUnit angleUnit )
1052 {
1053  d->map()->setDefaultAngleUnit( angleUnit );
1054 }
1055 
1056 QFont MarbleWidget::defaultFont() const
1057 {
1058  return d->map()->defaultFont();
1059 }
1060 
1061 void MarbleWidget::setDefaultFont( const QFont& font )
1062 {
1063  d->map()->setDefaultFont( font );
1064 }
1065 
1066 void MarbleWidget::setSelection( const QRect& region )
1067 {
1068  d->setSelection(region);
1069 }
1070 
1071 qreal MarbleWidget::distance() const
1072 {
1073  return d->distance();
1074 }
1075 
1076 void MarbleWidget::setDistance( qreal newDistance )
1077 {
1078  d->setDistance(newDistance);
1079 }
1080 
1081 QString MarbleWidget::distanceString() const
1082 {
1083  return d->distanceString();
1084 }
1085 
1086 void MarbleWidget::setInputEnabled( bool enabled )
1087 {
1088  //if input is set as enabled
1089  if ( enabled )
1090  {
1091  if ( !d->m_inputhandler ) {
1092  d->setInputHandler();
1093  }
1094  else {
1095  installEventFilter( d->m_inputhandler );
1096  }
1097  }
1098 
1099  else // input is disabled
1100  {
1101  mDebug() << "MarbleWidget::disableInput";
1102  removeEventFilter( d->m_inputhandler );
1103  setCursor( Qt::ArrowCursor );
1104  }
1105 }
1106 
1107 QList<RenderPlugin *> MarbleWidget::renderPlugins() const
1108 {
1109  return d->map()->renderPlugins();
1110 }
1111 
1112 void MarbleWidget::readPluginSettings( QSettings& settings )
1113 {
1114  foreach( RenderPlugin *plugin, renderPlugins() ) {
1115  settings.beginGroup( QString( "plugin_" ) + plugin->nameId() );
1116 
1117  QHash<QString,QVariant> hash;
1118 
1119  foreach ( const QString& key, settings.childKeys() ) {
1120  hash.insert( key, settings.value( key ) );
1121  }
1122 
1123  plugin->setSettings( hash );
1124 
1125  settings.endGroup();
1126  }
1127 }
1128 
1129 void MarbleWidget::writePluginSettings( QSettings& settings ) const
1130 {
1131  foreach( RenderPlugin *plugin, renderPlugins() ) {
1132  settings.beginGroup( QString( "plugin_" ) + plugin->nameId() );
1133 
1134  QHash<QString,QVariant> hash = plugin->settings();
1135 
1136  QHash<QString,QVariant>::iterator it = hash.begin();
1137  while( it != hash.end() ) {
1138  settings.setValue( it.key(), it.value() );
1139  ++it;
1140  }
1141 
1142  settings.endGroup();
1143  }
1144 }
1145 
1146 QList<AbstractFloatItem *> MarbleWidget::floatItems() const
1147 {
1148  return d->map()->floatItems();
1149 }
1150 
1151 AbstractFloatItem * MarbleWidget::floatItem( const QString &nameId ) const
1152 {
1153  return d->map()->floatItem( nameId );
1154 }
1155 
1156 void MarbleWidget::changeEvent( QEvent * event )
1157 {
1158  if ( event->type() == QEvent::EnabledChange )
1159  {
1160  setInputEnabled(isEnabled());
1161  }
1162 
1163  QWidget::changeEvent(event);
1164 }
1165 
1166 void MarbleWidget::flyTo( const GeoDataLookAt &newLookAt, FlyToMode mode )
1167 {
1168  d->flyTo(newLookAt, mode);
1169 }
1170 
1171 void MarbleWidget::reloadMap()
1172 {
1173  d->map()->reload();
1174 }
1175 
1176 void MarbleWidget::downloadRegion( QVector<TileCoordsPyramid> const & pyramid )
1177 {
1178  d->map()->downloadRegion( pyramid );
1179 }
1180 
1181 GeoDataLookAt MarbleWidget::lookAt() const
1182 {
1183  return d->lookAt();
1184 }
1185 
1186 GeoDataCoordinates MarbleWidget::focusPoint() const
1187 {
1188  return d->map()->viewport()->focusPoint();
1189 }
1190 
1191 void MarbleWidget::setFocusPoint( const GeoDataCoordinates &focusPoint )
1192 {
1193  d->map()->viewport()->setFocusPoint( focusPoint );
1194 }
1195 
1196 void MarbleWidget::resetFocusPoint()
1197 {
1198  d->map()->viewport()->resetFocusPoint();
1199 }
1200 
1201 qreal MarbleWidget::radiusFromDistance( qreal distance ) const
1202 {
1203  return d->radiusFromDistance(distance);
1204 }
1205 
1206 qreal MarbleWidget::distanceFromRadius( qreal radius ) const
1207 {
1208  return d->distanceFromRadius(radius);
1209 }
1210 
1211 qreal MarbleWidget::zoomFromDistance( qreal distance ) const
1212 {
1213  return d->zoomFromDistance(distance);
1214 }
1215 
1216 qreal MarbleWidget::distanceFromZoom( qreal zoom ) const
1217 {
1218  return d->distanceFromZoom(zoom);
1219 }
1220 
1221 RoutingLayer* MarbleWidget::routingLayer()
1222 {
1223  return d->m_routingLayer;
1224 }
1225 
1226 PopupLayer *MarbleWidget::popupLayer()
1227 {
1228  return d->m_mapInfoDialog;
1229 }
1230 
1231 }
1232 
1233 #include "MarbleWidget.moc"
Marble::GeoDataCoordinates::Unit
Unit
enum used constructor to specify the units used
Definition: GeoDataCoordinates.h:64
Marble::FpsLayer::paint
void paint(QPainter *painter) const
Definition: FpsLayer.cpp:28
Marble::MarbleWidget::tileZoomLevel
int tileZoomLevel() const
Definition: MarbleWidget.cpp:345
QImage::scanLine
uchar * scanLine(int i)
FpsLayer.h
Marble::MarbleWidget::showSunShading
bool showSunShading() const
Return whether the night shadow is visible.
QEvent
QResizeEvent
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
QWidget
Marble::MarbleWidget::showLakes
bool showLakes() const
Return whether the lakes are visible.
Marble::MarbleWidget::~MarbleWidget
virtual ~MarbleWidget()
Definition: MarbleWidget.cpp:155
Marble::MarbleWidget::framesPerSecond
void framesPerSecond(qreal fps)
QEvent::type
Type type() const
FileManager.h
Marble::GeoDataCoordinates::Radian
Definition: GeoDataCoordinates.h:65
Marble::MarbleWidget::moveUp
void moveUp(FlyToMode mode=Automatic)
Move up by the moveStep.
Definition: MarbleWidget.cpp:606
QHash::insert
iterator insert(const Key &key, const T &value)
Marble::MarbleWidget::reloadMap
void reloadMap()
Re-download all visible tiles.
Definition: MarbleWidget.cpp:1171
Marble::MarbleWidget::showTerrain
bool showTerrain() const
Return whether the terrain place marks are visible.
Marble::MarbleWidget::showOverviewMap
bool showOverviewMap() const
Return whether the overview map is visible.
QMetaObject::normalizedSignature
QByteArray normalizedSignature(const char *method)
Marble::MarbleWidget::setFocusPoint
void setFocusPoint(const GeoDataCoordinates &focusPoint)
Change the point of focus, overridding any previously set focus point.
Definition: MarbleWidget.cpp:1191
Marble::MarbleWidget::distanceString
QString distanceString() const
Return the current distance string.
Definition: MarbleWidget.cpp:1081
QWidget::setCursor
void setCursor(const QCursor &)
Marble::MarbleWidget::CustomPaintLayer
friend class CustomPaintLayer
Definition: MarbleWidget.h:1107
QHash::key
const Key key(const T &value) const
Marble::MarbleWidget::projection
Projection projection() const
Get the Projection used for the map.
Marble::MarbleWidget::showCrosshairs
bool showCrosshairs() const
Return whether the crosshairs are visible.
Marble::MarbleWidget::setShowCityLights
void setShowCityLights(bool visible)
Set whether city lights instead of night shadow are visible.
Definition: MarbleWidget.cpp:830
Marble::MarbleWidget::zoomViewBy
void zoomViewBy(int zoomStep, FlyToMode mode=Instant)
Zoom the view by a certain step.
Definition: MarbleWidget.cpp:527
QSettings::childKeys
QStringList childKeys() const
Marble::MarbleWidgetInputHandler
Definition: MarbleWidgetInputHandler.h:27
QByteArray
Marble::MarbleWidget::showOtherPlaces
bool showOtherPlaces() const
Return whether other places are visible.
Marble::MarbleWidget::screenCoordinates
bool screenCoordinates(qreal lon, qreal lat, qreal &x, qreal &y) const
Get the screen coordinates corresponding to geographical coordinates in the widget.
Definition: MarbleWidget.cpp:662
Marble::MarbleWidget::connectNotify
void connectNotify(const char *signal)
Definition: MarbleWidget.cpp:631
Marble::MarbleWidget::leaveEvent
virtual void leaveEvent(QEvent *event)
Reimplementation of the leaveEvent() function in QWidget.
Definition: MarbleWidget.cpp:616
Marble::MarbleWidget::setPropertyValue
void setPropertyValue(const QString &name, bool value)
Sets the value of a map theme property.
Definition: MarbleWidget.cpp:787
Marble::GeoPainter
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:98
QPaintDevice
QSettings::endGroup
void endGroup()
Marble::MarbleWidget::renderState
RenderState renderState() const
Detailed render status of the current map view.
Definition: MarbleWidget.cpp:395
MarbleModel.h
This file contains the headers for MarbleModel.
QFont
Marble::MarbleWidget::radius
int radius() const
Return the radius of the globe in pixels.
Definition: MarbleWidget.cpp:325
Marble::MarbleWidget::creatingTilesStart
void creatingTilesStart(TileCreator *creator, const QString &name, const QString &description)
A slot that is called when the model starts to create new tiles.
Definition: MarbleWidget.cpp:994
Marble::MarbleWidget::renderStatus
RenderStatus renderStatus() const
Summarized render status of the current map view.
Marble::MarbleWidget::setShowRuntimeTrace
void setShowRuntimeTrace(bool visible)
Set whether the runtime tracing for layers gets shown.
Definition: MarbleWidget.cpp:959
Marble::ViewContext
ViewContext
This enum is used to choose context in which map quality gets used.
Definition: MarbleGlobal.h:74
Marble::MarbleWidget::whichFeatureAt
QVector< const GeoDataPlacemark * > whichFeatureAt(const QPoint &) const
Definition: MarbleWidget.cpp:360
Marble::MarbleWidget::volatileTileCacheLimit
quint64 volatileTileCacheLimit() const
Returns the limit in kilobytes of the volatile (in RAM) tile cache.
Marble::TileCreatorDialog
Definition: TileCreatorDialog.h:31
Marble::MarbleWidget::setAnimationsEnabled
void setAnimationsEnabled(bool enabled)
Set whether travels to a point should get animated.
Definition: MarbleWidget.cpp:1041
QPointer
Marble::PopupLayer
The PopupLayer class.
Definition: PopupLayer.h:34
QDBusConnection::registerObject
bool registerObject(const QString &path, QObject *object, QFlags< QDBusConnection::RegisterOption > options)
Marble::MarbleWidget::showBorders
bool showBorders() const
Return whether the borders are visible.
Marble::MarbleWidget::moveDown
void moveDown(FlyToMode mode=Automatic)
Move down by the moveStep.
Definition: MarbleWidget.cpp:611
QWidget::visible
visible
Marble::MarbleWidget::setProjection
void setProjection(int projection)
Set the Projection used for the map.
Definition: MarbleWidget.cpp:591
Marble::MarbleWidget::setDefaultAngleUnit
void setDefaultAngleUnit(AngleUnit angleUnit)
Definition: MarbleWidget.cpp:1051
Marble::MarbleWidget::zoomFromDistance
qreal zoomFromDistance(qreal distance) const
Returns the zoom value (no unit) corresponding to the given camera distance (km)
Definition: MarbleWidget.cpp:1211
Marble::MarbleWidget::distanceFromZoom
qreal distanceFromZoom(qreal zoom) const
Returns the distance (km) corresponding to the given zoom value.
Definition: MarbleWidget.cpp:1216
Marble::LayerInterface
Definition: LayerInterface.h:26
Marble::MarbleWidget::showGrid
bool showGrid() const
Return whether the coordinate grid is visible.
QDBusConnection::sessionBus
QDBusConnection sessionBus()
Marble::MarbleWidget::mapThemeId
QString mapThemeId() const
Get the ID of the current map theme To ensure that a unique identifier is being used the theme does N...
Marble::MarbleWidget::showRelief
bool showRelief() const
Return whether the relief is visible.
Marble::MapQuality
MapQuality
This enum is used to choose the map quality shown in the view.
Definition: MarbleGlobal.h:82
SunLocator.h
QPoint
Marble::MarbleWidget::setVolatileTileCacheLimit
void setVolatileTileCacheLimit(quint64 kiloBytes)
Set the limit of the volatile (in RAM) tile cache.
Definition: MarbleWidget.cpp:987
Marble::MarbleWidget::setZoom
void setZoom(int zoom, FlyToMode mode=Instant)
Zoom the view to a certain zoomlevel.
Definition: MarbleWidget.cpp:516
Marble::dgml::handler
static GeoTagHandlerRegistrar handler(GeoParser::QualifiedName(dgmlTag_DownloadPolicy, dgmlTag_nameSpace20), new DgmlDownloadPolicyTagHandler)
Planet.h
Marble::MarbleWidget::mapScreenShot
QPixmap mapScreenShot()
Return a QPixmap with the current contents of the widget.
Definition: MarbleWidget.cpp:385
Marble::MarbleWidget::setInputEnabled
void setInputEnabled(bool)
Definition: MarbleWidget.cpp:1086
Marble::MarbleWidget::moveLeft
void moveLeft(FlyToMode mode=Automatic)
Move left by the moveStep.
Definition: MarbleWidget.cpp:596
Marble::MarbleWidget::floatItem
AbstractFloatItem * floatItem(const QString &nameId) const
Returns the FloatItem with the given id.
Definition: MarbleWidget.cpp:1151
QTime
MarbleDebug.h
QObject::tr
QString tr(const char *sourceText, const char *disambiguation, int n)
QList::const_iterator
QWidget::update
void update()
Marble::MarbleWidget::readPluginSettings
void readPluginSettings(QSettings &settings)
Reads the plugin settings from the passed QSettings.
Definition: MarbleWidget.cpp:1112
Marble::MarbleWidget::setInputHandler
void setInputHandler(MarbleWidgetInputHandler *handler)
Set the input handler.
Definition: MarbleWidget.cpp:315
Marble::MarbleWidget::popupLayer
PopupLayer * popupLayer()
Definition: MarbleWidget.cpp:1226
Marble::MarbleWidget::whichItemAt
QList< AbstractDataPluginItem * > whichItemAt(const QPoint &curpos) const
Returns all widgets of dataPlugins on the position curpos.
Definition: MarbleWidget.cpp:365
Marble::RoutingLayer
A paint layer that serves as a view on a route model.
Definition: RoutingLayer.h:36
Marble::MarbleWidget::setSubSolarPointIconVisible
void setSubSolarPointIconVisible(bool visible)
Set whether the sun icon is shown in the sub solar point.
Definition: MarbleWidget.cpp:845
Marble::MarbleWidget::mapRegion
QRegion mapRegion() const
Return the projected region which describes the (shape of the) projected surface. ...
Definition: MarbleWidget.cpp:685
Marble::MarbleWidget::lookAt
GeoDataLookAt lookAt() const
Return the lookAt.
Definition: MarbleWidget.cpp:1181
MarbleWidgetInputHandler.h
Marble::MarbleWidget::flyTo
void flyTo(const GeoDataLookAt &lookAt, FlyToMode mode=Automatic)
Change the camera position to the given position.
Definition: MarbleWidget.cpp:1166
QSettings::setValue
void setValue(const QString &key, const QVariant &value)
Marble::MarbleWidget::setMapThemeId
void setMapThemeId(const QString &maptheme)
Set a new map theme.
Definition: MarbleWidget.cpp:759
QWidget::size
QSize size() const
QPaintEvent::rect
const QRect & rect() const
Marble::MarbleWidget::disconnectNotify
void disconnectNotify(const char *signal)
Definition: MarbleWidget.cpp:639
Marble::MarbleWidget::changeEvent
virtual void changeEvent(QEvent *event)
Reimplementation of the changeEvent() function in QWidget to react to changes of the enabled state...
Definition: MarbleWidget.cpp:1156
QRect
QTime::elapsed
int elapsed() const
MarbleMap.h
This file contains the headers for MarbleMap.
QWidget::isEnabled
bool isEnabled() const
Marble::MarbleWidget::downloadRegion
void downloadRegion(QVector< TileCoordsPyramid > const &)
Definition: MarbleWidget.cpp:1176
Marble::MarbleWidget::mapQuality
MapQuality mapQuality(ViewContext=Still) const
Retrieve the map quality depending on the view context.
Definition: MarbleWidget.cpp:1004
Marble::MarbleWidget::centerLongitude
qreal centerLongitude() const
Return the longitude of the center point.
Definition: MarbleWidget.cpp:680
Marble::MarbleWidget::paintEvent
virtual void paintEvent(QPaintEvent *event)
Reimplementation of the paintEvent() function in QWidget.
Definition: MarbleWidget.cpp:690
QObject::installEventFilter
void installEventFilter(QObject *filterObj)
Marble::MarbleWidget::setShowBorders
void setShowBorders(bool visible)
Set whether the borders visible.
Definition: MarbleWidget.cpp:924
QImage::fill
void fill(uint pixelValue)
Marble::Mercator
Mercator projection.
Definition: MarbleGlobal.h:47
QHash< QString, QVariant >
Marble::MarbleWidget::setShowPlaces
void setShowPlaces(bool visible)
Set whether the place mark overlay is visible.
Definition: MarbleWidget.cpp:882
QWidget::setUpdatesEnabled
void setUpdatesEnabled(bool enable)
Marble::MarbleWidget::setShowIceLayer
void setShowIceLayer(bool visible)
Set whether the ice layer is visible.
Definition: MarbleWidget.cpp:917
Marble::DataMigration
Definition: DataMigration.h:20
QImage::width
int width() const
Marble::MarbleWidget::setShowOverviewMap
void setShowOverviewMap(bool visible)
Set whether the overview map overlay is visible.
Definition: MarbleWidget.cpp:795
Marble::AbstractFloatItem
The abstract class for float item plugins.
Definition: AbstractFloatItem.h:45
Marble::MarbleWidget::setShowRelief
void setShowRelief(bool visible)
Set whether the relief is visible.
Definition: MarbleWidget.cpp:910
Marble::MarbleWidget::maximumZoom
int maximumZoom() const
Return the minimum zoom value for the current map theme.
Definition: MarbleWidget.cpp:355
RoutingLayer.h
Marble::MarbleWidget::model
MarbleModel * model()
Return the model that this view shows.
Definition: MarbleWidget.cpp:289
Marble::TileCreator
Definition: TileCreator.h:53
QPainter
Marble::MarbleWidget::showRivers
bool showRivers() const
Return whether the rivers are visible.
Marble::MarbleWidget::setLockToSubSolarPoint
void setLockToSubSolarPoint(bool visible)
Set the globe locked to the sub solar point.
Definition: MarbleWidget.cpp:837
MarbleDirs.h
Marble::radius
static qreal radius(qreal zoom)
Definition: thumbnailer.cpp:99
MarbleWidgetPopupMenu.h
Marble::MarbleWidget::showAtmosphere
bool showAtmosphere() const
Return whether the atmospheric glow is visible.
QHash::begin
iterator begin()
Marble::TextureLayer
Definition: TextureLayer.h:38
Marble::MarbleMap::removeLayer
void removeLayer(LayerInterface *layer)
Remove a layer from being included in rendering.
Definition: MarbleMap.cpp:1242
Marble::MarbleWidget::zoomOut
void zoomOut(FlyToMode mode=Automatic)
Zoom out by the amount zoomStep.
Definition: MarbleWidget.cpp:538
Marble::MarbleWidget::setCenterLatitude
void setCenterLatitude(qreal lat, FlyToMode mode=Instant)
Set the latitude for the center point.
Definition: MarbleWidget.cpp:569
Marble::NOT_AVAILABLE
static const char NOT_AVAILABLE[]
Definition: MarbleGlobal.h:251
Marble::MarbleWidget::radiusFromDistance
qreal radiusFromDistance(qreal distance) const
Return the globe radius (pixel) for the given distance (km)
Definition: MarbleWidget.cpp:1201
Marble::MarbleWidget::zoomView
void zoomView(int zoom, FlyToMode mode=Instant)
Definition: MarbleWidget.cpp:521
Marble::MarbleWidget::setShowBackground
void setShowBackground(bool visible)
Definition: MarbleWidget.cpp:952
QString
QList
QtConcurrent::map
QFuture< void > map(Sequence &sequence, MapFunction function)
Marble::RenderStatus
RenderStatus
Definition: MarbleGlobal.h:191
MarbleLocale.h
GeoPainter.h
GeoDataPlacemark.h
Marble::MarbleWidget::goHome
void goHome(FlyToMode mode=Automatic)
Center the view on the default start point with the default zoom.
Definition: MarbleWidget.cpp:749
Marble::RenderState
Definition: RenderState.h:22
Marble::MarbleWidget::animationsEnabled
bool animationsEnabled() const
Retrieve whether travels to a point should get animated.
Definition: MarbleWidget.cpp:1036
Marble::MarbleWidget::addLayer
void addLayer(LayerInterface *layer)
Add a layer to be included in rendering.
Definition: MarbleWidget.cpp:370
Marble::MarbleWidget::minimumZoom
int minimumZoom() const
Return the minimum zoom value for the current map theme.
Definition: MarbleWidget.cpp:350
Marble::ViewportParams::mapRegion
QRegion mapRegion() const
Definition: ViewportParams.cpp:408
Marble::MarbleWidget::viewContext
ViewContext viewContext() const
Retrieve the view context (i.e.
Definition: MarbleWidget.cpp:1019
MarbleAbstractPresenter.h
QWidget::changeEvent
virtual void changeEvent(QEvent *event)
QStringList
Marble::ViewportParams
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
Marble::MarbleWidget::viewport
ViewportParams * viewport()
Definition: MarbleWidget.cpp:299
QWidget::rect
QRect rect() const
QPixmap
Marble::MarbleWidget::setShowLakes
void setShowLakes(bool visible)
Set whether the lakes are visible.
Definition: MarbleWidget.cpp:938
Marble::MarbleWidget::setCenterLongitude
void setCenterLongitude(qreal lon, FlyToMode mode=Instant)
Set the longitude for the center point.
Definition: MarbleWidget.cpp:574
Marble::MarbleWidget::textureLayer
TextureLayer * textureLayer() const
Definition: MarbleWidget.cpp:380
Marble::RenderPlugin::nameId
QString nameId
Definition: RenderPlugin.h:48
Marble::MarbleWidget::showScaleBar
bool showScaleBar() const
Return whether the scale bar is visible.
Marble::MarbleWidget::customPaint
virtual void customPaint(GeoPainter *painter)
Enables custom drawing onto the MarbleWidget straight after.
Definition: MarbleWidget.cpp:742
QHash::value
const T value(const Key &key) const
Marble::MarbleWidget::zoomIn
void zoomIn(FlyToMode mode=Automatic)
Zoom in by the amount zoomStep.
Definition: MarbleWidget.cpp:533
DataMigration.h
Marble::MarbleWidget::isLockedToSubSolarPoint
bool isLockedToSubSolarPoint() const
Return whether the globe is locked to the sub solar point.
QResizeEvent::size
const QSize & size() const
QSettings
Marble::MarbleWidget::centerOn
void centerOn(const qreal lon, const qreal lat, bool animated=false)
Center the view on a geographical point.
Definition: MarbleWidget.cpp:549
Marble::MarbleWidget::setShowSunShading
void setShowSunShading(bool visible)
Set whether the night shadow is visible.
Definition: MarbleWidget.cpp:823
Marble::GeoSceneDocument
A container for features parsed from the DGML file.
Definition: GeoSceneDocument.h:44
MarbleClock.h
Marble::MarbleWidget::setRadius
void setRadius(int radius)
Set the radius of the globe in pixels.
Definition: MarbleWidget.cpp:330
Marble::MarbleWidget::setViewContext
void setViewContext(ViewContext viewContext)
Set the view context (i.e.
Definition: MarbleWidget.cpp:1024
ViewportParams.h
This file contains the headers for ViewportParams.
Marble::MarbleWidget::setShowCompass
void setShowCompass(bool visible)
Set whether the compass overlay is visible.
Definition: MarbleWidget.cpp:809
QImage
Marble::GeoDataLookAt
Definition: GeoDataLookAt.h:23
Marble::MarbleWidget::rotateBy
void rotateBy(const qreal deltaLon, const qreal deltaLat, FlyToMode mode=Instant)
Rotate the view by the two angles phi and theta.
Definition: MarbleWidget.cpp:543
Marble::FlyToMode
FlyToMode
Describes possible flight mode (interpolation between source and target camera positions) ...
Definition: MarbleGlobal.h:173
Marble::MarbleWidget::showCompass
bool showCompass() const
Return whether the compass bar is visible.
Marble::MarbleWidget::setMapQualityForViewContext
void setMapQualityForViewContext(MapQuality quality, ViewContext viewContext)
Set the map quality for the specified view context.
Definition: MarbleWidget.cpp:1009
Marble::MarbleWidget::resetFocusPoint
void resetFocusPoint()
Invalidate any focus point set with setFocusPoint.
Definition: MarbleWidget.cpp:1196
Marble::MarbleModel
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:97
QSettings::value
QVariant value(const QString &key, const QVariant &defaultValue) const
Marble::MarbleWidget::showCities
bool showCities() const
Return whether the city place marks are visible.
PopupLayer.h
Marble::MarbleWidget::showCityLights
bool showCityLights() const
Return whether the city lights are shown instead of the night shadow.
Marble::MarbleAbstractPresenter::MarbleAbstractPresenter
MarbleAbstractPresenter()
Definition: MarbleAbstractPresenter.cpp:31
QPainter::drawImage
void drawImage(const QRectF &target, const QImage &image, const QRectF &source, QFlags< Qt::ImageConversionFlag > flags)
QVector
Marble::MarbleWidgetPopupMenu
The MarbleWidgetPopupMenu handles context menus.
Definition: MarbleWidgetPopupMenu.h:33
Marble::AngleUnit
AngleUnit
This enum is used to choose the unit chosen to measure angles.
Definition: MarbleGlobal.h:65
Marble::MarbleWidget::setShowRivers
void setShowRivers(bool visible)
Set whether the rivers are visible.
Definition: MarbleWidget.cpp:931
Marble::MarbleWidget::showFrameRate
bool showFrameRate() const
Return whether the frame rate gets displayed.
Definition: MarbleWidget.cpp:500
Marble::MarbleWidget::setShowTerrain
void setShowTerrain(bool visible)
Set whether the terrain place mark overlay is visible.
Definition: MarbleWidget.cpp:896
Marble::MarbleWidget::routingLayer
RoutingLayer * routingLayer()
Definition: MarbleWidget.cpp:1221
Marble::MarbleWidget::isSubSolarPointIconVisible
bool isSubSolarPointIconVisible() const
Return whether the sun icon is shown in the sub solar point.
Marble::MarbleWidget::focusPoint
GeoDataCoordinates focusPoint() const
Definition: MarbleWidget.cpp:1186
GeoDataLatLonAltBox.h
RenderPlugin.h
Marble::MarbleWidget::geoCoordinates
bool geoCoordinates(int x, int y, qreal &lon, qreal &lat, GeoDataCoordinates::Unit=GeoDataCoordinates::Degree) const
Get the earth coordinates corresponding to a pixel in the widget.
Definition: MarbleWidget.cpp:668
Marble::MarbleWidget::setSelection
void setSelection(const QRect &region)
Definition: MarbleWidget.cpp:1066
Marble::MarbleAbstractPresenter::map
MarbleMap * map()
Definition: MarbleAbstractPresenter.cpp:544
Marble::MarbleWidget::setShowAtmosphere
void setShowAtmosphere(bool visible)
Set whether the atmospheric glow is visible.
Definition: MarbleWidget.cpp:861
QPixmap::grabWidget
QPixmap grabWidget(QWidget *widget, const QRect &rectangle)
Marble::MarbleWidget::removeLayer
void removeLayer(LayerInterface *layer)
Remove a layer from being included in rendering.
Definition: MarbleWidget.cpp:375
Marble::MarbleWidget::mapTheme
GeoSceneDocument * mapTheme() const
Get the GeoSceneDocument object of the current map theme.
Definition: MarbleWidget.cpp:782
Marble::Projection
Projection
This enum is used to choose the projection shown in the view.
Definition: MarbleGlobal.h:44
Marble::MarbleWidget::zoom
int zoom() const
Return the current zoom amount.
Marble::MarbleWidget::setShowTileId
void setShowTileId(bool visible)
Set whether the is tile is visible NOTE: This is part of the transitional debug API and might be subj...
Definition: MarbleWidget.cpp:964
Marble::MarbleWidget::distanceFromRadius
qreal distanceFromRadius(qreal radius) const
Return the distance (km) at the given globe radius (pixel)
Definition: MarbleWidget.cpp:1206
MarbleWidget.h
This file contains the headers for MarbleWidget.
QTime::start
void start()
Marble::MarbleWidget::popupMenu
MarbleWidgetPopupMenu * popupMenu()
Definition: MarbleWidget.cpp:309
QImage::height
int height() const
Marble::MarbleWidget::setDistance
void setDistance(qreal distance)
Set the distance of the observer to the globe in km.
Definition: MarbleWidget.cpp:1076
Marble::FpsLayer
Definition: FpsLayer.h:20
Marble::MarbleWidget::setShowClouds
void setShowClouds(bool visible)
Set whether the cloud cover is visible.
Definition: MarbleWidget.cpp:816
Marble::MarbleWidget::setDefaultFont
void setDefaultFont(const QFont &font)
Definition: MarbleWidget.cpp:1061
Marble::MarbleWidget::moveStep
qreal moveStep() const
Return how much the map will move if one of the move slots are called.
Definition: MarbleWidget.cpp:335
Marble::MarbleWidget::defaultFont
QFont defaultFont() const
Definition: MarbleWidget.cpp:1056
Marble::MarbleWidget::setShowCities
void setShowCities(bool visible)
Set whether the city place mark overlay is visible.
Definition: MarbleWidget.cpp:889
Marble::MarbleWidget::showBackground
bool showBackground() const
Definition: MarbleWidget.cpp:505
MarbleWidget
Wraps a Marble::MarbleWidget, providing access to important properties and methods.
Definition: MarbleDeclarativeWidget.h:50
QPaintEvent
QHash::end
iterator end()
QWidget::resizeEvent
virtual void resizeEvent(QResizeEvent *event)
QList::constEnd
const_iterator constEnd() const
Marble::MarbleWidget::writePluginSettings
void writePluginSettings(QSettings &settings) const
Writes the plugin settings in the passed QSettings.
Definition: MarbleWidget.cpp:1129
Marble::MarbleWidget::MarbleWidget
MarbleWidget(QWidget *parent=0)
Construct a new MarbleWidget.
Definition: MarbleWidget.cpp:147
QList::constBegin
const_iterator constBegin() const
Marble::MarbleWidget::clearVolatileTileCache
void clearVolatileTileCache()
Definition: MarbleWidget.cpp:981
Marble::MarbleWidget::showIceLayer
bool showIceLayer() const
Return whether the ice layer is visible.
MarblePhysics.h
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Marble::MarbleWidget::inputHandler
MarbleWidgetInputHandler * inputHandler() const
Returns the current input handler.
Definition: MarbleWidget.cpp:320
Marble::RenderPlugin::settings
virtual QHash< QString, QVariant > settings() const
Settings of the plugin.
Definition: RenderPlugin.cpp:185
Marble::MarbleWidget::setShowGrid
void setShowGrid(bool visible)
Set whether the coordinate grid overlay is visible.
Definition: MarbleWidget.cpp:875
Marble::MarbleWidget::showPlaces
bool showPlaces() const
Return whether the place marks are visible.
Marble::MarbleWidget::defaultAngleUnit
AngleUnit defaultAngleUnit() const
Definition: MarbleWidget.cpp:1046
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:36
Marble::MarbleWidget::setShowCrosshairs
void setShowCrosshairs(bool visible)
Set whether the crosshairs are visible.
Definition: MarbleWidget.cpp:868
Marble::MarbleWidget::floatItems
QList< AbstractFloatItem * > floatItems() const
Returns a list of all FloatItems on the widget.
Definition: MarbleWidget.cpp:1146
Marble::RenderPlugin
The abstract class that creates a renderable item.
Definition: RenderPlugin.h:43
Marble::MarbleWidget::mouseMoveGeoPosition
void mouseMoveGeoPosition(const QString &)
Marble::GeoDataLatLonAltBox
A class that defines a 3D bounding box for geographic data.
Definition: GeoDataLatLonAltBox.h:49
Marble::MarbleWidget::renderPlugins
QList< RenderPlugin * > renderPlugins() const
Returns a list of all RenderPlugins on the widget, this includes float items.
Definition: MarbleWidget.cpp:1107
QMetaMethod
Marble::RenderPlugin::setSettings
virtual void setSettings(const QHash< QString, QVariant > &settings)
Set the settings of the plugin.
Definition: RenderPlugin.cpp:195
Marble::MarbleWidget::showClouds
bool showClouds() const
Return whether the cloud cover is visible.
QPalette
QObject::removeEventFilter
void removeEventFilter(QObject *obj)
Marble::MarbleWidget::mouseClickGeoPosition
void mouseClickGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::Unit)
QSettings::beginGroup
void beginGroup(const QString &prefix)
TileCreatorDialog.h
QRegion
Marble::MarbleWidget::notifyMouseClick
void notifyMouseClick(int x, int y)
Used to notify about the position of the mouse click.
Definition: MarbleWidget.cpp:969
QWidget::render
void render(QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, QFlags< QWidget::RenderFlag > renderFlags)
Marble::MarbleWidget::setShowFrameRate
void setShowFrameRate(bool visible)
Set whether the frame rate gets shown.
Definition: MarbleWidget.cpp:945
Marble::MarbleWidget::moveRight
void moveRight(FlyToMode mode=Automatic)
Move right by the moveStep.
Definition: MarbleWidget.cpp:601
Marble::MarbleWidget::setShowOtherPlaces
void setShowOtherPlaces(bool visible)
Set whether the other places overlay is visible.
Definition: MarbleWidget.cpp:903
Marble::MarbleWidget::resizeEvent
virtual void resizeEvent(QResizeEvent *event)
Reimplementation of the resizeEvent() function in QWidget.
Definition: MarbleWidget.cpp:621
Marble::GeoDataLatLonBox
A class that defines a 2D bounding box for geographic data.
Definition: GeoDataLatLonBox.h:51
Marble::MarbleWidget::setShowScaleBar
void setShowScaleBar(bool visible)
Set whether the scale bar overlay is visible.
Definition: MarbleWidget.cpp:802
Marble::MarbleWidget::centerLatitude
qreal centerLatitude() const
Return the latitude of the center point.
Definition: MarbleWidget.cpp:675
Marble::MarbleWidget::distance
qreal distance() const
Return the current distance.
Definition: MarbleWidget.cpp:1071
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:40 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