37 myAllowReplacement(false) {
46 const std::string& lane,
double posOverLane,
bool friendlyPos,
double posLat,
const std::string& icon,
47 double layer,
double angle,
const std::string& imgFile,
bool relativePath,
double width,
double height,
49 GUIPointOfInterest* p =
new GUIPointOfInterest(
id, type, color, pos, geo, lane, posOverLane, friendlyPos, posLat, icon,
50 layer, angle, imgFile, relativePath, width, height);
51 FXMutexLock locker(
myLock);
72 double angle,
const std::string& imgFile,
bool relativePath,
73 const PositionVector& shape,
bool geo,
bool fill,
double lineWidth,
bool ,
74 const std::string& name) {
75 GUIPolygon* p =
new GUIPolygon(
id, type, color, shape, geo, fill, lineWidth, layer, angle, imgFile, relativePath, name);
76 FXMutexLock locker(
myLock);
100 const std::vector<double>& timeSpan,
101 const std::vector<double>& alphaSpan,
114 FXMutexLock locker(
myLock);
116 assert(p !=
nullptr);
133 FXMutexLock* locker =
nullptr;
135 locker =
new FXMutexLock(
myLock);
146 FXMutexLock locker(
myLock);
158 FXMutexLock locker(
myLock);
162 static_cast<Position*
>(p)->set(pos);
170 FXMutexLock locker(
myLock);
183 FXMutexLock locker(
myLock);
184 std::vector<GUIGlID> ret;
185 for (
const auto& poi :
getPOIs()) {
194 FXMutexLock locker(
myLock);
195 std::vector<GUIGlID> ret;
225 for (std::string type : inactivePolygonTypes) {
#define WRITE_WARNINGF(...)
GUIGlID getGlID() const
Returns the numerical id of the object.
void activate(bool isActive)
virtual void setShape(const PositionVector &shape) override
set a new shape and update the tesselation
void removeInactivePolygonTypes(std::set< std::string > inactivePolygonTypes)
Remove some polygon types that were deemed as inactive.
void setInactivePolygonTypes(std::set< std::string > inactivePolygonTypes)
Sets polygon types that define which one is active or not.
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.
SUMORTree & myVis
The RTree structure to add and remove visualization elements.
virtual ~GUIShapeContainer()
Destructor.
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, const std::string &name=Shape::DEFAULT_NAME) override
Builds a polygon using the given values and adds it to the container.
void allowReplacement()
allow replacement
SUMOTime polygonDynamicsUpdate(SUMOTime t, PolygonDynamics *pd) override
Update PolygonDynamics,.
std::vector< GUIGlID > getPOIIds() const
Returns the gl-ids of all pois.
std::set< std::string > myInactivePolygonTypes
The polygon types that define the inactive polygons.
std::vector< GUIGlID > getPolygonIDs() const
Returns the gl-ids of all polygons.
virtual bool removePolygon(const std::string &id, bool useLock=true) override
Removes a polygon from the container.
FXMutex myLock
The mutex for adding/removing operations.
GUIShapeContainer(SUMORTree &vis)
Constructor.
void computeActivePolygons(void)
Determine which polygons are active based on their type.
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, bool friendlyPos, double posLat, const std::string &icon, 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 myAllowReplacement
whether existing ids shall be replaced
virtual void reshapePolygon(const std::string &id, const PositionVector &shape) override
Assigns a shape to the named polygon.
void addInactivePolygonTypes(std::set< std::string > inactivePolygonTypes)
Adds new polygon types to the set of inactive ones.
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,.
T get(const std::string &id) const
Retrieves an item.
bool remove(const std::string &id, const bool del=true)
Removes an item.
bool add(const std::string &id, T item)
Adds an item.
SUMOPolygon * getPolygon() const
void setRTree(SUMORTree *rtree)
Set the RTree.
A point in 2D or 3D with translation and scaling methods.
A RT-tree for efficient storing of SUMO's GL-objects.
void addAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Adds an additional object (detector/shape/trigger) for visualisation.
void removeAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Removes an additional object (detector/shape/trigger) from being visualised.
Representation of a vehicle, person, or container.
virtual SUMOTime polygonDynamicsUpdate(SUMOTime t, PolygonDynamics *pd)
Regular update event for updating polygon dynamics.
virtual bool removePolygon(const std::string &id, bool useLock=true)
Removes a polygon from the container.
const Polygons & getPolygons() const
Returns all polygons.
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.
const POIs & getPOIs() const
Returns all pois.
Polygons myPolygons
stored Polygons
const std::string & getShapeType() const
Returns the (abstract) type of the Shape.