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

Importer for networks stored in openDrive format. More...

#include <NIImporter_OpenDrive.h>

Inheritance diagram for NIImporter_OpenDrive:
[legend]
Collaboration diagram for NIImporter_OpenDrive:
[legend]

Data Structures

struct  Connection
 A connection between two roads. More...
 
struct  LaneAttributeChange
 Attribute set applied at a certain position along a lane. More...
 
class  LaneSorter
 
struct  OpenDriveController
 Representation of a signal group. More...
 
struct  OpenDriveEdge
 Representation of an openDrive "link". More...
 
struct  OpenDriveGeometry
 Representation of an OpenDrive geometry part. More...
 
struct  OpenDriveLane
 Representation of a lane. More...
 
struct  OpenDriveLaneSection
 Representation of a lane section. More...
 
struct  OpenDriveLink
 Representation of an OpenDrive link. More...
 
struct  OpenDriveObject
 
struct  OpenDriveSignal
 Representation of a signal. More...
 
struct  Poly3
 
class  same_position_finder
 
class  sections_by_s_sorter
 A class for sorting lane sections by their s-value. More...
 

Public Member Functions

void characters (const XMLCh *const chars, const XERCES3_SIZE_t length)
 The inherited method called when characters occurred.
 
void endElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname)
 The inherited method called when a tag is being closed.
 
const std::string & getFileName () const
 returns the current file name
 
void registerParent (const int tag, GenericSAXHandler *handler)
 Assigning a parent handler which is enabled when the specified tag is closed.
 
void setFileName (const std::string &name)
 Sets the current file name.
 
void startElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const XERCES_CPP_NAMESPACE::Attributes &attrs)
 The inherited method called when a new tag opens.
 

Static Public Member Functions

static void loadNetwork (const OptionsCont &oc, NBNetBuilder &nb)
 Loads content of the optionally given SUMO file.
 

Protected Types

enum  ContactPoint { OPENDRIVE_CP_UNKNOWN , OPENDRIVE_CP_START , OPENDRIVE_CP_END }
 OpenDrive contact type enumeration. More...
 
enum  ElementType { OPENDRIVE_ET_UNKNOWN , OPENDRIVE_ET_ROAD , OPENDRIVE_ET_JUNCTION }
 OpenDrive element type enumeration. More...
 
enum  GeometryType {
  OPENDRIVE_GT_UNKNOWN , OPENDRIVE_GT_LINE , OPENDRIVE_GT_SPIRAL , OPENDRIVE_GT_ARC ,
  OPENDRIVE_GT_POLY3 , OPENDRIVE_GT_PARAMPOLY3
}
 OpenDrive geometry type enumeration. More...
 
enum  LinkType { OPENDRIVE_LT_SUCCESSOR , OPENDRIVE_LT_PREDECESSOR }
 OpenDrive link type enumeration. More...
 
typedef Poly3 OpenDriveElevation
 LaneOffset has the same fields as Elevation.
 
typedef Poly3 OpenDriveLaneOffset
 
typedef Poly3 OpenDriveWidth
 
enum  OpenDriveXMLAttr {
  OPENDRIVE_ATTR_NOTHING , OPENDRIVE_ATTR_REVMAJOR , OPENDRIVE_ATTR_REVMINOR , OPENDRIVE_ATTR_ID ,
  OPENDRIVE_ATTR_LENGTH , OPENDRIVE_ATTR_WIDTH , OPENDRIVE_ATTR_RADIUS , OPENDRIVE_ATTR_DISTANCE ,
  OPENDRIVE_ATTR_TSTART , OPENDRIVE_ATTR_TEND , OPENDRIVE_ATTR_WIDTHSTART , OPENDRIVE_ATTR_WIDTHEND ,
  OPENDRIVE_ATTR_JUNCTION , OPENDRIVE_ATTR_ELEMENTTYPE , OPENDRIVE_ATTR_ELEMENTID , OPENDRIVE_ATTR_CONTACTPOINT ,
  OPENDRIVE_ATTR_S , OPENDRIVE_ATTR_T , OPENDRIVE_ATTR_X , OPENDRIVE_ATTR_Y ,
  OPENDRIVE_ATTR_Z , OPENDRIVE_ATTR_HDG , OPENDRIVE_ATTR_CURVSTART , OPENDRIVE_ATTR_CURVEND ,
  OPENDRIVE_ATTR_CURVATURE , OPENDRIVE_ATTR_A , OPENDRIVE_ATTR_B , OPENDRIVE_ATTR_C ,
  OPENDRIVE_ATTR_D , OPENDRIVE_ATTR_AU , OPENDRIVE_ATTR_BU , OPENDRIVE_ATTR_CU ,
  OPENDRIVE_ATTR_DU , OPENDRIVE_ATTR_AV , OPENDRIVE_ATTR_BV , OPENDRIVE_ATTR_CV ,
  OPENDRIVE_ATTR_DV , OPENDRIVE_ATTR_PRANGE , OPENDRIVE_ATTR_TYPE , OPENDRIVE_ATTR_LEVEL ,
  OPENDRIVE_ATTR_ORIENTATION , OPENDRIVE_ATTR_DYNAMIC , OPENDRIVE_ATTR_INCOMINGROAD , OPENDRIVE_ATTR_CONNECTINGROAD ,
  OPENDRIVE_ATTR_FROM , OPENDRIVE_ATTR_TO , OPENDRIVE_ATTR_FROMLANE , OPENDRIVE_ATTR_TOLANE ,
  OPENDRIVE_ATTR_MAX , OPENDRIVE_ATTR_SOFFSET , OPENDRIVE_ATTR_RULE , OPENDRIVE_ATTR_RESTRICTION ,
  OPENDRIVE_ATTR_NAME , OPENDRIVE_ATTR_UNIT , OPENDRIVE_ATTR_SIGNALID , OPENDRIVE_ATTR_FILE
}
 Numbers representing openDrive-XML - attributes. More...
 
enum  OpenDriveXMLTag {
  OPENDRIVE_TAG_NOTHING , OPENDRIVE_TAG_HEADER , OPENDRIVE_TAG_ROAD , OPENDRIVE_TAG_PREDECESSOR ,
  OPENDRIVE_TAG_SUCCESSOR , OPENDRIVE_TAG_GEOMETRY , OPENDRIVE_TAG_LINE , OPENDRIVE_TAG_SPIRAL ,
  OPENDRIVE_TAG_ARC , OPENDRIVE_TAG_POLY3 , OPENDRIVE_TAG_PARAMPOLY3 , OPENDRIVE_TAG_LANESECTION ,
  OPENDRIVE_TAG_LANEOFFSET , OPENDRIVE_TAG_ACCESS , OPENDRIVE_TAG_LEFT , OPENDRIVE_TAG_CENTER ,
  OPENDRIVE_TAG_RIGHT , OPENDRIVE_TAG_LANE , OPENDRIVE_TAG_SIGNAL , OPENDRIVE_TAG_SIGNALREFERENCE ,
  OPENDRIVE_TAG_CONTROLLER , OPENDRIVE_TAG_CONTROL , OPENDRIVE_TAG_VALIDITY , OPENDRIVE_TAG_JUNCTION ,
  OPENDRIVE_TAG_CONNECTION , OPENDRIVE_TAG_LANELINK , OPENDRIVE_TAG_WIDTH , OPENDRIVE_TAG_SPEED ,
  OPENDRIVE_TAG_ELEVATION , OPENDRIVE_TAG_GEOREFERENCE , OPENDRIVE_TAG_OFFSET , OPENDRIVE_TAG_OBJECT ,
  OPENDRIVE_TAG_REPEAT , OPENDRIVE_TAG_INCLUDE
}
 Numbers representing openDrive-XML - element names. More...
 

Protected Member Functions

 NIImporter_OpenDrive (const NBTypeCont &tc, std::map< std::string, OpenDriveEdge * > &edges)
 Constructor.
 
 ~NIImporter_OpenDrive ()
 Destructor.
 

inherited from GenericSAXHandler

const NBTypeContmyTypeContainer
 
OpenDriveEdge myCurrentEdge
 
OpenDriveController myCurrentController
 
std::map< std::string, OpenDriveEdge * > & myEdges
 
std::vector< int > myElementStack
 
OpenDriveXMLTag myCurrentLaneDirection
 
std::string myCurrentJunctionID
 
std::string myCurrentIncomingRoad
 
std::string myCurrentConnectingRoad
 
ContactPoint myCurrentContactPoint
 
bool myConnectionWasEmpty
 
std::map< std::string, OpenDriveSignalmySignals
 
std::map< std::string, OpenDriveControllermyControllers
 
std::map< std::string, std::vector< std::string > > myJunctions2Controllers
 
Position myOffset
 
bool myUseCurrentNode
 
static bool myImportAllTypes
 
static bool myImportWidths
 
static double myMinWidth
 
static bool myImportInternalShapes
 
static bool myIgnoreMisplacedSignals
 
static OpenDriveController myDummyController
 
static SequentialStringBijection::Entry openDriveTags []
 The names of openDrive-XML elements (for passing to GenericSAXHandler)
 
static SequentialStringBijection::Entry openDriveAttrs []
 The names of openDrive-XML attributes (for passing to GenericSAXHandler)
 
void myStartElement (int element, const SUMOSAXAttributes &attrs)
 Called on the opening of a tag;.
 
void myCharacters (int element, const std::string &chars)
 Callback method for characters to implement by derived classes.
 
void myEndElement (int element)
 Called when a closing tag occurs.
 
std::map< std::string, OpenDriveSignal > & getSignals ()
 
std::map< std::string, OpenDriveController > & getControllers ()
 
std::map< std::string, std::vector< std::string > > & getJunctions2Controllers ()
 
const OpenDriveControllergetController (std::string signalID)
 
int getTLIndexForController (std::string controllerID)
 
void addLink (LinkType lt, const std::string &elementType, const std::string &elementID, const std::string &contactPoint)
 
void addGeometryShape (GeometryType type, const std::vector< double > &vals)
 
static void setEdgeLinks2 (OpenDriveEdge &e, const std::map< std::string, OpenDriveEdge * > &edges)
 
static void buildConnectionsToOuter (const Connection &c, const std::map< std::string, OpenDriveEdge * > &innerEdges, const std::map< std::string, OpenDriveEdge * > &edges, const NBTypeCont &tc, std::vector< Connection > &into, std::set< Connection > &seen)
 
static bool laneSectionsConnected (OpenDriveEdge *edge, int in, int out)
 
static std::string revertID (const std::string &id)
 
bool operator< (const Connection &c1, const Connection &c2)
 
static NBNodegetOrBuildNode (const std::string &id, const Position &pos, NBNodeCont &nc)
 Builds a node or returns the already built.
 
static PositionVector geomFromLine (const OpenDriveEdge &e, const OpenDriveGeometry &g, double resolution)
 
static PositionVector geomFromSpiral (const OpenDriveEdge &e, const OpenDriveGeometry &g, double resolution)
 
static PositionVector geomFromArc (const OpenDriveEdge &e, const OpenDriveGeometry &g, double resolution)
 
static PositionVector geomFromPoly (const OpenDriveEdge &e, const OpenDriveGeometry &g, double resolution)
 
static PositionVector geomFromParamPoly (const OpenDriveEdge &e, const OpenDriveGeometry &g, double resolution)
 
static Position calculateStraightEndPoint (double hdg, double length, const Position &start)
 
static void calculateCurveCenter (double *ad_x, double *ad_y, double ad_radius, double ad_hdg)
 
static void calcPointOnCurve (double *ad_x, double *ad_y, double ad_centerX, double ad_centerY, double ad_r, double ad_length)
 
static void computeShapes (std::map< std::string, OpenDriveEdge * > &edges)
 Computes a polygon representation of each edge's geometry.
 
static bool hasNonLinearElevation (const OpenDriveEdge &e)
 
static std::vector< double > discretizeOffsets (PositionVector &geom, const std::vector< OpenDriveLaneOffset > &offsets, const std::string &id)
 transform Poly3 into a list of offsets, adding intermediate points to geom if needed
 
static void addOffsets (bool left, PositionVector &geom, const std::vector< OpenDriveLaneOffset > &offsets, const std::string &id, std::vector< double > &result)
 
static void revisitLaneSections (const NBTypeCont &tc, std::map< std::string, OpenDriveEdge * > &edges)
 Rechecks lane sections of the given edges.
 
static void setNodeSecure (NBNodeCont &nc, OpenDriveEdge &e, const std::string &nodeID, NIImporter_OpenDrive::LinkType lt, std::vector< NodeSet > &joinedNodeIDs)
 
static NBTrafficLightDefinitiongetTLSSecure (NBEdge *inEdge, NBNetBuilder &nb)
 
static std::pair< NBEdge *, NBEdge * > retrieveSignalEdges (NBNetBuilder &nb, const std::string &fromID, const std::string &toID, const std::string &junction)
 
static void splitMinWidths (OpenDriveEdge *e, const NBTypeCont &tc, double minDist)
 
static void findWidthSplit (const NBTypeCont &tc, std::vector< OpenDriveLane > &lanes, int section, double sectionStart, double sectionEnd, std::vector< double > &splitPositions)
 
static void sanitizeWidths (OpenDriveEdge *e)
 
static void sanitizeWidths (std::vector< OpenDriveLane > &lanes, double length)
 
static void setStraightConnections (std::vector< OpenDriveLane > &lanes)
 
static void recomputeWidths (OpenDriveLaneSection &sec, double start, double end, double sectionStart, double sectionEnd)
 
static void recomputeWidths (std::vector< OpenDriveLane > &lanes, double start, double end, double sectionStart, double sectionEnd)
 
static void setLaneAttributes (const OpenDriveEdge *e, NBEdge::Lane &sumoLane, const OpenDriveLane &odLane, bool saveOrigIDs, const NBTypeCont &tc)
 
static void writeRoadObjects (const OpenDriveEdge *e)
 

attributes parsing

AttrMap myPredefinedTags
 
std::vector< std::string > myPredefinedTagsMML
 the map from ids to their string representation
 
typedef std::vector< XMLCh * > AttrMap
 

elements parsing

TagMap myTagMap
 
std::vector< std::string > myCharactersVector
 A list of character strings obtained so far to build the complete characters string at the end.
 
GenericSAXHandlermyParentHandler
 The handler to give control back to.
 
int myParentIndicator
 The tag indicating that control should be given back.
 
std::string myFileName
 The name of the currently parsed file.
 
std::string myExpectedRoot
 The root element to expect, empty string disables the check.
 
bool myCollectCharacterData = false
 whether the reader should collect character data
 
bool myRootSeen = false
 whether the reader has already seen the root element
 
int mySection = -1
 The tag indicating the current section to parse.
 
bool mySectionSeen = false
 whether the reader has already seen the begin of the section
 
bool mySectionEnded = false
 whether the reader has already seen the end of the section
 
bool mySectionOpen = false
 whether an element of the current section is open
 
std::pair< int, SUMOSAXAttributes * > myNextSectionStart
 
typedef std::map< std::string, int > TagMap
 

SAX ErrorHandler callbacks

std::string buildErrorMessage (const XERCES_CPP_NAMESPACE::SAXParseException &exception)
 Builds an error message.
 
void callParentEnd (int element)
 signal endElement to the parent handler (special case for MSCalibrator)
 
XMLCh * convert (const std::string &name) const
 converts from c++-string into unicode
 
int convertTag (const std::string &tag) const
 Converts a tag from its string into its numerical representation.
 
void warning (const XERCES_CPP_NAMESPACE::SAXParseException &exception)
 Handler for XML-warnings.
 
void error (const XERCES_CPP_NAMESPACE::SAXParseException &exception)
 Handler for XML-errors.
 
void fatalError (const XERCES_CPP_NAMESPACE::SAXParseException &exception)
 Handler for XML-errors.
 
void setSection (const int element, const bool seen)
 
bool sectionFinished () const
 
std::pair< int, SUMOSAXAttributes * > retrieveNextSectionStart ()
 
void needsCharacterData (const bool value=true)
 

Detailed Description

Importer for networks stored in openDrive format.

Definition at line 53 of file NIImporter_OpenDrive.h.

Member Typedef Documentation

◆ AttrMap

typedef std::vector<XMLCh*> GenericSAXHandler::AttrMap
privateinherited

Definition at line 303 of file GenericSAXHandler.h.

◆ OpenDriveElevation

LaneOffset has the same fields as Elevation.

Definition at line 296 of file NIImporter_OpenDrive.h.

◆ OpenDriveLaneOffset

Definition at line 297 of file NIImporter_OpenDrive.h.

◆ OpenDriveWidth

Definition at line 298 of file NIImporter_OpenDrive.h.

◆ TagMap

typedef std::map<std::string, int> GenericSAXHandler::TagMap
privateinherited

Definition at line 317 of file GenericSAXHandler.h.

Member Enumeration Documentation

◆ ContactPoint

OpenDrive contact type enumeration.

Enumerator
OPENDRIVE_CP_UNKNOWN 
OPENDRIVE_CP_START 
OPENDRIVE_CP_END 

Definition at line 204 of file NIImporter_OpenDrive.h.

◆ ElementType

OpenDrive element type enumeration.

Enumerator
OPENDRIVE_ET_UNKNOWN 
OPENDRIVE_ET_ROAD 
OPENDRIVE_ET_JUNCTION 

Definition at line 195 of file NIImporter_OpenDrive.h.

◆ GeometryType

OpenDrive geometry type enumeration.

Enumerator
OPENDRIVE_GT_UNKNOWN 
OPENDRIVE_GT_LINE 
OPENDRIVE_GT_SPIRAL 
OPENDRIVE_GT_ARC 
OPENDRIVE_GT_POLY3 
OPENDRIVE_GT_PARAMPOLY3 

Definition at line 212 of file NIImporter_OpenDrive.h.

◆ LinkType

OpenDrive link type enumeration.

Enumerator
OPENDRIVE_LT_SUCCESSOR 
OPENDRIVE_LT_PREDECESSOR 

Definition at line 187 of file NIImporter_OpenDrive.h.

◆ OpenDriveXMLAttr

Numbers representing openDrive-XML - attributes.

See also
GenericSAXHandler
Enumerator
OPENDRIVE_ATTR_NOTHING 
OPENDRIVE_ATTR_REVMAJOR 
OPENDRIVE_ATTR_REVMINOR 
OPENDRIVE_ATTR_ID 
OPENDRIVE_ATTR_LENGTH 
OPENDRIVE_ATTR_WIDTH 
OPENDRIVE_ATTR_RADIUS 
OPENDRIVE_ATTR_DISTANCE 
OPENDRIVE_ATTR_TSTART 
OPENDRIVE_ATTR_TEND 
OPENDRIVE_ATTR_WIDTHSTART 
OPENDRIVE_ATTR_WIDTHEND 
OPENDRIVE_ATTR_JUNCTION 
OPENDRIVE_ATTR_ELEMENTTYPE 
OPENDRIVE_ATTR_ELEMENTID 
OPENDRIVE_ATTR_CONTACTPOINT 
OPENDRIVE_ATTR_S 
OPENDRIVE_ATTR_T 
OPENDRIVE_ATTR_X 
OPENDRIVE_ATTR_Y 
OPENDRIVE_ATTR_Z 
OPENDRIVE_ATTR_HDG 
OPENDRIVE_ATTR_CURVSTART 
OPENDRIVE_ATTR_CURVEND 
OPENDRIVE_ATTR_CURVATURE 
OPENDRIVE_ATTR_A 
OPENDRIVE_ATTR_B 
OPENDRIVE_ATTR_C 
OPENDRIVE_ATTR_D 
OPENDRIVE_ATTR_AU 
OPENDRIVE_ATTR_BU 
OPENDRIVE_ATTR_CU 
OPENDRIVE_ATTR_DU 
OPENDRIVE_ATTR_AV 
OPENDRIVE_ATTR_BV 
OPENDRIVE_ATTR_CV 
OPENDRIVE_ATTR_DV 
OPENDRIVE_ATTR_PRANGE 
OPENDRIVE_ATTR_TYPE 
OPENDRIVE_ATTR_LEVEL 
OPENDRIVE_ATTR_ORIENTATION 
OPENDRIVE_ATTR_DYNAMIC 
OPENDRIVE_ATTR_INCOMINGROAD 
OPENDRIVE_ATTR_CONNECTINGROAD 
OPENDRIVE_ATTR_FROM 
OPENDRIVE_ATTR_TO 
OPENDRIVE_ATTR_FROMLANE 
OPENDRIVE_ATTR_TOLANE 
OPENDRIVE_ATTR_MAX 
OPENDRIVE_ATTR_SOFFSET 
OPENDRIVE_ATTR_RULE 
OPENDRIVE_ATTR_RESTRICTION 
OPENDRIVE_ATTR_NAME 
OPENDRIVE_ATTR_UNIT 
OPENDRIVE_ATTR_SIGNALID 
OPENDRIVE_ATTR_FILE 

Definition at line 125 of file NIImporter_OpenDrive.h.

◆ OpenDriveXMLTag

Numbers representing openDrive-XML - element names.

See also
GenericSAXHandler
Enumerator
OPENDRIVE_TAG_NOTHING 
OPENDRIVE_TAG_HEADER 
OPENDRIVE_TAG_ROAD 
OPENDRIVE_TAG_PREDECESSOR 
OPENDRIVE_TAG_SUCCESSOR 
OPENDRIVE_TAG_GEOMETRY 
Todo:

OPENDRIVE_TAG_NEIGHBOR,

OPENDRIVE_TAG_TYPE,

OPENDRIVE_TAG_LINE 
OPENDRIVE_TAG_SPIRAL 
OPENDRIVE_TAG_ARC 
OPENDRIVE_TAG_POLY3 
OPENDRIVE_TAG_PARAMPOLY3 
OPENDRIVE_TAG_LANESECTION 
OPENDRIVE_TAG_LANEOFFSET 
OPENDRIVE_TAG_ACCESS 
OPENDRIVE_TAG_LEFT 
OPENDRIVE_TAG_CENTER 
OPENDRIVE_TAG_RIGHT 
OPENDRIVE_TAG_LANE 
OPENDRIVE_TAG_SIGNAL 
OPENDRIVE_TAG_SIGNALREFERENCE 
OPENDRIVE_TAG_CONTROLLER 
OPENDRIVE_TAG_CONTROL 
OPENDRIVE_TAG_VALIDITY 
OPENDRIVE_TAG_JUNCTION 
OPENDRIVE_TAG_CONNECTION 
OPENDRIVE_TAG_LANELINK 
OPENDRIVE_TAG_WIDTH 
OPENDRIVE_TAG_SPEED 
OPENDRIVE_TAG_ELEVATION 
OPENDRIVE_TAG_GEOREFERENCE 
OPENDRIVE_TAG_OFFSET 
OPENDRIVE_TAG_OBJECT 
OPENDRIVE_TAG_REPEAT 
OPENDRIVE_TAG_INCLUDE 

Definition at line 80 of file NIImporter_OpenDrive.h.

Constructor & Destructor Documentation

◆ NIImporter_OpenDrive()

NIImporter_OpenDrive::NIImporter_OpenDrive ( const NBTypeCont tc,
std::map< std::string, OpenDriveEdge * > &  edges 
)
protected

Constructor.

Parameters
[in]tcThe type container used to determine whether a lane shall kept
[in]ncThe edge map to fill

Definition at line 2258 of file NIImporter_OpenDrive.cpp.

◆ ~NIImporter_OpenDrive()

NIImporter_OpenDrive::~NIImporter_OpenDrive ( )
protected

Destructor.

Definition at line 2265 of file NIImporter_OpenDrive.cpp.

Member Function Documentation

◆ addGeometryShape()

void NIImporter_OpenDrive::addGeometryShape ( GeometryType  type,
const std::vector< double > &  vals 
)
private

Definition at line 2815 of file NIImporter_OpenDrive.cpp.

References NIImporter_OpenDrive::OpenDriveEdge::geometries, NIImporter_OpenDrive::OpenDriveEdge::id, myCurrentEdge, OPENDRIVE_GT_UNKNOWN, NIImporter_OpenDrive::OpenDriveGeometry::params, TLF, and NIImporter_OpenDrive::OpenDriveGeometry::type.

Referenced by myStartElement().

Here is the caller graph for this function:

◆ addLink()

void NIImporter_OpenDrive::addLink ( LinkType  lt,
const std::string &  elementType,
const std::string &  elementID,
const std::string &  contactPoint 
)
private

Definition at line 2793 of file NIImporter_OpenDrive.cpp.

References NIImporter_OpenDrive::OpenDriveLink::contactPoint, NIImporter_OpenDrive::OpenDriveLink::elementType, NIImporter_OpenDrive::OpenDriveEdge::links, myCurrentEdge, OPENDRIVE_CP_END, OPENDRIVE_CP_START, OPENDRIVE_ET_JUNCTION, and OPENDRIVE_ET_ROAD.

Referenced by myStartElement().

Here is the caller graph for this function:

◆ addOffsets()

void NIImporter_OpenDrive::addOffsets ( bool  left,
PositionVector geom,
const std::vector< OpenDriveLaneOffset > &  offsets,
const std::string &  id,
std::vector< double > &  result 
)
staticprotected

Definition at line 1638 of file NIImporter_OpenDrive.cpp.

References NIImporter_OpenDrive::Poly3::computeAt(), Position::distanceTo2D(), PositionVector::indexOfClosest(), PositionVector::insertAtClosest(), PositionVector::positionAtOffset2D(), and UNUSED_PARAMETER.

Referenced by loadNetwork().

Here is the caller graph for this function:

◆ buildConnectionsToOuter()

void NIImporter_OpenDrive::buildConnectionsToOuter ( const Connection c,
const std::map< std::string, OpenDriveEdge * > &  innerEdges,
const std::map< std::string, OpenDriveEdge * > &  edges,
const NBTypeCont tc,
std::vector< Connection > &  into,
std::set< Connection > &  seen 
)
staticprivate

◆ buildErrorMessage()

std::string GenericSAXHandler::buildErrorMessage ( const XERCES_CPP_NAMESPACE::SAXParseException &  exception)
protectedinherited

Builds an error message.

The error message includes the file name and the line/column information as supported by the given SAXParseException

Parameters
[in]exceptionThe name of the currently processed file
Returns
A string describing the given exception

Definition at line 205 of file GenericSAXHandler.cpp.

References GenericSAXHandler::getFileName(), and TL.

Referenced by GenericSAXHandler::error(), GenericSAXHandler::fatalError(), and GenericSAXHandler::warning().

Here is the caller graph for this function:

◆ calcPointOnCurve()

void NIImporter_OpenDrive::calcPointOnCurve ( double *  ad_x,
double *  ad_y,
double  ad_centerX,
double  ad_centerY,
double  ad_r,
double  ad_length 
)
staticprotected

Definition at line 1944 of file NIImporter_OpenDrive.cpp.

Referenced by geomFromArc().

Here is the caller graph for this function:

◆ calculateCurveCenter()

void NIImporter_OpenDrive::calculateCurveCenter ( double *  ad_x,
double *  ad_y,
double  ad_radius,
double  ad_hdg 
)
staticprotected

Definition at line 1916 of file NIImporter_OpenDrive.cpp.

Referenced by geomFromArc().

Here is the caller graph for this function:

◆ calculateStraightEndPoint()

Position NIImporter_OpenDrive::calculateStraightEndPoint ( double  hdg,
double  length,
const Position start 
)
staticprotected

Definition at line 1904 of file NIImporter_OpenDrive.cpp.

References Position::x(), and Position::y().

Referenced by geomFromLine().

Here is the caller graph for this function:

◆ callParentEnd()

void GenericSAXHandler::callParentEnd ( int  element)
protectedinherited

signal endElement to the parent handler (special case for MSCalibrator)

Definition at line 247 of file GenericSAXHandler.cpp.

References GenericSAXHandler::myEndElement(), and GenericSAXHandler::myParentHandler.

Referenced by MSCalibrator::myEndElement().

Here is the caller graph for this function:

◆ characters()

void GenericSAXHandler::characters ( const XMLCh *const  chars,
const XERCES3_SIZE_t  length 
)
inherited

The inherited method called when characters occurred.

The retrieved characters are converted into a string and appended into a private buffer. They are reported as soon as the element ends.

Todo:

recheck/describe what happens with characters when a new element is opened

describe characters processing in the class' head

Definition at line 186 of file GenericSAXHandler.cpp.

References GenericSAXHandler::myCharactersVector, GenericSAXHandler::myCollectCharacterData, and StringUtils::transcode().

◆ computeShapes()

◆ convert()

XMLCh * GenericSAXHandler::convert ( const std::string &  name) const
privateinherited

converts from c++-string into unicode

Todo:
recheck encoding
Parameters
[in]nameThe string to convert
Returns
The string converted into a XMLCh-string

Definition at line 86 of file GenericSAXHandler.cpp.

Referenced by GenericSAXHandler::GenericSAXHandler().

Here is the caller graph for this function:

◆ convertTag()

int GenericSAXHandler::convertTag ( const std::string &  tag) const
privateinherited

Converts a tag from its string into its numerical representation.

Returns the enum-representation stored for the given tag. If the tag is not known, SUMO_TAG_NOTHING is returned.

Parameters
[in]tagThe string to convert
Returns
The int-value that represents the string, SUMO_TAG_NOTHING if the named attribute is not known

Definition at line 195 of file GenericSAXHandler.cpp.

References GenericSAXHandler::myTagMap, and SUMO_TAG_NOTHING.

Referenced by GenericSAXHandler::endElement(), and GenericSAXHandler::startElement().

Here is the caller graph for this function:

◆ discretizeOffsets()

std::vector< double > NIImporter_OpenDrive::discretizeOffsets ( PositionVector geom,
const std::vector< OpenDriveLaneOffset > &  offsets,
const std::string &  id 
)
staticprotected

transform Poly3 into a list of offsets, adding intermediate points to geom if needed

Definition at line 1601 of file NIImporter_OpenDrive.cpp.

References NIImporter_OpenDrive::Poly3::computeAt(), Position::distanceTo2D(), PositionVector::indexOfClosest(), PositionVector::insertAtClosest(), PositionVector::positionAtOffset2D(), and UNUSED_PARAMETER.

Referenced by computeShapes().

Here is the caller graph for this function:

◆ endElement()

void GenericSAXHandler::endElement ( const XMLCh *const  uri,
const XMLCh *const  localname,
const XMLCh *const  qname 
)
inherited

The inherited method called when a tag is being closed.

This method calls the user-implemented methods myCharacters with the previously collected and converted characters.

Then, myEndElement is called, supplying it the qname converted to its enum- and string-representations.

Todo:

recheck/describe encoding of the string-representation

do not generate and report the string-representation

Definition at line 134 of file GenericSAXHandler.cpp.

References GenericSAXHandler::convertTag(), GenericSAXHandler::myCharacters(), GenericSAXHandler::myCharactersVector, GenericSAXHandler::myEndElement(), GenericSAXHandler::myParentHandler, GenericSAXHandler::myParentIndicator, GenericSAXHandler::mySection, GenericSAXHandler::mySectionOpen, XMLSubSys::setHandler(), SUMO_TAG_INCLUDE, SUMO_TAG_NOTHING, and StringUtils::transcode().

◆ error()

void GenericSAXHandler::error ( const XERCES_CPP_NAMESPACE::SAXParseException &  exception)
inherited

Handler for XML-errors.

The message is built using buildErrorMessage and thrown within a ProcessError.

Parameters
[in]exceptionThe occurred exception to process
Exceptions
ProcessErrorOn any call

Definition at line 224 of file GenericSAXHandler.cpp.

References GenericSAXHandler::buildErrorMessage().

Referenced by MSRouteHandler::addFlowTransportable(), MSRouteHandler::addTransportable(), MSRouteHandler::closeTransportable(), geomFromSpiral(), and MSRouteHandler::interpretDepartPosLat().

Here is the caller graph for this function:

◆ fatalError()

void GenericSAXHandler::fatalError ( const XERCES_CPP_NAMESPACE::SAXParseException &  exception)
inherited

Handler for XML-errors.

The message is built using buildErrorMessage and thrown within a ProcessError.

Exceptions
ProcessErrorOn any call
Parameters
[in]exceptionThe occurred exception to process

Definition at line 230 of file GenericSAXHandler.cpp.

References GenericSAXHandler::buildErrorMessage().

◆ findWidthSplit()

void NIImporter_OpenDrive::findWidthSplit ( const NBTypeCont tc,
std::vector< OpenDriveLane > &  lanes,
int  section,
double  sectionStart,
double  sectionEnd,
std::vector< double > &  splitPositions 
)
staticprotected

Definition at line 2981 of file NIImporter_OpenDrive.cpp.

References gDebugFlag1, NBTypeCont::getEdgeTypePermissions(), NBTypeCont::getEdgeTypeShallBeDiscarded(), NBTypeCont::knows(), myMinWidth, and UNUSED_PARAMETER.

Referenced by splitMinWidths().

Here is the caller graph for this function:

◆ geomFromArc()

PositionVector NIImporter_OpenDrive::geomFromArc ( const OpenDriveEdge e,
const OpenDriveGeometry g,
double  resolution 
)
staticprotected

◆ geomFromLine()

PositionVector NIImporter_OpenDrive::geomFromLine ( const OpenDriveEdge e,
const OpenDriveGeometry g,
double  resolution 
)
staticprotected

Definition at line 1740 of file NIImporter_OpenDrive.cpp.

References calculateStraightEndPoint(), NIImporter_OpenDrive::OpenDriveGeometry::hdg, NIImporter_OpenDrive::OpenDriveGeometry::length, UNUSED_PARAMETER, NIImporter_OpenDrive::OpenDriveGeometry::x, Position::x(), NIImporter_OpenDrive::OpenDriveGeometry::y, and Position::y().

Referenced by computeShapes().

Here is the caller graph for this function:

◆ geomFromParamPoly()

PositionVector NIImporter_OpenDrive::geomFromParamPoly ( const OpenDriveEdge e,
const OpenDriveGeometry g,
double  resolution 
)
staticprotected

Definition at line 1885 of file NIImporter_OpenDrive.cpp.

References PositionVector::getSubpart2D(), NIImporter_OpenDrive::OpenDriveGeometry::hdg, NIImporter_OpenDrive::OpenDriveGeometry::length, NIImporter_OpenDrive::OpenDriveGeometry::params, UNUSED_PARAMETER, NIImporter_OpenDrive::OpenDriveGeometry::x, and NIImporter_OpenDrive::OpenDriveGeometry::y.

Referenced by computeShapes().

Here is the caller graph for this function:

◆ geomFromPoly()

PositionVector NIImporter_OpenDrive::geomFromPoly ( const OpenDriveEdge e,
const OpenDriveGeometry g,
double  resolution 
)
staticprotected

Definition at line 1868 of file NIImporter_OpenDrive.cpp.

References PositionVector::getSubpart2D(), NIImporter_OpenDrive::OpenDriveGeometry::hdg, NIImporter_OpenDrive::OpenDriveGeometry::length, NIImporter_OpenDrive::OpenDriveGeometry::params, UNUSED_PARAMETER, NIImporter_OpenDrive::OpenDriveGeometry::x, and NIImporter_OpenDrive::OpenDriveGeometry::y.

Referenced by computeShapes().

Here is the caller graph for this function:

◆ geomFromSpiral()

◆ getController()

const OpenDriveController & NIImporter_OpenDrive::getController ( std::string  signalID)
inlineprotected

Definition at line 643 of file NIImporter_OpenDrive.h.

References myControllers, myDummyController, and mySignals.

Referenced by loadNetwork().

Here is the caller graph for this function:

◆ getControllers()

std::map< std::string, OpenDriveController > & NIImporter_OpenDrive::getControllers ( )
inlineprotected

Definition at line 635 of file NIImporter_OpenDrive.h.

References myControllers.

Referenced by loadNetwork().

Here is the caller graph for this function:

◆ getFileName()

◆ getJunctions2Controllers()

std::map< std::string, std::vector< std::string > > & NIImporter_OpenDrive::getJunctions2Controllers ( )
inlineprotected

Definition at line 639 of file NIImporter_OpenDrive.h.

References myJunctions2Controllers.

◆ getOrBuildNode()

NBNode * NIImporter_OpenDrive::getOrBuildNode ( const std::string &  id,
const Position pos,
NBNodeCont nc 
)
staticprotected

Builds a node or returns the already built.

If the node is already known, it is returned. Otherwise, the node is built. If the newly built node can not be added to the container, a ProcessError is thrown. Otherwise this node is returned.

Parameters
[in]idThe id of the node to build/get
[in,changed]pos The position of the node to build/get
[filled]nc The node container to retrieve/add the node to
Returns
The retrieved/built node
Exceptions
ProcessErrorIf the node could not be built/retrieved

Definition at line 1423 of file NIImporter_OpenDrive.cpp.

References NBNodeCont::insert(), NBNodeCont::retrieve(), and TLF.

Referenced by loadNetwork().

Here is the caller graph for this function:

◆ getSignals()

std::map< std::string, OpenDriveSignal > & NIImporter_OpenDrive::getSignals ( )
inlineprotected

Definition at line 631 of file NIImporter_OpenDrive.h.

References mySignals.

Referenced by loadNetwork().

Here is the caller graph for this function:

◆ getTLIndexForController()

int NIImporter_OpenDrive::getTLIndexForController ( std::string  controllerID)
inlineprotected

Definition at line 650 of file NIImporter_OpenDrive.h.

References myControllers.

Referenced by loadNetwork().

Here is the caller graph for this function:

◆ getTLSSecure()

NBTrafficLightDefinition * NIImporter_OpenDrive::getTLSSecure ( NBEdge inEdge,
NBNetBuilder nb 
)
staticprotected

Definition at line 1018 of file NIImporter_OpenDrive.cpp.

References NBNode::addTrafficLight(), StringBijection< T >::get(), NBNode::getControllingTLS(), Named::getID(), OptionsCont::getOptions(), NBNetBuilder::getTLLogicCont(), NBEdge::getToNode(), NBTrafficLightLogicCont::insert(), NBNode::isTLControlled(), and SUMOXMLDefinitions::TrafficLightTypes.

Referenced by loadNetwork().

Here is the caller graph for this function:

◆ hasNonLinearElevation()

bool NIImporter_OpenDrive::hasNonLinearElevation ( const OpenDriveEdge e)
staticprotected

Definition at line 1483 of file NIImporter_OpenDrive.cpp.

References NIImporter_OpenDrive::OpenDriveEdge::elevations.

Referenced by computeShapes().

Here is the caller graph for this function:

◆ laneSectionsConnected()

bool NIImporter_OpenDrive::laneSectionsConnected ( OpenDriveEdge edge,
int  in,
int  out 
)
staticprivate

Definition at line 1297 of file NIImporter_OpenDrive.cpp.

References NIImporter_OpenDrive::OpenDriveLaneSection::lanesByDir, NIImporter_OpenDrive::OpenDriveEdge::laneSections, OPENDRIVE_TAG_LEFT, and OPENDRIVE_TAG_RIGHT.

Referenced by buildConnectionsToOuter().

Here is the caller graph for this function:

◆ loadNetwork()

void NIImporter_OpenDrive::loadNetwork ( const OptionsCont oc,
NBNetBuilder nb 
)
static

Loads content of the optionally given SUMO file.

If the option "opendrive-files" is set, the file stored therein is read and the network definition stored therein is stored within the given network builder.

If the option "opendrive-files" is not set, this method simply returns.

The loading is done by parsing the network definition as an XML file using the SAXinterface and handling the incoming data via this class' methods.

Parameters
[in]ocThe options to use
[in]nbThe network builder to fill
Todo:
: One could think of determining whether lane sections may be joined when being equal in SUMO's sense Their naming would have to be updated, too, also in TraCI
Todo:
: probably, the lane offsets to the center are not right

XXX consider lane validity

Definition at line 192 of file NIImporter_OpenDrive.cpp.

References Position::add(), NBEdge::addLane2LaneConnection(), addOffsets(), buildConnectionsToOuter(), computeShapes(), NIImporter_OpenDrive::OpenDriveEdge::connections, NIImporter_OpenDrive::OpenDriveLink::contactPoint, NIImporter_OpenDrive::OpenDriveSignal::controller, NBNodeCont::createClusterId(), NBEdge::Lane::customShape, DEBUG_COND, DEBUG_COND2, DEBUG_COND3, NIImporter_OpenDrive::OpenDriveSignal::dynamic, NIImporter_OpenDrive::OpenDriveLink::elementID, NIImporter_OpenDrive::OpenDriveLink::elementType, NBNodeCont::extract(), NIImporter_OpenDrive::OpenDriveEdge::from, gDebugFlag1, NIImporter_OpenDrive::OpenDriveEdge::geom, OptionsCont::getBool(), PositionVector::getBoxBoundary(), NBEdge::getConnections(), getController(), getControllers(), NBNetBuilder::getEdgeCont(), NBTypeCont::getEdgeTypeSpeed(), OptionsCont::getFloat(), NBEdge::getID(), Named::getID(), NBEdge::getLaneStruct(), NBNetBuilder::getNodeCont(), OptionsCont::getOptions(), getOrBuildNode(), NIImporter_OpenDrive::OpenDriveEdge::getPriority(), getSignals(), OptionsCont::getStringVector(), PositionVector::getSubpart2D(), getTLIndexForController(), getTLSSecure(), NBNetBuilder::getTypeCont(), NIImporter_OpenDrive::OpenDriveController::id, NIImporter_OpenDrive::OpenDriveEdge::id, NBNodeCont::insert(), NBEdgeCont::insert(), OptionsCont::isSet(), OptionsCont::isUsableFileList(), NIImporter_OpenDrive::OpenDriveEdge::junction, KEEPCLEAR_UNSPECIFIED, NIImporter_OpenDrive::OpenDriveEdge::laneOffsets, NIImporter_OpenDrive::OpenDriveEdge::laneSections, NIImporter_OpenDrive::OpenDriveEdge::length, PositionVector::length2D(), NIImporter_OpenDrive::OpenDriveEdge::links, NIImporter_OpenDrive::OpenDriveLink::linkType, PositionVector::move2side(), PositionVector::move2sideCustom(), Position::mul(), myIgnoreMisplacedSignals, myImportAllTypes, myImportInternalShapes, myImportWidths, myMinWidth, NIImporter_OpenDrive::OpenDriveSignal::name, GenericSAXHandler::needsCharacterData(), OPENDRIVE_CP_END, OPENDRIVE_CP_START, OPENDRIVE_ET_ROAD, OPENDRIVE_LT_PREDECESSOR, OPENDRIVE_LT_SUCCESSOR, OPENDRIVE_TAG_LEFT, OPENDRIVE_TAG_RIGHT, PositionVector::positionAtOffset(), PROGRESS_BEGIN_MESSAGE, PROGRESS_DONE_MESSAGE, NBNodeCont::retrieve(), NBEdgeCont::retrieve(), retrieveSignalEdges(), PositionVector::reverse(), revertID(), revisitLaneSections(), RIGHT, XMLSubSys::runParser(), NIImporter_OpenDrive::OpenDriveLaneSection::s, sanitizeWidths(), setEdgeLinks2(), GenericSAXHandler::setFileName(), setLaneAttributes(), setNodeSecure(), NIImporter_OpenDrive::OpenDriveEdge::signals, PositionVector::simplified2(), splitMinWidths(), NIImporter_OpenDrive::OpenDriveEdge::streetName, SUMO_PARAM_ORIGID, std::swap(), TL, TLF, NIImporter_OpenDrive::OpenDriveEdge::to, StringUtils::toInt(), toString(), NIImporter_OpenDrive::OpenDriveSignal::type, UNSET_CONNECTION, NBEdge::UNSPECIFIED_CONTPOS, NBEdge::UNSPECIFIED_FRICTION, NBEdge::UNSPECIFIED_LOADED_LENGTH, NBEdge::UNSPECIFIED_OFFSET, NBEdge::UNSPECIFIED_SPEED, NBEdge::UNSPECIFIED_VISIBILITY_DISTANCE, NBEdge::UNSPECIFIED_WIDTH, NBEdge::USER, NBEdge::VALIDATED, NBEdgeCont::wasIgnored(), WRITE_WARNING, WRITE_WARNINGF, and writeRoadObjects().

Referenced by NILoader::load().

Here is the caller graph for this function:

◆ myCharacters()

void NIImporter_OpenDrive::myCharacters ( int  element,
const std::string &  chars 
)
protectedvirtual

Callback method for characters to implement by derived classes.

Called by "endElement" (see there).

Parameters
[in]elementThe opened element, given as a int
[in]charsThe complete embedded character string @exceptions ProcessError These method may throw a ProcessError if something fails

Reimplemented from GenericSAXHandler.

Definition at line 2685 of file NIImporter_OpenDrive.cpp.

References Boundary::add(), myOffset, GenericSAXHandler::needsCharacterData(), OPENDRIVE_TAG_GEOREFERENCE, GeoConvHelper::setLoaded(), TL, WRITE_ERRORF, and WRITE_WARNINGF.

◆ myEndElement()

◆ myStartElement()

void NIImporter_OpenDrive::myStartElement ( int  element,
const SUMOSAXAttributes attrs 
)
protectedvirtual

Called on the opening of a tag;.

In dependence to the obtained type, an appropriate parsing method is called ("addEdge" if an edge encounters, f.e.).

Parameters
[in]elementID of the currently opened element
[in]attrsAttributes within the currently opened element
Exceptions
ProcessErrorIf something fails
See also
GenericSAXHandler::myStartElement

Reimplemented from GenericSAXHandler.

Definition at line 2270 of file NIImporter_OpenDrive.cpp.

References addGeometryShape(), addLink(), NIImporter_OpenDrive::LaneAttributeChange::allowed, NIImporter_OpenDrive::OpenDriveEdge::connections, DEBUG_COND, NIImporter_OpenDrive::LaneAttributeChange::denied, NIImporter_OpenDrive::OpenDriveEdge::elevations, NIImporter_OpenDrive::Connection::fromEdge, NIImporter_OpenDrive::OpenDriveEdge::geometries, SUMOSAXAttributes::get(), FileHelpers::getConfigurationRelative(), GenericSAXHandler::getFileName(), OptionsCont::getFloat(), GeoConvHelper::getLoaded(), GeoConvHelper::getNumLoaded(), SUMOSAXAttributes::getOpt(), OptionsCont::getOptions(), gPrecision, SUMOSAXAttributes::hasAttribute(), NIImporter_OpenDrive::OpenDriveObject::hdg, NIImporter_OpenDrive::OpenDriveController::id, NIImporter_OpenDrive::OpenDriveObject::id, NIImporter_OpenDrive::OpenDriveEdge::id, FileHelpers::isAbsolute(), NIImporter_OpenDrive::OpenDriveEdge::junction, NIImporter_OpenDrive::OpenDriveLaneSection::lanesByDir, NIImporter_OpenDrive::OpenDriveEdge::laneSections, NIImporter_OpenDrive::OpenDriveObject::length, NIImporter_OpenDrive::OpenDriveEdge::length, MAX2(), GeoConvHelper::moveConvertedBy(), myConnectionWasEmpty, myCurrentConnectingRoad, myCurrentContactPoint, myCurrentController, myCurrentEdge, myCurrentIncomingRoad, myCurrentJunctionID, myCurrentLaneDirection, myEdges, myElementStack, myIgnoreMisplacedSignals, myOffset, mySignals, myUseCurrentNode, NIImporter_OpenDrive::OpenDriveObject::name, NIImporter_OpenDrive::OpenDriveEdge::objects, NIImporter_OpenDrive::OpenDriveEdge::offsets, OPENDRIVE_ATTR_A, OPENDRIVE_ATTR_AU, OPENDRIVE_ATTR_AV, OPENDRIVE_ATTR_B, OPENDRIVE_ATTR_BU, OPENDRIVE_ATTR_BV, OPENDRIVE_ATTR_C, OPENDRIVE_ATTR_CONNECTINGROAD, OPENDRIVE_ATTR_CONTACTPOINT, OPENDRIVE_ATTR_CU, OPENDRIVE_ATTR_CURVATURE, OPENDRIVE_ATTR_CURVEND, OPENDRIVE_ATTR_CURVSTART, OPENDRIVE_ATTR_CV, OPENDRIVE_ATTR_D, OPENDRIVE_ATTR_DISTANCE, OPENDRIVE_ATTR_DU, OPENDRIVE_ATTR_DV, OPENDRIVE_ATTR_DYNAMIC, OPENDRIVE_ATTR_ELEMENTID, OPENDRIVE_ATTR_ELEMENTTYPE, OPENDRIVE_ATTR_FILE, OPENDRIVE_ATTR_FROM, OPENDRIVE_ATTR_FROMLANE, OPENDRIVE_ATTR_HDG, OPENDRIVE_ATTR_ID, OPENDRIVE_ATTR_INCOMINGROAD, OPENDRIVE_ATTR_JUNCTION, OPENDRIVE_ATTR_LENGTH, OPENDRIVE_ATTR_LEVEL, OPENDRIVE_ATTR_MAX, OPENDRIVE_ATTR_NAME, OPENDRIVE_ATTR_ORIENTATION, OPENDRIVE_ATTR_PRANGE, OPENDRIVE_ATTR_RADIUS, OPENDRIVE_ATTR_RESTRICTION, OPENDRIVE_ATTR_REVMAJOR, OPENDRIVE_ATTR_REVMINOR, OPENDRIVE_ATTR_RULE, OPENDRIVE_ATTR_S, OPENDRIVE_ATTR_SIGNALID, OPENDRIVE_ATTR_SOFFSET, OPENDRIVE_ATTR_T, OPENDRIVE_ATTR_TEND, OPENDRIVE_ATTR_TO, OPENDRIVE_ATTR_TOLANE, OPENDRIVE_ATTR_TSTART, OPENDRIVE_ATTR_TYPE, OPENDRIVE_ATTR_UNIT, OPENDRIVE_ATTR_WIDTH, OPENDRIVE_ATTR_WIDTHEND, OPENDRIVE_ATTR_WIDTHSTART, OPENDRIVE_ATTR_X, OPENDRIVE_ATTR_Y, OPENDRIVE_ATTR_Z, OPENDRIVE_CP_END, OPENDRIVE_CP_START, OPENDRIVE_GT_ARC, OPENDRIVE_GT_LINE, OPENDRIVE_GT_PARAMPOLY3, OPENDRIVE_GT_POLY3, OPENDRIVE_GT_SPIRAL, OPENDRIVE_LT_PREDECESSOR, OPENDRIVE_LT_SUCCESSOR, OPENDRIVE_TAG_ACCESS, OPENDRIVE_TAG_ARC, OPENDRIVE_TAG_CENTER, OPENDRIVE_TAG_CONNECTION, OPENDRIVE_TAG_CONTROL, OPENDRIVE_TAG_CONTROLLER, OPENDRIVE_TAG_ELEVATION, OPENDRIVE_TAG_GEOMETRY, OPENDRIVE_TAG_HEADER, OPENDRIVE_TAG_INCLUDE, OPENDRIVE_TAG_JUNCTION, OPENDRIVE_TAG_LANE, OPENDRIVE_TAG_LANELINK, OPENDRIVE_TAG_LANEOFFSET, OPENDRIVE_TAG_LANESECTION, OPENDRIVE_TAG_LEFT, OPENDRIVE_TAG_LINE, OPENDRIVE_TAG_OBJECT, OPENDRIVE_TAG_OFFSET, OPENDRIVE_TAG_PARAMPOLY3, OPENDRIVE_TAG_POLY3, OPENDRIVE_TAG_PREDECESSOR, OPENDRIVE_TAG_REPEAT, OPENDRIVE_TAG_RIGHT, OPENDRIVE_TAG_ROAD, OPENDRIVE_TAG_SIGNAL, OPENDRIVE_TAG_SIGNALREFERENCE, OPENDRIVE_TAG_SPEED, OPENDRIVE_TAG_SPIRAL, OPENDRIVE_TAG_SUCCESSOR, OPENDRIVE_TAG_VALIDITY, OPENDRIVE_TAG_WIDTH, PROGRESS_BEGIN_MESSAGE, PROGRESS_DONE_MESSAGE, NIImporter_OpenDrive::OpenDriveObject::radius, XMLSubSys::runParser(), NIImporter_OpenDrive::OpenDriveObject::s, Position::set(), NIImporter_OpenDrive::OpenDriveController::signalIDs, NIImporter_OpenDrive::OpenDriveEdge::signals, NIImporter_OpenDrive::OpenDriveObject::t, TL, toString(), NIImporter_OpenDrive::OpenDriveObject::type, NIImporter_OpenDrive::OpenDriveObject::width, WRITE_ERRORF, and WRITE_WARNINGF.

◆ needsCharacterData()

void GenericSAXHandler::needsCharacterData ( const bool  value = true)
inlineinherited

Definition at line 220 of file GenericSAXHandler.h.

References GenericSAXHandler::myCollectCharacterData.

Referenced by NIImporter_ITSUMO::loadNetwork(), loadNetwork(), and myCharacters().

Here is the caller graph for this function:

◆ recomputeWidths() [1/2]

void NIImporter_OpenDrive::recomputeWidths ( OpenDriveLaneSection sec,
double  start,
double  end,
double  sectionStart,
double  sectionEnd 
)
staticprotected

Definition at line 3082 of file NIImporter_OpenDrive.cpp.

References NIImporter_OpenDrive::OpenDriveLaneSection::lanesByDir, NIImporter_OpenDrive::OpenDriveLaneSection::leftLaneNumber, OPENDRIVE_TAG_LEFT, OPENDRIVE_TAG_RIGHT, recomputeWidths(), and NIImporter_OpenDrive::OpenDriveLaneSection::rightLaneNumber.

Referenced by recomputeWidths(), and splitMinWidths().

Here is the caller graph for this function:

◆ recomputeWidths() [2/2]

void NIImporter_OpenDrive::recomputeWidths ( std::vector< OpenDriveLane > &  lanes,
double  start,
double  end,
double  sectionStart,
double  sectionEnd 
)
staticprotected

◆ registerParent()

void GenericSAXHandler::registerParent ( const int  tag,
GenericSAXHandler handler 
)
inherited

Assigning a parent handler which is enabled when the specified tag is closed.

Definition at line 178 of file GenericSAXHandler.cpp.

References GenericSAXHandler::myParentHandler, GenericSAXHandler::myParentIndicator, and XMLSubSys::setHandler().

Referenced by NLTriggerBuilder::parseAndBuildCalibrator(), NLTriggerBuilder::parseAndBuildLaneSpeedTrigger(), and NLTriggerBuilder::parseAndBuildRerouter().

Here is the caller graph for this function:

◆ retrieveNextSectionStart()

std::pair< int, SUMOSAXAttributes * > GenericSAXHandler::retrieveNextSectionStart ( )
inlineinherited

Definition at line 213 of file GenericSAXHandler.h.

References GenericSAXHandler::myNextSectionStart.

Referenced by SUMOSAXReader::parseSection().

Here is the caller graph for this function:

◆ retrieveSignalEdges()

std::pair< NBEdge *, NBEdge * > NIImporter_OpenDrive::retrieveSignalEdges ( NBNetBuilder nb,
const std::string &  fromID,
const std::string &  toID,
const std::string &  junction 
)
staticprotected

Definition at line 1002 of file NIImporter_OpenDrive.cpp.

References NBNetBuilder::getEdgeCont(), NBEdge::getFromNode(), Named::getID(), NBEdge::getToNode(), and NBEdgeCont::retrieve().

Referenced by loadNetwork().

Here is the caller graph for this function:

◆ revertID()

std::string NIImporter_OpenDrive::revertID ( const std::string &  id)
staticprivate

Definition at line 1414 of file NIImporter_OpenDrive.cpp.

Referenced by loadNetwork().

Here is the caller graph for this function:

◆ revisitLaneSections()

void NIImporter_OpenDrive::revisitLaneSections ( const NBTypeCont tc,
std::map< std::string, OpenDriveEdge * > &  edges 
)
staticprotected

Rechecks lane sections of the given edges.

Parameters
[in]edgesThe edges which lane sections shall be reviewed

Definition at line 1682 of file NIImporter_OpenDrive.cpp.

References DEBUG_COND, gDebugFlag1, NIImporter_OpenDrive::OpenDriveEdge::id, NIImporter_OpenDrive::OpenDriveEdge::isInner, NIImporter_OpenDrive::OpenDriveEdge::laneSections, TL, toString(), and WRITE_WARNINGF.

Referenced by loadNetwork().

Here is the caller graph for this function:

◆ sanitizeWidths() [1/2]

void NIImporter_OpenDrive::sanitizeWidths ( OpenDriveEdge e)
staticprotected

Definition at line 2845 of file NIImporter_OpenDrive.cpp.

References DEBUG_COND, gDebugFlag1, NIImporter_OpenDrive::OpenDriveEdge::id, NIImporter_OpenDrive::OpenDriveEdge::laneSections, OPENDRIVE_TAG_LEFT, OPENDRIVE_TAG_RIGHT, and sanitizeWidths().

Referenced by loadNetwork(), and sanitizeWidths().

Here is the caller graph for this function:

◆ sanitizeWidths() [2/2]

void NIImporter_OpenDrive::sanitizeWidths ( std::vector< OpenDriveLane > &  lanes,
double  length 
)
staticprotected

Definition at line 2865 of file NIImporter_OpenDrive.cpp.

References MAX2().

◆ sectionFinished()

bool GenericSAXHandler::sectionFinished ( ) const
inlineinherited

Definition at line 209 of file GenericSAXHandler.h.

References GenericSAXHandler::mySectionEnded.

Referenced by SUMOSAXReader::parseSection().

Here is the caller graph for this function:

◆ setEdgeLinks2()

◆ setFileName()

void GenericSAXHandler::setFileName ( const std::string &  name)
inherited

Sets the current file name.

Parameters
[in]nameThe name of the currently processed file
Todo:
Hmmm - this is as unsafe as having a direct access to the variable; recheck

Definition at line 74 of file GenericSAXHandler.cpp.

References GenericSAXHandler::myFileName.

Referenced by NIImporter_SUMO::_loadNetwork(), MSStateHandler::MSStateTimeHandler::getTime(), GUISettingsHandler::GUISettingsHandler(), NIImporter_OpenStreetMap::load(), NIImporter_Vissim::load(), PCNetProjectionLoader::load(), NITypeLoader::load(), loadNet(), ROLoader::loadNet(), NIImporter_ITSUMO::loadNetwork(), NIImporter_MATSim::loadNetwork(), loadNetwork(), main(), and XMLSubSys::runParser().

Here is the caller graph for this function:

◆ setLaneAttributes()

◆ setNodeSecure()

void NIImporter_OpenDrive::setNodeSecure ( NBNodeCont nc,
OpenDriveEdge e,
const std::string &  nodeID,
NIImporter_OpenDrive::LinkType  lt,
std::vector< NodeSet > &  joinedNodeIDs 
)
staticprotected

Definition at line 1437 of file NIImporter_OpenDrive.cpp.

References NIImporter_OpenDrive::OpenDriveEdge::from, OPENDRIVE_LT_SUCCESSOR, NBNodeCont::retrieve(), TLF, and NIImporter_OpenDrive::OpenDriveEdge::to.

Referenced by loadNetwork().

Here is the caller graph for this function:

◆ setSection()

void GenericSAXHandler::setSection ( const int  element,
const bool  seen 
)
inlineinherited

Definition at line 202 of file GenericSAXHandler.h.

References GenericSAXHandler::mySection, GenericSAXHandler::mySectionEnded, GenericSAXHandler::mySectionOpen, and GenericSAXHandler::mySectionSeen.

Referenced by SUMOSAXReader::parseSection().

Here is the caller graph for this function:

◆ setStraightConnections()

void NIImporter_OpenDrive::setStraightConnections ( std::vector< OpenDriveLane > &  lanes)
staticprotected

Definition at line 3074 of file NIImporter_OpenDrive.cpp.

Referenced by splitMinWidths().

Here is the caller graph for this function:

◆ splitMinWidths()

◆ startElement()

void GenericSAXHandler::startElement ( const XMLCh *const  uri,
const XMLCh *const  localname,
const XMLCh *const  qname,
const XERCES_CPP_NAMESPACE::Attributes &  attrs 
)
inherited

The inherited method called when a new tag opens.

The method parses the supplied XMLCh*-qname using the internal name/enum-map to obtain the enum representation of the attribute name.

Then, "myStartElement" is called supplying the enumeration value, the string-representation of the name and the attributes.

Todo:

recheck/describe encoding of the string-representation

do not generate and report the string-representation

Definition at line 99 of file GenericSAXHandler.cpp.

References GenericSAXHandler::convertTag(), FileHelpers::getConfigurationRelative(), GenericSAXHandler::getFileName(), SUMOSAXAttributesImpl_Xerces::getString(), FileHelpers::isAbsolute(), GenericSAXHandler::myCharactersVector, GenericSAXHandler::myExpectedRoot, GenericSAXHandler::myNextSectionStart, GenericSAXHandler::myPredefinedTags, GenericSAXHandler::myPredefinedTagsMML, GenericSAXHandler::myRootSeen, GenericSAXHandler::mySection, GenericSAXHandler::mySectionEnded, GenericSAXHandler::mySectionOpen, GenericSAXHandler::mySectionSeen, GenericSAXHandler::myStartElement(), XMLSubSys::runParser(), SUMO_ATTR_HREF, SUMO_TAG_INCLUDE, TL, StringUtils::transcode(), and WRITE_WARNINGF.

◆ warning()

void GenericSAXHandler::warning ( const XERCES_CPP_NAMESPACE::SAXParseException &  exception)
inherited

Handler for XML-warnings.

The message is built using buildErrorMessage and reported to the warning-instance of the MsgHandler.

Parameters
[in]exceptionThe occurred exception to process

Definition at line 218 of file GenericSAXHandler.cpp.

References GenericSAXHandler::buildErrorMessage(), and WRITE_WARNING.

◆ writeRoadObjects()

Friends And Related Symbol Documentation

◆ operator<

bool operator< ( const Connection c1,
const Connection c2 
)
friend

Definition at line 2830 of file NIImporter_OpenDrive.cpp.

Field Documentation

◆ myCharactersVector

std::vector<std::string> GenericSAXHandler::myCharactersVector
privateinherited

A list of character strings obtained so far to build the complete characters string at the end.

Definition at line 324 of file GenericSAXHandler.h.

Referenced by GenericSAXHandler::characters(), GenericSAXHandler::endElement(), and GenericSAXHandler::startElement().

◆ myCollectCharacterData

bool GenericSAXHandler::myCollectCharacterData = false
privateinherited

whether the reader should collect character data

Definition at line 339 of file GenericSAXHandler.h.

Referenced by GenericSAXHandler::characters(), and GenericSAXHandler::needsCharacterData().

◆ myConnectionWasEmpty

bool NIImporter_OpenDrive::myConnectionWasEmpty
private

Definition at line 689 of file NIImporter_OpenDrive.h.

Referenced by myEndElement(), and myStartElement().

◆ myControllers

std::map<std::string, OpenDriveController> NIImporter_OpenDrive::myControllers
private

◆ myCurrentConnectingRoad

std::string NIImporter_OpenDrive::myCurrentConnectingRoad
private

Definition at line 687 of file NIImporter_OpenDrive.h.

Referenced by myEndElement(), and myStartElement().

◆ myCurrentContactPoint

ContactPoint NIImporter_OpenDrive::myCurrentContactPoint
private

Definition at line 688 of file NIImporter_OpenDrive.h.

Referenced by myEndElement(), and myStartElement().

◆ myCurrentController

OpenDriveController NIImporter_OpenDrive::myCurrentController
private

Definition at line 680 of file NIImporter_OpenDrive.h.

Referenced by myEndElement(), and myStartElement().

◆ myCurrentEdge

OpenDriveEdge NIImporter_OpenDrive::myCurrentEdge
private

Definition at line 679 of file NIImporter_OpenDrive.h.

Referenced by addGeometryShape(), addLink(), myEndElement(), and myStartElement().

◆ myCurrentIncomingRoad

std::string NIImporter_OpenDrive::myCurrentIncomingRoad
private

Definition at line 686 of file NIImporter_OpenDrive.h.

Referenced by myEndElement(), and myStartElement().

◆ myCurrentJunctionID

std::string NIImporter_OpenDrive::myCurrentJunctionID
private

Definition at line 685 of file NIImporter_OpenDrive.h.

Referenced by myStartElement().

◆ myCurrentLaneDirection

OpenDriveXMLTag NIImporter_OpenDrive::myCurrentLaneDirection
private

Definition at line 684 of file NIImporter_OpenDrive.h.

Referenced by myStartElement().

◆ myDummyController

NIImporter_OpenDrive::OpenDriveController NIImporter_OpenDrive::myDummyController
staticprivate

Definition at line 701 of file NIImporter_OpenDrive.h.

Referenced by getController().

◆ myEdges

std::map<std::string, OpenDriveEdge*>& NIImporter_OpenDrive::myEdges
private

Definition at line 682 of file NIImporter_OpenDrive.h.

Referenced by myEndElement(), and myStartElement().

◆ myElementStack

std::vector<int> NIImporter_OpenDrive::myElementStack
private

Definition at line 683 of file NIImporter_OpenDrive.h.

Referenced by myEndElement(), and myStartElement().

◆ myExpectedRoot

std::string GenericSAXHandler::myExpectedRoot
privateinherited

The root element to expect, empty string disables the check.

Definition at line 336 of file GenericSAXHandler.h.

Referenced by GenericSAXHandler::startElement().

◆ myFileName

std::string GenericSAXHandler::myFileName
privateinherited

The name of the currently parsed file.

Definition at line 333 of file GenericSAXHandler.h.

Referenced by GenericSAXHandler::getFileName(), and GenericSAXHandler::setFileName().

◆ myIgnoreMisplacedSignals

bool NIImporter_OpenDrive::myIgnoreMisplacedSignals
staticprivate

Definition at line 700 of file NIImporter_OpenDrive.h.

Referenced by loadNetwork(), myEndElement(), and myStartElement().

◆ myImportAllTypes

bool NIImporter_OpenDrive::myImportAllTypes
staticprivate

◆ myImportInternalShapes

bool NIImporter_OpenDrive::myImportInternalShapes
staticprivate

Definition at line 699 of file NIImporter_OpenDrive.h.

Referenced by buildConnectionsToOuter(), and loadNetwork().

◆ myImportWidths

bool NIImporter_OpenDrive::myImportWidths
staticprivate

Definition at line 697 of file NIImporter_OpenDrive.h.

Referenced by loadNetwork(), and setLaneAttributes().

◆ myJunctions2Controllers

std::map<std::string, std::vector<std::string> > NIImporter_OpenDrive::myJunctions2Controllers
private

Definition at line 692 of file NIImporter_OpenDrive.h.

Referenced by getJunctions2Controllers().

◆ myMinWidth

double NIImporter_OpenDrive::myMinWidth
staticprivate

Definition at line 698 of file NIImporter_OpenDrive.h.

Referenced by findWidthSplit(), loadNetwork(), and setLaneAttributes().

◆ myNextSectionStart

std::pair<int, SUMOSAXAttributes*> GenericSAXHandler::myNextSectionStart
privateinherited

◆ myOffset

Position NIImporter_OpenDrive::myOffset
private

Definition at line 693 of file NIImporter_OpenDrive.h.

Referenced by myCharacters(), and myStartElement().

◆ myParentHandler

GenericSAXHandler* GenericSAXHandler::myParentHandler
privateinherited

The handler to give control back to.

Definition at line 327 of file GenericSAXHandler.h.

Referenced by GenericSAXHandler::callParentEnd(), GenericSAXHandler::endElement(), and GenericSAXHandler::registerParent().

◆ myParentIndicator

int GenericSAXHandler::myParentIndicator
privateinherited

The tag indicating that control should be given back.

Definition at line 330 of file GenericSAXHandler.h.

Referenced by GenericSAXHandler::endElement(), and GenericSAXHandler::registerParent().

◆ myPredefinedTags

AttrMap GenericSAXHandler::myPredefinedTags
privateinherited

◆ myPredefinedTagsMML

std::vector<std::string> GenericSAXHandler::myPredefinedTagsMML
privateinherited

the map from ids to their string representation

Definition at line 309 of file GenericSAXHandler.h.

Referenced by GenericSAXHandler::GenericSAXHandler(), and GenericSAXHandler::startElement().

◆ myRootSeen

bool GenericSAXHandler::myRootSeen = false
privateinherited

whether the reader has already seen the root element

Definition at line 342 of file GenericSAXHandler.h.

Referenced by GenericSAXHandler::startElement().

◆ mySection

int GenericSAXHandler::mySection = -1
privateinherited

The tag indicating the current section to parse.

Definition at line 345 of file GenericSAXHandler.h.

Referenced by GenericSAXHandler::endElement(), GenericSAXHandler::setSection(), and GenericSAXHandler::startElement().

◆ mySectionEnded

bool GenericSAXHandler::mySectionEnded = false
privateinherited

whether the reader has already seen the end of the section

Definition at line 351 of file GenericSAXHandler.h.

Referenced by GenericSAXHandler::sectionFinished(), GenericSAXHandler::setSection(), and GenericSAXHandler::startElement().

◆ mySectionOpen

bool GenericSAXHandler::mySectionOpen = false
privateinherited

whether an element of the current section is open

Definition at line 354 of file GenericSAXHandler.h.

Referenced by GenericSAXHandler::endElement(), GenericSAXHandler::setSection(), and GenericSAXHandler::startElement().

◆ mySectionSeen

bool GenericSAXHandler::mySectionSeen = false
privateinherited

whether the reader has already seen the begin of the section

Definition at line 348 of file GenericSAXHandler.h.

Referenced by GenericSAXHandler::setSection(), and GenericSAXHandler::startElement().

◆ mySignals

std::map<std::string, OpenDriveSignal> NIImporter_OpenDrive::mySignals
private

Definition at line 690 of file NIImporter_OpenDrive.h.

Referenced by getController(), getSignals(), and myStartElement().

◆ myTagMap

TagMap GenericSAXHandler::myTagMap
privateinherited

◆ myTypeContainer

const NBTypeCont& NIImporter_OpenDrive::myTypeContainer
private

Definition at line 678 of file NIImporter_OpenDrive.h.

Referenced by myEndElement().

◆ myUseCurrentNode

bool NIImporter_OpenDrive::myUseCurrentNode
private

Definition at line 694 of file NIImporter_OpenDrive.h.

Referenced by myStartElement().

◆ openDriveAttrs

SequentialStringBijection::Entry NIImporter_OpenDrive::openDriveAttrs
staticprotected

The names of openDrive-XML attributes (for passing to GenericSAXHandler)

Definition at line 116 of file NIImporter_OpenDrive.h.

◆ openDriveTags

SequentialStringBijection::Entry NIImporter_OpenDrive::openDriveTags
staticprotected

The names of openDrive-XML elements (for passing to GenericSAXHandler)

Definition at line 77 of file NIImporter_OpenDrive.h.


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