SUMO - Simulation of Urban MObility
NBNetBuilder Class Reference

Instance responsible for building networks. More...

#include <NBNetBuilder.h>

Collaboration diagram for NBNetBuilder:
Collaboration graph

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. More...
 
void compute (OptionsCont &oc, const std::set< std::string > &explicitTurnarounds=std::set< std::string >(), bool removeElements=true)
 Performs the network building steps. More...
 
void haveLoadedNetworkWithoutInternalEdges ()
 notify about style of loaded network More...
 
 NBNetBuilder ()
 Constructor. More...
 
 ~NBNetBuilder ()
 Destructor. More...
 
Retrieval of subcontainers
NBEdgeContgetEdgeCont ()
 Returns the edge container. More...
 
NBNodeContgetNodeCont ()
 Returns the node container. More...
 
NBTypeContgetTypeCont ()
 Returns the type container. More...
 
NBTrafficLightLogicContgetTLLogicCont ()
 Returns the traffic light logics container. More...
 
NBDistrictContgetDistrictCont ()
 Returns the districts container. More...
 
const NBJoinedEdgesMapgetJoinedEdgesMap () const
 Returns the joined edges map. More...
 

Static Public Member Functions

static bool transformCoordinates (Position &from, bool includeInBoundary=true, GeoConvHelper *from_srs=0)
 transforms loaded coordinates handles projections, offsets (using GeoConvHelper) and import of height data (using NBHeightMapper) More...
 
static bool transformCoordinates (PositionVector &from, bool includeInBoundary=true, GeoConvHelper *from_srs=0)
 

Protected Attributes

NBDistrictCont myDistrictCont
 The used container for districts. More...
 
NBEdgeCont myEdgeCont
 The used container for edges. More...
 
bool myHaveLoadedNetworkWithoutInternalEdges
 whether a .net.xml without internal edges was loaded More...
 
NBJoinedEdgesMap myJoinedEdges
 Map of joined edges. More...
 
NBNodeCont myNodeCont
 The used container for nodes. More...
 
NBTrafficLightLogicCont myTLLCont
 The used container for traffic light logics. More...
 
NBTypeCont myTypeCont
 The used container for street types. More...
 

Private Member Functions

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

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 113 of file NBNetBuilder.h.

Constructor & Destructor Documentation

NBNetBuilder::NBNetBuilder ( )

Constructor.

Definition at line 65 of file NBNetBuilder.cpp.

NBNetBuilder::~NBNetBuilder ( )

Destructor.

Definition at line 71 of file NBNetBuilder.cpp.

NBNetBuilder::NBNetBuilder ( const NBNetBuilder s)
private

invalidated copy constructor

Member Function Documentation

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 75 of file NBNetBuilder.cpp.

References NBTrafficLightLogicCont::applyOptions(), NBEdgeCont::applyOptions(), OptionsCont::getFloat(), OptionsCont::getInt(), myEdgeCont, myTLLCont, myTypeCont, and NBTypeCont::setDefaults().

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

void NBNetBuilder::compute ( OptionsCont oc,
const std::set< std::string > &  explicitTurnarounds = std::set<std::string>(),
bool  removeElements = 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]removeElementswhether processing steps which cause nodes and edges to be removed shall be triggered
Exceptions
ProcessError(recheck)

Definition at line 86 of file NBNetBuilder.cpp.

References Boundary::add(), NBNodeCont::addJoinExclusion(), NBEdgeCont::appendTurnarounds(), NBNodeCont::avoidOverlap(), NBNodeCont::begin(), NBEdgeCont::begin(), NBEdgeCont::checkGeometries(), NBEdgeCont::computeEdge2Edges(), NBEdgePriorityComputer::computeEdgePriorities(), NBEdgeCont::computeEdgeShapes(), GeoConvHelper::computeFinal(), NBEdgeCont::computeLanes2Edges(), NBNodeCont::computeLanes2Lanes(), NBEdgeCont::computeLaneShapes(), NBTrafficLightLogicCont::computeLogics(), NBNodeCont::computeLogics(), NBNodeCont::computeNodeShapes(), NBNodeTypeComputer::computeNodeTypes(), NBRampsComputer::computeRamps(), NBTurningDirectionsComputer::computeTurnDirections(), DEG2RAD, NBNodeCont::end(), NBEdgeCont::end(), OptionsCont::exists(), NBEdgeCont::generateStreetSigns(), StringBijection< T >::get(), OptionsCont::getBool(), GeoConvHelper::getConvBoundary(), OptionsCont::getFloat(), GeoConvHelper::getOffsetBase(), GeoConvHelper::getOrigBoundary(), GeoConvHelper::getProcessing(), NBEdgeCont::getRoundabouts(), OptionsCont::getString(), OptionsCont::getStringVector(), NBEdgeCont::guessRoundabouts(), NBEdgeCont::guessSidewalks(), NBNodeCont::guessTLs(), NBJoinedEdgesMap::init(), OptionsCont::isDefault(), OptionsCont::isSet(), NBNodeCont::joinJunctions(), NBNodeCont::joinLoadedClusters(), NBNodeCont::joinSimilarEdges(), NBNodeCont::joinTLS(), NBEdgeCont::markRoundabouts(), MAX2(), MIN2(), mirrorX(), moveToOrigin(), myDistrictCont, myEdgeCont, myHaveLoadedNetworkWithoutInternalEdges, myJoinedEdges, myNodeCont, myTLLCont, NBNodeCont::printBuiltNodesStatistics(), PROGRESS_BEGIN_MESSAGE, PROGRESS_DONE_MESSAGE, NBEdgeCont::recheckLanes(), NBEdgeCont::recheckPostProcessConnections(), NBEdgeCont::reduceGeometries(), NBNodeCont::removeIsolatedRoads(), NBNodeCont::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBRequest::reportWarnings(), NBNodeCont::retrieve(), OptionsCont::set(), NBNodeCont::setAsTLControlled(), GeoConvHelper::setConvBoundary(), NBTrafficLightLogicCont::setTLControllingInformation(), NBNodesEdgesSorter::sortNodesEdges(), NBEdgeCont::sortOutgoingLanesConnections(), NBEdgeCont::splitGeometry(), SUMOReal, toString(), SUMOXMLDefinitions::TrafficLightTypes, WRITE_MESSAGE, WRITE_WARNING, Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().

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

const NBJoinedEdgesMap& NBNetBuilder::getJoinedEdgesMap ( ) const
inline

Returns the joined edges map.

Returns
The map of joined edges

Definition at line 193 of file NBNetBuilder.h.

References myJoinedEdges.

void NBNetBuilder::haveLoadedNetworkWithoutInternalEdges ( )
inline

notify about style of loaded network

Definition at line 200 of file NBNetBuilder.h.

References myHaveLoadedNetworkWithoutInternalEdges, and transformCoordinates().

Referenced by NIImporter_SUMO::_loadNetwork().

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

invalidated assignment operator

bool NBNetBuilder::transformCoordinates ( Position from,
bool  includeInBoundary = true,
GeoConvHelper from_srs = 0 
)
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 These methods are located outside of GeoConvHelper to avoid linker-dependencies on GDAL for libgeom

Definition at line 469 of file NBNetBuilder.cpp.

References GeoConvHelper::cartesian2geo(), NBHeightMapper::get(), GeoConvHelper::getProcessing(), NBHeightMapper::getZ(), NBHeightMapper::ready(), SUMOReal, GeoConvHelper::usingGeoProjection(), Position::x(), GeoConvHelper::x2cartesian(), and Position::y().

Referenced by NIImporter_SUMO::addEdge(), NIImporter_SUMO::addJunction(), NIImporter_SUMO::addLane(), NIXMLNodesHandler::addNode(), NIImporter_OpenDrive::computeShapes(), haveLoadedNetworkWithoutInternalEdges(), NBEdgeCont::ignoreFilterMatch(), NIImporter_OpenStreetMap::insertEdge(), NIImporter_OpenStreetMap::insertNodeChecking(), NIImporter_ArcView::load(), NIImporter_RobocupRescue::loadNodes(), NIImporter_ITSUMO::Handler::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(), transformCoordinates(), and NIXMLEdgesHandler::tryGetShape().

bool NBNetBuilder::transformCoordinates ( PositionVector from,
bool  includeInBoundary = true,
GeoConvHelper from_srs = 0 
)
static

Friends And Related Function Documentation

friend class GNENet
friend

Definition at line 114 of file NBNetBuilder.h.

Field Documentation

NBDistrictCont NBNetBuilder::myDistrictCont
protected

The used container for districts.

Definition at line 246 of file NBNetBuilder.h.

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

NBEdgeCont NBNetBuilder::myEdgeCont
protected

The used container for edges.

Definition at line 240 of file NBNetBuilder.h.

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

bool NBNetBuilder::myHaveLoadedNetworkWithoutInternalEdges
protected

whether a .net.xml without internal edges was loaded

Definition at line 252 of file NBNetBuilder.h.

Referenced by compute(), and haveLoadedNetworkWithoutInternalEdges().

NBJoinedEdgesMap NBNetBuilder::myJoinedEdges
protected

Map of joined edges.

Definition at line 249 of file NBNetBuilder.h.

Referenced by compute(), and getJoinedEdgesMap().

NBNodeCont NBNetBuilder::myNodeCont
protected

The used container for nodes.

Definition at line 234 of file NBNetBuilder.h.

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

NBTrafficLightLogicCont NBNetBuilder::myTLLCont
protected

The used container for traffic light logics.

Definition at line 243 of file NBNetBuilder.h.

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

NBTypeCont NBNetBuilder::myTypeCont
protected

The used container for street types.

Definition at line 237 of file NBNetBuilder.h.

Referenced by applyOptions(), and getTypeCont().


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