Skip to content

Commit

Permalink
use wkbPtr
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jan 9, 2015
1 parent e2e47d7 commit e8aedcb
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions src/core/qgsgeometry.cpp
Expand Up @@ -4628,41 +4628,25 @@ void QgsGeometry::transformVertex( QgsWkbPtr &wkbPtr, const QTransform& trans, b
double x, y, rotated_x, rotated_y;

QgsWkbPtr tmp = wkbPtr;

memcpy( &x, tmp, sizeof( double ) );
tmp += sizeof( double );
memcpy( &y, tmp, sizeof( double ) );
tmp += sizeof( double );

tmp >> x >> y;
trans.map( x, y, &rotated_x, &rotated_y );

//x-coordinate
memcpy( wkbPtr, &rotated_x, sizeof( double ) );
wkbPtr += sizeof( double );

//y-coordinate
memcpy( wkbPtr, &rotated_y, sizeof( double ) );
wkbPtr += sizeof( double );
wkbPtr << rotated_x << rotated_y;

if ( hasZValue )
wkbPtr += sizeof( double );
}

void QgsGeometry::transformVertex( QgsWkbPtr &wkbPtr, const QgsCoordinateTransform& ct, bool hasZValue )
{
double x, y, z;

memcpy( &x, wkbPtr, sizeof( double ) );
memcpy( &y, wkbPtr + sizeof( double ), sizeof( double ) );
z = 0.0; // Ignore Z for now.
double x, y, z = 0.0;

QgsWkbPtr tmp = wkbPtr;
tmp >> x >> y;
ct.transformInPlace( x, y, z );

// new coordinate
wkbPtr << x << y;

if ( hasZValue )
wkbPtr += sizeof( double );

}

GEOSGeometry* QgsGeometry::linePointDifference( GEOSGeometry* GEOSsplitPoint )
Expand Down

0 comments on commit e8aedcb

Please sign in to comment.