[Marble-commits] KDE/kdeedu/marble/src/lib
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Fri Dec 31 14:34:55 CET 2010
SVN commit 1210457 by beschow:
cleanup AbstractScanlineTextureMapper: merge selectTileLevel(), tileLevelInit(), initGlobalWidth(), and initGlobalHeight() into setRadius()
M +5 -23 AbstractScanlineTextureMapper.cpp
M +1 -5 AbstractScanlineTextureMapper.h
M +1 -1 EquirectScanlineTextureMapper.cpp
M +1 -1 MercatorScanlineTextureMapper.cpp
M +1 -1 SphericalScanlineTextureMapper.cpp
M +1 -1 TileScalingTextureMapper.cpp
--- trunk/KDE/kdeedu/marble/src/lib/AbstractScanlineTextureMapper.cpp #1210456:1210457
@@ -53,10 +53,8 @@
}
-void AbstractScanlineTextureMapper::selectTileLevel( ViewParams * const viewParams )
+void AbstractScanlineTextureMapper::setRadius( int radius )
{
- const int radius = viewParams->radius();
-
// As our tile resolution doubles with each level we calculate
// the tile level from tilesize and the globe radius via log(2)
@@ -77,19 +75,14 @@
if ( tileLevel != m_tileLevel ) {
m_tileLoader->flush();
- tileLevelInit( tileLevel );
- }
-}
-
-void AbstractScanlineTextureMapper::tileLevelInit( const int tileLevel )
-{
// mDebug() << "Texture Level was set to: " << tileLevel;
m_tileLevel = tileLevel;
- initGlobalWidth();
+ m_globalWidth = m_tileSize.width() * m_tileLoader->tileColumnCount( m_tileLevel );
m_normGlobalWidth = (qreal)( m_globalWidth / ( 2 * M_PI ) );
- initGlobalHeight();
+
+ m_globalHeight = m_tileSize.height() * m_tileLoader->tileRowCount( m_tileLevel );
m_normGlobalHeight = (qreal)( m_globalHeight / M_PI );
m_maxGlobalX = m_globalWidth - 1;
@@ -104,6 +97,7 @@
emit tileLevelChanged( m_tileLevel );
}
+}
void AbstractScanlineTextureMapper::pixelValueF( const qreal lon, const qreal lat,
@@ -553,16 +547,4 @@
posY = lat - m_tilePosY;
}
-void AbstractScanlineTextureMapper::initGlobalWidth()
-{
- m_globalWidth = m_tileSize.width()
- * m_tileLoader->tileColumnCount( m_tileLevel );
-}
-
-void AbstractScanlineTextureMapper::initGlobalHeight()
-{
- m_globalHeight = m_tileSize.height()
- * m_tileLoader->tileRowCount( m_tileLevel );
-}
-
#include "AbstractScanlineTextureMapper.moc"
--- trunk/KDE/kdeedu/marble/src/lib/AbstractScanlineTextureMapper.h #1210456:1210457
@@ -67,8 +67,7 @@
// method for precise interpolation
void nextTile( qreal& posx, qreal& posy );
- void selectTileLevel( ViewParams * const viewParams );
- void tileLevelInit( const int tileLevel );
+ void setRadius( int radius );
int globalWidth() const;
int globalHeight() const;
@@ -120,9 +119,6 @@
private:
Q_DISABLE_COPY( AbstractScanlineTextureMapper )
- void initGlobalWidth();
- void initGlobalHeight();
-
StackedTile *m_tile;
int m_previousRadius;
--- trunk/KDE/kdeedu/marble/src/lib/EquirectScanlineTextureMapper.cpp #1210456:1210457
@@ -64,7 +64,7 @@
// Reset backend
m_tileLoader->resetTilehash();
- selectTileLevel( viewParams );
+ setRadius( viewParams->radius() );
// Evaluate the degree of interpolation
const int n = interpolationStep( viewParams );
--- trunk/KDE/kdeedu/marble/src/lib/MercatorScanlineTextureMapper.cpp #1210456:1210457
@@ -68,7 +68,7 @@
// Reset backend
m_tileLoader->resetTilehash();
- selectTileLevel( viewParams );
+ setRadius( viewParams->radius() );
// Evaluate the degree of interpolation
const int n = interpolationStep( viewParams );
--- trunk/KDE/kdeedu/marble/src/lib/SphericalScanlineTextureMapper.cpp #1210456:1210457
@@ -60,7 +60,7 @@
// Reset backend
m_tileLoader->resetTilehash();
- selectTileLevel( viewParams );
+ setRadius( viewParams->radius() );
// Evaluate the degree of interpolation
const int n = interpolationStep( viewParams );
--- trunk/KDE/kdeedu/marble/src/lib/TileScalingTextureMapper.cpp #1210456:1210457
@@ -57,7 +57,7 @@
// Reset backend
m_tileLoader->resetTilehash();
- selectTileLevel( viewParams );
+ setRadius( viewParams->radius() );
// Calculate translation of center point
qreal centerLon, centerLat;
More information about the Marble-commits
mailing list