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
727d7397
Commit
727d7397
authored
Jul 10, 2011
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working towards correct line updates - not tested yet, might create runtime issues
parent
0b385b47
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
0 deletions
+37
-0
mapgraphicitem.cpp
src/libs/opmapcontrol/src/mapwidget/mapgraphicitem.cpp
+15
-0
waypointlineitem.cpp
src/libs/opmapcontrol/src/mapwidget/waypointlineitem.cpp
+17
-0
waypointlineitem.h
src/libs/opmapcontrol/src/mapwidget/waypointlineitem.h
+5
-0
No files found.
src/libs/opmapcontrol/src/mapwidget/mapgraphicitem.cpp
View file @
727d7397
...
...
@@ -28,6 +28,7 @@
#include "gpsitem.h"
#include "homeitem.h"
#include "mapgraphicitem.h"
#include "waypointlineitem.h"
namespace
mapcontrol
{
...
...
@@ -91,6 +92,13 @@ namespace mapcontrol
GPSItem
*
wwww
=
qgraphicsitem_cast
<
GPSItem
*>
(
i
);
if
(
wwww
)
wwww
->
RefreshPos
();
QGraphicsItemGroup
*
wwwww
=
qgraphicsitem_cast
<
QGraphicsItemGroup
*>
(
i
);
if
(
wwwww
)
foreach
(
QGraphicsItem
*
i
,
wwwww
->
childItems
())
{
WaypointLineItem
*
line
=
qgraphicsitem_cast
<
WaypointLineItem
*>
(
i
);
if
(
line
)
line
->
RefreshPos
();
}
}
}
void
MapGraphicItem
::
ChildPosRefresh
()
...
...
@@ -109,6 +117,13 @@ namespace mapcontrol
GPSItem
*
wwww
=
qgraphicsitem_cast
<
GPSItem
*>
(
i
);
if
(
wwww
)
wwww
->
RefreshPos
();
QGraphicsItemGroup
*
wwwww
=
qgraphicsitem_cast
<
QGraphicsItemGroup
*>
(
i
);
if
(
wwwww
)
foreach
(
QGraphicsItem
*
i
,
wwwww
->
childItems
())
{
WaypointLineItem
*
line
=
qgraphicsitem_cast
<
WaypointLineItem
*>
(
i
);
if
(
line
)
line
->
RefreshPos
();
}
}
}
void
MapGraphicItem
::
ConstructLastImage
(
int
const
&
zoomdiff
)
...
...
src/libs/opmapcontrol/src/mapwidget/waypointlineitem.cpp
View file @
727d7397
...
...
@@ -35,6 +35,23 @@ WaypointLineItem::WaypointLineItem(WayPointItem* wp1, WayPointItem* wp2, QColor
// Map Zoom and move
}
void
WaypointLineItem
::
RefreshPos
()
{
// Delete if either waypoint got deleted
if
(
!
wp1
||
!
wp2
)
{
this
->
deleteLater
();
}
else
{
// Set new pixel coordinates based on new global coordinates
core
::
Point
localPoint1
=
map
->
FromLatLngToLocal
(
wp1
->
Coord
());
core
::
Point
localPoint2
=
map
->
FromLatLngToLocal
(
wp2
->
Coord
());
setLine
(
localPoint1
.
X
(),
localPoint1
.
Y
(),
localPoint2
.
X
(),
localPoint2
.
Y
());
}
}
void
WaypointLineItem
::
updateWPValues
(
WayPointItem
*
waypoint
)
{
Q_UNUSED
(
waypoint
);
...
...
src/libs/opmapcontrol/src/mapwidget/waypointlineitem.h
View file @
727d7397
...
...
@@ -21,6 +21,11 @@ public slots:
* @param waypoint The waypoint object that just changed
*/
void
updateWPValues
(
WayPointItem
*
waypoint
);
/**
* @brief Update waypoint values
*
*/
void
RefreshPos
();
protected:
internals
::
PointLatLng
point1
;
...
...
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