Skip to content

Commit

Permalink
Fix naming of reverse coordinate transform enum
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9498 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Oct 19, 2008
1 parent 21ddc0e commit 1c6205e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion python/core/qgscoordinatetransform.sip
Expand Up @@ -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. */
};

/*!
Expand Down
8 changes: 4 additions & 4 deletions src/core/qgscoordinatetransform.cpp
Expand Up @@ -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 )
Expand All @@ -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 ) );
Expand Down Expand Up @@ -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 )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgscoordinatetransform.h
Expand Up @@ -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. */
};

/*!
Expand Down
12 changes: 6 additions & 6 deletions src/core/qgsmaprenderer.cpp
Expand Up @@ -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() )
{
Expand All @@ -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 )
Expand Down Expand Up @@ -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 )
{
Expand All @@ -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 )
{
Expand Down

0 comments on commit 1c6205e

Please sign in to comment.