From ba986011cdcae9f42ea6b02c285a9fc24348e78a Mon Sep 17 00:00:00 2001 From: timlinux Date: Sun, 19 Oct 2008 20:16:08 +0000 Subject: [PATCH] Fix naming of reverse coordinate transform enum git-svn-id: http://svn.osgeo.org/qgis/trunk@9498 c8812cc2-4d05-0410-92ff-de0c093fc19c --- python/core/qgscoordinatetransform.sip | 2 +- src/core/qgscoordinatetransform.cpp | 8 ++++---- src/core/qgscoordinatetransform.h | 2 +- src/core/qgsmaprenderer.cpp | 12 ++++++------ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/python/core/qgscoordinatetransform.sip b/python/core/qgscoordinatetransform.sip index f5939f9cd63..9a5efa18668 100644 --- a/python/core/qgscoordinatetransform.sip +++ b/python/core/qgscoordinatetransform.sip @@ -57,7 +57,7 @@ class QgsCoordinateTransform : QObject //! Enum used to indicate the direction (forward or inverse) of the transform enum TransformDirection{ ForwardTransform, /*!< Transform from source to destination CRS. */ - INVERSE /*!< Transform from destination to source CRS. */ + ReverseTransform /*!< Transform from destination to source CRS. */ }; /*! diff --git a/src/core/qgscoordinatetransform.cpp b/src/core/qgscoordinatetransform.cpp index 80238989e81..335d620190a 100644 --- a/src/core/qgscoordinatetransform.cpp +++ b/src/core/qgscoordinatetransform.cpp @@ -436,7 +436,7 @@ void QgsCoordinateTransform::transformCoords( const int& numPoints, double *x, d QString dir; // if the source/destination projection is lat/long, convert the points to radians // prior to transforming - if (( pj_is_latlong( mDestinationProjection ) && ( direction == INVERSE ) ) + if (( pj_is_latlong( mDestinationProjection ) && ( direction == ReverseTransform ) ) || ( pj_is_latlong( mSourceProjection ) && ( direction == ForwardTransform ) ) ) { for ( int i = 0; i < numPoints; ++i ) @@ -448,10 +448,10 @@ void QgsCoordinateTransform::transformCoords( const int& numPoints, double *x, d } int projResult; - if ( direction == INVERSE ) + if ( direction == ReverseTransform ) { #if 0 - QgsDebugMsg( "!!!! INVERSE PROJ4 TRANSFORM !!!!" ); + QgsDebugMsg( "!!!! ReverseTransform PROJ4 TRANSFORM !!!!" ); QgsDebugMsg( QString( " numPoint: %1" ).arg( numPoints ) ); QgsDebugMsg( QString( " x : %1" ).arg( x ) ); QgsDebugMsg( QString( " y : %1" ).arg( y ) ); @@ -505,7 +505,7 @@ void QgsCoordinateTransform::transformCoords( const int& numPoints, double *x, d // if the result is lat/long, convert the results from radians back // to degrees if (( pj_is_latlong( mDestinationProjection ) && ( direction == ForwardTransform ) ) - || ( pj_is_latlong( mSourceProjection ) && ( direction == INVERSE ) ) ) + || ( pj_is_latlong( mSourceProjection ) && ( direction == ReverseTransform ) ) ) { for ( int i = 0; i < numPoints; ++i ) { diff --git a/src/core/qgscoordinatetransform.h b/src/core/qgscoordinatetransform.h index e7a97fd7935..cc165d06f98 100644 --- a/src/core/qgscoordinatetransform.h +++ b/src/core/qgscoordinatetransform.h @@ -92,7 +92,7 @@ class CORE_EXPORT QgsCoordinateTransform: public QObject enum TransformDirection { ForwardTransform, /*!< Transform from source to destination CRS. */ - INVERSE /*!< Transform from destination to source CRS. */ + ReverseTransform /*!< Transform from destination to source CRS. */ }; /*! diff --git a/src/core/qgsmaprenderer.cpp b/src/core/qgsmaprenderer.cpp index 234fa5c79ad..ef516bf55c7 100644 --- a/src/core/qgsmaprenderer.cpp +++ b/src/core/qgsmaprenderer.cpp @@ -518,10 +518,10 @@ bool QgsMapRenderer::splitLayersExtent( QgsMapLayer* layer, QgsRect& extent, Qgs // Note: ll = lower left point // and ur = upper right point QgsPoint ll = tr.transform( extent.xMin(), extent.yMin(), - QgsCoordinateTransform::INVERSE ); + QgsCoordinateTransform::ReverseTransform ); QgsPoint ur = tr.transform( extent.xMax(), extent.yMax(), - QgsCoordinateTransform::INVERSE ); + QgsCoordinateTransform::ReverseTransform ); if ( ll.x() > ur.x() ) { @@ -531,12 +531,12 @@ bool QgsMapRenderer::splitLayersExtent( QgsMapLayer* layer, QgsRect& extent, Qgs } else // no need to split { - extent = tr.transformBoundingBox( extent, QgsCoordinateTransform::INVERSE ); + extent = tr.transformBoundingBox( extent, QgsCoordinateTransform::ReverseTransform ); } } else // can't cross 180 { - extent = tr.transformBoundingBox( extent, QgsCoordinateTransform::INVERSE ); + extent = tr.transformBoundingBox( extent, QgsCoordinateTransform::ReverseTransform ); } } catch ( QgsCsException &cse ) @@ -601,7 +601,7 @@ QgsPoint QgsMapRenderer::mapToLayerCoordinates( QgsMapLayer* theLayer, QgsPoint try { QgsCoordinateTransform tr( theLayer->srs(), *mDestCRS ); - point = tr.transform( point, QgsCoordinateTransform::INVERSE ); + point = tr.transform( point, QgsCoordinateTransform::ReverseTransform ); } catch ( QgsCsException &cse ) { @@ -623,7 +623,7 @@ QgsRect QgsMapRenderer::mapToLayerCoordinates( QgsMapLayer* theLayer, QgsRect re try { QgsCoordinateTransform tr( theLayer->srs(), *mDestCRS ); - rect = tr.transform( rect, QgsCoordinateTransform::INVERSE ); + rect = tr.transform( rect, QgsCoordinateTransform::ReverseTransform ); } catch ( QgsCsException &cse ) {