diff --git a/Help/images/parking_parallel.png b/Help/images/parking_parallel.png new file mode 100644 index 0000000000000000000000000000000000000000..5927af68000a633d69865d0833942ab2ed522c13 Binary files /dev/null and b/Help/images/parking_parallel.png differ diff --git a/Help/images/parking_perpendicular.png b/Help/images/parking_perpendicular.png new file mode 100644 index 0000000000000000000000000000000000000000..f4caea4438e14f08261179ad0a24f9eb55a8abc8 Binary files /dev/null and b/Help/images/parking_perpendicular.png differ diff --git a/OpenRoadEd/OpenDrive/ObjectSignal.cpp b/OpenRoadEd/OpenDrive/ObjectSignal.cpp index b71539b99b13a09a2425d2d06b76e17689473219..81db8095651bcd5ed41eb3f3d1afda5b9b5c830c 100644 --- a/OpenRoadEd/OpenDrive/ObjectSignal.cpp +++ b/OpenRoadEd/OpenDrive/ObjectSignal.cpp @@ -17,6 +17,9 @@ Object::Object() mRoll=0.0; mBoundingBox=false; mBoundingCylinder=false; + mParkingAccess="all"; + mParkingRestrictions="none"; + mParkingMarkings.clear(); } Object::Object(std::string &name,std::string &id) @@ -35,6 +38,9 @@ Object::Object(std::string &name,std::string &id) mRoll=0.0; mBoundingBox=false; mBoundingCylinder=false; + mParkingAccess="all"; + mParkingRestrictions="none"; + mParkingMarkings.clear(); } Object::Object(const Object &object) @@ -64,6 +70,9 @@ Object::Object(const Object &object) mBounding.cylinder.radius=object.mBounding.cylinder.radius; mBounding.cylinder.height=object.mBounding.cylinder.height; } + mParkingAccess=object.mParkingAccess; + mParkingRestrictions=object.mParkingRestrictions; + mParkingMarkings=object.mParkingMarkings; } const Object &Object::operator=(const Object &rhs) @@ -185,6 +194,49 @@ bool Object::GetBoundingCylinder(double &radius,double &height) return mBoundingCylinder; } + +std::string Object::GetParkingAccess(void) +{ + if(this->mType=="parkingSpace") + return this->mParkingAccess; + else + return std::string(""); +} + +std::string Object::GetParkingRestrictions(void) +{ + if(this->mType=="parkingSpace") + return this->mParkingRestrictions; + else + return std::string(""); +} + +unsigned int Object::GetNumParkingMarkings(void) +{ + if(this->mType=="parkingSpace") + return this->mParkingMarkings.size(); + else + return 0; +} + +bool Object::GetParkingMarking(unsigned int index,std::string &side, std::string &type, double &width,std::string &color) +{ + if(this->mType=="parkingSpace") + { + if(index>=0 && index<mParkingMarkings.size()) + { + side=mParkingMarkings[index].side; + type=mParkingMarkings[index].type; + width=mParkingMarkings[index].width; + color=mParkingMarkings[index].color; + return true; + } + else + return false; + } + else + return false; +} void Object::SetS(const double s) { @@ -269,6 +321,69 @@ void Object::ClearBounding(void) mBoundingCylinder=false; } +void Object::SetParkingAccess(const std::string &access) +{ + if(mType=="parkingSpace") + mParkingAccess=access; +} + +void Object::SetParkingRestrictions(const std::string &restrictions) +{ + if(mType=="parkingSpace") + mParkingRestrictions=restrictions; +} + +void Object::AddParkingMarking(const std::string &side, const std::string &type, const double width, const std::string &color) +{ + TParkingSpaceMarking new_markings; + + std::vector<TParkingSpaceMarking>::iterator it; + + if(mType=="parkingSpace") + { + for(it=mParkingMarkings.begin();it!=mParkingMarkings.end();it++) + { + if(it->side==side) + { + it->side=side; + it->type=type; + it->width=width; + it->color=color; + return; + } + } + new_markings.side=side; + new_markings.type=type; + new_markings.width=width; + new_markings.color=color; + mParkingMarkings.push_back(new_markings); + } +} + +void Object::RemoveParkingMarking(const std::string &side) +{ + std::vector<TParkingSpaceMarking>::iterator it; + + if(mType=="parkingSpace") + { + for(it=mParkingMarkings.begin();it!=mParkingMarkings.end();it++) + { + if(it->side==side) + { + mParkingMarkings.erase(it); + return; + } + } + } +} + +void Object::ClearParking(void) +{ + mParkingAccess="all"; + mParkingRestrictions="none"; + mParkingMarkings.clear(); +} + Signal::Signal() { mS=0.0; diff --git a/OpenRoadEd/OpenDrive/ObjectSignal.h b/OpenRoadEd/OpenDrive/ObjectSignal.h index 762873fb34cc9666c883b38e9a5a20fdface58d4..6d995ee3faef0b0bcf8352919e2e099893b94f6c 100644 --- a/OpenRoadEd/OpenDrive/ObjectSignal.h +++ b/OpenRoadEd/OpenDrive/ObjectSignal.h @@ -2,7 +2,7 @@ #define OBJECTSIGNAL_H #include <string> - +#include <vector> typedef struct { @@ -23,6 +23,14 @@ typedef union TBoundingCylinder cylinder; }TBounding; +typedef struct +{ + std::string side; + std::string type; + double width; + std::string color; +}TParkingSpaceMarking; + //*********************************************************************************** //Object //*********************************************************************************** @@ -44,6 +52,10 @@ class Object bool mBoundingBox; bool mBoundingCylinder; TBounding mBounding; + // parking space specific attributes + std::string mParkingAccess; + std::string mParkingRestrictions; + std::vector<TParkingSpaceMarking> mParkingMarkings; public: Object(); Object(std::string &name,std::string &id); @@ -68,6 +80,10 @@ class Object bool IsBoundigCylinder(void); TBoundingCylinder GetBoundingCylinder(void); bool GetBoundingCylinder(double &radius,double &height); + std::string GetParkingAccess(void); + std::string GetParkingRestrictions(void); + unsigned int GetNumParkingMarkings(void); + bool GetParkingMarking(unsigned int index,std::string &side, std::string &type, double &width,std::string &color); void SetS(const double s); void SetT(const double t); @@ -84,7 +100,11 @@ class Object void SetBoundingBox(double length,double width,double height); void SetBoundingCylinder(double radius,double height); void ClearBounding(void); - + void SetParkingAccess(const std::string &access); + void SetParkingRestrictions(const std::string &restrictions); + void AddParkingMarking(const std::string &side, const std::string &type, const double width,const std::string &color); + void RemoveParkingMarking(const std::string &side); + void ClearParking(void); }; //---------------------------------------------------------------------------------- diff --git a/OpenRoadEd/OpenDrive/OpenDriveXmlParser.cpp b/OpenRoadEd/OpenDrive/OpenDriveXmlParser.cpp index 8c06fa67231a2cbe01086a44a91aead8653e5c76..6484d90b0a61fb8619035c47a0108f0eaaf15511 100644 --- a/OpenRoadEd/OpenDrive/OpenDriveXmlParser.cpp +++ b/OpenRoadEd/OpenDrive/OpenDriveXmlParser.cpp @@ -10,8 +10,8 @@ using std::endl; * Constructor which saves a reference to OpenDrive structure */ OpenDriveXmlParser::OpenDriveXmlParser (OpenDrive* openDriveObj) -{ - mOpenDrive=openDriveObj; +{ + mOpenDrive=openDriveObj; } /** @@ -20,282 +20,282 @@ OpenDriveXmlParser::OpenDriveXmlParser (OpenDrive* openDriveObj) */ bool OpenDriveXmlParser::ReadHeader(TiXmlElement *node) { - //Read the Header - unsigned short int revMajor; - unsigned short int revMinor; - string name; - float version; - string date; - double north; - double south; - double east; - double west; - - int checker=TIXML_SUCCESS; - checker+=node->QueryValueAttribute<unsigned short int>("revMajor",&revMajor); - checker+=node->QueryValueAttribute<unsigned short int>("revMinor",&revMinor); - checker+=node->QueryStringAttribute("name",&name); - checker+=node->QueryFloatAttribute("version",&version); - checker+=node->QueryStringAttribute("date",&date); - checker+=node->QueryDoubleAttribute("north",&north); - checker+=node->QueryDoubleAttribute("south",&south); - checker+=node->QueryDoubleAttribute("east",&east); - checker+=node->QueryDoubleAttribute("west",&west); - - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Header attributes"<<endl; - return false; - } - - mOpenDrive->SetHeader(revMajor, revMinor, name, version, date, north, south, east, west); - - return true; + //Read the Header + unsigned short int revMajor; + unsigned short int revMinor; + string name; + float version; + string date; + double north; + double south; + double east; + double west; + + int checker=TIXML_SUCCESS; + checker+=node->QueryValueAttribute<unsigned short int>("revMajor",&revMajor); + checker+=node->QueryValueAttribute<unsigned short int>("revMinor",&revMinor); + checker+=node->QueryStringAttribute("name",&name); + checker+=node->QueryFloatAttribute("version",&version); + checker+=node->QueryStringAttribute("date",&date); + checker+=node->QueryDoubleAttribute("north",&north); + checker+=node->QueryDoubleAttribute("south",&south); + checker+=node->QueryDoubleAttribute("east",&east); + checker+=node->QueryDoubleAttribute("west",&west); + + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Header attributes"<<endl; + return false; + } + + mOpenDrive->SetHeader(revMajor, revMinor, name, version, date, north, south, east, west); + + return true; } //-------------- bool OpenDriveXmlParser::ReadRoad(TiXmlElement *node) { - //Read road attributes - string name; - double length; - string id; - string junction; - - int checker=TIXML_SUCCESS; - - checker+=node->QueryStringAttribute("name",&name); - checker+=node->QueryDoubleAttribute("length",&length); - checker+=node->QueryStringAttribute("id",&id); - checker+=node->QueryStringAttribute("junction",&junction); - - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Road attributes"<<endl; - return false; - } - //fill in - mOpenDrive->AddRoad(name, length, id, junction); - Road* road = mOpenDrive->GetLastAddedRoad(); - TiXmlElement* subNode; - - - //Get links - subNode=node->FirstChildElement("link"); - if (subNode) - { - ReadRoadLinks (road,subNode); - } - - //Proceed to road Type - subNode=node->FirstChildElement("type"); - while (subNode) - { - ReadRoadType(road, subNode); - subNode=subNode->NextSiblingElement("type"); - } - - //Proceed to planView - subNode=node->FirstChildElement("planView"); - ReadPlanView(road, subNode); - - //Proceed to ElevationProfile - subNode=node->FirstChildElement("elevationProfile"); - if (subNode) - { - ReadElevationProfile(road, subNode); - } - - //Proceed to LateralProfile - subNode=node->FirstChildElement("lateralProfile"); - if (subNode) - { - ReadLateralProfile(road, subNode); - } - - //Proceed to Lanes - subNode=node->FirstChildElement("lanes"); - ReadLanes(road, subNode); - - //Proceed to Objects - subNode=node->FirstChildElement("objects"); - if (subNode) - { - ReadObjects(road, subNode); - } - - //Proceed to Signals - subNode=node->FirstChildElement("signals"); - if (subNode) - { - ReadSignals(road, subNode); - } - - //Proceed to Surface - subNode=node->FirstChildElement("surface"); - if (subNode) - { - ReadSurface(road, subNode); - } - - return true; + //Read road attributes + string name; + double length; + string id; + string junction; + + int checker=TIXML_SUCCESS; + + checker+=node->QueryStringAttribute("name",&name); + checker+=node->QueryDoubleAttribute("length",&length); + checker+=node->QueryStringAttribute("id",&id); + checker+=node->QueryStringAttribute("junction",&junction); + + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Road attributes"<<endl; + return false; + } + //fill in + mOpenDrive->AddRoad(name, length, id, junction); + Road* road = mOpenDrive->GetLastAddedRoad(); + TiXmlElement* subNode; + + + //Get links + subNode=node->FirstChildElement("link"); + if (subNode) + { + ReadRoadLinks (road,subNode); + } + + //Proceed to road Type + subNode=node->FirstChildElement("type"); + while (subNode) + { + ReadRoadType(road, subNode); + subNode=subNode->NextSiblingElement("type"); + } + + //Proceed to planView + subNode=node->FirstChildElement("planView"); + ReadPlanView(road, subNode); + + //Proceed to ElevationProfile + subNode=node->FirstChildElement("elevationProfile"); + if (subNode) + { + ReadElevationProfile(road, subNode); + } + + //Proceed to LateralProfile + subNode=node->FirstChildElement("lateralProfile"); + if (subNode) + { + ReadLateralProfile(road, subNode); + } + + //Proceed to Lanes + subNode=node->FirstChildElement("lanes"); + ReadLanes(road, subNode); + + //Proceed to Objects + subNode=node->FirstChildElement("objects"); + if (subNode) + { + ReadObjects(road, subNode); + } + + //Proceed to Signals + subNode=node->FirstChildElement("signals"); + if (subNode) + { + ReadSignals(road, subNode); + } + + //Proceed to Surface + subNode=node->FirstChildElement("surface"); + if (subNode) + { + ReadSurface(road, subNode); + } + + return true; } //-------------- bool OpenDriveXmlParser::ReadRoadLinks (Road* road, TiXmlElement *node) { - TiXmlElement* subNode; - subNode=node->FirstChildElement("predecessor"); - if (subNode) - { - ReadRoadLink(road, subNode,0); - } - - subNode=node->FirstChildElement("successor"); - if (subNode) - { - ReadRoadLink(road, subNode,1); - } - - subNode=node->FirstChildElement("neighbor"); - if (subNode) - { - ReadRoadLink(road, subNode,2); - } - - subNode=node->NextSiblingElement("neighbor"); - if (subNode) - { - ReadRoadLink(road, subNode,2); - } - - return true; + TiXmlElement* subNode; + subNode=node->FirstChildElement("predecessor"); + if (subNode) + { + ReadRoadLink(road, subNode,0); + } + + subNode=node->FirstChildElement("successor"); + if (subNode) + { + ReadRoadLink(road, subNode,1); + } + + subNode=node->FirstChildElement("neighbor"); + if (subNode) + { + ReadRoadLink(road, subNode,2); + } + + subNode=node->NextSiblingElement("neighbor"); + if (subNode) + { + ReadRoadLink(road, subNode,2); + } + + return true; } //-------------- bool OpenDriveXmlParser::ReadRoadLink (Road* road, TiXmlElement *node, short int type) { - //all three types (neighbor, successor or predecessor) have the same number and same types of members, - //but in case this changes in future, load it separately - if (type == 0) - { - string elementType; - string elementId; - string contactPoint; - - int checker=TIXML_SUCCESS; - checker+=node->QueryStringAttribute("elementType",&elementType); - checker+=node->QueryStringAttribute("elementId",&elementId); - checker+=node->QueryStringAttribute("contactPoint",&contactPoint); - - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Predecessor attributes for road " << road->GetRoadName() << ": missing element"<<endl; - return false; - } + //all three types (neighbor, successor or predecessor) have the same number and same types of members, + //but in case this changes in future, load it separately + if (type == 0) + { + string elementType; + string elementId; + string contactPoint; + + int checker=TIXML_SUCCESS; + checker+=node->QueryStringAttribute("elementType",&elementType); + checker+=node->QueryStringAttribute("elementId",&elementId); + checker+=node->QueryStringAttribute("contactPoint",&contactPoint); + + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Predecessor attributes for road " << road->GetRoadName() << ": missing element"<<endl; + return false; + } else { if(elementType!="road" && elementType!="junction") - { - cout<<"Error parsing Predecessor attributes for road " << road->GetRoadName() << ": invalid element type: " << elementType << endl; - return false; - } + { + cout<<"Error parsing Predecessor attributes for road " << road->GetRoadName() << ": invalid element type: " << elementType << endl; + return false; + } if(contactPoint!="start" && contactPoint!="end") - { - cout<<"Error parsing Predecessor attributes for road " << road->GetRoadName() << ": invalid contact point: " << contactPoint << endl; - return false; - } + { + cout<<"Error parsing Predecessor attributes for road " << road->GetRoadName() << ": invalid contact point: " << contactPoint << endl; + return false; + } + } + road->SetPredecessor(elementType,elementId,contactPoint); + return true; + + } + else if (type == 1) + { + string elementType; + string elementId; + string contactPoint; + + int checker=TIXML_SUCCESS; + checker+=node->QueryStringAttribute("elementType",&elementType); + checker+=node->QueryStringAttribute("elementId",&elementId); + checker+=node->QueryStringAttribute("contactPoint",&contactPoint); + + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Successor attributes for road " << road->GetRoadName() << ": missing element"<<endl; + return false; } - road->SetPredecessor(elementType,elementId,contactPoint); - return true; - - } - else if (type == 1) - { - string elementType; - string elementId; - string contactPoint; - - int checker=TIXML_SUCCESS; - checker+=node->QueryStringAttribute("elementType",&elementType); - checker+=node->QueryStringAttribute("elementId",&elementId); - checker+=node->QueryStringAttribute("contactPoint",&contactPoint); - - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Successor attributes for road " << road->GetRoadName() << ": missing element"<<endl; - return false; - } else { if(elementType!="road" && elementType!="junction") - { - cout<<"Error parsing Successor attributes for road " << road->GetRoadName() << ": invalid element type: " << elementType << endl; - return false; - } + { + cout<<"Error parsing Successor attributes for road " << road->GetRoadName() << ": invalid element type: " << elementType << endl; + return false; + } if(contactPoint!="start" && contactPoint!="end") - { - cout<<"Error parsing Successor attributes for road " << road->GetRoadName() << ": invalid contact point: " << contactPoint << endl; - return false; - } + { + cout<<"Error parsing Successor attributes for road " << road->GetRoadName() << ": invalid contact point: " << contactPoint << endl; + return false; + } + } + road->SetSuccessor(elementType,elementId,contactPoint); + return true; + } + + else if (type == 2) + { + string side; + string elementId; + string direction; + + int checker=TIXML_SUCCESS; + checker+=node->QueryStringAttribute("side",&side); + checker+=node->QueryStringAttribute("elementId",&elementId); + checker+=node->QueryStringAttribute("direction",&direction); + + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Neighbor attributes for road " << road->GetRoadName() << ": missing element" << endl; + return false; } - road->SetSuccessor(elementType,elementId,contactPoint); - return true; - } - - else if (type == 2) - { - string side; - string elementId; - string direction; - - int checker=TIXML_SUCCESS; - checker+=node->QueryStringAttribute("side",&side); - checker+=node->QueryStringAttribute("elementId",&elementId); - checker+=node->QueryStringAttribute("direction",&direction); - - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Neighbor attributes for road " << road->GetRoadName() << ": missing element" << endl; - return false; - } else { if(side!="left" && side!="right") - { - cout<<"Error parsing Neightbor attributes for road " << road->GetRoadName() << ": invalid side: " << side << endl; - return false; - } + { + cout<<"Error parsing Neightbor attributes for road " << road->GetRoadName() << ": invalid side: " << side << endl; + return false; + } if(direction!="same" && direction!="opposite") - { - cout<<"Error parsing Neightbor attributes for road " << road->GetRoadName() << ": invalid direction: " << direction << endl; - return false; - } + { + cout<<"Error parsing Neightbor attributes for road " << road->GetRoadName() << ": invalid direction: " << direction << endl; + return false; + } } - road->SetNeighbor(side,elementId,direction); - return true; - } + road->SetNeighbor(side,elementId,direction); + return true; + } - return false; - + return false; + } //-------------- bool OpenDriveXmlParser::ReadRoadType (Road* road, TiXmlElement *node) { - double s; - string type; - - int checker=TIXML_SUCCESS; - checker+=node->QueryDoubleAttribute("s",&s); - checker+=node->QueryStringAttribute("type",&type); - - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Road Type attributes"<<endl; - return false; - } + double s; + string type; + + int checker=TIXML_SUCCESS; + checker+=node->QueryDoubleAttribute("s",&s); + checker+=node->QueryStringAttribute("type",&type); + + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Road Type attributes"<<endl; + return false; + } else { if(type!="unknown" && type!="rural" && type!="motorway" && type!="town" && type!="lowSpeed" && type!="pedestrian" && type!="bicycle" && type!="townExpressway" && type!="townCollector" && @@ -306,359 +306,359 @@ bool OpenDriveXmlParser::ReadRoadType (Road* road, TiXmlElement *node) } } - road->AddRoadType(s,type); - return true; + road->AddRoadType(s,type); + return true; } //-------------- bool OpenDriveXmlParser::ReadPlanView(Road* road, TiXmlElement *node) { - //Get geometry - TiXmlElement* subNode; - TiXmlElement* subNodeType; - subNode=node->FirstChildElement("geometry"); - - while (subNode) - { - subNodeType=subNode->FirstChildElement(); - if (subNodeType->ValueStr().compare("line")==0) - { - ReadGeometryBlock(road, subNode,0); //load a straight block - } - else if (subNodeType->ValueStr().compare("spiral")==0) - { - ReadGeometryBlock(road, subNode,1); //load a turn block - } - else if (subNodeType->ValueStr().compare("poly3")==0) - { - ReadGeometryBlock(road, subNode,2); //load a polynom spline block - } - else if (subNodeType->ValueStr().compare("paramPoly3")==0) - { - ReadGeometryBlock(road, subNode,3); //load a polynom spline block - } + //Get geometry + TiXmlElement* subNode; + TiXmlElement* subNodeType; + subNode=node->FirstChildElement("geometry"); + + while (subNode) + { + subNodeType=subNode->FirstChildElement(); + if (subNodeType->ValueStr().compare("line")==0) + { + ReadGeometryBlock(road, subNode,0); //load a straight block + } + else if (subNodeType->ValueStr().compare("spiral")==0) + { + ReadGeometryBlock(road, subNode,1); //load a turn block + } + else if (subNodeType->ValueStr().compare("poly3")==0) + { + ReadGeometryBlock(road, subNode,2); //load a polynom spline block + } + else if (subNodeType->ValueStr().compare("paramPoly3")==0) + { + ReadGeometryBlock(road, subNode,3); //load a polynom spline block + } else cout<<"Unsupported geometry type for road " << road->GetRoadName() << ": " << subNodeType->ValueStr() << endl; - + - subNode=subNode->NextSiblingElement("geometry"); + subNode=subNode->NextSiblingElement("geometry"); - } - return true; + } + return true; } //-------------- bool OpenDriveXmlParser::ReadGeometryBlock (Road* road, TiXmlElement *&node, short int blockType) { - road->AddGeometryBlock(); - GeometryBlock* geomBlock=road->GetLastAddedGeometryBlock(); - switch (blockType) - { - case 0: - ReadGeometry(geomBlock, node, 0); - break; - case 1: - ReadGeometry(geomBlock, node, 1); - node=node->NextSiblingElement("geometry"); - ReadGeometry(geomBlock, node, 2); - node=node->NextSiblingElement("geometry"); - ReadGeometry(geomBlock, node, 1); - break; - case 2: - ReadGeometry(geomBlock, node, 3); - break; - case 3: - ReadGeometry(geomBlock, node, 4); - break; - } - - return true; - + road->AddGeometryBlock(); + GeometryBlock* geomBlock=road->GetLastAddedGeometryBlock(); + switch (blockType) + { + case 0: + ReadGeometry(geomBlock, node, 0); + break; + case 1: + ReadGeometry(geomBlock, node, 1); + node=node->NextSiblingElement("geometry"); + ReadGeometry(geomBlock, node, 2); + node=node->NextSiblingElement("geometry"); + ReadGeometry(geomBlock, node, 1); + break; + case 2: + ReadGeometry(geomBlock, node, 3); + break; + case 3: + ReadGeometry(geomBlock, node, 4); + break; + } + + return true; + } //-------------- bool OpenDriveXmlParser::ReadGeometry(GeometryBlock* geomBlock, TiXmlElement *node, short int geometryType) { - double s, x, y, hdg, length; - //read the geometry node - int checker=TIXML_SUCCESS; - checker+=node->QueryDoubleAttribute("s",&s); - checker+=node->QueryDoubleAttribute("x",&x); - checker+=node->QueryDoubleAttribute("y",&y); - checker+=node->QueryDoubleAttribute("hdg",&hdg); - checker+=node->QueryDoubleAttribute("length",&length); - - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Geometry attributes"<<endl; - return false; - } - - TiXmlElement *subNode=node->FirstChildElement(); - - //read the type nodes - switch ( geometryType ) + double s, x, y, hdg, length; + //read the geometry node + int checker=TIXML_SUCCESS; + checker+=node->QueryDoubleAttribute("s",&s); + checker+=node->QueryDoubleAttribute("x",&x); + checker+=node->QueryDoubleAttribute("y",&y); + checker+=node->QueryDoubleAttribute("hdg",&hdg); + checker+=node->QueryDoubleAttribute("length",&length); + + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Geometry attributes"<<endl; + return false; + } + + TiXmlElement *subNode=node->FirstChildElement(); + + //read the type nodes + switch ( geometryType ) { - case 0: //line - geomBlock->AddGeometryLine(s,x,y,hdg,length); - break; - case 1: //spiral - checker=TIXML_SUCCESS; - double curvatureStart, curvatureEnd; - checker+=subNode->QueryDoubleAttribute("curvStart",&curvatureStart); - checker+=subNode->QueryDoubleAttribute("curvEnd",&curvatureEnd); - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing spiral attributes"<<endl; - return false; - } - geomBlock->AddGeometrySpiral(s,x,y,hdg,length,curvatureStart,curvatureEnd); - break; - case 2: //arc - checker=TIXML_SUCCESS; - double curvature; - checker+=subNode->QueryDoubleAttribute("curvature",&curvature); - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing arc attributes"<<endl; - return false; - } - geomBlock->AddGeometryArc(s,x,y,hdg,length,curvature); - break; - - - case 3: //poly3 - checker=TIXML_SUCCESS; - double a,b,c,d; - checker+=subNode->QueryDoubleAttribute("a",&a); - checker+=subNode->QueryDoubleAttribute("b",&b); - checker+=subNode->QueryDoubleAttribute("c",&c); - checker+=subNode->QueryDoubleAttribute("d",&d); - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing poly3 attributes"<<endl; - return false; - } - - geomBlock->AddGeometryPoly3(s,x,y,hdg,length,a,b,c,d); - break; - - case 4: //parampoly3 - checker=TIXML_SUCCESS; - double au,bu,cu,du; - double av,bv,cv,dv; - checker+=subNode->QueryDoubleAttribute("aU",&au); - checker+=subNode->QueryDoubleAttribute("bU",&bu); - checker+=subNode->QueryDoubleAttribute("cU",&cu); - checker+=subNode->QueryDoubleAttribute("dU",&du); - checker+=subNode->QueryDoubleAttribute("aV",&av); - checker+=subNode->QueryDoubleAttribute("bV",&bv); - checker+=subNode->QueryDoubleAttribute("cV",&cv); - checker+=subNode->QueryDoubleAttribute("dV",&dv); - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing paramPoly3 attributes"<<endl; - return false; - } - - geomBlock->AddGeometryParamPoly3(s,x,y,hdg,length,au,bu,cu,du,av,bv,cv,dv); - break; - - } - - return true; + case 0: //line + geomBlock->AddGeometryLine(s,x,y,hdg,length); + break; + case 1: //spiral + checker=TIXML_SUCCESS; + double curvatureStart, curvatureEnd; + checker+=subNode->QueryDoubleAttribute("curvStart",&curvatureStart); + checker+=subNode->QueryDoubleAttribute("curvEnd",&curvatureEnd); + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing spiral attributes"<<endl; + return false; + } + geomBlock->AddGeometrySpiral(s,x,y,hdg,length,curvatureStart,curvatureEnd); + break; + case 2: //arc + checker=TIXML_SUCCESS; + double curvature; + checker+=subNode->QueryDoubleAttribute("curvature",&curvature); + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing arc attributes"<<endl; + return false; + } + geomBlock->AddGeometryArc(s,x,y,hdg,length,curvature); + break; + + + case 3: //poly3 + checker=TIXML_SUCCESS; + double a,b,c,d; + checker+=subNode->QueryDoubleAttribute("a",&a); + checker+=subNode->QueryDoubleAttribute("b",&b); + checker+=subNode->QueryDoubleAttribute("c",&c); + checker+=subNode->QueryDoubleAttribute("d",&d); + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing poly3 attributes"<<endl; + return false; + } + + geomBlock->AddGeometryPoly3(s,x,y,hdg,length,a,b,c,d); + break; + + case 4: //parampoly3 + checker=TIXML_SUCCESS; + double au,bu,cu,du; + double av,bv,cv,dv; + checker+=subNode->QueryDoubleAttribute("aU",&au); + checker+=subNode->QueryDoubleAttribute("bU",&bu); + checker+=subNode->QueryDoubleAttribute("cU",&cu); + checker+=subNode->QueryDoubleAttribute("dU",&du); + checker+=subNode->QueryDoubleAttribute("aV",&av); + checker+=subNode->QueryDoubleAttribute("bV",&bv); + checker+=subNode->QueryDoubleAttribute("cV",&cv); + checker+=subNode->QueryDoubleAttribute("dV",&dv); + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing paramPoly3 attributes"<<endl; + return false; + } + + geomBlock->AddGeometryParamPoly3(s,x,y,hdg,length,au,bu,cu,du,av,bv,cv,dv); + break; + + } + + return true; } //-------------- bool OpenDriveXmlParser::ReadElevationProfile (Road* road, TiXmlElement *node) { - TiXmlElement* subNode; - subNode=node->FirstChildElement("elevation"); - double s, a, b, c, d; - while (subNode) - { - int checker=TIXML_SUCCESS; - checker+=subNode->QueryDoubleAttribute("s",&s); - checker+=subNode->QueryDoubleAttribute("a",&a); - checker+=subNode->QueryDoubleAttribute("b",&b); - checker+=subNode->QueryDoubleAttribute("c",&c); - checker+=subNode->QueryDoubleAttribute("d",&d); - - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Elevation attributes"<<endl; - return false; - } - - road->AddElevation(s,a,b,c,d); - - subNode=subNode->NextSiblingElement("elevation"); - } - return true; + TiXmlElement* subNode; + subNode=node->FirstChildElement("elevation"); + double s, a, b, c, d; + while (subNode) + { + int checker=TIXML_SUCCESS; + checker+=subNode->QueryDoubleAttribute("s",&s); + checker+=subNode->QueryDoubleAttribute("a",&a); + checker+=subNode->QueryDoubleAttribute("b",&b); + checker+=subNode->QueryDoubleAttribute("c",&c); + checker+=subNode->QueryDoubleAttribute("d",&d); + + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Elevation attributes"<<endl; + return false; + } + + road->AddElevation(s,a,b,c,d); + + subNode=subNode->NextSiblingElement("elevation"); + } + return true; } //-------------- bool OpenDriveXmlParser::ReadLateralProfile (Road* road, TiXmlElement *node) { - TiXmlElement* subNode; - subNode=node->FirstChildElement("superelevation"); - double s, a, b, c, d; - while (subNode) - { - int checker=TIXML_SUCCESS; - checker+=subNode->QueryDoubleAttribute("s",&s); - checker+=subNode->QueryDoubleAttribute("a",&a); - checker+=subNode->QueryDoubleAttribute("b",&b); - checker+=subNode->QueryDoubleAttribute("c",&c); - checker+=subNode->QueryDoubleAttribute("d",&d); - - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Superelevation attributes"<<endl; - return false; - } - - road->AddSuperElevation(s,a,b,c,d); - - subNode=subNode->NextSiblingElement("superelevation"); - } - - subNode=node->FirstChildElement("crossfall"); - string side; - while (subNode) - { - int checker=TIXML_SUCCESS; - checker+=subNode->QueryStringAttribute("side",&side); - checker+=subNode->QueryDoubleAttribute("s",&s); - checker+=subNode->QueryDoubleAttribute("a",&a); - checker+=subNode->QueryDoubleAttribute("b",&b); - checker+=subNode->QueryDoubleAttribute("c",&c); - checker+=subNode->QueryDoubleAttribute("d",&d); - - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Crossfall attributes"<<endl; - return false; - } - - road->AddCrossfall(side,s,a,b,c,d); - - subNode=subNode->NextSiblingElement("crossfall"); - } - - return true; + TiXmlElement* subNode; + subNode=node->FirstChildElement("superelevation"); + double s, a, b, c, d; + while (subNode) + { + int checker=TIXML_SUCCESS; + checker+=subNode->QueryDoubleAttribute("s",&s); + checker+=subNode->QueryDoubleAttribute("a",&a); + checker+=subNode->QueryDoubleAttribute("b",&b); + checker+=subNode->QueryDoubleAttribute("c",&c); + checker+=subNode->QueryDoubleAttribute("d",&d); + + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Superelevation attributes"<<endl; + return false; + } + + road->AddSuperElevation(s,a,b,c,d); + + subNode=subNode->NextSiblingElement("superelevation"); + } + + subNode=node->FirstChildElement("crossfall"); + string side; + while (subNode) + { + int checker=TIXML_SUCCESS; + checker+=subNode->QueryStringAttribute("side",&side); + checker+=subNode->QueryDoubleAttribute("s",&s); + checker+=subNode->QueryDoubleAttribute("a",&a); + checker+=subNode->QueryDoubleAttribute("b",&b); + checker+=subNode->QueryDoubleAttribute("c",&c); + checker+=subNode->QueryDoubleAttribute("d",&d); + + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Crossfall attributes"<<endl; + return false; + } + + road->AddCrossfall(side,s,a,b,c,d); + + subNode=subNode->NextSiblingElement("crossfall"); + } + + return true; } //-------------- bool OpenDriveXmlParser::ReadLanes (Road* road, TiXmlElement *node) { - TiXmlElement *subNode = node->FirstChildElement("laneSection"); - while (subNode) - { - ReadLaneSections(road, subNode); - subNode=subNode->NextSiblingElement("laneSection"); - } - - return true; + TiXmlElement *subNode = node->FirstChildElement("laneSection"); + while (subNode) + { + ReadLaneSections(road, subNode); + subNode=subNode->NextSiblingElement("laneSection"); + } + + return true; } //-------------- bool OpenDriveXmlParser::ReadLaneSections (Road* road, TiXmlElement *node) { - int checker=TIXML_SUCCESS; - double s; - checker+=node->QueryDoubleAttribute("s",&s); - - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Lane Section attributes"<<endl; - return false; - } - - - road->AddLaneSection(s); - LaneSection* laneSection=road->GetLastAddedLaneSection(); - TiXmlElement *subNode=node->FirstChildElement("left"); - if (subNode) - { - subNode=subNode->FirstChildElement("lane"); - while(subNode) - { - - ReadLane(laneSection,subNode,1); //0 for left - subNode=subNode->NextSiblingElement("lane"); - } - - } - - subNode=node->FirstChildElement("center"); - if (subNode) - { - subNode=subNode->FirstChildElement("lane"); - while(subNode) - { - - ReadLane(laneSection,subNode,0); //1 for center - subNode=subNode->NextSiblingElement("lane"); - } - } - - subNode=node->FirstChildElement("right"); - if (subNode) - { - subNode=subNode->FirstChildElement("lane"); - while(subNode) - { - - ReadLane(laneSection,subNode,-1); //2 for right - subNode=subNode->NextSiblingElement("lane"); - } - } - - - //OutputDebugString( "\n") ; - for (unsigned int i=0;i<laneSection->GetLaneVector()->size();i++) - { - int id = static_cast<Lane>(laneSection->GetLaneVector()->at(i)).GetId(); - - /*char* buf; - buf=new char[5]; - itoa(id,buf,10); - - OutputDebugString( buf ) ; - OutputDebugString( " ") ;*/ - } - //OutputDebugString( "\n") ; - - - //sort in descending order - std::sort(laneSection->GetLaneVector()->begin(),laneSection->GetLaneVector()->end()); - std::reverse(laneSection->GetLaneVector()->begin(),laneSection->GetLaneVector()->end()); - return true; + int checker=TIXML_SUCCESS; + double s; + checker+=node->QueryDoubleAttribute("s",&s); + + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Lane Section attributes"<<endl; + return false; + } + + + road->AddLaneSection(s); + LaneSection* laneSection=road->GetLastAddedLaneSection(); + TiXmlElement *subNode=node->FirstChildElement("left"); + if (subNode) + { + subNode=subNode->FirstChildElement("lane"); + while(subNode) + { + + ReadLane(laneSection,subNode,1); //0 for left + subNode=subNode->NextSiblingElement("lane"); + } + + } + + subNode=node->FirstChildElement("center"); + if (subNode) + { + subNode=subNode->FirstChildElement("lane"); + while(subNode) + { + + ReadLane(laneSection,subNode,0); //1 for center + subNode=subNode->NextSiblingElement("lane"); + } + } + + subNode=node->FirstChildElement("right"); + if (subNode) + { + subNode=subNode->FirstChildElement("lane"); + while(subNode) + { + + ReadLane(laneSection,subNode,-1); //2 for right + subNode=subNode->NextSiblingElement("lane"); + } + } + + + //OutputDebugString( "\n") ; + for (unsigned int i=0;i<laneSection->GetLaneVector()->size();i++) + { + int id = static_cast<Lane>(laneSection->GetLaneVector()->at(i)).GetId(); + + /*char* buf; + buf=new char[5]; + itoa(id,buf,10); + + OutputDebugString( buf ) ; + OutputDebugString( " ") ;*/ + } + //OutputDebugString( "\n") ; + + + //sort in descending order + std::sort(laneSection->GetLaneVector()->begin(),laneSection->GetLaneVector()->end()); + std::reverse(laneSection->GetLaneVector()->begin(),laneSection->GetLaneVector()->end()); + return true; } //-------------- bool OpenDriveXmlParser::ReadLane (LaneSection* laneSection, TiXmlElement *node, short int laneType) { - //Read Lane attributes - short int side=laneType; - int id; - string type; - string level; - bool boolLevel; - int predecessor; - int successor; - - int checker=TIXML_SUCCESS; - checker+=node->QueryIntAttribute("id",&id); - checker+=node->QueryStringAttribute("type",&type); - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Lane attributes"<<endl; - return false; - } + //Read Lane attributes + short int side=laneType; + int id; + string type; + string level; + bool boolLevel; + int predecessor; + int successor; + + int checker=TIXML_SUCCESS; + checker+=node->QueryIntAttribute("id",&id); + checker+=node->QueryStringAttribute("type",&type); + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Lane attributes"<<endl; + return false; + } else { if(type!="none" && type!="driving" && type!="stop" && type!="shoulder" && type!="biking" && type!="sidewalk" && type!="border" && type!="restricted" && type!="parking" && type!="bidirectional" && @@ -669,157 +669,157 @@ bool OpenDriveXmlParser::ReadLane (LaneSection* laneSection, TiXmlElement *node, return false; } } - //in case "level" is missing, apply default value - checker=node->QueryStringAttribute("level",&level); - if (checker!=TIXML_SUCCESS) - { level="false"; } - - //convert level to bool - - if (level.compare("false")==0 || level.compare("0")==0) - boolLevel=false; - else - boolLevel=true; - - //pointer to the lane - Lane* lane; - //Depending on the laneType, add it to the appropriate vector and get a pointer to it - - laneSection->AddLane(side,id,type,boolLevel,false); - lane=laneSection->GetLastAddedLane(); - - - //Read Link parameters and add them to the lane if available - TiXmlElement *subNode=node->FirstChildElement("link"); - TiXmlElement *subSubNode; - if (subNode) - subSubNode=subNode->FirstChildElement("predecessor"); - if (subSubNode) - { - checker=subSubNode->QueryIntAttribute("id",&predecessor); - if (checker==TIXML_SUCCESS) - lane->SetPredecessor(predecessor); - } - if (subNode) - subSubNode=subNode->FirstChildElement("successor"); - if (subSubNode) - { - checker=subSubNode->QueryIntAttribute("id",&successor); - if (checker==TIXML_SUCCESS) - lane->SetSuccessor(successor); - } + //in case "level" is missing, apply default value + checker=node->QueryStringAttribute("level",&level); + if (checker!=TIXML_SUCCESS) + { level="false"; } + + //convert level to bool + + if (level.compare("false")==0 || level.compare("0")==0) + boolLevel=false; + else + boolLevel=true; + + //pointer to the lane + Lane* lane; + //Depending on the laneType, add it to the appropriate vector and get a pointer to it + + laneSection->AddLane(side,id,type,boolLevel,false); + lane=laneSection->GetLastAddedLane(); + + + //Read Link parameters and add them to the lane if available + TiXmlElement *subNode=node->FirstChildElement("link"); + TiXmlElement *subSubNode; + if (subNode) + subSubNode=subNode->FirstChildElement("predecessor"); + if (subSubNode) + { + checker=subSubNode->QueryIntAttribute("id",&predecessor); + if (checker==TIXML_SUCCESS) + lane->SetPredecessor(predecessor); + } + if (subNode) + subSubNode=subNode->FirstChildElement("successor"); + if (subSubNode) + { + checker=subSubNode->QueryIntAttribute("id",&successor); + if (checker==TIXML_SUCCESS) + lane->SetSuccessor(successor); + } if(side!=0) { - //Proceed to the Road width - subNode=node->FirstChildElement("width"); - while (subNode) - { - ReadLaneWidth(lane, subNode); - subNode=subNode->NextSiblingElement("width"); - } + //Proceed to the Road width + subNode=node->FirstChildElement("width"); + while (subNode) + { + ReadLaneWidth(lane, subNode); + subNode=subNode->NextSiblingElement("width"); + } } - //Proceed to the Road Mark - subNode=node->FirstChildElement("roadMark"); - while (subNode) - { - ReadLaneRoadMark(lane, subNode); - subNode=subNode->NextSiblingElement("roadMark"); - } + //Proceed to the Road Mark + subNode=node->FirstChildElement("roadMark"); + while (subNode) + { + ReadLaneRoadMark(lane, subNode); + subNode=subNode->NextSiblingElement("roadMark"); + } if(side!=0) { - //Proceed to the Lane Material - subNode=node->FirstChildElement("material"); - while (subNode) - { - ReadLaneMaterial(lane, subNode); - subNode=subNode->NextSiblingElement("material"); - } - - //Proceed to the Lane Visibility - subNode=node->FirstChildElement("visibility"); - while (subNode) - { - ReadLaneVisibility(lane, subNode); - subNode=subNode->NextSiblingElement("visibility"); - } - - //Proceed to the Lane speed - subNode=node->FirstChildElement("speed"); - while (subNode) - { - ReadLaneSpeed(lane, subNode); - subNode=subNode->NextSiblingElement("speed"); - } - - //Proceed to the Lane access - subNode=node->FirstChildElement("access"); - while (subNode) - { - ReadLaneAccess(lane, subNode); - subNode=subNode->NextSiblingElement("access"); - } - - //Proceed to the Lane height - subNode=node->FirstChildElement("height"); - while (subNode) - { - ReadLaneHeight(lane, subNode); - subNode=subNode->NextSiblingElement("height"); - } + //Proceed to the Lane Material + subNode=node->FirstChildElement("material"); + while (subNode) + { + ReadLaneMaterial(lane, subNode); + subNode=subNode->NextSiblingElement("material"); + } + + //Proceed to the Lane Visibility + subNode=node->FirstChildElement("visibility"); + while (subNode) + { + ReadLaneVisibility(lane, subNode); + subNode=subNode->NextSiblingElement("visibility"); + } + + //Proceed to the Lane speed + subNode=node->FirstChildElement("speed"); + while (subNode) + { + ReadLaneSpeed(lane, subNode); + subNode=subNode->NextSiblingElement("speed"); + } + + //Proceed to the Lane access + subNode=node->FirstChildElement("access"); + while (subNode) + { + ReadLaneAccess(lane, subNode); + subNode=subNode->NextSiblingElement("access"); + } + + //Proceed to the Lane height + subNode=node->FirstChildElement("height"); + while (subNode) + { + ReadLaneHeight(lane, subNode); + subNode=subNode->NextSiblingElement("height"); + } } - return true; + return true; } //-------------- bool OpenDriveXmlParser::ReadLaneWidth(Lane* lane, TiXmlElement *node) { - double sOffset, a, b, c, d; + double sOffset, a, b, c, d; - int checker=TIXML_SUCCESS; - checker+=node->QueryDoubleAttribute("sOffset",&sOffset); - checker+=node->QueryDoubleAttribute("a",&a); - checker+=node->QueryDoubleAttribute("b",&b); - checker+=node->QueryDoubleAttribute("c",&c); - checker+=node->QueryDoubleAttribute("d",&d); + int checker=TIXML_SUCCESS; + checker+=node->QueryDoubleAttribute("sOffset",&sOffset); + checker+=node->QueryDoubleAttribute("a",&a); + checker+=node->QueryDoubleAttribute("b",&b); + checker+=node->QueryDoubleAttribute("c",&c); + checker+=node->QueryDoubleAttribute("d",&d); - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Lane Width attributes"<<endl; - return false; - } + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Lane Width attributes"<<endl; + return false; + } - lane->AddWidthRecord(sOffset,a,b,c,d); + lane->AddWidthRecord(sOffset,a,b,c,d); - return true; + return true; } //-------------- bool OpenDriveXmlParser::ReadLaneRoadMark(Lane* lane, TiXmlElement *node) { - - double sOffset; - string type; - string weight; - string color; - double width; - string laneChange; - - int checker=TIXML_SUCCESS; - checker+=node->QueryDoubleAttribute("sOffset",&sOffset); - checker+=node->QueryStringAttribute("type",&type); - checker+=node->QueryStringAttribute("weight",&weight); - checker+=node->QueryStringAttribute("color",&color); - - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Lane road mark attributes"<<endl; - return false; - } + + double sOffset; + string type; + string weight; + string color; + double width; + string laneChange; + + int checker=TIXML_SUCCESS; + checker+=node->QueryDoubleAttribute("sOffset",&sOffset); + checker+=node->QueryStringAttribute("type",&type); + checker+=node->QueryStringAttribute("weight",&weight); + checker+=node->QueryStringAttribute("color",&color); + + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Lane road mark attributes"<<endl; + return false; + } else { if(type!="none" && type!="solid" && type!="broken" && type!="solid solid" && type!="solid broken" && type!="broken solid" && type!="broken broken" && type!="botts dots" && type!="grass" && @@ -830,130 +830,130 @@ bool OpenDriveXmlParser::ReadLaneRoadMark(Lane* lane, TiXmlElement *node) } } - checker+=node->QueryDoubleAttribute("width",&width); - if (checker!=TIXML_SUCCESS) - { width=0; } + checker+=node->QueryDoubleAttribute("width",&width); + if (checker!=TIXML_SUCCESS) + { width=0; } - checker=node->QueryStringAttribute("laneChange",&laneChange); - if (checker!=TIXML_SUCCESS) - { laneChange = "both"; } + checker=node->QueryStringAttribute("laneChange",&laneChange); + if (checker!=TIXML_SUCCESS) + { laneChange = "both"; } - lane->AddRoadMarkRecord(sOffset,type,weight,color,width,laneChange); + lane->AddRoadMarkRecord(sOffset,type,weight,color,width,laneChange); - return true; + return true; } //-------------- bool OpenDriveXmlParser::ReadLaneMaterial(Lane* lane, TiXmlElement *node) { - double sOffset; - string surface; - double friction; - double roughness; - - int checker=TIXML_SUCCESS; - checker+=node->QueryDoubleAttribute("sOffset",&sOffset); - checker+=node->QueryStringAttribute("surface",&surface); - checker+=node->QueryDoubleAttribute("friction",&friction); - checker+=node->QueryDoubleAttribute("roughness",&roughness); - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Lane material attributes"<<endl; - return false; - } - - lane->AddMaterialRecord(sOffset,surface,friction,roughness); - - return true; + double sOffset; + string surface; + double friction; + double roughness; + + int checker=TIXML_SUCCESS; + checker+=node->QueryDoubleAttribute("sOffset",&sOffset); + checker+=node->QueryStringAttribute("surface",&surface); + checker+=node->QueryDoubleAttribute("friction",&friction); + checker+=node->QueryDoubleAttribute("roughness",&roughness); + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Lane material attributes"<<endl; + return false; + } + + lane->AddMaterialRecord(sOffset,surface,friction,roughness); + + return true; } //-------------- bool OpenDriveXmlParser::ReadLaneVisibility(Lane* lane, TiXmlElement *node) { - double sOffset; - double forward; - double back; - double left; - double right; - - int checker=TIXML_SUCCESS; - checker+=node->QueryDoubleAttribute("sOffset",&sOffset); - checker+=node->QueryDoubleAttribute("forward",&forward); - checker+=node->QueryDoubleAttribute("back",&back); - checker+=node->QueryDoubleAttribute("left",&left); - checker+=node->QueryDoubleAttribute("right",&right); - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Lane visibility attributes"<<endl; - return false; - } - - lane->AddVisibilityRecord(sOffset,forward,back,left,right); - - return true; + double sOffset; + double forward; + double back; + double left; + double right; + + int checker=TIXML_SUCCESS; + checker+=node->QueryDoubleAttribute("sOffset",&sOffset); + checker+=node->QueryDoubleAttribute("forward",&forward); + checker+=node->QueryDoubleAttribute("back",&back); + checker+=node->QueryDoubleAttribute("left",&left); + checker+=node->QueryDoubleAttribute("right",&right); + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Lane visibility attributes"<<endl; + return false; + } + + lane->AddVisibilityRecord(sOffset,forward,back,left,right); + + return true; } //-------------- bool OpenDriveXmlParser::ReadLaneSpeed(Lane* lane, TiXmlElement *node) -{ - double sOffset; - double max; - - int checker=TIXML_SUCCESS; - checker+=node->QueryDoubleAttribute("sOffset",&sOffset); - checker+=node->QueryDoubleAttribute("max",&max); - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Lane speed attributes"<<endl; - return false; - } - - lane->AddSpeedRecord(sOffset,max); - - return true; +{ + double sOffset; + double max; + + int checker=TIXML_SUCCESS; + checker+=node->QueryDoubleAttribute("sOffset",&sOffset); + checker+=node->QueryDoubleAttribute("max",&max); + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Lane speed attributes"<<endl; + return false; + } + + lane->AddSpeedRecord(sOffset,max); + + return true; } //-------------- bool OpenDriveXmlParser::ReadLaneAccess(Lane* lane, TiXmlElement *node) { - double sOffset; - string restriction; + double sOffset; + string restriction; - int checker=TIXML_SUCCESS; - checker+=node->QueryDoubleAttribute("sOffset",&sOffset); - checker+=node->QueryStringAttribute("restriction",&restriction); - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Lane access attributes"<<endl; - return false; - } + int checker=TIXML_SUCCESS; + checker+=node->QueryDoubleAttribute("sOffset",&sOffset); + checker+=node->QueryStringAttribute("restriction",&restriction); + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Lane access attributes"<<endl; + return false; + } - lane->AddAccessRecord(sOffset,restriction); + lane->AddAccessRecord(sOffset,restriction); - return true; + return true; } //-------------- bool OpenDriveXmlParser::ReadLaneHeight(Lane* lane, TiXmlElement *node) { - double sOffset; - double inner; - double outer; - - int checker=TIXML_SUCCESS; - checker+=node->QueryDoubleAttribute("sOffset",&sOffset); - checker+=node->QueryDoubleAttribute("inner",&inner); - checker+=node->QueryDoubleAttribute("outer",&outer); - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Lane height attributes"<<endl; - return false; - } - - lane->AddHeightRecord(sOffset,inner,outer); - - return true; + double sOffset; + double inner; + double outer; + + int checker=TIXML_SUCCESS; + checker+=node->QueryDoubleAttribute("sOffset",&sOffset); + checker+=node->QueryDoubleAttribute("inner",&inner); + checker+=node->QueryDoubleAttribute("outer",&outer); + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Lane height attributes"<<endl; + return false; + } + + lane->AddHeightRecord(sOffset,inner,outer); + + return true; } //-------------- @@ -961,38 +961,37 @@ bool OpenDriveXmlParser::ReadLaneHeight(Lane* lane, TiXmlElement *node) bool OpenDriveXmlParser::ReadObjects (Road* road, TiXmlElement *node) { - double s,t,zOffset,validLength,length,width,height,radius,heading,pitch,roll; - std::string id,name,dynamic,orientation,type,subType; + double s,t,zOffset,validLength,length,width,height,radius,heading,pitch,roll; + std::string id,name,dynamic,orientation,type,subType; Object *object; - int checker=TIXML_SUCCESS; - TiXmlElement *object_node; + int checker=TIXML_SUCCESS; + TiXmlElement *object_node,*parking_node,*parking_marking_node; object_node=node->FirstChildElement("object"); while(object_node!=0) { - std::cout << "new object" << std::endl; - checker=TIXML_SUCCESS; - checker+=object_node->QueryDoubleAttribute("s",&s); - checker+=object_node->QueryDoubleAttribute("t",&t); - checker+=object_node->QueryStringAttribute("id",&id); + checker=TIXML_SUCCESS; + checker+=object_node->QueryDoubleAttribute("s",&s); + checker+=object_node->QueryDoubleAttribute("t",&t); + checker+=object_node->QueryStringAttribute("id",&id); checker+=object_node->QueryStringAttribute("name",&name); checker+=object_node->QueryStringAttribute("dynamic",&dynamic); checker+=object_node->QueryStringAttribute("orientation",&orientation); - checker+=object_node->QueryDoubleAttribute("zOffset",&zOffset); - checker+=object_node->QueryDoubleAttribute("validLength",&validLength); + checker+=object_node->QueryDoubleAttribute("zOffset",&zOffset); + checker+=object_node->QueryDoubleAttribute("validLength",&validLength); checker+=object_node->QueryStringAttribute("type",&type); - checker+=object_node->QueryDoubleAttribute("hdg",&heading); - checker+=object_node->QueryDoubleAttribute("pitch",&pitch); - checker+=object_node->QueryDoubleAttribute("roll",&roll); - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing road object attributes"<<endl; - return false; - } + checker+=object_node->QueryDoubleAttribute("hdg",&heading); + checker+=object_node->QueryDoubleAttribute("pitch",&pitch); + checker+=object_node->QueryDoubleAttribute("roll",&roll); + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing road object attributes"<<endl; + return false; + } else { if(type!="none" && type!="obstacle" && type!="pole" && type!="tree" && type!="vegetation" && type!="barrier" && type!="building" && type!="parkingSpace" && type!="patch" && type!="railing" && - type!="trafficIsland" && type!="crosswalk" && type!="streetLamp" && type!="gantry" && type!="soundBarrier") + type!="trafficIsland" && type!="crosswalk" && type!="streetLamp" && type!="gantry" && type!="soundBarrier") { cout<<"Error parsing road object attributes for road " << road->GetRoadName() << ": invalid type: " << type << endl; return false; @@ -1009,7 +1008,7 @@ bool OpenDriveXmlParser::ReadObjects (Road* road, TiXmlElement *node) } } - road->AddObject(); + road->AddObject(); object=road->GetLastObject(); object->SetS(s); object->SetT(t); @@ -1027,64 +1026,103 @@ bool OpenDriveXmlParser::ReadObjects (Road* road, TiXmlElement *node) object->SetPitch(pitch); object->SetRoll(roll); // read bounding box - checker=TIXML_SUCCESS; - checker+=object_node->QueryDoubleAttribute("length",&length); - checker+=object_node->QueryDoubleAttribute("width",&width); - checker+=object_node->QueryDoubleAttribute("height",&height); - if(checker==TIXML_SUCCESS) + checker=TIXML_SUCCESS; + checker+=object_node->QueryDoubleAttribute("length",&length); + checker+=object_node->QueryDoubleAttribute("width",&width); + checker+=object_node->QueryDoubleAttribute("height",&height); + if(checker==TIXML_SUCCESS) object->SetBoundingBox(length,width,height); else { - checker=TIXML_SUCCESS; - checker+=object_node->QueryDoubleAttribute("radius",&radius); - checker+=object_node->QueryDoubleAttribute("height",&height); - if(checker==TIXML_SUCCESS) + checker=TIXML_SUCCESS; + checker+=object_node->QueryDoubleAttribute("radius",&radius); + checker+=object_node->QueryDoubleAttribute("height",&height); + if(checker==TIXML_SUCCESS) object->SetBoundingCylinder(radius,height); } + if(type=="parkingSpace") + { + std::string access,restrictions,mark_side,mark_type,mark_color; + double mark_width; + + parking_node=object_node->FirstChildElement("parkingSpace"); + if(parking_node!=0) + { + checker=TIXML_SUCCESS; + checker+=parking_node->QueryStringAttribute("access",&access); + checker+=parking_node->QueryStringAttribute("restrictions",&restrictions); + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing road object attributes"<<endl; + return false; + } + else + { + object->SetParkingAccess(access); + object->SetParkingRestrictions(restrictions); + parking_marking_node=parking_node->FirstChildElement("marking"); + while(parking_marking_node!=0) + { + checker=TIXML_SUCCESS; + checker+=parking_marking_node->QueryStringAttribute("side",&mark_side); + checker+=parking_marking_node->QueryStringAttribute("type",&mark_type); + checker+=parking_marking_node->QueryDoubleAttribute("width",&mark_width); + checker+=parking_marking_node->QueryStringAttribute("color",&mark_color); + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing road object attributes"<<endl; + return false; + } + else + object->AddParkingMarking(mark_side,mark_type,mark_width,mark_color); + parking_marking_node=parking_marking_node->NextSiblingElement("marking"); + } + } + } + } object_node=object_node->NextSiblingElement("object"); } - return true; + return true; } //-------------- bool OpenDriveXmlParser::ReadSignals (Road* road, TiXmlElement *node) { - double s,t,zOffset,value,height,width,hOffset,pitch,roll; - std::string id,name,dynamic,orientation,country,countryRevision,type,subType,unit,text; + double s,t,zOffset,value,height,width,hOffset,pitch,roll; + std::string id,name,dynamic,orientation,country,countryRevision,type,subType,unit,text; Signal *signal; - int checker=TIXML_SUCCESS; + int checker=TIXML_SUCCESS; TiXmlElement *signal_node; signal_node=node->FirstChildElement("signal"); while(signal_node!=0) { - std::cout << "new signal" << std::endl; - checker=TIXML_SUCCESS; - checker+=signal_node->QueryDoubleAttribute("s",&s); - checker+=signal_node->QueryDoubleAttribute("t",&t); - checker+=signal_node->QueryStringAttribute("id",&id); + checker=TIXML_SUCCESS; + checker+=signal_node->QueryDoubleAttribute("s",&s); + checker+=signal_node->QueryDoubleAttribute("t",&t); + checker+=signal_node->QueryStringAttribute("id",&id); checker+=signal_node->QueryStringAttribute("name",&name); checker+=signal_node->QueryStringAttribute("dynamic",&dynamic); checker+=signal_node->QueryStringAttribute("orientation",&orientation); - checker+=signal_node->QueryDoubleAttribute("zOffset",&zOffset); + checker+=signal_node->QueryDoubleAttribute("zOffset",&zOffset); checker+=signal_node->QueryStringAttribute("country",&country); // checker+=signal_node->QueryStringAttribute("countryRevision",&countryRevision); checker+=signal_node->QueryStringAttribute("type",&type); checker+=signal_node->QueryStringAttribute("subtype",&subType); - checker+=signal_node->QueryDoubleAttribute("value",&value); + checker+=signal_node->QueryDoubleAttribute("value",&value); // checker+=signal_node->QueryStringAttribute("unit",&unit); -// checker+=signal_node->QueryDoubleAttribute("height",&height); -// checker+=signal_node->QueryDoubleAttribute("width",&width); +// checker+=signal_node->QueryDoubleAttribute("height",&height); +// checker+=signal_node->QueryDoubleAttribute("width",&width); // checker+=signal_node->QueryStringAttribute("text",&text); -// checker+=signal_node->QueryDoubleAttribute("hOffset",&hOffset); -// checker+=signal_node->QueryDoubleAttribute("pitch",&pitch); -// checker+=signal_node->QueryDoubleAttribute("roll",&roll); - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing road signal attributes"<<endl; - return false; - } +// checker+=signal_node->QueryDoubleAttribute("hOffset",&hOffset); +// checker+=signal_node->QueryDoubleAttribute("pitch",&pitch); +// checker+=signal_node->QueryDoubleAttribute("roll",&roll); + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing road signal attributes"<<endl; + return false; + } else { if(dynamic!="yes" && dynamic!="no") @@ -1099,7 +1137,7 @@ bool OpenDriveXmlParser::ReadSignals (Road* road, TiXmlElement *node) } } - road->AddSignal(); + road->AddSignal(); signal=road->GetLastSignal(); signal->SetS(s); signal->SetT(t); @@ -1126,162 +1164,162 @@ bool OpenDriveXmlParser::ReadSignals (Road* road, TiXmlElement *node) signal_node=signal_node->NextSiblingElement("signal"); } - return true; + return true; } //-------------- bool OpenDriveXmlParser::ReadSurface (Road* road, TiXmlElement *node) { - return true; + return true; } //-------------- bool OpenDriveXmlParser::ReadController (TiXmlElement *node) -{ return true; } +{ return true; } //-------------- bool OpenDriveXmlParser::ReadJunction (TiXmlElement *node) -{ - string name; - string id; - - int checker=TIXML_SUCCESS; - checker+=node->QueryStringAttribute("name",&name); - checker+=node->QueryStringAttribute("id",&id); - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Junction attributes"<<endl; - return false; - } +{ + string name; + string id; + + int checker=TIXML_SUCCESS; + checker+=node->QueryStringAttribute("name",&name); + checker+=node->QueryStringAttribute("id",&id); + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Junction attributes"<<endl; + return false; + } - mOpenDrive->AddJunction(name,id); - Junction* junction=mOpenDrive->GetLastJunction(); + mOpenDrive->AddJunction(name,id); + Junction* junction=mOpenDrive->GetLastJunction(); - //Read connection parameters and add them to the lane if available - TiXmlElement *subNode=node->FirstChildElement("connection"); + //Read connection parameters and add them to the lane if available + TiXmlElement *subNode=node->FirstChildElement("connection"); - while (subNode) - { - ReadJunctionConnection(junction, subNode); - subNode=subNode->NextSiblingElement("connection"); - } + while (subNode) + { + ReadJunctionConnection(junction, subNode); + subNode=subNode->NextSiblingElement("connection"); + } - //Read connection parameters and add them to the lane if available - subNode=node->FirstChildElement("priority"); + //Read connection parameters and add them to the lane if available + subNode=node->FirstChildElement("priority"); - while (subNode) - { - ReadJunctionPriority(junction, subNode); - subNode=subNode->NextSiblingElement("priority"); - } + while (subNode) + { + ReadJunctionPriority(junction, subNode); + subNode=subNode->NextSiblingElement("priority"); + } - //Read connection parameters and add them to the lane if available - subNode=node->FirstChildElement("controller"); + //Read connection parameters and add them to the lane if available + subNode=node->FirstChildElement("controller"); - while (subNode) - { - ReadJunctionController(junction, subNode); - subNode=subNode->NextSiblingElement("controller"); - } + while (subNode) + { + ReadJunctionController(junction, subNode); + subNode=subNode->NextSiblingElement("controller"); + } - return true; - + return true; + } //-------------- bool OpenDriveXmlParser::ReadJunctionConnection (Junction* junction, TiXmlElement *node) { - string id; - string incomingRoad; - string connectingRoad; - string contactPoint; - - int checker=TIXML_SUCCESS; - checker+=node->QueryStringAttribute("id",&id); - checker+=node->QueryStringAttribute("incomingRoad",&incomingRoad); - checker+=node->QueryStringAttribute("connectingRoad",&connectingRoad); - checker+=node->QueryStringAttribute("contactPoint",&contactPoint); - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Junction Connection attributes"<<endl; - return false; - } + string id; + string incomingRoad; + string connectingRoad; + string contactPoint; + + int checker=TIXML_SUCCESS; + checker+=node->QueryStringAttribute("id",&id); + checker+=node->QueryStringAttribute("incomingRoad",&incomingRoad); + checker+=node->QueryStringAttribute("connectingRoad",&connectingRoad); + checker+=node->QueryStringAttribute("contactPoint",&contactPoint); + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Junction Connection attributes"<<endl; + return false; + } else { if(contactPoint!="start" && contactPoint!="end") - { - cout<<"Error parsing junction connection attributes for junction " << junction->GetName() << ": invalid contact point: " << contactPoint << endl; - return false; - } + { + cout<<"Error parsing junction connection attributes for junction " << junction->GetName() << ": invalid contact point: " << contactPoint << endl; + return false; + } } - - junction->AddJunctionConnection(id,incomingRoad,connectingRoad,contactPoint); - JunctionConnection* junctionConnetion = junction->GetLastJunctionConnection(); + + junction->AddJunctionConnection(id,incomingRoad,connectingRoad,contactPoint); + JunctionConnection* junctionConnetion = junction->GetLastJunctionConnection(); - TiXmlElement *subNode=node->FirstChildElement("laneLink"); + TiXmlElement *subNode=node->FirstChildElement("laneLink"); - while (subNode) - { - ReadJunctionConnectionLaneLink(junctionConnetion, subNode); - subNode=subNode->NextSiblingElement("laneLink"); - } + while (subNode) + { + ReadJunctionConnectionLaneLink(junctionConnetion, subNode); + subNode=subNode->NextSiblingElement("laneLink"); + } - return true; + return true; } bool OpenDriveXmlParser::ReadJunctionConnectionLaneLink (JunctionConnection* junctionConnection, TiXmlElement *node) { - int from; - int to; - - int checker=TIXML_SUCCESS; - checker+=node->QueryIntAttribute("from",&from); - checker+=node->QueryIntAttribute("to",&to); - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Junction Lane Link attributes"<<endl; - return false; - } - - junctionConnection->AddJunctionLaneLink(from,to); - return true; + int from; + int to; + + int checker=TIXML_SUCCESS; + checker+=node->QueryIntAttribute("from",&from); + checker+=node->QueryIntAttribute("to",&to); + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Junction Lane Link attributes"<<endl; + return false; + } + + junctionConnection->AddJunctionLaneLink(from,to); + return true; } bool OpenDriveXmlParser::ReadJunctionPriority (Junction* junction, TiXmlElement *node) { - string high; - string low; - - int checker=TIXML_SUCCESS; - checker+=node->QueryStringAttribute("high",&high); - checker+=node->QueryStringAttribute("low",&low); - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Junction Priority attributes"<<endl; - return false; - } - - junction->AddJunctionPriority(high,low); - return true; + string high; + string low; + + int checker=TIXML_SUCCESS; + checker+=node->QueryStringAttribute("high",&high); + checker+=node->QueryStringAttribute("low",&low); + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Junction Priority attributes"<<endl; + return false; + } + + junction->AddJunctionPriority(high,low); + return true; } bool OpenDriveXmlParser::ReadJunctionController (Junction* junction, TiXmlElement *node) { - string id; - string type; - - int checker=TIXML_SUCCESS; - checker+=node->QueryStringAttribute("id",&id); - checker+=node->QueryStringAttribute("type",&type); - if (checker!=TIXML_SUCCESS) - { - cout<<"Error parsing Junction Controller attributes"<<endl; - return false; - } - - junction->AddJunctionController(id,type); - return true; + string id; + string type; + + int checker=TIXML_SUCCESS; + checker+=node->QueryStringAttribute("id",&id); + checker+=node->QueryStringAttribute("type",&type); + if (checker!=TIXML_SUCCESS) + { + cout<<"Error parsing Junction Controller attributes"<<endl; + return false; + } + + junction->AddJunctionController(id,type); + return true; } @@ -1291,46 +1329,46 @@ bool OpenDriveXmlParser::ReadJunctionController (Junction* junction, TiXmlElemen */ bool OpenDriveXmlParser::ReadFile(std::string fileName) { - //Read and load File - TiXmlDocument doc( fileName ); - bool loadOkay = doc.LoadFile(); - if (loadOkay) - { - TiXmlElement *rootNode=doc.FirstChildElement(); - //read header - int checker=TIXML_SUCCESS; - TiXmlElement *node=rootNode->FirstChildElement("header"); - ReadHeader(node); - - //read roads - node=rootNode->FirstChildElement("road"); - while (node!=0) - { - ReadRoad(node); - node=node->NextSiblingElement("road"); - } - - //read controllers - node=rootNode->FirstChildElement("controller"); - while (node!=0) - { - ReadController(node); - node=node->NextSiblingElement("controller"); - } - - //read junctions - node=rootNode->FirstChildElement("junction"); - while (node!=0) - { - ReadJunction(node); - node=node->NextSiblingElement("junction"); - } - - return true; - } - - //failed to read the file - cout<<"Could not read file: "<<fileName<<endl; - return false; + //Read and load File + TiXmlDocument doc( fileName ); + bool loadOkay = doc.LoadFile(); + if (loadOkay) + { + TiXmlElement *rootNode=doc.FirstChildElement(); + //read header + int checker=TIXML_SUCCESS; + TiXmlElement *node=rootNode->FirstChildElement("header"); + ReadHeader(node); + + //read roads + node=rootNode->FirstChildElement("road"); + while (node!=0) + { + ReadRoad(node); + node=node->NextSiblingElement("road"); + } + + //read controllers + node=rootNode->FirstChildElement("controller"); + while (node!=0) + { + ReadController(node); + node=node->NextSiblingElement("controller"); + } + + //read junctions + node=rootNode->FirstChildElement("junction"); + while (node!=0) + { + ReadJunction(node); + node=node->NextSiblingElement("junction"); + } + + return true; + } + + //failed to read the file + cout<<"Could not read file: "<<fileName<<endl; + return false; } //-------------- diff --git a/OpenRoadEd/OpenDrive/OpenDriveXmlWriter.cpp b/OpenRoadEd/OpenDrive/OpenDriveXmlWriter.cpp index fc3053d3d764cea53311ef8543f23beaf07d0d78..fab5a48272f558dcdcbdb334015ed6bc02cb3174 100644 --- a/OpenRoadEd/OpenDrive/OpenDriveXmlWriter.cpp +++ b/OpenRoadEd/OpenDrive/OpenDriveXmlWriter.cpp @@ -966,8 +966,28 @@ bool OpenDriveXmlWriter::WriteObjects (TiXmlElement *node, Road* road) text << setprecision(16) << setiosflags (ios_base::scientific) << height; object_node->SetAttribute("height",text.str()); } - - std::cout << "written object " << object->GetName() << " with id: " << object->GetId() << std::endl; + if(object->GetType()=="parkingSpace") + { + TiXmlElement *parking_node = new TiXmlElement("parkingSpace"); + object_node->LinkEndChild(parking_node); + parking_node->SetAttribute("access",object->GetParkingAccess()); + parking_node->SetAttribute("restrictions",object->GetParkingRestrictions()); + for(unsigned int i=0;i<object->GetNumParkingMarkings();i++) + { + TiXmlElement *parking_marking_node = new TiXmlElement("marking"); + std::string mark_side,mark_type,mark_color; + double mark_width; + + parking_node->LinkEndChild(parking_marking_node); + object->GetParkingMarking(i,mark_side,mark_type,mark_width,mark_color); + parking_marking_node->SetAttribute("side",mark_side); + parking_marking_node->SetAttribute("type",mark_type); + text.str(""); + text << setprecision(16) << setiosflags (ios_base::scientific) << mark_width; + parking_marking_node->SetAttribute("width",text.str()); + parking_marking_node->SetAttribute("color",mark_color); + } + } } return true; @@ -1019,8 +1039,6 @@ bool OpenDriveXmlWriter::WriteSignals (TiXmlElement *node, Road* road) // signal_node->SetAttribute("hOffset",signal->GetHeadingOffset()); // signal_node->SetAttribute("pitch",signal->GetPitch()); // signal_node->SetAttribute("roll",signal->GetRoll()); - - std::cout << "written signal " << signal->GetName() << " with id: " << signal->GetId() << std::endl; } return true; diff --git a/OpenRoadEd/Osg/OSGCameraControls.h b/OpenRoadEd/Osg/OSGCameraControls.h index 9cdcb930b5a24174448e1ec423116784aa568dc4..4a689ef98edb4a3358b3560b69bf2e599d6ea1eb 100644 --- a/OpenRoadEd/Osg/OSGCameraControls.h +++ b/OpenRoadEd/Osg/OSGCameraControls.h @@ -59,4 +59,4 @@ -#endif \ No newline at end of file +#endif diff --git a/OpenRoadEd/Osg/OSGCameraControls2.cpp b/OpenRoadEd/Osg/OSGCameraControls2.cpp index 4ccd4a438511c7cfe979714128e26f463778b4df..2587eb0f1ef3d2ba70d4efe56e83f8f63dcbc5c4 100644 --- a/OpenRoadEd/Osg/OSGCameraControls2.cpp +++ b/OpenRoadEd/Osg/OSGCameraControls2.cpp @@ -5,6 +5,8 @@ OSGCameraControls2::OSGCameraControls2() { mSpaceIsPressed=false; + mNode=NULL; + mParkingNode=NULL; } OSGCameraControls2::~OSGCameraControls2() {} @@ -23,6 +25,10 @@ void OSGCameraControls2::setNode(osg::Node* node) } if (getAutoComputeHomePosition()) computeHomePosition(); } +void OSGCameraControls2::setParkingNode(osg::Node* node) +{ + mParkingNode = node; +} const osg::Node* OSGCameraControls2::getNode() const { return mNode.get(); @@ -31,7 +37,10 @@ osg::Node* OSGCameraControls2::getNode() { return mNode.get(); } - +osg::Node* OSGCameraControls2::getParkingNode() +{ + return mParkingNode.get(); +} /** * Home methods (inherited from the matrix manipulator) */ @@ -50,11 +59,12 @@ void OSGCameraControls2::computeHomePosition() { double x,y,z,width,height; - if(getNode()) + if(getNode() && getParkingNode()) { osg::ref_ptr<osg::ComputeBoundsVisitor> cbv = new osg::ComputeBoundsVisitor(); //attach the compute bounds visitor to the node getNode()->accept(*cbv); + getParkingNode()->accept(*cbv); osg::BoundingBox bb(cbv->getBoundingBox()); x=(bb.xMax()+bb.xMin())/2.0; y=(bb.yMax()+bb.yMin())/2.0; diff --git a/OpenRoadEd/Osg/OSGCameraControls2.h b/OpenRoadEd/Osg/OSGCameraControls2.h index 063098017ef6c70c0390397a202e764b94fb2604..02c1085456a55222238fe2dd5ac3eb492ff70489 100644 --- a/OpenRoadEd/Osg/OSGCameraControls2.h +++ b/OpenRoadEd/Osg/OSGCameraControls2.h @@ -25,8 +25,10 @@ public: * Usually the root node */ virtual void setNode(osg::Node* node); + void setParkingNode(osg::Node* node); virtual const osg::Node* getNode() const; virtual osg::Node* getNode(); + osg::Node* getParkingNode(); /** * Home methods (inherited from the matrix manipulator) @@ -88,6 +90,7 @@ protected: * Node reference */ osg::ref_ptr<osg::Node> mNode; + osg::ref_ptr<osg::Node> mParkingNode; /** * Camera position, rotation diff --git a/OpenRoadEd/Osg/OSGMain.cpp b/OpenRoadEd/Osg/OSGMain.cpp index 360c0523433470782f13402a4ba6fffc0e27dbce..c06cb4b16dd224f5f479a6824b1d8d0b821076e4 100644 --- a/OpenRoadEd/Osg/OSGMain.cpp +++ b/OpenRoadEd/Osg/OSGMain.cpp @@ -109,6 +109,7 @@ void OSGMain::initViewer(QOSGWidget *viewer) // lala viewer->getCameraManipulator()->setNode(mRoadsGroup); +// ((OSGCameraControls2 *)viewer->getCameraManipulator())->setParkingNode(mRecordsHelpersGroup); } /** @@ -162,7 +163,27 @@ void OSGMain::ShowScenery(bool show) */ void OSGMain::ShowRecordsHelpers(bool show) { - mRecordsHelpersGroup->setNodeMask(show); + //mRecordsHelpersGroup->setNodeMask(show); + for(unsigned int i=0;i<mRecordsHelpersGroup->getNumChildren();i++) + { + osg::Group *group=mRecordsHelpersGroup->getChild(i)->asGroup(); + for(unsigned int l=0;l<group->getNumChildren();l++) + { + osg::Group *group2=group->getChild(l)->asGroup(); + for(unsigned int j=0;j<group2->getNumChildren();j++) + { + osg::MatrixTransform *transform=(osg::MatrixTransform *)group2->getChild(j)->asGroup(); + for(unsigned int k=0;k<transform->getNumChildren();k++) + { + OSGGeodeNode *geode=(OSGGeodeNode *)transform->getChild(k); + if(geode->GetNodeType()!=PARKING_OBJECT_NODE) + geode->setNodeMask(show); + else + geode->setNodeMask(true); + } + } + } + } mHelpersGroup->setNodeMask(show); } @@ -736,6 +757,7 @@ OSGObjectNode* OSGMain::PickNode(float x, float y) case SUPERELEVATION_NODE: case CROSSFALL_NODE: case OBJECT_NODE: + case PARKING_OBJECT_NODE: case SIGNAL_NODE: { //get the index of the parameter and then the index of the road @@ -942,6 +964,7 @@ void OSGMain::GetBoundingBox(double &x,double &y,double &width,double &height) osg::ref_ptr<osg::ComputeBoundsVisitor> cbv = new osg::ComputeBoundsVisitor(); //attach the compute bounds visitor to the node this->mRoadsGroup->accept(*cbv); + this->mRecordsHelpersGroup->accept(*cbv); osg::BoundingBox bb(cbv->getBoundingBox()); x=(bb.xMax()+bb.xMin())/2.0; @@ -1387,6 +1410,7 @@ OSGGeodeNode* OSGMain::FindNode(OSGObjectNode* objToSelect) break; } + case PARKING_OBJECT_NODE: case OBJECT_NODE: { roadParamInd=objToSelect->GetNodeInfoIndex(1); diff --git a/OpenRoadEd/Osg/OSGObjectNode.h b/OpenRoadEd/Osg/OSGObjectNode.h index 2a1457d263b005741908e8ab2f41595646a51207..e868514abb68db80e361bfe54d4f0af8897f9096 100644 --- a/OpenRoadEd/Osg/OSGObjectNode.h +++ b/OpenRoadEd/Osg/OSGObjectNode.h @@ -32,7 +32,8 @@ enum OSGNodeType LANE_HEIGHT_NODE, OBJECT_NODE, SIGNAL_NODE, - JUNCTION_NODE + JUNCTION_NODE, + PARKING_OBJECT_NODE, }; /** diff --git a/OpenRoadEd/Osg/OSGRecordsHelpers.cpp b/OpenRoadEd/Osg/OSGRecordsHelpers.cpp index dc5ea15aa372a22e30fe8ad4b812413749f73033..d3f58fcf602b449f9390c91a91908b2295873ab9 100644 --- a/OpenRoadEd/Osg/OSGRecordsHelpers.cpp +++ b/OpenRoadEd/Osg/OSGRecordsHelpers.cpp @@ -4,6 +4,7 @@ #include <osg/Geode> #include <osg/MatrixTransform> #include <osg/Geometry> +#include <osg/Material> #include <osgDB/ReadFile> #include <osg/Texture2D> #include <osg/ShapeDrawable> @@ -32,8 +33,8 @@ OSGRecordsHelpers::OSGRecordsHelpers() /** * Create a billboard node */ - CreateBillboard(); - CreateSignalBillboard(); + mBillboard=CreateBillboard(mSize,mSize); + mSignalBillboard=CreateBillboard(mSignalSize,mSignalSize); /** * Create an arrow @@ -258,8 +259,12 @@ void OSGRecordsHelpers::FillHelperGroups (Road *road,unsigned int roadIndex, osg } ////Objects and Signals for (unsigned int i = 0; i<road->GetObjectCount(); i++) - mObjectGroup->addChild(AddObjectHelper(road->GetObject(i)).get()); - + { + if(road->GetObject(i)->GetType()=="parkingSpace") + mObjectGroup->addChild(AddParkingHelper(road->GetObject(i)).get()); + else + mObjectGroup->addChild(AddObjectHelper(road->GetObject(i)).get()); + } for (unsigned int i = 0; i<road->GetSignalCount(); i++) mSignalGroup->addChild(AddSignalHelper(road->GetSignal(i)).get()); } @@ -471,6 +476,170 @@ osg::ref_ptr<osg::MatrixTransform> OSGRecordsHelpers::AddObjectHelper(Object *ob return matrix; } +osg::ref_ptr<osg::MatrixTransform> OSGRecordsHelpers::AddParkingHelper(Object *object) +{ + osg::ref_ptr<OSGGeodeNode> ShapeGeode = new OSGGeodeNode(); + osg::ref_ptr<osg::ShapeDrawable> Shape = new osg::ShapeDrawable; + osg::ref_ptr<osg::MatrixTransform> matrix = new osg::MatrixTransform; + matrix->setName("RecordMatrix"); + + //Get the coords and the heading for the current record + double x,y,hdg,elevation,s; + s=object->GetS(); + short int resultID=mRoad->GetGeometryCoords(s,x,y,hdg); + + if (resultID==-999) + return matrix; + + elevation=mRoad->GetElevationValue(s); + + double length,width,height,radius; + + object->GetBoundingBox(length,width,height); + //========================================================= + //Now, add a billboard with the texture of the needed type + //========================================================= + osg::ref_ptr<OSGGeodeNode> parkingGeode = new OSGGeodeNode(); + osg::ref_ptr<osg::Geometry> parkingGeom=new osg::Geometry; + parkingGeom->setUseDisplayList( false ); + + parkingGeode->SetNodeType(PARKING_OBJECT_NODE); + + osg::ref_ptr<osg::Vec3Array> parkingVertices = new osg::Vec3Array; + osg::ref_ptr<osg::DrawElementsUInt> parkingTris = new osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLES, 0); + osg::ref_ptr<osg::Vec2Array> parkingTexCoords = new osg::Vec2Array; + + parkingVertices->push_back(osg::Vec3(-length/2.0,-width/2.0,0)); + parkingVertices->push_back(osg::Vec3(length/2.0,-width/2.0,0)); + parkingVertices->push_back(osg::Vec3(length/2.0,width/2.0,0)); + parkingVertices->push_back(osg::Vec3(-length/2.0,width/2.0,0)); + parkingTris->push_back(1); + parkingTris->push_back(2); + parkingTris->push_back(3); + parkingTris->push_back(0); + parkingTris->push_back(1); + parkingTris->push_back(3); + parkingTexCoords->push_back(osg::Vec2(0,0)); + parkingTexCoords->push_back(osg::Vec2(1,0)); + parkingTexCoords->push_back(osg::Vec2(1,1)); + parkingTexCoords->push_back(osg::Vec2(0,1)); + + parkingGeode->addDrawable(parkingGeom); + parkingGeom->setVertexArray(parkingVertices.get()); + parkingGeom->setTexCoordArray(0,parkingTexCoords.get()); + parkingGeom->addPrimitiveSet(parkingTris.get()); + + osg::ref_ptr<osg::Material> roadMaterial = new osg::Material(); + //roadMaterial->setEmission(osg::Material::FRONT, osg::Vec4(0.0, 0.0, 0.0, 1.0)); + roadMaterial->setColorMode(osg::Material::AMBIENT_AND_DIFFUSE); + + std::string roadTextureFile; + roadTextureFile=":/Billboards/parkingSpace.jpg"; + // create a texture + // load image for texture + osg::Image *roadImage = convert_resource(roadTextureFile); + if (!roadImage) + { + roadImage = convert_resource(":/noTexture.jpg"); + osg::notify(osg::WARN) << "Couldn't load texture." << std::endl; + } + osg::ref_ptr<osg::Texture2D> roadTexture = new osg::Texture2D; + roadTexture->setDataVariance(osg::Object::DYNAMIC); + roadTexture->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT); + roadTexture->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT); + roadTexture->setImage(roadImage); + + osg::StateSet* roadStateSet=parkingGeom->getOrCreateStateSet(); + // assign the material and texture + roadStateSet->setAttribute(roadMaterial); + roadStateSet->setTextureAttributeAndModes(0, roadTexture, osg::StateAttribute::ON); + roadStateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); + roadStateSet->setMode(GL_BLEND,osg::StateAttribute::ON); + roadStateSet->setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF); + + //=========================================================================================== + //in order to translate the helper orthogonally to the heading, compute the cos and sin + //=========================================================================================== + x-=object->GetT()*sin(hdg); + y+=object->GetT()*cos(hdg); + + matrix->setMatrix(osg::Matrix::rotate(osg::inRadians(hdg+object->GetHeading()), osg::Vec3(0.0, 0.0, 1.0)) * + osg::Matrix::translate(osg::Vec3(x,y,elevation+object->GetZOffset())) ); + matrix->addChild(parkingGeode); + + //========================================================= + // Add mark + //========================================================= + std::string mark_side,mark_type,mark_color; + double mark_width; + + for(unsigned int i=0;i<object->GetNumParkingMarkings();i++) + { + object->GetParkingMarking(i,mark_side,mark_type,mark_width,mark_color); + osg::ref_ptr<OSGGeodeNode> markGeode = new OSGGeodeNode(); + osg::ref_ptr<osg::Geometry> markGeom=new osg::Geometry; + markGeom->setUseDisplayList( false ); + + markGeode->SetNodeType(PARKING_OBJECT_NODE); + + osg::ref_ptr<osg::Vec3Array> markVertices = new osg::Vec3Array; + osg::ref_ptr<osg::DrawElementsUInt> markTris = new osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLES, 0); + + if(mark_side=="front") + { + markVertices->push_back(osg::Vec3(-mark_width/2.0+length/2.0,-width/2.0,0)); + markVertices->push_back(osg::Vec3(mark_width/2.0+length/2.0,-width/2.0,0)); + markVertices->push_back(osg::Vec3(mark_width/2.0+length/2.0,width/2.0,0)); + markVertices->push_back(osg::Vec3(-mark_width/2.0+length/2.0,width/2.0,0)); + } + else if(mark_side=="rear") + { + markVertices->push_back(osg::Vec3(-mark_width/2.0-length/2.0,-width/2.0,0)); + markVertices->push_back(osg::Vec3(mark_width/2.0-length/2.0,-width/2.0,0)); + markVertices->push_back(osg::Vec3(mark_width/2.0-length/2.0,width/2.0,0)); + markVertices->push_back(osg::Vec3(-mark_width/2.0-length/2.0,width/2.0,0)); + } + else if(mark_side=="left") + { + markVertices->push_back(osg::Vec3(-length/2.0,-mark_width/2.0+width/2.0,0)); + markVertices->push_back(osg::Vec3(length/2.0,-mark_width/2.0+width/2.0,0)); + markVertices->push_back(osg::Vec3(length/2.0,mark_width/2.0+width/2.0,0)); + markVertices->push_back(osg::Vec3(-length/2.0,mark_width/2.0+width/2.0,0)); + } + else if(mark_side=="right") + { + markVertices->push_back(osg::Vec3(-length/2.0,-mark_width/2.0-width/2.0,0)); + markVertices->push_back(osg::Vec3(length/2.0,-mark_width/2.0-width/2.0,0)); + markVertices->push_back(osg::Vec3(length/2.0,mark_width/2.0-width/2.0,0)); + markVertices->push_back(osg::Vec3(-length/2.0,mark_width/2.0-width/2.0,0)); + } + + markTris->push_back(1); + markTris->push_back(2); + markTris->push_back(3); + markTris->push_back(0); + markTris->push_back(1); + markTris->push_back(3); + + markGeode->addDrawable(markGeom); + markGeom->setVertexArray(markVertices.get()); + markGeom->addPrimitiveSet(markTris.get()); + + osg::ref_ptr<osg::Vec4Array> colors = new osg::Vec4Array; + markGeom->setColorArray(colors.get()); + markGeom->setColorBinding(osg::Geometry::BIND_OVERALL); + colors->push_back(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f) ); + osg::StateSet* markState=markGeom->getOrCreateStateSet(); + // assign the material and texture + markState->setMode(GL_LIGHTING, osg::StateAttribute::OFF); + markState->setMode(GL_BLEND,osg::StateAttribute::ON); + markState->setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF); + + matrix->addChild(markGeode); + } + + return matrix; +} osg::ref_ptr<osg::MatrixTransform> OSGRecordsHelpers::AddSignalHelper(Signal *signal) { osg::ref_ptr<OSGGeodeNode> arrowGeode = new OSGGeodeNode(); @@ -575,66 +744,35 @@ osg::ref_ptr<osg::MatrixTransform> OSGRecordsHelpers::AddSignalHelper(Signal *si } //-------------- -void OSGRecordsHelpers::CreateBillboard() +osg::Geometry *OSGRecordsHelpers::CreateBillboard(double length, double width) { - mBillboard = new osg::Geometry(); + osg::Geometry *geometry = new osg::Geometry(); //arrays for vertices osg::ref_ptr<osg::Vec3Array> vertices = new osg::Vec3Array; - mBillboard->setVertexArray( vertices.get() ); + geometry->setVertexArray( vertices.get() ); osg::ref_ptr<osg::Vec2Array> texCoords = new osg::Vec2Array; - mBillboard->setTexCoordArray( 0, texCoords.get() ); + geometry->setTexCoordArray( 0, texCoords.get() ); osg::ref_ptr<osg::Vec4Array> colors = new osg::Vec4Array; colors->push_back(osg::Vec4(1,1,1,1)); - mBillboard->setColorArray( colors.get() ); - mBillboard->setColorBinding(osg::Geometry::BIND_OVERALL); - - double halfSize=mSize/2; + geometry->setColorArray( colors.get() ); + geometry->setColorBinding(osg::Geometry::BIND_OVERALL); - vertices->push_back(osg::Vec3(-halfSize,0,-halfSize)); + vertices->push_back(osg::Vec3(-length/2.0,0,-width/2.0)); texCoords->push_back(osg::Vec2(0,0)); - vertices->push_back(osg::Vec3(halfSize,0,-halfSize)); - texCoords->push_back(osg::Vec2(1,0)); - vertices->push_back(osg::Vec3(halfSize,0,halfSize)); + vertices->push_back(osg::Vec3(length/2.0,0,-width/2.0)); + texCoords->push_back(osg::Vec2(1,0)); + vertices->push_back(osg::Vec3(length/2.0,0,width/2.0)); texCoords->push_back(osg::Vec2(1,1)); - vertices->push_back(osg::Vec3(-halfSize,0,halfSize)); + vertices->push_back(osg::Vec3(-length/2.0,0,width/2.0)); texCoords->push_back(osg::Vec2(0,1)); //lines osg::ref_ptr<osg::DrawArrays> quad = new osg::DrawArrays(osg::PrimitiveSet::QUADS, 0, vertices.get()->size()); - mBillboard->addPrimitiveSet(quad.get()); + geometry->addPrimitiveSet(quad.get()); - mBillboard->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF); -} - -void OSGRecordsHelpers::CreateSignalBillboard() -{ - mSignalBillboard = new osg::Geometry(); - //arrays for vertices - osg::ref_ptr<osg::Vec3Array> vertices = new osg::Vec3Array; - mSignalBillboard->setVertexArray( vertices.get() ); - osg::ref_ptr<osg::Vec2Array> texCoords = new osg::Vec2Array; - mSignalBillboard->setTexCoordArray( 0, texCoords.get() ); - osg::ref_ptr<osg::Vec4Array> colors = new osg::Vec4Array; - colors->push_back(osg::Vec4(1,1,1,1)); - mSignalBillboard->setColorArray( colors.get() ); - mSignalBillboard->setColorBinding(osg::Geometry::BIND_OVERALL); - - double halfSize=mSignalSize/2; - - vertices->push_back(osg::Vec3(-halfSize,0,-halfSize)); - texCoords->push_back(osg::Vec2(0,0)); - vertices->push_back(osg::Vec3(halfSize,0,-halfSize)); - texCoords->push_back(osg::Vec2(1,0)); - vertices->push_back(osg::Vec3(halfSize,0,halfSize)); - texCoords->push_back(osg::Vec2(1,1)); - vertices->push_back(osg::Vec3(-halfSize,0,halfSize)); - texCoords->push_back(osg::Vec2(0,1)); - - //lines - osg::ref_ptr<osg::DrawArrays> quad = new osg::DrawArrays(osg::PrimitiveSet::QUADS, 0, vertices.get()->size()); - mSignalBillboard->addPrimitiveSet(quad.get()); + geometry->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF); - mSignalBillboard->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF); + return geometry; } void OSGRecordsHelpers::CreateArrow() diff --git a/OpenRoadEd/Osg/OSGRecordsHelpers.h b/OpenRoadEd/Osg/OSGRecordsHelpers.h index 1f59b7010a9cdc27b034c4fa80b3c423c707eac3..a1493049646476f8537ef2a82ac88df011c07c04 100644 --- a/OpenRoadEd/Osg/OSGRecordsHelpers.h +++ b/OpenRoadEd/Osg/OSGRecordsHelpers.h @@ -17,6 +17,7 @@ private: osg::ref_ptr<osg::Geometry> mBillboard; osg::ref_ptr<osg::Geometry> mSignalBillboard; + std::map<std::string,osg::ref_ptr<osg::Geometry>> mParkingBillboards; //these are shared between all the arrows osg::ref_ptr<osg::Vec3Array>mArrowVertices; @@ -32,8 +33,7 @@ private: /** * Create a billboard node */ - void CreateBillboard(); - void CreateSignalBillboard(); + osg::Geometry *CreateBillboard(double length, double width); /** * Create an arrow @@ -52,6 +52,7 @@ private: */ osg::ref_ptr<osg::MatrixTransform> AddRecordHelper(double s, double offsetX,double offsetY,double offsetZ, OSGNodeType type, std::string iconName, double extra_heading=0.0,osg::Vec4* color=NULL); osg::ref_ptr<osg::MatrixTransform> AddObjectHelper(Object *object); + osg::ref_ptr<osg::MatrixTransform> AddParkingHelper(Object *object); osg::ref_ptr<osg::MatrixTransform> AddSignalHelper(Signal *signal); public: OSGRecordsHelpers(); diff --git a/OpenRoadEd/Qt/CreationWidgets/CreationAllRoad.cpp b/OpenRoadEd/Qt/CreationWidgets/CreationAllRoad.cpp index dea1e497ecbf269b8bc8faa6541d19f9a416929e..a69ad3e0501f5d4b8707601d0c1471b64b1f2cf3 100644 --- a/OpenRoadEd/Qt/CreationWidgets/CreationAllRoad.cpp +++ b/OpenRoadEd/Qt/CreationWidgets/CreationAllRoad.cpp @@ -268,7 +268,7 @@ void CreationAllRoad::CreateRoadTypePressed() // Duplicate it if it exists if(lRoadType) index = lRoad->CloneRoadType(lRoad->GetRoadTypeCount()-1); // else create a blank one - else index = lRoad->AddRoadType(0,"Default"); + else index = lRoad->AddRoadType(0,"unknown"); // Redraws the road to reflect the changes mOsgMain->RedrawRoad(lCurSelection->GetIndex(0)); // Add new road type to the road tree diff --git a/OpenRoadEd/Qt/QOSGWidget.cpp b/OpenRoadEd/Qt/QOSGWidget.cpp index 7010fbcc47938930eabe828f0cbef9e8664e14eb..3bf8cab1d5a1de92885106d509f0ab05de4ddc52 100644 --- a/OpenRoadEd/Qt/QOSGWidget.cpp +++ b/OpenRoadEd/Qt/QOSGWidget.cpp @@ -1,6 +1,5 @@ #include "QOSGWidget.h" #include "moc_QOSGWidget.cpp" -#include "OSGCameraControls2.h" #include <osgGA/KeySwitchMatrixManipulator> #define SCREENSHOT_WIDTH 7000 @@ -24,6 +23,8 @@ QOSGWidget::QOSGWidget(OSGMain *osgMain, QWidget * parent, const char * name, Qt this->setThreadingModel(osgViewer::Viewer::SingleThreaded); this->setKeyEventSetsDone(0); + camera_controls=new OSGCameraControls2(); + display=addViewWidget(this->createGraphicsWindow(0,0,100,100)); QHBoxLayout* layout=new QHBoxLayout; layout->addWidget(display); @@ -60,6 +61,7 @@ QOSGWidget::QOSGWidget(OSGMain *osgMain, QWidget * parent, const char * name, Qt _timer.start(10); mOsgMain=osgMain; + camera_controls->setParkingNode(mOsgMain->mRecordsHelpersGroup); } QWidget* QOSGWidget::addViewWidget(osgQt::GraphicsWindowQt* gw) @@ -83,7 +85,7 @@ QWidget* QOSGWidget::addViewWidget(osgQt::GraphicsWindowQt* gw) this->addEventHandler(new osgViewer::ThreadingHandler); osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator=new osgGA::KeySwitchMatrixManipulator; - keyswitchManipulator->addMatrixManipulator('6',"Own2",new OSGCameraControls2()); + keyswitchManipulator->addMatrixManipulator('6',"Own2",camera_controls); this->setCameraManipulator(keyswitchManipulator.get()); //gw->setTouchEventsEnabled( true ); return gw->getGLWidget(); @@ -429,6 +431,7 @@ void QOSGWidget::Pick(QMouseEvent *e) case LANE_HEIGHT_NODE: mRoadTree->SelectLaneHeight(lLastPicked->GetNodeInfoIndex(0),lLastPicked->GetNodeInfoIndex(1),lLastPicked->GetNodeInfoIndex(2),lLastPicked->GetNodeInfoIndex(3)); break; + case PARKING_OBJECT_NODE: case OBJECT_NODE: mRoadTree->SelectObject(lLastPicked->GetNodeInfoIndex(0),lLastPicked->GetNodeInfoIndex(1)); break; diff --git a/OpenRoadEd/Qt/QOSGWidget.h b/OpenRoadEd/Qt/QOSGWidget.h index 5c19574534a0a31a637d40cbdbbbd7c4bbba889f..d8405d71d08e1df5a375004bdff0c8d4886204fe 100644 --- a/OpenRoadEd/Qt/QOSGWidget.h +++ b/OpenRoadEd/Qt/QOSGWidget.h @@ -12,6 +12,7 @@ #include <osgGA/MultiTouchTrackballManipulator> #include <osgDB/ReadFile> #include <osgQt/GraphicsWindowQt> +#include "OSGCameraControls2.h" #include <sys/stat.h> #include <sys/types.h> @@ -85,6 +86,8 @@ private: */ OSGMain *mOsgMain; + OSGCameraControls2 *camera_controls; + //Class with methods needed to take the screenshots osg::ref_ptr<OSGScreenshotRequest> mScreenshotRequest; diff --git a/OpenRoadEd/Qt/SettingsWidgets/SettingsRoadObject.cpp b/OpenRoadEd/Qt/SettingsWidgets/SettingsRoadObject.cpp index 71ab21a91dbbb15baff4f4d5fa8b61f857067733..6295e9d89fbafd6548b8b0eeb620599d368d63c1 100644 --- a/OpenRoadEd/Qt/SettingsWidgets/SettingsRoadObject.cpp +++ b/OpenRoadEd/Qt/SettingsWidgets/SettingsRoadObject.cpp @@ -69,6 +69,65 @@ SettingsRoadObject::SettingsRoadObject(OpenDrive *openDrive) mTypeMap["unknown"]="14"; mHeading = new QLineEdit; + mParkingAccess = new QComboBox; + mParkingAccess->insertItem(0,tr("all")); + mAccessMap["all"]="0"; + mParkingAccess->insertItem(1,tr("car")); + mAccessMap["car"]="1"; + mParkingAccess->insertItem(2,tr("women")); + mAccessMap["women"]="2"; + mParkingAccess->insertItem(3,tr("handicapped")); + mAccessMap["handicapped"]="3"; + mParkingAccess->insertItem(4,tr("bus")); + mAccessMap["bus"]="4"; + mParkingAccess->insertItem(5,tr("truck")); + mAccessMap["truck"]="5"; + mParkingAccess->insertItem(6,tr("residents")); + mAccessMap["residents"]="6"; + mParkingAccess->insertItem(7,tr("electric")); + mAccessMap["electric"]="7"; + mParkingRestrictions = new QComboBox; + mParkingRestrictions->insertItem(0,tr("none")); + mAccessMap["none"]="-1"; + mParkingRestrictions->insertItem(1,tr("2hr_limit")); + mAccessMap["2hr_limit"]="0"; + mParkingFrontMark = new QGroupBox; + mParkingFrontMark->setTitle(tr("ParkingFrontMarking")); + mParkingFrontMark->setCheckable(true); + mParkingFrontMark->setChecked(false); + mParkingFrontWidth = new QLineEdit; + mParkingFrontWidth->setText("0.3"); + QFormLayout *settingsParkingFrontMarkLayout = new QFormLayout; + settingsParkingFrontMarkLayout->addRow(tr("Width:"),mParkingFrontWidth); + mParkingFrontMark->setLayout(settingsParkingFrontMarkLayout); + mParkingRearMark = new QGroupBox; + mParkingRearMark->setTitle(tr("ParkingRearMarking")); + mParkingRearMark->setCheckable(true); + mParkingRearMark->setChecked(false); + mParkingRearWidth = new QLineEdit; + mParkingRearWidth->setText("0.3"); + QFormLayout *settingsParkingRearMarkLayout = new QFormLayout; + settingsParkingRearMarkLayout->addRow(tr("Width:"),mParkingRearWidth); + mParkingRearMark->setLayout(settingsParkingRearMarkLayout); + mParkingLeftMark = new QGroupBox; + mParkingLeftMark->setTitle(tr("ParkingLeftMarking")); + mParkingLeftMark->setCheckable(true); + mParkingLeftMark->setChecked(false); + mParkingLeftWidth = new QLineEdit; + mParkingLeftWidth->setText("0.3"); + QFormLayout *settingsParkingLeftMarkLayout = new QFormLayout; + settingsParkingLeftMarkLayout->addRow(tr("Width:"),mParkingLeftWidth); + mParkingLeftMark->setLayout(settingsParkingLeftMarkLayout); + mParkingRightMark = new QGroupBox; + mParkingRightMark->setTitle(tr("ParkingRightMarking")); + mParkingRightMark->setCheckable(true); + mParkingRightMark->setChecked(false); + mParkingRightWidth = new QLineEdit; + mParkingRightWidth->setText("0.3"); + QFormLayout *settingsParkingRightMarkLayout = new QFormLayout; + settingsParkingRightMarkLayout->addRow(tr("Width:"),mParkingRightWidth); + mParkingRightMark->setLayout(settingsParkingRightMarkLayout); + mBoundingBox = new QGroupBox; mBoundingBox->setTitle(tr("BoundingBox")); mBoundingBox->setCheckable(true); @@ -112,9 +171,15 @@ SettingsRoadObject::SettingsRoadObject(OpenDrive *openDrive) settingsFormLayout->addRow(tr("validLength:"),mValidLength); settingsFormLayout->addRow(tr("Type:"),mType); settingsFormLayout->addRow(tr("Heading:"),mHeading); + settingsFormLayout->addRow(tr("ParkingAccess:"),mParkingAccess); + settingsFormLayout->addRow(tr("ParkingRestrictions:"),mParkingRestrictions); QVBoxLayout *settingsGroupLayout = new QVBoxLayout; settingsGroupLayout->addLayout(settingsFormLayout); + settingsGroupLayout->addWidget(mParkingFrontMark); + settingsGroupLayout->addWidget(mParkingRearMark); + settingsGroupLayout->addWidget(mParkingLeftMark); + settingsGroupLayout->addWidget(mParkingRightMark); settingsGroupLayout->addWidget(mBoundingBox); settingsGroupLayout->addWidget(mBoundingCyl); @@ -137,7 +202,14 @@ SettingsRoadObject::SettingsRoadObject(OpenDrive *openDrive) "<p><b>zOffset</b> - z offset from track level to bottom edge of the object [meter]</p>" "<p><b>validLength</b> - extent of object's validity along s-axis (0.0 for point object) [meter]</p>" "<p><b>Type</b> - type identifier according to country code. -1 or none for unspecified type</p>" - "<p><b>heading</b> - heading angle of the object relative to road direction</p>" + "<p><b>Heading</b> - heading angle of the object relative to road direction</p>" + "<p><b>ParkingAccess</b> - type of parking. Only for ParkingSpace objects</p>" + "<p><b>ParkingRestrictions</b> - restrictions of the parking space. Only for ParkingSpace objects</p>" + "<p><b>ParkingFrontMark</b> - check if the parking space has a front mark</p>" + "<p><b>ParkingRearMark</b> - check if the parking space has a rear mark</p>" + "<p><b>ParkingLeftMark</b> - check if the parking space has a left mark</p>" + "<p><b>ParkingRightMark</b> - check if the parking space has a right mark</p>" + "<p><b>Width</b> - Width of the front mark of the parking space</p>" "<p><b>BoundingBox</b> - check if this road has a bounding box</p>" "<p><b>Box length</b> - length of the bounding box</p>" "<p><b>Box width</b> - width of the bounding box</p>" @@ -179,6 +251,16 @@ void SettingsRoadObject::LoadData(Object *object) disconnect(mValidLength, SIGNAL(editingFinished()), this, SLOT(ValidLengthChanged())); disconnect(mType, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(TypeChanged(const QString &))); disconnect(mHeading, SIGNAL(editingFinished()), this, SLOT(HeadingChanged())); + disconnect(mParkingAccess, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(ParkingAccessChanged(const QString &))); + disconnect(mParkingRestrictions, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(ParkingRestrictionsChanged(const QString &))); + disconnect(mParkingFrontMark, SIGNAL(clicked(bool)), this, SLOT(ParkingFrontMarkChanged(bool))); + disconnect(mParkingFrontWidth, SIGNAL(editingFinished()), this, SLOT(ParkingFrontWidthChanged())); + disconnect(mParkingRearMark, SIGNAL(clicked(bool)), this, SLOT(ParkingRearMarkChanged(bool))); + disconnect(mParkingRearWidth, SIGNAL(editingFinished()), this, SLOT(ParkingRearWidthChanged())); + disconnect(mParkingLeftMark, SIGNAL(clicked(bool)), this, SLOT(ParkingLeftMarkChanged(bool))); + disconnect(mParkingLeftWidth, SIGNAL(editingFinished()), this, SLOT(ParkingLeftWidthChanged())); + disconnect(mParkingRightMark, SIGNAL(clicked(bool)), this, SLOT(ParkingRightMarkChanged(bool))); + disconnect(mParkingRightWidth, SIGNAL(editingFinished()), this, SLOT(ParkingRightWidthChanged())); disconnect(mBoundingBox, SIGNAL(clicked(bool)), this, SLOT(BoundingBoxChanged(bool))); disconnect(mBoxLength, SIGNAL(editingFinished()), this, SLOT(BoxLengthChanged())); disconnect(mBoxWidth, SIGNAL(editingFinished()), this, SLOT(BoxWidthChanged())); @@ -239,6 +321,82 @@ void SettingsRoadObject::LoadData(Object *object) else mType->setCurrentIndex(15); mHeading->setText(QString("%1").arg(object->GetHeading())); + if(object->GetType()=="parkingSpace") + { + mParkingAccess->setEnabled(true); + if(object->GetParkingAccess()=="all") + mParkingAccess->setCurrentIndex(0); + else if(object->GetParkingAccess()=="car") + mParkingAccess->setCurrentIndex(1); + else if(object->GetParkingAccess()=="women") + mParkingAccess->setCurrentIndex(2); + else if(object->GetParkingAccess()=="handicapped") + mParkingAccess->setCurrentIndex(3); + else if(object->GetParkingAccess()=="bus") + mParkingAccess->setCurrentIndex(4); + else if(object->GetParkingAccess()=="truck") + mParkingAccess->setCurrentIndex(5); + else if(object->GetParkingAccess()=="residents") + mParkingAccess->setCurrentIndex(6); + else if(object->GetParkingAccess()=="electric") + mParkingAccess->setCurrentIndex(7); + mParkingRestrictions->setEnabled(true); + if(object->GetParkingRestrictions()=="none") + mParkingRestrictions->setCurrentIndex(0); + else if(object->GetParkingRestrictions()=="2hr_limit") + mParkingRestrictions->setCurrentIndex(1); + mParkingFrontMark->setEnabled(true); + mParkingFrontMark->setChecked(false); + mParkingRearMark->setEnabled(true); + mParkingRearMark->setChecked(false); + mParkingLeftMark->setEnabled(true); + mParkingLeftMark->setChecked(false); + mParkingRightMark->setEnabled(true); + mParkingRightMark->setChecked(false); + for(unsigned int i=0;i<object->GetNumParkingMarkings();i++) + { + std::string mark_side,mark_type,mark_color; + double mark_width; + object->GetParkingMarking(i,mark_side,mark_type,mark_width,mark_color); + if(mark_side=="front") + { + mParkingFrontMark->setChecked(true); + mParkingFrontWidth->setEnabled(true); + mParkingFrontWidth->setText(QString("%1").arg(mark_width)); + } + else if(mark_side=="rear") + { + mParkingRearMark->setChecked(true); + mParkingRearWidth->setEnabled(true); + mParkingRearWidth->setText(QString("%1").arg(mark_width)); + } + else if(mark_side=="left") + { + mParkingLeftMark->setChecked(true); + mParkingLeftWidth->setEnabled(true); + mParkingLeftWidth->setText(QString("%1").arg(mark_width)); + } + else if(mark_side=="right") + { + mParkingRightMark->setChecked(true); + mParkingRightWidth->setEnabled(true); + mParkingRightWidth->setText(QString("%1").arg(mark_width)); + } + } + } + else + { + mParkingAccess->setDisabled(true); + mParkingRestrictions->setDisabled(true); + mParkingFrontMark->setDisabled(true); + mParkingFrontWidth->setDisabled(true); + mParkingRearMark->setDisabled(true); + mParkingRearWidth->setDisabled(true); + mParkingLeftMark->setDisabled(true); + mParkingLeftWidth->setDisabled(true); + mParkingRightMark->setDisabled(true); + mParkingRightWidth->setDisabled(true); + } if(object->GetBoundingBox(length,width,height)) { @@ -271,6 +429,16 @@ void SettingsRoadObject::LoadData(Object *object) connect(mValidLength, SIGNAL(editingFinished()), this, SLOT(ValidLengthChanged())); connect(mType, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(TypeChanged(const QString &))); connect(mHeading, SIGNAL(editingFinished()), this, SLOT(HeadingChanged())); + connect(mParkingAccess, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(ParkingAccessChanged(const QString &))); + connect(mParkingRestrictions, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(ParkingRestrictionsChanged(const QString &))); + connect(mParkingFrontMark, SIGNAL(clicked(bool)), this, SLOT(ParkingFrontMarkChanged(bool))); + connect(mParkingFrontWidth, SIGNAL(editingFinished()), this, SLOT(ParkingFrontWidthChanged())); + connect(mParkingRearMark, SIGNAL(clicked(bool)), this, SLOT(ParkingRearMarkChanged(bool))); + connect(mParkingRearWidth, SIGNAL(editingFinished()), this, SLOT(ParkingRearWidthChanged())); + connect(mParkingLeftMark, SIGNAL(clicked(bool)), this, SLOT(ParkingLeftMarkChanged(bool))); + connect(mParkingLeftWidth, SIGNAL(editingFinished()), this, SLOT(ParkingLeftWidthChanged())); + connect(mParkingRightMark, SIGNAL(clicked(bool)), this, SLOT(ParkingRightMarkChanged(bool))); + connect(mParkingRightWidth, SIGNAL(editingFinished()), this, SLOT(ParkingRightWidthChanged())); connect(mBoundingBox, SIGNAL(clicked(bool)), this, SLOT(BoundingBoxChanged(bool))); connect(mBoxLength, SIGNAL(editingFinished()), this, SLOT(BoxLengthChanged())); connect(mBoxWidth, SIGNAL(editingFinished()), this, SLOT(BoxWidthChanged())); @@ -332,6 +500,27 @@ void SettingsRoadObject::ValidLengthChanged() void SettingsRoadObject::TypeChanged(const QString & text) { mObject->SetType(text.toStdString()); + if(mObject->GetType()=="parkingSpace") + { + mParkingAccess->setEnabled(true); + mParkingRestrictions->setEnabled(true); + mParkingFrontMark->setEnabled(true); + mParkingRearMark->setEnabled(true); + mParkingLeftMark->setEnabled(true); + mParkingRightMark->setEnabled(true); + mBoundingBox->setChecked(true); + mBoundingCyl->setChecked(false); + } + else + { + mParkingAccess->setDisabled(true); + mParkingRestrictions->setDisabled(true); + mParkingFrontMark->setDisabled(true); + mParkingRearMark->setDisabled(true); + mParkingLeftMark->setDisabled(true); + mParkingRightMark->setDisabled(true); + mObject->ClearParking(); + } emit RoadGeometryChanged(true); } @@ -341,6 +530,134 @@ void SettingsRoadObject::HeadingChanged() emit RoadGeometryChanged(true); } +void SettingsRoadObject::ParkingAccessChanged(const QString &text) +{ + mObject->SetParkingAccess(text.toStdString()); + emit RoadGeometryChanged(true); +} + +void SettingsRoadObject::ParkingRestrictionsChanged(const QString &text) +{ + mObject->SetParkingRestrictions(text.toStdString()); + emit RoadGeometryChanged(true); +} + +void SettingsRoadObject::ParkingFrontMarkChanged(bool on) +{ + double width; + + if(on) + { + mParkingFrontWidth->setEnabled(true); + width=mParkingFrontWidth->text().toDouble(); + mObject->AddParkingMarking("front","solid",width,"standard"); + } + else + { + mParkingFrontWidth->setDisabled(true); + mObject->RemoveParkingMarking("front"); + } + + emit RoadGeometryChanged(true); +} + +void SettingsRoadObject::ParkingFrontWidthChanged() +{ + double width; + + width=mParkingFrontWidth->text().toDouble(); + mObject->AddParkingMarking("front","solid",width,"standard"); + + emit RoadGeometryChanged(true); +} + +void SettingsRoadObject::ParkingRearMarkChanged(bool on) +{ + double width; + + if(on) + { + mParkingRearWidth->setEnabled(true); + width=mParkingRearWidth->text().toDouble(); + mObject->AddParkingMarking("rear","solid",width,"standard"); + } + else + { + mParkingRearWidth->setDisabled(true); + mObject->RemoveParkingMarking("rear"); + } + + emit RoadGeometryChanged(true); +} + +void SettingsRoadObject::ParkingRearWidthChanged() +{ + double width; + + width=mParkingRearWidth->text().toDouble(); + mObject->AddParkingMarking("rear","solid",width,"standard"); + + emit RoadGeometryChanged(true); +} + +void SettingsRoadObject::ParkingLeftMarkChanged(bool on) +{ + double width; + + if(on) + { + mParkingLeftWidth->setEnabled(true); + width=mParkingLeftWidth->text().toDouble(); + mObject->AddParkingMarking("left","solid",width,"standard"); + } + else + { + mParkingLeftWidth->setDisabled(true); + mObject->RemoveParkingMarking("left"); + } + + emit RoadGeometryChanged(true); +} + +void SettingsRoadObject::ParkingLeftWidthChanged() +{ + double width; + + width=mParkingLeftWidth->text().toDouble(); + mObject->AddParkingMarking("left","solid",width,"standard"); + + emit RoadGeometryChanged(true); +} + +void SettingsRoadObject::ParkingRightMarkChanged(bool on) +{ + double width; + + if(on) + { + mParkingRightWidth->setEnabled(true); + width=mParkingRightWidth->text().toDouble(); + mObject->AddParkingMarking("right","solid",width,"standard"); + } + else + { + mParkingRightWidth->setDisabled(true); + mObject->RemoveParkingMarking("right"); + } + + emit RoadGeometryChanged(true); +} + +void SettingsRoadObject::ParkingRightWidthChanged() +{ + double width; + + width=mParkingRightWidth->text().toDouble(); + mObject->AddParkingMarking("right","solid",width,"standard"); + + emit RoadGeometryChanged(true); +} + void SettingsRoadObject::BoundingBoxChanged(bool on) { double length,width,height; @@ -355,7 +672,10 @@ void SettingsRoadObject::BoundingBoxChanged(bool on) } else { - mObject->ClearBounding(); + if(mObject->GetType()=="parkingSpace") + mBoundingBox->setChecked(true); + else + mObject->ClearBounding(); } emit RoadGeometryChanged(true); diff --git a/OpenRoadEd/Qt/SettingsWidgets/SettingsRoadObject.h b/OpenRoadEd/Qt/SettingsWidgets/SettingsRoadObject.h index 393e7df8986183c4db9f22c625894372afa3ca2a..98db5b6b74ea548b678e5804736427e76c4dfc38 100644 --- a/OpenRoadEd/Qt/SettingsWidgets/SettingsRoadObject.h +++ b/OpenRoadEd/Qt/SettingsWidgets/SettingsRoadObject.h @@ -42,6 +42,8 @@ private: Object *mObject; std::map<std::string,std::string> mTypeMap; + std::map<std::string,std::string> mAccessMap; + std::map<std::string,std::string> mRestrictionsMap; /** * Interface widgets @@ -56,6 +58,16 @@ private: QLineEdit *mValidLength; QComboBox *mType; QLineEdit *mHeading; + QComboBox *mParkingAccess; + QComboBox *mParkingRestrictions; + QGroupBox *mParkingFrontMark; + QLineEdit *mParkingFrontWidth; + QGroupBox *mParkingRearMark; + QLineEdit *mParkingRearWidth; + QGroupBox *mParkingLeftMark; + QLineEdit *mParkingLeftWidth; + QGroupBox *mParkingRightMark; + QLineEdit *mParkingRightWidth; QGroupBox *mBoundingBox; QLineEdit *mBoxLength; QLineEdit *mBoxWidth; @@ -79,6 +91,16 @@ public slots: void ValidLengthChanged(); void TypeChanged(const QString & text); void HeadingChanged(); + void ParkingAccessChanged(const QString & text); + void ParkingRestrictionsChanged(const QString & text); + void ParkingFrontMarkChanged(bool on); + void ParkingFrontWidthChanged(); + void ParkingRearMarkChanged(bool on); + void ParkingRearWidthChanged(); + void ParkingLeftMarkChanged(bool on); + void ParkingLeftWidthChanged(); + void ParkingRightMarkChanged(bool on); + void ParkingRightWidthChanged(); void BoundingBoxChanged(bool on); void BoxLengthChanged(); void BoxWidthChanged(); diff --git a/OpenRoadEd/create_junction_road.cpp b/OpenRoadEd/create_junction_road.cpp index f0cfa2f0c8b5bb8fcc16bce7f79519157dc870a2..5f50c9ed4a30e2a3b96e492f67530d3bf7d2e2d9 100644 --- a/OpenRoadEd/create_junction_road.cpp +++ b/OpenRoadEd/create_junction_road.cpp @@ -112,7 +112,13 @@ unsigned int create_junction_road(RoadTree *road_tree, OpenDrive *open_drive,uns if(abs(lane->GetId())==abs(lane_link->GetFrom())) { lane_start_width=lane->GetWidthValue(s); - max_speed=lane->GetLaneSpeed(0)->GetMax(); + if(lane->GetLaneSpeedCount()>0) + max_speed=lane->GetLaneSpeed(0)->GetMax(); + else + { + std::cout << "Warning: Speed record missing. Using 60.0 Km/h" << std::endl; + max_speed=60.0; + } } } } @@ -253,7 +259,13 @@ unsigned int create_junction_road(RoadTree *road_tree, OpenDrive *open_drive,uns road->SetSuccessor("road",connection->GetConnectingRoad(), "start"); else road->SetSuccessor("road",connection->GetConnectingRoad(), "end"); - road->AddRoadType(0,predecessor->GetRoadType(0)->GetType()); + if(predecessor->GetRoadTypeCount()>0) + road->AddRoadType(0,predecessor->GetRoadType(0)->GetType()); + else + { + std::cout << "Warning: Road type record missing: Using town" << std::endl; + road->AddRoadType(0,"town"); + } road_tree->AddRoadType(road_index,0,false); road_id++; } @@ -367,7 +379,13 @@ unsigned int create_junction_road(RoadTree *road_tree, OpenDrive *open_drive,uns road->SetSuccessor("road",connection->GetConnectingRoad(), "start"); else road->SetSuccessor("road",connection->GetConnectingRoad(), "end"); - road->AddRoadType(0,predecessor->GetRoadType(0)->GetType()); + if(predecessor->GetRoadTypeCount()>0) + road->AddRoadType(0,predecessor->GetRoadType(0)->GetType()); + else + { + std::cout << "Warning: Road type record missing: Using town" << std::endl; + road->AddRoadType(0,"town"); + } road_tree->AddRoadType(road_index,0,false); road_id++; } diff --git a/Resources/Billboards/parkingSpace.jpg b/Resources/Billboards/parkingSpace.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c89d8eca0d161cdc34d5086fa0f040bd64ee9de8 Binary files /dev/null and b/Resources/Billboards/parkingSpace.jpg differ diff --git a/Resources/resources.qrc b/Resources/resources.qrc index 5a4c3ed4380d8c90a78abc8775ac2fcdf1bdf2e5..7dd1c347c3feb480102ea179d4f818b9facde727 100644 --- a/Resources/resources.qrc +++ b/Resources/resources.qrc @@ -37,6 +37,7 @@ <file>Billboards/JunctionConnection.jpg</file> <file>Billboards/LaneMaterial.jpg</file> <file>Billboards/Road.jpg</file> + <file>Billboards/parkingSpace.jpg</file> <file>Icons/Expand.png</file> <file>Icons/Collapse.png</file> <file>Icons/Hide.png</file> diff --git a/Samples/sample.xodr b/Samples/sample.xodr new file mode 100644 index 0000000000000000000000000000000000000000..73968295d9487709c5211ff9d1e89dca27d975f9 --- /dev/null +++ b/Samples/sample.xodr @@ -0,0 +1,1034 @@ +<?xml version="1.0" ?> +<OpenDRIVE> + <header revMajor="1" revMinor="1" name="Testfile" version="1" date="Thu Feb 8 14:24:06 2007" north="0.0000000000000000e+00" south="0.0000000000000000e+00" east="0.0000000000000000e+00" west="0.0000000000000000e+00" /> + <road name="road0" length="2.5000000000000000e+01" id="0" junction="-1"> + <link> + <predecessor elementType="road" elementId="9" contactPoint="end" /> + <successor elementType="junction" elementId="1" contactPoint="end" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="0.0000000000000000e+00" y="0.0000000000000000e+00" hdg="0.0000000000000000e+00" length="2.5000000000000000e+01"> + <line /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <left> + <lane id="1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </left> + <center> + <lane id="0" type="driving" level="false"> + <link /> + <roadMark sOffset="0.0000000000000000e+00" type="broken" weight="standard" color="standard" width="2.0000000000000001e-01" laneChange="both" /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects> + <object s="2.0000000000000000e+01" t="-6.5499999999999998e+00" id="10000" name="parking_slot1" dynamic="no" orientation="none" zOffset="0.0000000000000000e+00" validLength="0.0000000000000000e+00" type="parkingSpace" hdg="0.0000000000000000e+00" pitch="0.0000000000000000e+00" roll="0.0000000000000000e+00" length="1.0000000000000000e+01" width="4.2000000000000002e+00" height="1.0000000000000000e+00"> + <parkingSpace access="car" restrictions="2hr_limit"> + <marking side="front" type="solid" width="1.4999999999999999e-01" color="standard" /> + <marking side="rear" type="solid" width="1.4999999999999999e-01" color="standard" /> + <marking side="left" type="solid" width="1.4999999999999999e-01" color="standard" /> + <marking side="right" type="solid" width="1.4999999999999999e-01" color="standard" /> + </parkingSpace> + </object> + </objects> + <signals> + <signal s="1.0000000000000000e+01" t="-5.0000000000000000e+00" id="1001" name="pedestrian0_1" dynamic="no" orientation="-" zOffset="0.0000000000000000e+00" country="DEU" type="350" subtype="-1" value="0.0000000000000000e+00" /> + <signal s="1.5000000000000000e+01" t="5.0000000000000000e+00" id="1002" name="pedestrian0_2" dynamic="no" orientation="+" zOffset="0.0000000000000000e+00" country="DEU" type="350" subtype="-1" value="0.0000000000000000e+00" /> + </signals> + </road> + <road name="road1" length="2.5000000000000000e+01" id="1" junction="-1"> + <link> + <predecessor elementType="junction" elementId="1" contactPoint="end" /> + <successor elementType="road" elementId="2" contactPoint="start" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="4.5000000000000000e+01" y="0.0000000000000000e+00" hdg="0.0000000000000000e+00" length="2.5000000000000000e+01"> + <line /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <left> + <lane id="1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </left> + <center> + <lane id="0" type="driving" level="false"> + <link /> + <roadMark sOffset="0.0000000000000000e+00" type="broken" weight="standard" color="standard" width="2.0000000000000001e-01" laneChange="both" /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects /> + <signals /> + </road> + <road name="road2" length="1.5707963270000000e+01" id="2" junction="-1"> + <link> + <predecessor elementType="road" elementId="1" contactPoint="end" /> + <successor elementType="road" elementId="3" contactPoint="start" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="7.0000000000000000e+01" y="0.0000000000000000e+00" hdg="0.0000000000000000e+00" length="1.0000000000000000e-03"> + <spiral curvStart="0.0000000000000000e+00" curvEnd="1.0000000000000001e-01" /> + </geometry> + <geometry s="1.0000000000000000e-03" x="7.0000999999999749e+01" y="1.6666666663690484e-08" hdg="5.0000000000000002e-05" length="1.5707963270000000e+01"> + <arc curvature="1.0000000000000001e-01" /> + </geometry> + <geometry s="1.5708963270000000e+01" x="8.0000499987499865e+01" y="1.0000500006217495e+01" hdg="1.5708463270000002e+00" length="-1.0000000000000000e-03"> + <spiral curvStart="1.0000000000000001e-01" curvEnd="0.0000000000000000e+00" /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <left> + <lane id="1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </left> + <center> + <lane id="0" type="driving" level="false"> + <link /> + <roadMark sOffset="0.0000000000000000e+00" type="broken" weight="standard" color="standard" width="2.0000000000000001e-01" laneChange="both" /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects /> + <signals /> + </road> + <road name="road3" length="6.0000000000000000e+01" id="3" junction="-1"> + <link> + <predecessor elementType="road" elementId="2" contactPoint="end" /> + <successor elementType="road" elementId="4" contactPoint="start" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="8.0000000000000000e+01" y="1.0000000000000000e+01" hdg="1.5707963270000000e+00" length="6.0000000000000000e+01"> + <line /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <left> + <lane id="1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </left> + <center> + <lane id="0" type="driving" level="false"> + <link /> + <roadMark sOffset="0.0000000000000000e+00" type="broken" weight="standard" color="standard" width="2.0000000000000001e-01" laneChange="both" /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects> + <object s="3.0000000000000000e+01" t="-1.2000000000000000e+01" id="perimeter1" name="perimeter1" dynamic="no" orientation="none" zOffset="2.5000000000000000e+00" validLength="0.0000000000000000e+00" type="building" hdg="0.0000000000000000e+00" pitch="0.0000000000000000e+00" roll="0.0000000000000000e+00" length="5.0000000000000000e+00" width="1.0000000000000000e+02" height="5.0000000000000000e+00" /> + </objects> + <signals> + <signal s="5.0000000000000000e+00" t="-5.0000000000000000e+00" id="1031" name="max50_3_1" dynamic="no" orientation="-" zOffset="0.0000000000000000e+00" country="DEU" type="274" subtype="-1" value="5.0000000000000000e+01" /> + <signal s="5.5000000000000000e+01" t="5.0000000000000000e+00" id="1032" name="max50_3_2" dynamic="no" orientation="+" zOffset="0.0000000000000000e+00" country="DEU" type="274" subtype="-1" value="5.0000000000000000e+01" /> + <signal s="4.0000000000000000e+01" t="5.0000000000000000e+00" id="1033" name="parking_3_1" dynamic="no" orientation="+" zOffset="0.0000000000000000e+00" country="DEU" type="314" subtype="-1" value="0.0000000000000000e+00" /> + </signals> + </road> + <road name="road4" length="1.5707963270000000e+01" id="4" junction="-1"> + <link> + <predecessor elementType="road" elementId="3" contactPoint="end" /> + <successor elementType="road" elementId="5" contactPoint="start" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="8.0000000000000000e+01" y="7.0000000000000000e+01" hdg="1.5707963270000000e+00" length="1.0000000000000000e-03"> + <spiral curvStart="0.0000000000000000e+00" curvEnd="1.0000000000000001e-01" /> + </geometry> + <geometry s="1.0000000000000000e-03" x="7.9999999983333140e+01" y="7.0000999999999749e+01" hdg="1.5708463270000002e+00" length="1.5707963270000000e+01"> + <arc curvature="1.0000000000000001e-01" /> + </geometry> + <geometry s="1.5708963270000000e+01" x="6.9999499991731369e+01" y="8.0000499985448712e+01" hdg="3.1416426540000000e+00" length="-1.0000000000000000e-03"> + <spiral curvStart="1.0000000000000001e-01" curvEnd="0.0000000000000000e+00" /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <left> + <lane id="1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </left> + <center> + <lane id="0" type="driving" level="false"> + <link /> + <roadMark sOffset="0.0000000000000000e+00" type="broken" weight="standard" color="standard" width="2.0000000000000001e-01" laneChange="both" /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects /> + <signals /> + </road> + <road name="road5" length="2.5000000000000000e+01" id="5" junction="-1"> + <link> + <predecessor elementType="road" elementId="4" contactPoint="end" /> + <successor elementType="junction" elementId="2" contactPoint="end" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="7.0000000000000000e+01" y="8.0000000000000000e+01" hdg="3.1415926540000001e+00" length="2.5000000000000000e+01"> + <line /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <left> + <lane id="1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </left> + <center> + <lane id="0" type="driving" level="false"> + <link /> + <roadMark sOffset="0.0000000000000000e+00" type="broken" weight="standard" color="standard" width="2.0000000000000001e-01" laneChange="both" /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects /> + <signals /> + </road> + <road name="road6" length="2.5000000000000000e+01" id="6" junction="-1"> + <link> + <predecessor elementType="junction" elementId="2" contactPoint="end" /> + <successor elementType="road" elementId="7" contactPoint="start" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="2.5000000000000000e+01" y="8.0000000000000000e+01" hdg="3.1415926540000001e+00" length="2.5000000000000000e+01"> + <line /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <left> + <lane id="1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </left> + <center> + <lane id="0" type="driving" level="false"> + <link /> + <roadMark sOffset="0.0000000000000000e+00" type="broken" weight="standard" color="standard" width="2.0000000000000001e-01" laneChange="both" /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects /> + <signals /> + </road> + <road name="road7" length="1.5707963270000000e+01" id="7" junction="-1"> + <link> + <predecessor elementType="road" elementId="6" contactPoint="end" /> + <successor elementType="road" elementId="8" contactPoint="start" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="0.0000000000000000e+00" y="8.0000000000000000e+01" hdg="3.1415926540000001e+00" length="1.0000000000000000e-03"> + <spiral curvStart="0.0000000000000000e+00" curvEnd="1.0000000000000001e-01" /> + </geometry> + <geometry s="1.0000000000000000e-03" x="-9.9999999974999297e-04" y="7.9999999983332927e+01" hdg="3.1416426540000000e+00" length="1.5707963270000000e+01"> + <arc curvature="1.0000000000000001e-01" /> + </geometry> + <geometry s="1.5708963270000000e+01" x="-1.0000499983397582e+01" y="6.9999499989680245e+01" hdg="4.7124389810000000e+00" length="-1.0000000000000000e-03"> + <spiral curvStart="1.0000000000000001e-01" curvEnd="0.0000000000000000e+00" /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <left> + <lane id="1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </left> + <center> + <lane id="0" type="driving" level="false"> + <link /> + <roadMark sOffset="0.0000000000000000e+00" type="broken" weight="standard" color="standard" width="2.0000000000000001e-01" laneChange="both" /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects /> + <signals /> + </road> + <road name="road8" length="6.0000000000000000e+01" id="8" junction="-1"> + <link> + <predecessor elementType="road" elementId="7" contactPoint="end" /> + <successor elementType="road" elementId="9" contactPoint="start" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="-1.0000000000000000e+01" y="7.0000000000000000e+01" hdg="4.7123889800000001e+00" length="6.0000000000000000e+01"> + <line /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <left> + <lane id="1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </left> + <center> + <lane id="0" type="driving" level="false"> + <link /> + <roadMark sOffset="0.0000000000000000e+00" type="broken" weight="standard" color="standard" width="2.0000000000000001e-01" laneChange="both" /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects> + <object s="3.0000000000000000e+01" t="-1.2000000000000000e+01" id="perimeter3" name="perimeter3" dynamic="no" orientation="none" zOffset="2.5000000000000000e+00" validLength="0.0000000000000000e+00" type="none" hdg="0.0000000000000000e+00" pitch="0.0000000000000000e+00" roll="0.0000000000000000e+00" length="5.0000000000000000e+00" width="1.0000000000000000e+02" height="5.0000000000000000e+00" /> + <object s="3.0000000000000000e+01" t="-6.5000000000000000e+00" id="2" name="parkingslot2" dynamic="no" orientation="none" zOffset="0.0000000000000000e+00" validLength="0.0000000000000000e+00" type="parkingSpace" hdg="0.0000000000000000e+00" pitch="0.0000000000000000e+00" roll="0.0000000000000000e+00" length="1.0000000000000000e+01" width="4.2000000000000002e+00" height="5.0000000000000000e+00"> + <parkingSpace access="all" restrictions="none"> + <marking side="front" type="solid" width="1.4999999999999999e-01" color="standard" /> + </parkingSpace> + </object> + </objects> + <signals> + <signal s="5.0000000000000000e+00" t="-5.0000000000000000e+00" id="1081" name="max50_8_1" dynamic="no" orientation="-" zOffset="0.0000000000000000e+00" country="DEU" type="274" subtype="-1" value="5.0000000000000000e+01" /> + <signal s="5.5000000000000000e+01" t="5.0000000000000000e+00" id="1082" name="max50_7_2" dynamic="no" orientation="+" zOffset="0.0000000000000000e+00" country="DEU" type="274" subtype="-1" value="5.0000000000000000e+01" /> + </signals> + </road> + <road name="road9" length="1.5707963270000000e+01" id="9" junction="-1"> + <link> + <predecessor elementType="road" elementId="8" contactPoint="end" /> + <successor elementType="road" elementId="0" contactPoint="start" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="-1.0000000000000000e+01" y="1.0000000000000000e+01" hdg="4.7123889800000001e+00" length="1.0000000000000000e-03"> + <spiral curvStart="0.0000000000000000e+00" curvEnd="1.0000000000000001e-01" /> + </geometry> + <geometry s="1.0000000000000000e-03" x="-1.0000000272313564e+01" y="9.9990000000371886e+00" hdg="4.7123889800000001e+00" length="1.5707963270000000e+01"> + <arc curvature="1.0000000000000001e-01" /> + </geometry> + <geometry s="1.5707963270000000e+01" x="-3.3536281043515387e-03" y="-3.3892401329413957e-03" hdg="6.2831853070000001e+00" length="-1.0000000000000000e-03"> + <spiral curvStart="1.0000000000000001e-01" curvEnd="0.0000000000000000e+00" /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <left> + <lane id="1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </left> + <center> + <lane id="0" type="driving" level="false"> + <link /> + <roadMark sOffset="0.0000000000000000e+00" type="broken" weight="standard" color="standard" width="2.0000000000000001e-01" laneChange="both" /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects /> + <signals /> + </road> + <road name="road10" length="6.0000000000000000e+01" id="10" junction="-1"> + <link> + <predecessor elementType="junction" elementId="1" contactPoint="end" /> + <successor elementType="junction" elementId="2" contactPoint="end" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="3.5000000000000000e+01" y="1.0000000000000000e+01" hdg="1.5707963270000000e+00" length="6.0000000000000000e+01"> + <line /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <left> + <lane id="1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </left> + <center> + <lane id="0" type="driving" level="false"> + <link /> + <roadMark sOffset="0.0000000000000000e+00" type="broken" weight="standard" color="standard" width="2.0000000000000001e-01" laneChange="both" /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects> + <object s="3.0000000000000000e+01" t="2.2500000000000000e+01" id="object0" name="object0" dynamic="no" orientation="none" zOffset="2.5000000000000000e+00" validLength="0.0000000000000000e+00" type="building" hdg="0.0000000000000000e+00" pitch="0.0000000000000000e+00" roll="0.0000000000000000e+00" length="2.5000000000000000e+01" width="6.0000000000000000e+01" height="5.0000000000000000e+00" /> + <object s="5.0000000000000000e+01" t="-2.2500000000000000e+01" id="object1" name="object1" dynamic="no" orientation="none" zOffset="2.5000000000000000e+00" validLength="0.0000000000000000e+00" type="building" hdg="0.0000000000000000e+00" pitch="0.0000000000000000e+00" roll="0.0000000000000000e+00" length="2.5000000000000000e+01" width="2.0000000000000000e+01" height="5.0000000000000000e+00" /> + <object s="1.5000000000000000e+01" t="-2.2500000000000000e+01" id="object2" name="object2" dynamic="no" orientation="none" zOffset="2.5000000000000000e+00" validLength="0.0000000000000000e+00" type="building" hdg="0.0000000000000000e+00" pitch="0.0000000000000000e+00" roll="0.0000000000000000e+00" length="2.5000000000000000e+01" width="3.0000000000000000e+01" height="5.0000000000000000e+00" /> + </objects> + <signals> + <signal s="3.2000000000000000e+01" t="-5.0000000000000000e+00" id="1101" name="parking_10_1" dynamic="no" orientation="-" zOffset="0.0000000000000000e+00" country="DEU" type="314" subtype="-1" value="0.0000000000000000e+00" /> + <signal s="6.0000000000000000e+01" t="-5.0000000000000000e+00" id="1102" name="giveway_10_1" dynamic="no" orientation="-" zOffset="0.0000000000000000e+00" country="DEU" type="205" subtype="-1" value="0.0000000000000000e+00" /> + <signal s="0.0000000000000000e+00" t="5.0000000000000000e+00" id="1103" name="giveway_10_2" dynamic="no" orientation="+" zOffset="0.0000000000000000e+00" country="DEU" type="205" subtype="-1" value="0.0000000000000000e+00" /> + <signal s="5.0000000000000000e+00" t="-5.0000000000000000e+00" id="1104" name="max50_10_1" dynamic="no" orientation="-" zOffset="0.0000000000000000e+00" country="DEU" type="274" subtype="-1" value="5.0000000000000000e+01" /> + <signal s="5.5000000000000000e+01" t="5.0000000000000000e+00" id="1105" name="max50_10_2" dynamic="no" orientation="+" zOffset="0.0000000000000000e+00" country="DEU" type="274" subtype="-1" value="5.0000000000000000e+01" /> + </signals> + </road> + <road name="juntion_0_-1_1_-1" length="2.0000000000000000e+01" id="1000" junction="1"> + <link> + <predecessor elementType="road" elementId="0" contactPoint="end" /> + <successor elementType="road" elementId="1" contactPoint="start" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="2.5000000000000000e+01" y="0.0000000000000000e+00" hdg="0.0000000000000000e+00" length="2.0000000000000000e+01"> + <line /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <center> + <lane id="0" type="driving" level="false"> + <link /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects> + <object s="1.0000000000000000e+01" t="-1.2000000000000000e+01" id="perimeter0" name="perimeter0" dynamic="no" orientation="none" zOffset="2.5000000000000000e+00" validLength="0.0000000000000000e+00" type="building" hdg="0.0000000000000000e+00" pitch="0.0000000000000000e+00" roll="0.0000000000000000e+00" length="5.0000000000000000e+00" width="1.2000000000000000e+02" height="5.0000000000000000e+00" /> + </objects> + <signals /> + </road> + <road name="juntion_1_1_0_1" length="2.0000000000000000e+01" id="1001" junction="1"> + <link> + <predecessor elementType="road" elementId="1" contactPoint="start" /> + <successor elementType="road" elementId="0" contactPoint="end" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="4.5000000000000000e+01" y="0.0000000000000000e+00" hdg="3.1415799999999998e+00" length="2.0000000000000000e+01"> + <line /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <center> + <lane id="0" type="driving" level="false"> + <link /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects /> + <signals /> + </road> + <road name="juntion_0_-1_10_-1" length="1.5709921586393582e+01" id="1002" junction="1"> + <link> + <predecessor elementType="road" elementId="0" contactPoint="end" /> + <successor elementType="road" elementId="10" contactPoint="start" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="2.5000000000000000e+01" y="0.0000000000000000e+00" hdg="0.0000000000000000e+00" length="2.0510348974767112e-09"> + <line /> + </geometry> + <geometry s="2.0510348974767112e-09" x="2.5000000002051035e+01" y="0.0000000000000000e+00" hdg="0.0000000000000000e+00" length="1.0000000000000000e-03"> + <spiral curvStart="0.0000000000000000e+00" curvEnd="1.0000026537984180e-01" /> + </geometry> + <geometry s="1.0000020510348975e-03" x="2.5001000002050784e+01" y="1.6666710893664086e-08" hdg="5.0000132689920889e-05" length="1.5707921584342548e+01"> + <arc curvature="1.0000026537984180e-01" /> + </geometry> + <geometry s="1.5708921586393583e+01" x="3.5000473451637099e+01" y="1.0000473468303746e+01" hdg="1.5708463271326900e+00" length="1.0000000000000000e-03"> + <spiral curvStart="1.0000026537984180e-01" curvEnd="0.0000000000000000e+00" /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <center> + <lane id="0" type="driving" level="false"> + <link /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects /> + <signals /> + </road> + <road name="juntion_10_1_0_1" length="1.5709975894455384e+01" id="1003" junction="1"> + <link> + <predecessor elementType="road" elementId="10" contactPoint="start" /> + <successor elementType="road" elementId="0" contactPoint="end" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="3.5000000000000000e+01" y="1.0000000000000000e+01" hdg="4.7123763269999994e+00" length="2.5306974480443500e-04"> + <line /> + </geometry> + <geometry s="2.5306974480443500e-04" x="3.4999999996797811e+01" y="9.9997469302552151e+00" hdg="4.7123763269999994e+00" length="1.0000000000000000e-03"> + <spiral curvStart="0.0000000000000000e+00" curvEnd="-1.0000153074568541e-01" /> + </geometry> + <geometry s="1.2530697448044350e-03" x="3.4999999967477500e+01" y="9.9987469302557557e+00" hdg="4.7123263262346269e+00" length="1.5707722824710581e+01"> + <arc curvature="-1.0000153074568541e-01" /> + </geometry> + <geometry s="1.5708975894455385e+01" x="2.4999526525369703e+01" y="-4.7344598170084851e-04" hdg="3.1415299992346277e+00" length="1.0000000000000000e-03"> + <spiral curvStart="-1.0000153074568541e-01" curvEnd="0.0000000000000000e+00" /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <center> + <lane id="0" type="driving" level="false"> + <link /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects /> + <signals /> + </road> + <road name="juntion_10_1_1_-1" length="1.5710120346678314e+01" id="1004" junction="1"> + <link> + <predecessor elementType="road" elementId="10" contactPoint="start" /> + <successor elementType="road" elementId="1" contactPoint="start" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="3.5000000000000000e+01" y="1.0000000000000000e+01" hdg="4.7123763269999994e+00" length="1.0000000000000000e-03"> + <spiral curvStart="0.0000000000000000e+00" curvEnd="9.9998999976484537e-02" /> + </geometry> + <geometry s="1.0000000000000000e-03" x="3.5000000004013110e+01" y="9.9990000000001178e+00" hdg="4.7124263264999877e+00" length="1.5707993813631946e+01"> + <arc curvature="9.9998999976484537e-02" /> + </geometry> + <geometry s="1.5708993813631945e+01" x="4.5000346926064282e+01" y="-7.2653541527145649e-04" hdg="6.2832099994999879e+00" length="1.0000000000000000e-03"> + <spiral curvStart="9.9998999976484537e-02" curvEnd="0.0000000000000000e+00" /> + </geometry> + <geometry s="1.5709993813631945e+01" x="4.5001346926062482e+01" y="-7.2647738995110136e-04" hdg="6.2832599989999762e+00" length="1.2653304636955909e-04"> + <line /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <center> + <lane id="0" type="driving" level="false"> + <link /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects /> + <signals /> + </road> + <road name="juntion_1_1_10_-1" length="1.5709921584511781e+01" id="1005" junction="1"> + <link> + <predecessor elementType="road" elementId="1" contactPoint="start" /> + <successor elementType="road" elementId="10" contactPoint="start" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="4.5000000000000000e+01" y="0.0000000000000000e+00" hdg="3.1415799999999998e+00" length="1.2653464747280907e-04"> + <line /> + </geometry> + <geometry s="1.2653464747280907e-04" x="4.4999873465352536e+01" y="1.6011175237333795e-09" hdg="3.1415799999999998e+00" length="1.0000000000000000e-03"> + <spiral curvStart="0.0000000000000000e+00" curvEnd="-1.0000026534682657e-01" /> + </geometry> + <geometry s="1.1265346474728091e-03" x="4.4998873465353078e+01" y="3.0921418200480930e-08" hdg="3.1415299998673265e+00" length="1.5707795049864309e+01"> + <arc curvature="-1.0000026534682657e-01" /> + </geometry> + <geometry s="1.5708921584511781e+01" x="3.4999526548027013e+01" y="1.0000473474630535e+01" hdg="1.5707463268673272e+00" length="1.0000000000000000e-03"> + <spiral curvStart="-1.0000026534682657e-01" curvEnd="0.0000000000000000e+00" /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <center> + <lane id="0" type="driving" level="false"> + <link /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects /> + <signals /> + </road> + <road name="juntion_5_-1_6_-1" length="2.0000000000000000e+01" id="1006" junction="2"> + <link> + <predecessor elementType="road" elementId="5" contactPoint="end" /> + <successor elementType="road" elementId="6" contactPoint="start" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="4.5000000000000000e+01" y="7.9999999989744822e+01" hdg="3.1415926540000001e+00" length="2.0000000000000000e+01"> + <line /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <center> + <lane id="0" type="driving" level="false"> + <link /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects> + <object s="1.0000000000000000e+01" t="-1.2000000000000000e+01" id="perimeter2" name="perimeter2" dynamic="no" orientation="none" zOffset="2.5000000000000000e+00" validLength="0.0000000000000000e+00" type="building" hdg="0.0000000000000000e+00" pitch="0.0000000000000000e+00" roll="0.0000000000000000e+00" length="5.0000000000000000e+00" width="1.2000000000000000e+02" height="5.0000000000000000e+00" /> + </objects> + <signals /> + </road> + <road name="juntion_5_-1_10_1" length="1.5709921580400758e+01" id="1007" junction="2"> + <link> + <predecessor elementType="road" elementId="5" contactPoint="end" /> + <successor elementType="road" elementId="10" contactPoint="end" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="4.5000000000000000e+01" y="7.9999999989744822e+01" hdg="3.1415926540000001e+00" length="1.0000000000000000e-03"> + <spiral curvStart="0.0000000000000000e+00" curvEnd="1.0000026520325046e-01" /> + </geometry> + <geometry s="1.0000000000000000e-03" x="4.4999000000000251e+01" y="7.9999999973077692e+01" hdg="3.1416426541326019e+00" length="1.5707795072416884e+01"> + <arc curvature="1.0000026520325046e-01" /> + </geometry> + <geometry s="1.5708795072416883e+01" x="3.4999526531330694e+01" y="6.9999653039344068e+01" hdg="4.7124263271326008e+00" length="1.0000000000000000e-03"> + <spiral curvStart="1.0000026520325046e-01" curvEnd="0.0000000000000000e+00" /> + </geometry> + <geometry s="1.5709795072416883e+01" x="3.4999526602010867e+01" y="6.9998653039346678e+01" hdg="4.7124763272652022e+00" length="1.2650798387525697e-04"> + <line /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <center> + <lane id="0" type="driving" level="false"> + <link /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects /> + <signals /> + </road> + <road name="juntion_6_1_10_1" length="1.5710120345618366e+01" id="1008" junction="2"> + <link> + <predecessor elementType="road" elementId="6" contactPoint="start" /> + <successor elementType="road" elementId="10" contactPoint="end" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="2.5000000000000000e+01" y="8.0000000000000000e+01" hdg="1.2653999999834298e-05" length="1.0000000000000000e-03"> + <spiral curvStart="0.0000000000000000e+00" curvEnd="-9.9999000153067119e-02" /> + </geometry> + <geometry s="1.0000000000000000e-03" x="2.5000999999999880e+01" y="7.9999999995987494e+01" hdg="-3.7345500076699277e-05" length="1.5708120327159305e+01"> + <arc curvature="-9.9999000153067119e-02" /> + </geometry> + <geometry s="1.5709120327159305e+01" x="3.5000726519984596e+01" y="6.9999526556482252e+01" hdg="-1.5708336725000767e+00" length="1.0000000000000000e-03"> + <spiral curvStart="-9.9999000153067119e-02" curvEnd="0.0000000000000000e+00" /> + </geometry> + <geometry s="1.5710120327159304e+01" x="3.5000726449305887e+01" y="6.9998526556484862e+01" hdg="-1.5708836720001531e+00" length="1.8459061834619206e-08"> + <line /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <center> + <lane id="0" type="driving" level="false"> + <link /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects /> + <signals /> + </road> + <road name="juntion_6_1_5_1" length="2.0000000000000000e+01" id="1009" junction="2"> + <link> + <predecessor elementType="road" elementId="6" contactPoint="start" /> + <successor elementType="road" elementId="5" contactPoint="end" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="2.5000000000000000e+01" y="8.0000000000000000e+01" hdg="1.2653999999834298e-05" length="2.0000000000000000e+01"> + <line /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <center> + <lane id="0" type="driving" level="false"> + <link /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects /> + <signals /> + </road> + <road name="juntion_10_-1_5_1" length="1.5709921592724829e+01" id="1010" junction="2"> + <link> + <predecessor elementType="road" elementId="10" contactPoint="end" /> + <successor elementType="road" elementId="5" contactPoint="end" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="3.4999999987693798e+01" y="7.0000000000000000e+01" hdg="1.5707963270000000e+00" length="1.0000000000000000e-03"> + <spiral curvStart="0.0000000000000000e+00" curvEnd="-1.0000026549040329e-01" /> + </geometry> + <geometry s="1.0000000000000000e-03" x="3.5000000004360302e+01" y="7.0000999999999749e+01" hdg="1.5707463268672548e+00" length="1.5707795027311636e+01"> + <arc curvature="-1.0000026549040329e-01" /> + </geometry> + <geometry s="1.5708795027311636e+01" x="4.5000346903226394e+01" y="8.0000473446107492e+01" hdg="-3.7346132745419425e-05" length="1.0000000000000000e-03"> + <spiral curvStart="-1.0000026549040329e-01" curvEnd="0.0000000000000000e+00" /> + </geometry> + <geometry s="1.5709795027311635e+01" x="4.5001346903223784e+01" y="8.0000473375427944e+01" hdg="-8.7346265490565649e-05" length="1.2656541319344683e-04"> + <line /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <center> + <lane id="0" type="driving" level="false"> + <link /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <roadMark sOffset="0.0000000000000000e+00" type="solid" weight="standard" color="standard" width="2.9999999999999999e-01" laneChange="both" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects /> + <signals /> + </road> + <road name="juntion_10_-1_6_-1" length="1.5709921580249619e+01" id="1011" junction="2"> + <link> + <predecessor elementType="road" elementId="10" contactPoint="end" /> + <successor elementType="road" elementId="6" contactPoint="start" /> + </link> + <type s="0.0000000000000000e+00" type="town" /> + <planView> + <geometry s="0.0000000000000000e+00" x="3.4999999987693798e+01" y="7.0000000000000000e+01" hdg="1.5707963270000000e+00" length="1.8459305195506204e-08"> + <line /> + </geometry> + <geometry s="1.8459305195506204e-08" x="3.4999999987693798e+01" y="7.0000000018459303e+01" hdg="1.5707963270000000e+00" length="1.0000000000000000e-03"> + <spiral curvStart="0.0000000000000000e+00" curvEnd="1.0000026552341455e-01" /> + </geometry> + <geometry s="1.0000184593051955e-03" x="3.4999999971026881e+01" y="7.0001000018459052e+01" hdg="1.5708463271327617e+00" length="1.5707921561790315e+01"> + <arc curvature="1.0000026552341455e-01" /> + </geometry> + <geometry s="1.5708921580249619e+01" x="2.4999526531696123e+01" y="8.0000473451637035e+01" hdg="3.1416426541327618e+00" length="1.0000000000000000e-03"> + <spiral curvStart="1.0000026552341455e-01" curvEnd="0.0000000000000000e+00" /> + </geometry> + </planView> + <elevationProfile /> + <lateralProfile /> + <lanes> + <laneSection s="0.0000000000000000e+00"> + <center> + <lane id="0" type="driving" level="false"> + <link /> + </lane> + </center> + <right> + <lane id="-1" type="driving" level="false"> + <link /> + <width sOffset="0.0000000000000000e+00" a="4.4000000000000004e+00" b="0.0000000000000000e+00" c="0.0000000000000000e+00" d="0.0000000000000000e+00" /> + <speed sOffset="0.0000000000000000e+00" max="6.0000000000000000e+01" /> + </lane> + </right> + </laneSection> + </lanes> + <objects /> + <signals /> + </road> + <junction name="junction_1" id="1"> + <connection id="1" incomingRoad="0" connectingRoad="1" contactPoint="end"> + <laneLink from="-1" to="-1" /> + </connection> + <connection id="2" incomingRoad="1" connectingRoad="0" contactPoint="start"> + <laneLink from="1" to="1" /> + </connection> + <connection id="3" incomingRoad="0" connectingRoad="10" contactPoint="end"> + <laneLink from="-1" to="-1" /> + </connection> + <connection id="4" incomingRoad="10" connectingRoad="0" contactPoint="start"> + <laneLink from="1" to="1" /> + </connection> + <connection id="5" incomingRoad="10" connectingRoad="1" contactPoint="start"> + <laneLink from="1" to="-1" /> + </connection> + <connection id="6" incomingRoad="1" connectingRoad="10" contactPoint="start"> + <laneLink from="1" to="-1" /> + </connection> + </junction> + <junction name="junction_2" id="2"> + <connection id="1" incomingRoad="5" connectingRoad="6" contactPoint="end"> + <laneLink from="-1" to="-1" /> + </connection> + <connection id="2" incomingRoad="5" connectingRoad="10" contactPoint="end"> + <laneLink from="-1" to="1" /> + </connection> + <connection id="3" incomingRoad="6" connectingRoad="10" contactPoint="start"> + <laneLink from="1" to="1" /> + </connection> + <connection id="4" incomingRoad="6" connectingRoad="5" contactPoint="start"> + <laneLink from="1" to="1" /> + </connection> + <connection id="5" incomingRoad="10" connectingRoad="5" contactPoint="end"> + <laneLink from="-1" to="1" /> + </connection> + <connection id="6" incomingRoad="10" connectingRoad="6" contactPoint="end"> + <laneLink from="-1" to="-1" /> + </connection> + </junction> +</OpenDRIVE>