SUMO - Simulation of Urban MObility
|
Storage for edges, including some functionality operating on multiple edges. More...
#include <NBEdgeCont.h>
Data Structures | |
struct | PostProcessConnection |
A structure representing a connection between two lanes. More... | |
Public Member Functions | |
void | applyOptions (OptionsCont &oc) |
Initialises the storage by applying given options. More... | |
void | clear () |
Deletes all edges. More... | |
void | generateStreetSigns () |
assigns street signs to edges based on toNode types More... | |
void | guessRoundabouts (std::vector< EdgeVector > &marked) |
Determines which edges belong to roundabouts and increases their priority. More... | |
bool | isLeftHanded () const |
Returns whether the built edges are left-handed. More... | |
NBEdgeCont (NBTypeCont &tc) | |
Constructor. More... | |
void | rename (NBEdge *edge, const std::string &newID) |
Renames the edge. Throws exception if newID already exists. More... | |
bool | wasIgnored (std::string id) const |
Returns whether the edge with the id was ignored during parsing. More... | |
bool | wasRemoved (std::string id) const |
Returns whether the edge with the id was deleted explicitly. More... | |
~NBEdgeCont () | |
Destructor. More... | |
edge access methods | |
bool | insert (NBEdge *edge, bool ignorePrunning=false) |
Adds an edge to the dictionary. More... | |
NBEdge * | retrieve (const std::string &id, bool retrieveExtracted=false) const |
Returns the edge that has the given id. More... | |
NBEdge * | retrievePossiblySplit (const std::string &id, bool downstream) const |
Tries to retrieve an edge, even if it is splitted. More... | |
NBEdge * | retrievePossiblySplit (const std::string &id, const std::string &hint, bool incoming) const |
Tries to retrieve an edge, even if it is splitted. More... | |
NBEdge * | retrievePossiblySplit (const std::string &id, SUMOReal pos) const |
Tries to retrieve an edge, even if it is splitted. More... | |
void | erase (NBDistrictCont &dc, NBEdge *edge) |
Removes the given edge from the container (deleting it) More... | |
void | extract (NBDistrictCont &dc, NBEdge *edge, bool remember=false) |
Removes the given edge from the container like erase but does not delete it. More... | |
std::map< std::string, NBEdge * > ::const_iterator | begin () const |
Returns the pointer to the begin of the stored edges. More... | |
std::map< std::string, NBEdge * > ::const_iterator | end () const |
Returns the pointer to the end of the stored edges. More... | |
explicit edge manipulation methods | |
bool | splitAt (NBDistrictCont &dc, NBEdge *edge, NBNode *node) |
Splits the edge at the position nearest to the given node. More... | |
bool | splitAt (NBDistrictCont &dc, NBEdge *edge, NBNode *node, const std::string &firstEdgeName, const std::string &secondEdgeName, unsigned int noLanesFirstEdge, unsigned int noLanesSecondEdge) |
Splits the edge at the position nearest to the given node using the given modifications. More... | |
bool | splitAt (NBDistrictCont &dc, NBEdge *edge, SUMOReal edgepos, NBNode *node, const std::string &firstEdgeName, const std::string &secondEdgeName, unsigned int noLanesFirstEdge, unsigned int noLanesSecondEdge) |
Splits the edge at the position nearest to the given node using the given modifications. More... | |
container access methods | |
unsigned int | size () const |
Returns the number of edges. More... | |
std::vector< std::string > | getAllNames () const |
Returns all ids of known edges. More... | |
unsigned int | getNoEdgeSplits () const |
Returns the number of edge splits. More... | |
Adapting the input | |
void | removeUnwishedEdges (NBDistrictCont &dc) |
Removes unwished edges (not in keep-edges) More... | |
void | splitGeometry (NBNodeCont &nc) |
Splits edges into multiple if they have a complex geometry. More... | |
void | reduceGeometries (const SUMOReal minDist) |
void | checkGeometries (const SUMOReal maxAngle, const SUMOReal minRadius, bool fix) |
processing methods | |
void | sortOutgoingLanesConnections () |
Sorts all lanes of all edges within the container by their direction. More... | |
void | computeEdge2Edges (bool noLeftMovers) |
Computes for each edge the approached edges. More... | |
void | computeLanes2Edges () |
Computes for each edge which lanes approach the next edges. More... | |
void | recheckLanes () |
Rechecks whether all lanes have a successor for each of the stored edges. More... | |
void | appendTurnarounds (bool noTLSControlled) |
Appends turnarounds to all edges stored in the container. More... | |
void | appendTurnarounds (const std::set< std::string > &ids, bool noTLSControlled) |
Appends turnarounds to all edges stored in the container Calls "NBEdge::appendTurnaround" for edges with the given ids. More... | |
void | computeEdgeShapes () |
Computes the shapes of all edges stored in the container. More... | |
void | computeLaneShapes () |
Computes the shapes of all lanes of all edges stored in the container. More... | |
void | clearControllingTLInformation () const |
Clears information about controlling traffic lights for all connenections of all edges. More... | |
void | joinSameNodeConnectingEdges (NBDistrictCont &dc, NBTrafficLightLogicCont &tlc, EdgeVector edges) |
Joins the given edges because they connect the same nodes. More... | |
void | recheckLaneSpread () |
Rechecks whether the lane spread is proper. More... | |
Connections handling | |
void | addPostProcessConnection (const std::string &from, int fromLane, const std::string &to, int toLane, bool mayDefinitelyPass) |
Adds a connection which could not be set during loading. More... | |
void | recheckPostProcessConnections () |
Try to set any stored connections. More... | |
Private Types | |
typedef std::map< std::string, NBEdge * > | EdgeCont |
The type of the dictionary where an edge may be found by its id. More... | |
Private Member Functions | |
EdgeVector | getGeneratedFrom (const std::string &id) const |
Returns the edges which have been built by splitting the edge of the given id. More... | |
bool | ignoreFilterMatch (NBEdge *edge) |
Returns true if this edge matches one of the removal criteria. More... | |
NBEdgeCont (const NBEdgeCont &s) | |
invalidated copy constructor More... | |
NBEdgeCont & | operator= (const NBEdgeCont &s) |
invalidated assignment operator More... | |
Private Attributes | |
bool | myAmLeftHanded |
Whether the network is left-handed. More... | |
std::vector < PostProcessConnection > | myConnections |
The list of connections to recheck. More... | |
EdgeCont | myEdges |
The instance of the dictionary (id->edge) More... | |
unsigned int | myEdgesSplit |
the number of splits of edges during the building More... | |
EdgeCont | myExtractedEdges |
The extracted nodes which are kept for reference. More... | |
std::set< std::string > | myIgnoredEdges |
The ids of ignored edges. More... | |
NBTypeCont & | myTypeCont |
The network builder; used to obtain type information. More... | |
Settings for accepting/dismissing edges | |
SUMOReal | myEdgesMinSpeed |
The minimum speed an edge may have in order to be kept (default: -1) More... | |
bool | myRemoveEdgesAfterJoining |
Whether edges shall be joined first, then removed. More... | |
std::set< std::string > | myEdges2Keep |
Set of ids of edges which shall explicitly be kept. More... | |
std::set< std::string > | myEdges2Remove |
Set of ids of edges which shall explicitly be removed. More... | |
SVCPermissions | myVehicleClasses2Keep |
Set of vehicle types which must be allowed on edges in order to keep them. More... | |
SVCPermissions | myVehicleClasses2Remove |
Set of vehicle types which need not be supported (edges which allow ONLY these are removed) More... | |
std::set< std::string > | myTypes2Keep |
Set of edges types which shall be kept. More... | |
std::set< std::string > | myTypes2Remove |
Set of edges types which shall be removed. More... | |
PositionVector | myPrunningBoundary |
Boundary within which an edge must be located in order to be kept. More... | |
bool | myNeedGeoTransformedPrunningBoundary |
whether a geo transform has been applied to the pruning boundary More... | |
Storage for edges, including some functionality operating on multiple edges.
Definition at line 66 of file NBEdgeCont.h.
|
private |
The type of the dictionary where an edge may be found by its id.
Definition at line 551 of file NBEdgeCont.h.
NBEdgeCont::NBEdgeCont | ( | NBTypeCont & | tc | ) |
Constructor.
[in] | tc | The net builded; used to obtain types |
Definition at line 69 of file NBEdgeCont.cpp.
NBEdgeCont::~NBEdgeCont | ( | ) |
|
private |
invalidated copy constructor
void NBEdgeCont::addPostProcessConnection | ( | const std::string & | from, |
int | fromLane, | ||
const std::string & | to, | ||
int | toLane, | ||
bool | mayDefinitelyPass | ||
) |
Adds a connection which could not be set during loading.
[in] | from | The id of the edge the connection starts at |
[in] | fromLane | The number of the lane the connection starts at |
[in] | to | The id of the edge the connection ends at |
[in] | toLane | The number of the lane the connection ends at |
[in] | mayDefinitelyPass | Whether the connection may be passed without braking |
Definition at line 729 of file NBEdgeCont.cpp.
References myConnections.
Referenced by NIXMLConnectionsHandler::parseLaneBound().
void NBEdgeCont::appendTurnarounds | ( | bool | noTLSControlled | ) |
Appends turnarounds to all edges stored in the container.
Calls "NBEdge::appendTurnaround" for all edges within the container.
[in] | noTLSControlled | Whether the turnaround shall not be connected if the edge is controlled by a tls |
Definition at line 598 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBNetBuilder::compute().
void NBEdgeCont::appendTurnarounds | ( | const std::set< std::string > & | ids, |
bool | noTLSControlled | ||
) |
Appends turnarounds to all edges stored in the container Calls "NBEdge::appendTurnaround" for edges with the given ids.
[in] | ids | The list of ids for which to append a turnaround |
[in] | noTLSControlled | Whether the turnaround shall not be connected if the edge is controlled by a tls |
Definition at line 606 of file NBEdgeCont.cpp.
References myEdges.
void NBEdgeCont::applyOptions | ( | OptionsCont & | oc | ) |
Initialises the storage by applying given options.
Options, mainly steering the acceptance of edges, are parsed and the according internal variables are set.
[in] | oc | The options container to read options from |
Definition at line 84 of file NBEdgeCont.cpp.
References TplConvert::_2SUMOReal(), OptionsCont::exists(), OptionsCont::getBool(), OptionsCont::getFloat(), OptionsCont::getStringVector(), getVehicleClassID(), OptionsCont::isSet(), myAmLeftHanded, myEdges2Keep, myEdges2Remove, myEdgesMinSpeed, myNeedGeoTransformedPrunningBoundary, myPrunningBoundary, myRemoveEdgesAfterJoining, myTypes2Keep, myTypes2Remove, myVehicleClasses2Keep, myVehicleClasses2Remove, PositionVector::push_back(), and SUMOReal.
Referenced by NBNetBuilder::applyOptions().
|
inline |
Returns the pointer to the begin of the stored edges.
Definition at line 190 of file NBEdgeCont.h.
References myEdges.
Referenced by NBNetBuilder::compute(), NBNetBuilder::moveToOrigin(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_DlrNavteq::writeLinksUnsplitted(), NWWriter_OpenDrive::writeNetwork(), NWWriter_MATSim::writeNetwork(), NWWriter_SUMO::writeNetwork(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_XML::writeStreetSigns(), and NWWriter_XML::writeTrafficLights().
[in] | maxAngle | The maximum geometry angle allowed |
[in] | minRadius | The minimum turning radius allowed at the start and end |
[in] | fix | Whether to prune geometry points to avoid sharp turns at start and end |
Definition at line 547 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBNetBuilder::compute().
void NBEdgeCont::clear | ( | ) |
Deletes all edges.
Definition at line 149 of file NBEdgeCont.cpp.
References myEdges, and myExtractedEdges.
Referenced by ~NBEdgeCont().
void NBEdgeCont::clearControllingTLInformation | ( | ) | const |
Clears information about controlling traffic lights for all connenections of all edges.
Definition at line 558 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBTrafficLightLogicCont::setTLControllingInformation().
void NBEdgeCont::computeEdge2Edges | ( | bool | noLeftMovers | ) |
Computes for each edge the approached edges.
Calls "NBEdge::computeEdge2Edges" for all edges within the container.
[in] | noLeftMovers | Whether left-moving connections shall be omitted |
Definition at line 574 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBNetBuilder::compute().
void NBEdgeCont::computeEdgeShapes | ( | ) |
Computes the shapes of all edges stored in the container.
Calls "NBEdge::computeEdgeShape" for all edges within the container.
Recheck whether a visitor-pattern should be used herefor
Recheck usage
Definition at line 614 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBNetBuilder::compute().
void NBEdgeCont::computeLanes2Edges | ( | ) |
Computes for each edge which lanes approach the next edges.
Calls "NBEdge::computeLanes2Edges" for all edges within the container.
Definition at line 582 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBNetBuilder::compute().
void NBEdgeCont::computeLaneShapes | ( | ) |
Computes the shapes of all lanes of all edges stored in the container.
Calls "NBEdge::computeLaneShapes" for all edges within the container.
Recheck whether a visitor-pattern should be used herefor
Recheck usage
Definition at line 622 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBNetBuilder::compute().
|
inline |
Returns the pointer to the end of the stored edges.
Definition at line 198 of file NBEdgeCont.h.
References myEdges.
Referenced by NBNetBuilder::compute(), NBNetBuilder::moveToOrigin(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_DlrNavteq::writeLinksUnsplitted(), NWWriter_OpenDrive::writeNetwork(), NWWriter_MATSim::writeNetwork(), NWWriter_SUMO::writeNetwork(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_XML::writeStreetSigns(), and NWWriter_XML::writeTrafficLights().
void NBEdgeCont::erase | ( | NBDistrictCont & | dc, |
NBEdge * | edge | ||
) |
Removes the given edge from the container (deleting it)
[in] | dc | The district container, in order to remove the edge from sources/sinks |
[in] | edge | The edge to remove |
Definition at line 363 of file NBEdgeCont.cpp.
References extract().
Referenced by NIXMLEdgesHandler::addEdge(), NBNodeCont::joinNodeClusters(), joinSameNodeConnectingEdges(), NBNodeCont::removeIsolatedRoads(), NBNode::removeSelfLoops(), removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), and splitAt().
void NBEdgeCont::extract | ( | NBDistrictCont & | dc, |
NBEdge * | edge, | ||
bool | remember = false |
||
) |
Removes the given edge from the container like erase but does not delete it.
[in] | dc | The district container, in order to remove the edge from sources/sinks |
[in] | edge | The edge to remove |
[in] | remember | Whether to keep this edge for future reference |
Recheck whether the district cont is needed - if districts are processed using an external tool
Recheck whether this is used at all and why
Definition at line 370 of file NBEdgeCont.cpp.
References Named::getID(), myEdges, myExtractedEdges, NBEdge::myFrom, NBEdge::myTo, NBNode::removeEdge(), and NBDistrictCont::removeFromSinksAndSources().
Referenced by NIXMLEdgesHandler::deleteEdge(), and erase().
void NBEdgeCont::generateStreetSigns | ( | ) |
assigns street signs to edges based on toNode types
Definition at line 912 of file NBEdgeCont.cpp.
References NBEdge::addSign(), NBEdge::getJunctionPriority(), NBEdge::getLength(), NBEdge::getToNode(), NBNode::getType(), myEdges, NODETYPE_ALLWAY_STOP, NODETYPE_PRIORITY, NODETYPE_PRIORITY_STOP, NODETYPE_RIGHT_BEFORE_LEFT, NBSign::SIGN_TYPE_ALLWAY_STOP, NBSign::SIGN_TYPE_PRIORITY, NBSign::SIGN_TYPE_RIGHT_BEFORE_LEFT, NBSign::SIGN_TYPE_STOP, NBSign::SIGN_TYPE_YIELD, and SUMOReal.
Referenced by NBNetBuilder::compute().
std::vector< std::string > NBEdgeCont::getAllNames | ( | ) | const |
Returns all ids of known edges.
Definition at line 500 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBJoinedEdgesMap::init(), and NBNodeCont::removeIsolatedRoads().
|
private |
Returns the edges which have been built by splitting the edge of the given id.
[in] | id | The id of the original edge |
Definition at line 765 of file NBEdgeCont.cpp.
References myEdges.
Referenced by retrievePossiblySplit().
|
inline |
Returns the number of edge splits.
Definition at line 289 of file NBEdgeCont.h.
References myEdgesSplit.
Referenced by NILoader::load().
void NBEdgeCont::guessRoundabouts | ( | std::vector< EdgeVector > & | marked | ) |
Determines which edges belong to roundabouts and increases their priority.
[out] | marked | Edges which belong to a roundabout are stored here |
Definition at line 807 of file NBEdgeCont.cpp.
References NBEdge::getAngleAtNode(), NBNode::getConnectionTo(), NBNode::getEdges(), NBEdge::getFromNode(), NBNode::getIncomingEdges(), NBEdge::getToNode(), NBEdge::getTurnDestination(), NBEdge::LANES2LANES_USER, myEdges, NBContHelper::nextCW(), NBHelpers::relAngle(), NBEdge::removeFromConnections(), NBNode::setRoundabout(), and SUMOReal.
Referenced by NBNetBuilder::compute().
Returns true if this edge matches one of the removal criteria.
Definition at line 188 of file NBEdgeCont.cpp.
References PositionVector::getBoxBoundary(), NBEdge::getGeometry(), Named::getID(), GeoConvHelper::getLoaded(), NBEdge::getPermissions(), GeoConvHelper::getProcessing(), NBTypeCont::getShallBeDiscarded(), NBEdge::getSpeed(), NBEdge::getTypeID(), Boundary::grow(), NBTypeCont::knows(), myEdges2Keep, myEdges2Remove, myEdgesMinSpeed, myNeedGeoTransformedPrunningBoundary, myPrunningBoundary, myRemoveEdgesAfterJoining, myTypeCont, myTypes2Keep, myTypes2Remove, myVehicleClasses2Keep, myVehicleClasses2Remove, Boundary::overlapsWith(), POSITION_EPS, SUMOReal, NBNetBuilder::transformCoordinates(), GeoConvHelper::usingGeoProjection(), WRITE_ERROR, and GeoConvHelper::x2cartesian_const().
Referenced by insert().
Adds an edge to the dictionary.
First, it is determined whether the edge shall not be discarded due to any reasons (being outside a boundary, or not in the optional list of edges to import, etc.). If so, the edge is deleted and "true" is returned. "true" is also returned if the edge is accepted - no edge with the same name exists within this container. If another edge with the same name exists, false is returned.
[in] | edge | The edge to add |
[in] | ignorePrunning | Whether this edge must not be prunned |
Definition at line 164 of file NBEdgeCont.cpp.
References NBEdge::dismissVehicleClassInformation(), OptionsCont::exists(), OptionsCont::getBool(), NBEdge::getFromNode(), Named::getID(), OptionsCont::getOptions(), NBEdge::getToNode(), ignoreFilterMatch(), myAmLeftHanded, myEdges, myIgnoredEdges, NBNode::removeEdge(), and NBEdge::setLeftHanded().
Referenced by NIImporter_SUMO::_loadNetwork(), NIVissimEdge::buildNBEdge(), NIVissimDistrictConnection::dict_BuildDistricts(), NIImporter_OpenStreetMap::insertEdge(), joinSameNodeConnectingEdges(), NIImporter_ArcView::load(), NIImporter_RobocupRescue::loadEdges(), NIImporter_OpenDrive::loadNetwork(), NIXMLEdgesHandler::myEndElement(), NIImporter_VISUM::parse_Connectors(), NIImporter_VISUM::parse_Edges(), splitAt(), NBEdge::splitGeometry(), and NGNet::toNB().
|
inline |
Returns whether the built edges are left-handed.
Definition at line 455 of file NBEdgeCont.h.
References myAmLeftHanded.
Referenced by NBNode::computeLogic().
void NBEdgeCont::joinSameNodeConnectingEdges | ( | NBDistrictCont & | dc, |
NBTrafficLightLogicCont & | tlc, | ||
EdgeVector | edges | ||
) |
Joins the given edges because they connect the same nodes.
[in] | dc | The district container needed to remove edges |
[in] | tlc | The tls container needed to remove edges |
[in] | edges | The edges to join |
Definition at line 630 of file NBEdgeCont.cpp.
References NBEdge::addEdge2EdgeConnection(), erase(), Named::getID(), insert(), MAX2(), NBEdge::moveOutgoingConnectionsFrom(), NBNode::replaceIncoming(), NBNode::replaceOutgoing(), NBTrafficLightLogicCont::replaceRemoved(), SUMOReal, NBEdge::UNSPECIFIED_OFFSET, and NBEdge::UNSPECIFIED_WIDTH.
Referenced by NBNodeCont::joinSimilarEdges().
|
private |
invalidated assignment operator
void NBEdgeCont::recheckLanes | ( | ) |
Rechecks whether all lanes have a successor for each of the stored edges.
Calls "NBEdge::recheckLanes" for all edges within the container.
Definition at line 590 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBNetBuilder::compute().
void NBEdgeCont::recheckLaneSpread | ( | ) |
Rechecks whether the lane spread is proper.
Definition at line 708 of file NBEdgeCont.cpp.
References LANESPREAD_CENTER, LANESPREAD_RIGHT, and myEdges.
Referenced by NIImporter_DlrNavteq::loadNetwork().
void NBEdgeCont::recheckPostProcessConnections | ( | ) |
Try to set any stored connections.
Definition at line 735 of file NBEdgeCont.cpp.
References NBEdge::addLane2LaneConnection(), NBEdge::getConnections(), NBEdge::getFromNode(), Named::getID(), NBEdge::getToNode(), NBEdge::L2L_USER, myConnections, myEdges, NBEdge::removeFromConnections(), retrievePossiblySplit(), NBEdge::Connection::toEdge, and WRITE_WARNING.
Referenced by NBNetBuilder::compute().
void NBEdgeCont::reduceGeometries | ( | const SUMOReal | minDist | ) |
[in] | nc | The node container needed to build (geometry) nodes |
Definition at line 539 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBNetBuilder::compute().
void NBEdgeCont::removeUnwishedEdges | ( | NBDistrictCont & | dc | ) |
Removes unwished edges (not in keep-edges)
in,opt. | changed] dc The district container needed to remove edges |
Definition at line 511 of file NBEdgeCont.cpp.
References erase(), NBEdge::getFromNode(), Named::getID(), NBEdge::getToNode(), myEdges, myEdges2Keep, and NBNode::removeEdge().
Referenced by NBNetBuilder::compute().
void NBEdgeCont::rename | ( | NBEdge * | edge, |
const std::string & | newID | ||
) |
Renames the edge. Throws exception if newID already exists.
Definition at line 382 of file NBEdgeCont.cpp.
References Named::getID(), myEdges, and Named::setID().
Returns the edge that has the given id.
If no edge that has the given id is known, 0 is returned.
[in] | id | The id of the edge to retrieve |
[in] | bool | Whether extracted edges shall be retrieved as well |
Definition at line 251 of file NBEdgeCont.cpp.
References myEdges, and myExtractedEdges.
Referenced by NIImporter_SUMO::_loadNetwork(), NIXMLEdgesHandler::addEdge(), NIVissimDisturbance::addToNode(), NIVissimEdge::buildNBEdge(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), NBConnection::checkFrom(), NBConnection::checkTo(), NBRampsComputer::computeRamps(), NIXMLEdgesHandler::deleteEdge(), NIVissimDistrictConnection::dict_BuildDistricts(), NIImporter_VISUM::getNamedEdge(), NIImporter_VISUM::getNamedEdgeContinuating(), NIImporter_VISUM::getReversedContinuating(), NBJoinedEdgesMap::init(), NIImporter_ArcView::load(), NIImporter_OpenDrive::loadNetwork(), NIXMLEdgesHandler::myEndElement(), NIXMLConnectionsHandler::myStartElement(), NIImporter_VISUM::parse_Connectors(), NIImporter_VISUM::parse_Edges(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_LanesConnections(), NIImporter_VISUM::parse_TurnsToSignalGroups(), NIXMLConnectionsHandler::parseConnection(), NBNodeCont::removeIsolatedRoads(), NIXMLTrafficLightsHandler::retrieveEdge(), retrievePossiblySplit(), and NWWriter_SUMO::writeRoundabout().
Tries to retrieve an edge, even if it is splitted.
The edge given with the id should exist and is followed downstream or upstream, depending on the parameter to the last edge still starting with the id.
[in] | id | The id of the edge to retrieve |
[in] | downstream | search direction |
Definition at line 268 of file NBEdgeCont.cpp.
References NBEdge::getFromNode(), NBNode::getIncomingEdges(), NBNode::getOutgoingEdges(), NBEdge::getToNode(), and retrieve().
Referenced by NIVissimTL::NIVissimTLSignal::addTo(), NIVissimDisturbance::addToNode(), NIVissimConnection::buildEdgeConnections(), NBConnection::checkFrom(), NBConnection::checkTo(), NIVissimDistrictConnection::dict_BuildDistricts(), and recheckPostProcessConnections().
NBEdge * NBEdgeCont::retrievePossiblySplit | ( | const std::string & | id, |
const std::string & | hint, | ||
bool | incoming | ||
) | const |
Tries to retrieve an edge, even if it is splitted.
To describe which part of the edge shall be returned, the id of a second edge, participating at the node and the information whether to return the outgoing or the incoming is needed.
[in] | id | The id of the edge to retrieve |
[in] | hint | An additional information which helps to retrieve the correct edge |
[in] | incoming | Whether the edge to find is an incoming edge at the node "hint" participates |
Definition at line 284 of file NBEdgeCont.cpp.
References getGeneratedFrom(), NBNode::getIncomingEdges(), NBNode::getOutgoingEdges(), NBEdge::myFrom, NBEdge::myTo, and retrieve().
Tries to retrieve an edge, even if it is splitted.
To describe which part of the edge shall be returned, a position hint is supplied.
[in] | id | The id of the edge to retrieve |
[in] | pos | An additional about the position of the basic edge's subpart |
Definition at line 318 of file NBEdgeCont.cpp.
References NBEdge::getLength(), MAX2(), myEdges, retrieve(), and SUMOReal.
|
inline |
Returns the number of edges.
Definition at line 274 of file NBEdgeCont.h.
References myEdges.
Referenced by NILoader::load(), main(), and NWWriter_OpenDrive::writeNetwork().
void NBEdgeCont::sortOutgoingLanesConnections | ( | ) |
Sorts all lanes of all edges within the container by their direction.
Calls "NBEdge::sortOutgoingLanesConnections" for all edges within the container.
Definition at line 566 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBNetBuilder::compute().
bool NBEdgeCont::splitAt | ( | NBDistrictCont & | dc, |
NBEdge * | edge, | ||
NBNode * | node | ||
) |
Splits the edge at the position nearest to the given node.
Uses "splitAt(NBDistrictCont &, NBEdge *, NBNode *, const std::string &, const std::string &, unsigned int , unsigned int)" to perform the split; the edge names are built by appending "[0]" and "[1]", respectively. Both edges will have the same number of lanes.
[in] | dc | The district container, in order to remove/add the edge from/to sources/sinks |
[in] | edge | The edge to split |
[in] | node | The node to split the edge at |
ProcessError | If connections between the edges can not be built |
Definition at line 394 of file NBEdgeCont.cpp.
References Named::getID(), and NBEdge::myLanes.
Referenced by NIVissimDisturbance::addToNode(), NIVissimEdge::buildNBEdge(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), NIXMLEdgesHandler::myEndElement(), NIImporter_VISUM::parse_Lanes(), and splitAt().
bool NBEdgeCont::splitAt | ( | NBDistrictCont & | dc, |
NBEdge * | edge, | ||
NBNode * | node, | ||
const std::string & | firstEdgeName, | ||
const std::string & | secondEdgeName, | ||
unsigned int | noLanesFirstEdge, | ||
unsigned int | noLanesSecondEdge | ||
) |
Splits the edge at the position nearest to the given node using the given modifications.
Determines the position of the split by finding the nearest position on the edge to the given node. If this position is too near to the edges begin/end, false is returned.
Otherwise, "splitAt(NBDistrictCont &, NBEdge *, SUMOReal, NBNode *, const std::string &, const std::string &, unsigned int , unsigned int)" is used to perform the split.
[in] | dc | The district container, in order to remove/add the edge from/to sources/sinks |
[in] | edge | The edge to split |
[in] | node | The node to split the edge at |
[in] | firstEdgeName | The id the first part of the split edge shall have |
[in] | secondEdgeName | The id the second part of the split edge shall have |
[in] | noLanesFirstEdge | The number of lanes the second part of the split edge shall have |
[in] | noLanesSecondEdge | The number of lanes the second part of the split edge shall have |
ProcessError | If connections between the edges can not be built |
Definition at line 401 of file NBEdgeCont.cpp.
References NBEdge::getGeometry(), NBNode::getPosition(), PositionVector::length(), NBEdge::myFrom, NBEdge::myTo, GeomHelper::nearest_offset_on_line_to_point2D(), PositionVector::nearest_offset_to_point2D(), splitAt(), and SUMOReal.
bool NBEdgeCont::splitAt | ( | NBDistrictCont & | dc, |
NBEdge * | edge, | ||
SUMOReal | edgepos, | ||
NBNode * | node, | ||
const std::string & | firstEdgeName, | ||
const std::string & | secondEdgeName, | ||
unsigned int | noLanesFirstEdge, | ||
unsigned int | noLanesSecondEdge | ||
) |
Splits the edge at the position nearest to the given node using the given modifications.
[in] | dc | The district container, in order to remove/add the edge from/to sources/sinks |
[in] | edge | The edge to split |
[in] | node | The node to split the edge at |
[in] | firstEdgeName | The id the first part of the split edge shall have |
[in] | secondEdgeName | The id the second part of the split edge shall have |
[in] | noLanesFirstEdge | The number of lanes the second part of the split edge shall have |
[in] | noLanesSecondEdge | The number of lanes the second part of the split edge shall have |
ProcessError | If connections between the edges can not be built |
Definition at line 421 of file NBEdgeCont.cpp.
References NBEdge::addLane2LaneConnection(), NBEdge::copyConnectionsFrom(), erase(), NBEdge::getGeometry(), Named::getID(), NBEdge::getLaneSpeed(), NBEdge::getNumLanes(), NBNode::getPosition(), NBEdge::getPriority(), NBEdge::getStreetName(), insert(), NBEdge::L2L_COMPUTED, myEdges2Keep, myEdges2Remove, myEdgesSplit, NBEdge::myFrom, NBEdge::myLaneSpreadFunction, NBEdge::myLaneWidth, NBEdge::myOffset, myRemoveEdgesAfterJoining, NBEdge::mySpeed, NBEdge::myTo, NBEdge::myType, NBNode::removeDoubleEdges(), NBNode::replaceIncoming(), NBNode::replaceOutgoing(), NBEdge::setSpeed(), and PositionVector::splitAt().
void NBEdgeCont::splitGeometry | ( | NBNodeCont & | nc | ) |
Splits edges into multiple if they have a complex geometry.
Calls "NBEdge::splitGeometry" for all edges within the container which have more than three positions in their geometry.
[in] | nc | The node container needed to build (geometry) nodes |
Definition at line 528 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBNetBuilder::compute().
|
inline |
Returns whether the edge with the id was ignored during parsing.
Definition at line 463 of file NBEdgeCont.h.
References myIgnoredEdges.
Referenced by NIXMLConnectionsHandler::myStartElement().
|
inline |
Returns whether the edge with the id was deleted explicitly.
Definition at line 470 of file NBEdgeCont.h.
References myExtractedEdges.
Referenced by NIXMLConnectionsHandler::myStartElement().
|
private |
Whether the network is left-handed.
Definition at line 566 of file NBEdgeCont.h.
Referenced by applyOptions(), insert(), and isLeftHanded().
|
private |
The list of connections to recheck.
Definition at line 547 of file NBEdgeCont.h.
Referenced by addPostProcessConnection(), and recheckPostProcessConnections().
|
private |
The instance of the dictionary (id->edge)
Definition at line 554 of file NBEdgeCont.h.
Referenced by appendTurnarounds(), begin(), checkGeometries(), clear(), clearControllingTLInformation(), computeEdge2Edges(), computeEdgeShapes(), computeLanes2Edges(), computeLaneShapes(), end(), extract(), generateStreetSigns(), getAllNames(), getGeneratedFrom(), guessRoundabouts(), insert(), recheckLanes(), recheckLaneSpread(), recheckPostProcessConnections(), reduceGeometries(), removeUnwishedEdges(), rename(), retrieve(), retrievePossiblySplit(), size(), sortOutgoingLanesConnections(), and splitGeometry().
|
private |
Set of ids of edges which shall explicitly be kept.
Definition at line 579 of file NBEdgeCont.h.
Referenced by applyOptions(), ignoreFilterMatch(), removeUnwishedEdges(), and splitAt().
|
private |
Set of ids of edges which shall explicitly be removed.
Definition at line 582 of file NBEdgeCont.h.
Referenced by applyOptions(), ignoreFilterMatch(), and splitAt().
|
private |
The minimum speed an edge may have in order to be kept (default: -1)
Definition at line 573 of file NBEdgeCont.h.
Referenced by applyOptions(), and ignoreFilterMatch().
|
private |
the number of splits of edges during the building
Definition at line 563 of file NBEdgeCont.h.
Referenced by getNoEdgeSplits(), and splitAt().
|
private |
The extracted nodes which are kept for reference.
Definition at line 557 of file NBEdgeCont.h.
Referenced by clear(), extract(), retrieve(), and wasRemoved().
|
private |
The ids of ignored edges.
Definition at line 560 of file NBEdgeCont.h.
Referenced by insert(), and wasIgnored().
|
private |
whether a geo transform has been applied to the pruning boundary
Definition at line 600 of file NBEdgeCont.h.
Referenced by applyOptions(), and ignoreFilterMatch().
|
private |
Boundary within which an edge must be located in order to be kept.
Definition at line 597 of file NBEdgeCont.h.
Referenced by applyOptions(), and ignoreFilterMatch().
|
private |
Whether edges shall be joined first, then removed.
Definition at line 576 of file NBEdgeCont.h.
Referenced by applyOptions(), ignoreFilterMatch(), and splitAt().
|
private |
The network builder; used to obtain type information.
Definition at line 517 of file NBEdgeCont.h.
Referenced by ignoreFilterMatch().
|
private |
Set of edges types which shall be kept.
Definition at line 591 of file NBEdgeCont.h.
Referenced by applyOptions(), and ignoreFilterMatch().
|
private |
Set of edges types which shall be removed.
Definition at line 594 of file NBEdgeCont.h.
Referenced by applyOptions(), and ignoreFilterMatch().
|
private |
Set of vehicle types which must be allowed on edges in order to keep them.
Definition at line 585 of file NBEdgeCont.h.
Referenced by applyOptions(), and ignoreFilterMatch().
|
private |
Set of vehicle types which need not be supported (edges which allow ONLY these are removed)
Definition at line 588 of file NBEdgeCont.h.
Referenced by applyOptions(), and ignoreFilterMatch().