SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PCPolyContainer.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // A storage for loaded polygons and pois
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef PCPolyContainer_h
22 #define PCPolyContainer_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <string>
35 #include <map>
36 #include <vector>
37 #include <utils/shapes/Polygon.h>
39 #include <utils/geom/Boundary.h>
41 using namespace SUMO;
42 
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
52 public:
58  PCPolyContainer(bool prune, const Boundary& prunningBoundary,
59  const std::vector<std::string>& removeByNames);
60 
61 
63  ~PCPolyContainer();
64 
65 
81  bool insert(const std::string& id, Polygon* poly, int layer,
82  bool ignorePrunning = false);
83 
84 
100  bool insert(const std::string& id, PointOfInterest* poi, int layer,
101  bool ignorePrunning = false);
102 
103 
107  unsigned int getNoPolygons() {
108  return (unsigned int) myPolyCont.size();
109  }
110 
111 
115  unsigned int getNoPOIs() {
116  return (unsigned int) myPOICont.size();
117  }
118 
119 
124  void clear();
125 
126 
128  void report();
129 
130 
135  bool containsPolygon(const std::string& kidey);
136 
137 
142  void save(const std::string& file);
143 
144 
153  int getEnumIDFor(const std::string& key);
154 
155 
156 public:
158  typedef std::map<std::string, Polygon*> PolyCont;
161 
163  typedef std::map<std::string, PointOfInterest*> POICont;
166 
168  std::map<std::string, int> myIDEnums;
169 
171  std::map<Polygon*, int> myPolyLayerMap;
172 
174  std::map<PointOfInterest*, int> myPOILayerMap;
175 
176 
179 
182 
184  std::vector<std::string> myRemoveByNames;
185 
186 
187 private:
190 
192  PCPolyContainer& operator=(const PCPolyContainer& s);
193 
194 
195 };
196 
197 
198 #endif
199 
200 /****************************************************************************/
201