• 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.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 // Qt
32 class QAbstractItemModel;
33 class QItemSelectionModel;
34 class QSettings;
35 
36 namespace Marble
37 {
38 
39 class AbstractDataPluginItem;
40 class AbstractFloatItem;
41 class GeoDataLatLonAltBox;
42 class GeoDataLatLonBox;
43 class GeoPainter;
44 class GeoSceneDocument;
45 class LayerInterface;
46 class MarbleModel;
47 class MarbleWidgetPopupMenu;
48 class MarbleWidgetInputHandler;
49 class MarbleWidgetPrivate;
50 class Quaternion;
51 class RenderPlugin;
52 class RoutingLayer;
53 class TextureLayer;
54 class TileCoordsPyramid;
55 class TileCreator;
56 class GeoDataPlacemark;
57 class ViewportParams;
58 class PopupLayer;
59 
102 class MARBLE_EXPORT MarbleWidget : public QWidget
103 {
104  Q_OBJECT
105 #ifdef MARBLE_DBUS
106  Q_CLASSINFO("D-Bus Interface", "org.kde.MarbleWidget")
107 #endif
108 
109  Q_PROPERTY(int zoom READ zoom WRITE setZoom)
110 
111  Q_PROPERTY(QString mapThemeId READ mapThemeId WRITE setMapThemeId)
112  Q_PROPERTY(int projection READ projection WRITE setProjection)
113 
114  Q_PROPERTY(qreal longitude READ centerLongitude WRITE setCenterLongitude)
115  Q_PROPERTY(qreal latitude READ centerLatitude WRITE setCenterLatitude)
116 
117  Q_PROPERTY(bool showOverviewMap READ showOverviewMap WRITE setShowOverviewMap)
118  Q_PROPERTY(bool showScaleBar READ showScaleBar WRITE setShowScaleBar)
119  Q_PROPERTY(bool showCompass READ showCompass WRITE setShowCompass)
120  Q_PROPERTY(bool showGrid READ showGrid WRITE setShowGrid)
121 
122  Q_PROPERTY(bool showClouds READ showClouds WRITE setShowClouds)
123  Q_PROPERTY(bool showSunShading READ showSunShading WRITE setShowSunShading)
124  Q_PROPERTY(bool showCityLights READ showCityLights WRITE setShowCityLights)
125  Q_PROPERTY(bool isLockedToSubSolarPoint READ isLockedToSubSolarPoint WRITE setLockToSubSolarPoint)
126  Q_PROPERTY(bool isSubSolarPointIconVisible READ isSubSolarPointIconVisible WRITE setSubSolarPointIconVisible)
127  Q_PROPERTY(bool showAtmosphere READ showAtmosphere WRITE setShowAtmosphere)
128  Q_PROPERTY(bool showCrosshairs READ showCrosshairs WRITE setShowCrosshairs)
129 
130  Q_PROPERTY(bool showPlaces READ showPlaces WRITE setShowPlaces)
131  Q_PROPERTY(bool showCities READ showCities WRITE setShowCities)
132  Q_PROPERTY(bool showTerrain READ showTerrain WRITE setShowTerrain)
133  Q_PROPERTY(bool showOtherPlaces READ showOtherPlaces WRITE setShowOtherPlaces)
134 
135  Q_PROPERTY(bool showRelief READ showRelief WRITE setShowRelief)
136 
137  Q_PROPERTY(bool showIceLayer READ showIceLayer WRITE setShowIceLayer)
138  Q_PROPERTY(bool showBorders READ showBorders WRITE setShowBorders)
139  Q_PROPERTY(bool showRivers READ showRivers WRITE setShowRivers)
140  Q_PROPERTY(bool showLakes READ showLakes WRITE setShowLakes)
141 
142  Q_PROPERTY(quint64 volatileTileCacheLimit READ volatileTileCacheLimit WRITE setVolatileTileCacheLimit)
143 
144  public:
145 
154  explicit MarbleWidget( QWidget *parent = 0 );
155 
156  virtual ~MarbleWidget();
157 
159 
160 
164  MarbleModel *model() const;
165 
166  ViewportParams *viewport();
167  const ViewportParams *viewport() const;
168 
169  MarbleWidgetPopupMenu *popupMenu();
170 
174  MarbleWidgetInputHandler *inputHandler() const;
175 
179  void setInputHandler( MarbleWidgetInputHandler *handler );
180 
185  QList<RenderPlugin *> renderPlugins() const;
186 
191  QList<AbstractFloatItem *> floatItems() const;
192 
199  AbstractFloatItem * floatItem( const QString &nameId ) const;
200 
207  void readPluginSettings( QSettings& settings );
208 
215  void writePluginSettings( QSettings& settings ) const;
216 
220  ViewContext viewContext() const;
221 
225  GeoSceneDocument * mapTheme() const;
226 
230  QList<AbstractDataPluginItem *> whichItemAt( const QPoint& curpos ) const;
231 
235  void addLayer( LayerInterface *layer );
236 
240  void removeLayer( LayerInterface *layer );
241 
242  RoutingLayer* routingLayer();
243 
244  PopupLayer* popupLayer();
245 
252  Projection projection() const;
253 // int projection() const;
254 
256 
258 
259 
269  QString mapThemeId() const;
270 
274  QRegion mapRegion() const;
275 
279  int radius() const;
280 
284  int zoom() const;
285 
286  int tileZoomLevel() const;
287 
291  qreal distance() const;
292 
296  QString distanceString() const;
297 
301  int minimumZoom() const;
302 
306  int maximumZoom() const;
307 
309 
311 
312 
322  bool screenCoordinates( qreal lon, qreal lat,
323  qreal& x, qreal& y ) const;
324 
334  bool geoCoordinates( int x, int y,
335  qreal& lon, qreal& lat,
336  GeoDataCoordinates::Unit = GeoDataCoordinates::Degree ) const;
337 
342  qreal centerLongitude() const;
343 
348  qreal centerLatitude() const;
349 
354  qreal moveStep() const;
355 
359  GeoDataLookAt lookAt() const;
360 
367  GeoDataCoordinates focusPoint() const;
368 
374  void setFocusPoint( const GeoDataCoordinates &focusPoint );
375 
380  void resetFocusPoint();
381 
385  qreal radiusFromDistance( qreal distance ) const;
386 
390  qreal distanceFromRadius( qreal radius ) const;
391 
395  qreal zoomFromDistance( qreal distance ) const;
396 
400  qreal distanceFromZoom( qreal zoom ) const;
401 
403 
405 
406 
407  QVector<const GeoDataPlacemark*> whichFeatureAt( const QPoint& ) const;
408 
410 
412 
413 
418  bool showOverviewMap() const;
419 
424  bool showScaleBar() const;
425 
430  bool showCompass() const;
431 
436  bool showClouds() const;
437 
442  bool showSunShading() const;
443 
448  bool showCityLights() const;
449 
454  bool isLockedToSubSolarPoint() const;
455 
460  bool isSubSolarPointIconVisible() const;
461 
466  bool showAtmosphere() const;
467 
472  bool showCrosshairs() const;
473 
478  bool showGrid() const;
479 
484  bool showPlaces() const;
485 
490  bool showCities() const;
491 
496  bool showTerrain() const;
497 
502  bool showOtherPlaces() const;
503 
508  bool showRelief() const;
509 
514  bool showIceLayer() const;
515 
520  bool showBorders() const;
521 
526  bool showRivers() const;
527 
532  bool showLakes() const;
533 
538  bool showFrameRate() const;
539 
540  bool showBackground() const;
541 
545  MapQuality mapQuality( ViewContext = Still ) const;
546 
550  bool animationsEnabled() const;
551 
552  AngleUnit defaultAngleUnit() const;
553  void setDefaultAngleUnit( AngleUnit angleUnit );
554 
555  QFont defaultFont() const;
556  void setDefaultFont( const QFont& font );
557 
559 
561 
562 
567  quint64 volatileTileCacheLimit() const;
568 
570 
572 
573 
577  QPixmap mapScreenShot();
578 
580 
583  // @deprecated Please use setZoom
584  //MARBLE_DEPRECATED( void zoomView( int zoom, FlyToMode mode = Instant ) );
585 
586  public Q_SLOTS:
587 
589 
590 
595  void setRadius( int radius );
596 
605  void setZoom( int zoom, FlyToMode mode = Instant );
606 
610  void zoomView( int zoom, FlyToMode mode = Instant );
611 
616  void zoomViewBy( int zoomStep, FlyToMode mode = Instant );
617 
621  void zoomIn( FlyToMode mode = Automatic );
625  void zoomOut( FlyToMode mode = Automatic );
626 
631  void setDistance( qreal distance );
632 
644  void rotateBy( const qreal deltaLon, const qreal deltaLat, FlyToMode mode = Instant );
645 
653  void centerOn( const qreal lon, const qreal lat, bool animated = false );
654 
665  void centerOn( const GeoDataCoordinates &point, bool animated = false );
666 
674  void centerOn( const GeoDataLatLonBox& box, bool animated = false );
675 
682  void centerOn( const GeoDataPlacemark& placemark, bool animated = false );
683 
689  void setCenterLatitude( qreal lat, FlyToMode mode = Instant );
690 
696  void setCenterLongitude( qreal lon, FlyToMode mode = Instant );
697 
701  void moveLeft( FlyToMode mode = Automatic );
702 
706  void moveRight( FlyToMode mode = Automatic );
707 
711  void moveUp( FlyToMode mode = Automatic );
712 
716  void moveDown( FlyToMode mode = Automatic );
717 
721  void goHome( FlyToMode mode = Automatic );
722 
737  void flyTo( const GeoDataLookAt &lookAt, FlyToMode mode = Automatic );
738 
740 
742 
743 
748  void setProjection( int projection );
749  void setProjection( Projection projection );
750 
760  void setMapThemeId( const QString& maptheme );
761 
769  void setPropertyValue( const QString& name, bool value );
770 
775  void setShowOverviewMap( bool visible );
776 
781  void setShowScaleBar( bool visible );
782 
787  void setShowCompass( bool visible );
788 
793  void setShowClouds( bool visible );
794 
799  void setShowSunShading( bool visible );
800 
805  void setShowCityLights( bool visible );
806 
811  void setLockToSubSolarPoint( bool visible );
812 
817  void setSubSolarPointIconVisible( bool visible );
818 
823  void setShowAtmosphere( bool visible );
824 
829  void setShowCrosshairs( bool visible );
830 
835  void setShowGrid( bool visible );
836 
841  void setShowPlaces( bool visible );
842 
847  void setShowCities( bool visible );
848 
853  void setShowTerrain( bool visible );
854 
859  void setShowOtherPlaces( bool visible );
860 
865  void setShowRelief( bool visible );
866 
871  void setShowIceLayer( bool visible );
872 
877  void setShowBorders( bool visible );
878 
883  void setShowRivers( bool visible );
884 
889  void setShowLakes( bool visible );
890 
895  void setShowFrameRate( bool visible );
896 
897  void setShowBackground( bool visible );
898 
905  void setShowTileId( bool visible );
906 
911  void setShowRuntimeTrace( bool visible );
912 
919  void setMapQualityForViewContext( MapQuality quality, ViewContext viewContext );
920 
924  void setViewContext( ViewContext viewContext );
925 
929  void setAnimationsEnabled( bool enabled );
930 
932 
934 
935 
936  void clearVolatileTileCache();
941  void setVolatileTileCacheLimit( quint64 kiloBytes );
942 
961  void creatingTilesStart( TileCreator *creator, const QString& name, const QString& description );
962 
966  void reloadMap();
967 
968  void downloadRegion( QVector<TileCoordsPyramid> const & );
969 
971 
973 
974 
978  void notifyMouseClick( int x, int y );
979 
980  void setSelection( const QRect& region );
981 
982  void setInputEnabled( bool );
983 
984  const TextureLayer *textureLayer() const;
985 
987 
988  Q_SIGNALS:
994  void zoomChanged( int zoom );
995  void distanceChanged( const QString& distanceString );
996 
997  void tileLevelChanged( int level );
998 
1003  void themeChanged( const QString& theme );
1004 
1005  void projectionChanged( Projection );
1006 
1007  void mouseMoveGeoPosition( const QString& );
1008 
1009  void mouseClickGeoPosition( qreal lon, qreal lat, GeoDataCoordinates::Unit );
1010 
1011  void framesPerSecond( qreal fps );
1012 
1017  void regionSelected( const QList<double>& );
1018 
1022  void pluginSettingsChanged();
1023 
1027  void renderPluginInitialized( RenderPlugin *renderPlugin );
1028 
1033  void visibleLatLonAltBoxChanged( const GeoDataLatLonAltBox& visibleLatLonAltBox );
1034 
1035  protected:
1039  virtual void leaveEvent( QEvent *event );
1040 
1044  virtual void paintEvent( QPaintEvent *event );
1045 
1049  virtual void resizeEvent( QResizeEvent *event );
1050 
1051  void connectNotify( const char * signal );
1052  void disconnectNotify( const char * signal );
1053 
1058  virtual void changeEvent( QEvent * event );
1059 
1067  virtual void customPaint( GeoPainter *painter );
1068 
1069  private:
1070  Q_PRIVATE_SLOT( d, void updateMapTheme() )
1071  Q_PRIVATE_SLOT( d, void updateSystemBackgroundAttribute() )
1072 
1073  private:
1074  Q_DISABLE_COPY( MarbleWidget )
1075  MarbleWidgetPrivate * const d;
1076  friend class MarbleWidgetPrivate;
1077 
1078  class CustomPaintLayer;
1079  friend class CustomPaintLayer;
1080 
1081  friend class MarbleWidgetDefaultInputHandler;
1082 };
1083 
1084 }
1085 
1086 #endif
GeoDataCoordinates.h
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
Marble::Automatic
A sane value is chosen automatically depending on animation settings and the action.
Definition: MarbleGlobal.h:170
Marble::MarbleWidgetInputHandler
Definition: MarbleWidgetInputHandler.h:37
Marble::AbstractDataPluginItem
Definition: AbstractDataPluginItem.h:28
Marble::GeoPainter
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:98
Marble::ViewContext
ViewContext
This enum is used to choose context in which map quality gets used.
Definition: MarbleGlobal.h:72
QWidget
Marble::PopupLayer
The PopupLayer class.
Definition: PopupLayer.h:39
Marble::LayerInterface
Definition: LayerInterface.h:25
Marble::MapQuality
MapQuality
This enum is used to choose the map quality shown in the view.
Definition: MarbleGlobal.h:80
Marble::dgml::handler
static GeoTagHandlerRegistrar handler(GeoParser::QualifiedName(dgmlTag_DownloadPolicy, dgmlTag_nameSpace20), new DgmlDownloadPolicyTagHandler)
Marble::MarbleWidgetDefaultInputHandler
Definition: MarbleWidgetInputHandler.h:96
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:102
Marble::TileCoordsPyramid
Definition: TileCoordsPyramid.h:23
GeoDataLookAt.h
MARBLE_EXPORT
#define MARBLE_EXPORT
Definition: marble_export.h:20
Marble::AbstractFloatItem
The abstract class for float item plugins.
Definition: AbstractFloatItem.h:48
Marble::TileCreator
Definition: TileCreator.h:53
Marble::Still
still image
Definition: MarbleGlobal.h:73
Marble::TextureLayer
Definition: TextureLayer.h:39
MarbleGlobal.h
Marble::ViewportParams
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
QAbstractItemModel
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:169
GeoDataFolder.h
Marble::MarbleModel
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:96
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:63
Marble::Projection
Projection
This enum is used to choose the projection shown in the view.
Definition: MarbleGlobal.h:44
Marble::Instant
Change camera position immediately (no interpolation)
Definition: MarbleGlobal.h:171
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
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-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