• 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.h
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2006-2008 Torsten Rahn <tackat@kde.org>
9 // Copyright 2007 Inge Wallin <ingwa@kde.org>
10 //
11 
12 #ifndef MARBLE_MARBLEWIDGET_H
13 #define MARBLE_MARBLEWIDGET_H
14 
15 
23 #include <QPixmap>
24 #include <QWidget>
25 
26 #include "GeoDataCoordinates.h"
27 #include "GeoDataLookAt.h"
28 #include "MarbleGlobal.h" // types needed in all of marble.
29 #include "marble_export.h"
30 #include "GeoDataFolder.h"
31 #include "RenderState.h"
32 
33 // Qt
34 class QAbstractItemModel;
35 class QItemSelectionModel;
36 class QSettings;
37 
38 namespace Marble
39 {
40 
41 class AbstractDataPluginItem;
42 class AbstractFloatItem;
43 class GeoDataLatLonAltBox;
44 class GeoDataLatLonBox;
45 class GeoPainter;
46 class GeoSceneDocument;
47 class LayerInterface;
48 class MarbleModel;
49 class MarbleWidgetPopupMenu;
50 class MarbleWidgetInputHandler;
51 class MarbleWidgetPrivate;
52 class Quaternion;
53 class RenderPlugin;
54 class RoutingLayer;
55 class TextureLayer;
56 class TileCoordsPyramid;
57 class TileCreator;
58 class GeoDataPlacemark;
59 class ViewportParams;
60 class PopupLayer;
61 
104 class MARBLE_EXPORT MarbleWidget : public QWidget
105 {
106  Q_OBJECT
107 #ifdef MARBLE_DBUS
108  Q_CLASSINFO("D-Bus Interface", "org.kde.MarbleWidget")
109 #endif
110 
111  Q_PROPERTY(int zoom READ zoom WRITE setZoom)
112 
113  Q_PROPERTY(QString mapThemeId READ mapThemeId WRITE setMapThemeId)
114  Q_PROPERTY(int projection READ projection WRITE setProjection)
115 
116  Q_PROPERTY(qreal longitude READ centerLongitude WRITE setCenterLongitude)
117  Q_PROPERTY(qreal latitude READ centerLatitude WRITE setCenterLatitude)
118 
119  Q_PROPERTY(bool showOverviewMap READ showOverviewMap WRITE setShowOverviewMap)
120  Q_PROPERTY(bool showScaleBar READ showScaleBar WRITE setShowScaleBar)
121  Q_PROPERTY(bool showCompass READ showCompass WRITE setShowCompass)
122  Q_PROPERTY(bool showGrid READ showGrid WRITE setShowGrid)
123 
124  Q_PROPERTY(bool showClouds READ showClouds WRITE setShowClouds)
125  Q_PROPERTY(bool showSunShading READ showSunShading WRITE setShowSunShading)
126  Q_PROPERTY(bool showCityLights READ showCityLights WRITE setShowCityLights)
127  Q_PROPERTY(bool isLockedToSubSolarPoint READ isLockedToSubSolarPoint WRITE setLockToSubSolarPoint)
128  Q_PROPERTY(bool isSubSolarPointIconVisible READ isSubSolarPointIconVisible WRITE setSubSolarPointIconVisible)
129  Q_PROPERTY(bool showAtmosphere READ showAtmosphere WRITE setShowAtmosphere)
130  Q_PROPERTY(bool showCrosshairs READ showCrosshairs WRITE setShowCrosshairs)
131 
132  Q_PROPERTY(bool showPlaces READ showPlaces WRITE setShowPlaces)
133  Q_PROPERTY(bool showCities READ showCities WRITE setShowCities)
134  Q_PROPERTY(bool showTerrain READ showTerrain WRITE setShowTerrain)
135  Q_PROPERTY(bool showOtherPlaces READ showOtherPlaces WRITE setShowOtherPlaces)
136 
137  Q_PROPERTY(bool showRelief READ showRelief WRITE setShowRelief)
138 
139  Q_PROPERTY(bool showIceLayer READ showIceLayer WRITE setShowIceLayer)
140  Q_PROPERTY(bool showBorders READ showBorders WRITE setShowBorders)
141  Q_PROPERTY(bool showRivers READ showRivers WRITE setShowRivers)
142  Q_PROPERTY(bool showLakes READ showLakes WRITE setShowLakes)
143 
144  Q_PROPERTY( RenderStatus renderStatus READ renderStatus NOTIFY renderStatusChanged )
145 
146  Q_PROPERTY(quint64 volatileTileCacheLimit READ volatileTileCacheLimit WRITE setVolatileTileCacheLimit)
147 
148  public:
149 
158  explicit MarbleWidget( QWidget *parent = 0 );
159 
160  virtual ~MarbleWidget();
161 
163 
164 
168  MarbleModel *model();
169  const MarbleModel *model() const;
170 
171  ViewportParams *viewport();
172  const ViewportParams *viewport() const;
173 
174  MarbleWidgetPopupMenu *popupMenu();
175 
179  MarbleWidgetInputHandler *inputHandler() const;
180 
184  void setInputHandler( MarbleWidgetInputHandler *handler );
185 
190  QList<RenderPlugin *> renderPlugins() const;
191 
196  QList<AbstractFloatItem *> floatItems() const;
197 
204  AbstractFloatItem * floatItem( const QString &nameId ) const;
205 
212  void readPluginSettings( QSettings& settings );
213 
220  void writePluginSettings( QSettings& settings ) const;
221 
225  ViewContext viewContext() const;
226 
230  GeoSceneDocument * mapTheme() const;
231 
235  QList<AbstractDataPluginItem *> whichItemAt( const QPoint& curpos ) const;
236 
240  void addLayer( LayerInterface *layer );
241 
245  void removeLayer( LayerInterface *layer );
246 
247  RoutingLayer* routingLayer();
248 
249  PopupLayer* popupLayer();
250 
257  Projection projection() const;
258 // int projection() const;
259 
261 
263 
264 
274  QString mapThemeId() const;
275 
279  QRegion mapRegion() const;
280 
284  int radius() const;
285 
289  int zoom() const;
290 
291  int tileZoomLevel() const;
292 
296  qreal distance() const;
297 
301  QString distanceString() const;
302 
306  int minimumZoom() const;
307 
311  int maximumZoom() const;
312 
314 
316 
317 
327  bool screenCoordinates( qreal lon, qreal lat,
328  qreal& x, qreal& y ) const;
329 
339  bool geoCoordinates( int x, int y,
340  qreal& lon, qreal& lat,
341  GeoDataCoordinates::Unit = GeoDataCoordinates::Degree ) const;
342 
347  qreal centerLongitude() const;
348 
353  qreal centerLatitude() const;
354 
359  qreal moveStep() const;
360 
364  GeoDataLookAt lookAt() const;
365 
372  GeoDataCoordinates focusPoint() const;
373 
379  void setFocusPoint( const GeoDataCoordinates &focusPoint );
380 
385  void resetFocusPoint();
386 
390  qreal radiusFromDistance( qreal distance ) const;
391 
395  qreal distanceFromRadius( qreal radius ) const;
396 
400  qreal zoomFromDistance( qreal distance ) const;
401 
405  qreal distanceFromZoom( qreal zoom ) const;
406 
408 
410 
411 
412  QVector<const GeoDataPlacemark*> whichFeatureAt( const QPoint& ) const;
413 
415 
417 
418 
423  bool showOverviewMap() const;
424 
429  bool showScaleBar() const;
430 
435  bool showCompass() const;
436 
441  bool showClouds() const;
442 
447  bool showSunShading() const;
448 
453  bool showCityLights() const;
454 
459  bool isLockedToSubSolarPoint() const;
460 
465  bool isSubSolarPointIconVisible() const;
466 
471  bool showAtmosphere() const;
472 
477  bool showCrosshairs() const;
478 
483  bool showGrid() const;
484 
489  bool showPlaces() const;
490 
495  bool showCities() const;
496 
501  bool showTerrain() const;
502 
507  bool showOtherPlaces() const;
508 
513  bool showRelief() const;
514 
519  bool showIceLayer() const;
520 
525  bool showBorders() const;
526 
531  bool showRivers() const;
532 
537  bool showLakes() const;
538 
543  bool showFrameRate() const;
544 
545  bool showBackground() const;
546 
550  MapQuality mapQuality( ViewContext = Still ) const;
551 
555  bool animationsEnabled() const;
556 
557  AngleUnit defaultAngleUnit() const;
558  void setDefaultAngleUnit( AngleUnit angleUnit );
559 
560  QFont defaultFont() const;
561  void setDefaultFont( const QFont& font );
562 
564 
566 
567 
572  quint64 volatileTileCacheLimit() const;
573 
575 
577 
578 
582  QPixmap mapScreenShot();
583 
585 
588  // @deprecated Please use setZoom
589  //MARBLE_DEPRECATED( void zoomView( int zoom, FlyToMode mode = Instant ) );
590 
595  RenderStatus renderStatus() const;
596 
600  RenderState renderState() const;
601 
602  public Q_SLOTS:
603 
605 
606 
611  void setRadius( int radius );
612 
621  void setZoom( int zoom, FlyToMode mode = Instant );
622 
626  void zoomView( int zoom, FlyToMode mode = Instant );
627 
632  void zoomViewBy( int zoomStep, FlyToMode mode = Instant );
633 
637  void zoomIn( FlyToMode mode = Automatic );
641  void zoomOut( FlyToMode mode = Automatic );
642 
647  void setDistance( qreal distance );
648 
660  void rotateBy( const qreal deltaLon, const qreal deltaLat, FlyToMode mode = Instant );
661 
669  void centerOn( const qreal lon, const qreal lat, bool animated = false );
670 
681  void centerOn( const GeoDataCoordinates &point, bool animated = false );
682 
690  void centerOn( const GeoDataLatLonBox& box, bool animated = false );
691 
698  void centerOn( const GeoDataPlacemark& placemark, bool animated = false );
699 
705  void setCenterLatitude( qreal lat, FlyToMode mode = Instant );
706 
712  void setCenterLongitude( qreal lon, FlyToMode mode = Instant );
713 
717  void moveLeft( FlyToMode mode = Automatic );
718 
722  void moveRight( FlyToMode mode = Automatic );
723 
727  void moveUp( FlyToMode mode = Automatic );
728 
732  void moveDown( FlyToMode mode = Automatic );
733 
737  void goHome( FlyToMode mode = Automatic );
738 
753  void flyTo( const GeoDataLookAt &lookAt, FlyToMode mode = Automatic );
754 
756 
758 
759 
764  void setProjection( int projection );
765  void setProjection( Projection projection );
766 
776  void setMapThemeId( const QString& maptheme );
777 
785  void setPropertyValue( const QString& name, bool value );
786 
791  void setShowOverviewMap( bool visible );
792 
797  void setShowScaleBar( bool visible );
798 
803  void setShowCompass( bool visible );
804 
809  void setShowClouds( bool visible );
810 
815  void setShowSunShading( bool visible );
816 
821  void setShowCityLights( bool visible );
822 
827  void setLockToSubSolarPoint( bool visible );
828 
833  void setSubSolarPointIconVisible( bool visible );
834 
839  void setShowAtmosphere( bool visible );
840 
845  void setShowCrosshairs( bool visible );
846 
851  void setShowGrid( bool visible );
852 
857  void setShowPlaces( bool visible );
858 
863  void setShowCities( bool visible );
864 
869  void setShowTerrain( bool visible );
870 
875  void setShowOtherPlaces( bool visible );
876 
881  void setShowRelief( bool visible );
882 
887  void setShowIceLayer( bool visible );
888 
893  void setShowBorders( bool visible );
894 
899  void setShowRivers( bool visible );
900 
905  void setShowLakes( bool visible );
906 
911  void setShowFrameRate( bool visible );
912 
913  void setShowBackground( bool visible );
914 
921  void setShowTileId( bool visible );
922 
927  void setShowRuntimeTrace( bool visible );
928 
935  void setMapQualityForViewContext( MapQuality quality, ViewContext viewContext );
936 
940  void setViewContext( ViewContext viewContext );
941 
945  void setAnimationsEnabled( bool enabled );
946 
948 
950 
951 
952  void clearVolatileTileCache();
957  void setVolatileTileCacheLimit( quint64 kiloBytes );
958 
977  void creatingTilesStart( TileCreator *creator, const QString& name, const QString& description );
978 
982  void reloadMap();
983 
984  void downloadRegion( QVector<TileCoordsPyramid> const & );
985 
987 
989 
990 
994  void notifyMouseClick( int x, int y );
995 
996  void setSelection( const QRect& region );
997 
998  void setInputEnabled( bool );
999 
1000  TextureLayer *textureLayer() const;
1001 
1003 
1004  Q_SIGNALS:
1010  void zoomChanged( int zoom );
1011  void distanceChanged( const QString& distanceString );
1012 
1013  void tileLevelChanged( int level );
1014 
1019  void themeChanged( const QString& theme );
1020 
1021  void projectionChanged( Projection );
1022 
1023  void mouseMoveGeoPosition( const QString& );
1024 
1025  void mouseClickGeoPosition( qreal lon, qreal lat, GeoDataCoordinates::Unit );
1026 
1027  void framesPerSecond( qreal fps );
1028 
1033  void regionSelected( const QList<double>& );
1034 
1038  void pluginSettingsChanged();
1039 
1043  void renderPluginInitialized( RenderPlugin *renderPlugin );
1044 
1049  void visibleLatLonAltBoxChanged( const GeoDataLatLonAltBox& visibleLatLonAltBox );
1050 
1055  void renderStatusChanged( RenderStatus status );
1056 
1057  void renderStateChanged( const RenderState &state );
1058 
1059  protected:
1063  virtual void leaveEvent( QEvent *event );
1064 
1068  virtual void paintEvent( QPaintEvent *event );
1069 
1073  virtual void resizeEvent( QResizeEvent *event );
1074 
1075 #if QT_VERSION < 0x050000
1076  void connectNotify( const char * signal );
1077  void disconnectNotify( const char * signal );
1078 #else
1079  virtual void connectNotify(const QMetaMethod &signal);
1080  virtual void disconnectNotify(const QMetaMethod &signal);
1081 #endif
1082 
1087  virtual void changeEvent( QEvent * event );
1088 
1096  virtual void customPaint( GeoPainter *painter );
1097 
1098  private:
1099  Q_PRIVATE_SLOT( d, void updateMapTheme() )
1100  Q_PRIVATE_SLOT( d, void updateSystemBackgroundAttribute() )
1101 
1102  private:
1103  Q_DISABLE_COPY( MarbleWidget )
1104  MarbleWidgetPrivate * const d;
1105  friend class MarbleWidgetPrivate;
1106 
1107  class CustomPaintLayer;
1108  friend class CustomPaintLayer;
1109 
1110  friend class MarbleWidgetDefaultInputHandler;
1111 };
1112 
1113 }
1114 
1115 #endif
GeoDataCoordinates.h
QEvent
QResizeEvent
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
QWidget
Marble::Automatic
A sane value is chosen automatically depending on animation settings and the action.
Definition: MarbleGlobal.h:174
Marble::MarbleWidgetInputHandler
Definition: MarbleWidgetInputHandler.h:27
Marble::AbstractDataPluginItem
Definition: AbstractDataPluginItem.h:28
Marble::GeoPainter
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:98
QFont
Marble::ViewContext
ViewContext
This enum is used to choose context in which map quality gets used.
Definition: MarbleGlobal.h:74
Marble::PopupLayer
The PopupLayer class.
Definition: PopupLayer.h:34
Marble::LayerInterface
Definition: LayerInterface.h:26
Marble::MapQuality
MapQuality
This enum is used to choose the map quality shown in the view.
Definition: MarbleGlobal.h:82
QPoint
Marble::dgml::handler
static GeoTagHandlerRegistrar handler(GeoParser::QualifiedName(dgmlTag_DownloadPolicy, dgmlTag_nameSpace20), new DgmlDownloadPolicyTagHandler)
Marble::RoutingLayer
A paint layer that serves as a view on a route model.
Definition: RoutingLayer.h:36
Marble::MarbleWidget
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:104
QRect
Marble::TileCoordsPyramid
Definition: TileCoordsPyramid.h:23
GeoDataLookAt.h
RenderState.h
MARBLE_EXPORT
#define MARBLE_EXPORT
Definition: marble_export.h:20
Marble::AbstractFloatItem
The abstract class for float item plugins.
Definition: AbstractFloatItem.h:45
Marble::TileCreator
Definition: TileCreator.h:53
Marble::radius
static qreal radius(qreal zoom)
Definition: thumbnailer.cpp:99
Marble::Still
still image
Definition: MarbleGlobal.h:75
Marble::TextureLayer
Definition: TextureLayer.h:38
QString
QList
Marble::RenderStatus
RenderStatus
Definition: MarbleGlobal.h:191
MarbleGlobal.h
Marble::RenderState
Definition: RenderState.h:22
Marble::ViewportParams
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
QPixmap
QSettings
Marble::GeoSceneDocument
A container for features parsed from the DGML file.
Definition: GeoSceneDocument.h:44
Marble::GeoDataLookAt
Definition: GeoDataLookAt.h:23
Marble::FlyToMode
FlyToMode
Describes possible flight mode (interpolation between source and target camera positions) ...
Definition: MarbleGlobal.h:173
GeoDataFolder.h
Marble::MarbleModel
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:97
QVector
Marble::MarbleWidgetPopupMenu
The MarbleWidgetPopupMenu handles context menus.
Definition: MarbleWidgetPopupMenu.h:33
marble_export.h
Marble::AngleUnit
AngleUnit
This enum is used to choose the unit chosen to measure angles.
Definition: MarbleGlobal.h:65
Marble::Projection
Projection
This enum is used to choose the projection shown in the view.
Definition: MarbleGlobal.h:44
QAbstractItemModel
Marble::Instant
Change camera position immediately (no interpolation)
Definition: MarbleGlobal.h:175
QPaintEvent
QItemSelectionModel
Marble::GeoDataPlacemark
a class representing a point of interest on the map
Definition: GeoDataPlacemark.h:54
Marble::RenderPlugin
The abstract class that creates a renderable item.
Definition: RenderPlugin.h:43
Marble::GeoDataLatLonAltBox
A class that defines a 3D bounding box for geographic data.
Definition: GeoDataLatLonAltBox.h:49
QMetaMethod
QRegion
Marble::GeoDataLatLonBox
A class that defines a 2D bounding box for geographic data.
Definition: GeoDataLatLonBox.h:51
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