diff --git a/src/MissionManager/SurveyMissionItem.cc b/src/MissionManager/SurveyMissionItem.cc index 25f05da876242d6cce106363dbebd228f4d62d93..52de59842287475d71d2e3eebc3b2386d284c4e1 100644 --- a/src/MissionManager/SurveyMissionItem.cc +++ b/src/MissionManager/SurveyMissionItem.cc @@ -467,7 +467,6 @@ void SurveyMissionItem::_optimizeReflySegments(void) } if (shortestIndex > 1) { - qDebug() << "Reverse segments"; // We need to reverse the order of segments QList> rgReversedTransects; for (int i=_reflyTransectSegments.count() - 1; i>=0; i--) { @@ -476,7 +475,6 @@ void SurveyMissionItem::_optimizeReflySegments(void) _reflyTransectSegments = rgReversedTransects; } if (shortestIndex & 1) { - qDebug() << "Reverse points"; // We need to reverse the points within each segment for (int i=0; i<_reflyTransectSegments.count(); i++) { QList rgReversedCoords; @@ -770,11 +768,16 @@ void SurveyMissionItem::_intersectLinesWithPolygon(const QList& lineList /// Adjust the line segments such that they are all going the same direction with respect to going from P1->P2 void SurveyMissionItem::_adjustLineDirection(const QList& lineList, QList& resultLines) { + qreal firstAngle = 0; for (int i=0; i 180.0) { + if (i == 0) { + firstAngle = line.angle(); + } + + if (qAbs(line.angle() - firstAngle) > 1.0) { adjustedLine.setP1(line.p2()); adjustedLine.setP2(line.p1()); } else {