SUMO - Simulation of Urban MObility
|
Storage for geometrical objects extended by mutexes. More...
#include <GUIShapeContainer.h>
Public Types | |
typedef NamedObjectCont < PointOfInterest * > | POIs |
typedef NamedObjectCont < Polygon * > | Polygons |
Public Member Functions | |
virtual bool | addPOI (const std::string &id, const std::string &type, const RGBColor &color, SUMOReal layer, SUMOReal angle, const std::string &imgFile, const Position &pos, SUMOReal width, SUMOReal height) |
Builds a POI using the given values and adds it to the container. | |
virtual bool | addPolygon (const std::string &id, const std::string &type, const RGBColor &color, SUMOReal layer, SUMOReal angle, const std::string &imgFile, const PositionVector &shape, bool fill) |
Builds a polygon using the given values and adds it to the container. | |
std::vector< GUIGlID > | getPOIIds () const |
Returns the gl-ids of all pois. | |
const POIs & | getPOIs () const |
Returns all pois. | |
std::vector< GUIGlID > | getPolygonIDs () const |
Returns the gl-ids of all polygons. | |
const Polygons & | getPolygons () const |
Returns all polygons. | |
GUIShapeContainer (SUMORTree &vis) | |
Constructor. | |
virtual void | movePOI (const std::string &id, const Position &pos) |
Assigns a new position to the named PoI. | |
virtual bool | removePOI (const std::string &id) |
Removes a PoI from the container. | |
virtual bool | removePolygon (const std::string &id) |
Removes a polygon from the container. | |
virtual void | reshapePolygon (const std::string &id, const PositionVector &shape) |
Assigns a shape to the named polygon. | |
virtual | ~GUIShapeContainer () |
Destructor. |
Protected Attributes | |
POIs | myPOIs |
stored POIs | |
Polygons | myPolygons |
stored Polygons |
Private Attributes | |
MFXMutex | myLock |
The mutex for adding/removing operations. | |
SUMORTree & | myVis |
The RTree structure to add and remove visualization elements. |
Storage for geometrical objects extended by mutexes.
Definition at line 55 of file GUIShapeContainer.h.
|
inherited |
Definition at line 66 of file ShapeContainer.h.
|
inherited |
Definition at line 65 of file ShapeContainer.h.
GUIShapeContainer::GUIShapeContainer | ( | SUMORTree & | vis | ) |
Constructor.
Definition at line 48 of file GUIShapeContainer.cpp.
|
virtual |
Destructor.
Definition at line 52 of file GUIShapeContainer.cpp.
|
virtual |
Builds a POI using the given values and adds it to the container.
[in] | id | The name of the POI |
[in] | type | The (abstract) type of the POI |
[in] | color | The color of the POI |
[in] | layer | The layer of the POI |
[in] | angle | The rotation of the POI |
[in] | imgFile | The raster image of the POI |
[in] | pos | The position of the POI |
[in] | width | The width of the POI image |
[in] | height | The height of the POI image |
Reimplemented from ShapeContainer.
Definition at line 56 of file GUIShapeContainer.cpp.
References NamedObjectCont< T >::add(), SUMORTree::addAdditionalGLObject(), myLock, ShapeContainer::myPOIs, and myVis.
|
virtual |
Builds a polygon using the given values and adds it to the container.
[in] | id | The name of the polygon |
[in] | type | The (abstract) type of the polygon |
[in] | color | The color of the polygon |
[in] | layer | The layer of the polygon |
[in] | angle | The rotation of the polygon |
[in] | imgFile | The raster image of the polygon |
[in] | shape | The shape of the polygon |
[in] | fill | Whether the polygon shall be filled |
Reimplemented from ShapeContainer.
Definition at line 72 of file GUIShapeContainer.cpp.
References NamedObjectCont< T >::add(), SUMORTree::addAdditionalGLObject(), myLock, ShapeContainer::myPolygons, and myVis.
std::vector< GUIGlID > GUIShapeContainer::getPOIIds | ( | ) | const |
Returns the gl-ids of all pois.
Definition at line 138 of file GUIShapeContainer.cpp.
References NamedObjectCont< T >::getMyMap(), ShapeContainer::getPOIs(), and myLock.
|
inlineinherited |
Returns all pois.
Definition at line 140 of file ShapeContainer.h.
Referenced by TraCIServerAPI_POI::getPoI(), getPOIIds(), TraCIServerAPI_POI::getTree(), and TraCIServerAPI_POI::processGet().
std::vector< GUIGlID > GUIShapeContainer::getPolygonIDs | ( | ) | const |
Returns the gl-ids of all polygons.
Definition at line 150 of file GUIShapeContainer.cpp.
References NamedObjectCont< T >::getMyMap(), ShapeContainer::getPolygons(), and myLock.
|
inlineinherited |
Returns all polygons.
Definition at line 134 of file ShapeContainer.h.
Referenced by TraCIServerAPI_Polygon::getPolygon(), getPolygonIDs(), TraCIServerAPI_Polygon::getTree(), and TraCIServerAPI_Polygon::processGet().
|
virtual |
Assigns a new position to the named PoI.
[in] | id | The id of the PoI to move |
[in] | pos | The PoI's new position |
Reimplemented from ShapeContainer.
Definition at line 113 of file GUIShapeContainer.cpp.
References SUMORTree::addAdditionalGLObject(), NamedObjectCont< T >::get(), myLock, ShapeContainer::myPOIs, myVis, and SUMORTree::removeAdditionalGLObject().
|
virtual |
Removes a PoI from the container.
[in] | id | The id of the PoI |
Reimplemented from ShapeContainer.
Definition at line 101 of file GUIShapeContainer.cpp.
References NamedObjectCont< T >::get(), myLock, ShapeContainer::myPOIs, myVis, NamedObjectCont< T >::remove(), and SUMORTree::removeAdditionalGLObject().
|
virtual |
Removes a polygon from the container.
[in] | id | The id of the polygon |
Reimplemented from ShapeContainer.
Definition at line 89 of file GUIShapeContainer.cpp.
References NamedObjectCont< T >::get(), myLock, ShapeContainer::myPolygons, myVis, NamedObjectCont< T >::remove(), and SUMORTree::removeAdditionalGLObject().
|
virtual |
Assigns a shape to the named polygon.
[in] | id | The id of the polygon to reshape |
[in] | shape | The polygon's new shape |
Reimplemented from ShapeContainer.
Definition at line 125 of file GUIShapeContainer.cpp.
References SUMORTree::addAdditionalGLObject(), NamedObjectCont< T >::get(), myLock, ShapeContainer::myPolygons, myVis, SUMORTree::removeAdditionalGLObject(), and GUIPolygon::setShape().
|
mutableprivate |
The mutex for adding/removing operations.
Definition at line 137 of file GUIShapeContainer.h.
Referenced by addPOI(), addPolygon(), getPOIIds(), getPolygonIDs(), movePOI(), removePOI(), removePolygon(), and reshapePolygon().
|
protectedinherited |
stored POIs
Definition at line 150 of file ShapeContainer.h.
Referenced by addPOI(), ShapeContainer::addPOI(), movePOI(), ShapeContainer::movePOI(), removePOI(), and ShapeContainer::removePOI().
|
protectedinherited |
stored Polygons
Definition at line 147 of file ShapeContainer.h.
Referenced by addPolygon(), ShapeContainer::addPolygon(), removePolygon(), ShapeContainer::removePolygon(), reshapePolygon(), and ShapeContainer::reshapePolygon().
|
private |
The RTree structure to add and remove visualization elements.
Definition at line 140 of file GUIShapeContainer.h.
Referenced by addPOI(), addPolygon(), movePOI(), removePOI(), removePolygon(), and reshapePolygon().