SUMO - Simulation of Urban MObility
PCPolyContainer.h
Go to the documentation of this file.
00001 /****************************************************************************/
00008 // A storage for loaded polygons and pois
00009 /****************************************************************************/
00010 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00011 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00012 /****************************************************************************/
00013 //
00014 //   This file is part of SUMO.
00015 //   SUMO is free software: you can redistribute it and/or modify
00016 //   it under the terms of the GNU General Public License as published by
00017 //   the Free Software Foundation, either version 3 of the License, or
00018 //   (at your option) any later version.
00019 //
00020 /****************************************************************************/
00021 #ifndef PCPolyContainer_h
00022 #define PCPolyContainer_h
00023 
00024 
00025 // ===========================================================================
00026 // included modules
00027 // ===========================================================================
00028 #ifdef _MSC_VER
00029 #include <windows_config.h>
00030 #else
00031 #include <config.h>
00032 #endif
00033 
00034 #include <string>
00035 #include <map>
00036 #include <vector>
00037 #include <utils/shapes/Polygon.h>
00038 #include <utils/shapes/PointOfInterest.h>
00039 #include <utils/geom/Boundary.h>
00040 #include <utils/common/UtilExceptions.h>
00041 
00042 
00043 // ===========================================================================
00044 // class definitions
00045 // ===========================================================================
00050 class PCPolyContainer {
00051 public:
00057     PCPolyContainer(bool prune, const Boundary& prunningBoundary,
00058                     const std::vector<std::string> &removeByNames) ;
00059 
00060 
00062     ~PCPolyContainer() ;
00063 
00064 
00080     bool insert(const std::string& id, Polygon* poly, int layer,
00081                 bool ignorePrunning = false) ;
00082 
00083 
00099     bool insert(const std::string& id, PointOfInterest* poi, int layer,
00100                 bool ignorePrunning = false) ;
00101 
00102 
00106     unsigned int getNoPolygons() {
00107         return (unsigned int) myPolyCont.size();
00108     }
00109 
00110 
00114     unsigned int getNoPOIs() {
00115         return (unsigned int) myPOICont.size();
00116     }
00117 
00118 
00123     void clear() ;
00124 
00125 
00127     void report() ;
00128 
00129 
00134     bool containsPolygon(const std::string& kidey) ;
00135 
00136 
00141     void save(const std::string& file);
00142 
00143 
00152     int getEnumIDFor(const std::string& key) ;
00153 
00154 
00155 public:
00157     typedef std::map<std::string, Polygon*> PolyCont;
00159     PolyCont myPolyCont;
00160 
00162     typedef std::map<std::string, PointOfInterest*> POICont;
00164     POICont myPOICont;
00165 
00167     std::map<std::string, int> myIDEnums;
00168 
00170     std::map<Polygon*, int> myPolyLayerMap;
00171 
00173     std::map<PointOfInterest*, int> myPOILayerMap;
00174 
00175 
00177     Boundary myPrunningBoundary;
00178 
00180     bool myDoPrunne;
00181 
00183     std::vector<std::string> myRemoveByNames;
00184 
00185 
00186 private:
00188     PCPolyContainer(const PCPolyContainer& s);
00189 
00191     PCPolyContainer& operator=(const PCPolyContainer& s);
00192 
00193 
00194 };
00195 
00196 
00197 #endif
00198 
00199 /****************************************************************************/
00200 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines