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.sourceforge.net/
11 // Copyright (C) 2001-2012 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 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
51 public:
57  PCPolyContainer(bool prune, const Boundary& prunningBoundary,
58  const std::vector<std::string> &removeByNames) ;
59 
60 
63 
64 
80  bool insert(const std::string& id, Polygon* poly, int layer,
81  bool ignorePrunning = false) ;
82 
83 
99  bool insert(const std::string& id, PointOfInterest* poi, int layer,
100  bool ignorePrunning = false) ;
101 
102 
106  unsigned int getNoPolygons() {
107  return (unsigned int) myPolyCont.size();
108  }
109 
110 
114  unsigned int getNoPOIs() {
115  return (unsigned int) myPOICont.size();
116  }
117 
118 
123  void clear() ;
124 
125 
127  void report() ;
128 
129 
134  bool containsPolygon(const std::string& kidey) ;
135 
136 
141  void save(const std::string& file);
142 
143 
152  int getEnumIDFor(const std::string& key) ;
153 
154 
155 public:
157  typedef std::map<std::string, Polygon*> PolyCont;
160 
162  typedef std::map<std::string, PointOfInterest*> POICont;
165 
167  std::map<std::string, int> myIDEnums;
168 
170  std::map<Polygon*, int> myPolyLayerMap;
171 
173  std::map<PointOfInterest*, int> myPOILayerMap;
174 
175 
178 
181 
183  std::vector<std::string> myRemoveByNames;
184 
185 
186 private:
189 
192 
193 
194 };
195 
196 
197 #endif
198 
199 /****************************************************************************/
200