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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // Storage for geometrical objects extended by mutexes
18 /****************************************************************************/
19 #ifndef GUIShapeContainer_h
20 #define GUIShapeContainer_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
35 class SUMORTree;
36 class Position;
37 class MFXMutex;
38 
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
49 public:
52 
53 
55  virtual ~GUIShapeContainer();
56 
71  virtual bool addPolygon(const std::string& id, const std::string& type, const RGBColor& color, double layer,
72  double angle, const std::string& imgFile, bool relativePath, const PositionVector& shape, bool geo,
73  bool fill, double lineWidth, bool ignorePruning = false);
74 
75 
93  virtual bool addPOI(const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo,
94  const std::string& lane, double posOverLane, double posLat, double layer, double angle,
95  const std::string& imgFile, bool relativePath, double width, double height, bool ignorePruning = false);
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 
136  myAllowReplacement = true;
137  }
138 
139 private:
141  mutable MFXMutex myLock;
142 
145 
146 
149 };
150 
151 
152 #endif
153 
154 /****************************************************************************/
155 
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.
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, bool relativePath, double width, double height, bool ignorePruning=false)
Builds a POI using the given values and adds it to the container.
Storage for geometrical objects.
A RT-tree for efficient storing of SUMO&#39;s GL-objects.
Definition: SUMORTree.h:69
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:39
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.
virtual bool addPolygon(const std::string &id, const std::string &type, const RGBColor &color, double layer, double angle, const std::string &imgFile, bool relativePath, const PositionVector &shape, bool geo, bool fill, double lineWidth, bool ignorePruning=false)
Builds a polygon using the given values and adds it to the container.
bool myAllowReplacement
whether existing ids shall be replaced