Skip to content
Permalink
Browse files
Fix naming of reverse coordinate transform enum
git-svn-id: http://svn.osgeo.org/qgis/trunk@9498 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Oct 19, 2008
1 parent 2fe497f commit ba986011cdcae9f42ea6b02c285a9fc24348e78a
Showing with 12 additions and 12 deletions.
  1. +1 −1 python/core/qgscoordinatetransform.sip
  2. +4 −4 src/core/qgscoordinatetransform.cpp
  3. +1 −1 src/core/qgscoordinatetransform.h
  4. +6 −6 src/core/qgsmaprenderer.cpp
@@ -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. */
};

/*!
@@ -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 )
{
@@ -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. */
};

/*!
@@ -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 )
{

0 comments on commit ba98601

Please sign in to comment.