[Marble-commits] branches/KDE/4.6/kdeedu/marble/src/lib
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Wed Dec 29 23:03:53 CET 2010
SVN commit 1210170 by beschow:
backport of trunk-r1209175: don't use GeoSceneTextures in texture mappers and the TextureLayer
* use StackedTileLoader instead
M +4 -8 AbstractScanlineTextureMapper.cpp
M +1 -3 AbstractScanlineTextureMapper.h
M +2 -3 EquirectScanlineTextureMapper.cpp
M +2 -2 EquirectScanlineTextureMapper.h
M +2 -3 MercatorScanlineTextureMapper.cpp
M +2 -2 MercatorScanlineTextureMapper.h
M +2 -3 SphericalScanlineTextureMapper.cpp
M +1 -2 SphericalScanlineTextureMapper.h
M +0 -1 StackedTileLoader.cpp
M +5 -26 TextureLayer.cpp
--- branches/KDE/4.6/kdeedu/marble/src/lib/AbstractScanlineTextureMapper.cpp #1210169:1210170
@@ -22,8 +22,7 @@
using namespace Marble;
-AbstractScanlineTextureMapper::AbstractScanlineTextureMapper( GeoSceneTexture * const textureLayer,
- StackedTileLoader * const tileLoader,
+AbstractScanlineTextureMapper::AbstractScanlineTextureMapper( StackedTileLoader * const tileLoader,
QObject * const parent )
: QObject( parent ),
m_maxGlobalX( 0 ),
@@ -44,8 +43,7 @@
m_globalWidth( 0 ),
m_globalHeight( 0 ),
m_normGlobalWidth( 0.0 ),
- m_normGlobalHeight( 0.0 ),
- m_mapThemeIdHash( qHash( textureLayer->sourceDir() ) )
+ m_normGlobalHeight( 0.0 )
{
Q_ASSERT( textureLayer ); // just for documentation
}
@@ -499,8 +497,7 @@
int tileCol = lon / m_tileSize.width();
int tileRow = lat / m_tileSize.height();
- m_tile = m_tileLoader->loadTile( TileId( m_mapThemeIdHash, m_tileLevel, tileCol, tileRow ),
- DownloadBrowse );
+ m_tile = m_tileLoader->loadTile( TileId( 0, m_tileLevel, tileCol, tileRow ), DownloadBrowse );
m_tile->setUsed( true );
// Update position variables:
@@ -540,8 +537,7 @@
int tileCol = lon / m_tileSize.width();
int tileRow = lat / m_tileSize.height();
- m_tile = m_tileLoader->loadTile( TileId( m_mapThemeIdHash, m_tileLevel, tileCol, tileRow ),
- DownloadBrowse );
+ m_tile = m_tileLoader->loadTile( TileId( 0, m_tileLevel, tileCol, tileRow ), DownloadBrowse );
m_tile->setUsed( true );
// Update position variables:
--- branches/KDE/4.6/kdeedu/marble/src/lib/AbstractScanlineTextureMapper.h #1210169:1210170
@@ -35,8 +35,7 @@
Q_OBJECT
public:
- AbstractScanlineTextureMapper( GeoSceneTexture * const textureLayer,
- StackedTileLoader * const tileLoader,
+ AbstractScanlineTextureMapper( StackedTileLoader * const tileLoader,
QObject * const parent = 0 );
~AbstractScanlineTextureMapper();
@@ -131,7 +130,6 @@
int m_globalHeight;
qreal m_normGlobalWidth;
qreal m_normGlobalHeight;
- uint m_mapThemeIdHash;
};
inline bool AbstractScanlineTextureMapper::interlaced() const
--- branches/KDE/4.6/kdeedu/marble/src/lib/EquirectScanlineTextureMapper.cpp #1210169:1210170
@@ -28,10 +28,9 @@
using namespace Marble;
-EquirectScanlineTextureMapper::EquirectScanlineTextureMapper( GeoSceneTexture *textureLayer,
- StackedTileLoader *tileLoader,
+EquirectScanlineTextureMapper::EquirectScanlineTextureMapper( StackedTileLoader *tileLoader,
QObject *parent )
- : AbstractScanlineTextureMapper( textureLayer, tileLoader, parent ),
+ : AbstractScanlineTextureMapper( tileLoader, parent ),
m_oldCenterLon( 0.0 ),
m_oldYPaintedTop( 0 )
{
--- branches/KDE/4.6/kdeedu/marble/src/lib/EquirectScanlineTextureMapper.h #1210169:1210170
@@ -23,8 +23,8 @@
Q_OBJECT
public:
- EquirectScanlineTextureMapper( GeoSceneTexture *textureLayer, StackedTileLoader *tileLoader,
- QObject *parent = 0 );
+ EquirectScanlineTextureMapper( StackedTileLoader *tileLoader, QObject *parent = 0 );
+
void mapTexture( ViewParams *viewParams );
private:
--- branches/KDE/4.6/kdeedu/marble/src/lib/MercatorScanlineTextureMapper.cpp #1210169:1210170
@@ -30,10 +30,9 @@
using namespace Marble;
-MercatorScanlineTextureMapper::MercatorScanlineTextureMapper( GeoSceneTexture *textureLayer,
- StackedTileLoader *tileLoader,
+MercatorScanlineTextureMapper::MercatorScanlineTextureMapper( StackedTileLoader *tileLoader,
QObject *parent )
- : AbstractScanlineTextureMapper( textureLayer, tileLoader, parent ),
+ : AbstractScanlineTextureMapper( tileLoader, parent ),
m_oldCenterLon( 0.0 ),
m_oldYPaintedTop( 0 )
{
--- branches/KDE/4.6/kdeedu/marble/src/lib/MercatorScanlineTextureMapper.h #1210169:1210170
@@ -23,8 +23,8 @@
Q_OBJECT
public:
- MercatorScanlineTextureMapper( GeoSceneTexture *textureLayer, StackedTileLoader *tileLoader,
- QObject *parent = 0 );
+ MercatorScanlineTextureMapper( StackedTileLoader *tileLoader, QObject *parent = 0 );
+
void mapTexture( ViewParams *viewParams );
private:
--- branches/KDE/4.6/kdeedu/marble/src/lib/SphericalScanlineTextureMapper.cpp #1210169:1210170
@@ -27,10 +27,9 @@
using namespace Marble;
-SphericalScanlineTextureMapper::SphericalScanlineTextureMapper( GeoSceneTexture *textureLayer,
- StackedTileLoader *tileLoader,
+SphericalScanlineTextureMapper::SphericalScanlineTextureMapper( StackedTileLoader *tileLoader,
QObject *parent )
- : AbstractScanlineTextureMapper( textureLayer, tileLoader, parent )
+ : AbstractScanlineTextureMapper( tileLoader, parent )
{
m_interlaced = false;
}
--- branches/KDE/4.6/kdeedu/marble/src/lib/SphericalScanlineTextureMapper.h #1210169:1210170
@@ -35,8 +35,7 @@
class SphericalScanlineTextureMapper : public AbstractScanlineTextureMapper
{
public:
- SphericalScanlineTextureMapper( GeoSceneTexture *textureLayer, StackedTileLoader *tileLoader,
- QObject *parent = 0 );
+ SphericalScanlineTextureMapper( StackedTileLoader *tileLoader, QObject *parent = 0 );
void mapTexture( ViewParams *viewParams );
--- branches/KDE/4.6/kdeedu/marble/src/lib/StackedTileLoader.cpp #1210169:1210170
@@ -37,7 +37,6 @@
#include "MarbleDirs.h"
#include "MergedLayerDecorator.h"
#include "StackedTile.h"
-#include "TextureLayer.h"
#include "TextureTile.h"
#include "TileLoader.h"
#include "TileLoaderHelper.h"
--- branches/KDE/4.6/kdeedu/marble/src/lib/TextureLayer.cpp #1210169:1210170
@@ -47,7 +47,6 @@
void updateTextureLayers();
const GeoSceneLayer *sceneLayer() const;
- GeoSceneTexture *textureLayer() const;
GeoSceneGroup *textureLayerSettings() const;
public:
@@ -119,23 +118,6 @@
return map->layer( head->theme() );
}
-GeoSceneTexture* TextureLayer::Private::textureLayer() const
-{
- if ( !m_mapTheme )
- return 0;
- if ( !m_mapTheme->map()->hasTextureLayers() )
- return 0;
-
- // As long as we don't have an Layer Management Class we just lookup
- // the name of the layer that has the same name as the theme Id
- const QString themeId = m_mapTheme->head()->theme();
- GeoSceneLayer * const layer = static_cast<GeoSceneLayer*>( m_mapTheme->map()->layer( themeId ));
- if ( !layer )
- return 0;
-
- return static_cast<GeoSceneTexture*>( layer->groundDataset() );
-}
-
GeoSceneGroup* TextureLayer::Private::textureLayerSettings() const
{
if ( !m_mapTheme )
@@ -237,16 +219,13 @@
switch( projection ) {
case Spherical:
- d->m_texmapper = new SphericalScanlineTextureMapper( d->textureLayer(), &d->m_tileLoader,
- this );
+ d->m_texmapper = new SphericalScanlineTextureMapper( &d->m_tileLoader, this );
break;
case Equirectangular:
- d->m_texmapper = new EquirectScanlineTextureMapper( d->textureLayer(), &d->m_tileLoader,
- this );
+ d->m_texmapper = new EquirectScanlineTextureMapper( &d->m_tileLoader, this );
break;
case Mercator:
- d->m_texmapper = new MercatorScanlineTextureMapper( d->textureLayer(), &d->m_tileLoader,
- this );
+ d->m_texmapper = new MercatorScanlineTextureMapper( &d->m_tileLoader, this );
break;
default:
d->m_texmapper = 0;
@@ -342,12 +321,12 @@
QSize TextureLayer::tileSize() const
{
- return d->textureLayer()->tileSize();
+ return d->m_tileLoader.tileSize();
}
GeoSceneTexture::Projection TextureLayer::tileProjection() const
{
- return d->textureLayer()->projection();
+ return d->m_tileLoader.tileProjection();
}
int TextureLayer::tileColumnCount( int level ) const
More information about the Marble-commits
mailing list