[Marble-commits] KDE/kdeedu/marble/src/plugins/render/osmannotate/osm

Andrew Manson g.real.ate at gmail.com
Tue Jul 14 14:36:20 CEST 2009


SVN commit 996451 by mansona:

implementing displaying OSM nodes as Points and also the OsmNode 
tag handler 


 M  +13 -2     OsmBoundsGraphicsItem.cpp  
 M  +5 -1      OsmBoundsGraphicsItem.h  
 M  +1 -0      OsmElementDictionary.cpp  
 M  +1 -0      OsmElementDictionary.h  
 A             OsmNodeGraphicsItem.cpp   [License: LGPL]
 A             OsmNodeGraphicsItem.h   [License: LGPL]
 A             OsmNodeTagHandler.cpp   [License: LGPL]
 A             OsmNodeTagHandler.h   [License: LGPL]


--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/osm/OsmBoundsGraphicsItem.cpp #996450:996451
@@ -10,12 +10,19 @@
 
 #include "OsmBoundsGraphicsItem.h"
 
+#include "GeoDataLinearRing.h"
+#include "GeoPainter.h"
+
 #include <QtCore/QDebug>
 
 namespace Marble{
 
 OsmBoundsGraphicsItem::OsmBoundsGraphicsItem()
+        : GeoGraphicsItem()
 {
+    m_pen.setColor( Qt::black );
+    m_pen.setStyle( Qt::SolidLine );
+    m_pen.setWidth( 1 );
 }
 
 void OsmBoundsGraphicsItem::append( const GeoDataCoordinates& value )
@@ -26,12 +33,16 @@
 void OsmBoundsGraphicsItem::paint( GeoPainter* painter, ViewportParams * viewport,
                                    const QString &renderPos, GeoSceneLayer* layer )
 {
-
     Q_UNUSED( renderPos )
     Q_UNUSED( layer )
 
-    qDebug() << "Painting from OSMBounds";
+    painter->save();
+    painter->setPen( m_pen );
 
+    painter->drawPolygon( GeoDataLinearRing(m_lineString) );
+
+    painter->restore();
+
 }
 
 }
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/osm/OsmBoundsGraphicsItem.h #996450:996451
@@ -13,14 +13,17 @@
 
 #include "GeoDataLineString.h"
 #include "GeoDataGeometry.h"
+#include "GeoGraphicsItem.h"
 
+#include <QtGui/QPen>
+
 namespace Marble{
 
 class GeoPainter;
 class ViewportParams;
 class GeoSceneLayer;
 
-class OsmBoundsGraphicsItem
+class OsmBoundsGraphicsItem : public GeoGraphicsItem
 {
 public:
     OsmBoundsGraphicsItem();
@@ -32,6 +35,7 @@
                         const QString &renderPos, GeoSceneLayer *layer );
 private:
     GeoDataLineString m_lineString;
+    QPen    m_pen;
 };
 
 }
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/osm/OsmElementDictionary.cpp #996450:996451
@@ -18,6 +18,7 @@
     const char* osmTag_osm = "osm";
 
     const char* osmTag_bounds = "bounds";
+    const char* osmTag_node = "node";
 
 }
 
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/osm/OsmElementDictionary.h #996450:996451
@@ -19,6 +19,7 @@
     extern const char* osmTag_osm;
 
     extern const char* osmTag_bounds;
+    extern const char* osmTag_node;
 
 }
 


More information about the Marble-commits mailing list