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
7cbbf378
Commit
7cbbf378
authored
Jun 08, 2020
by
Aleksey Kontsevich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QGCMapPolygon select vertexes functionality
parent
553fa8a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
QGCMapPolygon.cc
src/MissionManager/QGCMapPolygon.cc
+12
-0
QGCMapPolygon.h
src/MissionManager/QGCMapPolygon.h
+5
-0
No files found.
src/MissionManager/QGCMapPolygon.cc
View file @
7cbbf378
...
...
@@ -311,6 +311,7 @@ void QGCMapPolygon::removeVertex(int vertexIndex)
QObject
*
coordObj
=
_polygonModel
.
removeAt
(
vertexIndex
);
coordObj
->
deleteLater
();
selectVertex
(
-
1
);
_polygonPath
.
removeAt
(
vertexIndex
);
emit
pathChanged
();
...
...
@@ -622,3 +623,14 @@ void QGCMapPolygon::setShowAltColor(bool showAltColor){
emit
showAltColorChanged
(
showAltColor
);
}
}
void
QGCMapPolygon
::
selectVertex
(
int
index
)
{
if
(
0
<=
index
&&
index
<
count
()
&&
index
!=
_selectedVertexIndex
)
{
_selectedVertexIndex
=
index
;
}
else
{
_selectedVertexIndex
=
-
1
;
// deselect vertex
}
emit
selectedVertexChanged
(
_selectedVertexIndex
);
}
src/MissionManager/QGCMapPolygon.h
View file @
7cbbf378
...
...
@@ -42,6 +42,7 @@ public:
Q_PROPERTY
(
bool
empty
READ
empty
NOTIFY
isEmptyChanged
)
Q_PROPERTY
(
bool
traceMode
READ
traceMode
WRITE
setTraceMode
NOTIFY
traceModeChanged
)
Q_PROPERTY
(
bool
showAltColor
READ
showAltColor
WRITE
setShowAltColor
NOTIFY
showAltColorChanged
)
Q_PROPERTY
(
int
selectedVertex
READ
selectedVertex
WRITE
selectVertex
NOTIFY
selectedVertexChanged
)
Q_INVOKABLE
void
clear
(
void
);
Q_INVOKABLE
void
appendVertex
(
const
QGeoCoordinate
&
coordinate
);
...
...
@@ -111,6 +112,7 @@ public:
bool
empty
(
void
)
const
{
return
_polygonModel
.
count
()
==
0
;
}
bool
traceMode
(
void
)
const
{
return
_traceMode
;
}
bool
showAltColor
(
void
)
const
{
return
_showAltColor
;
}
int
selectedVertex
()
const
{
return
_selectedVertexIndex
;
}
QVariantList
path
(
void
)
const
{
return
_polygonPath
;
}
QmlObjectListModel
*
qmlPathModel
(
void
)
{
return
&
_polygonModel
;
}
...
...
@@ -123,6 +125,7 @@ public:
void
setInteractive
(
bool
interactive
);
void
setTraceMode
(
bool
traceMode
);
void
setShowAltColor
(
bool
showAltColor
);
void
selectVertex
(
int
index
);
static
const
char
*
jsonPolygonKey
;
...
...
@@ -138,6 +141,7 @@ signals:
bool
isEmptyChanged
(
void
);
void
traceModeChanged
(
bool
traceMode
);
void
showAltColorChanged
(
bool
showAltColor
);
void
selectedVertexChanged
(
int
index
);
private
slots
:
void
_polygonModelCountChanged
(
int
count
);
...
...
@@ -162,6 +166,7 @@ private:
bool
_resetActive
=
false
;
bool
_traceMode
=
false
;
bool
_showAltColor
=
false
;
int
_selectedVertexIndex
=
-
1
;
};
#endif
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