SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NGNet.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // The class storing the generated network
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef NGNet_h
23 #define NGNet_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include "NGEdge.h"
36 #include "NGNode.h"
37 
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class NBNetBuilder;
43 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
56 class NGNet {
57 public:
59  NGNet(NBNetBuilder& nb);
60 
61 
63  ~NGNet();
64 
65 
75  NGNode* findNode(int xPos, int yPos);
76 
77 
85  std::string getNextFreeID();
86 
87 
94  SUMOReal radialToX(SUMOReal radius, SUMOReal phi);
95 
96 
103  SUMOReal radialToY(SUMOReal radius, SUMOReal phi);
104 
105 
122  void createChequerBoard(int numX, int numY, SUMOReal spaceX, SUMOReal spaceY, SUMOReal attachLength);
123 
124 
142  void createSpiderWeb(int numRadDiv, int numCircles, SUMOReal spaceRad, bool hasCenter);
143 
144 
162  void toNB() const;
163 
164 
171  void add(NGNode* node);
172 
173 
180  void add(NGEdge* edge);
181 
182 
187  size_t nodeNo() const;
188 
189 
190 private:
199  void connect(NGNode* node1, NGNode* node2);
200 
201 
202 private:
204  int myLastID;
205 
208 
211 
214 
215 private:
217  NGNet(const NGNet&);
218 
220  NGNet& operator=(const NGNet&);
221 
222 };
223 
224 
225 #endif
226 
227 /****************************************************************************/
228