![]() |
SUMO - Simulation of Urban MObility
|
Exporter writing networks using the openDRIVE format. More...
#include <NWWriter_OpenDrive.h>
Static Public Member Functions | |
static void | writeNetwork (const OptionsCont &oc, NBNetBuilder &nb) |
Writes the network into a openDRIVE-file. More... | |
Static Protected Member Functions | |
static void | addPedestrianConnection (const NBEdge *inEdge, const NBEdge *outEdge, std::vector< NBEdge::Connection > ¶llel) |
static void | checkLaneGeometries (const NBEdge *e) |
check if the lane geometries are compatible with OpenDRIVE assumptions (colinear stop line) More... | |
static int | getID (const std::string &origID, StringBijection< int > &map, int &lastID) |
static std::string | getLaneType (SVCPermissions permissions) |
static PositionVector | getLeftLaneBorder (const NBEdge *edge, int laneIndex=-1, double widthOffset=0) |
get the left border of the given lane (the leftmost one by default) More... | |
static PositionVector | getRightLaneBorder (const NBEdge *edge, int laneIndex=-1) |
static void | writeElevationProfile (const PositionVector &shape, OutputDevice &device, const OutputDevice_String &elevationDevice) |
static void | writeEmptyCenterLane (OutputDevice &device, const std::string &mark, double markWidth) |
static double | writeGeomLines (const PositionVector &shape, OutputDevice &device, OutputDevice &elevationDevice, double offset=0) |
write geometry as sequence of lines (sumo style) More... | |
static double | writeGeomPP3 (OutputDevice &device, OutputDevice &elevationDevice, PositionVector init, double length, double offset=0) |
write geometry as a single bezier curve (paramPoly3) More... | |
static bool | writeGeomSmooth (const PositionVector &shape, double speed, OutputDevice &device, OutputDevice &elevationDevice, double straightThresh, double &length) |
static int | writeInternalEdge (OutputDevice &device, OutputDevice &junctionDevice, const NBEdge *inEdge, int nodeID, int edgeID, int inEdgeID, int outEdgeID, int connectionID, const std::vector< NBEdge::Connection > ¶llel, const bool isOuterEdge, const double straightThresh, const std::string ¢erMark) |
write internal edge to device, return next connectionID More... | |
static void | writeNormalEdge (OutputDevice &device, const NBEdge *e, int edgeID, int fromNodeID, int toNodeID, const bool origNames, const double straightThresh) |
write normal edge to device More... | |
Exporter writing networks using the openDRIVE format.
Definition at line 50 of file NWWriter_OpenDrive.h.
|
staticprotected |
Definition at line 324 of file NWWriter_OpenDrive.cpp.
References NBEdge::getLanes(), NBEdge::getPermissions(), and SVC_PEDESTRIAN.
Referenced by writeNetwork().
|
staticprotected |
check if the lane geometries are compatible with OpenDRIVE assumptions (colinear stop line)
Definition at line 851 of file NWWriter_OpenDrive.cpp.
References PositionVector::distance2D(), NBEdge::getLaneID(), NBEdge::getLaneShape(), NBEdge::getNumLanes(), NUMERICAL_EPS, PositionVector::sideOffset(), toString(), and WRITE_WARNING.
Referenced by writeNormalEdge().
|
staticprotected |
Definition at line 515 of file NWWriter_OpenDrive.cpp.
References StringBijection< T >::get(), StringBijection< T >::hasString(), and StringBijection< T >::insert().
Referenced by writeNetwork().
|
staticprotected |
Definition at line 525 of file NWWriter_OpenDrive.cpp.
References isRailway(), SVC_BICYCLE, SVC_PASSENGER, SVC_PEDESTRIAN, SVC_RAIL, SVC_RAIL_ELECTRIC, SVC_RAIL_URBAN, SVC_TRAM, and SVCAll.
Referenced by writeInternalEdge(), and writeNormalEdge().
|
staticprotected |
get the left border of the given lane (the leftmost one by default)
it would be tempting to use
Definition at line 560 of file NWWriter_OpenDrive.cpp.
References OptionsCont::getBool(), NBEdge::getLaneShape(), NBEdge::getLaneWidth(), NBEdge::getNumLanes(), OptionsCont::getOptions(), and PositionVector::move2side().
Referenced by getRightLaneBorder(), writeInternalEdge(), and writeNormalEdge().
|
staticprotected |
Definition at line 593 of file NWWriter_OpenDrive.cpp.
References NBEdge::getLaneWidth(), and getLeftLaneBorder().
Referenced by writeInternalEdge().
|
staticprotected |
Definition at line 829 of file NWWriter_OpenDrive.cpp.
References OutputDevice_String::getString(), and NUMERICAL_EPS.
Referenced by writeInternalEdge(), and writeNormalEdge().
|
staticprotected |
Definition at line 504 of file NWWriter_OpenDrive.cpp.
Referenced by writeInternalEdge(), and writeNormalEdge().
|
staticprotected |
write geometry as sequence of lines (sumo style)
Definition at line 482 of file NWWriter_OpenDrive.cpp.
References PositionVector::angleAt2D(), OutputDevice::closeTag(), Position::distanceTo2D(), MAX2(), OutputDevice::openTag(), POSITION_EPS, OutputDevice::writeAttr(), Position::x(), Position::y(), and Position::z().
Referenced by writeGeomSmooth(), writeInternalEdge(), and writeNormalEdge().
|
staticprotected |
write geometry as a single bezier curve (paramPoly3)
Definition at line 599 of file NWWriter_OpenDrive.cpp.
References PositionVector::add(), PositionVector::angleAt2D(), OutputDevice::closeTag(), MAX2(), OutputDevice::openTag(), POSITION_EPS, PositionVector::rotate2D(), OutputDevice::writeAttr(), Position::x(), Position::y(), and Position::z().
Referenced by writeGeomSmooth(), and writeInternalEdge().
|
staticprotected |
Definition at line 695 of file NWWriter_OpenDrive.cpp.
References PositionVector::add(), GeomHelper::angleDiff(), Position::angleTo2D(), bezier(), NBNode::bezierControlPoints(), DEBUGCOND, Position::distanceTo2D(), PositionVector::length2D(), MAX2(), MIN2(), POSITION_EPS, PositionVector::positionAtOffset2D(), RAD2DEG, toString(), writeGeomLines(), and writeGeomPP3().
Referenced by writeNormalEdge().
|
staticprotected |
write internal edge to device, return next connectionID
Definition at line 340 of file NWWriter_OpenDrive.cpp.
References bezier(), NBNode::bezierControlPoints(), OutputDevice::closeTag(), DEBUGCOND, NBEdge::Connection::fromLane, NBNode::geometryLike(), NBNode::getDirection(), Named::getID(), NBEdge::getLaneID(), getLaneType(), NBEdge::getLaneWidth(), getLeftLaneBorder(), NBEdge::getNumLanes(), OptionsCont::getOptions(), NBEdge::getPermissions(), getRightLaneBorder(), NBEdge::getToNode(), gPrecision, NBEdge::isTurningDirectionAt(), PositionVector::length2D(), LINKDIR_LEFT, LINKDIR_PARTLEFT, LINKDIR_PARTRIGHT, LINKDIR_RIGHT, MAX2(), NUMERICAL_EPS, OutputDevice::openTag(), POSITION_EPS, OutputDevice::setPrecision(), SVC_BICYCLE, SVC_PEDESTRIAN, NBEdge::Connection::toLane, NBEdge::Connection::vmax, WRITE_WARNING, OutputDevice::writeAttr(), writeElevationProfile(), writeEmptyCenterLane(), writeGeomLines(), and writeGeomPP3().
Referenced by writeNetwork().
|
static |
Writes the network into a openDRIVE-file.
[in] | oc | The options to use |
[in] | nb | The network builder to fill |
Definition at line 56 of file NWWriter_OpenDrive.cpp.
References addPedestrianConnection(), NBNodeCont::begin(), NBEdgeCont::begin(), DEG2RAD, NBNodeCont::end(), NBEdgeCont::end(), NBNode::geometryLike(), OptionsCont::getBool(), NBEdge::getConnections(), GeoConvHelper::getConvBoundary(), OutputDevice::getDevice(), NBNetBuilder::getEdgeCont(), GeoConvHelper::getFinal(), OptionsCont::getFloat(), NBEdge::getFromNode(), Named::getID(), getID(), NBNode::getIncomingEdges(), NBEdge::getIncomingEdges(), NBNetBuilder::getNodeCont(), GeoConvHelper::getOffsetBase(), GeoConvHelper::getProjString(), OutputDevice_String::getString(), OptionsCont::getString(), NBEdge::getToNode(), INVALID_ID, OptionsCont::isSet(), OutputDevice::lf(), NBNode::numNormalConnections(), OutputDevice::openTag(), NBNodeCont::size(), NBEdge::Connection::toEdge, toString(), GeoConvHelper::usingGeoProjection(), WRITE_WARNING, writeInternalEdge(), writeNormalEdge(), Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().
Referenced by NWFrame::writeNetwork().
|
staticprotected |
write normal edge to device
Definition at line 221 of file NWWriter_OpenDrive.cpp.
References checkLaneGeometries(), OutputDevice::closeTag(), DEBUGCOND, StringUtils::escapeXML(), Named::getID(), NBEdge::getLanes(), getLaneType(), NBEdge::getLaneWidth(), getLeftLaneBorder(), NBEdge::getNumLanes(), NBEdge::getPermissions(), NBEdge::getSpeed(), NBEdge::getStreetName(), OutputDevice_String::getString(), gPrecision, INVALID_ID, MAX2(), OutputDevice::openTag(), POSITION_EPS, OutputDevice::setPrecision(), SVC_BICYCLE, SVC_PEDESTRIAN, WRITE_WARNING, OutputDevice::writeAttr(), writeElevationProfile(), writeEmptyCenterLane(), writeGeomLines(), and writeGeomSmooth().
Referenced by writeNetwork().