SUMO - Simulation of Urban MObility
GUIShapeContainer.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Storage for geometrical objects extended by mutexes
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2009-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 GUIShapeContainer_h
23 #define GUIShapeContainer_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 
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class SUMORTree;
43 class Position;
44 class MFXMutex;
45 
46 
47 // ===========================================================================
48 // class definitions
49 // ===========================================================================
56 public:
59 
60 
62  virtual ~GUIShapeContainer();
63 
75  virtual bool addPolygon(const std::string& id, const std::string& type,
76  const RGBColor& color, SUMOReal layer,
77  SUMOReal angle, const std::string& imgFile,
78  const PositionVector& shape, bool fill);
79 
80 
93  virtual bool addPOI(const std::string& id, const std::string& type,
94  const RGBColor& color, SUMOReal layer, SUMOReal angle, const std::string& imgFile,
95  const Position& pos, SUMOReal width, SUMOReal height);
96 
97 
98 
103  virtual bool removePolygon(const std::string& id);
104 
105 
110  virtual bool removePOI(const std::string& id);
111 
112 
113 
118  virtual void movePOI(const std::string& id, const Position& pos);
119 
120 
125  virtual void reshapePolygon(const std::string& id, const PositionVector& shape);
126 
127 
128 
130  std::vector<GUIGlID> getPOIIds() const;
132  std::vector<GUIGlID> getPolygonIDs() const;
133 
134 
135 private:
137  mutable MFXMutex myLock;
138 
141 
142 };
143 
144 
145 #endif
146 
147 /****************************************************************************/
148 
Storage for geometrical objects extended by mutexes.
std::vector< GUIGlID > getPOIIds() const
Returns the gl-ids of all pois.
SUMORTree & myVis
The RTree structure to add and remove visualization elements.
Storage for geometrical objects.
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)
Builds a POI using the given values and adds it to the container.
A RT-tree for efficient storing of SUMO&#39;s GL-objects.
Definition: SUMORTree.h:74
virtual bool removePOI(const std::string &id)
Removes a PoI from the container.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
A list of positions.
virtual void movePOI(const std::string &id, const Position &pos)
Assigns a new position to the named PoI.
MFXMutex myLock
The mutex for adding/removing operations.
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)
Builds a polygon using the given values and adds it to the container.
virtual ~GUIShapeContainer()
Destructor.
GUIShapeContainer(SUMORTree &vis)
Constructor.
#define SUMOReal
Definition: config.h:214
virtual bool removePolygon(const std::string &id)
Removes a polygon from the container.
std::vector< GUIGlID > getPolygonIDs() const
Returns the gl-ids of all polygons.
virtual void reshapePolygon(const std::string &id, const PositionVector &shape)
Assigns a shape to the named polygon.