1 /****************************************************************************/ 2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo 3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others. 4 // This program and the accompanying materials 5 // are made available under the terms of the Eclipse Public License v2.0 6 // which accompanies this distribution, and is available at 7 // http://www.eclipse.org/legal/epl-v20.html 8 // SPDX-License-Identifier: EPL-2.0 9 /****************************************************************************/ 10 /// @file NWWriter_XML.h 11 /// @author Daniel Krajzewicz 12 /// @author Jakob Erdmann 13 /// @author Michael Behrisch 14 /// @date Tue, 11.05.2011 15 /// @version $Id$ 16 /// 17 // Exporter writing networks using XML (native input) format 18 /****************************************************************************/ 19 #ifndef NWWriter_XML_h 20 #define NWWriter_XML_h 21 22 23 // =========================================================================== 24 // included modules 25 // =========================================================================== 26 #include <config.h> 27 28 #include <string> 29 #include <map> 30 #include <utils/xml/SUMOSAXHandler.h> 31 #include <utils/common/UtilExceptions.h> 32 33 34 // =========================================================================== 35 // class declarations 36 // =========================================================================== 37 class NBEdge; 38 class NBEdgeCont; 39 class NBNetBuilder; 40 class NBNode; 41 class NBNodeCont; 42 class NBParkingCont; 43 class NBPTStopCont; 44 class NBPTLineCont; 45 class NBTrafficLightLogicCont; 46 class NBTypeCont; 47 class OptionsCont; 48 49 50 // =========================================================================== 51 // class definitions 52 // =========================================================================== 53 /** 54 * @class NWWriter_XML 55 * @brief Exporter writing networks using XML (native input) format 56 * 57 */ 58 class NWWriter_XML { 59 public: 60 /** @brief Writes the network into XML-files (nodes, edges, connections, 61 * traffic lights) 62 * @param[in] oc The options to use 63 * @param[in] nb The network builder from which to read data 64 */ 65 static void writeNetwork(const OptionsCont& oc, NBNetBuilder& nb); 66 67 /** @brief Writes the joined-juncionts to file 68 * @param[in] oc The options to use 69 * @param[in] nc The node-container from which to read data 70 */ 71 static void writeJoinedJunctions(const OptionsCont& oc, NBNodeCont& nc); 72 73 /** @brief Writes street signs as POIs to file 74 * @param[in] oc The options to use 75 * @param[in] ec The edge-container from which to read data 76 */ 77 static void writeStreetSigns(const OptionsCont& oc, NBEdgeCont& ec); 78 79 private: 80 /** @brief Writes the nodes file 81 * @param[in] oc The options to use 82 * @param[in] nc The node-container from which to read data 83 */ 84 static void writeNodes(const OptionsCont& oc, NBNodeCont& nc); 85 86 /** @brief Writes the types file 87 * @param[in] oc The options to use 88 * @param[in] nc The type-container from which to read data 89 */ 90 static void writeTypes(const OptionsCont& oc, NBTypeCont& tc); 91 92 /** @brief Writes the edges and connections files 93 * @param[in] oc The options to use 94 * @param[in] nb The network build from which to read data 95 */ 96 static void writeEdgesAndConnections(const OptionsCont& oc, NBNodeCont& nc, NBEdgeCont& ec); 97 98 99 /** @brief Writes the traffic lights file 100 * @param[in] oc The options to use 101 * @param[in] tc The tll-container from which to read data 102 * @param[in] ec The edge-container from which to read data 103 */ 104 static void writeTrafficLights(const OptionsCont& oc, NBTrafficLightLogicCont& tc, NBEdgeCont& ec); 105 106 /** @brief Writes the pt stops file 107 * @param[in] oc The options to use 108 * @param[in] nc The pt stop container from which to read data 109 */ 110 static void writePTStops(const OptionsCont& oc, NBPTStopCont& ec); 111 static void writePTLines(const OptionsCont& cont, NBPTLineCont& lc, NBEdgeCont& ec); 112 113 /// @brief writes imported parking areas to file 114 static void writeParkingAreas(const OptionsCont& cont, NBParkingCont& pc, NBEdgeCont& ec); 115 }; 116 117 118 #endif 119 120 /****************************************************************************/ 121 122