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 
68  virtual bool addPolygon(const std::string& id, const std::string& type,
69  const RGBColor& color, double layer,
70  double angle, const std::string& imgFile,
71  bool relativePath, const PositionVector& shape, bool geo,
72  bool fill, double lineWidth, bool ignorePruning = false);
73 
91  virtual bool addPOI(const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo,
92  const std::string& lane, double posOverLane, double posLat, double layer, double angle,
93  const std::string& imgFile, bool relativePath, double width, double height, bool ignorePruning = false);
94 
99  virtual bool removePolygon(const std::string& id);
100 
105  virtual bool removePOI(const std::string& id);
106 
111  virtual void movePOI(const std::string& id, const Position& pos);
112 
117  virtual void reshapePolygon(const std::string& id, const PositionVector& shape);
118 
120  inline const Polygons& getPolygons() const {
121  return myPolygons;
122  }
123 
125  inline const POIs& getPOIs() const {
126  return myPOIs;
127  }
128 
129 protected:
131  virtual bool add(SUMOPolygon* poly, bool ignorePruning = false);
132 
134  virtual bool add(PointOfInterest* poi, bool ignorePruning = false);
135 
136 protected:
138  Polygons myPolygons;
139 
141  POIs myPOIs;
142 };
143 
144 
145 #endif
146 
147 /****************************************************************************/
148 
const Polygons & getPolygons() const
Returns all polygons.
POIs myPOIs
stored POIs
Polygons myPolygons
stored Polygons
ShapeContainer()
Constructor.
Storage for geometrical objects.
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, double lineWidth, bool ignorePruning=false)
Builds a polygon using the given values and adds it to the container.
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 ~ShapeContainer()
Destructor.
const POIs & getPOIs() const
Returns all pois.