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-sim.org/
12
// Copyright (C) 2001-2014 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,
82
NBTrafficLightLogicCont
& tlc,
83
OptionsCont
& options);
84
85
87
~NIXMLEdgesHandler
();
88
89
90
protected
:
92
93
101
void
myStartElement
(
int
element,
102
const
SUMOSAXAttributes
& attrs);
103
104
111
void
myEndElement
(
int
element);
113
114
115
private
:
123
PositionVector
tryGetShape
(
const
SUMOSAXAttributes
& attrs);
124
125
128
LaneSpreadFunction
tryGetLaneSpread
(
const
SUMOSAXAttributes
& attrs);
129
130
138
bool
setNodes
(
const
SUMOSAXAttributes
& attrs);
139
140
141
private
:
143
OptionsCont
&
myOptions
;
144
145
148
150
std::string
myCurrentID
;
151
153
SUMOReal
myCurrentSpeed
;
154
156
int
myCurrentPriority
;
157
159
int
myCurrentLaneNo
;
160
162
SUMOReal
myCurrentWidth
;
163
165
SUMOReal
myCurrentEndOffset
;
166
168
std::string
myCurrentStreetName
;
169
171
std::string
myCurrentType
;
172
174
NBNode
*
myFromNode
, *
myToNode
;
175
177
SUMOReal
myLength
;
178
180
PositionVector
myShape
;
181
183
LaneSpreadFunction
myLanesSpread
;
184
186
SVCPermissions
myPermissions
;
187
189
bool
myReinitKeepEdgeShape
;
190
192
193
195
bool
myIsUpdate
;
196
197
200
202
NBNodeCont
&
myNodeCont
;
203
205
NBEdgeCont
&
myEdgeCont
;
206
208
NBTypeCont
&
myTypeCont
;
209
211
NBDistrictCont
&
myDistrictCont
;
212
215
NBTrafficLightLogicCont
&
myTLLogicCont
;
217
218
220
NBEdge
*
myCurrentEdge
;
221
225
struct
Split
{
227
std::vector<int>
lanes
;
229
SUMOReal
pos
;
231
int
nameid
;
233
Position
gpos
;
234
};
235
237
std::vector<Split>
mySplits
;
238
239
243
class
split_sorter
{
244
public
:
246
explicit
split_sorter
() { }
247
249
int
operator()
(
const
Split
& e1,
const
Split
& e2)
const
{
250
return
e1.
pos
< e2.
pos
;
251
}
252
};
253
254
258
class
split_by_pos_finder
{
259
public
:
261
explicit
split_by_pos_finder
(
SUMOReal
pos)
262
:
myPosition
(pos) { }
263
265
bool
operator()
(
const
Split
& e) {
266
return
e.
pos
==
myPosition
;
267
}
268
269
private
:
271
SUMOReal
myPosition
;
272
273
};
274
275
277
bool
myHaveReportedAboutOverwriting
;
278
279
bool
myHaveWarnedAboutDeprecatedLaneId
;
280
282
const
bool
myKeepEdgeShape
;
283
284
285
private
:
286
290
void
addEdge
(
const
SUMOSAXAttributes
& attrs);
291
295
void
deleteEdge
(
const
SUMOSAXAttributes
& attrs);
296
301
void
addLane
(
const
SUMOSAXAttributes
& attrs);
302
307
void
addSplit
(
const
SUMOSAXAttributes
& attrs);
308
309
private
:
311
NIXMLEdgesHandler
(
const
NIXMLEdgesHandler
& s);
312
314
NIXMLEdgesHandler
&
operator=
(
const
NIXMLEdgesHandler
& s);
315
316
};
317
318
319
#endif
320
321
/****************************************************************************/
322
tmp
buildd
sumo-0.21.0+dfsg
src
netimport
NIXMLEdgesHandler.h
Generated on Thu Nov 20 2014 19:49:57 for SUMO - Simulation of Urban MObility by
1.8.1.2