Skip to content

Commit 1c6205e

Browse files
author
timlinux
committed
Fix naming of reverse coordinate transform enum
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9498 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 21ddc0e commit 1c6205e

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

python/core/qgscoordinatetransform.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class QgsCoordinateTransform : QObject
5757
//! Enum used to indicate the direction (forward or inverse) of the transform
5858
enum TransformDirection{
5959
ForwardTransform, /*!< Transform from source to destination CRS. */
60-
INVERSE /*!< Transform from destination to source CRS. */
60+
ReverseTransform /*!< Transform from destination to source CRS. */
6161
};
6262

6363
/*!

src/core/qgscoordinatetransform.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ void QgsCoordinateTransform::transformCoords( const int& numPoints, double *x, d
436436
QString dir;
437437
// if the source/destination projection is lat/long, convert the points to radians
438438
// prior to transforming
439-
if (( pj_is_latlong( mDestinationProjection ) && ( direction == INVERSE ) )
439+
if (( pj_is_latlong( mDestinationProjection ) && ( direction == ReverseTransform ) )
440440
|| ( pj_is_latlong( mSourceProjection ) && ( direction == ForwardTransform ) ) )
441441
{
442442
for ( int i = 0; i < numPoints; ++i )
@@ -448,10 +448,10 @@ void QgsCoordinateTransform::transformCoords( const int& numPoints, double *x, d
448448

449449
}
450450
int projResult;
451-
if ( direction == INVERSE )
451+
if ( direction == ReverseTransform )
452452
{
453453
#if 0
454-
QgsDebugMsg( "!!!! INVERSE PROJ4 TRANSFORM !!!!" );
454+
QgsDebugMsg( "!!!! ReverseTransform PROJ4 TRANSFORM !!!!" );
455455
QgsDebugMsg( QString( " numPoint: %1" ).arg( numPoints ) );
456456
QgsDebugMsg( QString( " x : %1" ).arg( x ) );
457457
QgsDebugMsg( QString( " y : %1" ).arg( y ) );
@@ -505,7 +505,7 @@ void QgsCoordinateTransform::transformCoords( const int& numPoints, double *x, d
505505
// if the result is lat/long, convert the results from radians back
506506
// to degrees
507507
if (( pj_is_latlong( mDestinationProjection ) && ( direction == ForwardTransform ) )
508-
|| ( pj_is_latlong( mSourceProjection ) && ( direction == INVERSE ) ) )
508+
|| ( pj_is_latlong( mSourceProjection ) && ( direction == ReverseTransform ) ) )
509509
{
510510
for ( int i = 0; i < numPoints; ++i )
511511
{

src/core/qgscoordinatetransform.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class CORE_EXPORT QgsCoordinateTransform: public QObject
9292
enum TransformDirection
9393
{
9494
ForwardTransform, /*!< Transform from source to destination CRS. */
95-
INVERSE /*!< Transform from destination to source CRS. */
95+
ReverseTransform /*!< Transform from destination to source CRS. */
9696
};
9797

9898
/*!

src/core/qgsmaprenderer.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -518,10 +518,10 @@ bool QgsMapRenderer::splitLayersExtent( QgsMapLayer* layer, QgsRect& extent, Qgs
518518
// Note: ll = lower left point
519519
// and ur = upper right point
520520
QgsPoint ll = tr.transform( extent.xMin(), extent.yMin(),
521-
QgsCoordinateTransform::INVERSE );
521+
QgsCoordinateTransform::ReverseTransform );
522522

523523
QgsPoint ur = tr.transform( extent.xMax(), extent.yMax(),
524-
QgsCoordinateTransform::INVERSE );
524+
QgsCoordinateTransform::ReverseTransform );
525525

526526
if ( ll.x() > ur.x() )
527527
{
@@ -531,12 +531,12 @@ bool QgsMapRenderer::splitLayersExtent( QgsMapLayer* layer, QgsRect& extent, Qgs
531531
}
532532
else // no need to split
533533
{
534-
extent = tr.transformBoundingBox( extent, QgsCoordinateTransform::INVERSE );
534+
extent = tr.transformBoundingBox( extent, QgsCoordinateTransform::ReverseTransform );
535535
}
536536
}
537537
else // can't cross 180
538538
{
539-
extent = tr.transformBoundingBox( extent, QgsCoordinateTransform::INVERSE );
539+
extent = tr.transformBoundingBox( extent, QgsCoordinateTransform::ReverseTransform );
540540
}
541541
}
542542
catch ( QgsCsException &cse )
@@ -601,7 +601,7 @@ QgsPoint QgsMapRenderer::mapToLayerCoordinates( QgsMapLayer* theLayer, QgsPoint
601601
try
602602
{
603603
QgsCoordinateTransform tr( theLayer->srs(), *mDestCRS );
604-
point = tr.transform( point, QgsCoordinateTransform::INVERSE );
604+
point = tr.transform( point, QgsCoordinateTransform::ReverseTransform );
605605
}
606606
catch ( QgsCsException &cse )
607607
{
@@ -623,7 +623,7 @@ QgsRect QgsMapRenderer::mapToLayerCoordinates( QgsMapLayer* theLayer, QgsRect re
623623
try
624624
{
625625
QgsCoordinateTransform tr( theLayer->srs(), *mDestCRS );
626-
rect = tr.transform( rect, QgsCoordinateTransform::INVERSE );
626+
rect = tr.transform( rect, QgsCoordinateTransform::ReverseTransform );
627627
}
628628
catch ( QgsCsException &cse )
629629
{

0 commit comments

Comments
 (0)