SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00009 // Importer for network nodes stored in XML 00010 /****************************************************************************/ 00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00013 /****************************************************************************/ 00014 // 00015 // This file is part of SUMO. 00016 // SUMO is free software: you can redistribute it and/or modify 00017 // it under the terms of the GNU General Public License as published by 00018 // the Free Software Foundation, either version 3 of the License, or 00019 // (at your option) any later version. 00020 // 00021 /****************************************************************************/ 00022 #ifndef NIXMLNodesHandler_h 00023 #define NIXMLNodesHandler_h 00024 00025 00026 // =========================================================================== 00027 // included modules 00028 // =========================================================================== 00029 #ifdef _MSC_VER 00030 #include <windows_config.h> 00031 #else 00032 #include <config.h> 00033 #endif 00034 00035 #include <utils/xml/SUMOSAXHandler.h> 00036 #include <utils/geom/Position.h> 00037 00038 00039 // =========================================================================== 00040 // class declarations 00041 // =========================================================================== 00042 class OptionsCont; 00043 class GeoConvHelper; 00044 class NBNode; 00045 class NBNodeCont; 00046 class NBTrafficLightLogicCont; 00047 00048 00049 // =========================================================================== 00050 // class definitions 00051 // =========================================================================== 00060 class NIXMLNodesHandler : public SUMOSAXHandler { 00061 00062 public: 00071 NIXMLNodesHandler(NBNodeCont& nc, NBTrafficLightLogicCont& tlc, 00072 OptionsCont& options); 00073 00074 00076 ~NIXMLNodesHandler() ; 00077 00078 00079 protected: 00081 00082 00093 void myStartElement(int element, 00094 const SUMOSAXAttributes& attrs) ; 00096 00097 00098 private: 00099 /* 00100 * @brief Parses node information 00101 * Tries to parse a node. If the node can be parsed, it is stored within 00102 * "myNodeCont". Otherwise an error is generated. Then, if given 00103 * the tls information is parsed and inserted into "myTLLogicCont". 00104 */ 00105 void addNode(const SUMOSAXAttributes& attrs); 00106 00107 /* 00108 * @brief Parses node deletion information 00109 */ 00110 void deleteNode(const SUMOSAXAttributes& attrs); 00111 00112 /* 00113 * @brief Parses a cluster of nodes to be joined 00114 */ 00115 void addJoinCluster(const SUMOSAXAttributes& attrs); 00116 00117 /* 00118 * @brief Parses a list of nodes to be excluded from joining 00119 */ 00120 void addJoinExclusion(const SUMOSAXAttributes& attrs); 00121 00127 void processTrafficLightDefinitions(const SUMOSAXAttributes& attrs, 00128 NBNode* currentNode); 00129 00130 00131 private: 00133 OptionsCont& myOptions; 00134 00136 std::string myID; 00137 00139 Position myPosition; 00140 00142 NBNodeCont& myNodeCont; 00143 00145 NBTrafficLightLogicCont& myTLLogicCont; 00146 00148 GeoConvHelper* myLocation; 00149 00150 00151 private: 00153 NIXMLNodesHandler(const NIXMLNodesHandler& s); 00154 00156 NIXMLNodesHandler& operator=(const NIXMLNodesHandler& s); 00157 00158 }; 00159 00160 00161 #endif 00162 00163 /****************************************************************************/ 00164