Eclipse 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-2019 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 
28 #include <fx.h>
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
35 class SUMORTree;
36 class Position;
37 
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
48 public:
51 
52 
54  virtual ~GUIShapeContainer();
55 
70  virtual bool addPolygon(const std::string& id, const std::string& type, const RGBColor& color, double layer,
71  double angle, const std::string& imgFile, bool relativePath, const PositionVector& shape, bool geo,
72  bool fill, double lineWidth, bool ignorePruning = false) override;
73 
76  PolygonDynamics* addPolygonDynamics(double simtime,
77  std::string polyID,
78  SUMOTrafficObject* trackedObject,
79  const std::vector<double>& timeSpan,
80  const std::vector<double>& alphaSpan,
81  bool looped,
82  bool rotate) override;
83 
87 
105  virtual bool addPOI(const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo,
106  const std::string& lane, double posOverLane, double posLat, double layer, double angle,
107  const std::string& imgFile, bool relativePath, double width, double height, bool ignorePruning = false) override;
108 
109 
110 
115  virtual bool removePolygon(const std::string& id, bool useLock = true) override;
116 
117 
122  virtual bool removePOI(const std::string& id) override;
123 
124 
125 
130  virtual void movePOI(const std::string& id, const Position& pos) override;
131 
132 
137  virtual void reshapePolygon(const std::string& id, const PositionVector& shape) override;
138 
139 
140 
142  std::vector<GUIGlID> getPOIIds() const;
144  std::vector<GUIGlID> getPolygonIDs() const;
145 
146 
148  myAllowReplacement = true;
149  }
150 
151 private:
153  mutable FXMutex myLock;
154 
157 
158 
161 };
162 
163 
164 #endif
165 
166 /****************************************************************************/
FXMutex myLock
The mutex for adding/removing operations.
long long int SUMOTime
Definition: SUMOTime.h:35
virtual bool removePolygon(const std::string &id, bool useLock=true) override
Removes a polygon from the container.
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 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) override
Builds a polygon 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:69
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) override
Builds a POI using the given values and adds it to the container.
virtual void reshapePolygon(const std::string &id, const PositionVector &shape) override
Assigns a shape to the named polygon.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
A list of positions.
virtual ~GUIShapeContainer()
Destructor.
GUIShapeContainer(SUMORTree &vis)
Constructor.
PolygonDynamics * addPolygonDynamics(double simtime, std::string polyID, SUMOTrafficObject *trackedObject, const std::vector< double > &timeSpan, const std::vector< double > &alphaSpan, bool looped, bool rotate) override
Adds dynamics to the given Polygon,.
Representation of a vehicle or person.
virtual void movePOI(const std::string &id, const Position &pos) override
Assigns a new position to the named PoI.
virtual bool removePOI(const std::string &id) override
Removes a PoI from the container.
SUMOTime polygonDynamicsUpdate(SUMOTime t, PolygonDynamics *pd) override
Update PolygonDynamics,.
std::vector< GUIGlID > getPolygonIDs() const
Returns the gl-ids of all polygons.
bool myAllowReplacement
whether existing ids shall be replaced