Eclipse SUMO - Simulation of Urban MObility
NBHelpers Class Reference

#include <NBHelpers.h>

Static Public Member Functions

static double distance (NBNode *node1, NBNode *node2)
 returns the distance between both nodes More...
 
static void interpretLaneID (const std::string &lane_id, std::string &edge_id, int &index)
 parses edge-id and index from lane-id More...
 
static void loadEdgesFromFile (const std::string &file, std::set< std::string > &into)
 Add edge ids defined in file (either ID or edge:ID per line) into the given set. More...
 
static void loadPrefixedIDsFomFile (const std::string &file, const std::string prefix, std::set< std::string > &into)
 Add prefixed ids defined in file. More...
 
static std::string normalIDRepresentation (const std::string &id)
 converts the numerical id to its "normal" string representation More...
 
static double normRelAngle (double angle1, double angle2)
 ensure that reverse relAngles (>=179.999) always count as turnarounds (-180) More...
 
static double relAngle (double angle1, double angle2)
 computes the relative angle between the two angles More...
 

Detailed Description

Some mathmatical methods for the computation of angles

Definition at line 44 of file NBHelpers.h.

Member Function Documentation

◆ distance()

double NBHelpers::distance ( NBNode node1,
NBNode node2 
)
static

returns the distance between both nodes

Definition at line 80 of file NBHelpers.cpp.

References Position::distanceTo(), and NBNode::getPosition().

◆ interpretLaneID()

void NBHelpers::interpretLaneID ( const std::string &  lane_id,
std::string &  edge_id,
int &  index 
)
static

parses edge-id and index from lane-id

Parameters
[in]lane_idThe lane-id
[out]edge_idID of this lane's edge
[out]indexIndex of this lane

Definition at line 119 of file NBHelpers.cpp.

References TL, StringUtils::toInt(), and WRITE_ERRORF.

Referenced by NIXMLShapeHandler::getLanePos(), and NWWriter_SUMO::writeNetwork().

Here is the caller graph for this function:

◆ loadEdgesFromFile()

void NBHelpers::loadEdgesFromFile ( const std::string &  file,
std::set< std::string > &  into 
)
static

Add edge ids defined in file (either ID or edge:ID per line) into the given set.

Definition at line 86 of file NBHelpers.cpp.

References StringUtils::startsWith(), and TLF.

Referenced by NBEdgeCont::applyOptions(), NBRailwayTopologyAnalyzer::makeAllBidi(), and NBNodeCont::removeUnwishedNodes().

Here is the caller graph for this function:

◆ loadPrefixedIDsFomFile()

void NBHelpers::loadPrefixedIDsFomFile ( const std::string &  file,
const std::string  prefix,
std::set< std::string > &  into 
)
static

Add prefixed ids defined in file.

Definition at line 104 of file NBHelpers.cpp.

References StringUtils::startsWith(), and TLF.

Referenced by NBEdgeCont::remapIDs(), NBNodeCont::remapIDs(), NWWriter_DlrNavteq::writeNodesUnsplitted(), and NWWriter_DlrNavteq::writeProhibitedManoeuvres().

Here is the caller graph for this function:

◆ normalIDRepresentation()

◆ normRelAngle()

double NBHelpers::normRelAngle ( double  angle1,
double  angle2 
)
static

ensure that reverse relAngles (>=179.999) always count as turnarounds (-180)

Definition at line 58 of file NBHelpers.cpp.

References relAngle().

Referenced by NBEdge::appendTurnaround(), NBEdge::computeAngle(), NBEdge::computeEdge2Edges(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NBNode::getDirection(), NBContHelper::same_connection_edge_sorter::getMinMaxRelAngles(), NBRailwayTopologyAnalyzer::isStraight(), NBNode::isStraighter(), NBEdgeCont::markRoundabouts(), NBContHelper::relative_outgoing_edge_sorter::operator()(), and NBContHelper::relative_incoming_edge_sorter::operator()().

Here is the caller graph for this function:

◆ relAngle()

double NBHelpers::relAngle ( double  angle1,
double  angle2 
)
static

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