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
cf189597
Commit
cf189597
authored
Mar 13, 2018
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better performance of KML loading
parent
f622859b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
QGCMapPolygon.cc
src/MissionManager/QGCMapPolygon.cc
+14
-3
QGCMapPolygon.h
src/MissionManager/QGCMapPolygon.h
+1
-0
No files found.
src/MissionManager/QGCMapPolygon.cc
View file @
cf189597
...
...
@@ -258,6 +258,19 @@ void QGCMapPolygon::appendVertex(const QGeoCoordinate& coordinate)
emit
pathChanged
();
}
void
QGCMapPolygon
::
appendVertices
(
const
QList
<
QGeoCoordinate
>&
coordinates
)
{
QList
<
QObject
*>
objects
;
foreach
(
const
QGeoCoordinate
&
coordinate
,
coordinates
)
{
objects
.
append
(
new
QGCQGeoCoordinate
(
coordinate
,
this
));
_polygonPath
.
append
(
QVariant
::
fromValue
(
coordinate
));
}
_polygonModel
.
append
(
objects
);
emit
pathChanged
();
}
void
QGCMapPolygon
::
_polygonModelDirtyChanged
(
bool
dirty
)
{
if
(
dirty
)
{
...
...
@@ -509,9 +522,7 @@ bool QGCMapPolygon::loadKMLFile(const QString& kmlFile)
}
clear
();
for
(
int
i
=
0
;
i
<
rgCoords
.
count
();
i
++
)
{
appendVertex
(
rgCoords
[
i
]);
}
appendVertices
(
rgCoords
);
return
true
;
}
src/MissionManager/QGCMapPolygon.h
View file @
cf189597
...
...
@@ -40,6 +40,7 @@ public:
Q_INVOKABLE
void
clear
(
void
);
Q_INVOKABLE
void
appendVertex
(
const
QGeoCoordinate
&
coordinate
);
Q_INVOKABLE
void
removeVertex
(
int
vertexIndex
);
Q_INVOKABLE
void
appendVertices
(
const
QList
<
QGeoCoordinate
>&
coordinates
);
/// Adjust the value for the specified coordinate
/// @param vertexIndex Polygon point index to modify (0-based)
...
...
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