Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
78c37693
Commit
78c37693
authored
May 11, 2017
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More fixes for line sorting
parent
4fc1047b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
SurveyMissionItem.cc
src/MissionManager/SurveyMissionItem.cc
+6
-3
No files found.
src/MissionManager/SurveyMissionItem.cc
View file @
78c37693
...
...
@@ -467,7 +467,6 @@ void SurveyMissionItem::_optimizeReflySegments(void)
}
if
(
shortestIndex
>
1
)
{
qDebug
()
<<
"Reverse segments"
;
// We need to reverse the order of segments
QList
<
QList
<
QGeoCoordinate
>>
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
<
QGeoCoordinate
>
rgReversedCoords
;
...
...
@@ -770,11 +768,16 @@ void SurveyMissionItem::_intersectLinesWithPolygon(const QList<QLineF>& 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
<
QLineF
>&
lineList
,
QList
<
QLineF
>&
resultLines
)
{
qreal
firstAngle
=
0
;
for
(
int
i
=
0
;
i
<
lineList
.
count
();
i
++
)
{
const
QLineF
&
line
=
lineList
[
i
];
QLineF
adjustedLine
;
if
(
line
.
angle
()
>
180.0
)
{
if
(
i
==
0
)
{
firstAngle
=
line
.
angle
();
}
if
(
qAbs
(
line
.
angle
()
-
firstAngle
)
>
1.0
)
{
adjustedLine
.
setP1
(
line
.
p2
());
adjustedLine
.
setP2
(
line
.
p1
());
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment