libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout
include
osmscout
Point.h
Go to the documentation of this file.
1
#ifndef OSMSCOUT_POINT_H
2
#define OSMSCOUT_POINT_H
3
4
/*
5
This source is part of the libosmscout library
6
Copyright (C) 2009 Tim Teulings
7
8
This library is free software; you can redistribute it and/or
9
modify it under the terms of the GNU Lesser General Public
10
License as published by the Free Software Foundation; either
11
version 2.1 of the License, or (at your option) any later version.
12
13
This library is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
Lesser General Public License for more details.
17
18
You should have received a copy of the GNU Lesser General Public
19
License along with this library; if not, write to the Free Software
20
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
*/
22
23
#include <
osmscout/GeoCoord.h
>
24
#include <
osmscout/OSMScoutTypes.h
>
25
26
#include <
osmscout/system/Compiler.h
>
27
28
namespace
osmscout
{
29
34
class
OSMSCOUT_API
Point
CLASS_FINAL
35
{
36
private
:
37
uint8_t serial=0;
38
GeoCoord coord;
39
40
public
:
41
Point
() =
default
;
42
43
Point
(uint8_t serial,
44
const
GeoCoord
&
coords
)
45
: serial(serial),
46
coord
(
coords
)
47
{
48
// no code
49
}
50
51
void
Set
(uint8_t serial,
52
const
GeoCoord
&
coords
)
53
{
54
this->serial=serial;
55
this->coord=
coords
;
56
}
57
58
void
SetSerial
(uint8_t serial)
59
{
60
this->serial=serial;
61
}
62
63
void
ClearSerial
()
64
{
65
serial=0;
66
}
67
68
void
SetCoord
(
const
GeoCoord
&
coords
)
69
{
70
this->coord=
coords
;
71
}
72
73
uint8_t
GetSerial
()
const
74
{
75
return
serial;
76
}
77
78
bool
IsRelevant
()
const
79
{
80
return
serial!=0;
81
}
82
91
Id
GetId
()
const
;
92
93
const
GeoCoord
&
GetCoord
()
const
94
{
95
return
coord
;
96
}
97
98
double
GetLat
()
const
99
{
100
return
coord
.GetLat();
101
}
102
103
double
GetLon
()
const
104
{
105
return
coord
.GetLon();
106
}
107
117
bool
IsIdentical
(
const
Point
& other)
const
118
{
119
return
serial==other.serial &&
coord
==other.coord;
120
}
121
132
bool
IsSame
(
const
Point
& other)
const
133
{
134
return
coord
==other.coord;
135
}
136
145
bool
IsEqual
(
const
Point
& other)
const
146
{
147
return
coord
==other.coord;
148
}
149
159
bool
operator<
(
const
Point
& other)
const
160
{
161
return
coord
<other.GetCoord() ||
162
(
coord
==other.GetCoord() && serial < other.serial);
163
}
164
165
static
GeoCoord
GetCoordFromId
(
Id
id
);
166
};
167
}
168
169
#endif
Compiler.h
OSMSCOUT_API
#define OSMSCOUT_API
Definition
CoreImportExport.h:45
GeoCoord.h
OSMScoutTypes.h
osmscout::CLASS_FINAL
Definition
Area.h:88
osmscout::CLASS_FINAL::operator<
bool operator<(const Point &other) const
Definition
Point.h:159
osmscout::CLASS_FINAL::coord
const GeoCoord coord
Definition
RouteStateAgent.h:49
osmscout::CLASS_FINAL::GetSerial
uint8_t GetSerial() const
Definition
Point.h:73
osmscout::CLASS_FINAL::IsRelevant
bool IsRelevant() const
Definition
Point.h:78
osmscout::CLASS_FINAL::Point
Point(uint8_t serial, const GeoCoord &coords)
Definition
Point.h:43
osmscout::CLASS_FINAL::Set
void Set(uint8_t serial, const GeoCoord &coords)
Definition
Point.h:51
osmscout::CLASS_FINAL::coords
std::vector< Coord > coords
Optional coordinates for coastline.
Definition
GroundTile.h:99
osmscout::CLASS_FINAL::IsSame
bool IsSame(const Point &other) const
Definition
Point.h:132
osmscout::CLASS_FINAL::SetSerial
void SetSerial(uint8_t serial)
Definition
Point.h:58
osmscout::CLASS_FINAL::GetCoordFromId
static GeoCoord GetCoordFromId(Id id)
osmscout::CLASS_FINAL::SetCoord
void SetCoord(const GeoCoord &coords)
Definition
Point.h:68
osmscout::CLASS_FINAL::IsEqual
bool IsEqual(const Point &other) const
Definition
Point.h:145
osmscout::CLASS_FINAL::GetLat
double GetLat() const
Definition
Point.h:98
osmscout::CLASS_FINAL::ClearSerial
void ClearSerial()
Definition
Point.h:63
osmscout::CLASS_FINAL::GeoCoord
GeoCoord()=default
osmscout::CLASS_FINAL::GetLon
double GetLon() const
Definition
Point.h:103
osmscout::CLASS_FINAL::Point
Point()=default
osmscout::CLASS_FINAL::GetId
Id GetId() const
osmscout::CLASS_FINAL::IsIdentical
bool IsIdentical(const Point &other) const
Definition
Point.h:117
osmscout::CLASS_FINAL::GetCoord
const GeoCoord & GetCoord() const
Definition
Point.h:93
osmscout::Id
uint64_t Id
Definition
OSMScoutTypes.h:40
osmscout
Definition
Area.h:39
Generated by
1.17.0