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-2017 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, double lanePos);
100 
106  void save(const std::string& file, bool useGeo);
107 
111  void saveDlrTDP(const std::string& prefix);
112 
113 
122  int getEnumIDFor(const std::string& key);
123 
124 
125 private:
127  std::map<std::string, std::pair<std::string, double> > myLanePosPois;
128 
130  std::map<std::string, int> myIDEnums;
131 
134 
136  bool myDoPrune;
137 
139  std::vector<std::string> myRemoveByNames;
140 
141  static void writeDlrTDPHeader(OutputDevice& device, const OptionsCont& oc);
142 
143 private:
146 
149 
150 
151 };
152 
153 
154 #endif
155 
156 /****************************************************************************/
157 
PCPolyContainer(bool prune, const Boundary &pruningBoundary, const std::vector< std::string > &removeByNames)
Constructor.
void saveDlrTDP(const std::string &prefix)
Saves the stored polygons and pois into the given file in dlrTDP format.
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, double lanePos)
A storage for options typed value containers)
Definition: OptionsCont.h:99
std::vector< std::string > myRemoveByNames
List of names of polygons/pois that shall be removed.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
A point-of-interest.
std::map< std::string, std::pair< std::string, double > > myLanePosPois
An id to pos map for lane pos specs.
bool myDoPrune
Information whether the pruning boundary shall be used.
static void writeDlrTDPHeader(OutputDevice &device, const OptionsCont &oc)