Eclipse SUMO - Simulation of Urban MObility
NWWriter_XML.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2001-2024 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 /****************************************************************************/
20 // Exporter writing networks using XML (native input) format
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 #include <string>
26 #include <map>
29 
30 
31 // ===========================================================================
32 // class declarations
33 // ===========================================================================
34 class NBEdge;
35 class NBEdgeCont;
36 class NBNetBuilder;
37 class NBNode;
38 class NBNodeCont;
39 class NBParkingCont;
40 class NBPTStopCont;
41 class NBPTLineCont;
43 class NBTypeCont;
44 class OptionsCont;
45 
46 
47 // ===========================================================================
48 // class definitions
49 // ===========================================================================
55 class NWWriter_XML {
56 public:
62  static void writeNetwork(const OptionsCont& oc, const std::string& prefix, NBNetBuilder& nb);
63 
68  static void writeJoinedJunctions(const std::string& filename, NBNodeCont& nc);
69 
74  static void writeStreetSigns(const OptionsCont& oc, NBEdgeCont& ec);
75 
76 private:
81  static void writeNodes(const OptionsCont& oc, const std::string& prefix, NBNodeCont& nc);
82 
87  static void writeTypes(const std::string& prefix, NBEdgeCont& ec, NBTypeCont& tc);
88 
93  static void writeEdgesAndConnections(const OptionsCont& oc, const std::string& prefix, NBNodeCont& nc, NBEdgeCont& ec);
94 
95 
101  static void writeTrafficLights(const std::string& prefix, NBTrafficLightLogicCont& tc, NBEdgeCont& ec);
102 
107  static void writePTStops(const OptionsCont& oc, NBPTStopCont& ec);
108  static void writePTLines(const OptionsCont& cont, NBPTLineCont& lc);
109 
111  static void writeParkingAreas(const OptionsCont& cont, NBParkingCont& pc, NBEdgeCont& ec);
112 
114  static void writeDistricts(const OptionsCont& oc, NBDistrictCont& dc);
115 
116  static void writeShape(OutputDevice& out, const GeoConvHelper& gch, PositionVector shape, SumoXMLAttr attr, bool useGeo, bool geoAccuracy);
117 };
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
static methods for processing the coordinates conversion for the current net
Definition: GeoConvHelper.h:53
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
Instance responsible for building networks.
Definition: NBNetBuilder.h:107
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:57
Represents a single node (junction) during network building.
Definition: NBNode.h:66
Container for public transport stops during the net building process.
Definition: NBPTStopCont.h:44
A container for traffic light definitions and built programs.
A storage for available edgeTypes of edges.
Definition: NBTypeCont.h:52
Exporter writing networks using XML (native input) format.
Definition: NWWriter_XML.h:55
static void writeStreetSigns(const OptionsCont &oc, NBEdgeCont &ec)
Writes street signs as POIs to file.
static void writeTrafficLights(const std::string &prefix, NBTrafficLightLogicCont &tc, NBEdgeCont &ec)
Writes the traffic lights file.
static void writeTypes(const std::string &prefix, NBEdgeCont &ec, NBTypeCont &tc)
Writes the types file.
static void writeParkingAreas(const OptionsCont &cont, NBParkingCont &pc, NBEdgeCont &ec)
writes imported parking areas to file
static void writeJoinedJunctions(const std::string &filename, NBNodeCont &nc)
Writes the joined-juncionts to file.
static void writeNetwork(const OptionsCont &oc, const std::string &prefix, NBNetBuilder &nb)
Writes the network into XML-files (nodes, edges, connections, traffic lights)
static void writePTLines(const OptionsCont &cont, NBPTLineCont &lc)
static void writeEdgesAndConnections(const OptionsCont &oc, const std::string &prefix, NBNodeCont &nc, NBEdgeCont &ec)
Writes the edges and connections files.
static void writePTStops(const OptionsCont &oc, NBPTStopCont &ec)
Writes the pt stops file.
static void writeShape(OutputDevice &out, const GeoConvHelper &gch, PositionVector shape, SumoXMLAttr attr, bool useGeo, bool geoAccuracy)
static void writeDistricts(const OptionsCont &oc, NBDistrictCont &dc)
writes imported districts (TAZ) to file
static void writeNodes(const OptionsCont &oc, const std::string &prefix, NBNodeCont &nc)
Writes the nodes file.
A storage for options typed value containers)
Definition: OptionsCont.h:89
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
A list of positions.