SUMO - Simulation of Urban MObility
GUIShapeContainer.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2009-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 extended by mutexes
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 
75  virtual bool addPolygon(const std::string& id, const std::string& type, const RGBColor& color, double layer,
76  double angle, const std::string& imgFile, const PositionVector& shape, bool geo,
77  bool fill, bool ignorePruning = false);
78 
79 
96  virtual bool addPOI(const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo,
97  const std::string& lane, double posOverLane, double posLat, double layer, double angle,
98  const std::string& imgFile, double width, double height, bool ignorePruning = false);
99 
100 
101 
106  virtual bool removePolygon(const std::string& id);
107 
108 
113  virtual bool removePOI(const std::string& id);
114 
115 
116 
121  virtual void movePOI(const std::string& id, const Position& pos);
122 
123 
128  virtual void reshapePolygon(const std::string& id, const PositionVector& shape);
129 
130 
131 
133  std::vector<GUIGlID> getPOIIds() const;
135  std::vector<GUIGlID> getPolygonIDs() const;
136 
137 
138 private:
140  mutable MFXMutex myLock;
141 
144 
145 };
146 
147 
148 #endif
149 
150 /****************************************************************************/
151 
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.
Storage for geometrical objects extended by mutexes.
std::vector< GUIGlID > getPOIIds() const
Returns the gl-ids of all 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.
SUMORTree & myVis
The RTree structure to add and remove visualization elements.
Storage for geometrical objects.
A RT-tree for efficient storing of SUMO&#39;s GL-objects.
Definition: SUMORTree.h:73
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:45
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 ~GUIShapeContainer()
Destructor.
GUIShapeContainer(SUMORTree &vis)
Constructor.
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.