![]() |
SUMO - Simulation of Urban MObility
|
Storage for geometrical objects extended by mutexes. More...
#include <GUIShapeContainer.h>
Public Types | |
typedef NamedObjectCont< PointOfInterest * > | POIs |
typedef NamedObjectCont< SUMOPolygon * > | Polygons |
containers More... | |
Public Member Functions | |
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, double width, double height, bool ignorePruning=false) |
Builds a POI using the given values and adds it to the container. More... | |
virtual bool | addPolygon (const std::string &id, const std::string &type, const RGBColor &color, double layer, double angle, const std::string &imgFile, const PositionVector &shape, bool geo, bool fill, bool ignorePruning=false) |
Builds a polygon using the given values and adds it to the container. More... | |
std::vector< GUIGlID > | getPOIIds () const |
Returns the gl-ids of all pois. More... | |
const POIs & | getPOIs () const |
Returns all pois. More... | |
std::vector< GUIGlID > | getPolygonIDs () const |
Returns the gl-ids of all polygons. More... | |
const Polygons & | getPolygons () const |
Returns all polygons. More... | |
GUIShapeContainer (SUMORTree &vis) | |
Constructor. More... | |
virtual void | movePOI (const std::string &id, const Position &pos) |
Assigns a new position to the named PoI. More... | |
virtual bool | removePOI (const std::string &id) |
Removes a PoI from the container. More... | |
virtual bool | removePolygon (const std::string &id) |
Removes a polygon from the container. More... | |
virtual void | reshapePolygon (const std::string &id, const PositionVector &shape) |
Assigns a shape to the named polygon. More... | |
virtual | ~GUIShapeContainer () |
Destructor. More... | |
Protected Member Functions | |
virtual bool | add (SUMOPolygon *poly, bool ignorePruning=false) |
add polygon More... | |
virtual bool | add (PointOfInterest *poi, bool ignorePruning=false) |
add poi More... | |
Protected Attributes | |
POIs | myPOIs |
stored POIs More... | |
Polygons | myPolygons |
stored Polygons More... | |
Private Attributes | |
MFXMutex | myLock |
The mutex for adding/removing operations. More... | |
SUMORTree & | myVis |
The RTree structure to add and remove visualization elements. More... | |
Storage for geometrical objects extended by mutexes.
Definition at line 54 of file GUIShapeContainer.h.
|
inherited |
Definition at line 52 of file ShapeContainer.h.
|
inherited |
containers
Definition at line 51 of file ShapeContainer.h.
GUIShapeContainer::GUIShapeContainer | ( | SUMORTree & | vis | ) |
Constructor.
Definition at line 41 of file GUIShapeContainer.cpp.
|
virtual |
Destructor.
Definition at line 45 of file GUIShapeContainer.cpp.
|
protectedvirtualinherited |
add polygon
Reimplemented in PCPolyContainer.
Definition at line 102 of file ShapeContainer.cpp.
References NamedObjectCont< T >::add(), Named::getID(), and ShapeContainer::myPolygons.
Referenced by PCPolyContainer::add(), ShapeContainer::addPOI(), ShapeContainer::addPolygon(), and ShapeContainer::getPOIs().
|
protectedvirtualinherited |
add poi
Reimplemented in PCPolyContainer.
Definition at line 112 of file ShapeContainer.cpp.
References NamedObjectCont< T >::add(), Named::getID(), and ShapeContainer::myPOIs.
|
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] | pos | The position of the POI |
Reimplemented from ShapeContainer.
Definition at line 49 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] | geo | specify if shape was loaded as GEO coordinate |
[in] | fill | Whether the polygon shall be filled |
Reimplemented from ShapeContainer.
Definition at line 65 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 131 of file GUIShapeContainer.cpp.
References ShapeContainer::getPOIs(), and myLock.
|
inlineinherited |
Returns all pois.
Definition at line 128 of file ShapeContainer.h.
References ShapeContainer::add(), and ShapeContainer::myPOIs.
Referenced by ShapeHandler::addPOI(), libsumo::POI::getIDList(), libsumo::POI::getPoI(), TraCIServerAPI_POI::getPoI(), getPOIIds(), libsumo::POI::getTree(), GNESelectorFrame::onCmdInvert(), and GNENet::retrieveShapes().
std::vector< GUIGlID > GUIShapeContainer::getPolygonIDs | ( | ) | const |
Returns the gl-ids of all polygons.
Definition at line 142 of file GUIShapeContainer.cpp.
References ShapeContainer::getPolygons(), and myLock.
|
inlineinherited |
Returns all polygons.
Definition at line 123 of file ShapeContainer.h.
References ShapeContainer::myPolygons.
Referenced by ShapeHandler::addPoly(), libsumo::Polygon::getIDList(), libsumo::Polygon::getPolygon(), TraCIServerAPI_Polygon::getPolygon(), getPolygonIDs(), libsumo::Polygon::getTree(), PCLoaderDlrNavteq::loadPolyFile(), GNESelectorFrame::onCmdInvert(), and GNENet::retrieveShapes().
|
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 106 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 94 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 82 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 118 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 140 of file GUIShapeContainer.h.
Referenced by addPOI(), addPolygon(), getPOIIds(), getPolygonIDs(), movePOI(), removePOI(), removePolygon(), and reshapePolygon().
|
protectedinherited |
stored POIs
Definition at line 144 of file ShapeContainer.h.
Referenced by ShapeContainer::add(), addPOI(), GNENet::addPOI(), GNENet::changeShapeID(), GNENet::computeAndUpdate(), GNENet::generateShapeID(), GNENet::getGlIDs(), GNENet::getNumberOfShapes(), ShapeContainer::getPOIs(), GNENet::insertShape(), ShapeContainer::movePOI(), movePOI(), ShapeContainer::removePOI(), removePOI(), GNENet::removeShape(), GNENet::retrievePOI(), GNENet::retrievePOILane(), PCPolyContainer::save(), PCPolyContainer::saveDlrTDP(), GNENet::saveShapes(), GNEChange_Shape::~GNEChange_Shape(), and PCPolyContainer::~PCPolyContainer().
|
protectedinherited |
stored Polygons
Definition at line 141 of file ShapeContainer.h.
Referenced by ShapeContainer::add(), addPolygon(), GNENet::addPolygon(), GNENet::changeShapeID(), GNENet::computeAndUpdate(), GNENet::generateShapeID(), GNENet::getGlIDs(), GNENet::getNumberOfShapes(), ShapeContainer::getPolygons(), GNENet::insertShape(), ShapeContainer::removePolygon(), removePolygon(), GNENet::removeShape(), ShapeContainer::reshapePolygon(), reshapePolygon(), GNENet::retrievePolygon(), PCPolyContainer::save(), PCPolyContainer::saveDlrTDP(), GNENet::saveShapes(), GNEChange_Shape::~GNEChange_Shape(), and PCPolyContainer::~PCPolyContainer().
|
private |
The RTree structure to add and remove visualization elements.
Definition at line 143 of file GUIShapeContainer.h.
Referenced by addPOI(), addPolygon(), movePOI(), removePOI(), removePolygon(), and reshapePolygon().