 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
38 myAllowReplacement(false) {
47 const std::string& lane,
double posOverLane,
double posLat,
double layer,
double angle,
48 const std::string& imgFile,
bool relativePath,
double width,
double height,
bool ) {
49 GUIPointOfInterest* p =
new GUIPointOfInterest(
id, type, color, pos, geo, lane, posOverLane, posLat, layer, angle, imgFile, relativePath, width, height);
50 FXMutexLock locker(
myLock);
71 double angle,
const std::string& imgFile,
bool relativePath,
72 const PositionVector& shape,
bool geo,
bool fill,
double lineWidth,
bool ) {
73 GUIPolygon* p =
new GUIPolygon(
id, type, color, shape, geo, fill, lineWidth, layer, angle, imgFile, relativePath);
74 FXMutexLock locker(
myLock);
96 const std::vector<double>& timeSpan,
97 const std::vector<double>& alphaSpan,
110 FXMutexLock locker(
myLock);
115 assert(p !=
nullptr);
129 FXMutexLock* locker =
nullptr;
131 locker =
new FXMutexLock(
myLock);
142 FXMutexLock locker(
myLock);
154 FXMutexLock locker(
myLock);
158 static_cast<Position*
>(p)->set(pos);
166 FXMutexLock locker(
myLock);
179 FXMutexLock locker(
myLock);
180 std::vector<GUIGlID> ret;
181 for (
const auto& poi :
getPOIs()) {
190 FXMutexLock locker(
myLock);
191 std::vector<GUIGlID> ret;
Representation of a vehicle or person.
#define WRITE_WARNING(msg)
virtual SUMOTime polygonDynamicsUpdate(SUMOTime t, PolygonDynamics *pd)
Regular update event for updating polygon dynamics.
FXMutex myLock
The mutex for adding/removing operations.
SUMORTree & myVis
The RTree structure to add and remove visualization elements.
virtual void movePOI(const std::string &id, const Position &pos) override
Assigns a new position to the named PoI.
SUMOTime polygonDynamicsUpdate(SUMOTime t, PolygonDynamics *pd) override
Update PolygonDynamics,.
virtual bool removePOI(const std::string &id) override
Removes a PoI from the container.
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.
virtual ~GUIShapeContainer()
Destructor.
A RT-tree for efficient storing of SUMO's GL-objects.
virtual bool removePolygon(const std::string &id, bool useLock=true) override
Removes a polygon from the container.
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.
bool remove(const std::string &id, const bool del=true)
Removes an item.
virtual void setShape(const PositionVector &shape)
set a new shape and update the tesselation
void removeAdditionalGLObject(GUIGlObject *o)
Removes an additional object (detector/shape/trigger) from being visualised.
GUIGlID getGlID() const
Returns the numerical id of the object.
void setRTree(SUMORTree *rtree)
Set the RTree.
virtual PolygonDynamics * addPolygonDynamics(double simtime, std::string polyID, SUMOTrafficObject *trackedObject, const std::vector< double > &timeSpan, const std::vector< double > &alphaSpan, bool looped, bool rotate)
Adds dynamics (animation / tracking) to the given polygon.
A point in 2D or 3D with translation and scaling methods.
const POIs & getPOIs() const
Returns all pois.
std::vector< GUIGlID > getPolygonIDs() const
Returns the gl-ids of all polygons.
virtual void reshapePolygon(const std::string &id, const PositionVector &shape) override
Assigns a shape to the named polygon.
T get(const std::string &id) const
Retrieves an item.
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,.
std::vector< GUIGlID > getPOIIds() const
Returns the gl-ids of all pois.
virtual bool removePolygon(const std::string &id, bool useLock=true)
Removes a polygon from the container.
void addAdditionalGLObject(GUIGlObject *o)
Adds an additional object (detector/shape/trigger) for visualisation.
SUMOPolygon * getPolygon() const
const Polygons & getPolygons() const
Returns all polygons.
Polygons myPolygons
stored Polygons
GUIShapeContainer(SUMORTree &vis)
Constructor.
bool myAllowReplacement
whether existing ids shall be replaced
bool add(const std::string &id, T item)
Adds an item.