[Marble-commits] KDE/kdeedu/marble/src/lib

Jens-Michael Hoffmann jensmh at gmx.de
Sat May 8 15:01:40 CEST 2010


SVN commit 1124265 by jmhoffmann:

MarbleMap/MarbleWidget: Add visibleLatLonAltBoxChanged signal.

This signal is emitted when the visible region on the map changes. This can
be triggered by the user moving the map or zooming. It is needed for
a non-modal download region dialog.

 M  +8 -0      MarbleMap.cpp  
 M  +7 -0      MarbleMap.h  
 M  +3 -0      MarbleWidget.cpp  
 M  +7 -0      MarbleWidget.h  


--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.cpp #1124264:1124265
@@ -36,6 +36,7 @@
 #include "FileStorageWatcher.h"
 #include "FileViewModel.h"
 #include "GeoDataFeature.h"
+#include "GeoDataLatLonAltBox.h"
 #include "GeoPainter.h"
 #include "GeoSceneDocument.h"
 #include "GeoSceneHead.h"
@@ -406,6 +407,7 @@
     d->m_height = height;
 
     d->doResize();
+    emit visibleLatLonAltBoxChanged( d->m_viewParams.viewport()->viewLatLonAltBox() );
 }
 
 void MarbleMap::setSize( const QSize& size )
@@ -414,6 +416,7 @@
     d->m_height = size.height();
 
     d->doResize();
+    emit visibleLatLonAltBoxChanged( d->m_viewParams.viewport()->viewLatLonAltBox() );
 }
 
 QSize MarbleMap::size() const
@@ -453,6 +456,7 @@
     d->m_logzoom = d->zoom( radius );
     emit zoomChanged( d->m_logzoom );
     emit distanceChanged( distanceString() );
+    emit visibleLatLonAltBoxChanged( d->m_viewParams.viewport()->viewLatLonAltBox() );
 }
 
 
@@ -770,6 +774,7 @@
 void MarbleMap::rotateBy( const Quaternion& incRot )
 {
     d->m_viewParams.setPlanetAxis( incRot * d->m_viewParams.planetAxis() );
+    emit visibleLatLonAltBoxChanged( d->m_viewParams.viewport()->viewLatLonAltBox() );
 }
 
 void MarbleMap::rotateBy( const qreal& deltaLon, const qreal& deltaLat )
@@ -782,6 +787,7 @@
     axis *= rotPhi;
     axis.normalize();
     d->m_viewParams.setPlanetAxis( axis );
+    emit visibleLatLonAltBoxChanged( d->m_viewParams.viewport()->viewLatLonAltBox() );
 }
 
 
@@ -790,6 +796,7 @@
     Quaternion  quat;
     quat.createFromEuler( -lat * DEG2RAD, lon * DEG2RAD, 0.0 );
     d->m_viewParams.setPlanetAxis( quat );
+    emit visibleLatLonAltBoxChanged( d->m_viewParams.viewport()->viewLatLonAltBox() );
 }
 
 void MarbleMap::centerOn( const QModelIndex& index )
@@ -843,6 +850,7 @@
 
     // Update texture map during the repaint that follows:
     setNeedsUpdate();
+    emit visibleLatLonAltBoxChanged( d->m_viewParams.viewport()->viewLatLonAltBox() );
 }
 
 void MarbleMap::home( qreal &lon, qreal &lat, int& zoom )
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.h #1124264:1124265
@@ -48,6 +48,7 @@
 class MarbleMapPrivate;
 
 // Marble
+class GeoDataLatLonAltBox;
 class MarbleModel;
 class ViewParams;
 class MeasureTool;
@@ -834,6 +835,12 @@
      */
     void repaintNeeded( const QRegion& dirtyRegion );
 
+    /**
+     * This signal is emitted when the visible region of the map changes. This typically happens
+     * when the user moves the map around or zooms.
+     */
+    void visibleLatLonAltBoxChanged( const GeoDataLatLonAltBox& visibleLatLonAltBox );
+
  protected:
 
     /**
--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidget.cpp #1124264:1124265
@@ -31,6 +31,7 @@
 #include "AbstractProjection.h"
 #include "DataMigration.h"
 #include "FileViewModel.h"
+#include "GeoDataLatLonAltBox.h"
 #include "GeoPainter.h"
 #include "MarbleDebug.h"
 #include "MarbleDirs.h"
@@ -212,6 +213,8 @@
                        m_widget, SIGNAL( zoomChanged( int ) ) );
     m_widget->connect( m_map,    SIGNAL( distanceChanged( QString ) ),
                        m_widget, SIGNAL( distanceChanged( QString ) ) );
+    m_widget->connect( m_map,    SIGNAL( visibleLatLonAltBoxChanged( GeoDataLatLonAltBox )),
+                       m_widget, SIGNAL( visibleLatLonAltBoxChanged( GeoDataLatLonAltBox )));
 
     // Set background: black.
     m_widget->setPalette( QPalette ( Qt::black ) );
--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidget.h #1124264:1124265
@@ -40,6 +40,7 @@
 
 class AbstractFloatItem;
 class FileViewModel;
+class GeoDataLatLonAltBox;
 class GeoDataLatLonBox;
 class GeoPainter;
 class GeoSceneDocument;
@@ -984,6 +985,12 @@
      */
     void renderPluginInitialized( RenderPlugin *renderPlugin );
 
+    /**
+     * This signal is emitted when the visible region of the map changes. This typically happens
+     * when the user moves the map around or zooms.
+     */
+    void visibleLatLonAltBoxChanged( const GeoDataLatLonAltBox& visibleLatLonAltBox );
+
  protected:
     /**
      * @brief Reimplementation of the leaveEvent() function in QWidget.


More information about the Marble-commits mailing list