Skip to content

Commit 444a5a8

Browse files
author
mhugent
committed
fix for svn compile problem
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5271 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 7db270a commit 444a5a8

File tree

1 file changed

+46
-44
lines changed

1 file changed

+46
-44
lines changed

src/core/qgsgeometry.cpp

Lines changed: 46 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -940,55 +940,57 @@ QgsPoint QgsGeometry::closestSegmentWithContext(QgsPoint& point,
940940
switch (wkbType)
941941
{
942942
case QGis::WKBPoint:
943-
// Points have no lines
944-
return QgsPoint(0,0);
945-
943+
{
944+
// Points have no lines
945+
return QgsPoint(0,0);
946+
}
946947
case QGis::WKBLineString:
947-
closestSegmentIndex = 0;
948-
unsigned char* ptr = mGeometry + 5;
949-
int* npoints = (int*) ptr;
950-
ptr += sizeof(int);
951-
for (int index=0; index < *npoints; ++index)
952948
{
953-
if (index > 0)
954-
{
955-
prevx = thisx;
956-
prevy = thisy;
957-
}
958-
959-
thisx = (double*) ptr;
960-
ptr += sizeof(double);
961-
thisy = (double*) ptr;
962-
963-
if (index > 0)
964-
{
965-
if (
966-
(
967-
testdist = distanceSquaredPointToSegment(point,
968-
prevx, prevy,
969-
thisx, thisy,
970-
minDistPoint) // TODO: save minDistPoint into something meaningful.
971-
)
972-
< sqrDist )
973-
{
949+
closestSegmentIndex = 0;
950+
unsigned char* ptr = mGeometry + 5;
951+
int* npoints = (int*) ptr;
952+
ptr += sizeof(int);
953+
for (int index=0; index < *npoints; ++index)
954+
{
955+
if (index > 0)
956+
{
957+
prevx = thisx;
958+
prevy = thisy;
959+
}
960+
961+
thisx = (double*) ptr;
962+
ptr += sizeof(double);
963+
thisy = (double*) ptr;
964+
965+
if (index > 0)
966+
{
967+
if (
968+
(
969+
testdist = distanceSquaredPointToSegment(point,
970+
prevx, prevy,
971+
thisx, thisy,
972+
minDistPoint) // TODO: save minDistPoint into something meaningful.
973+
)
974+
< sqrDist )
975+
{
974976
#ifdef QGISDEBUG
975-
// std::cout << "QgsGeometry::closestSegment: testDist "
976-
// << testdist << ", sqrDist"
977-
// << sqrDist
978-
// << "." << std::endl;
977+
// std::cout << "QgsGeometry::closestSegment: testDist "
978+
// << testdist << ", sqrDist"
979+
// << sqrDist
980+
// << "." << std::endl;
979981
#endif
980-
closestSegmentIndex = index;
981-
sqrDist = testdist;
982-
}
983-
}
984-
985-
ptr += sizeof(double);
982+
closestSegmentIndex = index;
983+
sqrDist = testdist;
984+
}
985+
}
986+
987+
ptr += sizeof(double);
988+
}
989+
990+
beforeVertex.push_back(closestSegmentIndex);
991+
992+
break;
986993
}
987-
988-
beforeVertex.push_back(closestSegmentIndex);
989-
990-
break;
991-
992994
//todo: add wkb parsing
993995
case QGis::WKBPolygon:
994996
{

0 commit comments

Comments
 (0)