SUMO - Simulation of Urban MObility
ShapeContainer.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2005-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // Storage for geometrical objects, sorted by the layers they are in
18 /****************************************************************************/
19 #ifndef ShapeContainer_h
20 #define ShapeContainer_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <string>
30 #include "PointOfInterest.h"
31 #include "SUMOPolygon.h"
32 
33 
34 // ===========================================================================
35 // class definitions
36 // ===========================================================================
42 public:
43 
47 
50 
52  virtual ~ShapeContainer();
53 
67  virtual bool addPolygon(const std::string& id, const std::string& type,
68  const RGBColor& color, double layer,
69  double angle, const std::string& imgFile,
70  bool relativePath, const PositionVector& shape, bool geo,
71  bool fill, bool ignorePruning = false);
72 
90  virtual bool addPOI(const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo,
91  const std::string& lane, double posOverLane, double posLat, double layer, double angle,
92  const std::string& imgFile, bool relativePath, double width, double height, bool ignorePruning = false);
93 
98  virtual bool removePolygon(const std::string& id);
99 
104  virtual bool removePOI(const std::string& id);
105 
110  virtual void movePOI(const std::string& id, const Position& pos);
111 
116  virtual void reshapePolygon(const std::string& id, const PositionVector& shape);
117 
119  inline const Polygons& getPolygons() const {
120  return myPolygons;
121  }
122 
124  inline const POIs& getPOIs() const {
125  return myPOIs;
126  }
127 
128 protected:
130  virtual bool add(SUMOPolygon* poly, bool ignorePruning = false);
131 
133  virtual bool add(PointOfInterest* poi, bool ignorePruning = false);
134 
135 protected:
137  Polygons myPolygons;
138 
140  POIs myPOIs;
141 };
142 
143 
144 #endif
145 
146 /****************************************************************************/
147 
const Polygons & getPolygons() const
Returns all polygons.
POIs myPOIs
stored POIs
Polygons myPolygons
stored Polygons
ShapeContainer()
Constructor.
Storage for geometrical objects.
NamedObjectCont< PointOfInterest * > POIs
virtual void movePOI(const std::string &id, const Position &pos)
Assigns a new position to the named PoI.
virtual bool removePolygon(const std::string &id)
Removes a polygon from the container.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
virtual bool removePOI(const std::string &id)
Removes a PoI from the container.
A list of positions.
virtual bool addPOI(const std::string &id, const std::string &type, const RGBColor &color, const Position &pos, bool geo, const std::string &lane, double posOverLane, double posLat, double layer, double angle, const std::string &imgFile, bool relativePath, double width, double height, bool ignorePruning=false)
Builds a POI using the given values and adds it to the container.
virtual void reshapePolygon(const std::string &id, const PositionVector &shape)
Assigns a shape to the named polygon.
virtual bool add(SUMOPolygon *poly, bool ignorePruning=false)
add polygon
A point-of-interest.
NamedObjectCont< SUMOPolygon * > Polygons
containers
virtual bool addPolygon(const std::string &id, const std::string &type, const RGBColor &color, double layer, double angle, const std::string &imgFile, bool relativePath, const PositionVector &shape, bool geo, bool fill, bool ignorePruning=false)
Builds a polygon using the given values and adds it to the container.
virtual ~ShapeContainer()
Destructor.
const POIs & getPOIs() const
Returns all pois.