libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout
include
osmscout
Node.h
Go to the documentation of this file.
1
#ifndef OSMSCOUT_NODE_H
2
#define OSMSCOUT_NODE_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 <memory>
24
#include <vector>
25
26
#include <
osmscout/GeoCoord.h
>
27
#include <
osmscout/Tag.h
>
28
#include <
osmscout/TypeConfig.h
>
29
30
#include <
osmscout/io/FileScanner.h
>
31
#include <
osmscout/io/FileWriter.h
>
32
33
#include <
osmscout/util/Progress.h
>
34
35
#include <
osmscout/system/Compiler.h
>
36
37
namespace
osmscout
{
38
39
class
OSMSCOUT_API
Node
CLASS_FINAL
40
{
41
private
:
42
FeatureValueBuffer featureValueBuffer;
43
44
FileOffset
fileOffset=0;
45
FileOffset
nextFileOffset=0;
46
47
GeoCoord coords;
48
49
public
:
50
Node
() =
default
;
51
52
FileOffset
GetFileOffset
()
const
53
{
54
return
fileOffset;
55
}
56
57
FileOffset
GetNextFileOffset
()
const
58
{
59
return
nextFileOffset;
60
}
61
62
ObjectFileRef
GetObjectFileRef
()
const
63
{
64
return
ObjectFileRef
(fileOffset,
refNode
);
65
}
66
67
TypeInfoRef
GetType
()
const
68
{
69
return
featureValueBuffer.GetType();
70
}
71
72
const
GeoCoord
&
GetCoords
()
const
73
{
74
return
coords
;
75
}
76
85
bool
Intersects
(
const
GeoBox
& boundingBox)
const
86
{
87
return
boundingBox.Includes(
coords
);
88
}
89
90
size_t
GetFeatureCount
()
const
91
{
92
return
featureValueBuffer.GetType()->GetFeatureCount();
93
}
94
95
bool
HasFeature
(
size_t
idx)
const
96
{
97
return
featureValueBuffer.HasFeature(idx);
98
}
99
100
const
FeatureInstance
&
GetFeature
(
size_t
idx)
const
101
{
102
return
featureValueBuffer.GetType()->GetFeature(idx);
103
}
104
105
void
UnsetFeature
(
size_t
idx)
106
{
107
featureValueBuffer.FreeValue(idx);
108
}
109
110
const
FeatureValueBuffer
&
GetFeatureValueBuffer
()
const
111
{
112
return
featureValueBuffer;
113
}
114
115
void
SetType
(
const
TypeInfoRef
&
type
);
116
void
SetCoords
(
const
GeoCoord
&
coords
);
117
void
SetFeatures
(
const
FeatureValueBuffer
&
buffer
);
118
119
void
Read
(
const
TypeConfig
& typeConfig,
120
FileScanner
& scanner);
121
void
Write
(
const
TypeConfig
& typeConfig,
122
FileWriter
& writer)
const
;
123
};
124
125
using
NodeRef
= std::shared_ptr<Node>;
126
}
127
128
#endif
Compiler.h
OSMSCOUT_API
#define OSMSCOUT_API
Definition
CoreImportExport.h:45
FileScanner.h
FileWriter.h
GeoCoord.h
Progress.h
Tag.h
TypeConfig.h
osmscout::CLASS_FINAL
Definition
Area.h:88
osmscout::CLASS_FINAL::UnsetFeature
void UnsetFeature(size_t idx)
Definition
Node.h:105
osmscout::CLASS_FINAL::GetType
TypeInfoRef GetType() const
Definition
Node.h:67
osmscout::CLASS_FINAL::SetCoords
void SetCoords(const GeoCoord &coords)
osmscout::CLASS_FINAL::TypeConfig
TypeConfig()
osmscout::CLASS_FINAL::coords
std::vector< Coord > coords
Optional coordinates for coastline.
Definition
GroundTile.h:99
osmscout::CLASS_FINAL::Intersects
bool Intersects(const GeoBox &boundingBox) const
Definition
Node.h:85
osmscout::CLASS_FINAL::Write
void Write(const TypeConfig &typeConfig, FileWriter &writer) const
osmscout::CLASS_FINAL::GetFileOffset
FileOffset GetFileOffset() const
Definition
Node.h:52
osmscout::CLASS_FINAL::HasFeature
bool HasFeature(size_t idx) const
Definition
Node.h:95
osmscout::CLASS_FINAL::GeoBox
GeoBox()=default
osmscout::CLASS_FINAL::GetObjectFileRef
ObjectFileRef GetObjectFileRef() const
Definition
Node.h:62
osmscout::CLASS_FINAL::GetNextFileOffset
FileOffset GetNextFileOffset() const
Definition
Node.h:57
osmscout::CLASS_FINAL::GetCoords
const GeoCoord & GetCoords() const
Definition
Node.h:72
osmscout::CLASS_FINAL::FeatureInstance
FeatureInstance()
osmscout::CLASS_FINAL::SetFeatures
void SetFeatures(const FeatureValueBuffer &buffer)
osmscout::CLASS_FINAL::ObjectFileRef
ObjectFileRef()=default
osmscout::CLASS_FINAL::GeoCoord
GeoCoord()=default
osmscout::CLASS_FINAL::FileScanner
FileScanner()=default
osmscout::CLASS_FINAL::FileWriter
FileWriter()=default
osmscout::CLASS_FINAL::GetFeatureValueBuffer
const FeatureValueBuffer & GetFeatureValueBuffer() const
Definition
Node.h:110
osmscout::CLASS_FINAL::type
Type type
The type of the cell.
Definition
GroundTile.h:92
osmscout::CLASS_FINAL::SetType
void SetType(const TypeInfoRef &type)
osmscout::CLASS_FINAL::buffer
Vertex2D * buffer
Definition
Transformation.h:343
osmscout::CLASS_FINAL::Node
Node()=default
osmscout::CLASS_FINAL::FeatureValueBuffer
FeatureValueBuffer()=default
osmscout::CLASS_FINAL::GetFeature
const FeatureInstance & GetFeature(size_t idx) const
Definition
Node.h:100
osmscout::CLASS_FINAL::Read
void Read(const TypeConfig &typeConfig, FileScanner &scanner)
osmscout::CLASS_FINAL::GetFeatureCount
size_t GetFeatureCount() const
Definition
Node.h:90
osmscout::FileOffset
uint64_t FileOffset
Definition
OSMScoutTypes.h:46
osmscout
Definition
Area.h:39
osmscout::refNode
@ refNode
Definition
ObjectRef.h:141
osmscout::TypeInfoRef
std::shared_ptr< TypeInfo > TypeInfoRef
Definition
TypeConfig.h:61
osmscout::NodeRef
std::shared_ptr< Node > NodeRef
Definition
Node.h:125
Generated by
1.17.0