Marble

MarbleMap.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 <[email protected]>
9 // Copyright 2007 Inge Wallin <[email protected]>
10 // Copyright 2009 Jens-Michael Hoffmann <[email protected]>
11 //
12 
13 #ifndef MARBLE_MARBLEMAP_H
14 #define MARBLE_MARBLEMAP_H
15 
16 
25 #include "marble_export.h"
26 #include "GeoDataCoordinates.h" // In geodata/data/
27 #include "GeoDataRelation.h"
28 
29 // Qt
30 #include <QObject>
31 #include <QRegion>
32 
33 class QFont;
34 class QString;
35 
36 namespace Marble
37 {
38 
39 // MarbleMap
40 class MarbleMapPrivate;
41 
42 // Marble
43 class GeoDataLatLonAltBox;
44 class GeoDataFeature;
45 class MarbleModel;
46 class ViewportParams;
47 class GeoPainter;
48 class LayerInterface;
49 class RenderPlugin;
50 class RenderState;
51 class AbstractDataPlugin;
52 class AbstractDataPluginItem;
53 class AbstractFloatItem;
54 class TextureLayer;
55 class TileCoordsPyramid;
56 class GeoSceneTextureTileDataset;
57 class StyleBuilder;
58 
89 class MARBLE_EXPORT MarbleMap : public QObject
90 {
91  Q_OBJECT
92  Q_CLASSINFO("D-Bus Interface", "org.kde.MarbleMap")
93 
94  public:
95 
96  friend class MarbleWidget;
97 
105  MarbleMap();
106 
115  explicit MarbleMap( MarbleModel *model );
116 
117  ~MarbleMap() override;
118 
122  MarbleModel *model() const;
123 
124  // Accessors to internal objects;
125  ViewportParams *viewport();
126  const ViewportParams *viewport() const;
127 
134  Projection projection() const;
135 
145  QString mapThemeId() const;
146 
147  void setMapQualityForViewContext( MapQuality qualityForViewContext, ViewContext viewContext );
148  MapQuality mapQuality( ViewContext viewContext ) const;
149 
153  MapQuality mapQuality() const;
154 
155  void setViewContext( ViewContext viewContext );
156  ViewContext viewContext() const;
157 
158  void setSize( int width, int height );
159  void setSize( const QSize& size );
160  QSize size() const;
161  int width() const;
162  int height() const;
163 
167  int radius() const;
168 
169  int preferredRadiusCeil(int radius) const;
170  int preferredRadiusFloor(int radius) const;
171 
172  int tileZoomLevel() const;
173 
177  int minimumZoom() const;
178 
182  int maximumZoom() const;
183 
184  bool discreteZoom() const;
185 
195  bool screenCoordinates( qreal lon, qreal lat,
196  qreal& x, qreal& y ) const;
197 
208  bool geoCoordinates( int x, int y,
209  qreal& lon, qreal& lat,
210  GeoDataCoordinates::Unit = GeoDataCoordinates::Degree ) const;
211 
216  qreal centerLongitude() const;
217 
222  qreal centerLatitude() const;
223 
224  qreal heading() const;
225 
229  bool hasFeatureAt(const QPoint&) const;
230 
231  QVector<const GeoDataFeature *> whichFeatureAt( const QPoint& ) const;
232 
237  bool propertyValue( const QString& name ) const;
238 
243  bool showOverviewMap() const;
244 
249  bool showScaleBar() const;
250 
255  bool showCompass() const;
256 
261  bool showClouds() const;
262 
267  bool showSunShading() const;
268 
273  bool showCityLights() const;
274 
279  bool isLockedToSubSolarPoint() const;
280 
285  bool isSubSolarPointIconVisible() const;
286 
291  bool showAtmosphere() const;
292 
297  bool showCrosshairs() const;
298 
303  bool showGrid() const;
304 
309  bool showPlaces() const;
310 
315  bool showCities() const;
316 
321  bool showTerrain() const;
322 
327  bool showOtherPlaces() const;
328 
333  bool showRelief() const;
334 
339  bool showIceLayer() const;
340 
345  bool showBorders() const;
346 
351  bool showRivers() const;
352 
357  bool showLakes() const;
358 
363  bool showFrameRate() const;
364 
365  bool showBackground() const;
366 
367  GeoDataRelation::RelationTypes visibleRelationTypes() const;
368 
373  quint64 volatileTileCacheLimit() const;
374 
379  QList<RenderPlugin *> renderPlugins() const;
380  QList<AbstractFloatItem *> floatItems() const;
381 
386  AbstractFloatItem * floatItem( const QString &nameId ) const;
387 
392  QList<AbstractDataPlugin *> dataPlugins() const;
393 
397  QList<AbstractDataPluginItem *> whichItemAt( const QPoint& curpos ) const;
398 
399  AngleUnit defaultAngleUnit() const;
400 
401  QFont defaultFont() const;
402 
403  TextureLayer *textureLayer() const;
404 
408  void addLayer( LayerInterface *layer );
409 
414  QString addTextureLayer(GeoSceneTextureTileDataset *texture);
415 
420  void removeTextureLayer(const QString &key);
421 
425  void removeLayer( LayerInterface *layer );
426 
427  RenderStatus renderStatus() const;
428 
429  RenderState renderState() const;
430 
434  const StyleBuilder* styleBuilder() const;
435 
436  public Q_SLOTS:
437 
443  void paint( GeoPainter &painter, const QRect &dirtyRect );
444 
449  void setRadius( int radius );
450 
451  void setHeading( qreal heading );
452 
464  void rotateBy(qreal deltaLon, qreal deltaLat);
465 
473  void centerOn( const qreal lon, const qreal lat );
474 
479  void setCenterLatitude( qreal lat );
480 
485  void setCenterLongitude( qreal lon );
486 
491  void setProjection( Projection projection );
492 
502  void setMapThemeId( const QString& maptheme );
503 
512  void setPropertyValue( const QString& name, bool value );
513 
518  void setShowOverviewMap( bool visible );
519 
524  void setShowScaleBar( bool visible );
525 
530  void setShowCompass( bool visible );
531 
536  void setShowClouds( bool visible );
537 
542  void setShowSunShading( bool visible );
543 
548  void setShowCityLights( bool visible );
549 
554  void setLockToSubSolarPoint( bool visible );
555 
560  void setSubSolarPointIconVisible( bool visible );
561 
568  void setShowTileId( bool visible );
569 
574  void setShowAtmosphere( bool visible );
575 
580  void setShowCrosshairs( bool visible );
581 
586  void setShowGrid( bool visible );
587 
592  void setShowPlaces( bool visible );
593 
598  void setShowCities( bool visible );
599 
604  void setShowTerrain( bool visible );
605 
610  void setShowOtherPlaces( bool visible );
611 
616  void setShowRelief( bool visible );
617 
622  void setShowIceLayer( bool visible );
623 
628  void setShowBorders( bool visible );
629 
634  void setShowRivers( bool visible );
635 
640  void setShowLakes( bool visible );
641 
646  void setShowFrameRate( bool visible );
647 
648  void setShowRuntimeTrace( bool visible );
649 
650  bool showRuntimeTrace() const;
651 
657  void setShowDebugPolygons( bool visible);
658 
659  bool showDebugPolygons() const;
660 
666  void setShowDebugBatchRender( bool visible);
667 
668  bool showDebugBatchRender() const;
669 
670 
676  void setShowDebugPlacemarks(bool visible);
677 
678  bool showDebugPlacemarks() const;
679 
680 
686  void setLevelTagDebugModeEnabled(bool visible);
687 
688  bool levelTagDebugModeEnabled() const;
689 
690  void setDebugLevelTag(int level);
691 
692  int debugLevelTag() const;
693 
694 
695  void setShowBackground( bool visible );
696 
697  void setVisibleRelationTypes(GeoDataRelation::RelationTypes relationTypes);
698 
702  void notifyMouseClick( int x, int y );
703 
704  void clearVolatileTileCache();
709  void setVolatileTileCacheLimit( quint64 kiloBytes );
710 
711  void setDefaultAngleUnit( AngleUnit angleUnit );
712 
713  void setDefaultFont( const QFont& font );
714 
720  void reload();
721 
722  void downloadRegion( QVector<TileCoordsPyramid> const & );
723 
724  void highlightRouteRelation(qint64 osmId, bool enabled);
725 
726  Q_SIGNALS:
727  void tileLevelChanged( int level );
728 
733  void themeChanged( const QString& theme );
734 
735  void projectionChanged( Projection );
736 
737  void radiusChanged( int radius );
738 
739  void mouseMoveGeoPosition( const QString& );
740 
741  void mouseClickGeoPosition( qreal lon, qreal lat, GeoDataCoordinates::Unit );
742 
743  void framesPerSecond( qreal fps );
744 
750  void repaintNeeded( const QRegion& dirtyRegion = QRegion() );
751 
756  void visibleLatLonAltBoxChanged( const GeoDataLatLonAltBox& visibleLatLonAltBox );
757 
761  void pluginSettingsChanged();
762 
766  void renderPluginInitialized( RenderPlugin *renderPlugin );
767 
772  void renderStatusChanged( RenderStatus status );
773 
774  void renderStateChanged( const RenderState &state );
775 
776  void highlightedPlacemarksChanged( qreal, qreal, GeoDataCoordinates::Unit );
777 
778  void viewContextChanged(ViewContext viewContext);
779 
780  void visibleRelationTypesChanged(GeoDataRelation::RelationTypes relationTypes);
781 
782  protected:
783 
791  virtual void customPaint( GeoPainter *painter );
792 
793  private:
794  Q_PRIVATE_SLOT( d, void updateMapTheme() )
795  Q_PRIVATE_SLOT( d, void updateProperty( const QString &, bool ) )
796  Q_PRIVATE_SLOT( d, void setDocument(QString) )
797  Q_PRIVATE_SLOT( d, void updateTileLevel() )
798  Q_PRIVATE_SLOT(d, void addPlugins())
799 
800  private:
801  Q_DISABLE_COPY( MarbleMap )
802  MarbleMapPrivate * const d;
803  friend class MarbleMapPrivate;
804 
805  class CustomPaintLayer;
806  friend class CustomPaintLayer;
807 };
808 
809 }
810 
811 #endif
Unit
enum used constructor to specify the units used
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:93
Binds a QML item to a specific geodetic location in screen coordinates.
ViewContext
This enum is used to choose context in which map quality gets used.
Definition: MarbleGlobal.h:70
MapQuality
This enum is used to choose the map quality shown in the view.
Definition: MarbleGlobal.h:78
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:102
The abstract class for float item plugins.
A class that can paint a view of the earth.
Definition: MarbleMap.h:89
A public class that controls what is visible in the viewport of a Marble map.
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:91
AngleUnit
This enum is used to choose the unit chosen to measure angles.
Definition: MarbleGlobal.h:61
Projection
This enum is used to choose the projection shown in the view.
Definition: MarbleGlobal.h:45
The abstract class that creates a renderable item.
Definition: RenderPlugin.h:43
A class that defines a 3D bounding box for geographic data.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jun 5 2020 22:32:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.