SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NBNetBuilder.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // Instance responsible for building networks
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
13 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef NBNetBuilder_h
24 #define NBNetBuilder_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <string>
37 #include <iostream>
38 #include <vector>
39 #include <set>
40 #include "NBEdgeCont.h"
41 #include "NBTypeCont.h"
42 #include "NBNodeCont.h"
43 #include "NBNode.h"
45 #include "NBDistrictCont.h"
46 #include "NBJoinedEdgesMap.h"
48 
49 
50 // ===========================================================================
51 // class declarations
52 // ===========================================================================
53 class OptionsCont;
54 class OutputDevice;
55 class GeoConvHelper;
56 
57 
58 // ===========================================================================
59 // class definitions
60 // ===========================================================================
114  friend class GNENet; // for triggering intermediate build steps
115 
116 public:
118  NBNetBuilder();
119 
121  ~NBNetBuilder();
122 
123 
132  void applyOptions(OptionsCont& oc);
133 
134 
142  void compute(OptionsCont& oc,
143  const std::set<std::string>& explicitTurnarounds = std::set<std::string>(),
144  bool removeUnwishedNodes = true);
145 
146 
147 
150 
155  return myEdgeCont;
156  }
157 
158 
163  return myNodeCont;
164  }
165 
166 
171  return myTypeCont;
172  }
173 
174 
179  return myTLLCont;
180  }
181 
182 
187  return myDistrictCont;
188  }
189 
190 
194  const std::vector<EdgeVector>& getRoundabouts() const {
195  return myRoundabouts;
196  }
197 
198 
203  return myJoinedEdges;
204  }
206 
207 
210  myHaveSeenRoundabouts = true;
211  }
212 
213 
214 protected:
219  class by_id_sorter {
220  public:
222  explicit by_id_sorter() { }
223 
224  int operator()(const NBNode* n1, const NBNode* n2) const {
225  return n1->getID() < n2->getID();
226  }
227 
228  };
229 
230 protected:
233 
236 
239 
242 
245 
248 
250  std::vector<EdgeVector> myRoundabouts;
251 
254 
255 private:
257  void moveToOrigin(GeoConvHelper& geoConvHelper);
258 
259 private:
261  NBNetBuilder(const NBNetBuilder& s);
262 
265 
266 };
267 
268 
269 #endif
270 
271 /****************************************************************************/
272