[Marble-commits] KDE/kdeedu/marble/src
Torsten Rahn
tackat at t-online.de
Fri Jul 24 02:40:27 CEST 2009
If I were you I'd wait a bit with the implementation of "zoom to new
file loaded". -- At least if you're not just after a "lazy workaround".
I've got a related feature pending that I'd like to implement
within the next few days. :-)
Am Donnerstag 23 Juli 2009 18:04:08 schrieb Andrew Manson:
> 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.cp
>p #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/OsmWayGraphicsIt
>em.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);
>
> _______________________________________________
> Marble-commits mailing list
> Marble-commits at kde.org
> https://mail.kde.org/mailman/listinfo/marble-commits
More information about the Marble-commits
mailing list