22 #ifndef NIImporter_OpenDrive_h
23 #define NIImporter_OpenDrive_h
51 #define UNSET_CONNECTION 100000
223 :
length(lengthArg),
s(sArg),
x(xArg),
y(yArg),
hdg(hdgArg),
246 OpenDriveLane(
int idArg,
const std::string& levelArg,
const std::string& typeArg)
294 std::map<OpenDriveXMLTag, std::vector<OpenDriveLane> >
lanesByDir;
415 void addLink(
LinkType lt,
const std::string& elementType,
const std::string& elementID,
416 const std::string& contactPoint);
421 static std::string
revertID(
const std::string&
id);
424 std::map<std::string, OpenDriveEdge*>&
myEdges;
464 static void computeShapes(std::map<std::string, OpenDriveEdge*>& edges);
std::map< std::string, OpenDriveEdge * > & myEdges
ContactPoint contactPoint
static void calculateCurveCenter(SUMOReal *ad_x, SUMOReal *ad_y, SUMOReal ad_radius, SUMOReal ad_hdg)
std::vector< int > myElementStack
void buildLaneMapping()
Build the mapping from OpenDrive to SUMO lanes.
static StringBijection< int >::Entry openDriveAttrs[]
The names of openDrive-XML attributes (for passing to GenericSAXHandler)
void addLink(LinkType lt, const std::string &elementType, const std::string &elementID, const std::string &contactPoint)
Representation of an OpenDrive link.
OpenDriveLink(LinkType linkTypeArg, const std::string &elementIDArg)
Constructor.
OpenDriveXMLAttr
Numbers representing openDrive-XML - attributes.
ContactPoint
OpenDrive contact type enumeration.
std::string junction
The id of the junction the edge belongs to.
OpenDriveSignal(int idArg, const std::string typeArg, int orientationArg, bool dynamicArg, SUMOReal sArg)
Constructor.
GeometryType
OpenDrive geometry type enumeration.
static std::vector< Position > geomFromPoly(const OpenDriveEdge &e, const OpenDriveGeometry &g)
static void buildConnectionsToOuter(const Connection &c, const std::map< std::string, OpenDriveEdge * > &innerEdges, std::vector< Connection > &into)
Representation of a lane section.
The representation of a single edge during network building.
Representation of an openDrive "link".
ContactPoint myCurrentContactPoint
SUMOReal s
The starting offset of this lane section.
std::map< OpenDriveXMLTag, std::vector< OpenDriveLane > > lanesByDir
The lanes, sorted by their direction.
std::set< Connection > connections
Representation of a signal.
friend bool operator<(const Connection &c1, const Connection &c2)
unsigned int getLaneNumber(OpenDriveXMLTag dir) const
Returns the number of lanes for the given direction.
OpenDriveEdge myCurrentEdge
static NBNode * getOrBuildNode(const std::string &id, const Position &pos, NBNodeCont &nc)
Builds a node or returns the already built.
static std::string revertID(const std::string &id)
std::string myCurrentConnectingRoad
Representation of a lane.
OpenDriveXMLTag myCurrentLaneDirection
static void calcPointOnCurve(SUMOReal *ad_x, SUMOReal *ad_y, SUMOReal ad_centerX, SUMOReal ad_centerY, SUMOReal ad_r, SUMOReal ad_length)
OpenDriveLane(int idArg, const std::string &levelArg, const std::string &typeArg)
Constructor.
std::vector< OpenDriveLink > links
A handler which converts occuring elements and attributes into enums.
OpenDriveGeometry(SUMOReal lengthArg, SUMOReal sArg, SUMOReal xArg, SUMOReal yArg, SUMOReal hdgArg)
Constructor.
int getPriority(OpenDriveXMLTag dir) const
Encapsulated SAX-Attributes.
static Position calculateStraightEndPoint(double hdg, double length, const Position &start)
A point in 2D or 3D with translation and scaling methods.
unsigned int getMaxLaneNumber(OpenDriveXMLTag dir) const
std::string id
The id of the edge.
static void loadNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Loads content of the optionally given SUMO file.
bool myConnectionWasEmpty
std::string myCurrentJunctionID
std::vector< OpenDriveLaneSection > laneSections
std::map< int, int > laneMap
A mapping from OpenDrive to SUMO-index (the first is signed, the second unsigned) ...
std::string sumoID
The id (generic, without the optionally leading '-') of the edge generated for this section...
ElementType
OpenDrive element type enumeration.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
OpenDriveXMLTag
Numbers representing openDrive-XML - element names.
static bool myImportWidths
static StringBijection< int >::Entry openDriveTags[]
The names of openDrive-XML elements (for passing to GenericSAXHandler)
static bool myImportAllTypes
static std::vector< Position > geomFromLine(const OpenDriveEdge &e, const OpenDriveGeometry &g)
std::vector< OpenDriveSignal > signals
LinkType
OpenDrive link type enumeration.
static void computeShapes(std::map< std::string, OpenDriveEdge * > &edges)
~NIImporter_OpenDrive()
Destructor.
std::map< int, int > getInnerConnections(OpenDriveXMLTag dir, const OpenDriveLaneSection &prev)
Instance responsible for building networks.
Representation of an OpenDrive geometry part.
A storage for options typed value containers)
static std::set< std::string > myLaneTypes2Import
static void setEdgeLinks2(OpenDriveEdge &e, const std::map< std::string, OpenDriveEdge * > &edges)
std::vector< OpenDriveGeometry > geometries
Represents a single node (junction) during network building.
static void setNodeSecure(NBNodeCont &nc, OpenDriveEdge &e, const std::string &nodeID, NIImporter_OpenDrive::LinkType lt)
A connection between two roads.
std::vector< SUMOReal > params
void addGeometryShape(GeometryType type, const std::vector< SUMOReal > &vals)
Container for nodes during the netbuilding process.
SUMOReal length
The length of the edge.
static std::vector< Position > geomFromArc(const OpenDriveEdge &e, const OpenDriveGeometry &g)
Importer for networks stored in openDrive format.
std::string myCurrentIncomingRoad
OpenDriveLaneSection(SUMOReal sArg)
Constructor.
OpenDriveEdge(const std::string &idArg, const std::string &junctionArg, SUMOReal lengthArg)
static std::vector< Position > geomFromSpiral(const OpenDriveEdge &e, const OpenDriveGeometry &g)
NIImporter_OpenDrive(std::map< std::string, OpenDriveEdge * > &edges)
Constructor.
void myEndElement(int element)
Called when a closing tag occurs.