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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // Storage for geometrical objects, sorted by the layers they are in
20 /****************************************************************************/
21 #ifndef ShapeContainer_h
22 #define ShapeContainer_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <string>
36 #include "PointOfInterest.h"
37 #include "SUMOPolygon.h"
38 
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
48 public:
49 
53 
56 
58  virtual ~ShapeContainer();
59 
72  virtual bool addPolygon(const std::string& id, const std::string& type,
73  const RGBColor& color, double layer,
74  double angle, const std::string& imgFile,
75  const PositionVector& shape, bool geo,
76  bool fill, bool ignorePruning = false);
77 
94  virtual bool addPOI(const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo,
95  const std::string& lane, double posOverLane, double posLat, double layer, double angle,
96  const std::string& imgFile, double width, double height, bool ignorePruning = false);
97 
102  virtual bool removePolygon(const std::string& id);
103 
108  virtual bool removePOI(const std::string& id);
109 
114  virtual void movePOI(const std::string& id, const Position& pos);
115 
120  virtual void reshapePolygon(const std::string& id, const PositionVector& shape);
121 
123  inline const Polygons& getPolygons() const {
124  return myPolygons;
125  }
126 
128  inline const POIs& getPOIs() const {
129  return myPOIs;
130  }
131 
132 protected:
134  virtual bool add(SUMOPolygon* poly, bool ignorePruning = false);
135 
137  virtual bool add(PointOfInterest* poi, bool ignorePruning = false);
138 
139 protected:
141  Polygons myPolygons;
142 
144  POIs myPOIs;
145 };
146 
147 
148 #endif
149 
150 /****************************************************************************/
151 
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 bool addPolygon(const std::string &id, const std::string &type, const RGBColor &color, double layer, double angle, const std::string &imgFile, const PositionVector &shape, bool geo, bool fill, bool ignorePruning=false)
Builds a polygon using the given values and adds it to the container.
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:45
virtual bool removePOI(const std::string &id)
Removes a PoI from the container.
A list of positions.
virtual void reshapePolygon(const std::string &id, const PositionVector &shape)
Assigns a shape to the named polygon.
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, double width, double height, bool ignorePruning=false)
Builds a POI using the given values and adds it to the container.
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.