[Marble-commits] KDE/kdeedu/marble/src/lib
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Sun Sep 19 00:50:45 CEST 2010
SVN commit 1176861 by beschow:
introduce MarbleModel::{minimum,maximum}Zoom()
M +2 -9 MarbleMap.cpp
M +17 -0 MarbleModel.cpp
M +10 -0 MarbleModel.h
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.cpp #1176860:1176861
@@ -39,7 +39,6 @@
#include "GeoPainter.h"
#include "GeoSceneDocument.h"
#include "GeoSceneHead.h"
-#include "GeoSceneZoom.h"
#include "MarbleDebug.h"
#include "MarbleDirs.h"
#include "MarbleLocale.h"
@@ -495,18 +494,12 @@
int MarbleMap::minimumZoom() const
{
- if ( d->m_viewParams.mapTheme() )
- return d->m_viewParams.mapTheme()->head()->zoom()->minimum();
-
- return 950;
+ return d->m_model->minimumZoom();
}
int MarbleMap::maximumZoom() const
{
- if ( d->m_viewParams.mapTheme() )
- return d->m_viewParams.mapTheme()->head()->zoom()->maximum();
-
- return 2100;
+ return d->m_model->maximumZoom();
}
void MarbleMap::addPlacemarkFile( const QString &filename )
--- trunk/KDE/kdeedu/marble/src/lib/MarbleModel.cpp #1176860:1176861
@@ -38,6 +38,7 @@
#include "GeoSceneTexture.h"
#include "GeoSceneVector.h"
#include "GeoSceneXmlDataSource.h"
+#include "GeoSceneZoom.h"
#include "GeoDataDocument.h"
#include "GeoDataStyle.h"
@@ -337,6 +338,22 @@
return d->m_mapTheme;
}
+int MarbleModel::minimumZoom() const
+{
+ if ( d->m_mapTheme )
+ return d->m_mapTheme->head()->zoom()->minimum();
+
+ return 950;
+}
+
+int MarbleModel::maximumZoom() const
+{
+ if ( d->m_mapTheme )
+ return d->m_mapTheme->head()->zoom()->maximum();
+
+ return 2100;
+}
+
// Set a particular theme for the map and load the appropriate tile level.
// If the tiles (for the lowest tile level) haven't been created already
// then create them here and now.
--- trunk/KDE/kdeedu/marble/src/lib/MarbleModel.h #1176860:1176861
@@ -162,6 +162,16 @@
GeoSceneDocument *mapTheme() const;
/**
+ * @brief return the minimum zoom value for the current map theme.
+ */
+ int minimumZoom() const;
+
+ /**
+ * @brief return the minimum zoom value for the current map theme.
+ */
+ int maximumZoom() const;
+
+ /**
* @brief Set a new map theme to use.
* @param selectedMap the identifier of the selected map theme
* @param currentProjection the current projection
More information about the Marble-commits
mailing list