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

Andrew Manson g.real.ate at gmail.com
Fri Jul 24 08:51:57 CEST 2009


If you want to take charge of this Torsten that is cool with me. I have 
however pretty much worked out how to get the right parameters needed to 
decide what the radius of the globe should be based on the bounding of the file 
that has been loaded. I was quite interested in just attempting a solution to 
see if my maths skills are up to scratch, of course I will make the changes 
minimal so that they can be undone or I could submit a patch for review? 

Of course, like I said, if you want to take charge on this one then be my 
guest ;) 

- Andrew 

On Friday 24 July 2009 01:40:27 Torsten Rahn wrote:
> 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/OsmWayGraphics
> >It 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/OsmWayTagHandl
> >er .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
>
> _______________________________________________
> 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