SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NIImporter_OpenDrive Class Reference

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

#include <NIImporter_OpenDrive.h>

Inheritance diagram for NIImporter_OpenDrive:
GenericSAXHandler

Data Structures

struct  Connection
 A connection between two roads. 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  OpenDriveSignal
 Representation of a signal. More...
 
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 occured. More...
 
void endElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname)
 The inherited method called when a tag is being closed. More...
 
const std::string & getFileName () const
 returns the current file name More...
 
void registerParent (const int tag, GenericSAXHandler *handler)
 Assigning a parent handler which is enabled when the specified tag is closed. More...
 
void setFileName (const std::string &name)
 Sets the current file name. More...
 
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. More...
 
SAX ErrorHandler callbacks
void warning (const XERCES_CPP_NAMESPACE::SAXParseException &exception)
 Handler for XML-warnings. More...
 
void error (const XERCES_CPP_NAMESPACE::SAXParseException &exception)
 Handler for XML-errors. More...
 
void fatalError (const XERCES_CPP_NAMESPACE::SAXParseException &exception)
 Handler for XML-errors. More...
 

Static Public Member Functions

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

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 geometry type enumeration. More...
 
enum  LinkType { OPENDRIVE_LT_SUCCESSOR, OPENDRIVE_LT_PREDECESSOR }
 OpenDrive link type enumeration. More...
 
enum  OpenDriveXMLAttr {
  OPENDRIVE_ATTR_NOTHING, OPENDRIVE_ATTR_REVMAJOR, OPENDRIVE_ATTR_REVMINOR, OPENDRIVE_ATTR_ID,
  OPENDRIVE_ATTR_LENGTH, OPENDRIVE_ATTR_JUNCTION, OPENDRIVE_ATTR_ELEMENTTYPE, OPENDRIVE_ATTR_ELEMENTID,
  OPENDRIVE_ATTR_CONTACTPOINT, OPENDRIVE_ATTR_S, OPENDRIVE_ATTR_X, OPENDRIVE_ATTR_Y,
  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_TYPE, OPENDRIVE_ATTR_LEVEL, OPENDRIVE_ATTR_ORIENTATION, OPENDRIVE_ATTR_DYNAMIC,
  OPENDRIVE_ATTR_INCOMINGROAD, OPENDRIVE_ATTR_CONNECTINGROAD, OPENDRIVE_ATTR_FROM, OPENDRIVE_ATTR_TO,
  OPENDRIVE_ATTR_MAX, OPENDRIVE_ATTR_SOFFSET, OPENDRIVE_ATTR_NAME
}
 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_LANESECTION, OPENDRIVE_TAG_LEFT,
  OPENDRIVE_TAG_CENTER, OPENDRIVE_TAG_RIGHT, OPENDRIVE_TAG_LANE, OPENDRIVE_TAG_SIGNAL,
  OPENDRIVE_TAG_JUNCTION, OPENDRIVE_TAG_CONNECTION, OPENDRIVE_TAG_LANELINK, OPENDRIVE_TAG_WIDTH,
  OPENDRIVE_TAG_SPEED
}
 Numbers representing openDrive-XML - element names. More...
 

Protected Member Functions

std::string buildErrorMessage (const XERCES_CPP_NAMESPACE::SAXParseException &exception)
 Builds an error message. More...
 
virtual void myCharacters (int element, const std::string &chars)
 Callback method for characters to implement by derived classes. More...
 
 NIImporter_OpenDrive (const NBTypeCont &tc, std::map< std::string, OpenDriveEdge * > &edges)
 Constructor. More...
 
 ~NIImporter_OpenDrive ()
 Destructor. More...
 
inherited from GenericSAXHandler
void myStartElement (int element, const SUMOSAXAttributes &attrs)
 Called on the opening of a tag;. More...
 
void myEndElement (int element)
 Called when a closing tag occurs. More...
 

Static Protected Member Functions

static void calcPointOnCurve (SUMOReal *ad_x, SUMOReal *ad_y, SUMOReal ad_centerX, SUMOReal ad_centerY, SUMOReal ad_r, SUMOReal ad_length)
 
static void calculateCurveCenter (SUMOReal *ad_x, SUMOReal *ad_y, SUMOReal ad_radius, SUMOReal ad_hdg)
 
static Position calculateStraightEndPoint (double hdg, double length, const Position &start)
 
static void computeShapes (std::map< std::string, OpenDriveEdge * > &edges)
 Computes a polygon representation of each edge's geometry. More...
 
static std::vector< PositiongeomFromArc (const OpenDriveEdge &e, const OpenDriveGeometry &g)
 
static std::vector< PositiongeomFromLine (const OpenDriveEdge &e, const OpenDriveGeometry &g)
 
static std::vector< PositiongeomFromPoly (const OpenDriveEdge &e, const OpenDriveGeometry &g)
 
static std::vector< PositiongeomFromSpiral (const OpenDriveEdge &e, const OpenDriveGeometry &g)
 
static NBNodegetOrBuildNode (const std::string &id, const Position &pos, NBNodeCont &nc)
 Builds a node or returns the already built. More...
 
static void revisitLaneSections (const NBTypeCont &tc, std::map< std::string, OpenDriveEdge * > &edges)
 Rechecks lane sections of the given edges. More...
 
static void setNodeSecure (NBNodeCont &nc, OpenDriveEdge &e, const std::string &nodeID, NIImporter_OpenDrive::LinkType lt)
 

Static Protected Attributes

static StringBijection< int >
::Entry 
openDriveAttrs []
 The names of openDrive-XML attributes (for passing to GenericSAXHandler) More...
 
static StringBijection< int >
::Entry 
openDriveTags []
 The names of openDrive-XML elements (for passing to GenericSAXHandler) More...
 

Private Member Functions

void addGeometryShape (GeometryType type, const std::vector< SUMOReal > &vals)
 
void addLink (LinkType lt, const std::string &elementType, const std::string &elementID, const std::string &contactPoint)
 

Static Private Member Functions

static void buildConnectionsToOuter (const Connection &c, const std::map< std::string, OpenDriveEdge * > &innerEdges, std::vector< Connection > &into)
 
static std::string revertID (const std::string &id)
 
static void setEdgeLinks2 (OpenDriveEdge &e, const std::map< std::string, OpenDriveEdge * > &edges)
 

Private Attributes

bool myConnectionWasEmpty
 
std::string myCurrentConnectingRoad
 
ContactPoint myCurrentContactPoint
 
OpenDriveEdge myCurrentEdge
 
std::string myCurrentIncomingRoad
 
std::string myCurrentJunctionID
 
OpenDriveXMLTag myCurrentLaneDirection
 
std::map< std::string,
OpenDriveEdge * > & 
myEdges
 
std::vector< intmyElementStack
 
const NBTypeContmyTypeContainer
 

Static Private Attributes

static bool myImportAllTypes
 
static bool myImportWidths
 

Friends

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

Detailed Description

Importer for networks stored in openDrive format.

Definition at line 61 of file NIImporter_OpenDrive.h.

Member Enumeration Documentation

OpenDrive contact type enumeration.

Enumerator
OPENDRIVE_CP_UNKNOWN 
OPENDRIVE_CP_START 
OPENDRIVE_CP_END 

Definition at line 174 of file NIImporter_OpenDrive.h.

OpenDrive element type enumeration.

Enumerator
OPENDRIVE_ET_UNKNOWN 
OPENDRIVE_ET_ROAD 
OPENDRIVE_ET_JUNCTION 

Definition at line 165 of file NIImporter_OpenDrive.h.

OpenDrive geometry type enumeration.

Enumerator
OPENDRIVE_GT_UNKNOWN 
OPENDRIVE_GT_LINE 
OPENDRIVE_GT_SPIRAL 
OPENDRIVE_GT_ARC 
OPENDRIVE_GT_POLY3 

Definition at line 182 of file NIImporter_OpenDrive.h.

OpenDrive link type enumeration.

Enumerator
OPENDRIVE_LT_SUCCESSOR 
OPENDRIVE_LT_PREDECESSOR 

Definition at line 157 of file NIImporter_OpenDrive.h.

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_JUNCTION 
OPENDRIVE_ATTR_ELEMENTTYPE 
OPENDRIVE_ATTR_ELEMENTID 
OPENDRIVE_ATTR_CONTACTPOINT 
OPENDRIVE_ATTR_S 
OPENDRIVE_ATTR_X 
OPENDRIVE_ATTR_Y 
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_TYPE 
OPENDRIVE_ATTR_LEVEL 
OPENDRIVE_ATTR_ORIENTATION 
OPENDRIVE_ATTR_DYNAMIC 
OPENDRIVE_ATTR_INCOMINGROAD 
OPENDRIVE_ATTR_CONNECTINGROAD 
OPENDRIVE_ATTR_FROM 
OPENDRIVE_ATTR_TO 
OPENDRIVE_ATTR_MAX 
OPENDRIVE_ATTR_SOFFSET 
OPENDRIVE_ATTR_NAME 

Definition at line 120 of file NIImporter_OpenDrive.h.

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_LANESECTION 
OPENDRIVE_TAG_LEFT 
OPENDRIVE_TAG_CENTER 
OPENDRIVE_TAG_RIGHT 
OPENDRIVE_TAG_LANE 
OPENDRIVE_TAG_SIGNAL 
OPENDRIVE_TAG_JUNCTION 
OPENDRIVE_TAG_CONNECTION 
OPENDRIVE_TAG_LANELINK 
OPENDRIVE_TAG_WIDTH 
OPENDRIVE_TAG_SPEED 

Definition at line 88 of file NIImporter_OpenDrive.h.

Constructor & Destructor Documentation

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 1215 of file NIImporter_OpenDrive.cpp.

NIImporter_OpenDrive::~NIImporter_OpenDrive ( )
protected

Destructor.

Definition at line 1221 of file NIImporter_OpenDrive.cpp.

Member Function Documentation

void NIImporter_OpenDrive::addLink ( LinkType  lt,
const std::string &  elementType,
const std::string &  elementID,
const std::string &  contactPoint 
)
private
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 193 of file GenericSAXHandler.cpp.

References GenericSAXHandler::getFileName().

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

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

Definition at line 1011 of file NIImporter_OpenDrive.cpp.

Referenced by geomFromArc().

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

Definition at line 983 of file NIImporter_OpenDrive.cpp.

References SUMOReal.

Referenced by geomFromArc().

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

Definition at line 971 of file NIImporter_OpenDrive.cpp.

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

Referenced by geomFromLine().

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

The inherited method called when characters occured.

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 176 of file GenericSAXHandler.cpp.

References TplConvert::_2str(), and GenericSAXHandler::myCharactersVector.

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 126 of file GenericSAXHandler.cpp.

References TplConvert::_2str(), GenericSAXHandler::convertTag(), GenericSAXHandler::myCharacters(), GenericSAXHandler::myCharactersVector, GenericSAXHandler::myEndElement(), GenericSAXHandler::myParentHandler, GenericSAXHandler::myParentIndicator, XMLSubSys::setHandler(), SUMO_TAG_INCLUDE, and SUMO_TAG_NOTHING.

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 occured exception to process
Exceptions
ProcessErrorOn any call

Definition at line 212 of file GenericSAXHandler.cpp.

References GenericSAXHandler::buildErrorMessage().

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 occured exception to process

Definition at line 218 of file GenericSAXHandler.cpp.

References GenericSAXHandler::buildErrorMessage().

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 751 of file NIImporter_OpenDrive.cpp.

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

Referenced by 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

Definition at line 146 of file NIImporter_OpenDrive.cpp.

References NBEdge::addLane2LaneConnection(), Parameterised::addParameter(), NBNode::addTrafficLight(), buildConnectionsToOuter(), computeShapes(), NIImporter_OpenDrive::OpenDriveLink::contactPoint, NIImporter_OpenDrive::OpenDriveLink::elementID, NIImporter_OpenDrive::OpenDriveLink::elementType, FileHelpers::exists(), OptionsCont::exists(), NIImporter_OpenDrive::OpenDriveEdge::from, NIImporter_OpenDrive::OpenDriveEdge::geom, StringBijection< T >::get(), OptionsCont::getBool(), PositionVector::getBoxBoundary(), NBEdge::getConnections(), NBNode::getControllingTLS(), NBNetBuilder::getEdgeCont(), Named::getID(), NBEdge::getLaneStruct(), NBNetBuilder::getNodeCont(), OptionsCont::getOptions(), getOrBuildNode(), NBTypeCont::getPermissions(), NIImporter_OpenDrive::OpenDriveEdge::getPriority(), NBTypeCont::getSpeed(), OptionsCont::getStringVector(), PositionVector::getSubpart2D(), NBNetBuilder::getTLLogicCont(), NBEdge::getToNode(), NBNetBuilder::getTypeCont(), NBTypeCont::getWidth(), NIImporter_OpenDrive::OpenDriveEdge::id, NBNodeCont::insert(), NBTypeCont::insert(), NBTrafficLightLogicCont::insert(), NBEdgeCont::insert(), OptionsCont::isSet(), NBNode::isTLControlled(), OptionsCont::isUsableFileList(), NIImporter_OpenDrive::OpenDriveEdge::junction, NBEdge::L2L_USER, NBEdge::L2L_VALIDATED, NIImporter_OpenDrive::OpenDriveEdge::laneSections, LANESPREAD_RIGHT, NIImporter_OpenDrive::OpenDriveEdge::length, PositionVector::length2D(), NIImporter_OpenDrive::OpenDriveEdge::links, NIImporter_OpenDrive::OpenDriveLink::linkType, myImportAllTypes, myImportWidths, OPENDRIVE_CP_END, OPENDRIVE_CP_START, OPENDRIVE_ET_ROAD, OPENDRIVE_LT_PREDECESSOR, OPENDRIVE_LT_SUCCESSOR, OPENDRIVE_TAG_LEFT, OPENDRIVE_TAG_RIGHT, NBEdge::Lane::origID, NBEdge::Lane::permissions, PositionVector::positionAtOffset(), PROGRESS_BEGIN_MESSAGE, PROGRESS_DONE_MESSAGE, NBEdgeCont::retrieve(), NBNodeCont::retrieve(), PositionVector::reverse(), revertID(), revisitLaneSections(), XMLSubSys::runParser(), NIImporter_OpenDrive::OpenDriveLaneSection::s, setEdgeLinks2(), GenericSAXHandler::setFileName(), setNodeSecure(), NIImporter_OpenDrive::OpenDriveEdge::signals, NBEdge::Lane::speed, NIImporter_OpenDrive::OpenDriveLane::speed, SUMOReal, SVC_PEDESTRIAN, NIImporter_OpenDrive::OpenDriveEdge::to, toString(), SUMOXMLDefinitions::TrafficLightTypes, NIImporter_OpenDrive::OpenDriveLane::type, OptionsCont::unSet(), UNSET_CONNECTION, NBEdge::UNSPECIFIED_OFFSET, NBEdge::UNSPECIFIED_WIDTH, NBEdge::Lane::width, NIImporter_OpenDrive::OpenDriveLane::width, WRITE_ERROR, and WRITE_WARNING.

Referenced by NILoader::load().

void GenericSAXHandler::myCharacters ( int  element,
const std::string &  chars 
)
protectedvirtualinherited

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 ProcessError These method may throw a ProcessError if something fails

Reimplemented in NIImporter_ITSUMO::Handler.

Definition at line 228 of file GenericSAXHandler.cpp.

Referenced by GenericSAXHandler::endElement().

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 1226 of file NIImporter_OpenDrive.cpp.

References addGeometryShape(), addLink(), NIImporter_OpenDrive::OpenDriveEdge::connections, NIImporter_OpenDrive::Connection::fromEdge, NIImporter_OpenDrive::OpenDriveEdge::geometries, SUMOSAXAttributes::get(), GenericSAXHandler::getFileName(), SUMOSAXAttributes::getOpt(), SUMOSAXAttributes::hasAttribute(), NIImporter_OpenDrive::OpenDriveEdge::id, NIImporter_OpenDrive::OpenDriveEdge::laneSections, MAX2(), myConnectionWasEmpty, myCurrentConnectingRoad, myCurrentContactPoint, myCurrentEdge, myCurrentIncomingRoad, myCurrentJunctionID, myCurrentLaneDirection, myEdges, myElementStack, OPENDRIVE_ATTR_A, OPENDRIVE_ATTR_B, OPENDRIVE_ATTR_C, OPENDRIVE_ATTR_CONNECTINGROAD, OPENDRIVE_ATTR_CONTACTPOINT, OPENDRIVE_ATTR_CURVATURE, OPENDRIVE_ATTR_CURVEND, OPENDRIVE_ATTR_CURVSTART, OPENDRIVE_ATTR_D, OPENDRIVE_ATTR_DYNAMIC, OPENDRIVE_ATTR_ELEMENTID, OPENDRIVE_ATTR_ELEMENTTYPE, OPENDRIVE_ATTR_FROM, 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_REVMAJOR, OPENDRIVE_ATTR_REVMINOR, OPENDRIVE_ATTR_S, OPENDRIVE_ATTR_SOFFSET, OPENDRIVE_ATTR_TO, OPENDRIVE_ATTR_TYPE, OPENDRIVE_ATTR_X, OPENDRIVE_ATTR_Y, OPENDRIVE_CP_END, OPENDRIVE_CP_START, OPENDRIVE_GT_ARC, OPENDRIVE_GT_LINE, OPENDRIVE_GT_POLY3, OPENDRIVE_GT_SPIRAL, OPENDRIVE_LT_PREDECESSOR, OPENDRIVE_LT_SUCCESSOR, OPENDRIVE_TAG_ARC, OPENDRIVE_TAG_CENTER, OPENDRIVE_TAG_CONNECTION, OPENDRIVE_TAG_GEOMETRY, OPENDRIVE_TAG_HEADER, OPENDRIVE_TAG_JUNCTION, OPENDRIVE_TAG_LANE, OPENDRIVE_TAG_LANELINK, OPENDRIVE_TAG_LANESECTION, OPENDRIVE_TAG_LEFT, OPENDRIVE_TAG_LINE, OPENDRIVE_TAG_POLY3, OPENDRIVE_TAG_PREDECESSOR, OPENDRIVE_TAG_RIGHT, OPENDRIVE_TAG_ROAD, OPENDRIVE_TAG_SIGNAL, OPENDRIVE_TAG_SPEED, OPENDRIVE_TAG_SPIRAL, OPENDRIVE_TAG_SUCCESSOR, OPENDRIVE_TAG_WIDTH, NIImporter_OpenDrive::OpenDriveEdge::signals, SUMOReal, toString(), WRITE_ERROR, and WRITE_WARNING.

void GenericSAXHandler::registerParent ( const int  tag,
GenericSAXHandler handler 
)
inherited
std::string NIImporter_OpenDrive::revertID ( const std::string &  id)
staticprivate

Definition at line 743 of file NIImporter_OpenDrive.cpp.

Referenced by loadNetwork().

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 833 of file NIImporter_OpenDrive.cpp.

References NIImporter_OpenDrive::OpenDriveEdge::id, NIImporter_OpenDrive::OpenDriveEdge::laneSections, POSITION_EPS, SUMOReal, toString(), and WRITE_WARNING.

Referenced by loadNetwork().

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 80 of file GenericSAXHandler.cpp.

References GenericSAXHandler::myFileName.

Referenced by NIImporter_SUMO::_loadNetwork(), GUISettingsHandler::GUISettingsHandler(), PCNetProjectionLoader::load(), NIImporter_OpenStreetMap::load(), loadNet(), ROLoader::loadNet(), NIImporter_ITSUMO::loadNetwork(), NIImporter_MATSim::loadNetwork(), loadNetwork(), and XMLSubSys::runParser().

void NIImporter_OpenDrive::setNodeSecure ( NBNodeCont nc,
OpenDriveEdge e,
const std::string &  nodeID,
NIImporter_OpenDrive::LinkType  lt 
)
staticprotected
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 105 of file GenericSAXHandler.cpp.

References TplConvert::_2str(), GenericSAXHandler::convertTag(), FileHelpers::getConfigurationRelative(), GenericSAXHandler::getFileName(), SUMOSAXAttributesImpl_Xerces::getString(), FileHelpers::isAbsolute(), GenericSAXHandler::myCharactersVector, GenericSAXHandler::myPredefinedTags, GenericSAXHandler::myPredefinedTagsMML, GenericSAXHandler::myStartElement(), XMLSubSys::runParser(), SUMO_ATTR_HREF, and SUMO_TAG_INCLUDE.

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 occured exception to process

Definition at line 206 of file GenericSAXHandler.cpp.

References GenericSAXHandler::buildErrorMessage(), and WRITE_WARNING.

Friends And Related Function Documentation

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

Definition at line 1477 of file NIImporter_OpenDrive.cpp.

Field Documentation

bool NIImporter_OpenDrive::myConnectionWasEmpty
private

Definition at line 478 of file NIImporter_OpenDrive.h.

Referenced by myEndElement(), and myStartElement().

std::string NIImporter_OpenDrive::myCurrentConnectingRoad
private

Definition at line 476 of file NIImporter_OpenDrive.h.

Referenced by myEndElement(), and myStartElement().

ContactPoint NIImporter_OpenDrive::myCurrentContactPoint
private

Definition at line 477 of file NIImporter_OpenDrive.h.

Referenced by myEndElement(), and myStartElement().

OpenDriveEdge NIImporter_OpenDrive::myCurrentEdge
private

Definition at line 469 of file NIImporter_OpenDrive.h.

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

std::string NIImporter_OpenDrive::myCurrentIncomingRoad
private

Definition at line 475 of file NIImporter_OpenDrive.h.

Referenced by myEndElement(), and myStartElement().

std::string NIImporter_OpenDrive::myCurrentJunctionID
private

Definition at line 474 of file NIImporter_OpenDrive.h.

Referenced by myStartElement().

OpenDriveXMLTag NIImporter_OpenDrive::myCurrentLaneDirection
private

Definition at line 473 of file NIImporter_OpenDrive.h.

Referenced by myStartElement().

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

Definition at line 471 of file NIImporter_OpenDrive.h.

Referenced by myEndElement(), and myStartElement().

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

Definition at line 472 of file NIImporter_OpenDrive.h.

Referenced by myEndElement(), and myStartElement().

bool NIImporter_OpenDrive::myImportAllTypes
staticprivate
bool NIImporter_OpenDrive::myImportWidths
staticprivate

Definition at line 481 of file NIImporter_OpenDrive.h.

Referenced by loadNetwork().

const NBTypeCont& NIImporter_OpenDrive::myTypeContainer
private

Definition at line 468 of file NIImporter_OpenDrive.h.

Referenced by myEndElement().

StringBijection< int >::Entry NIImporter_OpenDrive::openDriveAttrs
staticprotected

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

Definition at line 533 of file NIImporter_OpenDrive.h.


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