Eclipse SUMO - Simulation of Urban MObility
|
Storage for geometrical objects. More...
#include <ShapeContainer.h>
Public Types | |
typedef NamedObjectCont< PointOfInterest * > | POIs |
typedef NamedObjectCont< SUMOPolygon * > | Polygons |
containers | |
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, 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) |
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, 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) |
Builds a polygon using the given values and adds it to the container. | |
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. | |
virtual void | addPolygonUpdateCommand (std::string polyID, ParametrisedWrappingCommand< ShapeContainer, PolygonDynamics * > *cmd) |
Register update command (for descheduling at removal) | |
void | clearState () |
Remove all dynamics before quick-loading state. | |
const POIs & | getPOIs () const |
Returns all pois. | |
const Polygons & | getPolygons () const |
Returns all polygons. | |
virtual void | movePOI (const std::string &id, const Position &pos) |
Assigns a new position to the named PoI. | |
virtual SUMOTime | polygonDynamicsUpdate (SUMOTime t, PolygonDynamics *pd) |
Regular update event for updating polygon dynamics. | |
virtual void | registerHighlight (const std::string &objectID, const int type, const std::string &polygonID) |
register highlight of the specified type if the given id | |
virtual bool | removePOI (const std::string &id) |
Removes a PoI from the container. | |
virtual bool | removePolygon (const std::string &id, bool useLock=true) |
Removes a polygon from the container. | |
virtual bool | removePolygonDynamics (const std::string &polyID) |
Remove dynamics (animation / tracking) for the given polygon. | |
virtual void | removeTrackers (std::string objectID) |
Remove all tracking polygons for the given object. | |
virtual void | reshapePolygon (const std::string &id, const PositionVector &shape) |
Assigns a shape to the named polygon. | |
ShapeContainer () | |
Constructor. | |
virtual | ~ShapeContainer () |
Destructor. | |
Protected Member Functions | ||||
virtual bool | add (PointOfInterest *poi, bool ignorePruning=false) | |||
add poi | ||||
virtual bool | add (SUMOPolygon *poly, bool ignorePruning=false) | |||
add polygon | ||||
virtual void | cleanupPolygonDynamics (const std::string &id) | |||
Unschedules the removal and update commands of the given polygon. | ||||
Management of highlights. For each type, only one highlight can be active, | ||||
Remove any previously added highlight polygon of the specified type
| ||||
virtual void | clearHighlight (const std::string &objectID, const int type, std::string &toRemove) | |||
virtual void | clearHighlights (const std::string &objectID, SUMOPolygon *p) | |||
Clears all highlight information from the maps when the object leaves the net (Highlight polygons and dynamics are removed via removeTrackers()) | ||||
Protected Attributes | |
std::map< std::string, std::string > | myHighlightedObjects |
inverse map to myHighlightPolygons saves the highlighted object for each polygon | |
std::map< std::string, std::map< int, std::string > > | myHighlightPolygons |
maps objects to a map of highlight types to highlighting polygons | |
POIs | myPOIs |
stored POIs | |
std::map< std::string, PolygonDynamics * > | myPolygonDynamics |
stored PolygonDynamics | |
Polygons | myPolygons |
stored Polygons | |
std::map< const std::string, std::set< const SUMOPolygon * > > | myTrackingPolygons |
Information about tracked objects. | |
Private Attributes | |
std::map< const std::string, ParametrisedWrappingCommand< ShapeContainer, PolygonDynamics * > * > | myPolygonUpdateCommands |
Command pointers for scheduled polygon update. Maps PolyID->Command. | |
Storage for geometrical objects.
Definition at line 49 of file ShapeContainer.h.
Definition at line 54 of file ShapeContainer.h.
containers
Definition at line 53 of file ShapeContainer.h.
ShapeContainer::ShapeContainer | ( | ) |
Constructor.
Definition at line 47 of file ShapeContainer.cpp.
|
virtual |
Destructor.
Definition at line 49 of file ShapeContainer.cpp.
References myPolygonDynamics, and myPolygonUpdateCommands.
|
protectedvirtual |
add poi
Reimplemented in PCPolyContainer.
Definition at line 197 of file ShapeContainer.cpp.
References NamedObjectCont< T >::add(), Named::getID(), and myPOIs.
|
protectedvirtual |
add polygon
Reimplemented in PCPolyContainer.
Definition at line 187 of file ShapeContainer.cpp.
References NamedObjectCont< T >::add(), Named::getID(), and myPolygons.
Referenced by PCPolyContainer::add(), PCPolyContainer::add(), addPOI(), and addPolygon().
|
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 |
[in[ | geo use GEO coordinates (lon/lat) | |
[in] | lane | The Lane in which this POI is placed |
[in] | posOverLane | The position over Lane |
[in] | friendlyPos | enable or disable friendly position over lane |
[in] | posLat | The position lateral over Lane |
[in] | icon | The icon 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] | relativePath | set image file as relative path |
[in] | width | The width of the POI image |
[in] | height | The height of the POI image |
Reimplemented in GUIShapeContainer.
Definition at line 145 of file ShapeContainer.cpp.
References add().
Referenced by LIBSUMO_NAMESPACE::POI::add(), and ShapeHandler::addPOI().
|
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] | relativePath | set image file as relative path |
[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 |
[in] | lineWidth | Line width when drawing unfilled polygon |
Reimplemented in GUIShapeContainer.
Definition at line 63 of file ShapeContainer.cpp.
References add().
Referenced by LIBSUMO_NAMESPACE::Polygon::add(), NLHandler::addDistrict(), ShapeHandler::addPoly(), MSPModel_JuPedSim::preparePolygonForDrawing(), and NWWriter_OpenDrive::writeNetwork().
|
virtual |
Adds dynamics (animation / tracking) to the given polygon.
polyID | ID of the polygon which should become dynamic |
Reimplemented in GUIShapeContainer.
Definition at line 73 of file ShapeContainer.cpp.
References NamedObjectCont< T >::get(), PolygonDynamics::getTrackedObjectID(), myPolygonDynamics, myPolygons, myTrackingPolygons, and removePolygonDynamics().
Referenced by LIBSUMO_NAMESPACE::Polygon::addDynamics(), and GUIShapeContainer::addPolygonDynamics().
|
virtual |
Register update command (for descheduling at removal)
Definition at line 287 of file ShapeContainer.cpp.
References myPolygonUpdateCommands.
Referenced by LIBSUMO_NAMESPACE::Polygon::addDynamics().
|
protectedvirtual |
Unschedules the removal and update commands of the given polygon.
[in] | id | The id of the polygon |
Definition at line 214 of file ShapeContainer.cpp.
References myPolygonUpdateCommands.
Referenced by removePolygonDynamics().
|
protectedvirtual |
Definition at line 252 of file ShapeContainer.cpp.
References myHighlightedObjects, and myHighlightPolygons.
Referenced by registerHighlight().
|
protectedvirtual |
Clears all highlight information from the maps when the object leaves the net (Highlight polygons and dynamics are removed via removeTrackers())
Definition at line 268 of file ShapeContainer.cpp.
References Named::getID(), and myHighlightPolygons.
Referenced by removePolygonDynamics().
void ShapeContainer::clearState | ( | ) |
Remove all dynamics before quick-loading state.
Definition at line 206 of file ShapeContainer.cpp.
References myPolygonUpdateCommands.
Referenced by MSNet::clearState().
|
inline |
Returns all pois.
Definition at line 157 of file ShapeContainer.h.
References myPOIs.
Referenced by LIBSUMO_NAMESPACE::POI::add(), ShapeHandler::addPOI(), LIBSUMO_NAMESPACE::POI::getPoI(), GUIShapeContainer::getPOIIds(), LIBSUMO_NAMESPACE::POI::getTree(), PCLoaderVisum::load(), NWWriter_OpenDrive::mapmatchRoadObjects(), LIBSUMO_NAMESPACE::POI::remove(), NWWriter_OpenDrive::writeRoadObjects(), and NWWriter_OpenDrive::writeSignals().
|
inline |
Returns all polygons.
Definition at line 152 of file ShapeContainer.h.
References myPolygons.
Referenced by LIBSUMO_NAMESPACE::Polygon::add(), MSPModel_JuPedSim::add(), NLHandler::addDistrict(), ShapeHandler::addPoly(), MSPModel_JuPedSim::buildPedestrianNetwork(), MSDevice_FCD::buildShapeFilter(), GUIViewTraffic::changePedestrianNetworkColor(), LIBSUMO_NAMESPACE::Polygon::exists(), LIBSUMO_NAMESPACE::Polygon::getPolygon(), GUIShapeContainer::getPolygonIDs(), LIBSUMO_NAMESPACE::Polygon::getTree(), MSPModel_JuPedSim::initialize(), PCLoaderVisum::load(), PCLoaderDlrNavteq::loadPolyFile(), NWWriter_OpenDrive::mapmatchRoadObjects(), MSPModel_JuPedSim::preparePolygonForDrawing(), LIBSUMO_NAMESPACE::Polygon::remove(), NWWriter_OpenDrive::writeNetwork(), and NWWriter_OpenDrive::writeRoadObjects().
|
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 in GUIShapeContainer.
Definition at line 169 of file ShapeContainer.cpp.
References NamedObjectCont< T >::get(), and myPOIs.
Referenced by LIBSUMO_NAMESPACE::POI::setPosition().
|
virtual |
Regular update event for updating polygon dynamics.
[in] | t | The time at which the update is called |
[in] | pd | The dynamics to be updated |
Reimplemented in GUIShapeContainer.
Definition at line 224 of file ShapeContainer.cpp.
References PolygonDynamics::getPolygonID(), myPolygonUpdateCommands, removePolygon(), and PolygonDynamics::update().
Referenced by LIBSUMO_NAMESPACE::Polygon::addDynamics(), and GUIShapeContainer::polygonDynamicsUpdate().
|
virtual |
register highlight of the specified type if the given id
Definition at line 236 of file ShapeContainer.cpp.
References clearHighlight(), myHighlightedObjects, myHighlightPolygons, and removePolygon().
Referenced by LIBSUMO_NAMESPACE::Polygon::addHighlightPolygon().
|
virtual |
Removes a PoI from the container.
[in] | id | The id of the PoI |
Reimplemented in GUIShapeContainer.
Definition at line 163 of file ShapeContainer.cpp.
References myPOIs, and NamedObjectCont< T >::remove().
Referenced by LIBSUMO_NAMESPACE::POI::remove().
|
virtual |
Removes a polygon from the container.
[in] | id | The id of the polygon |
Reimplemented in GUIShapeContainer.
Definition at line 153 of file ShapeContainer.cpp.
References myPolygons, NamedObjectCont< T >::remove(), and removePolygonDynamics().
Referenced by polygonDynamicsUpdate(), registerHighlight(), LIBSUMO_NAMESPACE::Polygon::remove(), GUIShapeContainer::removePolygon(), MSPModel_JuPedSim::removePolygonFromDrawing(), and removeTrackers().
|
virtual |
Remove dynamics (animation / tracking) for the given polygon.
polyID | ID of the polygon for which dynamics shall be removed |
Definition at line 113 of file ShapeContainer.cpp.
References cleanupPolygonDynamics(), clearHighlights(), NamedObjectCont< T >::get(), myPolygonDynamics, myPolygons, and myTrackingPolygons.
Referenced by addPolygonDynamics(), and removePolygon().
|
virtual |
Remove all tracking polygons for the given object.
Definition at line 293 of file ShapeContainer.cpp.
References myTrackingPolygons, and removePolygon().
Referenced by MSDynamicShapeUpdater::vehicleStateChanged().
|
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 in GUIShapeContainer.
Definition at line 178 of file ShapeContainer.cpp.
References NamedObjectCont< T >::get(), myPolygons, and SUMOPolygon::setShape().
Referenced by LIBSUMO_NAMESPACE::Polygon::setShape().
|
protected |
inverse map to myHighlightPolygons saves the highlighted object for each polygon
Definition at line 213 of file ShapeContainer.h.
Referenced by clearHighlight(), and registerHighlight().
|
protected |
maps objects to a map of highlight types to highlighting polygons
Definition at line 211 of file ShapeContainer.h.
Referenced by clearHighlight(), clearHighlights(), and registerHighlight().
|
protected |
stored POIs
Definition at line 221 of file ShapeContainer.h.
Referenced by add(), GUIShapeContainer::addPOI(), getPOIs(), movePOI(), GUIShapeContainer::movePOI(), removePOI(), GUIShapeContainer::removePOI(), PCPolyContainer::save(), PCPolyContainer::saveDlrTDP(), and PCPolyContainer::~PCPolyContainer().
|
protected |
stored PolygonDynamics
Definition at line 208 of file ShapeContainer.h.
Referenced by addPolygonDynamics(), removePolygonDynamics(), and ~ShapeContainer().
|
protected |
stored Polygons
Definition at line 205 of file ShapeContainer.h.
Referenced by add(), GUIShapeContainer::addPolygon(), addPolygonDynamics(), GUIShapeContainer::computeActivePolygons(), getPolygons(), removePolygon(), GUIShapeContainer::removePolygon(), removePolygonDynamics(), reshapePolygon(), GUIShapeContainer::reshapePolygon(), PCPolyContainer::save(), PCPolyContainer::saveDlrTDP(), and PCPolyContainer::~PCPolyContainer().
|
private |
Command pointers for scheduled polygon update. Maps PolyID->Command.
Definition at line 225 of file ShapeContainer.h.
Referenced by addPolygonUpdateCommand(), cleanupPolygonDynamics(), clearState(), polygonDynamicsUpdate(), and ~ShapeContainer().
|
protected |
Information about tracked objects.
Definition at line 218 of file ShapeContainer.h.
Referenced by addPolygonDynamics(), removePolygonDynamics(), and removeTrackers().