|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // The class storing the generated network 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright (C) 2001-2011 DLR (http://www.dlr.de/) and contributors 00011 /****************************************************************************/ 00012 // 00013 // This program is free software; you can redistribute it and/or modify 00014 // it under the terms of the GNU General Public License as published by 00015 // the Free Software Foundation; either version 2 of the License, or 00016 // (at your option) any later version. 00017 // 00018 /****************************************************************************/ 00019 #ifndef NGNet_h 00020 #define NGNet_h 00021 00022 00023 // =========================================================================== 00024 // included modules 00025 // =========================================================================== 00026 #ifdef _MSC_VER 00027 #include <windows_config.h> 00028 #else 00029 #include <config.h> 00030 #endif 00031 00032 #include "NGEdge.h" 00033 #include "NGNode.h" 00034 00035 00036 // =========================================================================== 00037 // class declarations 00038 // =========================================================================== 00039 class NBNetBuilder; 00040 00041 00042 // =========================================================================== 00043 // class definitions 00044 // =========================================================================== 00053 class NGNet { 00054 public: 00056 NGNet(NBNetBuilder& nb) throw(); 00057 00058 00060 ~NGNet() throw(); 00061 00062 00072 NGNode* findNode(int xPos, int yPos) throw(); 00073 00074 00082 std::string getNextFreeID() throw(); 00083 00084 00091 SUMOReal radialToX(SUMOReal radius, SUMOReal phi) throw(); 00092 00093 00100 SUMOReal radialToY(SUMOReal radius, SUMOReal phi) throw(); 00101 00102 00119 void createChequerBoard(int numX, int numY, SUMOReal spaceX, SUMOReal spaceY, SUMOReal attachLength) throw(); 00120 00121 00139 void createSpiderWeb(int numRadDiv, int numCircles, SUMOReal spaceRad, bool hasCenter) throw(); 00140 00141 00159 void toNB() const throw(ProcessError); 00160 00161 00168 void add(NGNode* node) throw(); 00169 00170 00177 void add(NGEdge* edge) throw(); 00178 00179 00184 size_t nodeNo() const throw(); 00185 00186 00187 private: 00196 void connect(NGNode* node1, NGNode* node2) throw(); 00197 00198 00199 private: 00201 int myLastID; 00202 00204 NBNetBuilder& myNetBuilder; 00205 00207 NGNodeList myNodeList; 00208 00210 NGEdgeList myEdgeList; 00211 00212 private: 00214 NGNet(const NGNet&); 00215 00217 NGNet& operator=(const NGNet&); 00218 00219 }; 00220 00221 00222 #endif 00223 00224 /****************************************************************************/ 00225