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
22169ffe
Commit
22169ffe
authored
Nov 27, 2017
by
Beat Küng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AirMapManager: update polygons to changed airmapd interface
parent
6599fde0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
AirMapManager.cc
src/MissionManager/AirMapManager.cc
+11
-12
No files found.
src/MissionManager/AirMapManager.cc
View file @
22169ffe
...
@@ -210,21 +210,20 @@ void AirMapRestrictionManager::setROI(const QGeoCoordinate& center, double radiu
...
@@ -210,21 +210,20 @@ void AirMapRestrictionManager::setROI(const QGeoCoordinate& center, double radiu
void
AirMapRestrictionManager
::
_addPolygonToList
(
const
airmap
::
Geometry
::
Polygon
&
polygon
,
QList
<
PolygonAirspaceRestriction
*>&
list
)
void
AirMapRestrictionManager
::
_addPolygonToList
(
const
airmap
::
Geometry
::
Polygon
&
polygon
,
QList
<
PolygonAirspaceRestriction
*>&
list
)
{
{
QVariantList
polygonArray
;
QVariantList
polygonArray
;
if
(
polygon
.
size
()
==
1
)
{
for
(
const
auto
&
vertex
:
polygon
.
outer_ring
.
coordinates
)
{
for
(
const
auto
&
vertex
:
polygon
[
0
].
coordinates
)
{
QGeoCoordinate
coord
;
QGeoCoordinate
coord
;
if
(
vertex
.
altitude
)
{
if
(
vertex
.
altitude
)
{
coord
=
QGeoCoordinate
(
vertex
.
latitude
,
vertex
.
longitude
,
vertex
.
altitude
.
get
());
coord
=
QGeoCoordinate
(
vertex
.
latitude
,
vertex
.
longitude
,
vertex
.
altitude
.
get
());
}
else
{
}
else
{
coord
=
QGeoCoordinate
(
vertex
.
latitude
,
vertex
.
longitude
);
coord
=
QGeoCoordinate
(
vertex
.
latitude
,
vertex
.
longitude
);
}
polygonArray
.
append
(
QVariant
::
fromValue
(
coord
));
}
}
list
.
append
(
new
PolygonAirspaceRestriction
(
polygonArray
));
polygonArray
.
append
(
QVariant
::
fromValue
(
coord
));
}
list
.
append
(
new
PolygonAirspaceRestriction
(
polygonArray
));
}
else
{
if
(
polygon
.
inner_rings
.
size
()
>
0
)
{
// no need to support those (they are rare, and in most cases, there's a more restrictive polygon filling the hole)
// no need to support those (they are rare, and in most cases, there's a more restrictive polygon filling the hole)
qCDebug
(
AirMapManagerLog
)
<<
"
Empty polygon, or Polygon with holes. Size: "
<<
polygon
.
size
();
qCDebug
(
AirMapManagerLog
)
<<
"
Polygon with holes. Size: "
<<
polygon
.
inner_rings
.
size
();
}
}
}
}
...
...
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