• 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
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 
27 #ifdef MARBLE_DBUS
28 #include <QDBusConnection>
29 #endif
30 
31 #include "DataMigration.h"
32 #include "FpsLayer.h"
33 #include "FileManager.h"
34 #include "GeoDataLatLonAltBox.h"
35 #include "GeoDataPlacemark.h"
36 #include "GeoPainter.h"
37 #include "MarbleClock.h"
38 #include "MarbleDebug.h"
39 #include "MarbleDirs.h"
40 #include "MarbleLocale.h"
41 #include "MarbleMap.h"
42 #include "MarbleModel.h"
43 #include "MarblePhysics.h"
44 #include "MarbleWidgetInputHandler.h"
45 #include "MarbleWidgetPopupMenu.h"
46 #include "Planet.h"
47 #include "PopupLayer.h"
48 #include "RenderPlugin.h"
49 #include "SunLocator.h"
50 #include "TileCreatorDialog.h"
51 #include "ViewportParams.h"
52 #include "routing/RoutingLayer.h"
53 
54 namespace Marble
55 {
56 
57 class MarbleWidget::CustomPaintLayer : public LayerInterface
58 {
59  public:
60  CustomPaintLayer( MarbleWidget *widget )
61  : m_widget( widget )
62  {
63  }
64 
65  virtual QStringList renderPosition() const { return QStringList() << "USER_TOOLS"; }
66 
67  virtual bool render( GeoPainter *painter, ViewportParams *viewport,
68  const QString &renderPos, GeoSceneLayer *layer )
69  {
70  Q_UNUSED( viewport );
71  Q_UNUSED( renderPos );
72  Q_UNUSED( layer );
73 
74  m_widget->customPaint( painter );
75 
76  return true;
77  }
78 
79  virtual qreal zValue() const { return 1.0e7; }
80 
81  private:
82  MarbleWidget *const m_widget;
83 };
84 
85 
86 class MarbleWidgetPrivate
87 {
88  public:
89  MarbleWidgetPrivate( MarbleWidget *parent )
90  : m_widget( parent ),
91  m_model(),
92  m_map( &m_model ),
93  m_animationsEnabled( false ),
94  m_logzoom( 0 ),
95  m_zoomStep( MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen ? 60 : 40 ),
96  m_inputhandler( 0 ),
97  m_physics( parent ),
98  m_routingLayer( 0 ),
99  m_mapInfoDialog( 0 ),
100  m_customPaintLayer( parent ),
101  m_popupmenu( 0 ),
102  m_showFrameRate( false ),
103  m_viewAngle( 110.0 )
104  {
105  }
106 
107  ~MarbleWidgetPrivate()
108  {
109  m_map.removeLayer( &m_customPaintLayer );
110  }
111 
112  void construct();
113 
114  void updateMapTheme();
115 
116  inline static qreal zoom( qreal radius ) { return (200.0 * log( radius ) ); }
117  inline static qreal radius( qreal zoom ) { return pow( M_E, ( zoom / 200.0 ) ); }
118 
125  void moveByStep( int stepsRight, int stepsDown, FlyToMode mode );
126 
133  void updateSystemBackgroundAttribute();
134 
135  MarbleWidget *const m_widget;
136  // The model we are showing.
137  MarbleModel m_model;
138  MarbleMap m_map;
139 
140  bool m_animationsEnabled;
141 
142  // zoom related
143  int m_logzoom;
144  int m_zoomStep;
145 
146  MarbleWidgetInputHandler *m_inputhandler;
147 
148  MarblePhysics m_physics;
149 
150  RoutingLayer *m_routingLayer;
151  PopupLayer *m_mapInfoDialog;
152  MarbleWidget::CustomPaintLayer m_customPaintLayer;
153 
154  MarbleWidgetPopupMenu *m_popupmenu;
155 
156  bool m_showFrameRate;
157 
158  const qreal m_viewAngle;
159 };
160 
161 
162 
163 MarbleWidget::MarbleWidget(QWidget *parent)
164  : QWidget( parent ),
165  d( new MarbleWidgetPrivate( this ) )
166 {
167 // setAttribute( Qt::WA_PaintOnScreen, true );
168  d->construct();
169 }
170 
171 MarbleWidget::~MarbleWidget()
172 {
173  // Remove and delete an existing InputHandler
174  // initialized in d->construct()
175  setInputHandler( 0 );
176 
177  delete d;
178 }
179 
180 void MarbleWidgetPrivate::construct()
181 {
182  QPointer<DataMigration> dataMigration = new DataMigration( m_widget );
183  dataMigration->exec();
184  delete dataMigration;
185 
186 #ifdef MARBLE_DBUS
187  QDBusConnection::sessionBus().registerObject( "/MarbleWidget", m_widget,
188  QDBusConnection::ExportAllSlots
189  | QDBusConnection::ExportAllSignals
190  | QDBusConnection::ExportAllProperties );
191 #endif
192 
193  // Widget settings
194  m_widget->setMinimumSize( 200, 300 );
195  m_widget->setFocusPolicy( Qt::WheelFocus );
196  m_widget->setFocus( Qt::OtherFocusReason );
197 
198  // Set background: black.
199  m_widget->setPalette( QPalette ( Qt::black ) );
200 
201  // Set whether the black space gets displayed or the earth gets simply
202  // displayed on the widget background.
203  m_widget->setAutoFillBackground( true );
204 
205  // Initialize the map and forward some signals.
206  m_map.setSize( m_widget->width(), m_widget->height() );
207  m_map.setShowFrameRate( false ); // never let the map draw the frame rate,
208  // we do this differently here in the widget
209 
210  // forward some signals of m_map
211  m_widget->connect( &m_map, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)),
212  m_widget, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)) );
213  m_widget->connect( &m_map, SIGNAL(projectionChanged(Projection)),
214  m_widget, SIGNAL(projectionChanged(Projection)) );
215  m_widget->connect( &m_map, SIGNAL(tileLevelChanged(int)),
216  m_widget, SIGNAL(tileLevelChanged(int)) );
217  m_widget->connect( &m_map, SIGNAL(framesPerSecond(qreal)),
218  m_widget, SIGNAL(framesPerSecond(qreal)) );
219 
220  m_widget->connect( &m_map, SIGNAL(pluginSettingsChanged()),
221  m_widget, SIGNAL(pluginSettingsChanged()) );
222  m_widget->connect( &m_map, SIGNAL(renderPluginInitialized(RenderPlugin*)),
223  m_widget, SIGNAL(renderPluginInitialized(RenderPlugin*)) );
224 
225  // react to some signals of m_map
226  m_widget->connect( &m_map, SIGNAL(themeChanged(QString)),
227  m_widget, SLOT(updateMapTheme()) );
228  m_widget->connect( &m_map, SIGNAL(repaintNeeded(QRegion)),
229  m_widget, SLOT(update()) );
230  m_widget->connect( &m_map, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)),
231  m_widget, SLOT(updateSystemBackgroundAttribute()) );
232 
233  m_widget->connect( m_model.fileManager(), SIGNAL(centeredDocument(GeoDataLatLonBox)),
234  m_widget, SLOT(centerOn(GeoDataLatLonBox)) );
235 
236 
237  // Show a progress dialog when the model calculates new map tiles.
238  m_widget->connect( &m_model, SIGNAL( creatingTilesStart( TileCreator*, const QString&,
239  const QString& ) ),
240  m_widget, SLOT( creatingTilesStart( TileCreator*, const QString&,
241  const QString& ) ) );
242 
243  m_popupmenu = new MarbleWidgetPopupMenu( m_widget, &m_model );
244 
245  m_widget->connect( m_popupmenu, SIGNAL(trackPlacemark(const GeoDataPlacemark*)),
246  &m_model, SLOT(setTrackedPlacemark(const GeoDataPlacemark*)) );
247 
248  m_routingLayer = new RoutingLayer( m_widget, m_widget );
249  m_routingLayer->setPlacemarkModel( 0 );
250  QObject::connect( m_routingLayer, SIGNAL(repaintNeeded(QRect)),
251  m_widget, SLOT(update()) );
252 
253  m_mapInfoDialog = new PopupLayer( m_widget, m_widget );
254  m_mapInfoDialog->setVisible( false );
255  m_widget->connect( m_mapInfoDialog, SIGNAL(repaintNeeded()), m_widget, SLOT(update()) );
256  m_map.addLayer( m_mapInfoDialog );
257 
258  m_widget->setInputHandler( new MarbleWidgetDefaultInputHandler( m_widget ) );
259  m_widget->setMouseTracking( true );
260 
261  m_map.addLayer( &m_customPaintLayer );
262 }
263 
264 void MarbleWidgetPrivate::moveByStep( int stepsRight, int stepsDown, FlyToMode mode )
265 {
266  int polarity = m_widget->viewport()->polarity();
267  qreal left = polarity * stepsRight * m_widget->moveStep();
268  qreal down = stepsDown * m_widget->moveStep();
269  m_widget->rotateBy( left, down, mode );
270 }
271 
272 void MarbleWidgetPrivate::updateSystemBackgroundAttribute()
273 {
274  // We only have to repaint the background every time if the earth
275  // doesn't cover the whole image.
276  const bool isOn = m_map.viewport()->mapCoversViewport() && !m_model.mapThemeId().isEmpty();
277  m_widget->setAttribute( Qt::WA_NoSystemBackground, isOn );
278 }
279 
280 // ----------------------------------------------------------------
281 
282 
283 MarbleModel *MarbleWidget::model() const
284 {
285  return &d->m_model;
286 }
287 
288 
289 ViewportParams* MarbleWidget::viewport()
290 {
291  return d->m_map.viewport();
292 }
293 
294 const ViewportParams* MarbleWidget::viewport() const
295 {
296  return d->m_map.viewport();
297 }
298 
299 MarbleWidgetPopupMenu *MarbleWidget::popupMenu()
300 {
301  return d->m_popupmenu;
302 }
303 
304 
305 void MarbleWidget::setInputHandler( MarbleWidgetInputHandler *handler )
306 {
307  delete d->m_inputhandler;
308  d->m_inputhandler = handler;
309 
310  if ( d->m_inputhandler ) {
311  installEventFilter( d->m_inputhandler );
312 
313  connect( d->m_inputhandler, SIGNAL(mouseClickScreenPosition(int,int)),
314  this, SLOT(notifyMouseClick(int,int)) );
315 
316  connect( d->m_inputhandler, SIGNAL(mouseMoveGeoPosition(QString)),
317  this, SIGNAL(mouseMoveGeoPosition(QString)) );
318  }
319 }
320 
321 MarbleWidgetInputHandler *MarbleWidget::inputHandler() const
322 {
323  return d->m_inputhandler;
324 }
325 
326 int MarbleWidget::radius() const
327 {
328  return d->m_map.radius();
329 }
330 
331 void MarbleWidget::setRadius( int radius )
332 {
333  Q_ASSERT( radius >= 0 );
334  bool adjustRadius = radius != d->m_map.radius();
335 
336  qreal const zoom = d->zoom( radius );
337 
338  // Prevent exceeding zoom range
339  if ( zoom < minimumZoom() ) {
340  radius = d->radius( minimumZoom() );
341  adjustRadius = true;
342  } else if ( zoom > maximumZoom() ) {
343  radius = d->radius( maximumZoom() );
344  adjustRadius = true;
345  }
346 
347  if( adjustRadius) {
348  d->m_map.setRadius( radius );
349  d->m_logzoom = qRound( zoom );
350 
351  emit zoomChanged( d->m_logzoom );
352  emit distanceChanged( distanceString() );
353 
354  update();
355  }
356 }
357 
358 qreal MarbleWidget::moveStep() const
359 {
360  if ( radius() < qSqrt( (qreal)(width() * width() + height() * height()) ) )
361  return 180.0 * 0.1;
362  else
363  return 180.0 * qAtan( (qreal)width()
364  / (qreal)( 2 * radius() ) ) * 0.2;
365 }
366 
367 int MarbleWidget::zoom() const
368 {
369  return d->m_logzoom;
370 }
371 
372 int MarbleWidget::tileZoomLevel() const
373 {
374  return d->m_map.tileZoomLevel();
375 }
376 
377 int MarbleWidget::minimumZoom() const
378 {
379  return d->m_map.minimumZoom();
380 }
381 
382 int MarbleWidget::maximumZoom() const
383 {
384  return d->m_map.maximumZoom();
385 }
386 
387 QVector<const GeoDataPlacemark*> MarbleWidget::whichFeatureAt( const QPoint &curpos ) const
388 {
389  return d->m_map.whichFeatureAt( curpos );
390 }
391 
392 QList<AbstractDataPluginItem*> MarbleWidget::whichItemAt( const QPoint &curpos ) const
393 {
394  return d->m_map.whichItemAt( curpos );
395 }
396 
397 void MarbleWidget::addLayer( LayerInterface *layer )
398 {
399  d->m_map.addLayer( layer );
400 }
401 
402 void MarbleWidget::removeLayer( LayerInterface *layer )
403 {
404  d->m_map.removeLayer( layer );
405 }
406 
407 const Marble::TextureLayer* MarbleWidget::textureLayer() const
408 {
409  return d->m_map.textureLayer();
410 }
411 
412 QPixmap MarbleWidget::mapScreenShot()
413 {
414  return QPixmap::grabWidget( this );
415 }
416 
417 bool MarbleWidget::showOverviewMap() const
418 {
419  return d->m_map.showOverviewMap();
420 }
421 
422 bool MarbleWidget::showScaleBar() const
423 {
424  return d->m_map.showScaleBar();
425 }
426 
427 bool MarbleWidget::showCompass() const
428 {
429  return d->m_map.showCompass();
430 }
431 
432 bool MarbleWidget::showClouds() const
433 {
434  return d->m_map.showClouds();
435 }
436 
437 bool MarbleWidget::showSunShading() const
438 {
439  return d->m_map.showSunShading();
440 }
441 
442 bool MarbleWidget::showCityLights() const
443 {
444  return d->m_map.showCityLights();
445 }
446 
447 bool MarbleWidget::isLockedToSubSolarPoint() const
448 {
449  return d->m_map.isLockedToSubSolarPoint();
450 }
451 
452 bool MarbleWidget::isSubSolarPointIconVisible() const
453 {
454  return d->m_map.isSubSolarPointIconVisible();
455 }
456 
457 bool MarbleWidget::showAtmosphere() const
458 {
459  return d->m_map.showAtmosphere();
460 }
461 
462 bool MarbleWidget::showCrosshairs() const
463 {
464  return d->m_map.showCrosshairs();
465 }
466 
467 bool MarbleWidget::showGrid() const
468 {
469  return d->m_map.showGrid();
470 }
471 
472 bool MarbleWidget::showPlaces() const
473 {
474  return d->m_map.showPlaces();
475 }
476 
477 bool MarbleWidget::showCities() const
478 {
479  return d->m_map.showCities();
480 }
481 
482 bool MarbleWidget::showTerrain() const
483 {
484  return d->m_map.showTerrain();
485 }
486 
487 bool MarbleWidget::showOtherPlaces() const
488 {
489  return d->m_map.showOtherPlaces();
490 }
491 
492 bool MarbleWidget::showRelief() const
493 {
494  return d->m_map.showRelief();
495 }
496 
497 bool MarbleWidget::showIceLayer() const
498 {
499  return d->m_map.showIceLayer();
500 }
501 
502 bool MarbleWidget::showBorders() const
503 {
504  return d->m_map.showBorders();
505 }
506 
507 bool MarbleWidget::showRivers() const
508 {
509  return d->m_map.showRivers();
510 }
511 
512 bool MarbleWidget::showLakes() const
513 {
514  return d->m_map.showLakes();
515 }
516 
517 bool MarbleWidget::showFrameRate() const
518 {
519  return d->m_showFrameRate;
520 }
521 
522 bool MarbleWidget::showBackground() const
523 {
524  return d->m_map.showBackground();
525 }
526 
527 quint64 MarbleWidget::volatileTileCacheLimit() const
528 {
529  return d->m_map.volatileTileCacheLimit();
530 }
531 
532 
533 void MarbleWidget::setZoom( int newZoom, FlyToMode mode )
534 {
535  // It won't fly anyway. So we should do everything to keep the zoom value.
536  if ( !d->m_animationsEnabled || mode == Instant ) {
537  // Check for under and overflow.
538  if ( newZoom < minimumZoom() )
539  newZoom = minimumZoom();
540  else if ( newZoom > maximumZoom() )
541  newZoom = maximumZoom();
542 
543  // Prevent infinite loops.
544  if ( newZoom == d->m_logzoom )
545  return;
546 
547  d->m_map.setRadius( d->radius( newZoom ) );
548  d->m_logzoom = newZoom;
549 
550  emit zoomChanged( d->m_logzoom );
551  emit distanceChanged( distanceString() );
552 
553  update();
554  }
555  else {
556  GeoDataLookAt target = lookAt();
557  target.setRange( KM2METER * distanceFromZoom( newZoom ) );
558 
559  flyTo( target, mode );
560  }
561 }
562 
563 void MarbleWidget::zoomView( int zoom, FlyToMode mode )
564 {
565  setZoom( zoom, mode );
566 }
567 
568 
569 void MarbleWidget::zoomViewBy( int zoomStep, FlyToMode mode )
570 {
571  setZoom( zoom() + zoomStep, mode );
572 }
573 
574 
575 void MarbleWidget::zoomIn( FlyToMode mode )
576 {
577  if ( d->m_map.tileZoomLevel() < 0 ) {
578  zoomViewBy( d->m_zoomStep, mode );
579  } else {
580  int radius = d->m_map.preferredRadiusCeil( d->m_map.radius() * 1.05 );
581  radius = qMax<int>( d->radius( minimumZoom() ), qMin<int>( radius, d->radius( maximumZoom() ) ) );
582 
583  GeoDataLookAt target = lookAt();
584  target.setRange( KM2METER * distanceFromRadius( radius ) );
585 
586  flyTo( target, mode );
587  }
588 }
589 
590 void MarbleWidget::zoomOut( FlyToMode mode )
591 {
592  if ( d->m_map.tileZoomLevel() <= 0 ) {
593  zoomViewBy( -d->m_zoomStep, mode );
594  } else {
595  int radius = d->m_map.preferredRadiusFloor( d->m_map.radius() * 0.95 );
596  radius = qMax<int>( d->radius( minimumZoom() ), qMin<int>( radius, d->radius( maximumZoom() ) ) );
597 
598  GeoDataLookAt target = lookAt();
599  target.setRange( KM2METER * distanceFromRadius( radius ) );
600 
601  flyTo( target, mode );
602  }
603 }
604 
605 void MarbleWidget::rotateBy( const qreal deltaLon, const qreal deltaLat, FlyToMode mode )
606 {
607  Quaternion rotPhi( 1.0, deltaLat / 180.0, 0.0, 0.0 );
608  Quaternion rotTheta( 1.0, 0.0, deltaLon / 180.0, 0.0 );
609 
610  Quaternion axis = d->m_map.viewport()->planetAxis();
611  qreal lon( 0.0 ), lat( 0.0 );
612  axis.getSpherical( lon, lat );
613  axis = rotTheta * axis;
614  axis *= rotPhi;
615  axis.normalize();
616  lat = -axis.pitch();
617  lon = axis.yaw();
618 
619  GeoDataLookAt target = lookAt();
620  target.setLongitude( lon );
621  target.setLatitude( lat );
622  flyTo( target, mode );
623 }
624 
625 
626 void MarbleWidget::centerOn( const qreal lon, const qreal lat, bool animated )
627 {
628  GeoDataCoordinates target( lon, lat, 0.0, GeoDataCoordinates::Degree );
629  centerOn( target, animated );
630 }
631 
632 void MarbleWidget::centerOn( const GeoDataCoordinates &position, bool animated )
633 {
634  GeoDataLookAt target = lookAt();
635  target.setCoordinates( position );
636  flyTo( target, animated ? Automatic : Instant );
637 }
638 
639 void MarbleWidget::centerOn( const GeoDataLatLonBox &box, bool animated )
640 {
641  if ( box.isEmpty() ) {
642  return;
643  }
644 
645  int newRadius = radius();
646  ViewportParams* viewparams = viewport();
647  //prevent divide by zero
648  if( box.height() && box.width() ) {
649  //work out the needed zoom level
650  int const horizontalRadius = ( 0.25 * M_PI ) * ( viewparams->height() / box.height() );
651  int const verticalRadius = ( 0.25 * M_PI ) * ( viewparams->width() / box.width() );
652  newRadius = qMin<int>( horizontalRadius, verticalRadius );
653  newRadius = qMax<int>( d->radius( minimumZoom() ), qMin<int>( newRadius, d->radius( maximumZoom() ) ) );
654  }
655 
656  //move the map
657  GeoDataLookAt target;
658  target.setCoordinates( box.center() );
659  target.setAltitude( box.center().altitude() );
660  target.setRange(KM2METER * distanceFromRadius( newRadius ));
661  flyTo( target, animated ? Automatic : Instant );
662 }
663 
664 void MarbleWidget::centerOn( const GeoDataPlacemark& placemark, bool animated )
665 {
666  const GeoDataLookAt *lookAt( placemark.lookAt() );
667  if ( lookAt ) {
668  flyTo( *lookAt, animated ? Automatic : Instant );
669  } else {
670  bool icon;
671  GeoDataCoordinates coords = placemark.coordinate( d->m_model.clock()->dateTime(), &icon );
672  if ( icon ) {
673  centerOn( coords, animated );
674  } else {
675  centerOn( placemark.geometry()->latLonAltBox(), animated );
676  }
677  }
678 }
679 
680 void MarbleWidget::setCenterLatitude( qreal lat, FlyToMode mode )
681 {
682  centerOn( centerLongitude(), lat, mode );
683 }
684 
685 void MarbleWidget::setCenterLongitude( qreal lon, FlyToMode mode )
686 {
687  centerOn( lon, centerLatitude(), mode );
688 }
689 
690 Projection MarbleWidget::projection() const
691 {
692  return d->m_map.projection();
693 }
694 
695 void MarbleWidget::setProjection( Projection projection )
696 {
697  d->m_map.setProjection( projection );
698 
699  update();
700 }
701 
702 void MarbleWidget::setProjection( int projection )
703 {
704  setProjection( (Projection)( projection ) );
705 }
706 
707 void MarbleWidget::moveLeft( FlyToMode mode )
708 {
709  d->moveByStep( -1, 0, mode );
710 }
711 
712 void MarbleWidget::moveRight( FlyToMode mode )
713 {
714  d->moveByStep( 1, 0, mode );
715 }
716 
717 
718 void MarbleWidget::moveUp( FlyToMode mode )
719 {
720  d->moveByStep( 0, -1, mode );
721 }
722 
723 void MarbleWidget::moveDown( FlyToMode mode )
724 {
725  d->moveByStep( 0, 1, mode );
726 }
727 
728 void MarbleWidget::leaveEvent( QEvent* )
729 {
730  emit mouseMoveGeoPosition( tr( NOT_AVAILABLE ) );
731 }
732 
733 void MarbleWidget::resizeEvent( QResizeEvent *event )
734 {
735  setUpdatesEnabled( false );
736  d->m_map.setSize( event->size() );
737  setUpdatesEnabled( true );
738 
739  QWidget::resizeEvent( event );
740 }
741 
742 void MarbleWidget::connectNotify( const char * signal )
743 {
744  if ( QByteArray( signal ) ==
745  QMetaObject::normalizedSignature ( SIGNAL(mouseMoveGeoPosition(QString)) ) )
746  if ( d->m_inputhandler )
747  d->m_inputhandler->setPositionSignalConnected( true );
748 }
749 
750 void MarbleWidget::disconnectNotify( const char * signal )
751 {
752  if ( QByteArray( signal ) ==
753  QMetaObject::normalizedSignature ( SIGNAL(mouseMoveGeoPosition(QString)) ) )
754  if ( d->m_inputhandler )
755  d->m_inputhandler->setPositionSignalConnected( false );
756 }
757 
758 bool MarbleWidget::screenCoordinates( qreal lon, qreal lat,
759  qreal& x, qreal& y ) const
760 {
761  return d->m_map.screenCoordinates( lon, lat, x, y );
762 }
763 
764 bool MarbleWidget::geoCoordinates( int x, int y,
765  qreal& lon, qreal& lat,
766  GeoDataCoordinates::Unit unit ) const
767 {
768  return d->m_map.geoCoordinates( x, y, lon, lat, unit );
769 }
770 
771 qreal MarbleWidget::centerLatitude() const
772 {
773  return d->m_map.centerLatitude();
774 }
775 
776 qreal MarbleWidget::centerLongitude() const
777 {
778  return d->m_map.centerLongitude();
779 }
780 
781 QRegion MarbleWidget::mapRegion() const
782 {
783  return viewport()->mapRegion();
784 }
785 
786 void MarbleWidget::paintEvent( QPaintEvent *evt )
787 {
788  QTime t;
789  t.start();
790 
791  QPaintDevice *paintDevice = this;
792  QImage image;
793  if (!isEnabled())
794  {
795  // If the globe covers fully the screen then we can use the faster
796  // RGB32 as there are no translucent areas involved.
797  QImage::Format imageFormat = ( d->m_map.viewport()->mapCoversViewport() )
798  ? QImage::Format_RGB32
799  : QImage::Format_ARGB32_Premultiplied;
800  // Paint to an intermediate image
801  image = QImage( rect().size(), imageFormat );
802  image.fill( Qt::transparent );
803  paintDevice = &image;
804  }
805 
806  {
807  // FIXME: Better way to get the GeoPainter
808  // Create a painter that will do the painting.
809  GeoPainter geoPainter( paintDevice, d->m_map.viewport(), d->m_map.mapQuality() );
810 
811  d->m_map.paint( geoPainter, evt->rect() );
812  }
813 
814  if ( !isEnabled() )
815  {
816  // Draw a grayscale version of the intermediate image
817  QRgb* pixel = reinterpret_cast<QRgb*>( image.scanLine( 0 ));
818  for (int i=0; i<image.width()*image.height(); ++i, ++pixel) {
819  int gray = qGray( *pixel );
820  *pixel = qRgb( gray, gray, gray );
821  }
822 
823  QPainter widgetPainter( this );
824  widgetPainter.drawImage( rect(), image );
825  }
826 
827  if ( d->m_showFrameRate )
828  {
829  QPainter painter( this );
830  FpsLayer fpsPainter( &t );
831  fpsPainter.paint( &painter );
832 
833  const qreal fps = 1000.0 / (qreal)( t.elapsed() + 1 );
834  emit framesPerSecond( fps );
835  }
836 }
837 
838 void MarbleWidget::customPaint( GeoPainter *painter )
839 {
840  Q_UNUSED( painter );
841  /* This is a NOOP in the base class*/
842 }
843 
844 
845 void MarbleWidget::goHome( FlyToMode mode )
846 {
847  qreal homeLon = 0;
848  qreal homeLat = 0;
849  int homeZoom = 0;
850  d->m_model.home( homeLon, homeLat, homeZoom );
851 
852  GeoDataLookAt target;
853  target.setLongitude( homeLon, GeoDataCoordinates::Degree );
854  target.setLatitude( homeLat, GeoDataCoordinates::Degree );
855  target.setRange( 1000 * distanceFromZoom( homeZoom ) );
856 
857  flyTo( target, mode );
858 }
859 
860 QString MarbleWidget::mapThemeId() const
861 {
862  return d->m_model.mapThemeId();
863 }
864 
865 void MarbleWidget::setMapThemeId( const QString& mapThemeId )
866 {
867  d->m_map.setMapThemeId( mapThemeId );
868 }
869 
870 void MarbleWidgetPrivate::updateMapTheme()
871 {
872  m_map.removeLayer( m_routingLayer );
873 
874  m_widget->setRadius( m_widget->radius() ); // Corrects zoom range, if needed
875 
876  if ( m_model.planetId() == "earth" ) {
877  m_map.addLayer( m_routingLayer );
878  }
879 
880  emit m_widget->themeChanged( m_map.mapThemeId() );
881 
882  // Now we want a full repaint as the atmosphere might differ
883  m_widget->setAttribute( Qt::WA_NoSystemBackground, false );
884 
885  m_widget->update();
886 }
887 
888 GeoSceneDocument *MarbleWidget::mapTheme() const
889 {
890  return d->m_model.mapTheme();
891 }
892 
893 void MarbleWidget::setPropertyValue( const QString& name, bool value )
894 {
895  mDebug() << "In MarbleWidget the property " << name << "was set to " << value;
896  d->m_map.setPropertyValue( name, value );
897 
898  update();
899 }
900 
901 void MarbleWidget::setShowOverviewMap( bool visible )
902 {
903  d->m_map.setShowOverviewMap( visible );
904 
905  update();
906 }
907 
908 void MarbleWidget::setShowScaleBar( bool visible )
909 {
910  d->m_map.setShowScaleBar( visible );
911 
912  update();
913 }
914 
915 void MarbleWidget::setShowCompass( bool visible )
916 {
917  d->m_map.setShowCompass( visible );
918 
919  update();
920 }
921 
922 void MarbleWidget::setShowClouds( bool visible )
923 {
924  d->m_map.setShowClouds( visible );
925 
926  update();
927 }
928 
929 void MarbleWidget::setShowSunShading( bool visible )
930 {
931  d->m_map.setShowSunShading( visible );
932 
933  update();
934 }
935 
936 void MarbleWidget::setShowCityLights( bool visible )
937 {
938  d->m_map.setShowCityLights( visible );
939 
940  update();
941 }
942 
943 void MarbleWidget::setLockToSubSolarPoint( bool visible )
944 {
945  if ( d->m_map.isLockedToSubSolarPoint() != visible ) { // Toggling input modifies event filters, so avoid that if not needed
946  d->m_map.setLockToSubSolarPoint( visible );
947  setInputEnabled( !d->m_map.isLockedToSubSolarPoint() );
948  }
949 }
950 
951 void MarbleWidget::setSubSolarPointIconVisible( bool visible )
952 {
953  if ( d->m_map.isSubSolarPointIconVisible() != visible ) {
954  d->m_map.setSubSolarPointIconVisible( visible );
955  }
956 
957  QList<RenderPlugin *> pluginList = renderPlugins();
958  QList<RenderPlugin *>::const_iterator i = pluginList.constBegin();
959  QList<RenderPlugin *>::const_iterator const end = pluginList.constEnd();
960  for (; i != end; ++i ) {
961  if ( (*i)->nameId() == "sun" ) {
962  (*i)->setVisible( visible );
963  }
964  }
965 }
966 
967 void MarbleWidget::setShowAtmosphere( bool visible )
968 {
969  d->m_map.setShowAtmosphere( visible );
970 
971  update();
972 }
973 
974 void MarbleWidget::setShowCrosshairs( bool visible )
975 {
976  d->m_map.setShowCrosshairs( visible );
977 
978  update();
979 }
980 
981 void MarbleWidget::setShowGrid( bool visible )
982 {
983  d->m_map.setShowGrid( visible );
984 
985  update();
986 }
987 
988 void MarbleWidget::setShowPlaces( bool visible )
989 {
990  d->m_map.setShowPlaces( visible );
991 
992  update();
993 }
994 
995 void MarbleWidget::setShowCities( bool visible )
996 {
997  d->m_map.setShowCities( visible );
998 
999  update();
1000 }
1001 
1002 void MarbleWidget::setShowTerrain( bool visible )
1003 {
1004  d->m_map.setShowTerrain( visible );
1005 
1006  update();
1007 }
1008 
1009 void MarbleWidget::setShowOtherPlaces( bool visible )
1010 {
1011  d->m_map.setShowOtherPlaces( visible );
1012 
1013  update();
1014 }
1015 
1016 void MarbleWidget::setShowRelief( bool visible )
1017 {
1018  d->m_map.setShowRelief( visible );
1019 
1020  update();
1021 }
1022 
1023 void MarbleWidget::setShowIceLayer( bool visible )
1024 {
1025  d->m_map.setShowIceLayer( visible );
1026 
1027  update();
1028 }
1029 
1030 void MarbleWidget::setShowBorders( bool visible )
1031 {
1032  d->m_map.setShowBorders( visible );
1033 
1034  update();
1035 }
1036 
1037 void MarbleWidget::setShowRivers( bool visible )
1038 {
1039  d->m_map.setShowRivers( visible );
1040 
1041  update();
1042 }
1043 
1044 void MarbleWidget::setShowLakes( bool visible )
1045 {
1046  d->m_map.setShowLakes( visible );
1047 
1048  update();
1049 }
1050 
1051 void MarbleWidget::setShowFrameRate( bool visible )
1052 {
1053  d->m_showFrameRate = visible;
1054 
1055  update();
1056 }
1057 
1058 void MarbleWidget::setShowBackground( bool visible )
1059 {
1060  d->m_map.setShowBackground( visible );
1061 
1062  update();
1063 }
1064 
1065 void MarbleWidget::setShowRuntimeTrace( bool visible )
1066 {
1067  d->m_map.setShowRuntimeTrace( visible );
1068 }
1069 
1070 void MarbleWidget::setShowTileId( bool visible )
1071 {
1072  d->m_map.setShowTileId( visible );
1073 }
1074 
1075 void MarbleWidget::notifyMouseClick( int x, int y)
1076 {
1077  qreal lon = 0;
1078  qreal lat = 0;
1079 
1080  bool const valid = geoCoordinates( x, y, lon, lat, GeoDataCoordinates::Radian );
1081 
1082  if ( valid ) {
1083  emit mouseClickGeoPosition( lon, lat, GeoDataCoordinates::Radian );
1084  }
1085 }
1086 
1087 void MarbleWidget::clearVolatileTileCache()
1088 {
1089  mDebug() << "About to clear VolatileTileCache";
1090  d->m_map.clearVolatileTileCache();
1091 }
1092 
1093 void MarbleWidget::setVolatileTileCacheLimit( quint64 kiloBytes )
1094 {
1095  d->m_map.setVolatileTileCacheLimit( kiloBytes );
1096 }
1097 
1098 // This slot will called when the Globe starts to create the tiles.
1099 
1100 void MarbleWidget::creatingTilesStart( TileCreator *creator,
1101  const QString &name,
1102  const QString &description )
1103 {
1104  TileCreatorDialog dlg( creator, this );
1105  dlg.setSummary( name, description );
1106  dlg.exec();
1107 }
1108 
1109 MapQuality MarbleWidget::mapQuality( ViewContext viewContext ) const
1110 {
1111  return d->m_map.mapQuality( viewContext );
1112 }
1113 
1114 void MarbleWidget::setMapQualityForViewContext( MapQuality quality, ViewContext viewContext )
1115 {
1116  const MapQuality oldQuality = d->m_map.mapQuality();
1117 
1118  d->m_map.setMapQualityForViewContext( quality, viewContext );
1119 
1120  if ( d->m_map.mapQuality() != oldQuality )
1121  update();
1122 }
1123 
1124 ViewContext MarbleWidget::viewContext() const
1125 {
1126  return d->m_map.viewContext();
1127 }
1128 
1129 void MarbleWidget::setViewContext( ViewContext viewContext )
1130 {
1131  if ( d->m_map.viewContext() != viewContext ) {
1132  const MapQuality oldQuality = d->m_map.mapQuality();
1133  d->m_map.setViewContext( viewContext );
1134  d->m_routingLayer->setViewContext( viewContext );
1135 
1136  if ( d->m_map.mapQuality() != oldQuality )
1137  update();
1138  }
1139 }
1140 
1141 bool MarbleWidget::animationsEnabled() const
1142 {
1143  return d->m_animationsEnabled;
1144 }
1145 
1146 void MarbleWidget::setAnimationsEnabled( bool enabled )
1147 {
1148  d->m_animationsEnabled = enabled;
1149 }
1150 
1151 AngleUnit MarbleWidget::defaultAngleUnit() const
1152 {
1153  return d->m_map.defaultAngleUnit();
1154 }
1155 
1156 void MarbleWidget::setDefaultAngleUnit( AngleUnit angleUnit )
1157 {
1158  d->m_map.setDefaultAngleUnit( angleUnit );
1159 }
1160 
1161 QFont MarbleWidget::defaultFont() const
1162 {
1163  return d->m_map.defaultFont();
1164 }
1165 
1166 void MarbleWidget::setDefaultFont( const QFont& font )
1167 {
1168  d->m_map.setDefaultFont( font );
1169 }
1170 
1171 void MarbleWidget::setSelection( const QRect& region )
1172 {
1173  QPoint tl = region.topLeft();
1174  QPoint br = region.bottomRight();
1175  mDebug() << "Selection region: (" << tl.x() << ", " << tl.y() << ") ("
1176  << br.x() << ", " << br.y() << ")" << endl;
1177 
1178  GeoDataLatLonAltBox box = viewport()->latLonAltBox( region );
1179 
1180  // NOTE: coordinates as lon1, lat1, lon2, lat2 (or West, North, East, South)
1181  // as left/top, right/bottom rectangle.
1182  QList<double> coordinates;
1183  coordinates << box.west( GeoDataCoordinates::Degree ) << box.north( GeoDataCoordinates::Degree )
1184  << box.east( GeoDataCoordinates::Degree ) << box.south( GeoDataCoordinates::Degree );
1185 
1186  mDebug() << "West: " << coordinates[0] << " North: " << coordinates[1]
1187  << " East: " << coordinates[2] << " South: " << coordinates[3] << endl;
1188 
1189  emit regionSelected( coordinates );
1190 }
1191 
1192 qreal MarbleWidget::distance() const
1193 {
1194  return distanceFromRadius(radius());
1195 }
1196 
1197 void MarbleWidget::setDistance( qreal newDistance )
1198 {
1199  qreal minDistance = 0.001;
1200 
1201  if ( newDistance <= minDistance ) {
1202  mDebug() << "Invalid distance: 0 m";
1203  newDistance = minDistance;
1204  }
1205 
1206  int newRadius = radiusFromDistance( newDistance );
1207  setRadius( newRadius );
1208 }
1209 
1210 QString MarbleWidget::distanceString() const
1211 {
1212  qreal dist = distance();
1213  QString distanceUnitString;
1214 
1215  const QLocale::MeasurementSystem measurementSystem = MarbleGlobal::getInstance()->locale()->measurementSystem();
1216 
1217  switch ( measurementSystem ) {
1218  case QLocale::MetricSystem:
1219  distanceUnitString = tr("km");
1220  break;
1221  case QLocale::ImperialSystem:
1222  dist *= KM2MI;
1223  distanceUnitString = tr("mi");
1224  break;
1225  }
1226 
1227  return QString( "%L1 %2" ).arg( dist, 8, 'f', 1, QChar(' ') ).arg( distanceUnitString );
1228 }
1229 
1230 void MarbleWidget::setInputEnabled( bool enabled )
1231 {
1232  //if input is set as enabled
1233  if ( enabled )
1234  {
1235  if ( !d->m_inputhandler ) {
1236  setInputHandler( new MarbleWidgetDefaultInputHandler( this ) );
1237  }
1238  else {
1239  installEventFilter( d->m_inputhandler );
1240  }
1241  }
1242 
1243  else // input is disabled
1244  {
1245  mDebug() << "MarbleWidget::disableInput";
1246  removeEventFilter( d->m_inputhandler );
1247  setCursor( Qt::ArrowCursor );
1248  }
1249 }
1250 
1251 QList<RenderPlugin *> MarbleWidget::renderPlugins() const
1252 {
1253  return d->m_map.renderPlugins();
1254 }
1255 
1256 void MarbleWidget::readPluginSettings( QSettings& settings )
1257 {
1258  foreach( RenderPlugin *plugin, renderPlugins() ) {
1259  settings.beginGroup( QString( "plugin_" ) + plugin->nameId() );
1260 
1261  QHash<QString,QVariant> hash;
1262 
1263  foreach ( const QString& key, settings.childKeys() ) {
1264  hash.insert( key, settings.value( key ) );
1265  }
1266 
1267  plugin->setSettings( hash );
1268 
1269  settings.endGroup();
1270  }
1271 }
1272 
1273 void MarbleWidget::writePluginSettings( QSettings& settings ) const
1274 {
1275  foreach( RenderPlugin *plugin, renderPlugins() ) {
1276  settings.beginGroup( QString( "plugin_" ) + plugin->nameId() );
1277 
1278  QHash<QString,QVariant> hash = plugin->settings();
1279 
1280  QHash<QString,QVariant>::iterator it = hash.begin();
1281  while( it != hash.end() ) {
1282  settings.setValue( it.key(), it.value() );
1283  ++it;
1284  }
1285 
1286  settings.endGroup();
1287  }
1288 }
1289 
1290 QList<AbstractFloatItem *> MarbleWidget::floatItems() const
1291 {
1292  return d->m_map.floatItems();
1293 }
1294 
1295 AbstractFloatItem * MarbleWidget::floatItem( const QString &nameId ) const
1296 {
1297  return d->m_map.floatItem( nameId );
1298 }
1299 
1300 void MarbleWidget::changeEvent( QEvent * event )
1301 {
1302  if ( event->type() == QEvent::EnabledChange )
1303  {
1304  setInputEnabled(isEnabled());
1305  }
1306 
1307  QWidget::changeEvent(event);
1308 }
1309 
1310 void MarbleWidget::flyTo( const GeoDataLookAt &newLookAt, FlyToMode mode )
1311 {
1312  if ( !d->m_animationsEnabled || mode == Instant ) {
1313  const int radius = qRound( radiusFromDistance( newLookAt.range() * METER2KM ) );
1314  qreal const zoom = d->zoom( radius );
1315  // Prevent exceeding zoom range. Note: Bounding to range is not useful here
1316  if ( qRound( zoom ) >= minimumZoom() && qRound( zoom ) <= maximumZoom() ) {
1317  d->m_map.setRadius( radius );
1318  d->m_logzoom = qRound( d->zoom( radius ) );
1319 
1320  GeoDataCoordinates::Unit deg = GeoDataCoordinates::Degree;
1321  d->m_map.centerOn( newLookAt.longitude( deg ), newLookAt.latitude( deg ) );
1322 
1323  emit zoomChanged( d->m_logzoom );
1324  emit distanceChanged( distanceString() );
1325 
1326  update();
1327  }
1328  }
1329  else {
1330  d->m_physics.flyTo( newLookAt, mode );
1331  }
1332 }
1333 
1334 void MarbleWidget::reloadMap()
1335 {
1336  d->m_map.reload();
1337 }
1338 
1339 void MarbleWidget::downloadRegion( QVector<TileCoordsPyramid> const & pyramid )
1340 {
1341  d->m_map.downloadRegion( pyramid );
1342 }
1343 
1344 GeoDataLookAt MarbleWidget::lookAt() const
1345 {
1346  GeoDataLookAt result;
1347 
1348  result.setLongitude( d->m_map.viewport()->centerLongitude() );
1349  result.setLatitude( d->m_map.viewport()->centerLatitude() );
1350  result.setAltitude( 0.0 );
1351  result.setRange( distance() * KM2METER );
1352 
1353  return result;
1354 }
1355 
1356 GeoDataCoordinates MarbleWidget::focusPoint() const
1357 {
1358  return d->m_map.viewport()->focusPoint();
1359 }
1360 
1361 void MarbleWidget::setFocusPoint( const GeoDataCoordinates &focusPoint )
1362 {
1363  d->m_map.viewport()->setFocusPoint( focusPoint );
1364 }
1365 
1366 void MarbleWidget::resetFocusPoint()
1367 {
1368  d->m_map.viewport()->resetFocusPoint();
1369 }
1370 
1371 qreal MarbleWidget::radiusFromDistance( qreal distance ) const
1372 {
1373  return model()->planet()->radius() /
1374  ( distance * tan( 0.5 * d->m_viewAngle * DEG2RAD ) / 0.4 );
1375 }
1376 
1377 qreal MarbleWidget::distanceFromRadius( qreal radius ) const
1378 {
1379  // Due to Marble's orthographic projection ("we have no focus")
1380  // it's actually not possible to calculate a "real" distance.
1381  // Additionally the viewing angle of the earth doesn't adjust to
1382  // the window's size.
1383  //
1384  // So the only possible workaround is to come up with a distance
1385  // definition which gives a reasonable approximation of
1386  // reality. Therefore we assume that the average window width
1387  // (about 800 pixels) equals the viewing angle of a human being.
1388 
1389  return ( model()->planet()->radius() * 0.4
1390  / radius / tan( 0.5 * d->m_viewAngle * DEG2RAD ) );
1391 }
1392 
1393 qreal MarbleWidget::zoomFromDistance( qreal distance ) const
1394 {
1395  return d->zoom( radiusFromDistance( distance ) );
1396 }
1397 
1398 qreal MarbleWidget::distanceFromZoom( qreal zoom ) const
1399 {
1400  return distanceFromRadius( d->radius( zoom ) );
1401 }
1402 
1403 RoutingLayer* MarbleWidget::routingLayer()
1404 {
1405  return d->m_routingLayer;
1406 }
1407 
1408 PopupLayer *MarbleWidget::popupLayer()
1409 {
1410  return d->m_mapInfoDialog;
1411 }
1412 
1413 }
1414 
1415 #include "MarbleWidget.moc"
Marble::GeoDataCoordinates::Unit
Unit
enum used constructor to specify the units used
Definition: GeoDataCoordinates.h:64
Marble::MarbleWidget::tileZoomLevel
int tileZoomLevel() const
Definition: MarbleWidget.cpp:372
QPainter
FpsLayer.h
Marble::MarbleWidget::showSunShading
bool showSunShading() const
Return whether the night shadow is visible.
Marble::GeoDataLatLonBox::height
qreal height(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the height of the latitude interval.
Definition: GeoDataLatLonBox.cpp:255
Marble::GeoDataPlacemark::lookAt
const GeoDataLookAt * lookAt() const
Returns GeoDataLookAt object if lookAt is setup earlier otherwise It will convert GeoDataCoordinates ...
Definition: GeoDataPlacemark.cpp:68
Marble::ViewportParams::latLonAltBox
GeoDataLatLonAltBox latLonAltBox(const QRect &screenRect) const
Definition: ViewportParams.cpp:317
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
Marble::MarbleWidget::showLakes
bool showLakes() const
Return whether the lakes are visible.
Marble::MarbleWidget::~MarbleWidget
virtual ~MarbleWidget()
Definition: MarbleWidget.cpp:171
Marble::MarbleWidget::framesPerSecond
void framesPerSecond(qreal fps)
Marble::Automatic
A sane value is chosen automatically depending on animation settings and the action.
Definition: MarbleGlobal.h:170
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:718
Marble::GeoDataLatLonBox::isEmpty
virtual bool isEmpty() const
Indicates whether the bounding box is not initialised (and contains nothing).
Definition: GeoDataLatLonBox.cpp:768
Marble::GeoDataLatLonBox::width
qreal width(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the width of the longitude interval.
Definition: GeoDataLatLonBox.cpp:236
Marble::MarbleWidget::reloadMap
void reloadMap()
Re-download all visible tiles.
Definition: MarbleWidget.cpp:1334
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.
Marble::MarbleWidget::setFocusPoint
void setFocusPoint(const GeoDataCoordinates &focusPoint)
Change the point of focus, overridding any previously set focus point.
Definition: MarbleWidget.cpp:1361
Marble::MarbleLocale::measurementSystem
QLocale::MeasurementSystem measurementSystem() const
Definition: MarbleLocale.cpp:45
Marble::MarbleWidget::distanceString
QString distanceString() const
Return the current distance string.
Definition: MarbleWidget.cpp:1210
Marble::MarbleWidget::CustomPaintLayer
friend class CustomPaintLayer
Definition: MarbleWidget.h:1078
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:936
Marble::MarbleWidget::zoomViewBy
void zoomViewBy(int zoomStep, FlyToMode mode=Instant)
Zoom the view by a certain step.
Definition: MarbleWidget.cpp:569
Marble::GeoDataLookAt::longitude
qreal longitude(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
retrieves the longitude of the GeoDataLookAt object use the unit parameter to switch between Radian a...
Definition: GeoDataLookAt.cpp:91
Marble::MarbleWidgetInputHandler
Definition: MarbleWidgetInputHandler.h:37
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:758
Marble::MarbleWidget::connectNotify
void connectNotify(const char *signal)
Definition: MarbleWidget.cpp:742
Marble::MarbleWidget::leaveEvent
virtual void leaveEvent(QEvent *event)
Reimplementation of the leaveEvent() function in QWidget.
Definition: MarbleWidget.cpp:728
Marble::MarbleWidget::setPropertyValue
void setPropertyValue(const QString &name, bool value)
Sets the value of a map theme property.
Definition: MarbleWidget.cpp:893
Marble::GeoPainter
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:98
MarbleModel.h
This file contains the headers for MarbleModel.
Marble::KM2METER
const qreal KM2METER
Definition: MarbleGlobal.h:204
Marble::MarbleWidget::radius
int radius() const
Return the radius of the globe in pixels.
Definition: MarbleWidget.cpp:326
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:1100
Marble::MarbleWidget::setShowRuntimeTrace
void setShowRuntimeTrace(bool visible)
Set whether the runtime tracing for layers gets shown.
Definition: MarbleWidget.cpp:1065
Marble::ViewContext
ViewContext
This enum is used to choose context in which map quality gets used.
Definition: MarbleGlobal.h:72
Marble::MarbleWidget::whichFeatureAt
QVector< const GeoDataPlacemark * > whichFeatureAt(const QPoint &) const
Definition: MarbleWidget.cpp:387
QWidget
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:1146
Marble::PopupLayer
The PopupLayer class.
Definition: PopupLayer.h:39
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:723
Marble::MarbleWidget::distanceChanged
void distanceChanged(const QString &distanceString)
Marble::MarbleWidget::setProjection
void setProjection(int projection)
Set the Projection used for the map.
Definition: MarbleWidget.cpp:702
Marble::MarbleWidget::setDefaultAngleUnit
void setDefaultAngleUnit(AngleUnit angleUnit)
Definition: MarbleWidget.cpp:1156
Marble::MarbleWidget::zoomFromDistance
qreal zoomFromDistance(qreal distance) const
Returns the zoom value (no unit) corresponding to the given camera distance (km)
Definition: MarbleWidget.cpp:1393
Marble::MarbleWidget::distanceFromZoom
qreal distanceFromZoom(qreal zoom) const
Returns the distance (km) corresponding to the given zoom value.
Definition: MarbleWidget.cpp:1398
Marble::GeoDataPlacemark::coordinate
GeoDataCoordinates coordinate(const QDateTime &dateTime=QDateTime(), bool *iconAtCoordinates=0) const
Return the coordinates of the placemark at time dateTime as a GeoDataCoordinates. ...
Definition: GeoDataPlacemark.cpp:78
Marble::LayerInterface
Definition: LayerInterface.h:25
Marble::MarbleWidget::showGrid
bool showGrid() const
Return whether the coordinate grid is visible.
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:80
SunLocator.h
Marble::MarbleWidget::setVolatileTileCacheLimit
void setVolatileTileCacheLimit(quint64 kiloBytes)
Set the limit of the volatile (in RAM) tile cache.
Definition: MarbleWidget.cpp:1093
Marble::MarbleWidget::setZoom
void setZoom(int zoom, FlyToMode mode=Instant)
Zoom the view to a certain zoomlevel.
Definition: MarbleWidget.cpp:533
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:412
Marble::MarbleWidget::setInputEnabled
void setInputEnabled(bool)
Definition: MarbleWidget.cpp:1230
Marble::MarbleWidget::moveLeft
void moveLeft(FlyToMode mode=Automatic)
Move left by the moveStep.
Definition: MarbleWidget.cpp:707
Marble::MarbleModel::planet
const Planet * planet() const
Returns the planet object for the current map.
Definition: MarbleModel.cpp:574
Marble::MarbleWidget::regionSelected
void regionSelected(const QList< double > &)
This signal is emit when a new rectangle region is selected over the map The list of double values in...
Marble::MarbleWidget::floatItem
AbstractFloatItem * floatItem(const QString &nameId) const
Returns the FloatItem with the given id.
Definition: MarbleWidget.cpp:1295
Marble::GeoDataPlacemark::geometry
GeoDataGeometry * geometry() const
The geometry of the GeoDataPlacemark is to be rendered to the marble map along with the icon at the c...
Definition: GeoDataPlacemark.cpp:63
Marble::GeoDataLookAt::setLongitude
void setLongitude(qreal longitude, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
set the longitude in a GeoDataLookAt object
Definition: GeoDataLookAt.cpp:85
MarbleDebug.h
Marble::GeoDataLookAt::range
qreal range() const
Retrieve the distance (in meters) between the camera and the object looked at.
Definition: GeoDataLookAt.cpp:107
Marble::GeoDataCoordinates::Degree
Definition: GeoDataCoordinates.h:66
Marble::MarbleWidget::readPluginSettings
void readPluginSettings(QSettings &settings)
Reads the plugin settings from the passed QSettings.
Definition: MarbleWidget.cpp:1256
Marble::MarbleWidgetDefaultInputHandler
Definition: MarbleWidgetInputHandler.h:96
Marble::ViewportParams::height
int height() const
Definition: ViewportParams.cpp:255
Marble::FpsLayer::paint
void paint(QPainter *painter)
Definition: FpsLayer.cpp:28
Marble::MarbleWidget::setInputHandler
void setInputHandler(MarbleWidgetInputHandler *handler)
Set the input handler.
Definition: MarbleWidget.cpp:305
Marble::MarbleWidget::popupLayer
PopupLayer * popupLayer()
Definition: MarbleWidget.cpp:1408
Marble::MarbleWidget::whichItemAt
QList< AbstractDataPluginItem * > whichItemAt(const QPoint &curpos) const
Returns all widgets of dataPlugins on the position curpos.
Definition: MarbleWidget.cpp:392
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:951
Marble::MarbleWidget::mapRegion
QRegion mapRegion() const
Return the projected region which describes the (shape of the) projected surface. ...
Definition: MarbleWidget.cpp:781
Marble::MarbleWidget::lookAt
GeoDataLookAt lookAt() const
Return the lookAt.
Definition: MarbleWidget.cpp:1344
Marble::GeoDataCoordinates::altitude
qreal altitude() const
return the altitude of the Point in meters
Definition: GeoDataCoordinates.cpp:1197
MarbleWidgetInputHandler.h
Marble::MarbleWidget::flyTo
void flyTo(const GeoDataLookAt &lookAt, FlyToMode mode=Automatic)
Change the camera position to the given position.
Definition: MarbleWidget.cpp:1310
Marble::MarbleWidget::setMapThemeId
void setMapThemeId(const QString &maptheme)
Set a new map theme.
Definition: MarbleWidget.cpp:865
Marble::TileCreatorDialog::setSummary
void setSummary(const QString &name, const QString &description)
Definition: TileCreatorDialog.cpp:84
Marble::MarbleWidget::disconnectNotify
void disconnectNotify(const char *signal)
Definition: MarbleWidget.cpp:750
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:1300
Marble::GeoDataLatLonBox::north
qreal north(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the northern boundary of the bounding box.
Definition: GeoDataLatLonBox.cpp:93
Marble::GeoDataLatLonBox::east
qreal east(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the eastern boundary of the bounding box.
Definition: GeoDataLatLonBox.cpp:135
MarbleMap.h
This file contains the headers for MarbleMap.
Marble::MarbleWidget::downloadRegion
void downloadRegion(QVector< TileCoordsPyramid > const &)
Definition: MarbleWidget.cpp:1339
Marble::MarbleWidget::mapQuality
MapQuality mapQuality(ViewContext=Still) const
Retrieve the map quality depending on the view context.
Definition: MarbleWidget.cpp:1109
Marble::MarbleWidget::centerLongitude
qreal centerLongitude() const
Return the longitude of the center point.
Definition: MarbleWidget.cpp:776
Marble::ViewportParams::width
int width() const
Definition: ViewportParams.cpp:250
Marble::MarbleWidget::paintEvent
virtual void paintEvent(QPaintEvent *event)
Reimplementation of the paintEvent() function in QWidget.
Definition: MarbleWidget.cpp:786
Marble::MarbleWidget::setShowBorders
void setShowBorders(bool visible)
Set whether the borders visible.
Definition: MarbleWidget.cpp:1030
Marble::GeoDataLookAt::setRange
void setRange(qreal range)
Change the distance (in meters) between the camera and the object looked at.
Definition: GeoDataLookAt.cpp:101
Marble::MarbleWidget::setShowPlaces
void setShowPlaces(bool visible)
Set whether the place mark overlay is visible.
Definition: MarbleWidget.cpp:988
Marble::MarbleWidget::setShowIceLayer
void setShowIceLayer(bool visible)
Set whether the ice layer is visible.
Definition: MarbleWidget.cpp:1023
Marble::DataMigration
Definition: DataMigration.h:19
Marble::MarbleWidget::setShowOverviewMap
void setShowOverviewMap(bool visible)
Set whether the overview map overlay is visible.
Definition: MarbleWidget.cpp:901
Marble::AbstractFloatItem
The abstract class for float item plugins.
Definition: AbstractFloatItem.h:48
Marble::MarbleWidget::setShowRelief
void setShowRelief(bool visible)
Set whether the relief is visible.
Definition: MarbleWidget.cpp:1016
Marble::MarbleWidget::maximumZoom
int maximumZoom() const
Return the minimum zoom value for the current map theme.
Definition: MarbleWidget.cpp:382
RoutingLayer.h
Marble::TileCreator
Definition: TileCreator.h:53
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:943
MarbleDirs.h
MarbleWidgetPopupMenu.h
Marble::MarbleWidget::showAtmosphere
bool showAtmosphere() const
Return whether the atmospheric glow is visible.
Marble::TextureLayer
Definition: TextureLayer.h:39
Marble::MarbleWidget::zoomOut
void zoomOut(FlyToMode mode=Automatic)
Zoom out by the amount zoomStep.
Definition: MarbleWidget.cpp:590
Marble::MarbleWidget::zoomChanged
void zoomChanged(int zoom)
Signal that the zoom has changed, and to what.
Marble::MarbleWidget::model
MarbleModel * model() const
Return the model that this view shows.
Definition: MarbleWidget.cpp:283
Marble::MarbleWidget::setCenterLatitude
void setCenterLatitude(qreal lat, FlyToMode mode=Instant)
Set the latitude for the center point.
Definition: MarbleWidget.cpp:680
Marble::NOT_AVAILABLE
static const char NOT_AVAILABLE[]
Definition: MarbleGlobal.h:232
Marble::MarbleWidget::radiusFromDistance
qreal radiusFromDistance(qreal distance) const
Return the globe radius (pixel) for the given distance (km)
Definition: MarbleWidget.cpp:1371
Marble::GeoDataLookAt::latitude
qreal latitude(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
retrieves the latitude of the GeoDataLookAt object use the unit parameter to switch between Radian an...
Definition: GeoDataLookAt.cpp:80
Marble::MarbleWidget::zoomView
void zoomView(int zoom, FlyToMode mode=Instant)
Definition: MarbleWidget.cpp:563
Marble::MarbleGlobal::locale
MarbleLocale * locale() const
Definition: MarbleGlobal.cpp:43
Marble::MarbleWidget::setShowBackground
void setShowBackground(bool visible)
Definition: MarbleWidget.cpp:1058
MarbleLocale.h
GeoPainter.h
GeoDataPlacemark.h
Marble::DEG2RAD
const qreal DEG2RAD
Definition: MarbleGlobal.h:200
Marble::MarbleWidget::goHome
void goHome(FlyToMode mode=Automatic)
Center the view on the default start point with the default zoom.
Definition: MarbleWidget.cpp:845
Marble::MarbleWidget::animationsEnabled
bool animationsEnabled() const
Retrieve whether travels to a point should get animated.
Definition: MarbleWidget.cpp:1141
Marble::MarbleWidget::addLayer
void addLayer(LayerInterface *layer)
Add a layer to be included in rendering.
Definition: MarbleWidget.cpp:397
Marble::MarbleWidget::minimumZoom
int minimumZoom() const
Return the minimum zoom value for the current map theme.
Definition: MarbleWidget.cpp:377
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:1124
Marble::METER2KM
const qreal METER2KM
Definition: MarbleGlobal.h:205
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:289
Marble::GeoDataLatLonBox::center
virtual GeoDataCoordinates center() const
returns the center of this box
Definition: GeoDataLatLonBox.cpp:276
Marble::MarbleWidget::setShowLakes
void setShowLakes(bool visible)
Set whether the lakes are visible.
Definition: MarbleWidget.cpp:1044
Marble::MarbleWidget::setCenterLongitude
void setCenterLongitude(qreal lon, FlyToMode mode=Instant)
Set the longitude for the center point.
Definition: MarbleWidget.cpp:685
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:838
Marble::MarbleWidget::zoomIn
void zoomIn(FlyToMode mode=Automatic)
Zoom in by the amount zoomStep.
Definition: MarbleWidget.cpp:575
Marble::KM2MI
const qreal KM2MI
Definition: MarbleGlobal.h:189
DataMigration.h
Marble::MarbleWidget::isLockedToSubSolarPoint
bool isLockedToSubSolarPoint() const
Return whether the globe is locked to the sub solar point.
Marble::MarbleWidget::centerOn
void centerOn(const qreal lon, const qreal lat, bool animated=false)
Center the view on a geographical point.
Definition: MarbleWidget.cpp:626
Marble::MarbleWidget::setShowSunShading
void setShowSunShading(bool visible)
Set whether the night shadow is visible.
Definition: MarbleWidget.cpp:929
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:331
Marble::MarbleWidget::setViewContext
void setViewContext(ViewContext viewContext)
Set the view context (i.e.
Definition: MarbleWidget.cpp:1129
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:915
Marble::MarbleGlobal::getInstance
static MarbleGlobal * getInstance()
Definition: MarbleGlobal.cpp:37
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:605
Marble::FlyToMode
FlyToMode
Describes possible flight mode (interpolation between source and target camera positions) ...
Definition: MarbleGlobal.h:169
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:1114
Marble::MarbleWidget::resetFocusPoint
void resetFocusPoint()
Invalidate any focus point set with setFocusPoint.
Definition: MarbleWidget.cpp:1366
Marble::GeoDataLatLonBox::west
qreal west(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the western boundary of the bounding box.
Definition: GeoDataLatLonBox.cpp:156
Marble::MarbleModel
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:96
Marble::MarbleWidget::showCities
bool showCities() const
Return whether the city place marks are visible.
PopupLayer.h
Marble::Planet::radius
qreal radius() const
the radius of the planet, in metres
Definition: Planet.cpp:251
Marble::MarbleWidget::showCityLights
bool showCityLights() const
Return whether the city lights are shown instead of the night shadow.
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:63
Marble::MarbleWidget::setShowRivers
void setShowRivers(bool visible)
Set whether the rivers are visible.
Definition: MarbleWidget.cpp:1037
Marble::MarbleWidget::showFrameRate
bool showFrameRate() const
Return whether the frame rate gets displayed.
Definition: MarbleWidget.cpp:517
Marble::MarbleWidget::setShowTerrain
void setShowTerrain(bool visible)
Set whether the terrain place mark overlay is visible.
Definition: MarbleWidget.cpp:1002
Marble::MarbleWidget::routingLayer
RoutingLayer * routingLayer()
Definition: MarbleWidget.cpp:1403
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:1356
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:764
Marble::Quaternion
Definition: Quaternion.h:43
Marble::MarbleWidget::setSelection
void setSelection(const QRect &region)
Definition: MarbleWidget.cpp:1171
Marble::GeoDataLatLonBox::south
qreal south(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the southern boundary of the bounding box.
Definition: GeoDataLatLonBox.cpp:114
Marble::MarbleWidget::setShowAtmosphere
void setShowAtmosphere(bool visible)
Set whether the atmospheric glow is visible.
Definition: MarbleWidget.cpp:967
Marble::MarbleWidget::removeLayer
void removeLayer(LayerInterface *layer)
Remove a layer from being included in rendering.
Definition: MarbleWidget.cpp:402
Marble::MarbleWidget::mapTheme
GeoSceneDocument * mapTheme() const
Get the GeoSceneDocument object of the current map theme.
Definition: MarbleWidget.cpp:888
Marble::Projection
Projection
This enum is used to choose the projection shown in the view.
Definition: MarbleGlobal.h:44
M_PI
#define M_PI
Definition: GeoDataCoordinates.h:26
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:1070
Marble::MarbleWidget::distanceFromRadius
qreal distanceFromRadius(qreal radius) const
Return the distance (km) at the given globe radius (pixel)
Definition: MarbleWidget.cpp:1377
MarbleWidget.h
This file contains the headers for MarbleWidget.
Marble::MarbleWidget::popupMenu
MarbleWidgetPopupMenu * popupMenu()
Definition: MarbleWidget.cpp:299
Marble::MarbleWidget::setDistance
void setDistance(qreal distance)
Set the distance of the observer to the globe in km.
Definition: MarbleWidget.cpp:1197
Marble::FpsLayer
Definition: FpsLayer.h:20
Marble::MarbleWidget::setShowClouds
void setShowClouds(bool visible)
Set whether the cloud cover is visible.
Definition: MarbleWidget.cpp:922
Marble::Instant
Change camera position immediately (no interpolation)
Definition: MarbleGlobal.h:171
Marble::MarbleWidget::setDefaultFont
void setDefaultFont(const QFont &font)
Definition: MarbleWidget.cpp:1166
Marble::MarbleWidget::moveStep
qreal moveStep() const
Return how much the map will move if one of the move slots are called.
Definition: MarbleWidget.cpp:358
Marble::MarbleWidget::defaultFont
QFont defaultFont() const
Definition: MarbleWidget.cpp:1161
Marble::GeoDataGeometry::latLonAltBox
virtual const GeoDataLatLonAltBox & latLonAltBox() const
Definition: GeoDataGeometry.cpp:122
Marble::MarbleWidget::setShowCities
void setShowCities(bool visible)
Set whether the city place mark overlay is visible.
Definition: MarbleWidget.cpp:995
Marble::MarbleWidget::showBackground
bool showBackground() const
Definition: MarbleWidget.cpp:522
MarbleWidget
Wraps a Marble::MarbleWidget, providing access to important properties and methods.
Definition: MarbleDeclarativeWidget.h:50
Marble::MarbleWidget::writePluginSettings
void writePluginSettings(QSettings &settings) const
Writes the plugin settings in the passed QSettings.
Definition: MarbleWidget.cpp:1273
Marble::MarbleWidget::MarbleWidget
MarbleWidget(QWidget *parent=0)
Construct a new MarbleWidget.
Definition: MarbleWidget.cpp:163
Marble::Quaternion::getSpherical
void getSpherical(qreal &lon, qreal &lat) const
Definition: Quaternion.cpp:48
Marble::MarbleWidget::clearVolatileTileCache
void clearVolatileTileCache()
Definition: MarbleWidget.cpp:1087
Marble::GeoDataLookAt::setAltitude
void setAltitude(qreal altitude)
set the altitude in a GeoDataLookAt object
Definition: GeoDataLookAt.cpp:63
Marble::MarbleWidget::showIceLayer
bool showIceLayer() const
Return whether the ice layer is visible.
MarblePhysics.h
Marble::MarbleWidget::inputHandler
MarbleWidgetInputHandler * inputHandler() const
Returns the current input handler.
Definition: MarbleWidget.cpp:321
Marble::RenderPlugin::settings
virtual QHash< QString, QVariant > settings() const
Settings of the plugin.
Definition: RenderPlugin.cpp:183
Marble::MarbleWidget::setShowGrid
void setShowGrid(bool visible)
Set whether the coordinate grid overlay is visible.
Definition: MarbleWidget.cpp:981
Marble::MarbleWidget::showPlaces
bool showPlaces() const
Return whether the place marks are visible.
Marble::MarbleWidget::defaultAngleUnit
AngleUnit defaultAngleUnit() const
Definition: MarbleWidget.cpp:1151
Marble::MarbleWidget::MarbleWidgetDefaultInputHandler
friend class MarbleWidgetDefaultInputHandler
Definition: MarbleWidget.h:1081
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::Quaternion::normalize
void normalize()
Definition: Quaternion.cpp:64
Marble::MarbleWidget::textureLayer
const TextureLayer * textureLayer() const
Definition: MarbleWidget.cpp:407
Marble::MarbleWidget::setShowCrosshairs
void setShowCrosshairs(bool visible)
Set whether the crosshairs are visible.
Definition: MarbleWidget.cpp:974
Marble::MarbleWidget::floatItems
QList< AbstractFloatItem * > floatItems() const
Returns a list of all FloatItems on the widget.
Definition: MarbleWidget.cpp:1290
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:1251
Marble::RenderPlugin::setSettings
virtual void setSettings(const QHash< QString, QVariant > &settings)
Set the settings of the plugin.
Definition: RenderPlugin.cpp:193
Marble::MarbleWidget::showClouds
bool showClouds() const
Return whether the cloud cover is visible.
Marble::MarbleWidget::mouseClickGeoPosition
void mouseClickGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::Unit)
TileCreatorDialog.h
Marble::MarbleWidget::notifyMouseClick
void notifyMouseClick(int x, int y)
Used to notify about the position of the mouse click.
Definition: MarbleWidget.cpp:1075
Marble::MarbleWidget::setShowFrameRate
void setShowFrameRate(bool visible)
Set whether the frame rate gets shown.
Definition: MarbleWidget.cpp:1051
Marble::GeoDataLookAt::setLatitude
void setLatitude(qreal latitude, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
set the latitude in a GeoDataLookAt object
Definition: GeoDataLookAt.cpp:74
Marble::MarbleWidget::moveRight
void moveRight(FlyToMode mode=Automatic)
Move right by the moveStep.
Definition: MarbleWidget.cpp:712
Marble::MarbleWidget::setShowOtherPlaces
void setShowOtherPlaces(bool visible)
Set whether the other places overlay is visible.
Definition: MarbleWidget.cpp:1009
Marble::MarbleWidget::resizeEvent
virtual void resizeEvent(QResizeEvent *event)
Reimplementation of the resizeEvent() function in QWidget.
Definition: MarbleWidget.cpp:733
Marble::GeoDataLookAt::setCoordinates
void setCoordinates(const GeoDataCoordinates &coordinates)
set the GeoDataCoordinates object
Definition: GeoDataLookAt.cpp:53
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:908
Marble::MarbleWidget::centerLatitude
qreal centerLatitude() const
Return the latitude of the center point.
Definition: MarbleWidget.cpp:771
Marble::MarbleWidget::distance
qreal distance() const
Return the current distance.
Definition: MarbleWidget.cpp:1192
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