22 #ifndef NIImporter_OpenDrive_h 23 #define NIImporter_OpenDrive_h 51 #define UNSET_CONNECTION 100000 225 : length(lengthArg), s(sArg), x(xArg), y(yArg), hdg(hdgArg),
248 OpenDriveLane(
int idArg,
const std::string& levelArg,
const std::string& typeArg)
250 speed(0), width(0) { }
257 std::vector<std::pair<SUMOReal, SUMOReal> >
speeds;
291 bool buildSpeedChanges(
const NBTypeCont& tc, std::vector<OpenDriveLaneSection>& newSections);
299 std::map<OpenDriveXMLTag, std::vector<OpenDriveLane> >
lanesByDir;
321 OpenDriveSignal(
int idArg,
const std::string typeArg,
const std::string nameArg,
int orientationArg,
bool dynamicArg,
SUMOReal sArg)
322 : id(idArg), type(typeArg), name(nameArg), orientation(orientationArg), dynamic(dynamicArg), s(sArg) { }
355 OpenDriveEdge(
const std::string& idArg,
const std::string& streetNameArg,
const std::string& junctionArg,
SUMOReal lengthArg) :
357 streetName(streetNameArg),
358 junction(junctionArg),
362 isInner = junction !=
"" && junction !=
"-1";
403 return ls1.
s < ls2.
s;
415 return ps.first == myPosition;
473 static std::string
revertID(
const std::string&
id);
477 std::map<std::string, OpenDriveEdge*>&
myEdges;
520 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
static PositionVector geomFromLine(const OpenDriveEdge &e, const OpenDriveGeometry &g)
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.
GeometryType
OpenDrive geometry type enumeration.
bool operator()(const std::pair< SUMOReal, SUMOReal > &ps)
the comparing function
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.
static PositionVector geomFromArc(const OpenDriveEdge &e, const OpenDriveGeometry &g)
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)
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)
int predecessor
The lane's predecessor lane.
std::string myCurrentConnectingRoad
OpenDriveSignal(int idArg, const std::string typeArg, const std::string nameArg, int orientationArg, bool dynamicArg, SUMOReal sArg)
Constructor.
int successor
The lane's successor lane.
same_position_finder(SUMOReal pos)
constructor
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)
sections_by_s_sorter()
Constructor.
OpenDriveLane(int idArg, const std::string &levelArg, const std::string &typeArg)
Constructor.
std::string level
The lane's level (not used)
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.
const GenericSAXHandler & operator=(const GenericSAXHandler &s)
invalidated assignment operator
std::string type
The lane's type.
Encapsulated SAX-Attributes.
static Position calculateStraightEndPoint(double hdg, double length, const Position &start)
A point in 2D or 3D with translation and scaling methods.
std::string id
The id of the edge.
static void loadNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Loads content of the optionally given SUMO file.
NIImporter_OpenDrive(const NBTypeCont &tc, std::map< std::string, OpenDriveEdge * > &edges)
Constructor.
OpenDriveEdge(const std::string &idArg, const std::string &streetNameArg, const std::string &junctionArg, SUMOReal lengthArg)
const NBTypeCont & myTypeContainer
bool myConnectionWasEmpty
SUMOReal width
The lane's width;.
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 PositionVector geomFromSpiral(const OpenDriveEdge &e, const OpenDriveGeometry &g)
static PositionVector geomFromPoly(const OpenDriveEdge &e, const OpenDriveGeometry &g)
static StringBijection< int >::Entry openDriveTags[]
The names of openDrive-XML elements (for passing to GenericSAXHandler)
static bool myImportAllTypes
std::vector< OpenDriveSignal > signals
LinkType
OpenDrive link type enumeration.
static void computeShapes(std::map< std::string, OpenDriveEdge * > &edges)
Computes a polygon representation of each edge's geometry.
~NIImporter_OpenDrive()
Destructor.
SUMOReal speed
The lane's speed (set in post-processing)
Instance responsible for building networks.
Representation of an OpenDrive geometry part.
A storage for options typed value containers)
SUMOReal myPosition
The position to search for.
unsigned int rightLaneNumber
The number of lanes on the right and on the left side, respectively.
static void setEdgeLinks2(OpenDriveEdge &e, const std::map< std::string, OpenDriveEdge * > &edges)
std::vector< OpenDriveGeometry > geometries
Represents a single node (junction) during network building.
A class for sorting lane sections by their s-value.
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.
Importer for networks stored in openDrive format.
std::string myCurrentIncomingRoad
int operator()(const OpenDriveLaneSection &ls1, const OpenDriveLaneSection &ls2)
Sorting function; compares OpenDriveLaneSection::s.
std::vector< std::pair< SUMOReal, SUMOReal > > speeds
List of positions/speeds of speed changes.
A storage for available types of edges.
std::string streetName
The road name of the edge.
void myEndElement(int element)
Called when a closing tag occurs.
static void revisitLaneSections(const NBTypeCont &tc, std::map< std::string, OpenDriveEdge * > &edges)
Rechecks lane sections of the given edges.