SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIShapeContainer.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // Storage for geometrical objects extended by mutexes
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef GUIShapeContainer_h
22 #define GUIShapeContainer_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 
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 class SUMORTree;
42 class Position;
43 class MFXMutex;
44 
45 
46 // ===========================================================================
47 // class definitions
48 // ===========================================================================
55 public:
58 
59 
61  virtual ~GUIShapeContainer();
62 
74  virtual bool addPolygon(const std::string& id, const std::string& type,
75  const RGBColor& color, SUMOReal layer,
76  SUMOReal angle, const std::string& imgFile,
77  const PositionVector& shape, bool fill);
78 
79 
92  virtual bool addPOI(const std::string& id, const std::string& type,
93  const RGBColor& color, SUMOReal layer, SUMOReal angle, const std::string& imgFile,
94  const Position& pos, SUMOReal width, SUMOReal height);
95 
96 
97 
102  virtual bool removePolygon(const std::string& id);
103 
104 
109  virtual bool removePOI(const std::string& id);
110 
111 
112 
117  virtual void movePOI(const std::string& id, const Position& pos);
118 
119 
124  virtual void reshapePolygon(const std::string& id, const PositionVector& shape);
125 
126 
127 
129  std::vector<GUIGlID> getPOIIds() const;
131  std::vector<GUIGlID> getPolygonIDs() const;
132 
133 
134 private:
136  mutable MFXMutex myLock;
137 
140 
141 };
142 
143 
144 #endif
145 
146 /****************************************************************************/
147 
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'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:215
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.