dRonin
adbada4
dRonin GCS
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Groups
Pages
mappointitem.cpp
Go to the documentation of this file.
1
12
/*
13
* This program is free software; you can redistribute it and/or modify
14
* it under the terms of the GNU General Public License as published by
15
* the Free Software Foundation; either version 3 of the License, or
16
* (at your option) any later version.
17
*
18
* This program is distributed in the hope that it will be useful, but
19
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21
* for more details.
22
*
23
* You should have received a copy of the GNU General Public License along
24
* with this program; if not, see <http://www.gnu.org/licenses/>
25
*/
26
#include "
mappointitem.h
"
27
28
namespace
mapcontrol
29
{
30
void
MapPointItem::SetAltitude(
const
float
&value)
31
{
32
if
(
altitude
==value)
33
return
;
34
altitude
=value;
35
this->update();
36
}
37
38
void
MapPointItem::setRelativeCoord(distBearingAltitude value)
39
{
40
relativeCoord
=value;
41
this->update();
42
}
43
44
void
MapPointItem::SetCoord(
const
internals::PointLatLng
&value)
45
{
46
if
(
coord
== value)
47
return
;
48
coord
= value;
49
distBearingAltitude back=
relativeCoord
;
50
if
(qAbs(back.bearing-
relativeCoord
.
bearing
)>0.01 || qAbs(back.distance-
relativeCoord
.
distance
)>0.1)
51
{
52
relativeCoord
=back;
53
}
54
this->update();
55
}
56
void
MapPointItem::SetDescription(
const
QString &value)
57
{
58
if
(
description
==value)
59
return
;
60
description
=value;
61
this->update();
62
}
63
64
70
double
MapPointItem::DistanceToPoint_2D
(
const
internals::PointLatLng
&coord2)
71
{
72
return
internals::PureProjection::DistanceBetweenLatLng
(
coord
, coord2);
73
}
74
75
82
double
MapPointItem::DistanceToPoint_3D
(
const
internals::PointLatLng
&coord2,
const
int
&altitude2)
83
{
84
return
internals::PureProjection::DistanceBetweenLatLngAlt
(
coord
,
altitude
, coord2, altitude2);
85
}
86
87
88
89
}
mapcontrol::MapPointItem::coord
internals::PointLatLng coord
Definition:
mappointitem.h:109
mapcontrol::MapPointItem::DistanceToPoint_3D
double DistanceToPoint_3D(const internals::PointLatLng &coord, const int &altitude)
MapPointItem::DistanceToPoint_3D Calculates distance from this point to second point.
Definition:
mappointitem.cpp:82
mapcontrol::distBearingAltitude::bearing
double bearing
Definition:
mappointitem.h:47
mapcontrol::MapPointItem::altitude
float altitude
Definition:
mappointitem.h:110
mapcontrol::MapPointItem::relativeCoord
distBearingAltitude relativeCoord
Definition:
mappointitem.h:111
mappointitem.h
A graphicsItem representing a MapPointItem.
mapcontrol::MapPointItem::DistanceToPoint_2D
double DistanceToPoint_2D(const internals::PointLatLng &coord)
MapPointItem::DistanceToPoint_2D Calculates distance from this point to second point.
Definition:
mappointitem.cpp:70
internals::PointLatLng
Definition:
pointlatlng.h:36
internals::PureProjection::DistanceBetweenLatLngAlt
static double DistanceBetweenLatLngAlt(PointLatLng const &p1, double const &alt1, PointLatLng const &p2, double const &alt2)
PureProjection::DistanceBetweenLatLngAlt Returns 3D distance between two geodetic points...
Definition:
pureprojection.cpp:269
mapcontrol::MapPointItem::description
QString description
Definition:
mappointitem.h:112
internals::PureProjection::DistanceBetweenLatLng
static double DistanceBetweenLatLng(PointLatLng const &p1, PointLatLng const &p2)
PureProjection::DistanceBetweenLatLng Returns 2D distance between two geodetic points.
Definition:
pureprojection.cpp:246
mapcontrol::distBearingAltitude::distance
double distance
Definition:
mappointitem.h:46
ground
gcs
src
libs
tlmapcontrol
mapwidget
mappointitem.cpp
Generated by
1.8.6