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-2012 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
141
SUMOReal
tryGetPosition
(
const
SUMOSAXAttributes
& attrs,
SumoXMLAttr
attrID,
142
const
std::string& attrName);
143
144
145
NBNode
*
insertNodeChecking
(
const
Position
& pos,
146
const
std::string& name,
const
std::string& dir);
147
148
149
private
:
151
OptionsCont
&
myOptions
;
152
153
156
158
std::string
myCurrentID
;
159
161
SUMOReal
myCurrentSpeed
;
162
164
int
myCurrentPriority
;
165
167
int
myCurrentLaneNo
;
168
170
SUMOReal
myCurrentWidth
;
171
173
SUMOReal
myCurrentOffset
;
174
176
std::string
myCurrentStreetName
;
177
179
std::string
myCurrentType
;
180
182
NBNode
*
myFromNode
, *
myToNode
;
183
185
SUMOReal
myLength
;
186
188
PositionVector
myShape
;
189
191
LaneSpreadFunction
myLanesSpread
;
192
194
SVCPermissions
myPermissions
;
195
197
198
200
bool
myIsUpdate
;
201
203
NBEdge
*
myCurrentEdge
;
204
205
208
210
NBNodeCont
&
myNodeCont
;
211
213
NBEdgeCont
&
myEdgeCont
;
214
216
NBTypeCont
&
myTypeCont
;
217
219
NBDistrictCont
&
myDistrictCont
;
221
222
226
struct
Split
{
228
std::vector<int>
lanes
;
230
SUMOReal
pos
;
232
int
nameid
;
234
Position
gpos
;
235
};
236
238
std::vector<Split>
mySplits
;
239
240
244
class
split_sorter
{
245
public
:
247
explicit
split_sorter
() { }
248
250
int
operator()
(
const
Split
& e1,
const
Split
& e2)
const
{
251
return
e1.
pos
< e2.
pos
;
252
}
253
};
254
255
259
class
split_by_pos_finder
{
260
public
:
262
explicit
split_by_pos_finder
(
SUMOReal
pos)
263
:
myPosition
(pos) { }
264
266
bool
operator()
(
const
Split
& e) {
267
return
e.
pos
==
myPosition
;
268
}
269
270
private
:
272
SUMOReal
myPosition
;
273
274
};
275
276
278
bool
myHaveReportedAboutOverwriting
;
279
280
bool
myHaveWarnedAboutDeprecatedSpreadType
,
myHaveWarnedAboutDeprecatedFromTo
,
281
myHaveWarnedAboutDeprecatedNoLanes
,
myHaveWarnedAboutDeprecatedLaneId
;
282
283
284
private
:
285
289
void
addEdge
(
const
SUMOSAXAttributes
& attrs);
290
294
void
deleteEdge
(
const
SUMOSAXAttributes
& attrs);
295
300
void
addLane
(
const
SUMOSAXAttributes
& attrs);
301
306
void
addSplit
(
const
SUMOSAXAttributes
& attrs);
307
308
private
:
310
NIXMLEdgesHandler
(
const
NIXMLEdgesHandler
& s);
311
313
NIXMLEdgesHandler
&
operator=
(
const
NIXMLEdgesHandler
& s);
314
315
};
316
317
318
#endif
319
320
/****************************************************************************/
321
build
buildd
sumo-0.15.0~dfsg
src
netimport
NIXMLEdgesHandler.h
Generated on Wed Jul 18 2012 22:58:35 for SUMO - Simulation of Urban MObility by
1.8.1.1