SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
NIXMLEdgesHandler.h
Go to the documentation of this file.
1
/****************************************************************************/
9
// Importer for network edges stored in XML
10
/****************************************************************************/
11
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
12
// Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
13
/****************************************************************************/
14
//
15
// This file is part of SUMO.
16
// SUMO is free software: you can redistribute it and/or modify
17
// it under the terms of the GNU General Public License as published by
18
// the Free Software Foundation, either version 3 of the License, or
19
// (at your option) any later version.
20
//
21
/****************************************************************************/
22
#ifndef NIXMLEdgesHandler_h
23
#define NIXMLEdgesHandler_h
24
25
26
// ===========================================================================
27
// included modules
28
// ===========================================================================
29
#ifdef _MSC_VER
30
#include <
windows_config.h
>
31
#else
32
#include <
config.h
>
33
#endif
34
35
#include <
utils/common/SUMOVehicleClass.h
>
36
#include <
utils/geom/PositionVector.h
>
37
#include <
utils/xml/SUMOSAXHandler.h
>
38
#include <
netbuild/NBEdge.h
>
39
40
41
// ===========================================================================
42
// class declarations
43
// ===========================================================================
44
class
OptionsCont
;
45
class
NBNode
;
46
class
NBEdge
;
47
class
NBNodeCont
;
48
class
NBEdgeCont
;
49
class
NBTypeCont
;
50
class
NBDistrictCont
;
51
52
53
// ===========================================================================
54
// class definitions
55
// ===========================================================================
71
class
NIXMLEdgesHandler
:
public
SUMOSAXHandler
{
72
public
:
80
NIXMLEdgesHandler
(
NBNodeCont
& nc,
NBEdgeCont
& ec,
81
NBTypeCont
& tc,
NBDistrictCont
& dc,
OptionsCont
& options);
82
83
85
~NIXMLEdgesHandler
();
86
87
88
protected
:
90
91
99
void
myStartElement
(
int
element,
100
const
SUMOSAXAttributes
& attrs);
101
102
109
void
myEndElement
(
int
element);
111
112
113
private
:
121
PositionVector
tryGetShape
(
const
SUMOSAXAttributes
& attrs);
122
123
126
LaneSpreadFunction
tryGetLaneSpread
(
const
SUMOSAXAttributes
& attrs);
127
128
136
bool
setNodes
(
const
SUMOSAXAttributes
& attrs);
137
138
139
private
:
141
OptionsCont
&
myOptions
;
142
143
146
148
std::string
myCurrentID
;
149
151
SUMOReal
myCurrentSpeed
;
152
154
int
myCurrentPriority
;
155
157
int
myCurrentLaneNo
;
158
160
SUMOReal
myCurrentWidth
;
161
163
SUMOReal
myCurrentOffset
;
164
166
std::string
myCurrentStreetName
;
167
169
std::string
myCurrentType
;
170
172
NBNode
*
myFromNode
, *
myToNode
;
173
175
SUMOReal
myLength
;
176
178
PositionVector
myShape
;
179
181
LaneSpreadFunction
myLanesSpread
;
182
184
SVCPermissions
myPermissions
;
185
187
bool
myKeepEdgeShape
;
188
190
bool
myReinitKeepEdgeShape
;
191
193
194
196
bool
myIsUpdate
;
197
198
201
203
NBNodeCont
&
myNodeCont
;
204
206
NBEdgeCont
&
myEdgeCont
;
207
209
NBTypeCont
&
myTypeCont
;
210
212
NBDistrictCont
&
myDistrictCont
;
214
215
217
NBEdge
*
myCurrentEdge
;
218
222
struct
Split
{
224
std::vector<int>
lanes
;
226
SUMOReal
pos
;
228
int
nameid
;
230
Position
gpos
;
231
};
232
234
std::vector<Split>
mySplits
;
235
236
240
class
split_sorter
{
241
public
:
243
explicit
split_sorter
() { }
244
246
int
operator()
(
const
Split
& e1,
const
Split
& e2)
const
{
247
return
e1.
pos
< e2.
pos
;
248
}
249
};
250
251
255
class
split_by_pos_finder
{
256
public
:
258
explicit
split_by_pos_finder
(
SUMOReal
pos)
259
:
myPosition
(pos) { }
260
262
bool
operator()
(
const
Split
& e) {
263
return
e.
pos
==
myPosition
;
264
}
265
266
private
:
268
SUMOReal
myPosition
;
269
270
};
271
272
274
bool
myHaveReportedAboutOverwriting
;
275
276
bool
myHaveWarnedAboutDeprecatedLaneId
;
277
278
279
private
:
280
284
void
addEdge
(
const
SUMOSAXAttributes
& attrs);
285
289
void
deleteEdge
(
const
SUMOSAXAttributes
& attrs);
290
295
void
addLane
(
const
SUMOSAXAttributes
& attrs);
296
301
void
addSplit
(
const
SUMOSAXAttributes
& attrs);
302
303
private
:
305
NIXMLEdgesHandler
(
const
NIXMLEdgesHandler
& s);
306
308
NIXMLEdgesHandler
&
operator=
(
const
NIXMLEdgesHandler
& s);
309
310
};
311
312
313
#endif
314
315
/****************************************************************************/
316
build
buildd
sumo-0.17.1~dfsg
src
netimport
NIXMLEdgesHandler.h
Generated on Sun Jun 16 2013 17:30:18 for SUMO - Simulation of Urban MObility by
1.8.3.1