[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/marble/src/lib/geodata
From:       Bernhard Beschow <bbeschow () cs ! tu-berlin ! de>
Date:       2010-06-20 9:11:25
Message-ID: 20100620091125.11BE4AC8D9 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1140314 by beschow:

create GeoSceneTexture::Projection value in GeoSceneTexture instead of in the parser

TODO: remove the m_tileProjection from AbstractScanlineTextureMapper, then \
GeoSceneTexture will be the only place where GeoSceneTexture::Projection values are \
created

 M  +1 -9      handlers/dgml/DgmlProjectionTagHandler.cpp  
 M  +9 -2      scene/GeoSceneTexture.cpp  
 M  +1 -1      scene/GeoSceneTexture.h  


--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlProjectionTagHandler.cpp \
#1140313:1140314 @@ -46,17 +46,9 @@
 
     // Attribute name, default to "Equirectangular"
     const QString nameStr = parser.attribute( dgmlAttr_name ).trimmed();
-    if ( !nameStr.isEmpty() ) {
-        GeoSceneTexture::Projection projection = GeoSceneTexture::Equirectangular;
-        if ( nameStr == "Equirectangular" )
-            projection = GeoSceneTexture::Equirectangular;
-        else if ( nameStr == "Mercator" )
-            projection = GeoSceneTexture::Mercator;
-        else
+    if ( !parentItem.nodeAs<GeoSceneTexture>()->setProjection( nameStr ) )
             parser.raiseWarning( QString( "Value not allowed for attribute name: %1" \
).arg( nameStr ));  
-        parentItem.nodeAs<GeoSceneTexture>()->setProjection( projection );
-    }
     return 0;
 }
 
--- trunk/KDE/kdeedu/marble/src/lib/geodata/scene/GeoSceneTexture.cpp \
#1140313:1140314 @@ -118,9 +118,16 @@
     return m_projection;
 }
 
-void GeoSceneTexture::setProjection( const Projection projection )
+bool GeoSceneTexture::setProjection( const QString &name )
 {
-    m_projection = projection;
+    if ( name == "Equirectangular" )
+        m_projection = GeoSceneTexture::Equirectangular;
+    else if ( name == "Mercator" )
+        m_projection = GeoSceneTexture::Mercator;
+    else
+        return false;
+
+    return true;
 }
 
 QUrl GeoSceneTexture::downloadUrl( const TileId &id )
--- trunk/KDE/kdeedu/marble/src/lib/geodata/scene/GeoSceneTexture.h #1140313:1140314
@@ -73,7 +73,7 @@
     void setMaximumTileLevel( const int );
 
     Projection projection() const;
-    void setProjection( const Projection );
+    bool setProjection( const QString &name );
 
     Blending const * blending() const;
     void setBlending( Blending const * const );


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic