Skip to content

Commit 404a59c

Browse files
author
jef
committed
fix build error
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13993 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 3b250da commit 404a59c

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/plugins/georeferencer/qgsleastsquares.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -181,40 +181,40 @@ void QgsLeastSquares::affine( std::vector<QgsPoint> mapCoords,
181181
* Also returns 3x3 homogenous matrices which can be used to normalize and de-normalize coordinates.
182182
*/
183183
void normalizeCoordinates( const std::vector<QgsPoint> coords, std::vector<QgsPoint> &normalizedCoords,
184-
double normalizeMatrix[9], double denormalizeMatrix[9])
184+
double normalizeMatrix[9], double denormalizeMatrix[9] )
185185
{
186186
// Calculate center of gravity
187187
double cogX = 0.0, cogY = 0.0;
188188
for ( uint i = 0; i < coords.size(); i++ )
189189
{
190-
cogX+= coords[i].x();
191-
cogY+= coords[i].y();
190+
cogX += coords[i].x();
191+
cogY += coords[i].y();
192192
}
193-
cogX*= 1.0/coords.size();
194-
cogY*= 1.0/coords.size();
193+
cogX *= 1.0 / coords.size();
194+
cogY *= 1.0 / coords.size();
195195

196196
// Calculate mean distance to origin
197197
double meanDist = 0.0;
198198
for ( uint i = 0; i < coords.size(); i++ )
199199
{
200-
double X = (coords[i].x() - cogX);
201-
double Y = (coords[i].y() - cogY);
202-
meanDist+= sqrt( X*X + Y*Y );
200+
double X = ( coords[i].x() - cogX );
201+
double Y = ( coords[i].y() - cogY );
202+
meanDist += sqrt( X * X + Y * Y );
203203
}
204-
meanDist*= 1.0/coords.size();
204+
meanDist *= 1.0 / coords.size();
205205

206-
double OOD = meanDist/sqrt(2);
207-
double D = 1.0/OOD;
208-
normalizedCoords.resize(coords.size());
206+
double OOD = meanDist / sqrt( 2.0 );
207+
double D = 1.0 / OOD;
208+
normalizedCoords.resize( coords.size() );
209209
for ( uint i = 0; i < coords.size(); i++ )
210210
{
211-
normalizedCoords[i] = QgsPoint( (coords[i].x() - cogX)*D, (coords[i].y() - cogY)*D );
211+
normalizedCoords[i] = QgsPoint(( coords[i].x() - cogX ) * D, ( coords[i].y() - cogY ) * D );
212212
}
213213

214-
normalizeMatrix[0] = D; normalizeMatrix[1] = 0.0; normalizeMatrix[2] = -cogX*D;
215-
normalizeMatrix[3] = 0.0; normalizeMatrix[4] = D; normalizeMatrix[5] = -cogY*D;
214+
normalizeMatrix[0] = D; normalizeMatrix[1] = 0.0; normalizeMatrix[2] = -cogX * D;
215+
normalizeMatrix[3] = 0.0; normalizeMatrix[4] = D; normalizeMatrix[5] = -cogY * D;
216216
normalizeMatrix[6] = 0.0; normalizeMatrix[7] = 0.0; normalizeMatrix[8] = 1.0;
217-
217+
218218
denormalizeMatrix[0] = OOD; denormalizeMatrix[1] = 0.0; denormalizeMatrix[2] = cogX;
219219
denormalizeMatrix[3] = 0.0; denormalizeMatrix[4] = OOD; denormalizeMatrix[5] = cogY;
220220
denormalizeMatrix[6] = 0.0; denormalizeMatrix[7] = 0.0; denormalizeMatrix[8] = 1.0;
@@ -235,14 +235,14 @@ void QgsLeastSquares::projective( std::vector<QgsPoint> mapCoords,
235235

236236
std::vector<QgsPoint> mapCoordsNormalized;
237237
std::vector<QgsPoint> pixelCoordsNormalized;
238-
238+
239239
double normMap[9], denormMap[9];
240240
double normPixel[9], denormPixel[9];
241241
normalizeCoordinates( mapCoords, mapCoordsNormalized, normMap, denormMap );
242242
normalizeCoordinates( pixelCoords, pixelCoordsNormalized, normPixel, denormPixel );
243243
mapCoords = mapCoordsNormalized;
244244
pixelCoords = pixelCoordsNormalized;
245-
245+
246246
// GSL does not support a full SVD, so we artificially add a linear dependent row
247247
// to the matrix in case the system is underconstrained.
248248
uint m = std::max( 9u, ( uint )mapCoords.size() * 2u );

0 commit comments

Comments
 (0)