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-2015 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 using namespace SUMO;
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
44 class Position;
45 class PositionVector;
46 class RGBColor;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
57 public:
60 
61 
63  virtual ~ShapeContainer();
64 
67 
79  virtual bool addPolygon(const std::string& id, const std::string& type,
80  const RGBColor& color, SUMOReal layer,
81  SUMOReal angle, const std::string& imgFile,
82  const PositionVector& shape, bool fill);
83 
84 
97  virtual bool addPOI(const std::string& id, const std::string& type,
98  const RGBColor& color, SUMOReal layer, SUMOReal angle, const std::string& imgFile,
99  const Position& pos, SUMOReal width, SUMOReal height);
100 
101 
102 
107  virtual bool removePolygon(const std::string& id);
108 
109 
114  virtual bool removePOI(const std::string& id);
115 
116 
117 
122  virtual void movePOI(const std::string& id, const Position& pos);
123 
124 
129  virtual void reshapePolygon(const std::string& id, const PositionVector& shape);
130 
131 
132 
134  inline const Polygons& getPolygons() const {
135  return myPolygons;
136  }
137 
138 
140  inline const POIs& getPOIs() const {
141  return myPOIs;
142  }
143 
144 
145 protected:
147  Polygons myPolygons;
148 
150  POIs myPOIs;
151 
152 };
153 
154 
155 #endif
156 
157 /****************************************************************************/
158 
POIs myPOIs
stored POIs
Polygons myPolygons
stored Polygons
Storage for geometrical objects.
const Polygons & getPolygons() const
Returns all polygons.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
A list of positions.
const POIs & getPOIs() const
Returns all pois.
NamedObjectCont< PointOfInterest * > POIs
NamedObjectCont< SUMO::Polygon * > Polygons
Definition: Polygon.h:43
#define SUMOReal
Definition: config.h:218