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

Andrew Manson g.real.ate at gmail.com
Thu Jul 23 18:04:08 CEST 2009


SVN commit 1001551 by mansona:

working on getting marble to zoom to new file loaded. and also fixed a 
spelling mistake. 


 M  +2 -0      lib/GeoGraphicsItem.cpp  
 M  +1 -1      lib/GeoGraphicsItem.h  
 M  +15 -5     plugins/render/osmannotate/OsmAnnotatePlugin.cpp  
 M  +5 -1      plugins/render/osmannotate/osm/OsmWayGraphicsItem.cpp  
 M  +1 -1      plugins/render/osmannotate/osm/OsmWayTagHandler.cpp  


--- trunk/KDE/kdeedu/marble/src/lib/GeoGraphicsItem.cpp #1001550:1001551
@@ -23,11 +23,13 @@
 GeoGraphicsItem::GeoGraphicsItem()
     : MarbleGraphicsItem( new GeoGraphicsItemPrivate )
 {
+    setFlag( ItemIsVisible, true );
 }
 
 GeoGraphicsItem::GeoGraphicsItem( GeoGraphicsItemPrivate *d_ptr )
     : MarbleGraphicsItem( d_ptr )
 {
+    setFlag( ItemIsVisible, true );
 }
 
 GeoGraphicsItem::~GeoGraphicsItem() {
--- trunk/KDE/kdeedu/marble/src/lib/GeoGraphicsItem.h #1001550:1001551
@@ -42,7 +42,7 @@
         NoOptions = 0x0,
         ItemIsMovable = 0x1,
         ItemIsSelectable = 0x2,
-        ItemIsVisable = 0x4
+        ItemIsVisible = 0x4
     };
 
     Q_DECLARE_FLAGS(GeoGraphicsItemFlags, GeoGraphicsItemFlag)
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/OsmAnnotatePlugin.cpp #1001550:1001551
@@ -29,11 +29,9 @@
 #include "GeoPainter.h"
 #include "GeoDataDocument.h"
 #include "GeoDataCoordinates.h"
-#include "GeoDataLineString.h"
-#include "GeoDataLinearRing.h"
-#include "GeoDataPlacemark.h"
 #include "GeoDataParser.h"
 #include "MarbleWidget.h"
+#include "osm/OsmBoundsGraphicsItem.h"
 #include "PlacemarkTextAnnotation.h"
 
 namespace Marble
@@ -142,7 +140,7 @@
 
         while( it.hasNext() ) {
             GeoGraphicsItem* i = it.next();
-            if( i->flags() & GeoGraphicsItem::ItemIsVisable ) {
+            if( i->flags() & GeoGraphicsItem::ItemIsVisible ) {
                 i->paint( painter, viewport, renderPos, layer );
             }
         }
@@ -210,7 +208,19 @@
 
         file.close();
 
-        qDebug() << "size of container is " << model->size();
+        // now zoom to the newly added OSM file
+        if( m_itemModel->size() > 0 ) {
+            OsmBoundsGraphicsItem* item;
+            // mostly guarenteed that the first item will be a bounds item
+            item = dynamic_cast<OsmBoundsGraphicsItem*>( m_itemModel->first() );
+            if( item ) {
+                //get the place to zoom to
+                qDebug() << item->coordinate().toString();
+                //get the zoom level
+                // difficult?
+            }
+        }
+
     }
 }
 
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/osm/OsmWayGraphicsItem.cpp #1001550:1001551
@@ -29,7 +29,11 @@
 {
     m_nodeIdList.append( reference );
     if( osm::OsmNodeTagHandler::nodeRef.contains( reference ) ) {
-        append( osm::OsmNodeTagHandler::nodeRef.value( reference )->point() );
+        OsmNodeGraphicsItem* node = osm::OsmNodeTagHandler::nodeRef.value( reference );
+        append( node->point() );
+        //make node invisible only if its in a way
+        node->setFlag( GeoGraphicsItem::ItemIsVisible, false );
+
     }
 }
 
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/osm/OsmWayTagHandler.cpp #1001550:1001551
@@ -29,7 +29,7 @@
     GeoNode* result;
     OsmWayGraphicsItem* way = new OsmWayGraphicsItem();
 
-    way->setFlag( GeoGraphicsItem::ItemIsVisable );
+    way->setFlag( GeoGraphicsItem::ItemIsVisible );
 
     parser.activeModel()->append(way);
 


More information about the Marble-commits mailing list