Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
NBNetBuilder Class Reference

Instance responsible for building networks. More...

#include <NBNetBuilder.h>

Collaboration diagram for NBNetBuilder:
[legend]

Data Structures

class  by_id_sorter
 Sorts nodes by their ids. More...
 

Public Member Functions

void applyOptions (OptionsCont &oc)
 Initialises the storage by applying given options.
 
void compute (OptionsCont &oc, const std::set< std::string > &explicitTurnarounds=std::set< std::string >(), bool mayAddOrRemove=true)
 Performs the network building steps.
 
bool haveNetworkCrossings ()
 notify about style of loaded network (Without Crossings)
 
 NBNetBuilder ()
 Constructor.
 
void setHaveNetworkCrossings (bool value)
 enable crossing in networks
 
 ~NBNetBuilder ()
 Destructor.
 
Retrieval of subcontainers

Returns a reference to edge container

NBEdgeContgetEdgeCont ()
 
NBNodeContgetNodeCont ()
 Returns a reference to the node container.
 
NBTypeContgetTypeCont ()
 Returns a reference to the type container.
 
NBTrafficLightLogicContgetTLLogicCont ()
 Returns a reference to the traffic light logics container.
 
NBDistrictContgetDistrictCont ()
 Returns a reference the districts container.
 
NBPTStopContgetPTStopCont ()
 Returns a reference to the pt stop container.
 
NBPTLineContgetPTLineCont ()
 Returns a reference to the pt line container.
 
NBParkingContgetParkingCont ()
 
ShapeContainergetShapeCont ()
 

Static Public Member Functions

static int addGeometrySegments (PositionVector &from, const PositionVector &cartesian, const double maxLength)
 insertion geometry points to ensure maximum segment length between points
 
static bool runningNetedit ()
 whether netbuilding takes place in the context of netedit
 
static bool transformCoordinate (Position &from, bool includeInBoundary=true, GeoConvHelper *from_srs=nullptr)
 transforms loaded coordinates handles projections, offsets (using GeoConvHelper) and import of height data (using NBHeightMapper)
 
static bool transformCoordinates (PositionVector &from, bool includeInBoundary=true, GeoConvHelper *from_srs=nullptr)
 

Protected Attributes

NBDistrictCont myDistrictCont
 The used container for districts.
 
NBEdgeCont myEdgeCont
 The used container for edges.
 
bool myNetworkHaveCrossings
 flag to indicate that network has crossings
 
NBNodeCont myNodeCont
 The used container for nodes.
 
NBParkingCont myParkingCont
 
NBPTLineCont myPTLineCont
 The used container for pt stops.
 
NBPTStopCont myPTStopCont
 The used container for pt stops.
 
ShapeContainer myShapeCont
 container for loaded polygon data
 
NBTrafficLightLogicCont myTLLCont
 The used container for traffic light logics.
 
NBTypeCont myTypeCont
 The used container for street types.
 

Private Member Functions

void mirrorX ()
 mirror the network along the X-axis
 
void moveToOrigin (GeoConvHelper &geoConvHelper, bool lefthand)
 shift network so its lower left corner is at 0,0
 
 NBNetBuilder (const NBNetBuilder &s)
 invalidated copy constructor
 
NBNetBuilderoperator= (const NBNetBuilder &s)
 invalidated assignment operator
 

Friends

class GNENet
 

Detailed Description

Instance responsible for building networks.

The class' - and the netbuild module's - functionality is embedded within the compute() method.

Definition at line 107 of file NBNetBuilder.h.

Constructor & Destructor Documentation

◆ NBNetBuilder() [1/2]

NBNetBuilder::NBNetBuilder ( )

Constructor.

Definition at line 55 of file NBNetBuilder.cpp.

◆ ~NBNetBuilder()

NBNetBuilder::~NBNetBuilder ( )

Destructor.

Definition at line 61 of file NBNetBuilder.cpp.

◆ NBNetBuilder() [2/2]

NBNetBuilder::NBNetBuilder ( const NBNetBuilder s)
private

invalidated copy constructor

Member Function Documentation

◆ addGeometrySegments()

int NBNetBuilder::addGeometrySegments ( PositionVector from,
const PositionVector cartesian,
const double  maxLength 
)
static

insertion geometry points to ensure maximum segment length between points

Definition at line 834 of file NBNetBuilder.cpp.

Referenced by NIImporter_SUMO::_loadNetwork(), NGEdge::buildNBEdge(), transformCoordinates(), and NIXMLEdgesHandler::tryGetShape().

Here is the caller graph for this function:

◆ applyOptions()

void NBNetBuilder::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.

Parameters
[in]ocThe options container to read options from
Exceptions
ProcessErrorIf something fails (message is included)

Definition at line 65 of file NBNetBuilder.cpp.

References NBEdgeCont::applyOptions(), NBTrafficLightLogicCont::applyOptions(), StringBijection< T >::get(), OptionsCont::getFloat(), OptionsCont::getInt(), OptionsCont::getString(), SUMOXMLDefinitions::LaneSpreadFunctions, myEdgeCont, myTLLCont, myTypeCont, parseVehicleClasses(), NBEdge::setDefaultConnectionLength(), and NBTypeCont::setEdgeTypeDefaults().

Referenced by main(), and GNELoadThread::run().

Here is the caller graph for this function:

◆ compute()

void NBNetBuilder::compute ( OptionsCont oc,
const std::set< std::string > &  explicitTurnarounds = std::set<std::string>(),
bool  mayAddOrRemove = true 
)

Performs the network building steps.

Parameters
[in]ocContainer that contains options for building
[in]explicitTurnaroundsList of edge ids for which turn-arounds should be added (used by netedit)
[in]mayAddOrRemovewhether processing steps which cause nodes and edges to be added or removed shall be triggered (used by netedit)
Exceptions
ProcessError(recheck)

Definition at line 79 of file NBNetBuilder.cpp.

References Boundary::add(), NBNodeCont::addJoinExclusion(), NBPTStopCont::alignIdSigns(), NBRailwayTopologyAnalyzer::analyzeTopology(), NBEdgeCont::appendRailwayTurnarounds(), NBEdgeCont::appendTurnarounds(), NBTrafficLightLogicCont::applyOpenDriveControllers(), NBPTStopCont::assignEdgeForFloatingStops(), NBPTStopCont::assignLanes(), NBNodeCont::avoidOverlap(), NBEdgeCont::begin(), NBNodeCont::begin(), NBEdgeCont::checkGeometries(), NBEdgeCont::checkGrade(), NBEdgeCont::checkOverlap(), NBPTStopCont::cleanupDeleted(), NBEdgeCont::cleanupRoundabouts(), NBEdgeCont::computeAngles(), NBEdgeCont::computeEdge2Edges(), NBEdgePriorityComputer::computeEdgePriorities(), NBEdgeCont::computeEdgeShapes(), GeoConvHelper::computeFinal(), NBNodeCont::computeKeepClear(), NBEdgeCont::computeLanes2Edges(), NBNodeCont::computeLanes2Lanes(), NBEdgeCont::computeLaneShapes(), NBNodeCont::computeLogics(), NBTrafficLightLogicCont::computeLogics(), NBNodeCont::computeLogics2(), NBNodeCont::computeNodeShapes(), NBNodeTypeComputer::computeNodeTypes(), NBRampsComputer::computeRamps(), NBTrafficLightLogicCont::computeSingleLogic(), NBTurningDirectionsComputer::computeTurnDirections(), DEG2RAD, NBEdgeCont::end(), NBNodeCont::end(), OptionsCont::exists(), NBRailwayTopologyAnalyzer::extendDirectionPriority(), NBPTStopCont::findAccessEdgesForRailStops(), NBPTLineCont::fixBidiStops(), NBPTLineCont::fixPermissions(), NBEdgeCont::fixSplitCustomLength(), NBPTStopCont::generateBidiStops(), NBEdgeCont::generateStreetSigns(), StringBijection< T >::get(), OptionsCont::getBool(), GeoConvHelper::getConvBoundary(), SysUtils::getCurrentMillis(), OptionsCont::getFloat(), OptionsCont::getInt(), NBEdge::getLaneSpeed(), NBPTLineCont::getLines(), NBEdgeCont::getNumEdgeSplits(), NBEdge::getNumLanes(), GeoConvHelper::getProcessing(), NBEdgeCont::getRoundabouts(), NBPTLineCont::getServedPTStops(), NBPTStopCont::getStops(), OptionsCont::getString(), OptionsCont::getStringVector(), Boundary::getZRange(), NBNodeCont::guessFringe(), NBEdgeCont::guessOpposites(), NBRailwaySignalGuesser::guessRailSignals(), NBEdgeCont::guessRoundabouts(), NBEdgeCont::guessSpecialLanes(), NBNodeCont::guessTLs(), NBEdgeCont::hasGuessedRoundabouts(), OptionsCont::isDefault(), OptionsCont::isSet(), NBNodeCont::joinJunctions(), NBEdgeCont::joinLanes(), NBNodeCont::joinLoadedClusters(), NBNodeCont::joinSameJunctions(), NBNodeCont::joinSimilarEdges(), NBNodeCont::joinTLS(), NBEdgeCont::joinTramEdges(), NBPTStopCont::localizePTStops(), NBRailwayTopologyAnalyzer::makeAllBidi(), NBEdgeCont::markRoundabouts(), MAX2(), MIN2(), NBTrafficLightDefinition::MIN_YELLOW_SECONDS, mirrorX(), moveToOrigin(), myDistrictCont, myEdgeCont, myNetworkHaveCrossings, myNodeCont, myParkingCont, myPTLineCont, myPTStopCont, myTLLCont, NBTrafficLightDefinition::OSM_DIRECTION, parseVehicleClasses(), NBPTStopCont::postprocess(), NBPTLineCont::process(), PROGRESS_BEGIN_MESSAGE, PROGRESS_BEGIN_TIME_MESSAGE, PROGRESS_DONE_MESSAGE, PROGRESS_TIME_MESSAGE, NBNodeCont::recheckGuessedTLS(), NBEdgeCont::recheckLanes(), NBEdgeCont::recheckPostProcessConnections(), NBEdgeCont::reduceGeometries(), NBEdgeCont::remapIDs(), NBNodeCont::remapIDs(), NBNodeCont::removeComponents(), NBEdgeCont::removeEdgesByPermissions(), NBEdgeCont::removeEdgesBySpeed(), NBPTLineCont::removeInvalidEdges(), NBNodeCont::removeIsolatedRoads(), NBEdgeCont::removeLanesByWidth(), NBNodeCont::removeRailComponents(), NBNodeCont::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBRailwayTopologyAnalyzer::repairTopology(), NBRequest::reportWarnings(), NBNodeCont::resetNodeShapes(), OptionsCont::resetWritable(), NBNodeCont::retrieve(), OptionsCont::set(), NBNodeCont::setAsTLControlled(), GeoConvHelper::setConvBoundary(), NBTrafficLightLogicCont::setOpenDriveSignalParameters(), NBEdge::setSpeed(), NBTrafficLightLogicCont::setTLControllingInformation(), NBNodesEdgesSorter::sortNodesEdges(), NBEdgeCont::sortOutgoingLanesConnections(), NBEdgeCont::splitGeometry(), NBRailwayGeometryHelper::straigthenCorrdidor(), SVC_BICYCLE, SVC_IGNORING, SVC_PEDESTRIAN, TL, toString(), SUMOXMLDefinitions::TrafficLightTypes, NBEdgeCont::updateAllChangeRestrictions(), NBNodeTypeComputer::validateRailCrossings(), WRITE_MESSAGEF, WRITE_WARNING, WRITE_WARNINGF, Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().

Referenced by GNENet::computeAndUpdate(), main(), and GNELoadThread::run().

Here is the caller graph for this function:

◆ getDistrictCont()

NBDistrictCont & NBNetBuilder::getDistrictCont ( )
inline

◆ getEdgeCont()

NBEdgeCont & NBNetBuilder::getEdgeCont ( )
inline

◆ getNodeCont()

◆ getParkingCont()

NBParkingCont & NBNetBuilder::getParkingCont ( )
inline

Definition at line 173 of file NBNetBuilder.h.

References myParkingCont.

Referenced by NBRampsComputer::computeRamps(), NIImporter_OpenStreetMap::insertEdge(), and NWWriter_XML::writeNetwork().

Here is the caller graph for this function:

◆ getPTLineCont()

NBPTLineCont & NBNetBuilder::getPTLineCont ( )
inline

Returns a reference to the pt line container.

Definition at line 169 of file NBNetBuilder.h.

References myPTLineCont.

Referenced by NIImporter_OpenStreetMap::load(), NILoader::loadXML(), and NWWriter_XML::writeNetwork().

Here is the caller graph for this function:

◆ getPTStopCont()

NBPTStopCont & NBNetBuilder::getPTStopCont ( )
inline

Returns a reference to the pt stop container.

Definition at line 164 of file NBNetBuilder.h.

References myPTStopCont.

Referenced by NBRampsComputer::computeRamps(), NIImporter_OpenStreetMap::insertEdge(), NIImporter_OpenStreetMap::load(), NILoader::loadXML(), NIImporter_VISUM::parse_stopPoints(), and NWWriter_XML::writeNetwork().

Here is the caller graph for this function:

◆ getShapeCont()

ShapeContainer & NBNetBuilder::getShapeCont ( )
inline

Definition at line 177 of file NBNetBuilder.h.

References myShapeCont.

Referenced by NILoader::loadXML(), and NWWriter_OpenDrive::writeNetwork().

Here is the caller graph for this function:

◆ getTLLogicCont()

NBTrafficLightLogicCont & NBNetBuilder::getTLLogicCont ( )
inline

Returns a reference to the traffic light logics container.

Definition at line 154 of file NBNetBuilder.h.

References myTLLCont.

Referenced by NGNode::buildNBNode(), GNENet::getTLLogicCont(), NIImporter_OpenDrive::getTLSSecure(), NIImporter_OpenStreetMap::insertEdge(), NIImporter_VISUM::load(), NIImporter_OpenStreetMap::load(), NILoader::load(), NIImporter_DlrNavteq::loadNetwork(), NILoader::loadXML(), main(), NIImporter_Vissim::postLoadBuild(), NGNet::toNB(), NWWriter_XML::writeNetwork(), and NWWriter_SUMO::writeNetwork().

Here is the caller graph for this function:

◆ getTypeCont()

NBTypeCont & NBNetBuilder::getTypeCont ( )
inline

◆ haveNetworkCrossings()

bool NBNetBuilder::haveNetworkCrossings ( )
inline

notify about style of loaded network (Without Crossings)

Definition at line 183 of file NBNetBuilder.h.

References myNetworkHaveCrossings.

Referenced by GNEJunction::rebuildGNECrossings(), GNEChange_Crossing::redo(), and GNEChange_Crossing::undo().

Here is the caller graph for this function:

◆ mirrorX()

void NBNetBuilder::mirrorX ( )
private

mirror the network along the X-axis

Definition at line 759 of file NBNetBuilder.cpp.

References NBDistrictCont::begin(), NBEdgeCont::begin(), NBNodeCont::begin(), NBDistrictCont::end(), NBEdgeCont::end(), NBNodeCont::end(), NBPTStopCont::getStops(), myDistrictCont, myEdgeCont, myNodeCont, and myPTStopCont.

Referenced by compute().

Here is the caller graph for this function:

◆ moveToOrigin()

void NBNetBuilder::moveToOrigin ( GeoConvHelper geoConvHelper,
bool  lefthand 
)
private

shift network so its lower left corner is at 0,0

Definition at line 733 of file NBNetBuilder.cpp.

References NBDistrictCont::begin(), NBEdgeCont::begin(), NBNodeCont::begin(), NBDistrictCont::end(), NBEdgeCont::end(), NBNodeCont::end(), GeoConvHelper::getConvBoundary(), NBPTStopCont::getStops(), GeoConvHelper::moveConvertedBy(), myDistrictCont, myEdgeCont, myNodeCont, myPTStopCont, PROGRESS_BEGIN_TIME_MESSAGE, PROGRESS_TIME_MESSAGE, TL, Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().

Referenced by compute().

Here is the caller graph for this function:

◆ operator=()

NBNetBuilder & NBNetBuilder::operator= ( const NBNetBuilder s)
private

invalidated assignment operator

◆ runningNetedit()

bool NBNetBuilder::runningNetedit ( )
static

whether netbuilding takes place in the context of netedit

Definition at line 856 of file NBNetBuilder.cpp.

References OptionsCont::exists(), and OptionsCont::getOptions().

Referenced by NBLoadedSUMOTLDef::reconstructLogic().

Here is the caller graph for this function:

◆ setHaveNetworkCrossings()

void NBNetBuilder::setHaveNetworkCrossings ( bool  value)
inline

enable crossing in networks

Definition at line 188 of file NBNetBuilder.h.

References myNetworkHaveCrossings.

Referenced by NIImporter_SUMO::_loadNetwork(), GNEJunction::invalidateTLS(), GNEChange_Crossing::redo(), and GNEChange_Crossing::undo().

Here is the caller graph for this function:

◆ transformCoordinate()

bool NBNetBuilder::transformCoordinate ( Position from,
bool  includeInBoundary = true,
GeoConvHelper from_srs = nullptr 
)
static

transforms loaded coordinates handles projections, offsets (using GeoConvHelper) and import of height data (using NBHeightMapper)

Parameters
[in,out]fromThe coordinate to be transformed
[in]includeInBoundaryWhether to patch the convex boundary of the GeoConvHelper default instance
[in]from_srsThe spatial reference system of the input coordinate
Note
These methods are located outside of GeoConvHelper to avoid linker-dependencies on GDAL for libgeom

Definition at line 777 of file NBNetBuilder.cpp.

References GeoConvHelper::cartesian2geo(), NBHeightMapper::get(), GeoConvHelper::getLoaded(), GeoConvHelper::getNumLoaded(), GeoConvHelper::getOffset(), GeoConvHelper::getProcessing(), NBHeightMapper::getZ(), NBHeightMapper::ready(), Position::set(), Position::setz(), GeoConvHelper::usingGeoProjection(), Position::x(), GeoConvHelper::x2cartesian(), Position::y(), and Position::z().

Referenced by NIImporter_SUMO::addJunction(), NIXMLNodesHandler::addNode(), NIImporter_OpenStreetMap::insertEdge(), NIImporter_OpenStreetMap::insertNodeChecking(), NIImporter_ArcView::load(), NIImporter_OpenStreetMap::load(), NIImporter_ITSUMO::Handler::myEndElement(), NIImporter_OpenStreetMap::RelationHandler::myEndElement(), NIImporter_MATSim::NodesHandler::myStartElement(), NIVissimAbstractEdge::NIVissimAbstractEdge(), NIImporter_VISUM::parse_Districts(), NIImporter_VISUM::parse_EdgePolys(), NIImporter_VISUM::parse_Nodes(), NIImporter_VISUM::parse_Point(), NIImporter_DlrNavteq::NodesHandler::report(), and transformCoordinates().

Here is the caller graph for this function:

◆ transformCoordinates()

Friends And Related Symbol Documentation

◆ GNENet

friend class GNENet
friend

Definition at line 108 of file NBNetBuilder.h.

Field Documentation

◆ myDistrictCont

NBDistrictCont NBNetBuilder::myDistrictCont
protected

The used container for districts.

Definition at line 240 of file NBNetBuilder.h.

Referenced by compute(), getDistrictCont(), mirrorX(), and moveToOrigin().

◆ myEdgeCont

NBEdgeCont NBNetBuilder::myEdgeCont
protected

The used container for edges.

Definition at line 234 of file NBNetBuilder.h.

Referenced by applyOptions(), compute(), getEdgeCont(), mirrorX(), and moveToOrigin().

◆ myNetworkHaveCrossings

bool NBNetBuilder::myNetworkHaveCrossings
protected

flag to indicate that network has crossings

Definition at line 254 of file NBNetBuilder.h.

Referenced by compute(), haveNetworkCrossings(), and setHaveNetworkCrossings().

◆ myNodeCont

NBNodeCont NBNetBuilder::myNodeCont
protected

The used container for nodes.

Definition at line 228 of file NBNetBuilder.h.

Referenced by compute(), getNodeCont(), mirrorX(), and moveToOrigin().

◆ myParkingCont

NBParkingCont NBNetBuilder::myParkingCont
protected

Definition at line 248 of file NBNetBuilder.h.

Referenced by compute(), and getParkingCont().

◆ myPTLineCont

NBPTLineCont NBNetBuilder::myPTLineCont
protected

The used container for pt stops.

Definition at line 246 of file NBNetBuilder.h.

Referenced by compute(), and getPTLineCont().

◆ myPTStopCont

NBPTStopCont NBNetBuilder::myPTStopCont
protected

The used container for pt stops.

Definition at line 243 of file NBNetBuilder.h.

Referenced by compute(), getPTStopCont(), mirrorX(), and moveToOrigin().

◆ myShapeCont

ShapeContainer NBNetBuilder::myShapeCont
protected

container for loaded polygon data

Definition at line 251 of file NBNetBuilder.h.

Referenced by getShapeCont().

◆ myTLLCont

NBTrafficLightLogicCont NBNetBuilder::myTLLCont
protected

The used container for traffic light logics.

Definition at line 237 of file NBNetBuilder.h.

Referenced by applyOptions(), compute(), and getTLLogicCont().

◆ myTypeCont

NBTypeCont NBNetBuilder::myTypeCont
protected

The used container for street types.

Definition at line 231 of file NBNetBuilder.h.

Referenced by applyOptions(), and getTypeCont().


The documentation for this class was generated from the following files: