SUMO - Simulation of Urban MObility
PCPolyContainer.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // A storage for loaded polygons and pois
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2005-2016 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 PCPolyContainer_h
23 #define PCPolyContainer_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 <string>
36 #include <map>
37 #include <vector>
38 #include <utils/shapes/Polygon.h>
41 #include <utils/geom/Boundary.h>
43 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
53 public:
59  PCPolyContainer(bool prune, const Boundary& pruningBoundary,
60  const std::vector<std::string>& removeByNames);
61 
62 
65 
66 
80  bool add(SUMO::Polygon* poly, bool ignorePruning = false);
81 
82 
96  bool add(PointOfInterest* poi, bool ignorePruning = false);
97 
98 
99  void addLanePos(const std::string& poiID, const std::string& laneID, SUMOReal lanePos);
100 
106  void save(const std::string& file, bool useGeo);
107 
108 
117  int getEnumIDFor(const std::string& key);
118 
119 
120 private:
122  std::map<std::string, std::pair<std::string, SUMOReal> > myLanePosPois;
123 
125  std::map<std::string, int> myIDEnums;
126 
129 
131  bool myDoPrune;
132 
134  std::vector<std::string> myRemoveByNames;
135 
136 
137 private:
140 
143 
144 
145 };
146 
147 
148 #endif
149 
150 /****************************************************************************/
151 
PCPolyContainer(bool prune, const Boundary &pruningBoundary, const std::vector< std::string > &removeByNames)
Constructor.
void save(const std::string &file, bool useGeo)
Saves the stored polygons and pois into the given file.
Storage for geometrical objects.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
A storage for loaded polygons and pois.
A 2D- or 3D-polygon.
Definition: Polygon.h:57
Boundary myPruningBoundary
The boundary that described the rectangle within which an object must be in order to be kept...
PCPolyContainer & operator=(const PCPolyContainer &s)
Invalidated assignment operator.
~PCPolyContainer()
Destructor.
std::map< std::string, int > myIDEnums
An id to int map for proper enumeration.
bool add(SUMO::Polygon *poly, bool ignorePruning=false)
Adds a polygon to the storage.
int getEnumIDFor(const std::string &key)
Retuns a unique id for a given name.
void addLanePos(const std::string &poiID, const std::string &laneID, SUMOReal lanePos)
std::map< std::string, std::pair< std::string, SUMOReal > > myLanePosPois
An id to pos map for lane pos specs.
std::vector< std::string > myRemoveByNames
List of names of polygons/pois that shall be removed.
#define SUMOReal
Definition: config.h:213
A point-of-interest.
bool myDoPrune
Information whether the pruning boundary shall be used.