libosmscout 1.1.1
Loading...
Searching...
No Matches
GroundTile.h
Go to the documentation of this file.
1#ifndef OSMSCOUT_GROUNDTILE_H
2#define OSMSCOUT_GROUNDTILE_H
3
4/*
5 This source is part of the libosmscout library
6 Copyright (C) 2010 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 <vector>
24
26
28
29namespace osmscout {
30
46 struct OSMSCOUT_API GroundTile CLASS_FINAL
47 {
48 enum Type {
50 land = 1, // left side of the coast
51 water = 2, // right side of the coast
53 };
54
59 {
60 static const uint16_t CELL_MAX;
61
62 uint16_t x;
63 uint16_t y;
64 bool coast;
65
66 Coord() = default;
67
68 Coord(uint16_t x,
69 uint16_t y,
70 bool coast)
71 : x(x),
72 y(y),
74 {
75 }
76
77 void Set(uint16_t x,
78 uint16_t y,
79 bool coast)
80 {
81 this->x=x;
82 this->y=y;
83 this->coast=coast;
84 }
85
86 bool operator==(const Coord &coord) const
87 {
88 return x==coord.x && y==coord.y && coast==coord.coast;
89 }
90 };
91
93 size_t xAbs;
94 size_t yAbs;
95 size_t xRel;
96 size_t yRel;
97 double cellWidth;
98 double cellHeight;
99 std::vector<Coord> coords;
100
101 GroundTile() = default;
102
104 : type(type)
105 {
106 // no code
107 }
108 };
109}
110
111#endif
#define OSMSCOUT_API
Definition CoreImportExport.h:45
Definition Area.h:88
size_t yRel
Y coordinate of cell in relation to cell index of this level.
Definition GroundTile.h:96
const GeoCoord coord
Definition RouteStateAgent.h:49
@ coast
right side of the coast => a water tile
Definition GroundTile.h:52
@ water
left side of the coast => a land tile
Definition GroundTile.h:51
@ unknown
Definition GroundTile.h:49
@ land
We do not know yet.
Definition GroundTile.h:50
std::vector< Coord > coords
Optional coordinates for coastline.
Definition GroundTile.h:99
Type
Definition GroundTile.h:48
size_t yAbs
Absolute y coordinate of the cell in relation to level and cell size.
Definition GroundTile.h:94
Type type
The type of the cell.
Definition GroundTile.h:92
size_t xAbs
Absolute x coordinate of the cell in relation to level and cell size.
Definition GroundTile.h:93
double cellWidth
Width of cell.
Definition GroundTile.h:97
double cellHeight
Height of cell.
Definition GroundTile.h:98
size_t xRel
X coordinate of cell in relation to cell index of this level.
Definition GroundTile.h:95
GroundTile(Type type)
Definition GroundTile.h:103
Definition Area.h:39
uint16_t y
Definition GroundTile.h:63
Coord(uint16_t x, uint16_t y, bool coast)
Definition GroundTile.h:68
bool coast
Definition GroundTile.h:64
uint16_t x
Definition GroundTile.h:62
static const uint16_t CELL_MAX
Definition GroundTile.h:60
bool operator==(const Coord &coord) const
Definition GroundTile.h:86
void Set(uint16_t x, uint16_t y, bool coast)
Definition GroundTile.h:77