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
pointlatlng.h
Go to the documentation of this file.
1
13
/*
14
* This program is free software; you can redistribute it and/or modify
15
* it under the terms of the GNU General Public License as published by
16
* the Free Software Foundation; either version 3 of the License, or
17
* (at your option) any later version.
18
*
19
* This program is distributed in the hope that it will be useful, but
20
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22
* for more details.
23
*
24
* You should have received a copy of the GNU General Public License along
25
* with this program; if not, see <http://www.gnu.org/licenses/>
26
*/
27
#ifndef POINTLATLNG_H
28
#define POINTLATLNG_H
29
30
#include <QHash>
31
#include <QString>
32
#include "
sizelatlng.h
"
33
#include "../core/corecommon.h"
34
35
namespace
internals {
36
struct
TLMAPWIDGET_EXPORT
PointLatLng
37
{
38
friend
bool
TLMAPWIDGET_EXPORT
operator==
(
PointLatLng
const
& lhs,
PointLatLng
const
& rhs);
39
friend
bool
TLMAPWIDGET_EXPORT
operator!=
(
PointLatLng
const
& left,
PointLatLng
const
& right);
40
friend
PointLatLng
TLMAPWIDGET_EXPORT
operator+
(
PointLatLng
pt,
SizeLatLng
sz);
41
friend
PointLatLng
TLMAPWIDGET_EXPORT
operator-
(
PointLatLng
pt,
SizeLatLng
sz);
42
43
private
:
44
double
lat;
45
double
lng;
46
bool
empty;
47
public
:
48
PointLatLng
();
49
50
static
PointLatLng
Empty
;
51
52
PointLatLng
(
const
double
&lat,
const
double
&lng)
53
{
54
this->lat = lat;
55
this->lng = lng;
56
empty=
false
;
57
}
58
59
bool
IsEmpty
()
60
{
61
return
empty;
62
}
63
64
double
Lat
()
const
65
{
66
return
this->lat;
67
}
68
69
void
SetLat
(
const
double
&value)
70
{
71
this->lat = value;
72
empty=
false
;
73
}
74
75
76
double
Lng
()
const
77
{
78
return
this->lng;
79
}
80
void
SetLng
(
const
double
&value)
81
{
82
this->lng = value;
83
empty=
false
;
84
}
85
86
static
PointLatLng
Add
(
PointLatLng
const
& pt,
SizeLatLng
const
& sz)
87
{
88
return
PointLatLng
(pt.
Lat
() - sz.
HeightLat
(), pt.
Lng
() + sz.
WidthLng
());
89
}
90
91
static
PointLatLng
Subtract
(
PointLatLng
const
& pt,
SizeLatLng
const
& sz)
92
{
93
return
PointLatLng
(pt.
Lat
() + sz.
HeightLat
(), pt.
Lng
() - sz.
WidthLng
());
94
}
95
96
97
void
Offset
(
PointLatLng
const
& pos)
98
{
99
this->Offset(pos.
Lat
(), pos.
Lng
());
100
}
101
102
void
Offset
(
double
const
& lat,
double
const
& lng)
103
{
104
this->lng += lng;
105
this->lat -= lat;
106
}
107
108
109
QString
ToString
()
const
110
{
111
return
QString(
"{Lat=%1, Lng=%2}"
).arg(this->lat).arg(this->lng);
112
}
113
114
};
115
116
}
117
#endif // POINTLATLNG_H
internals::PointLatLng::Subtract
static PointLatLng Subtract(PointLatLng const &pt, SizeLatLng const &sz)
Definition:
pointlatlng.h:91
sizelatlng.h
internals::SizeLatLng::HeightLat
double HeightLat() const
Definition:
sizelatlng.h:84
internals::PointLatLng::IsEmpty
bool IsEmpty()
Definition:
pointlatlng.h:59
internals::PointLatLng::SetLat
void SetLat(const double &value)
Definition:
pointlatlng.h:69
internals::PointLatLng::ToString
QString ToString() const
Definition:
pointlatlng.h:109
internals::operator+
PointLatLng operator+(PointLatLng pt, SizeLatLng sz)
Definition:
pointlatlng.cpp:46
internals::PointLatLng::Offset
void Offset(PointLatLng const &pos)
Definition:
pointlatlng.h:97
internals::PointLatLng::SetLng
void SetLng(const double &value)
Definition:
pointlatlng.h:80
internals::PointLatLng::Lng
double Lng() const
Definition:
pointlatlng.h:76
internals::PointLatLng::Lat
double Lat() const
Definition:
pointlatlng.h:64
internals::SizeLatLng
Definition:
sizelatlng.h:36
internals::PointLatLng
Definition:
pointlatlng.h:36
internals::PointLatLng::Empty
static PointLatLng Empty
Definition:
pointlatlng.h:50
internals::SizeLatLng::WidthLng
double WidthLng() const
Definition:
sizelatlng.h:74
internals::operator-
PointLatLng operator-(PointLatLng pt, SizeLatLng sz)
Definition:
pointlatlng.cpp:51
internals::operator==
bool operator==(LoadTask const &lhs, LoadTask const &rhs)
Definition:
loadtask.cpp:31
internals::PointLatLng::PointLatLng
PointLatLng(const double &lat, const double &lng)
Definition:
pointlatlng.h:52
internals::PointLatLng::Add
static PointLatLng Add(PointLatLng const &pt, SizeLatLng const &sz)
Definition:
pointlatlng.h:86
internals::PointLatLng::Offset
void Offset(double const &lat, double const &lng)
Definition:
pointlatlng.h:102
internals::operator!=
bool operator!=(PointLatLng const &left, PointLatLng const &right)
Definition:
pointlatlng.cpp:42
ground
gcs
src
libs
tlmapcontrol
internals
pointlatlng.h
Generated by
1.8.6