[Marble-commits] KDE/kdeedu/marble/src
Andrew Manson
g.real.ate at gmail.com
Wed Jul 15 15:25:14 CEST 2009
SVN commit 997170 by mansona:
Creating a base class GeoPointGraphicsItem which is intended to be
a default implementation
M +1 -0 CMakeLists.txt
M +1 -0 lib/CMakeLists.txt
M +6 -0 lib/GeoPainter.cpp
M +2 -0 lib/GeoPainter.h
M +2 -0 lib/geodata/CMakeLists.txt
A lib/geodata/graphicsitem (directory)
A lib/geodata/graphicsitem/GeoPointGraphicsItem.cpp [License: LGPL]
A lib/geodata/graphicsitem/GeoPointGraphicsItem.h [License: LGPL]
M +1 -10 plugins/render/osmannotate/osm/OsmNodeGraphicsItem.cpp
M +2 -5 plugins/render/osmannotate/osm/OsmNodeGraphicsItem.h
M +1 -1 plugins/render/osmannotate/osm/OsmNodeTagHandler.cpp
--- trunk/KDE/kdeedu/marble/src/CMakeLists.txt #997169:997170
@@ -15,6 +15,7 @@
${CMAKE_CURRENT_SOURCE_DIR}/lib/Projections
${CMAKE_CURRENT_SOURCE_DIR}/lib/geodata
${CMAKE_CURRENT_SOURCE_DIR}/lib/geodata/data
+ ${CMAKE_CURRENT_SOURCE_DIR}/lib/geodata/graphicsitem
${CMAKE_CURRENT_SOURCE_DIR}/lib/geodata/handlers/dgml
${CMAKE_CURRENT_SOURCE_DIR}/lib/geodata/parser
${CMAKE_CURRENT_SOURCE_DIR}/lib/geodata/scene
--- trunk/KDE/kdeedu/marble/src/lib/CMakeLists.txt #997169:997170
@@ -13,6 +13,7 @@
${CMAKE_CURRENT_SOURCE_DIR}/runners
${CMAKE_CURRENT_SOURCE_DIR}/geodata
${CMAKE_CURRENT_SOURCE_DIR}/geodata/data
+ ${CMAKE_CURRENT_SOURCE_DIR}/geodata/graphicsitem
${CMAKE_CURRENT_SOURCE_DIR}/geodata/scene
${CMAKE_CURRENT_SOURCE_DIR}/geodata/handlers
${CMAKE_CURRENT_SOURCE_DIR}/geodata/handlers/gpx
--- trunk/KDE/kdeedu/marble/src/lib/GeoPainter.cpp #997169:997170
@@ -18,6 +18,7 @@
#include "GeoDataCoordinates.h"
#include "GeoDataLineString.h"
#include "GeoDataLinearRing.h"
+#include "GeoDataPoint.h"
#include "GeoDataPolygon.h"
#include "global.h"
@@ -209,6 +210,11 @@
}
}
+void GeoPainter::drawPoint( const GeoDataPoint & point )
+{
+ drawPoint( GeoDataCoordinates( point ) );
+}
+
void GeoPainter::drawPoints ( const GeoDataCoordinates * points, int pointCount )
{
int pointRepeatNum;
--- trunk/KDE/kdeedu/marble/src/lib/GeoPainter.h #997169:997170
@@ -37,6 +37,7 @@
class GeoDataCoordinates;
class GeoDataLineString;
class GeoDataLinearRing;
+class GeoDataPoint;
class GeoDataPolygon;
/**
@@ -90,6 +91,7 @@
void drawAnnotation ( const GeoDataCoordinates & position, const QString & text, QSizeF bubbleSize = QSizeF( 130, 100 ), qreal bubbleOffsetX = -10, qreal bubbleOffsetY = -30, qreal xRnd = 5, qreal yRnd = 5 );
void drawPoint ( const GeoDataCoordinates & position );
+ void drawPoint ( const GeoDataPoint & point );
void drawPoints ( const GeoDataCoordinates * points, int pointCount );
// Of course in theory we could have the "isGeoProjected" parameter used
--- trunk/KDE/kdeedu/marble/src/lib/geodata/CMakeLists.txt #997169:997170
@@ -5,6 +5,7 @@
#
FILE( GLOB geodata_data_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} geodata/data/*.cpp )
+FILE( GLOB geodata_graphicsitem_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} geodata/graphicsitem/*.cpp )
FILE( GLOB geodata_scene_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} geodata/scene/*.cpp )
FILE( GLOB geodata_handlers_dgml_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} geodata/handlers/dgml/*.cpp )
FILE( GLOB geodata_handlers_kml_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} geodata/handlers/kml/*.cpp )
@@ -37,6 +38,7 @@
SET( geodata_SRCS
${geodata_data_SRCS}
+ ${geodata_graphicsitem_SRCS}
${geodata_scene_SRCS}
${geodata_parser_SRCS}
${geodata_handlers_gpx_SRCS}
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/osm/OsmNodeGraphicsItem.cpp #997169:997170
@@ -16,7 +16,7 @@
{
OsmNodeGraphicsItem::OsmNodeGraphicsItem()
- : GeoGraphicsItem()
+ : GeoPointGraphicsItem()
{
m_pen.setColor( Qt::black );
}
@@ -27,11 +27,6 @@
Q_UNUSED( renderPos )
Q_UNUSED( layer )
- //FIXME GeoPainter should have a method to directly draw a
- //GeoDataPoint. after that most of this code can be removed
- qreal lon, lat;
- m_point.geoCoordinates( lon, lat );
-
painter->save();
//stop points from blurring
painter->setRenderHint( QPainter::Antialiasing, false );
@@ -41,9 +36,5 @@
}
-void OsmNodeGraphicsItem::setPoint( const GeoDataCoordinates& point )
-{
- m_point = GeoDataCoordinates( point );
-}
}
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/osm/OsmNodeGraphicsItem.h #997169:997170
@@ -13,13 +13,14 @@
#include "GeoDataPoint.h"
#include "GeoGraphicsItem.h"
+#include "GeoPointGraphicsItem.h"
#include <QtGui/QPen>
namespace Marble
{
-class OsmNodeGraphicsItem : public GeoGraphicsItem
+class OsmNodeGraphicsItem : public GeoPointGraphicsItem
{
public:
OsmNodeGraphicsItem();
@@ -27,13 +28,9 @@
virtual void paint( GeoPainter* painter, ViewportParams *viewport,
const QString &renderPos, GeoSceneLayer *layer );
- void setPoint( const GeoDataCoordinates& point );
private:
QPen m_pen;
- //FIXME this should be a GeoDataPoint. In fact there should be a
- // GeoPointGraphicsItem that this class should subclass
- GeoDataCoordinates m_point;
};
}
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/osm/OsmNodeTagHandler.cpp #997169:997170
@@ -32,7 +32,7 @@
qreal lon = parser.attribute("lon").toDouble();
qreal lat = parser.attribute("lat").toDouble();
- item->setPoint( GeoDataCoordinates(lon, lat, 0, GeoDataCoordinates::Degree ) );
+ item->setPoint( GeoDataPoint(lon, lat, 0, GeoDataCoordinates::Degree ) );
parser.activeModel()->append( item );
More information about the Marble-commits
mailing list