Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
cf189597
Commit
cf189597
authored
Mar 13, 2018
by
DonLakeFlyer
Browse files
Better performance of KML loading
parent
f622859b
Changes
2
Hide whitespace changes
Inline
Side-by-side
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
Supports
Markdown
0%
Try again
or
attach a new 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