[Marble-commits] KDE/kdeedu/marble/src/lib
Jens-Michael Hoffmann
jensmh at gmx.de
Tue Aug 31 21:20:22 CEST 2010
SVN commit 1170390 by jmhoffmann:
AbstractScanlineTextureMapper: Constify some more arguments.
M +9 -9 AbstractScanlineTextureMapper.cpp
M +11 -10 AbstractScanlineTextureMapper.h
--- trunk/KDE/kdeedu/marble/src/lib/AbstractScanlineTextureMapper.cpp #1170389:1170390
@@ -22,9 +22,9 @@
using namespace Marble;
-AbstractScanlineTextureMapper::AbstractScanlineTextureMapper( GeoSceneTexture *textureLayer,
- StackedTileLoader *tileLoader,
- QObject *parent )
+AbstractScanlineTextureMapper::AbstractScanlineTextureMapper( GeoSceneTexture * const textureLayer,
+ StackedTileLoader * const tileLoader,
+ QObject * const parent )
: QObject( parent ),
m_maxGlobalX( 0 ),
m_maxGlobalY( 0 ),
@@ -62,7 +62,7 @@
}
-void AbstractScanlineTextureMapper::selectTileLevel( ViewParams* viewParams )
+void AbstractScanlineTextureMapper::selectTileLevel( ViewParams * const viewParams )
{
const int radius = viewParams->radius();
@@ -116,7 +116,7 @@
void AbstractScanlineTextureMapper::pixelValueF( const qreal lon, const qreal lat,
- QRgb* scanLine )
+ QRgb* const scanLine )
{
// The same method using integers performs about 33% faster.
// However we need the qreal version to create the high quality mode.
@@ -148,7 +148,7 @@
}
void AbstractScanlineTextureMapper::pixelValue( const qreal lon, const qreal lat,
- QRgb* scanLine )
+ QRgb* const scanLine )
{
// The same method using integers performs about 33% faster.
// However we need the qreal version to create the high quality mode.
@@ -191,7 +191,7 @@
// texturemapping, so we move towards integer math to improve speed.
void AbstractScanlineTextureMapper::pixelValueApproxF( const qreal lon, const qreal lat,
- QRgb *scanLine, int n )
+ QRgb *scanLine, const int n )
{
// stepLon/Lat: Distance between two subsequent approximated positions
@@ -332,7 +332,7 @@
void AbstractScanlineTextureMapper::pixelValueApprox( const qreal lon, const qreal lat,
- QRgb *scanLine, int n )
+ QRgb *scanLine, const int n )
{
// stepLon/Lat: Distance between two subsequent approximated positions
@@ -454,7 +454,7 @@
}
-int AbstractScanlineTextureMapper::interpolationStep( ViewParams *viewParams )
+int AbstractScanlineTextureMapper::interpolationStep( ViewParams * const viewParams )
{
if ( viewParams->mapQuality() == PrintQuality ) {
return 1; // Don't interpolate for print quality.
--- trunk/KDE/kdeedu/marble/src/lib/AbstractScanlineTextureMapper.h #1170389:1170390
@@ -35,8 +35,9 @@
Q_OBJECT
public:
- AbstractScanlineTextureMapper( GeoSceneTexture *textureLayer, StackedTileLoader *tileLoader,
- QObject *parent = 0 );
+ AbstractScanlineTextureMapper( GeoSceneTexture * const textureLayer,
+ StackedTileLoader * const tileLoader,
+ QObject * const parent = 0 );
~AbstractScanlineTextureMapper();
virtual void mapTexture( ViewParams *viewParams ) = 0;
@@ -55,16 +56,16 @@
protected:
void pixelValueF( const qreal lon, const qreal lat,
- QRgb* scanLine );
+ QRgb* const scanLine );
void pixelValue( const qreal lon, const qreal lat,
- QRgb* scanLine );
+ QRgb* const scanLine );
void pixelValueApproxF( const qreal lon, const qreal lat,
- QRgb *scanLine, int n );
+ QRgb *scanLine, const int n );
void pixelValueApprox( const qreal lon, const qreal lat,
- QRgb *scanLine, int n );
+ QRgb *scanLine, const int n );
- static int interpolationStep( ViewParams *viewParams );
+ static int interpolationStep( ViewParams * const viewParams );
// method for fast integer calculation
void nextTile( int& posx, int& posy );
@@ -72,7 +73,7 @@
// method for precise interpolation
void nextTile( qreal& posx, qreal& posy );
- void selectTileLevel( ViewParams* viewParams );
+ void selectTileLevel( ViewParams * const viewParams );
void detectMaxTileLevel();
void tileLevelInit( const int tileLevel );
@@ -165,12 +166,12 @@
return m_globalHeight;
}
-inline qreal AbstractScanlineTextureMapper::rad2PixelX( qreal longitude ) const
+inline qreal AbstractScanlineTextureMapper::rad2PixelX( const qreal longitude ) const
{
return longitude * m_normGlobalWidth;
}
-inline qreal AbstractScanlineTextureMapper::rad2PixelY( qreal lat ) const
+inline qreal AbstractScanlineTextureMapper::rad2PixelY( const qreal lat ) const
{
switch ( m_textureLayer->projection() ) {
case GeoSceneTexture::Equirectangular:
More information about the Marble-commits
mailing list