SUMO - Simulation of Urban MObility
NGNet.h
Go to the documentation of this file.
00001 /****************************************************************************/
00009 // The class storing the generated network
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 NGNet_h
00023 #define NGNet_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 "NGEdge.h"
00036 #include "NGNode.h"
00037 
00038 
00039 // ===========================================================================
00040 // class declarations
00041 // ===========================================================================
00042 class NBNetBuilder;
00043 
00044 
00045 // ===========================================================================
00046 // class definitions
00047 // ===========================================================================
00056 class NGNet {
00057 public:
00059     NGNet(NBNetBuilder& nb) ;
00060 
00061 
00063     ~NGNet() ;
00064 
00065 
00075     NGNode* findNode(int xPos, int yPos) ;
00076 
00077 
00085     std::string getNextFreeID() ;
00086 
00087 
00094     SUMOReal radialToX(SUMOReal radius, SUMOReal phi) ;
00095 
00096 
00103     SUMOReal radialToY(SUMOReal radius, SUMOReal phi) ;
00104 
00105 
00122     void createChequerBoard(int numX, int numY, SUMOReal spaceX, SUMOReal spaceY, SUMOReal attachLength) ;
00123 
00124 
00142     void createSpiderWeb(int numRadDiv, int numCircles, SUMOReal spaceRad, bool hasCenter) ;
00143 
00144 
00162     void toNB() const ;
00163 
00164 
00171     void add(NGNode* node) ;
00172 
00173 
00180     void add(NGEdge* edge) ;
00181 
00182 
00187     size_t nodeNo() const ;
00188 
00189 
00190 private:
00199     void connect(NGNode* node1, NGNode* node2) ;
00200 
00201 
00202 private:
00204     int myLastID;
00205 
00207     NBNetBuilder& myNetBuilder;
00208 
00210     NGNodeList myNodeList;
00211 
00213     NGEdgeList myEdgeList;
00214 
00215 private:
00217     NGNet(const NGNet&);
00218 
00220     NGNet& operator=(const NGNet&);
00221 
00222 };
00223 
00224 
00225 #endif
00226 
00227 /****************************************************************************/
00228 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines