[Marble-commits] KDE/kdeedu/marble
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Thu Aug 19 22:18:44 CEST 2010
SVN commit 1165638 by beschow:
move measure tool from MarbleMap to MarbleModel
A docs/release_notes (directory)
A docs/release_notes/APIChanges-0.11.txt
M +1 -9 src/lib/MarbleMap.cpp
M +0 -2 src/lib/MarbleMap.h
M +0 -3 src/lib/MarbleMap_p.h
M +11 -0 src/lib/MarbleModel.cpp
M +3 -0 src/lib/MarbleModel.h
M +2 -2 src/lib/MarbleWidgetInputHandler.cpp
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.cpp #1165637:1165638
@@ -84,9 +84,6 @@
m_justModified = false;
m_dirtyAtmosphere = false;
- m_measureTool = new MeasureTool( m_model, m_parent );
-
-
m_logzoom = 0;
m_zoomStep = 40;
@@ -248,7 +245,7 @@
antialiased = true;
}
- m_measureTool->paint( &painter, m_viewParams.viewport(), antialiased );
+ m_model->measureTool()->paint( &painter, m_viewParams.viewport(), antialiased );
}
void MarbleMapPrivate::paintFps( GeoPainter &painter, QRect &dirtyRect, qreal fps )
@@ -329,12 +326,7 @@
return &d->m_viewParams;
}
-MeasureTool *MarbleMap::measureTool()
-{
- return d->m_measureTool;
-}
-
void MarbleMap::setSize( int width, int height )
{
d->m_width = width;
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.h #1165637:1165638
@@ -51,7 +51,6 @@
class GeoDataLatLonAltBox;
class MarbleModel;
class ViewParams;
-class MeasureTool;
class SunLocator;
class FileViewModel;
class GeoPainter;
@@ -126,7 +125,6 @@
// Accessors to internal objects;
ViewParams *viewParams();
- MeasureTool *measureTool();
void setSize( int width, int height );
void setSize( const QSize& size );
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap_p.h #1165637:1165638
@@ -76,9 +76,6 @@
bool m_showFrameRate;
- // Tools
- MeasureTool *m_measureTool;
-
const qreal m_viewAngle;
};
--- trunk/KDE/kdeedu/marble/src/lib/MarbleModel.cpp #1165637:1165638
@@ -57,6 +57,7 @@
#include "MarbleDataFacade.h"
#include "MarbleDirs.h"
#include "MarblePlacemarkModel.h"
+#include "MeasureTool.h"
#include "MergedLayerDecorator.h"
#include "FileManager.h"
#include "GeoDataTreeModel.h"
@@ -144,6 +145,9 @@
static VectorComposer *m_veccomposer; // FIXME: Make not a pointer.
+ // Tools
+ MeasureTool *m_measureTool;
+
// Places on the map
FileManager *m_fileManager;
PlacemarkManager *m_placemarkmanager;
@@ -223,6 +227,8 @@
d->m_placemarkmanager->setDataFacade(d->m_dataFacade);
d->m_placemarkmanager->setFileManager(d->m_fileManager);
+ d->m_measureTool = new MeasureTool( this );
+
d->m_popSortModel = new QSortFilterProxyModel( this );
d->m_popSortModel->setSourceModel( d->m_dataFacade->placemarkModel() );
@@ -1014,6 +1020,11 @@
d->m_layerManager->removeLayer(layer);
}
+MeasureTool *MarbleModel::measureTool()
+{
+ return d->m_measureTool;
+}
+
Planet* MarbleModel::planet() const
{
return d->m_planet;
--- trunk/KDE/kdeedu/marble/src/lib/MarbleModel.h #1165637:1165638
@@ -49,6 +49,7 @@
class AbstractDataPluginItem;
class AbstractScanlineTextureMapper;
class GeoPainter;
+class MeasureTool;
class TileCoordsPyramid;
class FileViewModel;
class PositionTracking;
@@ -275,6 +276,8 @@
*/
void removeLayer( LayerInterface *layer );
+ MeasureTool *measureTool();
+
/**
* @brief Returns the planet object for the current map.
* @return the planet object for the current map
--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidgetInputHandler.cpp #1165637:1165638
@@ -348,7 +348,7 @@
// The interface to the measure tool consists of a RMB popup menu
// and some signals.
- MeasureTool *measureTool = MarbleWidgetInputHandler::d->m_widget->map()->measureTool();
+ MeasureTool *measureTool = MarbleWidgetInputHandler::d->m_model->measureTool();
// Connect the inputHandler and the measure tool to the popup menu
if ( !d->m_popupmenu ) {
@@ -844,7 +844,7 @@
qreal lon;
MarbleWidgetInputHandler::d->m_widget->geoCoordinates( p.x(), p.y(), lon, lat, GeoDataCoordinates::Radian );
- MeasureTool *measureTool = MarbleWidgetInputHandler::d->m_widget->map()->measureTool();
+ MeasureTool *measureTool = MarbleWidgetInputHandler::d->m_model->measureTool();
measureTool->addMeasurePoint( lon, lat );
}
More information about the Marble-commits
mailing list