SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ShapeContainer.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Storage for geometrical objects, sorted by the layers they are in
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 ShapeContainer_h
23 #define ShapeContainer_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>
37 #include "PointOfInterest.h"
38 #include "Polygon.h"
39 
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
49 public:
52 
53 
55  virtual ~ShapeContainer();
56 
59 
71  virtual bool addPolygon(const std::string& id, const std::string& type,
72  const RGBColor& color, SUMOReal layer,
73  SUMOReal angle, const std::string& imgFile,
74  const PositionVector& shape, bool fill,
75  bool ignorePruning = false);
76 
77 
90  virtual bool addPOI(const std::string& id, const std::string& type,
91  const RGBColor& color, SUMOReal layer, SUMOReal angle, const std::string& imgFile,
92  const Position& pos, SUMOReal width, SUMOReal height, bool ignorePruning = false);
93 
94 
95 
100  virtual bool removePolygon(const std::string& id);
101 
102 
107  virtual bool removePOI(const std::string& id);
108 
109 
110 
115  virtual void movePOI(const std::string& id, const Position& pos);
116 
117 
122  virtual void reshapePolygon(const std::string& id, const PositionVector& shape);
123 
124 
125 
127  inline const Polygons& getPolygons() const {
128  return myPolygons;
129  }
130 
131 
133  inline const POIs& getPOIs() const {
134  return myPOIs;
135  }
136 
137 
138 protected:
139  virtual bool add(SUMO::Polygon* poly, bool ignorePruning = false);
140  virtual bool add(PointOfInterest* poi, bool ignorePruning = false);
141 
142 
143 protected:
145  Polygons myPolygons;
146 
148  POIs myPOIs;
149 
150 };
151 
152 
153 #endif
154 
155 /****************************************************************************/
156 
POIs myPOIs
stored POIs
Polygons myPolygons
stored Polygons
ShapeContainer()
Constructor.
Storage for geometrical objects.
const Polygons & getPolygons() const
Returns all polygons.
A 2D- or 3D-polygon.
Definition: Polygon.h:57
virtual void movePOI(const std::string &id, const Position &pos)
Assigns a new position to the named PoI.
virtual bool addPOI(const std::string &id, const std::string &type, const RGBColor &color, SUMOReal layer, SUMOReal angle, const std::string &imgFile, const Position &pos, SUMOReal width, SUMOReal height, bool ignorePruning=false)
Builds a POI using the given values and adds it to the container.
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:46
virtual bool add(SUMO::Polygon *poly, bool ignorePruning=false)
virtual bool removePOI(const std::string &id)
Removes a PoI from the container.
A list of positions.
const POIs & getPOIs() const
Returns all pois.
virtual void reshapePolygon(const std::string &id, const PositionVector &shape)
Assigns a shape to the named polygon.
NamedObjectCont< PointOfInterest * > POIs
NamedObjectCont< SUMO::Polygon * > Polygons
virtual bool addPolygon(const std::string &id, const std::string &type, const RGBColor &color, SUMOReal layer, SUMOReal angle, const std::string &imgFile, const PositionVector &shape, bool fill, bool ignorePruning=false)
Builds a polygon using the given values and adds it to the container.
#define SUMOReal
Definition: config.h:214
A point-of-interest.
virtual ~ShapeContainer()
Destructor.