Eclipse SUMO - Simulation of Urban MObility
NIXMLEdgesHandler.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
21// Importer for network edges stored in XML
22/****************************************************************************/
23#pragma once
24#include <config.h>
25
29#include <netbuild/NBEdge.h>
30#include <netbuild/NBEdgeCont.h>
31
32
33// ===========================================================================
34// class declarations
35// ===========================================================================
36class OptionsCont;
37class NBNode;
38class NBEdge;
39class NBNodeCont;
40class NBTypeCont;
41class NBDistrictCont;
43
44// ===========================================================================
45// class definitions
46// ===========================================================================
63public:
74 OptionsCont& options);
75
76
79
80protected:
82
83
91 void myStartElement(int element,
92 const SUMOSAXAttributes& attrs);
93
94
101 void myEndElement(int element);
103
104
105private:
114
115
119
120
128 bool setNodes(const SUMOSAXAttributes& attrs);
129
130
131private:
134
135
138
140 std::string myCurrentID;
141
144
147
150
153
156
159
162
164 std::string myCurrentType;
165
168
170 double myLength;
171
174
177
180
183
186
189
191
192
195
196
199
202
205
208
211
216
217
220
223
225 std::vector<NBEdgeCont::Split> mySplits;
226
231 public:
233 explicit split_by_pos_finder(double pos)
234 : myPosition(pos) { }
235
238 return e.pos == myPosition;
239 }
240
241 private:
244
245 };
246
247
250
253
255
257 const bool myKeepEdgeShape;
258
260 std::vector<Parameterised*> myLastParameterised;
261
262private:
263
267 void addEdge(const SUMOSAXAttributes& attrs);
268
272 void deleteEdge(const SUMOSAXAttributes& attrs);
273
278 void addLane(const SUMOSAXAttributes& attrs);
279
284 void addSplit(const SUMOSAXAttributes& attrs);
285
289 void addRoundabout(const SUMOSAXAttributes& attrs);
290
291
292private:
295
298
299};
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge's lateral offset shal...
A container for districts.
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:59
The representation of a single edge during network building.
Definition: NBEdge.h:92
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:58
Represents a single node (junction) during network building.
Definition: NBNode.h:66
A container for traffic light definitions and built programs.
A storage for available edgeTypes of edges.
Definition: NBTypeCont.h:52
Finds a split at the given position.
bool operator()(const NBEdgeCont::Split &e)
Comparing operator.
double myPosition
The position to search for.
split_by_pos_finder(double pos)
Constructor.
Importer for network edges stored in XML.
NIXMLEdgesHandler & operator=(const NIXMLEdgesHandler &s)
invalid assignment operator
std::string myCurrentID
The current edge's id.
SVCPermissions myPermissions
Information about lane permissions.
bool setNodes(const SUMOSAXAttributes &attrs)
Sets from/to node information of the currently parsed edge.
PositionVector myShape
The shape of the edge.
std::string myCurrentStreetName
The current edge's street name.
LaneSpreadFunction tryGetLaneSpread(const SUMOSAXAttributes &attrs)
Tries to parse the spread type.
double myCurrentSpeed
The current edge's maximum speed.
double myBikeLaneWidth
The width of the bike lane that shall be added to the current edge.
~NIXMLEdgesHandler()
Destructor.
int myCurrentLaneNo
The current edge's number of lanes.
OptionsCont & myOptions
A reference to the program's options.
void addRoundabout(const SUMOSAXAttributes &attrs)
Parses a roundabout and stores it in myEdgeCont.
double myCurrentWidth
The current edge's lane width.
NIXMLEdgesHandler(NBNodeCont &nc, NBEdgeCont &ec, NBTypeCont &tc, NBDistrictCont &dc, NBTrafficLightLogicCont &tlc, OptionsCont &options)
Constructor.
NBTypeCont & myTypeCont
The types container (for retrieval of type defaults)
double myCurrentEndOffset
The current edge's offset till the destination node.
double myLength
The current edge's length.
int myCurrentPriority
The current edge's priority.
NBNodeCont & myNodeCont
The nodes container (for retrieval of referenced nodes)
PositionVector tryGetShape(const SUMOSAXAttributes &attrs)
Tries to parse the shape definition.
bool myIsUpdate
Whether this edge definition is an update of a previously inserted edge.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
LaneSpreadFunction myLanesSpread
Information about how to spread the lanes.
NBDistrictCont & myDistrictCont
The districts container (needed if an edge must be split)
std::vector< Parameterised * > myLastParameterised
element to receive parameters
NBEdgeCont & myEdgeCont
The edges container (for insertion of build edges)
double mySidewalkWidth
The width of the sidewalk that shall be added to the current edge.
bool myHaveWarnedAboutDeprecatedLaneId
void addSplit(const SUMOSAXAttributes &attrs)
Parses a split and stores it in mySplits. Splits are executed Upon reading the end tag of an edge.
std::string myCurrentType
The current edge's type.
NBEdge * myCurrentEdge
The currently processed edge.
NBTrafficLightLogicCont & myTLLogicCont
The traffic lights container to add built tls to (when invalidating tls because of splits)
std::vector< NBEdgeCont::Split > mySplits
The list of this edge's splits.
double myCurrentFriction
The current edge's friction.
int myCurrentLaneIndex
The currently processed lane index.
bool myHaveReportedAboutTypeOverride
Information whether at least one edge's type was changed.
NIXMLEdgesHandler(const NIXMLEdgesHandler &s)
invalid copy constructor
NBNode * myFromNode
The nodes the edge starts and ends at.
void addLane(const SUMOSAXAttributes &attrs)
Parses a lane and modifies myCurrentEdge according to the given attribures.
void myEndElement(int element)
Called when a closing tag occurs.
const bool myKeepEdgeShape
Whether the edge shape shall be kept generally.
bool myHaveReportedAboutOverwriting
Information whether at least one edge's attributes were overwritten.
void deleteEdge(const SUMOSAXAttributes &attrs)
parses delete tag and deletes the specified edge or lane
bool myReinitKeepEdgeShape
Whether the edge shape shall be kept at reinitilization.
void addEdge(const SUMOSAXAttributes &attrs)
Parses an edge and stores the values in "myCurrentEdge".
A storage for options typed value containers)
Definition: OptionsCont.h:89
A list of positions.
Encapsulated SAX-Attributes.
SAX-handler base for SUMO-files.
A structure which describes changes of lane number or speed along the road.
Definition: NBEdgeCont.h:188
double pos
The position of this change.
Definition: NBEdgeCont.h:192