Eclipse SUMO - Simulation of Urban MObility
|
Storage for edges, including some functionality operating on multiple edges. More...
#include <NBEdgeCont.h>
Data Structures | |
struct | MinLaneComparatorIdLess |
struct | PostProcessConnection |
A structure representing a connection between two lanes. More... | |
struct | Split |
A structure which describes changes of lane number or speed along the road. More... | |
class | split_sorter |
Sorts splits by their position (increasing) More... | |
Public Member Functions | |
void | addPrefix (const std::string &prefix) |
add prefix to all edges | |
void | addRoundabout (const EdgeSet &roundabout) |
add user specified roundabout | |
void | applyOptions (OptionsCont &oc) |
Initialises the storage by applying given options. | |
bool | checkConsistency (const NBNodeCont &nc) |
ensure that all edges have valid nodes | |
void | checkGrade (double threshold) const |
check whether edges are to steep | |
void | checkOverlap (double threshold, double zThreshold) const |
check whether edges overlap | |
void | cleanupRoundabouts () |
void | clear () |
Deletes all edges. | |
void | computeAngles () |
compute all edge angles | |
int | extractRoundabouts () |
Determines which edges have been marked as roundabouts and stores them internally. | |
void | fixSplitCustomLength () |
adapt custom lengths of split edges to account for intersection size | |
void | generateStreetSigns () |
assigns street signs to edges based on toNode types | |
EdgeVector | getAllEdges () const |
return all edges | |
RouterEdgeVector | getAllRouterEdges () const |
return all router edges | |
NBEdge * | getByID (const std::string &edgeID) const |
Returns the edge with id if it exists. | |
EdgeVector | getGeneratedFrom (const std::string &id) const |
Returns the edges which have been built by splitting the edge of the given id. | |
NBEdge * | getOppositeByID (const std::string &edgeID) const |
Returns the edge with negated id if it exists. | |
const std::set< EdgeSet > | getRoundabouts () const |
Returns the determined roundabouts. | |
std::set< std::string > | getUsedTypes () const |
return all edge types in used | |
int | guessRoundabouts () |
Determines which edges belong to roundabouts and increases their priority. | |
int | guessSpecialLanes (SUMOVehicleClass svc, double width, double minSpeed, double maxSpeed, bool fromPermissions, const std::string &excludeOpt, NBTrafficLightLogicCont &tlc) |
add sidwalks to edges within the given limits or permissions and return the number of edges affected | |
bool | hasGuessedRoundabouts () const |
check if there is guessed roundabouts | |
void | ignore (std::string id) |
mark the given edge id as ignored | |
bool | ignoreFilterMatch (NBEdge *edge) |
Returns true if this edge matches one of the removal criteria. | |
int | joinLanes (SVCPermissions perms) |
join adjacent lanes with the given permissions | |
int | joinTramEdges (NBDistrictCont &dc, NBPTStopCont &sc, NBPTLineCont &lc, double maxDist) |
join tram edges into adjacent lanes | |
void | markRoundabouts () |
mark edge priorities and prohibit turn-arounds for all roundabout edges | |
NBEdgeCont (NBTypeCont &tc) | |
Constructor. | |
void | patchRoundabouts (NBEdge *orig, NBEdge *part1, NBEdge *part2, std::set< EdgeSet > &roundabouts) |
fix roundabout information after splitting an edge | |
int | remapIDs (bool numericaIDs, bool reservedIDs, const std::string &prefix, NBPTStopCont &sc) |
remap node IDs accoring to options –numerical-ids and –reserved-ids | |
int | removeEdgesByPermissions (NBDistrictCont &dc) |
int | removeEdgesBySpeed (NBDistrictCont &dc) |
return number of edges removed | |
int | removeLanesByWidth (NBDistrictCont &dc, const double minWidth) |
void | removeRoundabout (const NBNode *node) |
remove roundabout that contains the given node | |
void | removeRoundaboutEdges (const EdgeSet &toRemove) |
remove edges from all stored roundabouts | |
void | rename (NBEdge *edge, const std::string &newID) |
Renames the edge. Throws exception if newID already exists. | |
void | updateAllChangeRestrictions (SVCPermissions ignoring) |
modify all restrictions on lane changing for edges and connections | |
bool | wasIgnored (std::string id) const |
Returns whether the edge with the id was ignored during parsing. | |
bool | wasRemoved (std::string id) const |
Returns whether the edge with the id was deleted explicitly. | |
~NBEdgeCont () | |
Destructor. | |
edge access methods | |
bool | insert (NBEdge *edge, bool ignorePrunning=false) |
Adds an edge to the dictionary. | |
NBEdge * | retrieve (const std::string &id, bool retrieveExtracted=false) const |
Returns the edge that has the given id. | |
NBEdge * | retrievePossiblySplit (const std::string &id, bool downstream) const |
Tries to retrieve an edge, even if it is splitted. | |
NBEdge * | retrievePossiblySplit (const std::string &id, const std::string &hint, bool incoming) const |
Tries to retrieve an edge, even if it is splitted. | |
NBEdge * | retrievePossiblySplit (const std::string &id, double pos) const |
Tries to retrieve an edge, even if it is splitted. | |
void | erase (NBDistrictCont &dc, NBEdge *edge) |
Removes the given edge from the container (deleting it) | |
void | extract (NBDistrictCont &dc, NBEdge *edge, bool remember=false) |
Removes the given edge from the container like erase but does not delete it. | |
std::map< std::string, NBEdge * >::const_iterator | begin () const |
Returns the pointer to the begin of the stored edges. | |
std::map< std::string, NBEdge * >::const_iterator | end () const |
Returns the pointer to the end of the stored edges. | |
explicit edge manipulation methods | |
void | processSplits (NBEdge *e, std::vector< Split > splits, NBNodeCont &nc, NBDistrictCont &dc, NBTrafficLightLogicCont &tlc) |
process splits | |
bool | splitAt (NBDistrictCont &dc, NBEdge *edge, NBNode *node) |
Splits the edge at the position nearest to the given node. | |
bool | splitAt (NBDistrictCont &dc, NBEdge *edge, NBNode *node, const std::string &firstEdgeName, const std::string &secondEdgeName, int noLanesFirstEdge, int noLanesSecondEdge, const double speed=-1., const double friction=1., const int changedLeft=0) |
Splits the edge at the position nearest to the given node using the given modifications. | |
bool | splitAt (NBDistrictCont &dc, NBEdge *edge, double edgepos, NBNode *node, const std::string &firstEdgeName, const std::string &secondEdgeName, int noLanesFirstEdge, int noLanesSecondEdge, const double speed=-1., const double friction=1., const int changedLeft=0) |
Splits the edge at the position nearest to the given node using the given modifications. | |
container access methods | |
int | size () const |
Returns the number of edges. | |
std::vector< std::string > | getAllNames () const |
Returns all ids of known edges. | |
const std::pair< NBEdge *, NBEdge * > * | getSplit (const NBEdge *const origEdge) const |
Returns the edge split if the edge has been split, nullptr otherwise. | |
int | getNumEdgeSplits () const |
Returns the number of edge splits. | |
Adapting the input | |
int | removeUnwishedEdges (NBDistrictCont &dc) |
Removes unwished edges (not in keep-edges) | |
void | splitGeometry (NBDistrictCont &dc, NBNodeCont &nc) |
Splits edges into multiple if they have a complex geometry. | |
void | reduceGeometries (const double minDist) |
void | checkGeometries (const double maxAngle, bool fixAngle, const double minRadius, bool fix, bool fixRailways, bool silent=false) |
processing methods | |
void | sortOutgoingLanesConnections () |
Sorts all lanes of all edges within the container by their direction. | |
void | computeEdge2Edges (bool noLeftMovers) |
Computes for each edge the approached edges. | |
void | computeLanes2Edges () |
Computes for each edge which lanes approach the next edges. | |
void | recheckLanes () |
Rechecks whether all lanes have a successor for each of the stored edges. | |
void | appendTurnarounds (bool noTLSControlled, bool noFringe, bool onlyDeadends, bool onlyTurnlane, bool noGeometryLike) |
Appends turnarounds to all edges stored in the container. | |
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. | |
void | appendRailwayTurnarounds (const NBPTStopCont &sc) |
Appends turnarounds to all bidiRail edges with stops. | |
void | computeEdgeShapes (double smoothElevationThreshold=-1) |
Computes the shapes of all edges stored in the container. | |
void | computeLaneShapes () |
Computes the shapes of all lanes of all edges stored in the container. | |
void | clearControllingTLInformation () const |
Clears information about controlling traffic lights for all connenections of all edges. | |
void | joinSameNodeConnectingEdges (NBDistrictCont &dc, NBTrafficLightLogicCont &tlc, EdgeVector edges) |
Joins the given edges because they connect the same nodes. | |
void | guessOpposites () |
Sets opposite lane information for geometrically close edges. | |
void | recheckLaneSpread () |
Rechecks whether the lane spread is proper. | |
Connections handling | |
void | addPostProcessConnection (const std::string &from, int fromLane, const std::string &to, int toLane, bool mayDefinitelyPass, KeepClear keepClear, double contPos, double visibility, double speed, double friction, double length, const PositionVector &customShape, bool uncontrolled, bool warnOnly, SVCPermissions permissions=SVC_UNSPECIFIED, bool indirectLeft=false, const std::string &edgeType="", SVCPermissions changeLeft=SVC_UNSPECIFIED, SVCPermissions changeRight=SVC_UNSPECIFIED) |
Adds a connection which could not be set during loading. | |
bool | hasPostProcessConnection (const std::string &from, const std::string &to="") |
add post process connections | |
void | recheckPostProcessConnections () |
Try to set any stored connections. | |
Private Types | |
typedef std::map< std::string, NBEdge * > | EdgeCont |
The type of the dictionary where an edge may be found by its id. | |
Private Member Functions | |
NBEdgeCont (const NBEdgeCont &s)=delete | |
invalidated copy constructor | |
NBEdgeCont & | operator= (const NBEdgeCont &s)=delete |
invalidated assignment operator | |
void | removeRoundaboutEdges (const EdgeSet &toRemove, std::set< EdgeSet > &roundabouts) |
remove roundabout edges | |
Static Private Member Functions | |
static double | formFactor (const EdgeVector &loopEdges) |
compute the form factor for a loop of edges | |
Private Attributes | |
std::map< std::string, std::vector< PostProcessConnection > > | myConnections |
The list of connections to recheck. | |
std::set< NBEdge * > | myEdgeCemetery |
The edges which got extracted twice but may still be referenced somewhere TODO smart_ptr? | |
EdgeCont | myEdges |
The instance of the dictionary (id->edge) | |
std::map< const NBEdge *, std::pair< NBEdge *, NBEdge * > > | myEdgesSplit |
the number of splits of edges during the building | |
EdgeCont | myExtractedEdges |
The extracted edges which are kept for reference. | |
std::set< EdgeSet > | myGuessedRoundabouts |
Edges marked as belonging to a roundabout after guessing. | |
std::set< std::string > | myIgnoredEdges |
The ids of ignored edges. | |
std::set< EdgeSet > | myRoundabouts |
Edges marked as belonging to a roundabout by the user (each EdgeVector is a roundabout) | |
NBTypeCont & | myTypeCont |
The network builder; used to obtain type information. | |
std::set< const NBEdge * > | myWasSplit |
the edges that were created as result of splitting | |
Settings for accepting/dismissing edges | |
double | myEdgesMinSpeed |
The minimum speed an edge may have in order to be kept (default: -1) | |
bool | myRemoveEdgesAfterLoading |
Whether edges shall be joined and patched first, then removed. | |
std::set< std::string > | myEdges2Keep |
Set of ids of edges which shall explicitly be kept. | |
std::set< std::string > | myEdges2Remove |
Set of ids of edges which shall explicitly be removed. | |
SVCPermissions | myVehicleClasses2Keep |
Set of vehicle types which must be allowed on edges in order to keep them. | |
SVCPermissions | myVehicleClasses2Remove |
Set of vehicle types which need not be supported (edges which allow ONLY these are removed) | |
std::set< std::string > | myTypes2Keep |
Set of edges types which shall be kept. | |
std::set< std::string > | myTypes2Remove |
Set of edges types which shall be removed. | |
PositionVector | myPruningBoundary |
Boundary within which an edge must be located in order to be kept. | |
bool | myNeedGeoTransformedPruningBoundary |
whether a geo transform has been applied to the pruning boundary | |
Storage for edges, including some functionality operating on multiple edges.
Definition at line 59 of file NBEdgeCont.h.
|
private |
The type of the dictionary where an edge may be found by its id.
Definition at line 735 of file NBEdgeCont.h.
NBEdgeCont::NBEdgeCont | ( | NBTypeCont & | tc | ) |
Constructor.
[in] | tc | The net builded; used to obtain types |
Definition at line 64 of file NBEdgeCont.cpp.
NBEdgeCont::~NBEdgeCont | ( | ) |
|
privatedelete |
invalidated copy constructor
void NBEdgeCont::addPostProcessConnection | ( | const std::string & | from, |
int | fromLane, | ||
const std::string & | to, | ||
int | toLane, | ||
bool | mayDefinitelyPass, | ||
KeepClear | keepClear, | ||
double | contPos, | ||
double | visibility, | ||
double | speed, | ||
double | friction, | ||
double | length, | ||
const PositionVector & | customShape, | ||
bool | uncontrolled, | ||
bool | warnOnly, | ||
SVCPermissions | permissions = SVC_UNSPECIFIED , |
||
bool | indirectLeft = false , |
||
const std::string & | edgeType = "" , |
||
SVCPermissions | changeLeft = SVC_UNSPECIFIED , |
||
SVCPermissions | changeRight = SVC_UNSPECIFIED |
||
) |
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 |
[in] | keepClear | Whether the connection must check to keep the junction clear |
[in] | contPos | Custom position for internal junction |
[in] | visibility | Custom foe visiblity connection |
[in] | speed | Custom speed |
[in] | friction | Custom friction |
[in] | customShape | Custom shape |
[in] | warnOnly | Whether a failure to set this connection should only result in a warning |
Definition at line 1160 of file NBEdgeCont.cpp.
References myConnections.
Referenced by NIXMLConnectionsHandler::parseLaneBound().
void NBEdgeCont::addPrefix | ( | const std::string & | prefix | ) |
add prefix to all edges
Definition at line 1733 of file NBEdgeCont.cpp.
References myEdges.
Referenced by GNELoadThread::run().
void NBEdgeCont::addRoundabout | ( | const EdgeSet & | roundabout | ) |
add user specified roundabout
Definition at line 1565 of file NBEdgeCont.cpp.
References myRoundabouts, toString(), and WRITE_WARNING.
Referenced by NIImporter_SUMO::_loadNetwork(), NIXMLEdgesHandler::addRoundabout(), and extractRoundabouts().
void NBEdgeCont::appendRailwayTurnarounds | ( | const NBPTStopCont & | sc | ) |
Appends turnarounds to all bidiRail edges with stops.
Definition at line 970 of file NBEdgeCont.cpp.
References NBEdge::getID(), NBEdge::getNumLanes(), NBPTStopCont::getStops(), NBEdge::getTurnDestination(), NBEdge::isBidiRail(), KEEPCLEAR_UNSPECIFIED, myEdges, NBEdge::setConnection(), SUMO_const_haltingSpeed, NBEdge::UNSPECIFIED_CONTPOS, NBEdge::UNSPECIFIED_VISIBILITY_DISTANCE, and NBEdge::VALIDATED.
Referenced by NBNetBuilder::compute().
void NBEdgeCont::appendTurnarounds | ( | bool | noTLSControlled, |
bool | noFringe, | ||
bool | onlyDeadends, | ||
bool | onlyTurnlane, | ||
bool | noGeometryLike | ||
) |
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 |
[in] | noFringe | Whether the turnaround shall not be connected if the junction is at the (outer) fringe |
[in] | onlyDeadends | Whether the turnaround shall only be built at deadends |
[in] | onlyTurnlane | Whether the turnaround shall only be built when there is an exclusive (left) turn lane |
[in] | noGeometryLike | Whether the turnaround shall be built at geometry-like nodes |
Definition at line 954 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 962 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 78 of file NBEdgeCont.cpp.
References OptionsCont::exists(), OptionsCont::getBool(), OptionsCont::getFloat(), OptionsCont::getString(), OptionsCont::getStringVector(), OptionsCont::getValueString(), OptionsCont::isSet(), NBHelpers::loadEdgesFromFile(), myEdges2Keep, myEdges2Remove, myEdgesMinSpeed, myNeedGeoTransformedPruningBoundary, myPruningBoundary, myRemoveEdgesAfterLoading, myTypes2Keep, myTypes2Remove, myVehicleClasses2Keep, myVehicleClasses2Remove, GeomConvHelper::parseShapeReporting(), parseVehicleClasses(), TL, and StringUtils::toDouble().
Referenced by NBNetBuilder::applyOptions().
|
inline |
Returns the pointer to the begin of the stored edges.
Definition at line 171 of file NBEdgeCont.h.
References myEdges.
Referenced by NBNetBuilder::compute(), NBRailwayTopologyAnalyzer::extendBidiEdges(), NBRailwayTopologyAnalyzer::getRailNodes(), NWWriter_OpenDrive::mapmatchRoadObjects(), NBNetBuilder::mirrorX(), NBNetBuilder::moveToOrigin(), NBNodeCont::removeComponents(), NBNodeCont::removeUnwishedNodes(), NGNet::toNB(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_Amitran::writeNetwork(), NWWriter_MATSim::writeNetwork(), NWWriter_OpenDrive::writeNetwork(), NWWriter_SUMO::writeNetwork(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_XML::writeStreetSigns(), and NWWriter_XML::writeTrafficLights().
bool NBEdgeCont::checkConsistency | ( | const NBNodeCont & | nc | ) |
ensure that all edges have valid nodes
Definition at line 2135 of file NBEdgeCont.cpp.
References NBEdge::getFromNode(), NBEdge::getID(), Named::getID(), NBEdge::getToNode(), myEdges, NBNodeCont::retrieve(), TL, and WRITE_ERRORF.
Referenced by NILoader::load().
void NBEdgeCont::checkGeometries | ( | const double | maxAngle, |
bool | fixAngle, | ||
const double | minRadius, | ||
bool | fix, | ||
bool | fixRailways, | ||
bool | silent = false |
||
) |
[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 822 of file NBEdgeCont.cpp.
References isForbidden(), isRailway(), isSidewalk(), and myEdges.
Referenced by NBNetBuilder::compute().
void NBEdgeCont::checkGrade | ( | double | threshold | ) | const |
check whether edges are to steep
Definition at line 1847 of file NBEdgeCont.cpp.
References NBEdge::getConnections(), NBEdge::Connection::getDescription(), NBEdge::getID(), NBEdge::getLaneShape(), PositionVector::getMaxGrade(), NBEdge::getNumLanes(), MAX2(), myEdges, NBEdge::Connection::shape, TL, NBEdge::Connection::viaShape, and WRITE_WARNINGF.
Referenced by NBNetBuilder::compute().
void NBEdgeCont::checkOverlap | ( | double | threshold, |
double | zThreshold | ||
) | const |
check whether edges overlap
Definition at line 1818 of file NBEdgeCont.cpp.
References PositionVector::append(), PositionVector::getBoxBoundary(), NBEdge::getCCWBoundaryLine(), NBEdge::getFromNode(), NBEdge::getGeometry(), NBEdge::getID(), PositionVector::getOverlapWith(), NBEdge::getToNode(), NBEdge::getTotalWidth(), Boundary::grow(), myEdges, Boundary::overlapsWith(), TL, and WRITE_WARNINGF.
Referenced by NBNetBuilder::compute().
void NBEdgeCont::cleanupRoundabouts | ( | ) |
Definition at line 1522 of file NBEdgeCont.cpp.
References myEdges, and myRoundabouts.
Referenced by NBNetBuilder::compute().
void NBEdgeCont::clear | ( | ) |
Deletes all edges.
Definition at line 163 of file NBEdgeCont.cpp.
References myEdgeCemetery, 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 836 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBTrafficLightLogicCont::setTLControllingInformation().
void NBEdgeCont::computeAngles | ( | ) |
compute all edge angles
Definition at line 2175 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBNetBuilder::compute().
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 852 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBNetBuilder::compute().
void NBEdgeCont::computeEdgeShapes | ( | double | smoothElevationThreshold = -1 | ) |
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 992 of file NBEdgeCont.cpp.
References NBEdge::getLaneID(), NBEdge::getLanes(), NBEdge::getLength(), NBEdge::getNumLanes(), myEdges, retrieve(), and NBEdge::setAverageLengthWithOpposite().
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 860 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 1016 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBNetBuilder::compute().
|
inline |
Returns the pointer to the end of the stored edges.
Definition at line 178 of file NBEdgeCont.h.
References myEdges.
Referenced by NBNetBuilder::compute(), NBRailwayTopologyAnalyzer::extendBidiEdges(), NBRailwayTopologyAnalyzer::getRailNodes(), NWWriter_OpenDrive::mapmatchRoadObjects(), NBNetBuilder::mirrorX(), NBNetBuilder::moveToOrigin(), NBNodeCont::removeComponents(), NBNodeCont::removeUnwishedNodes(), NGNet::toNB(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_Amitran::writeNetwork(), NWWriter_MATSim::writeNetwork(), NWWriter_OpenDrive::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 411 of file NBEdgeCont.cpp.
References extract().
Referenced by NIImporter_SUMO::_loadNetwork(), NIXMLEdgesHandler::addEdge(), NBNodeCont::removeComponents(), NBNodeCont::removeIsolatedRoads(), NBNodeCont::removeRailComponents(), NBNode::removeSelfLoops(), and removeUnwishedEdges().
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 418 of file NBEdgeCont.cpp.
References NBEdge::getID(), myEdgeCemetery, myEdges, myExtractedEdges, NBEdge::myFrom, NBEdge::myTo, NBNode::removeEdge(), and NBDistrictCont::removeFromSinksAndSources().
Referenced by NIXMLEdgesHandler::deleteEdge(), erase(), NBNodeCont::joinNodeCluster(), joinSameNodeConnectingEdges(), NBNodeCont::joinSimilarEdges(), joinTramEdges(), removeEdgesByPermissions(), removeEdgesBySpeed(), removeLanesByWidth(), NBNodeCont::removeUnwishedNodes(), and splitAt().
int NBEdgeCont::extractRoundabouts | ( | ) |
Determines which edges have been marked as roundabouts and stores them internally.
Definition at line 1475 of file NBEdgeCont.cpp.
References addRoundabout(), NBEdge::getFromNode(), NBEdge::getJunctionPriority(), NBNode::getOutgoingEdges(), NBEdge::getToNode(), myEdges, and NBEdge::ROUNDABOUT.
Referenced by NIImporter_OpenStreetMap::load().
void NBEdgeCont::fixSplitCustomLength | ( | ) |
adapt custom lengths of split edges to account for intersection size
Definition at line 2154 of file NBEdgeCont.cpp.
References NBEdge::getConnections(), NBEdge::getIncomingEdges(), NBEdge::getLoadedLength(), NBEdge::hasLoadedLength(), MAX2(), myEdges, myWasSplit, and NBEdge::setLoadedLength().
Referenced by NBNetBuilder::compute().
|
staticprivate |
compute the form factor for a loop of edges
Definition at line 1545 of file NBEdgeCont.cpp.
References PositionVector::append(), PositionVector::area(), PositionVector::length2D(), and M_PI.
Referenced by guessRoundabouts().
void NBEdgeCont::generateStreetSigns | ( | ) |
assigns street signs to edges based on toNode types
Definition at line 1647 of file NBEdgeCont.cpp.
References NBEdge::addSign(), ALLWAY_STOP, NBEdge::getJunctionPriority(), NBEdge::getLength(), NBEdge::getToNode(), NBNode::getType(), NBNode::isSimpleContinuation(), LEFT_BEFORE_RIGHT, MAX2(), myEdges, PRIORITY, PRIORITY_STOP, RIGHT_BEFORE_LEFT, NBSign::SIGN_TYPE_ALLWAY_STOP, NBSign::SIGN_TYPE_LEFT_BEFORE_RIGHT, NBSign::SIGN_TYPE_PRIORITY, NBSign::SIGN_TYPE_RIGHT_BEFORE_LEFT, NBSign::SIGN_TYPE_STOP, and NBSign::SIGN_TYPE_YIELD.
Referenced by NBNetBuilder::compute().
EdgeVector NBEdgeCont::getAllEdges | ( | ) | const |
return all edges
Definition at line 2119 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBRailwayTopologyAnalyzer::addBidiEdgesForStops(), NBRailwayTopologyAnalyzer::extendDirectionPriority(), getAllRouterEdges(), GNEViewNet::getEdgeLaneParamKeys(), and NBRailwayTopologyAnalyzer::makeAllBidi().
std::vector< std::string > NBEdgeCont::getAllNames | ( | ) | const |
Returns all ids of known edges.
Definition at line 758 of file NBEdgeCont.cpp.
References myEdges.
Referenced by GNENet::initJunctionsAndEdges(), remapIDs(), NBNodeCont::removeIsolatedRoads(), NWWriter_DlrNavteq::writeNodesUnsplitted(), and NWWriter_DlrNavteq::writeProhibitedManoeuvres().
RouterEdgeVector NBEdgeCont::getAllRouterEdges | ( | ) | const |
return all router edges
Definition at line 2129 of file NBEdgeCont.cpp.
References getAllEdges().
Referenced by NBPTLineCont::fixBidiStops(), and GNEPathManager::PathCalculator::PathCalculator().
NBEdge * NBEdgeCont::getByID | ( | const std::string & | edgeID | ) | const |
Returns the edge with id if it exists.
Definition at line 1153 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBPTStopCont::assignAndCreatNewPTStopAsNeeded(), NBPTStopCont::assignPTStopToEdgeOfClosestPlatform(), NBPTStopCont::cleanupDeleted(), NBPTLine::deleteInvalidStops(), NBPTStopCont::findAccessEdgesForRailStops(), NBPTStop::findLaneAndComputeBusStopExtent(), NBPTStopCont::generateBidiStops(), NBPTLineCont::getCost(), NBPTStopCont::getReverseStop(), NBNodeCont::removeComponents(), and NBPTLineCont::reviseStops().
EdgeVector NBEdgeCont::getGeneratedFrom | ( | const std::string & | id | ) | const |
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 1227 of file NBEdgeCont.cpp.
References myEdges.
Referenced by retrievePossiblySplit().
|
inline |
Returns the number of edge splits.
Definition at line 311 of file NBEdgeCont.h.
References myEdgesSplit.
Referenced by NBNetBuilder::compute(), and NILoader::load().
NBEdge * NBEdgeCont::getOppositeByID | ( | const std::string & | edgeID | ) | const |
Returns the edge with negated id if it exists.
Definition at line 1146 of file NBEdgeCont.cpp.
References myEdges.
Referenced by recheckLaneSpread(), and NWWriter_DlrNavteq::writeNodesUnsplitted().
const std::set< EdgeSet > NBEdgeCont::getRoundabouts | ( | ) | const |
Returns the determined roundabouts.
Definition at line 1557 of file NBEdgeCont.cpp.
References myGuessedRoundabouts, and myRoundabouts.
Referenced by NBNetBuilder::compute(), NBNodeCont::computeLogics2(), NBRampsComputer::computeRamps(), markRoundabouts(), GNENet::selectRoundabout(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_Amitran::writeNetwork(), and NWWriter_SUMO::writeNetwork().
|
inline |
Returns the edge split if the edge has been split, nullptr otherwise.
Definition at line 300 of file NBEdgeCont.h.
References myEdgesSplit, and split().
Referenced by NBPTLine::removeInvalidEdges().
std::set< std::string > NBEdgeCont::getUsedTypes | ( | ) | const |
return all edge types in used
Definition at line 2183 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NWWriter_SUMO::writeNetwork(), and NWWriter_XML::writeTypes().
void NBEdgeCont::guessOpposites | ( | ) |
Sets opposite lane information for geometrically close edges.
Definition at line 1122 of file NBEdgeCont.cpp.
References NBEdge::guessOpposite(), and myEdges.
Referenced by NBNetBuilder::compute().
int NBEdgeCont::guessRoundabouts | ( | ) |
Determines which edges belong to roundabouts and increases their priority.
Definition at line 1269 of file NBEdgeCont.cpp.
References DEBUG_EDGE_ID, formFactor(), gDebugFlag1, NBEdge::getAngleAtNode(), NBNode::getConnectionTo(), NBNode::getEdges(), OptionsCont::getFloat(), NBEdge::getFromNode(), NBEdge::getID(), Named::getIDSecure(), NBEdge::getLaneShape(), NBEdge::getLength(), NBEdge::getLoadedLength(), OptionsCont::getOptions(), NBEdge::getPermissions(), NBEdge::getToNode(), NBEdge::getTurnDestination(), NBNode::getType(), LEFT_BEFORE_RIGHT, MAX2(), myEdges, myGuessedRoundabouts, myRoundabouts, NBContHelper::nextCW(), NBHelpers::relAngle(), RIGHT_BEFORE_LEFT, SVCAll, TL, toString(), NBNode::typeWasGuessed(), and WRITE_WARNINGF.
Referenced by NBNetBuilder::compute().
int NBEdgeCont::guessSpecialLanes | ( | SUMOVehicleClass | svc, |
double | width, | ||
double | minSpeed, | ||
double | maxSpeed, | ||
bool | fromPermissions, | ||
const std::string & | excludeOpt, | ||
NBTrafficLightLogicCont & | tlc | ||
) |
add sidwalks to edges within the given limits or permissions and return the number of edges affected
Definition at line 1690 of file NBEdgeCont.cpp.
References NBEdge::addRestrictedLane(), NBEdge::getFromNode(), NBEdge::getID(), OptionsCont::getOptions(), NBEdge::getPermissions(), NBEdge::getSpeed(), OptionsCont::getStringVector(), NBEdge::getToNode(), NBEdge::hasRestrictedLane(), NBEdge::invalidateConnections(), NBNode::invalidateOutgoingConnections(), NBNode::invalidateTLS(), myEdges, and SVC_PEDESTRIAN.
Referenced by NBNetBuilder::compute().
|
inline |
check if there is guessed roundabouts
Definition at line 547 of file NBEdgeCont.h.
References myGuessedRoundabouts.
Referenced by NBNetBuilder::compute().
bool NBEdgeCont::hasPostProcessConnection | ( | const std::string & | from, |
const std::string & | to = "" |
||
) |
add post process connections
Definition at line 1169 of file NBEdgeCont.cpp.
References myConnections.
Referenced by NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), and NBNodeCont::joinNodeCluster().
|
inline |
mark the given edge id as ignored
Definition at line 486 of file NBEdgeCont.h.
References myIgnoredEdges.
Referenced by NIImporter_SUMO::_loadNetwork().
bool NBEdgeCont::ignoreFilterMatch | ( | NBEdge * | edge | ) |
Returns true if this edge matches one of the removal criteria.
Definition at line 203 of file NBEdgeCont.cpp.
References PositionVector::getBoxBoundary(), NBTypeCont::getEdgeTypeShallBeDiscarded(), NBEdge::getGeometry(), NBEdge::getID(), GeoConvHelper::getLoaded(), NBEdge::getPermissions(), GeoConvHelper::getProcessing(), NBEdge::getSpeed(), NBEdge::getTypeID(), Boundary::grow(), PositionVector::intersects(), NBTypeCont::knows(), myEdges2Keep, myEdges2Remove, myEdgesMinSpeed, myNeedGeoTransformedPruningBoundary, myPruningBoundary, myRemoveEdgesAfterLoading, myTypeCont, myTypes2Keep, myTypes2Remove, myVehicleClasses2Keep, myVehicleClasses2Remove, Boundary::overlapsWith(), PositionVector::partialWithin(), TL, NBNetBuilder::transformCoordinates(), WRITE_ERROR, and GeoConvHelper::x2cartesian_const().
Referenced by NIImporter_SUMO::_loadNetwork(), and insert().
bool NBEdgeCont::insert | ( | NBEdge * | edge, |
bool | ignorePrunning = false |
||
) |
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 182 of file NBEdgeCont.cpp.
References NBEdge::dismissVehicleClassInformation(), OptionsCont::exists(), OptionsCont::getBool(), NBEdge::getFromNode(), NBEdge::getID(), OptionsCont::getOptions(), NBEdge::getToNode(), ignoreFilterMatch(), myEdges, myIgnoredEdges, and NBNode::removeEdge().
Referenced by NIImporter_SUMO::_loadNetwork(), NBRailwayTopologyAnalyzer::addBidiEdge(), GNENet::addExplicitTurnaround(), NIVissimEdge::buildNBEdge(), NIVissimDistrictConnection::dict_BuildDistricts(), NIImporter_OpenStreetMap::insertEdge(), joinSameNodeConnectingEdges(), NIImporter_ArcView::load(), NIImporter_OpenDrive::loadNetwork(), NIXMLEdgesHandler::myEndElement(), NIImporter_VISUM::parse_Connectors_legacy(), NIImporter_VISUM::parse_Edges(), splitAt(), and NGNet::toNB().
int NBEdgeCont::joinLanes | ( | SVCPermissions | perms | ) |
join adjacent lanes with the given permissions
Definition at line 1877 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBNetBuilder::compute().
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 1024 of file NBEdgeCont.cpp.
References NBEdge::addEdge2EdgeConnection(), extract(), NBEdge::getFromNode(), NBEdge::getStreetName(), NBEdge::getToNode(), insert(), NBEdge::moveOutgoingConnectionsFrom(), NBEdge::myLaneSpreadFunction, NBNode::replaceIncoming(), NBNode::replaceOutgoing(), NBTrafficLightLogicCont::replaceRemoved(), NBEdge::setEndOffset(), NBEdge::setLaneWidth(), NBEdge::setPermissions(), NBEdge::UNSPECIFIED_FRICTION, NBEdge::UNSPECIFIED_OFFSET, and NBEdge::UNSPECIFIED_WIDTH.
Referenced by NBNodeCont::joinSimilarEdges().
int NBEdgeCont::joinTramEdges | ( | NBDistrictCont & | dc, |
NBPTStopCont & | sc, | ||
NBPTLineCont & | lc, | ||
double | maxDist | ||
) |
join tram edges into adjacent lanes
Definition at line 1897 of file NBEdgeCont.cpp.
References Position::angleTo2D(), PositionVector::distance2D(), extract(), OptionsCont::getBool(), NBEdge::getFromNode(), NBEdge::getGeometry(), NBEdge::getID(), NBNode::getIncomingEdges(), NBEdge::getLaneShape(), GeomHelper::getMinAngleDiff(), OptionsCont::getOptions(), NBNode::getOutgoingEdges(), NBEdge::getPermissions(), PositionVector::getSubpart(), NBEdge::getToNode(), Boundary::grow(), NamedRTree::Insert(), GeomHelper::INVALID_OFFSET, NBEdge::invalidateConnections(), NBEdge::isConnectedTo(), isTram(), JOIN_TRAM_MAX_ANGLE, JOIN_TRAM_MIN_LENGTH, GeomHelper::legacyDegree(), PositionVector::length(), MAX2(), myEdges, PositionVector::nearest_offset_to_point2D(), PositionVector::positionAtOffset2D(), NBPTLineCont::replaceEdge(), NBPTStopCont::replaceEdge(), retrieve(), NamedRTree::Search(), NBEdge::setOrigID(), NBEdge::setPermissions(), splitAt(), SVC_BUS, SVC_PASSENGER, SVC_TRAM, TL, toString(), WRITE_WARNINGF, Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().
Referenced by NBNetBuilder::compute().
void NBEdgeCont::markRoundabouts | ( | ) |
mark edge priorities and prohibit turn-arounds for all roundabout edges
Definition at line 1608 of file NBEdgeCont.cpp.
References NBNode::getIncomingEdges(), getRoundabouts(), NBEdge::LANES2LANES_USER, NBHelpers::normRelAngle(), NBEdge::ROUNDABOUT, and NBNode::setRoundabout().
Referenced by NBNetBuilder::compute().
|
privatedelete |
invalidated assignment operator
void NBEdgeCont::patchRoundabouts | ( | NBEdge * | orig, |
NBEdge * | part1, | ||
NBEdge * | part2, | ||
std::set< EdgeSet > & | roundabouts | ||
) |
fix roundabout information after splitting an edge
Definition at line 740 of file NBEdgeCont.cpp.
Referenced by splitAt().
void NBEdgeCont::processSplits | ( | NBEdge * | e, |
std::vector< Split > | splits, | ||
NBNodeCont & | nc, | ||
NBDistrictCont & | dc, | ||
NBTrafficLightLogicCont & | tlc | ||
) |
process splits
Definition at line 458 of file NBEdgeCont.cpp.
References NBEdge::addLane2LaneConnection(), CENTER, NBEdge::decLaneNo(), NBEdge::getFromNode(), NBEdge::getGeometry(), NBEdge::getID(), NBEdge::getLaneSpreadFunction(), NBEdge::getLoadedLength(), NBEdge::getNumLanes(), NBNode::getOutgoingEdges(), NBEdge::getToNode(), NBEdge::incLaneNo(), NBNodeCont::insert(), NBEdge::invalidateConnections(), NBNode::invalidateTLS(), NBEdgeCont::Split::lanes, NBNodeCont::markAsSplit(), MAX2(), PositionVector::move2side(), NBEdgeCont::Split::offset, NBEdgeCont::Split::offsetFactor, NBEdgeCont::Split::pos, retrieve(), RIGHT, NBEdge::setGeometry(), NBEdge::setSpeed(), split(), splitAt(), SUMO_const_halfLaneWidth, SUMO_const_laneWidth, TL, toString(), NBEdge::VALIDATED, and WRITE_WARNINGF.
Referenced by NIXMLEdgesHandler::myEndElement(), and NGNet::toNB().
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 868 of file NBEdgeCont.cpp.
References NBEdge::getBidiEdge(), OptionsCont::getBool(), NBEdge::getEndOffset(), NBEdge::getFinalLength(), NBEdge::getFromNode(), NBEdge::getID(), NBEdge::getLaneID(), NBEdge::getLanes(), NBEdge::getLaneStruct(), NBEdge::getLength(), NBEdge::getLoadedLength(), NBEdge::getNumLanes(), OptionsCont::getOptions(), NBEdge::getToNode(), NBEdge::getTurnDestination(), NBEdge::isBidiRail(), myEdges, NBEdge::Lane::oppositeID, NBEdge::recheckLanes(), retrieve(), PositionVector::reverse(), NBEdge::setLoadedLength(), NBEdge::Lane::shape, TL, toString(), WRITE_ERROR, WRITE_ERRORF, and WRITE_WARNINGF.
Referenced by NBNetBuilder::compute().
void NBEdgeCont::recheckLaneSpread | ( | ) |
Rechecks whether the lane spread is proper.
Definition at line 1132 of file NBEdgeCont.cpp.
References CENTER, getOppositeByID(), myEdges, RIGHT, and NBEdge::setLaneSpreadFunction().
Referenced by NIImporter_DlrNavteq::loadNetwork().
void NBEdgeCont::recheckPostProcessConnections | ( | ) |
Try to set any stored connections.
Definition at line 1187 of file NBEdgeCont.cpp.
References NBEdge::addLane2LaneConnection(), OptionsCont::exists(), OptionsCont::getBool(), NBEdge::getConnections(), NBEdge::getFromNode(), NBEdge::getID(), Named::getID(), OptionsCont::getOptions(), NBEdge::getToNode(), myConnections, myEdges, NBEdge::removeFromConnections(), retrievePossiblySplit(), NBEdge::Connection::toEdge, NBEdge::USER, WRITE_ERROR, and WRITE_WARNING.
Referenced by NBNetBuilder::compute().
void NBEdgeCont::reduceGeometries | ( | const double | minDist | ) |
[in] | nc | The node container needed to build (geometry) nodes |
Definition at line 814 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBNetBuilder::compute(), and NIImporter_VISUM::load().
int NBEdgeCont::remapIDs | ( | bool | numericaIDs, |
bool | reservedIDs, | ||
const std::string & | prefix, | ||
NBPTStopCont & | sc | ||
) |
remap node IDs accoring to options –numerical-ids and –reserved-ids
Definition at line 1745 of file NBEdgeCont.cpp.
References getAllNames(), OptionsCont::getBool(), IDSupplier::getNext(), OptionsCont::getOptions(), NBPTStopCont::getStops(), OptionsCont::isDefault(), NBHelpers::loadPrefixedIDsFomFile(), myEdges, rename(), StringUtils::startsWith(), StringUtils::toLong(), and toString().
Referenced by NBNetBuilder::compute().
int NBEdgeCont::removeEdgesByPermissions | ( | NBDistrictCont & | dc | ) |
Definition at line 2217 of file NBEdgeCont.cpp.
References extract(), NBEdge::getPermissions(), myEdges, myEdges2Keep, myVehicleClasses2Keep, and myVehicleClasses2Remove.
Referenced by NBNetBuilder::compute().
int NBEdgeCont::removeEdgesBySpeed | ( | NBDistrictCont & | dc | ) |
return number of edges removed
Definition at line 2195 of file NBEdgeCont.cpp.
References extract(), NBEdge::getSpeed(), myEdges, myEdges2Keep, and myEdgesMinSpeed.
Referenced by NBNetBuilder::compute().
int NBEdgeCont::removeLanesByWidth | ( | NBDistrictCont & | dc, |
const double | minWidth | ||
) |
Definition at line 2243 of file NBEdgeCont.cpp.
References NBEdge::deleteLane(), extract(), NBEdge::getLanes(), NBEdge::getNumLanes(), myEdges, myEdges2Keep, and NBEdge::UNSPECIFIED_WIDTH.
Referenced by NBNetBuilder::compute().
void NBEdgeCont::removeRoundabout | ( | const NBNode * | node | ) |
remove roundabout that contains the given node
Definition at line 1576 of file NBEdgeCont.cpp.
References myRoundabouts.
Referenced by NIXMLNodesHandler::processNodeType(), and GNEJunction::setAttribute().
void NBEdgeCont::removeRoundaboutEdges | ( | const EdgeSet & | toRemove | ) |
remove edges from all stored roundabouts
Definition at line 1588 of file NBEdgeCont.cpp.
References myGuessedRoundabouts, myRoundabouts, and removeRoundaboutEdges().
Referenced by NBNodeCont::removeComponents(), and removeRoundaboutEdges().
|
private |
remove roundabout edges
Definition at line 1594 of file NBEdgeCont.cpp.
int 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 769 of file NBEdgeCont.cpp.
References erase(), NBEdge::getFromNode(), NBEdge::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 438 of file NBEdgeCont.cpp.
References SUMOXMLDefinitions::getEdgeIDFromLane(), NBEdge::getID(), NBEdge::getLaneID(), NBEdge::getLanes(), NBEdge::getLaneStruct(), NBEdge::getNumLanes(), myEdges, NBEdge::Lane::oppositeID, retrieve(), Named::setID(), and TLF.
Referenced by remapIDs().
NBEdge * NBEdgeCont::retrieve | ( | const std::string & | id, |
bool | retrieveExtracted = false |
||
) | const |
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 281 of file NBEdgeCont.cpp.
References myEdges, and myExtractedEdges.
Referenced by NIImporter_SUMO::_loadNetwork(), NIXMLPTHandler::addAccess(), NBRailwayTopologyAnalyzer::addBidiEdge(), NIXMLConnectionsHandler::addCrossing(), NIXMLEdgesHandler::addEdge(), NIXMLPTHandler::addPTLineRoute(), NIXMLPTHandler::addPTStop(), NIXMLEdgesHandler::addRoundabout(), NIXMLPTHandler::addRoute(), NIVissimDisturbance::addToNode(), NIXMLConnectionsHandler::addWalkingArea(), NIVissimEdge::buildNBEdge(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), NBConnection::checkFrom(), NBConnection::checkTo(), computeEdgeShapes(), NBRampsComputer::computeRamps(), NBPTLineCont::constructRoute(), NIXMLConnectionsHandler::delConnection(), NIXMLEdgesHandler::deleteEdge(), NIVissimDistrictConnection::dict_BuildDistricts(), NIXMLShapeHandler::getLanePos(), NIImporter_VISUM::getNamedEdge(), NIImporter_VISUM::getNamedEdgeContinuating(), NWWriter_SUMO::getOppositeInternalID(), NIImporter_VISUM::getReversedContinuating(), NBPTLine::getRouteEnd(), NBPTLine::getRouteStart(), NBPTLine::getStopEdges(), NBRailwaySignalGuesser::guessByStops(), GNENet::initJunctionsAndEdges(), GNELane::isValid(), NBNodeCont::joinJunctions(), joinTramEdges(), NIImporter_ArcView::load(), NIImporter_OpenDrive::loadNetwork(), NBRailwayTopologyAnalyzer::makeAllBidi(), NWWriter_OpenDrive::mapmatchRoadObjects(), NIImporter_VISUM::parse_Connectors_legacy(), NIImporter_VISUM::parse_Edges(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_LanesConnections(), NIImporter_VISUM::parse_stopPoints(), NIImporter_VISUM::parse_TurnsToSignalGroups(), NIXMLConnectionsHandler::parseConnection(), NIXMLConnectionsHandler::parseConnectionDef(), processSplits(), recheckLanes(), NBPTLine::removeInvalidEdges(), NBNodeCont::removeIsolatedRoads(), NBNodeCont::removeRailComponents(), rename(), NIXMLTrafficLightsHandler::retrieveEdge(), retrievePossiblySplit(), retrievePossiblySplit(), retrievePossiblySplit(), NIImporter_OpenDrive::retrieveSignalEdges(), GNELane::setAttribute(), splitGeometry(), NBParking::write(), and NWWriter_SUMO::writeRoundabout().
NBEdge * NBEdgeCont::retrievePossiblySplit | ( | const std::string & | id, |
bool | downstream | ||
) | const |
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 317 of file NBEdgeCont.cpp.
References retrieve().
Referenced by NIVissimTL::NIVissimTLSignal::addTo(), NIVissimDisturbance::addToNode(), NIVissimConnection::buildEdgeConnections(), NBConnection::checkFrom(), NBConnection::checkTo(), NIVissimDistrictConnection::dict_BuildDistricts(), recheckPostProcessConnections(), and NIVissimConflictArea::setPriorityRegulation().
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 336 of file NBEdgeCont.cpp.
References getGeneratedFrom(), NBNode::getIncomingEdges(), NBNode::getOutgoingEdges(), and retrieve().
NBEdge * NBEdgeCont::retrievePossiblySplit | ( | const std::string & | id, |
double | pos | ||
) | const |
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 366 of file NBEdgeCont.cpp.
References NBEdge::getLength(), MAX2(), myEdges, and retrieve().
|
inline |
Returns the number of edges.
Definition at line 287 of file NBEdgeCont.h.
References myEdges.
Referenced by NILoader::load(), and main().
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 844 of file NBEdgeCont.cpp.
References myEdges.
Referenced by NBNetBuilder::compute().
bool NBEdgeCont::splitAt | ( | NBDistrictCont & | dc, |
NBEdge * | edge, | ||
double | edgepos, | ||
NBNode * | node, | ||
const std::string & | firstEdgeName, | ||
const std::string & | secondEdgeName, | ||
int | noLanesFirstEdge, | ||
int | noLanesSecondEdge, | ||
const double | speed = -1. , |
||
const double | friction = 1. , |
||
const int | changedLeft = 0 |
||
) |
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 |
[in] | speed | The speed for the edge after the split |
[in] | changedLeft | The number of lanes that is added or removed on the left side of the edge (By default all added/removed lanes are assumed to be on the right when computing connections) |
ProcessError | If connections between the edges can not be built |
Definition at line 633 of file NBEdgeCont.cpp.
References NBEdge::addLane2LaneConnection(), NBEdge::COMPUTED, NBEdge::copyConnectionsFrom(), extract(), NBNode::getControllingTLS(), NBEdge::getDistance(), NBEdge::getGeometry(), NBEdge::getID(), NBEdge::getLaneStruct(), NBEdge::getLoadedLength(), NBEdge::getNumLanes(), OptionsCont::getOptions(), Parameterised::getParameter(), NBNode::getPosition(), NBEdge::hasLoadedLength(), insert(), NBEdge::isBidi(), PositionVector::length(), MAX2(), MIN2(), myEdges, myEdges2Keep, myEdges2Remove, myEdgesSplit, NBEdge::myFrom, myGuessedRoundabouts, myRemoveEdgesAfterLoading, myRoundabouts, NBEdge::myTo, myWasSplit, patchRoundabouts(), NBNode::removeDoubleEdges(), NBNode::replaceIncoming(), NBNode::replaceOutgoing(), NBEdge::setDistance(), NBEdge::setFriction(), NBEdge::setLoadedLength(), NBEdge::setOrigID(), NBEdge::setSpeed(), PositionVector::splitAt(), SUMO_PARAM_ORIGID, TL, and WRITE_ERRORF.
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 &, int , 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 604 of file NBEdgeCont.cpp.
References NBEdge::getID(), NBEdge::myLanes, and splitAt().
Referenced by NIVissimDisturbance::addToNode(), NIVissimEdge::buildNBEdge(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), joinTramEdges(), NIImporter_VISUM::parse_Lanes(), processSplits(), splitAt(), splitAt(), and splitGeometry().
bool NBEdgeCont::splitAt | ( | NBDistrictCont & | dc, |
NBEdge * | edge, | ||
NBNode * | node, | ||
const std::string & | firstEdgeName, | ||
const std::string & | secondEdgeName, | ||
int | noLanesFirstEdge, | ||
int | noLanesSecondEdge, | ||
const double | speed = -1. , |
||
const double | friction = 1. , |
||
const int | changedLeft = 0 |
||
) |
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 *, double, NBNode *, const std::string &, const std::string &, int , int)" is used to perform the split.
[in] | nb | The net builder containing all nodes, edges etc. |
[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 |
[in] | speed | The speed for the edge after the split |
[in] | friction | The friction for the edge after the split |
[in] | changedLeft | The number of lanes that is added or removed on the left side of the edge (By default all added/removed lanes are assumed to be on the right when computing connections) |
ProcessError | If connections between the edges can not be built |
Definition at line 611 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(), and splitAt().
void NBEdgeCont::splitGeometry | ( | NBDistrictCont & | dc, |
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 787 of file NBEdgeCont.cpp.
References NBEdge::getGeometry(), NBEdge::getID(), NBEdge::getNumLanes(), NBNodeCont::insert(), myEdges, NBNodeCont::retrieve(), retrieve(), splitAt(), toString(), and WRITE_WARNING.
Referenced by NBNetBuilder::compute().
void NBEdgeCont::updateAllChangeRestrictions | ( | SVCPermissions | ignoring | ) |
modify all restrictions on lane changing for edges and connections
Definition at line 1725 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 481 of file NBEdgeCont.h.
References myIgnoredEdges.
Referenced by NIImporter_SUMO::_loadNetwork(), NIXMLPTHandler::addAccess(), NBRailwayTopologyAnalyzer::addBidiEdge(), NIXMLPTHandler::addPTLineRoute(), NIXMLPTHandler::addPTStop(), NIXMLEdgesHandler::addRoundabout(), NIXMLPTHandler::addRoute(), NIImporter_OpenDrive::loadNetwork(), and NIXMLConnectionsHandler::parseConnection().
|
inline |
Returns whether the edge with the id was deleted explicitly.
Definition at line 491 of file NBEdgeCont.h.
References myExtractedEdges.
Referenced by NIXMLConnectionsHandler::addCrossing(), and NIXMLConnectionsHandler::delConnection().
|
private |
The list of connections to recheck.
Definition at line 732 of file NBEdgeCont.h.
Referenced by addPostProcessConnection(), hasPostProcessConnection(), and recheckPostProcessConnections().
|
private |
The edges which got extracted twice but may still be referenced somewhere TODO smart_ptr?
Definition at line 744 of file NBEdgeCont.h.
|
private |
The instance of the dictionary (id->edge)
Definition at line 738 of file NBEdgeCont.h.
Referenced by addPrefix(), appendRailwayTurnarounds(), appendTurnarounds(), appendTurnarounds(), begin(), checkConsistency(), checkGeometries(), checkGrade(), checkOverlap(), cleanupRoundabouts(), clear(), clearControllingTLInformation(), computeAngles(), computeEdge2Edges(), computeEdgeShapes(), computeLanes2Edges(), computeLaneShapes(), end(), extract(), extractRoundabouts(), fixSplitCustomLength(), generateStreetSigns(), getAllEdges(), getAllNames(), getByID(), getGeneratedFrom(), getOppositeByID(), getUsedTypes(), guessOpposites(), guessRoundabouts(), guessSpecialLanes(), insert(), joinLanes(), joinTramEdges(), recheckLanes(), recheckLaneSpread(), recheckPostProcessConnections(), reduceGeometries(), remapIDs(), removeEdgesByPermissions(), removeEdgesBySpeed(), removeLanesByWidth(), removeUnwishedEdges(), rename(), retrieve(), retrievePossiblySplit(), size(), sortOutgoingLanesConnections(), splitAt(), splitGeometry(), and updateAllChangeRestrictions().
|
private |
Set of ids of edges which shall explicitly be kept.
Definition at line 764 of file NBEdgeCont.h.
Referenced by applyOptions(), ignoreFilterMatch(), removeEdgesByPermissions(), removeEdgesBySpeed(), removeLanesByWidth(), removeUnwishedEdges(), and splitAt().
|
private |
Set of ids of edges which shall explicitly be removed.
Definition at line 767 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 758 of file NBEdgeCont.h.
Referenced by applyOptions(), ignoreFilterMatch(), and removeEdgesBySpeed().
the number of splits of edges during the building
Definition at line 750 of file NBEdgeCont.h.
Referenced by getNumEdgeSplits(), getSplit(), and splitAt().
|
private |
The extracted edges which are kept for reference.
Definition at line 741 of file NBEdgeCont.h.
Referenced by clear(), extract(), retrieve(), and wasRemoved().
|
private |
Edges marked as belonging to a roundabout after guessing.
Definition at line 792 of file NBEdgeCont.h.
Referenced by getRoundabouts(), guessRoundabouts(), hasGuessedRoundabouts(), removeRoundaboutEdges(), and splitAt().
|
private |
The ids of ignored edges.
Definition at line 747 of file NBEdgeCont.h.
Referenced by ignore(), insert(), and wasIgnored().
|
private |
whether a geo transform has been applied to the pruning boundary
Definition at line 785 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 782 of file NBEdgeCont.h.
Referenced by applyOptions(), and ignoreFilterMatch().
|
private |
Whether edges shall be joined and patched first, then removed.
Definition at line 761 of file NBEdgeCont.h.
Referenced by applyOptions(), ignoreFilterMatch(), and splitAt().
|
private |
Edges marked as belonging to a roundabout by the user (each EdgeVector is a roundabout)
Definition at line 789 of file NBEdgeCont.h.
Referenced by addRoundabout(), cleanupRoundabouts(), getRoundabouts(), guessRoundabouts(), removeRoundabout(), removeRoundaboutEdges(), and splitAt().
|
private |
The network builder; used to obtain type information.
Definition at line 628 of file NBEdgeCont.h.
Referenced by ignoreFilterMatch().
|
private |
Set of edges types which shall be kept.
Definition at line 776 of file NBEdgeCont.h.
Referenced by applyOptions(), and ignoreFilterMatch().
|
private |
Set of edges types which shall be removed.
Definition at line 779 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 770 of file NBEdgeCont.h.
Referenced by applyOptions(), ignoreFilterMatch(), and removeEdgesByPermissions().
|
private |
Set of vehicle types which need not be supported (edges which allow ONLY these are removed)
Definition at line 773 of file NBEdgeCont.h.
Referenced by applyOptions(), ignoreFilterMatch(), and removeEdgesByPermissions().
|
private |
the edges that were created as result of splitting
Definition at line 752 of file NBEdgeCont.h.
Referenced by fixSplitCustomLength(), and splitAt().