Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GUIShapeContainer.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2009-2023 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
20// Storage for geometrical objects extended by mutexes
21/****************************************************************************/
22#pragma once
23#include <config.h>
24
28
29// ===========================================================================
30// class declarations
31// ===========================================================================
32class SUMORTree;
33class Position;
34
35
36// ===========================================================================
37// class definitions
38// ===========================================================================
45public:
48
50 virtual ~GUIShapeContainer();
51
66 virtual bool addPolygon(const std::string& id, const std::string& type, const RGBColor& color, double layer,
67 double angle, const std::string& imgFile, bool relativePath, const PositionVector& shape, bool geo,
68 bool fill, double lineWidth, bool ignorePruning = false,
69 const std::string& name = Shape::DEFAULT_NAME) override;
70
73 PolygonDynamics* addPolygonDynamics(double simtime,
74 std::string polyID,
75 SUMOTrafficObject* trackedObject,
76 const std::vector<double>& timeSpan,
77 const std::vector<double>& alphaSpan,
78 bool looped,
79 bool rotate) override;
80
84
103 virtual bool addPOI(const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo,
104 const std::string& lane, double posOverLane, bool friendlyPos, double posLat, double layer, double angle,
105 const std::string& imgFile, bool relativePath, double width, double height, bool ignorePruning = false) override;
106
111 virtual bool removePolygon(const std::string& id, bool useLock = true) override;
112
117 virtual bool removePOI(const std::string& id) override;
118
123 virtual void movePOI(const std::string& id, const Position& pos) override;
124
129 virtual void reshapePolygon(const std::string& id, const PositionVector& shape) override;
130
132 std::vector<GUIGlID> getPOIIds() const;
133
135 std::vector<GUIGlID> getPolygonIDs() const;
136
138 void allowReplacement();
139
140private:
142 mutable FXMutex myLock;
143
146
149};
long long int SUMOTime
Definition GUI.h:36
Storage for geometrical objects extended by mutexes.
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,.
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, 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.
std::vector< GUIGlID > getPOIIds() const
Returns the gl-ids of all pois.
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.
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.
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,.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.
A RT-tree for efficient storing of SUMO's GL-objects.
Definition SUMORTree.h:66
Representation of a vehicle, person, or container.
Storage for geometrical objects.
static const std::string DEFAULT_NAME
Definition Shape.h:51