瀏覽代碼

change tool/map_lanetoxodr. add road borrow, but not complete.

yuchuli 3 年之前
父節點
當前提交
fab2de1226
共有 38 個文件被更改,包括 548 次插入13017 次删除
  1. 12 7
      src/common/common/xodr/OpenDrive/Lane.cpp
  2. 6 3
      src/common/common/xodr/OpenDrive/Lane.h
  3. 4 2
      src/common/common/xodr/OpenDrive/OpenDrive.pri
  4. 61 3
      src/common/common/xodr/OpenDrive/OpenDriveXmlParser.cpp
  5. 5 0
      src/common/common/xodr/OpenDrive/OpenDriveXmlParser.h
  6. 13 5
      src/common/common/xodr/OpenDrive/OpenDriveXmlWriter.cpp
  7. 70 1
      src/common/common/xodr/OpenDrive/Road.cpp
  8. 20 0
      src/common/common/xodr/OpenDrive/Road.h
  9. 47 0
      src/common/common/xodr/OpenDrive/userData.cpp
  10. 29 0
      src/common/common/xodr/OpenDrive/userData.h
  11. 0 565
      src/tool/map_lanetoxodr/OpenDrive/Junction.cpp
  12. 0 470
      src/tool/map_lanetoxodr/OpenDrive/Junction.h
  13. 0 1711
      src/tool/map_lanetoxodr/OpenDrive/Lane.cpp
  14. 0 853
      src/tool/map_lanetoxodr/OpenDrive/Lane.h
  15. 0 1190
      src/tool/map_lanetoxodr/OpenDrive/ObjectSignal.cpp
  16. 0 386
      src/tool/map_lanetoxodr/OpenDrive/ObjectSignal.h
  17. 0 381
      src/tool/map_lanetoxodr/OpenDrive/OpenDrive.cpp
  18. 0 202
      src/tool/map_lanetoxodr/OpenDrive/OpenDrive.h
  19. 0 1687
      src/tool/map_lanetoxodr/OpenDrive/OpenDriveXmlParser.cpp
  20. 0 97
      src/tool/map_lanetoxodr/OpenDrive/OpenDriveXmlParser.h
  21. 0 1570
      src/tool/map_lanetoxodr/OpenDrive/OpenDriveXmlWriter.cpp
  22. 0 98
      src/tool/map_lanetoxodr/OpenDrive/OpenDriveXmlWriter.h
  23. 0 90
      src/tool/map_lanetoxodr/OpenDrive/OtherStructures.cpp
  24. 0 66
      src/tool/map_lanetoxodr/OpenDrive/OtherStructures.h
  25. 0 1413
      src/tool/map_lanetoxodr/OpenDrive/Road.cpp
  26. 0 567
      src/tool/map_lanetoxodr/OpenDrive/Road.h
  27. 0 1170
      src/tool/map_lanetoxodr/OpenDrive/RoadGeometry.cpp
  28. 0 473
      src/tool/map_lanetoxodr/OpenDrive/RoadGeometry.h
  29. 37 0
      src/tool/map_lanetoxodr/dialogroadborrow.cpp
  30. 29 0
      src/tool/map_lanetoxodr/dialogroadborrow.h
  31. 183 0
      src/tool/map_lanetoxodr/dialogroadborrow.ui
  32. 2 2
      src/tool/map_lanetoxodr/main.cpp
  33. 7 0
      src/tool/map_lanetoxodr/mainwindow.cpp
  34. 3 0
      src/tool/map_lanetoxodr/mainwindow.h
  35. 7 0
      src/tool/map_lanetoxodr/mainwindow.ui
  36. 5 0
      src/tool/map_lanetoxodr/map_lanetoxodr.pro
  37. 3 0
      src/tool/map_lanetoxodr/roadeditdialog.cpp
  38. 5 5
      src/tool/map_lanetoxodr/roadeditdialog.ui

+ 12 - 7
src/common/common/xodr/OpenDrive/Lane.cpp

@@ -201,6 +201,7 @@ Lane* LaneSection::GetLane(unsigned int i)
 */
 unsigned int LaneSection::GetLaneCount()
 {
+ //   unsigned xx = mLaneVector.size();
 	return mLaneVector.size();
 }
 
@@ -1320,16 +1321,20 @@ LaneHeight  Lane::GetHeightValue(double s_check)
 	return retVal;
 }
 
-
-void Lane::SetuserData(std::string struserData)
+vector <string> * Lane::GetUserDataVector()
 {
-    muserData = struserData;
+    return &muserData;
 }
 
-void Lane::GetuserData(std::string &struserData)
-{
-    struserData = muserData;
-}
+//void Lane::SetuserData(std::string struserData)
+//{
+//    muserData = struserData;
+//}
+
+//void Lane::GetuserData(std::string &struserData)
+//{
+//    struserData = muserData;
+//}
 
 /**
 *	Evaluate the road marks records and return the road mark object corresponding to the provided s-offset

+ 6 - 3
src/common/common/xodr/OpenDrive/Lane.h

@@ -306,6 +306,7 @@ private:
 	bool mSuccessorExists;
 	int mSuccessor;
 
+    vector<string> muserData;
 	//Width
 	vector <LaneWidth> mLaneWidth;
 	//Road Mark
@@ -333,7 +334,8 @@ private:
 	unsigned int mLastAddedLaneHeight;
     unsigned int mLastAddedLaneBorder;
 
-    string muserData;
+//    string muserData;
+
 
 public:
 	/**
@@ -426,6 +428,7 @@ public:
 	vector <LaneAccess> *GetLaneAccessVector();
 	vector <LaneHeight> *GetLaneHeightVector();
     vector <LaneBorder> *GetLaneBorderVector();
+    vector <string> * GetUserDataVector();
 
 
 	/**
@@ -491,8 +494,8 @@ public:
     int CheckBorderInterval(double s_check);
 
 
-    void GetuserData(std::string & struserData);
-    void SetuserData(std::string struserData);
+//    void GetuserData(std::string & struserData);
+//    void SetuserData(std::string struserData);
 
 
     double GetBorderValue(double s_check);

+ 4 - 2
src/common/common/xodr/OpenDrive/OpenDrive.pri

@@ -7,7 +7,8 @@ HEADERS += \
     $$PWD/OpenDriveXmlWriter.h \
     $$PWD/OtherStructures.h \
     $$PWD/Road.h \
-    $$PWD/RoadGeometry.h
+    $$PWD/RoadGeometry.h \
+    $$PWD/userData.h
 
 SOURCES += \
     $$PWD/Junction.cpp \
@@ -18,4 +19,5 @@ SOURCES += \
     $$PWD/OpenDriveXmlWriter.cpp \
     $$PWD/OtherStructures.cpp \
     $$PWD/Road.cpp \
-    $$PWD/RoadGeometry.cpp
+    $$PWD/RoadGeometry.cpp \
+    $$PWD/userData.cpp

+ 61 - 3
src/common/common/xodr/OpenDrive/OpenDriveXmlParser.cpp

@@ -199,6 +199,23 @@ bool OpenDriveXmlParser::ReadRoad(TiXmlElement *node)
 		ReadSurface(road, subNode);
 	}
 
+    //Proceed to userData
+    subNode=node->FirstChildElement("userData");
+    while (subNode)
+    {
+        bool bProc = false;
+        bProc = ReadRoadBorrows(road, subNode);
+        if(bProc == false)
+        {
+            TiXmlPrinter *printer = new TiXmlPrinter();
+            subNode->Accept(printer );//保存该节点及其子节点到字符串
+            std::string str = printer->Str();
+            road->GetUserData()->push_back(str);
+ //           road->getroadb ->push_back(str);
+        }
+        subNode=subNode->NextSiblingElement("userData");
+    }
+
 	return true;
 }
 //--------------
@@ -887,13 +904,13 @@ bool OpenDriveXmlParser::ReadLane (LaneSection* laneSection, TiXmlElement *node,
 
     //Proceed to the user Data
     TiXmlElement *nodeuserData=node->FirstChildElement("userData");
-    if(nodeuserData != NULL)
+    while(nodeuserData != NULL)
     {
-
         TiXmlPrinter *printer = new TiXmlPrinter();
         nodeuserData->Accept(printer );//保存该节点及其子节点到字符串
         std::string str = printer->Str();
-        lane->SetuserData(str);
+        lane->GetUserDataVector()->push_back(str);
+        nodeuserData=nodeuserData->NextSiblingElement("userData");
     }
 
 	return true;
@@ -1371,6 +1388,47 @@ bool OpenDriveXmlParser::ReadObject(Road *road, TiXmlElement *node)
 
     return true;
 }
+//--------------
+
+bool OpenDriveXmlParser::ReadRoadBorrows(Road *road, TiXmlElement *node)
+{
+    string strcode;
+    if(node->QueryStringAttribute("code",&strcode) != TIXML_SUCCESS)
+    {
+        return false;
+    }
+    if(strcode != "roadborrow")
+    {
+        return false;
+    }
+
+    TiXmlElement *subNode = node->FirstChildElement("roadborrow");
+    while (subNode)
+    {
+        ReadRoadBorrow(road, subNode);
+        subNode=subNode->NextSiblingElement("roadborrow");
+    }
+
+    return true;
+}
+
+bool OpenDriveXmlParser::ReadRoadBorrow(Road *road, TiXmlElement *node)
+{
+    double s;
+    double length;
+    string mode;
+    int checker=TIXML_SUCCESS;
+    checker+=node->QueryDoubleAttribute("sOffset",&s);
+    checker+=node->QueryDoubleAttribute("length",&length);
+    checker+=node->QueryStringAttribute("mode",&mode);
+    if(checker != TIXML_SUCCESS)
+    {
+        cout<<"Error parsing Road Borrow attributes"<<endl;
+        return false;
+    }
+    road->AddRoadBorrow(s,length,mode);
+    return true;
+}
 
 //--------------
 

+ 5 - 0
src/common/common/xodr/OpenDrive/OpenDriveXmlParser.h

@@ -64,6 +64,11 @@ public:
 	bool ReadLaneHeight(Lane* lane, TiXmlElement *node);
     bool ReadLaneOffsets(Road * road,TiXmlElement * node);
     bool ReadLaneBorder(Lane* lane, TiXmlElement *node);
+
+    //--------------
+
+    bool ReadRoadBorrows(Road * road, TiXmlElement *node);
+    bool ReadRoadBorrow(Road * road,TiXmlElement * node);
 	//--------------
 
 	bool ReadObjects (Road* road, TiXmlElement *node);

+ 13 - 5
src/common/common/xodr/OpenDrive/OpenDriveXmlWriter.cpp

@@ -825,15 +825,23 @@ bool OpenDriveXmlWriter::WriteLane (TiXmlElement *node, Lane* lane)
 		WriteLaneHeight(nodeLane, lane->GetLaneHeight(i));
 	}
 
-    string struserData;
-    lane->GetuserData(struserData);
-    if(struserData != "")
+ //   string struserData;
+    vector<string> * puserDataVector = lane->GetUserDataVector();
+    unsigned int luserDataCount = puserDataVector->size();
+    for(unsigned int i=0;i<luserDataCount;i++)
     {
         TiXmlElement * nodeuserData = new TiXmlElement("userData");
-        nodeuserData->Parse(struserData.data(),0,TIXML_ENCODING_UTF8);
+        nodeuserData->Parse(puserDataVector->at(i).data(),0,TIXML_ENCODING_UTF8);
         nodeLane->LinkEndChild(nodeuserData);
-
     }
+//    lane->GetuserData(struserData);
+//    if(struserData != "")
+//    {
+//        TiXmlElement * nodeuserData = new TiXmlElement("userData");
+//        nodeuserData->Parse(struserData.data(),0,TIXML_ENCODING_UTF8);
+//        nodeLane->LinkEndChild(nodeuserData);
+
+//    }
 
 	return true;
 }

+ 70 - 1
src/common/common/xodr/OpenDrive/Road.cpp

@@ -313,6 +313,12 @@ Object*	Road::GetObject(unsigned int i)
 	else
 		return NULL;
 }
+
+vector<string> * Road::GetUserData()
+{
+    return & muserDataVector;
+}
+
 unsigned int Road::GetObjectCount()
 {
 	return mObjectsVector.size();
@@ -322,6 +328,7 @@ vector<Signal> *Road::GetSignalVector()
 {
 	return &mSignalsVector;
 }
+
 Signal*	Road::GetSignal(unsigned int i)
 {	
 	if ((mSignalsVector.size()>0)&&(i<mSignalsVector.size()))
@@ -333,11 +340,28 @@ unsigned int Road::GetSignalCount()
 {
 	return mSignalsVector.size();
 }
+unsigned int Road::GetRoadBorrowCount()
+{
+    return mRoadBorrowVector.size();
+}
+vector<RoadBorrow> * Road::GetRoadBorrowVector()
+{
+    return &mRoadBorrowVector;
+}
+RoadBorrow * Road::GetRoadBorrow(unsigned int i)
+{
+    if((mRoadBorrowVector.size()>0)&&(i<mRoadBorrowVector.size()))
+        return &mRoadBorrowVector.at(i);
+    else
+        return NULL;
+}
 //-------------------------------------------------
 
 /**
  * Getters for the last child records in their respective vectors
  */
+
+
 RoadType* Road::GetLastRoadType()
 {	
 	if (mRoadTypeVector.size()>0)
@@ -394,6 +418,13 @@ Signal*	Road::GetLastSignal()
 	else
 		return NULL;
 }
+RoadBorrow* Road::GetLastRoadBorrow()
+{
+    if(mRoadBorrowVector.size()>0)
+        return &mRoadBorrowVector.at(mRoadBorrowVector.size()-1);
+    else
+        return NULL;
+}
 
 
 /**
@@ -455,6 +486,13 @@ Signal* Road::GetLastAddedSignal()
 	else
 		return NULL;
 }
+RoadBorrow* Road::GetLastAddedRoadBorrow()
+{
+    if(mLastAddedRoadBorrow<mRoadBorrowVector.size())
+        return &mRoadBorrowVector.at(mLastAddedRoadBorrow);
+    else
+        return NULL;
+}
 //-------------------------------------------------
 
 /**
@@ -636,6 +674,15 @@ unsigned int Road::AddLaneOffset(double s, double a, double b, double c, double
     return index;
 }
 
+unsigned int Road::AddRoadBorrow(double s,double length,string mode)
+{
+    unsigned int index = CheckRoadBorrowInterval(s)+1;
+    if(index>=GetRoadBorrowCount()) mRoadBorrowVector.push_back(RoadBorrow(s,length,mode));
+    else mRoadBorrowVector.insert(mRoadBorrowVector.begin()+index, RoadBorrow(s,length,mode));
+    mLastAddedRoadBorrow=index;
+    return index;
+}
+
 //-------------
 unsigned int Road::AddObject(string id,double s,double t,double zOffset)
 {	
@@ -836,6 +883,18 @@ unsigned int Road::CloneSignal(unsigned int index)
 	mLastAddedSignal=index+1;
 	return mLastAddedSignal;
 }
+unsigned int Road::CloneRoadBorrow(unsigned int index)
+{
+    // Check the first method in the group for details
+
+    if(index<mRoadBorrowVector.size()-1)
+        mRoadBorrowVector.insert(mRoadBorrowVector.begin()+index+1, mRoadBorrowVector[index]);
+    else if(index==mRoadBorrowVector.size()-1)
+        mRoadBorrowVector.push_back(mRoadBorrowVector[index]);
+    mLastAddedRoadBorrow=index+1;
+    return mLastAddedRoadBorrow;
+}
+
 
 /**
  * Methods used to delete child records from the respective vectors
@@ -877,6 +936,11 @@ void Road::DeleteSignal(unsigned int index)
 	mSignalsVector.erase(mSignalsVector.begin()+index);
 }
 
+void Road::DeleteRoadBorrow(unsigned int index)
+{
+    mRoadBorrowVector.erase(mRoadBorrowVector.begin()+index);
+}
+
 //-------------------------------------------------
 // EVALUATION METHODS
 
@@ -1066,6 +1130,11 @@ int  Road::CheckLaneSectionInterval(double s_check)
 			break;	//if not, break;
 	}
 	return res;		//return the result: 0 to MaxInt as the index to the record containing s_check or -1 if nothing found
+}
+//-----------
+int Road::CheckRoadBorrowInterval(double s_check)
+{
+
 }
 //-----------
 int Road::CheckLaneOffsetInterval(double s_check)
@@ -1075,7 +1144,7 @@ int Road::CheckLaneOffsetInterval(double s_check)
     for (unsigned int i=0;i<mLaneOffsetVector.size();i++)
     {
         //check if the s_check belongs to the current record
-        if (mLaneOffsetVector.at(i).CheckInterval(s_check))
+        if (mRoadBorrowVector.at(i).CheckInterval(s_check))
             res=i;	//assign it to the result id
         else
             break;	//if not, break;

+ 20 - 0
src/common/common/xodr/OpenDrive/Road.h

@@ -9,6 +9,7 @@
 #include "Junction.h"
 #include "ObjectSignal.h"
 #include "OtherStructures.h"
+#include "userData.h"
 
 //--Prototypes--
 //road
@@ -79,6 +80,10 @@ private:
 	// Signal vector
 	vector<Signal> mSignalsVector;
 
+    vector<string> muserDataVector;
+
+    vector<RoadBorrow> mRoadBorrowVector;
+
 	/**
 	 * Indices of the last added child records
 	 */
@@ -91,6 +96,7 @@ private:
     unsigned int mLastAddedLaneOffset;
 	unsigned int mLastAddedObject;
 	unsigned int mLastAddedSignal;
+    unsigned int mLastAddedRoadBorrow;
 
 public:
 	/**
@@ -175,6 +181,13 @@ public:
 	vector<Signal> *GetSignalVector();
 	Signal*	GetSignal(unsigned int i);
 	unsigned int GetSignalCount();
+
+    vector<RoadBorrow> *GetRoadBorrowVector();
+    RoadBorrow*	GetRoadBorrow(unsigned int i);
+    unsigned int GetRoadBorrowCount();
+
+
+    vector<string> * GetUserData();
 	//-------------------------------------------------
 
 	/**
@@ -188,6 +201,7 @@ public:
 	LaneSection*	GetLastLaneSection();
 	Object*			GetLastObject();
 	Signal*			GetLastSignal();
+    RoadBorrow *    GetLastRoadBorrow();
 
 	/**
 	 * Getters for the last added child records in their respective vectors
@@ -200,6 +214,7 @@ public:
 	LaneSection*	GetLastAddedLaneSection();
 	Object*			GetLastAddedObject();
 	Signal*			GetLastAddedSignal();
+    RoadBorrow*     GetLastAddedRoadBorrow();
 
 	//-------------------------------------------------
 
@@ -245,6 +260,7 @@ public:
     unsigned int AddSignal(double s,double t,string id,string name,bool dynamic,string orientation,double zOffset,string type,string country,string countryRevision,
                            string subtype,double hOffset,double pitch,double roll ,double height,double width);
 
+    unsigned int AddRoadBorrow(double s,double length,string mode);
 	/**
 	 * Methods used to clone child records in the respective vectors
 	 */
@@ -256,6 +272,7 @@ public:
 	unsigned int CloneLaneSectionEnd(unsigned int index);
 	unsigned int CloneObject(unsigned int index);
 	unsigned int CloneSignal(unsigned int index);
+    unsigned int CloneRoadBorrow(unsigned int index);
 
 	/**
 	 * Methods used to delete child records from the respective vectors
@@ -269,6 +286,7 @@ public:
     void DeleteLaneOffset(unsigned int index);
 	void DeleteObject(unsigned int index);
 	void DeleteSignal(unsigned int index);
+    void DeleteRoadBorrow(unsigned int index);
 	
 	//-------------------------------------------------
 
@@ -308,6 +326,8 @@ public:
 	void FillLaneSectionSample(double s_check, LaneSectionSample &laneSectionSample);
 
     int CheckLaneOffsetInterval(double s_check);
+
+    int CheckRoadBorrowInterval(double s_check);
 	
 	//-------------------------------------------------
 

+ 47 - 0
src/common/common/xodr/OpenDrive/userData.cpp

@@ -0,0 +1,47 @@
+#include "userData.h"
+
+RoadBorrow::RoadBorrow(double s, double length, std::string mode)
+{
+    mS = s;
+    mlength = length;
+    mMode = mode;
+}
+
+void RoadBorrow::SetS(double s)
+{
+    mS = s;
+}
+
+void RoadBorrow::SetLength(double length)
+{
+    mlength = length;
+}
+
+void RoadBorrow::SetMode(std::string mode)
+{
+    mMode = mode;
+}
+
+double RoadBorrow::GetS()
+{
+    return mS;
+}
+
+double RoadBorrow::GetLength()
+{
+    return mlength;
+}
+
+string RoadBorrow::GetMode()
+{
+    return mMode;
+}
+
+bool RoadBorrow::CheckInterval(double s_check)
+{
+    if (s_check>=mS)
+        return true;
+    else
+        return false;
+}
+

+ 29 - 0
src/common/common/xodr/OpenDrive/userData.h

@@ -0,0 +1,29 @@
+#ifndef USERDATA_H
+#define USERDATA_H
+#include <vector>
+#include <string>
+
+using std::vector;
+using std::string;
+
+class RoadBorrow
+{
+private:
+    double mS;
+    double mlength;
+    string mMode;
+public:
+    RoadBorrow(double s,double length,string mode);
+
+    void SetS(double s);
+    void SetLength(double length);
+    void SetMode(string mode);
+
+    double GetS();
+    double GetLength();
+    string GetMode();
+
+    bool CheckInterval(double s_check);
+};
+
+#endif // USERDATA_H

+ 0 - 565
src/tool/map_lanetoxodr/OpenDrive/Junction.cpp

@@ -1,565 +0,0 @@
-#include "Junction.h"
-
-/**
-* Junction class. Holds all the junction information
-*
-*
-*
-*
-*/
-
-/**
-* Constructor. Sets basic junction parameters
-* @param name Name of the junction
-* @param id Unique ID of the junction
-*/
-Junction::Junction(	string name, string id)
-{
-	mName=name;
-	mId=id;
-}
-
-/**
-* Sets the name parameter
-*/
-void Junction::SetName(string name)
-{	mName=name;	}
-
-/**
-* Sets the ID parameter
-*/
-void Junction::SetId(string id)
-{	mId=id;	}
-
-
-/**
-* Adds a junction connection to the junction
-* @param id ID within the junction
-* @param incomingRoad ID of the incoming road
-* @param connectingRoad ID of the connecting path
-* @param contactPoint Contact point on the connecting road (start or end)
-*/
-unsigned int Junction::AddJunctionConnection(	string id,	string incomingRoad, string connectingRoad, string contactPoint)
-{	
-	// Adds a new junction connection
-	mJunctionConnectionVector.push_back(JunctionConnection(id, incomingRoad, connectingRoad, contactPoint));	
-	// Saves the index of the newly added junction connection
-	mLastAddedJunctionConnection = mJunctionConnectionVector.size()-1;
-	return mLastAddedJunctionConnection;
-}
-
-
-/**
-* Adds a priority parameter to the junction
-* @param high ID of the connecting road with higher priority
-* @param low ID of the connecting road with lower priority
-*/
-unsigned int Junction::AddJunctionPriority ( string high, string low)
-{	
-	// Check the first method in the group for details
-
-	mJunctionPriorityVector.push_back(JunctionPriorityRoad(high,low));	
-	mLastAddedJunctionPriority = mJunctionPriorityVector.size()-1;
-	return mLastAddedJunctionPriority;
-}
-
-/**
-* Adds a controller to the junction
-* @param id ID of the controller to add
-* @param type Type of control
-*/
-unsigned int Junction::AddJunctionController ( string id, string type)
-{	
-	mJunctionControllerVector.push_back(JunctionController(id,type));	
-	mLastAddedJunctionController = mJunctionControllerVector.size()-1;
-	return mLastAddedJunctionController;
-}
-//--------------
-
-/**
- * Methods used to clone child records in the respective vectors
- */
-unsigned int Junction::CloneJunctionConnection(unsigned int index)
-{
-	// Clone the object and insert it in the middle of the vector
-	if(index<mJunctionConnectionVector.size()-1)
-		mJunctionConnectionVector.insert(mJunctionConnectionVector.begin()+index+1, mJunctionConnectionVector[index]);
-	// or just push it to the back
-	else if(index==mJunctionConnectionVector.size()-1)
-		mJunctionConnectionVector.push_back(mJunctionConnectionVector[index]);
-	// Save the last added record index
-	mLastAddedJunctionConnection=index+1;
-	return mLastAddedJunctionConnection;
-}
-unsigned int Junction::CloneJunctionPriority(unsigned int index)
-{
-	// Check the first method in the group for details
-
-	if(index<mJunctionPriorityVector.size()-1)
-		mJunctionPriorityVector.insert(mJunctionPriorityVector.begin()+index+1, mJunctionPriorityVector[index]);
-	else if(index==mJunctionPriorityVector.size()-1)
-		mJunctionPriorityVector.push_back(mJunctionPriorityVector[index]);
-	mLastAddedJunctionPriority=index+1;
-	return mLastAddedJunctionPriority;
-}
-unsigned int Junction::CloneJunctionController(unsigned int index)
-{
-	if(index<mJunctionControllerVector.size()-1)
-		mJunctionControllerVector.insert(mJunctionControllerVector.begin()+index+1, mJunctionControllerVector[index]);
-	else if(index==mJunctionControllerVector.size()-1)
-		mJunctionControllerVector.push_back(mJunctionControllerVector[index]);
-	mLastAddedJunctionController=index+1;
-	return mLastAddedJunctionController;
-}
-
-/**
- * Methods used to delete child records from the respective vectors
- */
-void Junction::DeleteJunctionConnection(unsigned int index)
-{
-	mJunctionConnectionVector.erase(mJunctionConnectionVector.begin()+index);
-}
-void Junction::DeleteJunctionPriority(unsigned int index)
-{
-	mJunctionPriorityVector.erase(mJunctionPriorityVector.begin()+index);
-}
-void Junction::DeleteJunctionController(unsigned int index)
-{
-	mJunctionControllerVector.erase(mJunctionControllerVector.begin()+index);
-}
-
-/**
-* Return the name of the junction
-*/
-string Junction::GetName()
-{	return mName;	}
-
-/**
-* Return the id of the junction
-*/
-string Junction::GetId()
-{	return mId;	}
-
-/**
-* Return the vector that stores junction connections
-* @return A pointer to std::vector of JunctionConnection type that stores junction connections
-*/
-std::vector<JunctionConnection>* Junction::GetJunctionConnectionVector ()
-{	return &mJunctionConnectionVector;	}
-
-/**
-* Return the number of junction connections
-* @return An unsigned int that stores the number of junction connections
-*/
-unsigned int Junction::GetJunctionConnectionCount()
-{	return mJunctionConnectionVector.size();	}
-
-/**
-* Return the pointer to a junction connection at provided index
-* @param i Index to the junction connection that is returned
-* @return A pointer to JunctionConnection object
-*/
-JunctionConnection* Junction::GetJunctionConnection(unsigned int i)
-{	return &mJunctionConnectionVector.at(i);	}
-
-/**
-* Return the pointer to the last junction connection
-* @return A pointer to JunctionConnection object
-*/
-JunctionConnection* Junction::GetLastJunctionConnection()
-{	
-	if(mJunctionConnectionVector.size()>0)
-		return &mJunctionConnectionVector.at(mJunctionConnectionVector.size()-1);	
-	else
-		return NULL;
-}
-/**
-* Return the pointer to the last added junction connection (which might not be the one from the end of the vector)
-* @return A pointer to JunctionConnection object
-*/
-JunctionConnection* Junction::GetLastAddedJunctionConnection()
-{	
-	if(mLastAddedJunctionConnection<mJunctionConnectionVector.size())
-		return &mJunctionConnectionVector.at(mLastAddedJunctionConnection);
-	else
-		return NULL;
-}
-
-/**
-* Return the vector that stores junction priority records
-* @return A pointer to std::vector of JunctionPriorityRoad type that stores junction priority records
-*/
-std::vector<JunctionPriorityRoad>* Junction::GetJunctionPriorityVector()
-{	return &mJunctionPriorityVector;	}
-
-/**
-* Return the number of junction priority records
-* @return An unsigned int that stores the number of junction priority records
-*/
-unsigned int Junction::GetJunctionPriorityCount()
-{	return mJunctionPriorityVector.size();	}
-
-/**
-* Return the pointer to a junction priority record at provided index
-* @param i Index to the junction priority record that is returned
-* @return A pointer to JunctionPriorityRoad object
-*/
-JunctionPriorityRoad* Junction::GetJunctionPriority(unsigned int i)
-{	return &mJunctionPriorityVector.at(i);	}
-
-/**
-* Return the pointer to the last junction priority record
-* @return A pointer to JunctionPriorityRoad object
-*/
-JunctionPriorityRoad* Junction::GetLastJunctionPriority()
-{	
-	if(mJunctionPriorityVector.size()>0)
-		return &mJunctionPriorityVector.at(mJunctionPriorityVector.size()-1);	
-	else 
-		return NULL;
-}
-
-/**
-* Return the pointer to the last added junction priority record (which might not be the one from the end of the vector)
-* @return A pointer to JunctionPriorityRoad object
-*/
-JunctionPriorityRoad* Junction::GetLastAddedJunctionPriority()
-{	
-	if(mLastAddedJunctionPriority<mJunctionPriorityVector.size())
-		return &mJunctionPriorityVector.at(mLastAddedJunctionPriority);
-	else
-		return NULL;
-}
-
-
-/**
-* Return the vector that stores junction controller records
-* @return A pointer to std::vector of JunctionController type that stores junction controller records
-*/
-std::vector<JunctionController>* Junction::GetJunctionControllerVector()
-{	return &mJunctionControllerVector;	}
-
-/**
-* Return the number of junction controller records
-* @return An unsigned int that stores the number of junction controller records
-*/
-unsigned int  Junction::GetJunctionControllerCount()
-{	return mJunctionControllerVector.size();	}
-
-/**
-* Return the pointer to a junction controller record at provided index
-* @param i Index to the junction controller record that is returned
-* @return A pointer to JunctionController object
-*/
-JunctionController* Junction::GetJunctionController(unsigned int i)
-{	return &mJunctionControllerVector.at(i);	}
-
-/**
-* Return the pointer to the last junction controller record
-* @return A pointer to JunctionController object
-*/
-JunctionController* Junction::GetLastJunctionController()
-{	
-	if(mJunctionControllerVector.size()>0)
-		return &mJunctionControllerVector.at(mJunctionControllerVector.size()-1);	
-	else
-		return NULL;
-}
-
-/**
-* Return the pointer to the last added junction controller record (which might not be the one from the end of the vector)
-* @return A pointer to JunctionController object
-*/
-JunctionController* Junction::GetLastAddedJunctionController()
-{	
-	if(mLastAddedJunctionController<mJunctionControllerVector.size())
-		return &mJunctionControllerVector.at(mLastAddedJunctionController);
-	else
-		return NULL;
-}
-//--------------
-
-
-/**
-* Junction connection class. Holds all the information for a connection record
-*
-*
-*
-*
-*/
-
-/**
-* Constructor. Sets basic junction connection parameters
-* @param id ID within the junction
-* @param incomingRoad ID of the incoming road
-* @param connectingRoad ID of the connecting path
-* @param contactPoint Contact point on the connecting road (start / end)
-*/
-JunctionConnection::JunctionConnection(	string id, string incomingRoad, string connectingRoad, string contactPoint	)
-{
-	mId=id;
-	mIncomingRoad=incomingRoad;
-	mConnectingRoad=connectingRoad;
-	mContactPoint=contactPoint;	
-}
-
-/**
-* Set the ID parameter
-*/
-void JunctionConnection::SetId(string id)
-{	mId=id;	}
-
-/**
-* Set the ID of the incoming road 
-*/
-void JunctionConnection::SetIncomingRoad(string incomingRoad)
-{	mIncomingRoad=incomingRoad;	}
-
-/**
-* Set the ID of the connecting path
-*/
-void JunctionConnection::SetConnectingRoad(string connectingRoad)
-{	mConnectingRoad=connectingRoad;	}
-
-/**
-* Set the contact point parameter
-* @param contactPoint Contact point of the connecting road. Can be either start or end
-*/
-void JunctionConnection::SetContactPoint(string contactPoint)
-{	mContactPoint=contactPoint;	}
-
-/**
-* Add a lane link record
-* @param from ID of the incoming lane
-* @param to ID of the connecting lane
-*/
-unsigned int JunctionConnection::AddJunctionLaneLink(int from, int to)
-{	
-	mJunctionLaneLinkVector.push_back(JunctionLaneLink(from, to));	
-	mLastAddedJunctionLaneLink = mJunctionLaneLinkVector.size()-1;
-	return mLastAddedJunctionLaneLink;
-}
-//--------------
-
-/**
- * Method used to clone child record in the respective vectors
- */
-unsigned int JunctionConnection::CloneJunctionLaneLink(unsigned int index)
-{
-	// Clone the object and insert it in the middle of the vector
-	if(index<mJunctionLaneLinkVector.size()-1)
-		mJunctionLaneLinkVector.insert(mJunctionLaneLinkVector.begin()+index+1, mJunctionLaneLinkVector[index]);
-	// or just push it to the back
-	else if(index==mJunctionLaneLinkVector.size()-1)
-		mJunctionLaneLinkVector.push_back(mJunctionLaneLinkVector[index]);
-	// Save the last added record index
-	mLastAddedJunctionLaneLink=index+1;
-	return mLastAddedJunctionLaneLink;
-}
-
-/**
-* Delete the lane link parameter at the provided index
-*/
-void JunctionConnection::DeleteJunctionLaneLink(unsigned int index)
-{
-	mJunctionLaneLinkVector.erase(mJunctionLaneLinkVector.begin()+index);
-}
-
-
-/**
-* Get the ID parameter
-*/
-string JunctionConnection::GetId()
-{	return mId;	}
-
-/**
-* Get the ID fo the incoming road
-*/
-string JunctionConnection::GetIncomingRoad()
-{	return mIncomingRoad;	}
-
-/**
-* Get the ID of the connecting road
-*/
-string JunctionConnection::GetConnectingRoad()
-{	return mConnectingRoad;	}
-
-/**
-* Get the contact point parameter
-*/
-string JunctionConnection::GetContactPoint()
-{	return mContactPoint;	}
-
-/**
-* Return the vector that stores junction lane link records
-* @return A pointer to std::vector of JunctionLaneLink type that stores junction lane link records
-*/
-std::vector<JunctionLaneLink>* JunctionConnection::GetJunctionLaneLinkVector()
-{	return &mJunctionLaneLinkVector;	}
-
-/**
-* Return the number of junction lane link records
-* @return An unsigned int that stores the number of junction lane link records
-*/
-unsigned int JunctionConnection::GetJunctionLaneLinkCount()
-{	return mJunctionLaneLinkVector.size();	}
-
-/**
-* Return the pointer to a junction lane link record at provided index
-* @param i Index to the junction lane link record that is returned
-* @return A pointer to JunctionLaneLink object
-*/
-JunctionLaneLink* JunctionConnection::GetJunctionLaneLink(unsigned int i)
-{	return &mJunctionLaneLinkVector.at(i);	}
-
-/**
-* Return the pointer to the last junction lane link record
-* @return A pointer to JunctionLaneLink object
-*/
-JunctionLaneLink* JunctionConnection::GetLastJunctionLaneLink()
-{	
-	if(mJunctionLaneLinkVector.size()>0)
-		return &mJunctionLaneLinkVector.at(mJunctionLaneLinkVector.size()-1);	
-	else
-		return NULL;
-}
-
-/**
-* Return the pointer to the last added junction lane link record (which might not be the one from the end of the vector)
-* @return A pointer to JunctionLaneLink object
-*/
-JunctionLaneLink* JunctionConnection::GetLastAddedJunctionLaneLink()
-{	
-	if(mLastAddedJunctionLaneLink<mJunctionLaneLinkVector.size())
-		return &mJunctionLaneLinkVector.at(mLastAddedJunctionLaneLink);
-	else
-		return NULL;
-}
-
-
-
-/**
-* Junction lane link class. Holds all the information for a lane link record
-*
-*
-*
-*
-*/
-
-/**
-* Constructor. Initializes the parameters
-* @param from ID of the incoming lane
-* @param to ID of the connecting lane
-*/
-JunctionLaneLink::JunctionLaneLink(int from, int to)
-{	mFrom=from; mTo=to;	}
-
-
-/**
-* Set the ID of the incoming lane
-*/
-void JunctionLaneLink::SetFrom (int from)
-{	mFrom=from;	}
-
-/**
-* Set the ID of the connecting lane
-*/
-void JunctionLaneLink::SetTo (int to)
-{	mTo=to;	}
-
-/**
-* Get the ID of the incoming lane
-*/
-int JunctionLaneLink::GetFrom()
-{	return mFrom;	}
-
-/**
-* Get the ID of the connecting lane
-*/
-int JunctionLaneLink::GetTo()
-{	return mTo;	}
-
-
-/**
-* Junction priority class. Holds all the information for a priority record
-*
-*
-*
-*
-*/
-
-/**
-* Constructor. Initializes the parameters
-* @param high ID of the connecting road with higher priority
-* @param low ID of the connecting road with lower priority
-*/
-JunctionPriorityRoad::JunctionPriorityRoad(string high, string low)
-{
-	mHigh=high;
-	mLow=low;
-}
-
-/**
-* Set the ID of the connecting road with higher priority
-*/
-void JunctionPriorityRoad::SetHigh (string high)
-{	mHigh=high;	}
-
-/**
-* Set the ID of the connecting road with lower priority
-*/
-void JunctionPriorityRoad::SetLow (string low)
-{	mLow=low;	}
-
-/**
-* Get the ID of the connecting road with higher priority
-*/
-string JunctionPriorityRoad::GetHigh()
-{	return mHigh;	}
-
-/**
-* Get the ID of the connecting road with lower priority
-*/
-string JunctionPriorityRoad::GetLow()
-{	return mLow;	}
-
-
-/**
-* Junction controller class. Holds all the information for a priority record
-*
-*
-*
-*
-*/
-
-/**
-* Constructor. Initializes the parameters
-* @param id ID of the controller to add
-* @param type Type of control
-*/
-JunctionController::JunctionController(string id, string type)
-{	mId=id; mType=type;	}
-
-/**
-* Set the ID of the controller to add
-*/
-void JunctionController::SetId (string id)
-{	mId=id;	}
-
-/**
-* Set the type of control
-*/
-void JunctionController::SetType (string type)
-{	mType=type;	}
-
-/**
-* Get the ID of the controller to add
-*/
-string JunctionController::GetId()
-{	return mId;	}
-
-/**
-* Get the type of control
-*/
-string JunctionController::GetType()
-{	return mType;	}

+ 0 - 470
src/tool/map_lanetoxodr/OpenDrive/Junction.h

@@ -1,470 +0,0 @@
-#ifndef JUNCTION_H
-#define JUNCTION_H
-
-#include <string>
-#include <vector>
-using std::string;
-
-//Prototypes
-class Junction;
-class JunctionConnection;
-class JunctionLaneLink;
-class JunctionController;
-class JunctionPriorityRoad;
-
-/**
- * Junction class. Holds all the junction information
- *
- *
- *
- *
- */
-class Junction
-{
-private:
-	/**
-	 * Junction parameters
-	 */
-	std::string mName;
-	std::string mId;
-
-	/**
-	 * Vector based parameters of the junction
-	 */
-	std::vector<JunctionConnection> mJunctionConnectionVector;
-	std::vector<JunctionPriorityRoad> mJunctionPriorityVector;
-	std::vector<JunctionController> mJunctionControllerVector;
-
-public:
-
-	/**
-	 * Indices of the last added records
-	 */
-	unsigned int mLastAddedJunctionConnection;
-	unsigned int mLastAddedJunctionPriority;
-	unsigned int mLastAddedJunctionController;
-
-	/**
-	 * Constructor. Sets basic junction parameters
-	 * @param name Name of the junction
-	 * @param id Unique ID of the junction
-	 */
-	Junction(string name, string id);
-
-	/**
-	 * Sets the name parameter
-	 */
-	void SetName(string name);
-	/**
-	 * Sets the ID parameter
-	 */
-	void SetId(string id);
-
-	/**
-	 * Adds a junction connection to the junction
-	 * @param id ID within the junction
-	 * @param incomingRoad ID of the incoming road
-	 * @param connectingRoad ID of the connecting path
-	 * @param contactPoint Contact point on the connecting road (start or end)
-	 */
-	unsigned int AddJunctionConnection(string id,	string incomingRoad, string connectingRoad, string contactPoint);
-
-	/**
-	 * Adds a priority parameter to the junction
-	 * @param high ID of the connecting road with higher priority
-	 * @param low ID of the connecting road with lower priority
-	 */
-	unsigned int AddJunctionPriority(string high, string low);
-
-	/**
-	 * Adds a controller to the junction
-	 * @param id ID of the controller to add
-	 * @param type Type of control
-	 */
-	unsigned int AddJunctionController(string id, string type);
-
-	/**
-	 * Clone the connection record
-	 * @param index Index of the record to clone
-	 */
-	unsigned int CloneJunctionConnection(unsigned int index);
-	unsigned int CloneJunctionPriority(unsigned int index);
-	unsigned int CloneJunctionController(unsigned int index);
-
-
-	void DeleteJunctionConnection(unsigned int index);
-	void DeleteJunctionPriority(unsigned int index);
-	void DeleteJunctionController(unsigned int index);
-
-	/**
-	 * Return the name of the junction
-	 */
-	string GetName();
-
-	/**
-	 * Return the id of the junction
-	 */
-	string GetId();
-
-	/**
-	 * Return the vector that stores junction connections
-	 * @return A pointer to std::vector of JunctionConnection type that stores junction connections
-	 */
-	std::vector<JunctionConnection>* GetJunctionConnectionVector ();
-
-	/**
-	 * Return the number of junction connections
-	 * @return An unsigned int that stores the number of junction connections
-	 */
-	unsigned int GetJunctionConnectionCount();
-
-	/**
-	 * Return the pointer to a junction connection at provided index
-	 * @param i Index to the junction connection that is returned
-	 * @return A pointer to JunctionConnection object
-	 */
-	JunctionConnection* GetJunctionConnection(unsigned int i);
-
-	/**
-	 * Return the pointer to the last junction connection
-	 * @return A pointer to JunctionConnection object
-	 */
-    JunctionConnection* GetLastJunctionConnection();
-
-	/**
-	 * Return the pointer to the last added junction connection (which might not be the one from the end of the vector)
-	 * @return A pointer to JunctionConnection object
-	 */
-    JunctionConnection* GetLastAddedJunctionConnection();
-	
-	/**
-	 * Return the vector that stores junction priority records
-	 * @return A pointer to std::vector of JunctionPriorityRoad type that stores junction priority records
-	 */
-	std::vector<JunctionPriorityRoad>* GetJunctionPriorityVector();
-
-	/**
-	 * Return the number of junction priority records
-	 * @return An unsigned int that stores the number of junction priority records
-	 */
-	unsigned int GetJunctionPriorityCount();
-
-	/**
-	 * Return the pointer to a junction priority record at provided index
-	 * @param i Index to the junction priority record that is returned
-	 * @return A pointer to JunctionPriorityRoad object
-	 */
-	JunctionPriorityRoad* GetJunctionPriority(unsigned int i);
-
-	/**
-	 * Return the pointer to the last junction priority record
-	 * @return A pointer to JunctionPriorityRoad object
-	 */
-    JunctionPriorityRoad* GetLastJunctionPriority();
-
-	
-	/**
-	 * Return the pointer to the last added junction priority record (which might not be the one from the end of the vector)
-	 * @return A pointer to JunctionPriorityRoad object
-	 */
-    JunctionPriorityRoad* GetLastAddedJunctionPriority();
-
-	/**
-	 * Return the vector that stores junction controller records
-	 * @return A pointer to std::vector of JunctionController type that stores junction controller records
-	 */
-	std::vector<JunctionController>* GetJunctionControllerVector();
-
-	/**
-	 * Return the number of junction controller records
-	 * @return An unsigned int that stores the number of junction controller records
-	 */
-	unsigned int  GetJunctionControllerCount();
-
-	/**
-	 * Return the pointer to a junction controller record at provided index
-	 * @param i Index to the junction controller record that is returned
-	 * @return A pointer to JunctionController object
-	 */
-	JunctionController* GetJunctionController(unsigned int i);
-
-	/**
-	 * Return the pointer to the last junction controller record
-	 * @return A pointer to JunctionController object
-	 */
-    JunctionController* GetLastJunctionController();
-
-	/**
-	 * Return the pointer to the last added junction controller record (which might not be the one from the end of the vector)
-	 * @return A pointer to JunctionController object
-	 */
-    JunctionController* GetLastAddedJunctionController();
-
-};
-
-
-/**
- * Junction connection class. Holds all the information for a connection record
- *
- *
- *
- *
- */
-class JunctionConnection
-{
-private:
-	/**
-	 * Connection parameters
-	 */
-	string mId;
-	string mIncomingRoad;
-	string mConnectingRoad;
-	string mContactPoint;	//Possible values: start / end
-
-	/**
-	 * Lane linkage parameters vector
-	 */
-	std::vector<JunctionLaneLink> mJunctionLaneLinkVector;
-public:
-	
-	unsigned int mLastAddedJunctionLaneLink;
-
-	/**
-	 * Constructor. Sets basic junction connection parameters
-	 * @param id ID within the junction
-	 * @param incomingRoad ID of the incoming road
-	 * @param connectingRoad ID of the connecting path
-	 * @param contactPoint Contact point on the connecting road (start / end)
-	 */
-	JunctionConnection(	string id, string incomingRoad, string connectingRoad, string contactPoint);
-
-	/**
-	 * Set the ID parameter
-	 */
-	void SetId(string id);
-
-	/**
-	 * Set the ID of the incoming road 
-	 */
-	void SetIncomingRoad(string incomingRoad);
-
-	/**
-	 * Set the ID of the connecting path
-	 */
-	void SetConnectingRoad(string connectingRoad);
-
-	/**
-	 * Set the contact point parameter
-	 * @param contactPoint Contact point of the connecting road. Can be either start or end
-	 */
-	void SetContactPoint(string contactPoint);
-
-	/**
-	 * Add a lane link record
-	 * @param from ID of the incoming lane
-	 * @param to ID of the connecting lane
-	 */
-	unsigned int AddJunctionLaneLink(int from, int to);
-
-	//clone elements
-	unsigned int CloneJunctionLaneLink(unsigned int index);
-
-	/**
-	 * Delete the lane link parameter at the provided index
-	 */
-	void DeleteJunctionLaneLink(unsigned int index);
-
-	/**
-	 * Get the ID parameter
-	 */
-	string GetId();
-
-	/**
-	 * Get the ID fo the incoming road
-	 */
-	string GetIncomingRoad();
-	
-	/**
-	 * Get the ID of the connecting road
-	 */
-	string GetConnectingRoad();
-	
-	/**
-	 * Get the contact point parameter
-	 */
-	string GetContactPoint();
-
-	/**
-	 * Return the vector that stores junction lane link records
-	 * @return A pointer to std::vector of JunctionLaneLink type that stores junction lane link records
-	 */
-	std::vector<JunctionLaneLink>* GetJunctionLaneLinkVector();
-	
-	/**
-	 * Return the number of junction lane link records
-	 * @return An unsigned int that stores the number of junction lane link records
-	 */
-	unsigned int GetJunctionLaneLinkCount();
-
-	/**
-	 * Return the pointer to a junction lane link record at provided index
-	 * @param i Index to the junction lane link record that is returned
-	 * @return A pointer to JunctionLaneLink object
-	 */
-	JunctionLaneLink* GetJunctionLaneLink(unsigned int);
-
-	/**
-	 * Return the pointer to the last junction lane link record
-	 * @return A pointer to JunctionLaneLink object
-	 */
-	JunctionLaneLink* GetLastJunctionLaneLink();
-
-	/**
-	 * Return the pointer to the last added junction lane link record (which might not be the one from the end of the vector)
-	 * @return A pointer to JunctionLaneLink object
-	 */
-	JunctionLaneLink* GetLastAddedJunctionLaneLink();
-
-
-};
-
-/**
- * Junction lane link class. Holds all the information for a lane link record
- *
- *
- *
- *
- */
-class JunctionLaneLink
-{
-private:
-	/**
-	 * Record parameters
-	 */
-	int mFrom;
-	int mTo;
-
-public:
-	/**
-	 * Constructor. Initializes the parameters
-	 * @param from ID of the incoming lane
-	 * @param to ID of the connecting lane
-	 */
-	JunctionLaneLink(int from, int to);
-
-	/**
-	 * Set the ID of the incoming lane
-	 */
-	void SetFrom (int from);
-
-	/**
-	 * Set the ID of the connecting lane
-	 */
-	void SetTo (int to);
-
-	/**
-	 * Get the ID of the incoming lane
-	 */
-	int GetFrom();
-
-	/**
-	 * Get the ID of the connecting lane
-	 */
-	int GetTo();
-};
-
-
-/**
- * Junction priority class. Holds all the information for a priority record
- *
- *
- *
- *
- */
-class JunctionPriorityRoad
-{
-private:
-	/**
-	 * Record parameters
-	 */
-	string mHigh;
-	string mLow;
-public:
-
-	/**
-	 * Constructor. Initializes the parameters
-	 * @param high ID of the connecting road with higher priority
-	 * @param low ID of the connecting road with lower priority
-	 */
-	JunctionPriorityRoad(string high, string low);
-
-	/**
-	 * Set the ID of the connecting road with higher priority
-	 */
-	void SetHigh (string high);
-
-	/**
-	 * Set the ID of the connecting road with lower priority
-	 */
-	void SetLow (string low);
-
-	/**
-	 * Get the ID of the connecting road with higher priority
-	 */
-	string GetHigh();
-
-	/**
-	 * Get the ID of the connecting road with lower priority
-	 */
-	string GetLow();
-
-};
-
-
-
-/**
- * Junction controller class. Holds all the information for a priority record
- *
- *
- *
- *
- */
-class JunctionController
-{
-private:
-	/**
-	 * Record parameters
-	 */
-	string mId;
-	string mType;
-public:
-	/**
-	 * Constructor. Initializes the parameters
-	 * @param id ID of the controller to add
-	 * @param type Type of control
-	 */
-	JunctionController(string id, string type);
-
-	/**
-	 * Set the ID of the controller to add
-	 */
-	void SetId (string id);
-
-	/**
-	 * Set the type of control
-	 */
-	void SetType (string type);
-
-	/**
-	 * Get the ID of the controller to add
-	 */
-	string GetId();
-
-	/**
-	 * Get the type of control
-	 */
-	string GetType();
-
-};
-
-#endif

+ 0 - 1711
src/tool/map_lanetoxodr/OpenDrive/Lane.cpp

@@ -1,1711 +0,0 @@
-#include "Lane.h"
-
-
-
-
-/**
-* Lane section class. Holds all the lane section information
-*
-*
-*
-*
-*/
-
-/**
-* Constructor. Sets basic lane section parameters
-* @param s s-offset of the lane section
-*/
-LaneSection::LaneSection (double s)
-{	mS=s;	}
-
-/**
-* Add a lane to the lane section
-* @param side the side of the road to which the lane will be added
-* @param id ID of the lane
-* @param type Type of the lane (Section 6.5 of the OpenDRIVE specification) 
-* @param level Level parameter of the road
-* @param sort Defines if the lanes should be sorted when added. True by default
-*/
-unsigned int LaneSection::AddLane(short int side, int id, string type, bool level, bool sort)
-{	
-	unsigned int index=0;
-	//if lanes are sorted, add the lane to the correct side
-	if(sort)
-	{
-		if(side<0)
-		{
-			index=GetLaneCount();
-			mLaneVector.push_back(Lane(side,id,type,level));	
-			mLastAddedLane=index;
-		}
-		else if(side==0)
-		{
-			int sz=GetLaneCount();
-			if(sz>0)
-			{
-				for(int i=0; i<sz; i++)
-				{
-					if(mLaneVector[i].GetId()<0)
-					{
-						index=i;
-						mLaneVector.insert(mLaneVector.begin()+index, Lane(side,id,type,level));
-						mLastAddedLane=index;
-						break;
-					}
-				}
-			}
-			else
-			{
-				index=0;
-				mLaneVector.push_back(Lane(side,id,type,level));
-				mLastAddedLane=index;
-			}
-		}
-		else
-		{
-			index=0;
-			mLaneVector.insert(mLaneVector.begin(), Lane(side,id,type,level));
-			mLastAddedLane=index;
-		}
-
-		return index;
-	}
-	else
-	{
-		index=GetLaneCount();
-		mLaneVector.push_back(Lane(side,id,type,level));	
-		mLastAddedLane=index;
-		return index;
-	}	
-}
-
-/**
-* Delete the lane at the provided index
-*/
-void LaneSection::DeleteLane(unsigned int index)
-{
-	mLaneVector.erase(mLaneVector.begin()+index);
-}
-
-/**
-* Delete the outside left or right lane 
-*/
-void LaneSection::DeleteLeftLane()
-{
-	mLaneVector.erase(mLaneVector.begin());
-}
-void LaneSection::DeleteRigthLane()
-{
-	mLaneVector.pop_back();
-}
-
-/**
-* Get the last lane
-* @return A pointer to Lane object
-*/
-Lane* LaneSection::GetLastLane()
-{
-	if (mLaneVector.size()>0)
-		return &mLaneVector.at(mLaneVector.size()-1);
-	else
-		return NULL;
-}
-
-/**
-* Get the last added lane (which might not be the one from the end of the vector)
-* @return A pointer to Lane object
-*/
-Lane* LaneSection::GetLastAddedLane()
-{
-	if(mLastAddedLane<mLaneVector.size())
-		return &mLaneVector.at(mLastAddedLane);
-	else
-		return NULL;
-}
-
-/**
-* Get the last left lane
-* @return A pointer to Lane object
-*/
-Lane* LaneSection::GetLastLeftLane()
-{
-	if(mLaneVector.size()>0)
-	{
-		if(mLaneVector.at(0).GetSide()>0)
-			return &mLaneVector.at(0);
-		else
-			return NULL;
-	}
-	else
-		return NULL;
-}
-
-/**
-* Get the last center lane
-* @return A pointer to Lane object
-*/
-Lane* LaneSection::GetLastCenterLane()
-{
-	int sz=GetLaneCount();
-	for(int i=0; i<sz; i++)
-	{
-		if(mLaneVector[i].GetSide()==0)
-		{
-			return &mLaneVector.at(i);
-		}
-	}
-	return NULL;
-}
-
-/**
-* Get the last right lane
-* @return A pointer to Lane object
-*/
-Lane* LaneSection::GetLastRightLane()
-{
-	if(mLaneVector.size()>0)
-	{
-		int indexLast=mLaneVector.size()-1;
-		if(mLaneVector.at(indexLast).GetSide()<0)
-			return &mLaneVector.at(indexLast);
-		else
-			return NULL;
-	}
-	else return NULL;
-}
-/**
-* Get the lane vector
-* @return A pointer to a vector of type Lane
-*/
-vector<Lane>* LaneSection::GetLaneVector()
-{
-	return &mLaneVector;
-}
-
-/**
-* Get the lane by providing its index
-* @param i Index of the lane to be returned
-* @return A pointer to Lane object
-*/
-Lane* LaneSection::GetLane(unsigned int i)
-{
-	if ((mLaneVector.size()>0)&&(i<mLaneVector.size()))
-		return &mLaneVector.at(i);
-	else
-		return NULL;
-}
-
-/**
-* Get the lane number
-* @return Unsigned int with that stores the number of lanes
-*/
-unsigned int LaneSection::GetLaneCount()
-{
-	return mLaneVector.size();
-}
-
-/**
-* Get the lane section s-offset
-*/
-double LaneSection::GetS()
-{
-	return mS;
-}
-
-/**
-* Get the lane section final s-offset which is the s-offset of the last record of the lane section
-*/
-double LaneSection::GetS2()
-{
-	double lHighestS=0;
-
-	int sz=GetLaneCount();
-	for(int i=0; i<sz; i++)
-	{
-		Lane *lLane = GetLane(i);
-
-		//width
-		LaneWidth *lWidth = lLane->GetLaneWidth(lLane->GetLaneWidthCount()-1);
-		if(lWidth!=NULL) 
-		{
-			if(lWidth->GetS()>lHighestS) lHighestS=lWidth->GetS();
-		}
-
-		//road mark
-		LaneRoadMark *lRoadMark = lLane->GetLaneRoadMark(lLane->GetLaneRoadMarkCount()-1);
-		if(lRoadMark!=NULL) 
-		{
-			if(lRoadMark->GetS()>lHighestS) lHighestS=lRoadMark->GetS();
-		}
-
-		//material
-		LaneMaterial *lMaterial = lLane->GetLaneMaterial(lLane->GetLaneMaterialCount()-1);
-		if(lMaterial!=NULL) 
-		{
-			if(lMaterial->GetS()>lHighestS) lHighestS=lMaterial->GetS();
-		}
-
-		//visibility
-		LaneVisibility *lVisibility = lLane->GetLaneVisibility(lLane->GetLaneVisibilityCount()-1);
-		if(lVisibility!=NULL) 
-		{
-			if(lVisibility->GetS()>lHighestS) lHighestS=lVisibility->GetS();
-		}
-
-		//speed
-		LaneSpeed *lSpeed = lLane->GetLaneSpeed(lLane->GetLaneSpeedCount()-1);
-		if(lSpeed!=NULL) 
-		{
-			if(lSpeed->GetS()>lHighestS) lHighestS=lSpeed->GetS();
-		}
-
-		//access
-		LaneAccess *lAccess = lLane->GetLaneAccess(lLane->GetLaneAccessCount()-1);
-		if(lAccess!=NULL) 
-		{
-			if(lAccess->GetS()>lHighestS) lHighestS=lAccess->GetS();
-		}
-
-		//height
-		LaneHeight *lHeight = lLane->GetLaneHeight(lLane->GetLaneHeightCount()-1);
-		if(lHeight!=NULL) 
-		{
-			if(lHeight->GetS()>lHighestS) lHighestS=lHeight->GetS();
-		}
-	}
-
-	return mS+lHighestS;
-
-}
-
-/**
-* Set the lane section s-offset
-*/
-void LaneSection::SetS(double value)
-{
-	mS=value;
-}
-
-
-/**
-* Check if the tested s-offset is inside the lane section interval
-* @param A double s-offset value that has to be checked
-* @return Return true if the s-offset value belongs to current lane section, false otherwise
-*/
-bool LaneSection::CheckInterval(double s_check)
-{
-	if (s_check>=mS)
-		return true;
-	else 
-		return false;
-}
-
-/**
-* Return the lane-0 index in the lanes vector
-* @return An unsigned int value with the index
-*/
-unsigned int LaneSection::GetZeroLaneIndex()
-{
-	for (unsigned int i=0; i<GetLaneCount(); i++)
-	{
-		if(mLaneVector.at(i).GetId()==0)
-			return i;
-	}
-	return 0;
-}
-
-/**
-* Return the number of left lanes
-* @return An unsigned int value with the number of left lanes
-*/
-unsigned int LaneSection::GetLeftLaneCount()
-{
-	unsigned int count=0;
-	for (unsigned int i=0;i<GetLaneCount();i++)
-	{
-		if(mLaneVector.at(i).GetSide()==1)
-			count++;
-	}
-	return count;
-}
-
-/**
-* Return the number of central lanes
-* @return An unsigned int value with the number of central lanes
-*/
-unsigned int LaneSection::GetCenterLaneCount()
-{
-	unsigned int count=0;
-	for(unsigned int i=0; i<GetLaneCount(); i++)
-	{
-		if(mLaneVector[i].GetSide()==0)
-		{
-			count++;
-		}
-	}
-	return count;
-}
-
-/**
-* Return the number of right lanes
-* @return An unsigned int value with the number of right lanes
-*/
-unsigned int LaneSection::GetRightLaneCount()
-{
-	unsigned int count=0;
-	for (unsigned int i=0;i<GetLaneCount();i++)
-	{
-		if(mLaneVector.at(i).GetSide()==-1)
-			count++;
-	}
-	return count;
-}
-
-/**
-* Fill a special structure with all the lane / lane section data that is sampled at a provided s-offset position along the road
-* This data is used later to fill the geometry arrays
-* @param s_chek s-offset along the road at which to sample the lane section
-* @param laneSectionSample The structure that has to be filled with the sampled data
-* @return Returns true if the operation was successful. 
-*/
-bool LaneSection::FillLaneSectionSample(double s_check, LaneSectionSample& laneSectionSample)
-{
-	//clear and initialize variables
-	laneSectionSample.ClearVectors();
-	double width=0;
-	int leftMax=0;
-	int rightMax=GetLaneCount()-1;
-
-	s_check-=GetS();
-
-	bool level;
-	string type;
-	LaneHeight height; 
-	LaneRoadMark roadMark;
-	//Fill in left width vector
-	//if there are left lanes
-	if (GetLeftLaneCount()>0)
-	{	
-		//go through all of them
-		for (int i=GetZeroLaneIndex(); i>=leftMax;i--)
-		{	
-			type=GetLane(i)->GetType();
-			level=GetLane(i)->GetLevel();
-			height=GetLane(i)->GetHeightValue(s_check);
-			roadMark=GetLane(i)->GetRoadMarkValue(s_check);
-			//and accumulate the width
-			width=GetLane(i)->GetWidthValue(s_check);
-
-			laneSectionSample.AddLeftRecord(type, width, height, roadMark, level);
-		}
-	}
-
-	//same for the right side of the road
-	if (GetRightLaneCount()>0)
-	{	
-		//go through all of them
-		for (int i=GetZeroLaneIndex(); i<=rightMax;i++)
-		{	
-			type=GetLane(i)->GetType();
-			level=GetLane(i)->GetLevel();
-			height=GetLane(i)->GetHeightValue(s_check);
-			roadMark=GetLane(i)->GetRoadMarkValue(s_check);
-			//and accumulate the width
-			width=GetLane(i)->GetWidthValue(s_check);
-
-			laneSectionSample.AddRightRecord(type, width, height, roadMark, level);	
-		}
-	}
-	return true;
-}
-
-/**
-* Destructor. Delete all the members of the vectors: mLeft, mCenter, mRight
-*/
-LaneSection::~LaneSection()
-{
-	// DELETING LANES
-	mLaneVector.clear();
-}
-
-/**
- * @brief LaneSection::SetSingleSide
- * @param singleSide
- */
-void LaneSection::SetSingleSide(std::string singleSide)
-{
-    msingleSide = singleSide;
-}
-
-/**
- * @brief LaneSection::GetSingleSide
- * @return singleSide
- */
-string LaneSection::GetSingleSide()
-{
-    return msingleSide;
-}
-/**
-* Lane Section Sample. Holds all the lane information at a certain S value including lane widths, levels, 
-* heights, etc
-*
-*
-*
-*
-*/ 
-
-LaneSectionSample::LaneSectionSample()
-{}
-
-/*
-* Add various elements to the structure. Depending on the the value to be added, various input parameters are used.
-* The methods are divided into left and right for left and right sides of the road.
-*/
-void LaneSectionSample::AddLeftType(string type)
-{	mLeftTypeVector.push_back(type);	}
-void LaneSectionSample::AddLeftWidth(double width)
-{	mLeftWidthVector.push_back(width);	}
-void LaneSectionSample::AddLeftHeight(LaneHeight height)
-{	mLeftHeightVector.push_back(height);	}
-void LaneSectionSample::AddLeftRoadMark(LaneRoadMark roadMark)
-{	mLeftRoadMarkVector.push_back(roadMark);	}
-void LaneSectionSample::AddLeftLevel(bool level)
-{	mLeftLevelVector.push_back(level);	}
-
-void LaneSectionSample::AddRightType(string type)
-{	mRightTypeVector.push_back(type);	}
-void LaneSectionSample::AddRightWidth(double width)
-{	mRightWidthVector.push_back(width);	}
-void LaneSectionSample::AddRightHeight(LaneHeight height)
-{	mRightHeightVector.push_back(height);	}
-void LaneSectionSample::AddRightRoadMark(LaneRoadMark roadMark)
-{	mRightRoadMarkVector.push_back(roadMark);	}
-void LaneSectionSample::AddRightLevel(bool level)
-{	mRightLevelVector.push_back(level);	}
-
-void LaneSectionSample::AddLeftRecord(string type, double width, LaneHeight height, LaneRoadMark roadMark, bool level)
-{
-	AddLeftType(type);
-	AddLeftWidth(width);
-	AddLeftHeight(height);
-	AddLeftRoadMark(roadMark);
-	AddLeftLevel(level);
-}
-void LaneSectionSample::AddRightRecord(string type, double width, LaneHeight height, LaneRoadMark roadMark, bool level)
-{
-	AddRightType(type);
-	AddRightWidth(width);
-	AddRightHeight(height);
-	AddRightRoadMark(roadMark);
-	AddRightLevel(level);
-}
-
-/*
-* Get various elements of the structure. The methods return type depends on the elements that are returned.
-* The methods are divided into left and right for left and right sides of the road.
-*/
-string LaneSectionSample::GetLeftType(unsigned int i)
-{	return mLeftTypeVector.at(i);	}
-double LaneSectionSample::GetLeftWidth(unsigned int i)
-{	return mLeftWidthVector.at(i);	}
-LaneHeight LaneSectionSample::GetLeftHeight(unsigned int i)
-{	return mLeftHeightVector.at(i);	}
-LaneRoadMark LaneSectionSample::GetLeftRoadMark(unsigned int i)
-{	return mLeftRoadMarkVector.at(i);	}
-bool LaneSectionSample::GetLeftLevel(unsigned int i)
-{	return mLeftLevelVector.at(i);	}
-
-string LaneSectionSample::GetRightType(unsigned int i)
-{	return mRightTypeVector.at(i);	}
-double LaneSectionSample::GetRightWidth(unsigned int i)
-{	return mRightWidthVector.at(i);	}
-LaneHeight LaneSectionSample::GetRightHeight(unsigned int i)
-{	return mRightHeightVector.at(i);	}
-LaneRoadMark LaneSectionSample::GetRightRoadMark(unsigned int i)
-{	return mRightRoadMarkVector.at(i);	}
-bool LaneSectionSample::GetRightLevel(unsigned int i)
-{	return mRightLevelVector.at(i);	}
-
-
-/*
-* Get the number of elements in the vectors
-*/
-unsigned int LaneSectionSample::GetLeftVectorsSize()
-{	return mLeftWidthVector.size();	}
-unsigned int LaneSectionSample::GetRightVectorsSize()
-{	return mRightWidthVector.size();	}
-
-
-/*
-* Get the various record vectors. The vector type depends on the record
-* The methods are divided into left and right for left and right sides of the road.
-*/
-vector<string>* LaneSectionSample::GetLeftTypeVector()
-{	return &mLeftTypeVector;	}
-vector<double>* LaneSectionSample::GetLeftWidthVector()
-{	return &mLeftWidthVector;	}
-vector<LaneHeight>* LaneSectionSample::GetLeftHeigthVector()
-{	return &mLeftHeightVector;	}
-vector<LaneRoadMark>* LaneSectionSample::GetLeftRoadMarkVector()
-{	return &mLeftRoadMarkVector;	}
-vector<bool>* LaneSectionSample::GetLeftLevelVector()
-{	return &mLeftLevelVector;	}
-
-vector<string>* LaneSectionSample::GetRightTypeVector()
-{	return &mRightTypeVector;	}
-vector<double>* LaneSectionSample::GetRightWidthVector()
-{	return &mRightWidthVector;	}
-vector<LaneHeight>* LaneSectionSample::GetRightHeigthVector()
-{	return &mRightHeightVector;	}
-vector<LaneRoadMark>* LaneSectionSample::GetRightRoadMarkVector()
-{	return &mRightRoadMarkVector;	}
-vector<bool>* LaneSectionSample::GetRightLevelVector()
-{	return &mRightLevelVector;	}
-
-/*
-* Clear the vectors
-*/
-void LaneSectionSample::ClearVectors()
-{
-	mLeftTypeVector.clear();
-	mLeftWidthVector.clear();
-	mLeftHeightVector.clear();
-	mLeftRoadMarkVector.clear();
-	mLeftLevelVector.clear();
-
-	mRightTypeVector.clear();
-	mRightWidthVector.clear();
-	mRightHeightVector.clear();
-	mRightRoadMarkVector.clear();
-	mRightLevelVector.clear();
-}
-
-/**
-* Lane class. Holds all the record data that describes a lane
-*
-*
-*
-*
-*
-*/
-
-/**
-*	Constructor
-*/
-Lane::Lane(short int side, int id, string type, bool level)
-{	mSide=side; mId=id; mType=type; mLevel=level;	mPredecessorExists=false; mSuccessorExists=false;	}
-
-/**
-*	Various set methods.
-*/
-void Lane::SetSide(short int side)
-{
-	mSide=side;
-}
-void Lane::SetId(int id)
-{
-	mId=id;
-}
-void Lane::SetType(string type)
-{
-	mType=type;
-}
-void Lane::SetLevel(bool level)
-{
-	mLevel=level;
-}
-//-------------
-void Lane::SetPredecessor(int predecessor)
-{	mPredecessor=predecessor; mPredecessorExists=true;	}
-//-------------
-void Lane::SetSuccessor(int successor)
-{	mSuccessor=successor;	mSuccessorExists=true;	}
-
-/**
-*	Remove lane linkage
-*/
-void Lane::RemovePredecessor()
-{	mPredecessor=0;	mPredecessorExists=false;	}
-
-void Lane::RemoveSuccessor()
-{	mSuccessor=0;	mSuccessorExists=false;		}
-
-
-/**
- * @brief Lane::AddBorderRecord  Add Border Record
- * @param s
- * @param a
- * @param b
- * @param c
- * @param d
- * @return
- */
-unsigned int Lane::AddBorderRecord(double s, double a, double b, double c, double d)
-{
-    // Gets the index where the record should be inserted in the vector
-    unsigned int index = CheckBorderInterval(s)+1;
-    // If larger than the record count - push to the back
-    if(index>=GetLaneBorderCount()) mLaneBorder.push_back(LaneBorder(s,a,b,c,d));
-    // else insert in the middle
-    else mLaneBorder.insert(mLaneBorder.begin()+index, LaneBorder(s,a,b,c,d));
-    // Save the last added record index
-    mLastAddedLaneBorder=index;
-    return index;
-}
-
-/**
- * Methods used to add child records to the respective vectors
- */
-unsigned int Lane::AddWidthRecord(double s, double a, double b, double c, double d)
-{	
-	// Gets the index where the record should be inserted in the vector
-	unsigned int index = CheckWidthInterval(s)+1;
-	// If larger than the record count - push to the back
-	if(index>=GetLaneWidthCount()) mLaneWidth.push_back(LaneWidth(s,a,b,c,d));	
-	// else insert in the middle
-	else mLaneWidth.insert(mLaneWidth.begin()+index, LaneWidth(s,a,b,c,d));
-	// Save the last added record index
-	mLastAddedLaneWidth=index;
-	return index;
-}
-//-------------
-unsigned int Lane::AddRoadMarkRecord(double sOffset, string type, string weight, string color, double width, string laneChange)
-{	
-	// Check the first method in the group for details
-
-	unsigned int index = CheckRoadMarkInterval(sOffset)+1;
-	if(index>=GetLaneRoadMarkCount()) mLaneRoadMark.push_back(LaneRoadMark(sOffset, type, weight, color, width, laneChange));	
-	else mLaneRoadMark.insert(mLaneRoadMark.begin()+index, LaneRoadMark(sOffset, type, weight, color, width, laneChange));
-	mLastAddedLaneRoadMark=index;
-	return index;
-}
-//-------------
-unsigned int Lane::AddMaterialRecord(double sOffset, string surface, double friction, double roughness)
-{	
-	// Check the first method in the group for details
-
-	unsigned int index = CheckMaterialInterval(sOffset)+1;
-	if(index>=GetLaneMaterialCount()) mLaneMaterial.push_back(LaneMaterial(sOffset,surface,friction,roughness));	
-	else mLaneMaterial.insert(mLaneMaterial.begin()+index, LaneMaterial(sOffset,surface,friction,roughness));
-	mLastAddedLaneMaterial=index;
-	return index;
-}
-//-------------
-unsigned int Lane::AddVisibilityRecord(double sOffset, double forward, double back, double left, double right)
-{	
-	// Check the first method in the group for details
-
-	unsigned int index = CheckVisibilityInterval(sOffset)+1;
-	if(index>=GetLaneVisibilityCount()) mLaneVisibility.push_back(LaneVisibility(sOffset,forward,back,left,right));	
-	else mLaneVisibility.insert(mLaneVisibility.begin()+index, LaneVisibility(sOffset,forward,back,left,right));
-	mLastAddedLaneVisibility=index;
-	return index;
-}
-//-------------
-unsigned int Lane::AddSpeedRecord(double sOffset, double max)
-{	
-	// Check the first method in the group for details
-
-	unsigned int index = CheckSpeedInterval(sOffset)+1;
-	if(index>=GetLaneSpeedCount()) mLaneSpeed.push_back(LaneSpeed(sOffset,max));	
-	else mLaneSpeed.insert(mLaneSpeed.begin()+index, LaneSpeed(sOffset,max));
-	mLastAddedLaneSpeed=index;
-	return index;
-}
-//-------------
-unsigned int Lane::AddAccessRecord(double sOffset, string restriction)
-{	
-	// Check the first method in the group for details
-
-	unsigned int index = CheckAccessInterval(sOffset)+1;
-	if(index>=GetLaneAccessCount()) mLaneAccess.push_back(LaneAccess(sOffset,restriction));	
-	else mLaneAccess.insert(mLaneAccess.begin()+index, LaneAccess(sOffset,restriction));
-	mLastAddedLaneAccess=index;
-	return index;
-}
-//-------------
-unsigned int Lane::AddHeightRecord(double sOffset, double inner, double outer)
-{	
-	// Check the first method in the group for details
-
-	unsigned int index = CheckHeightInterval(sOffset)+1;
-	if(index>=GetLaneHeightCount()) mLaneHeight.push_back(LaneHeight(sOffset,inner,outer));	
-	else mLaneHeight.insert(mLaneHeight.begin()+index, LaneHeight(sOffset,inner,outer));
-	mLastAddedLaneHeight=index;
-	return index;
-}
-
-/**
- * @brief Lane::CloneLaneBorder
- * @param index
- * @return
- */
-unsigned int Lane::CloneLaneBorder(unsigned int index)
-{
-    // Clone the object and insert it in the middle of the vector
-    if(index<mLaneBorder.size()-1)
-        mLaneBorder.insert(mLaneBorder.begin()+index+1, mLaneBorder[index]);
-    // or just push it to the back
-    else if(index==mLaneBorder.size()-1)
-        mLaneBorder.push_back(mLaneBorder[index]);
-    // Save the last added record index
-    mLastAddedLaneBorder=index+1;
-    return mLastAddedLaneBorder;
-}
-
-/**
- * Methods used to clone child records in the respective vectors
- */
-unsigned int Lane::CloneLaneWidth(unsigned int index)
-{
-	// Clone the object and insert it in the middle of the vector
-	if(index<mLaneWidth.size()-1)
-		mLaneWidth.insert(mLaneWidth.begin()+index+1, mLaneWidth[index]);
-	// or just push it to the back
-	else if(index==mLaneWidth.size()-1)
-		mLaneWidth.push_back(mLaneWidth[index]);
-	// Save the last added record index
-	mLastAddedLaneWidth=index+1;
-	return mLastAddedLaneWidth;
-}
-unsigned int Lane::CloneLaneRoadMark(unsigned int index)
-{
-	// Check the first method in the group for details
-
-	if(index<mLaneRoadMark.size()-1)
-		mLaneRoadMark.insert(mLaneRoadMark.begin()+index+1, mLaneRoadMark[index]);
-	else if(index==mLaneRoadMark.size()-1)
-		mLaneRoadMark.push_back(mLaneRoadMark[index]);
-	mLastAddedLaneRoadMark=index+1;
-	return mLastAddedLaneRoadMark;
-}
-unsigned int Lane::CloneLaneMaterial(unsigned int index)
-{
-	// Check the first method in the group for details
-
-	if(index<mLaneMaterial.size()-1)
-		mLaneMaterial.insert(mLaneMaterial.begin()+index+1, mLaneMaterial[index]);
-	else if(index==mLaneMaterial.size()-1)
-		mLaneMaterial.push_back(mLaneMaterial[index]);
-	mLastAddedLaneMaterial=index+1;
-	return mLastAddedLaneMaterial;
-}
-unsigned int Lane::CloneLaneVisibility(unsigned int index)
-{
-	// Check the first method in the group for details
-
-	if(index<mLaneVisibility.size()-1)
-		mLaneVisibility.insert(mLaneVisibility.begin()+index+1, mLaneVisibility[index]);
-	else if(index==mLaneVisibility.size()-1)
-		mLaneVisibility.push_back(mLaneVisibility[index]);
-	mLastAddedLaneVisibility=index+1;
-	return mLastAddedLaneVisibility;
-}
-unsigned int Lane::CloneLaneSpeed(unsigned int index)
-{
-	// Check the first method in the group for details
-
-	if(index<mLaneSpeed.size()-1)
-		mLaneSpeed.insert(mLaneSpeed.begin()+index+1, mLaneSpeed[index]);
-	else if(index==mLaneSpeed.size()-1)
-		mLaneSpeed.push_back(mLaneSpeed[index]);
-	mLastAddedLaneSpeed=index+1;
-	return mLastAddedLaneSpeed;
-}
-unsigned int Lane::CloneLaneAccess(unsigned int index)
-{
-	// Check the first method in the group for details
-
-	if(index<mLaneAccess.size()-1)
-		mLaneAccess.insert(mLaneAccess.begin()+index+1, mLaneAccess[index]);
-	else if(index==mLaneAccess.size()-1)
-		mLaneAccess.push_back(mLaneAccess[index]);
-	mLastAddedLaneAccess=index+1;
-	return mLastAddedLaneAccess;
-}
-unsigned int Lane::CloneLaneHeight(unsigned int index)
-{
-	// Check the first method in the group for details
-
-	if(index<mLaneHeight.size()-1)
-		mLaneHeight.insert(mLaneHeight.begin()+index+1, mLaneHeight[index]);
-	else if(index==mLaneHeight.size()-1)
-		mLaneHeight.push_back(mLaneHeight[index]);
-	mLastAddedLaneHeight=index+1;
-	return mLastAddedLaneHeight;
-}
-
-
-
-/**
- * Methods used to delete child records from the respective vectors
- */
-
-void Lane::DeleteLaneBoder(unsigned int index)
-{
-    mLaneBorder.erase(mLaneBorder.begin()+index);
-}
-void Lane::DeleteLaneWidth(unsigned int index)
-{
-	mLaneWidth.erase(mLaneWidth.begin()+index);
-}
-void Lane::DeleteLaneRoadMark(unsigned int index)
-{
-	mLaneRoadMark.erase(mLaneRoadMark.begin()+index);
-}
-void Lane::DeleteLaneMaterial(unsigned int index)
-{
-	mLaneMaterial.erase(mLaneMaterial.begin()+index);
-}
-void Lane::DeleteLaneVisibility(unsigned int index)
-{
-	mLaneVisibility.erase(mLaneVisibility.begin()+index);
-}
-void Lane::DeleteLaneSpeed(unsigned int index)
-{
-	mLaneSpeed.erase(mLaneSpeed.begin()+index);
-}
-void Lane::DeleteLaneAccess(unsigned int index)
-{
-	mLaneAccess.erase(mLaneAccess.begin()+index);
-}
-void Lane::DeleteLaneHeight(unsigned int index)
-{
-	mLaneHeight.erase(mLaneHeight.begin()+index);
-}
-
-
-/**
-*	Getters of the lane parameters
-*/
-int Lane::GetSide()
-{
-	return mSide;
-}
-int Lane::GetId()
-{
-	return mId;
-}
-string Lane::GetType()
-{
-	return mType;
-}
-bool Lane::GetLevel()
-{
-	return mLevel;
-}
-
-/**
-*	Check if linkage information is provided
-*/
-bool Lane::IsPredecessorSet()
-{
-	return mPredecessorExists;
-}
-int Lane::GetPredecessor()
-{
-	return mPredecessor;
-}
-bool Lane::IsSuccessorSet()
-{
-	return mSuccessorExists;
-}
-int Lane::GetSuccessor()
-{
-	return mSuccessor;
-}
-
-
-/**
-*	Get pointers to the records vectors
-*/
-vector <LaneBorder> *Lane::GetLaneBorderVector()
-{	return &mLaneBorder;	}
-
-vector <LaneWidth> *Lane::GetLaneWidthVector()
-{	return &mLaneWidth;	}
-
-vector <LaneRoadMark> *Lane::GetLaneRoadMarkVector()
-{	return &mLaneRoadMark;	}
-
-vector <LaneMaterial> *Lane::GetLaneMaterialVector()
-{	return &mLaneMaterial;	}
-
-vector <LaneVisibility> *Lane::GetLaneVisibilityVector()
-{	return &mLaneVisibility;	}
-
-vector <LaneSpeed> *Lane::GetLaneSpeedVector()
-{	return &mLaneSpeed;	}
-
-vector <LaneAccess> *Lane::GetLaneAccessVector()
-{	return &mLaneAccess;	}
-
-vector <LaneHeight> *Lane::GetLaneHeightVector()
-{	return &mLaneHeight;	}
-
-
-/**
-*	Get the number of elements in a certain vector
-*/
-unsigned int Lane::GetLaneBorderCount()
-{	return mLaneBorder.size();	}
-
-unsigned int Lane::GetLaneWidthCount()
-{	return mLaneWidth.size();	}
-
-unsigned int Lane::GetLaneRoadMarkCount()
-{	return mLaneRoadMark.size();	}
-
-unsigned int Lane::GetLaneMaterialCount()
-{	return mLaneMaterial.size();	}
-
-unsigned int Lane::GetLaneVisibilityCount()
-{	return mLaneVisibility.size();	}
-
-unsigned int Lane::GetLaneSpeedCount()
-{	return mLaneSpeed.size();	}
-
-unsigned int Lane::GetLaneAccessCount()
-{	return mLaneAccess.size();	}
-
-unsigned int Lane::GetLaneHeightCount()
-{	return mLaneHeight.size();	}
-
-/**
-*	Get the elements of a certain vectors at position i
-*/
-LaneBorder* Lane::GetLaneBorder(unsigned int i)
-{
-    if ((mLaneBorder.size()>0)&&(i<mLaneBorder.size()))
-        return &mLaneBorder.at(i);
-    else
-        return NULL;
-}
-
-LaneWidth* Lane::GetLaneWidth(unsigned int i)
-{
-	if ((mLaneWidth.size()>0)&&(i<mLaneWidth.size()))
-		return &mLaneWidth.at(i);
-	else
-		return NULL;
-}
-
-LaneRoadMark* Lane::GetLaneRoadMark(unsigned int i)
-{
-	if ((mLaneRoadMark.size()>0)&&(i<mLaneRoadMark.size()))
-		return &mLaneRoadMark.at(i);
-	else
-		return NULL;
-}
-
-LaneMaterial* Lane::GetLaneMaterial(unsigned int i)
-{
-	if ((mLaneMaterial.size()>0)&&(i<mLaneMaterial.size()))
-		return &mLaneMaterial.at(i);
-	else
-		return NULL;
-}
-
-LaneVisibility* Lane::GetLaneVisibility(unsigned int i)
-{
-	if ((mLaneVisibility.size()>0)&&(i<mLaneVisibility.size()))
-		return &mLaneVisibility.at(i);
-	else
-		return NULL;
-}
-
-LaneSpeed* Lane::GetLaneSpeed(unsigned int i)
-{
-	if ((mLaneSpeed.size()>0)&&(i<mLaneSpeed.size()))
-		return &mLaneSpeed.at(i);
-	else
-		return NULL;
-}
-
-LaneAccess* Lane::GetLaneAccess(unsigned int i)
-{
-	if ((mLaneAccess.size()>0)&&(i<mLaneAccess.size()))
-		return &mLaneAccess.at(i);
-	else
-		return NULL;
-}
-
-LaneHeight* Lane::GetLaneHeight(unsigned int i)
-{
-	if ((mLaneHeight.size()>0)&&(i<mLaneHeight.size()))
-		return &mLaneHeight.at(i);
-	else
-		return NULL;
-}
-
-
-/**
-*	Get the last elements of a certain vectors
-*/
-LaneBorder* Lane::GetLastLaneBorder()
-{
-    if (mLaneBorder.size()>0)
-        return &mLaneBorder.at(mLaneBorder.size()-1);
-    else
-        return NULL;
-}
-LaneWidth* Lane::GetLastLaneWidth()
-{
-	if (mLaneWidth.size()>0)
-		return &mLaneWidth.at(mLaneWidth.size()-1);
-	else
-		return NULL;
-}
-LaneRoadMark* Lane::GetLastLaneRoadMark()
-{
-	if (mLaneRoadMark.size()>0)
-		return &mLaneRoadMark.at(mLaneRoadMark.size()-1);
-	else
-		return NULL;
-}
-LaneMaterial* Lane::GetLastLaneMaterial()
-{
-	if (mLaneMaterial.size()>0)
-		return &mLaneMaterial.at(mLaneMaterial.size()-1);
-	else
-		return NULL;
-}
-LaneVisibility* Lane::GetLastLaneVisibility()
-{
-	if (mLaneVisibility.size()>0)
-		return &mLaneVisibility.at(mLaneVisibility.size()-1);
-	else
-		return NULL;
-}
-LaneSpeed* Lane::GetLastLaneSpeed()
-{
-	if (mLaneSpeed.size()>0)
-		return &mLaneSpeed.at(mLaneSpeed.size()-1);
-	else
-		return NULL;
-}
-LaneAccess* Lane::GetLastLaneAccess()
-{
-	if (mLaneAccess.size()>0)
-		return &mLaneAccess.at(mLaneAccess.size()-1);
-	else
-		return NULL;
-}
-LaneHeight* Lane::GetLastLaneHeight()
-{
-	if (mLaneHeight.size()>0)
-		return &mLaneHeight.at(mLaneHeight.size()-1);
-	else
-		return NULL;
-}
-
-/**
-*	Get the last added elements of a certain vectors (their position might not be at the end of the vector)
-*/
-LaneBorder* Lane::GetLastAddedLaneBorder()
-{
-    if(mLastAddedLaneBorder<mLaneBorder.size())
-        return &mLaneBorder.at(mLastAddedLaneBorder);
-    else
-        return NULL;
-}
-LaneWidth* Lane::GetLastAddedLaneWidth()
-{
-	if(mLastAddedLaneWidth<mLaneWidth.size())
-		return &mLaneWidth.at(mLastAddedLaneWidth);
-	else
-		return NULL;
-}
-LaneRoadMark* Lane::GetLastAddedLaneRoadMark()
-{
-	if(mLastAddedLaneRoadMark<mLaneRoadMark.size())
-		return &mLaneRoadMark.at(mLastAddedLaneRoadMark);
-	else
-		return NULL;
-}
-LaneMaterial* Lane::GetLastAddedLaneMaterial()
-{
-	if(mLastAddedLaneMaterial<mLaneMaterial.size())
-		return &mLaneMaterial.at(mLastAddedLaneMaterial);
-	else
-		return NULL;
-}
-LaneVisibility* Lane::GetLastAddedLaneVisibility()
-{
-	if(mLastAddedLaneVisibility<mLaneVisibility.size())
-		return &mLaneVisibility.at(mLastAddedLaneVisibility);
-	else
-		return NULL;
-}
-LaneSpeed* Lane::GetLastAddedLaneSpeed()
-{
-	if(mLastAddedLaneSpeed<mLaneSpeed.size())
-		return &mLaneSpeed.at(mLastAddedLaneSpeed);
-	else
-		return NULL;
-}
-LaneAccess* Lane::GetLastAddedLaneAccess()
-{
-	if(mLastAddedLaneAccess<mLaneAccess.size())
-		return &mLaneAccess.at(mLastAddedLaneAccess);
-	else
-		return NULL;
-}
-LaneHeight* Lane::GetLastAddedLaneHeight()
-{
-	if(mLastAddedLaneHeight<mLaneHeight.size())
-		return &mLaneHeight.at(mLastAddedLaneHeight);
-	else
-		return NULL;
-}
-
-/**
-*	Check the intervals and return the index of the records that applies to the provided s-offset
-*/
-int  Lane::CheckBorderInterval(double s_check)
-{
-
-    int res=-1;
-    //Go through all the width records
-    for (unsigned int i=0;i<mLaneBorder.size();i++)
-    {
-        //check if the s_check belongs to the current record
-        if (s_check >= mLaneBorder.at(i).GetS())
-            res=i;	//assign it to the result id
-        else
-            break;	//if not, break;
-    }
-    return res;		//return the result: 0 to MaxInt as the index to the record containing s_check or -1 if nothing found
-}
-int  Lane::CheckWidthInterval(double s_check)
-{
-
-	int res=-1;
-	//Go through all the width records
-	for (unsigned int i=0;i<mLaneWidth.size();i++)
-	{
-		//check if the s_check belongs to the current record
-		if (s_check >= mLaneWidth.at(i).GetS())
-			res=i;	//assign it to the result id
-		else 
-			break;	//if not, break;
-	}
-	return res;		//return the result: 0 to MaxInt as the index to the record containing s_check or -1 if nothing found
-}
-int Lane::CheckRoadMarkInterval(double s_check)
-{
-	int res=-1;
-	//Go through all the road mark records
-	for (unsigned int i=0;i<mLaneRoadMark.size();i++)
-	{
-		//check if the s_check belongs to the current record
-		if (s_check >= mLaneRoadMark.at(i).GetS())
-			res=i;	//assign it to the result id
-		else 
-			break;	//if not, break;
-	}
-	return res;		//return the result: 0 to MaxInt as the index to the record containing s_check or -1 if nothing found
-}
-int Lane::CheckMaterialInterval(double s_check)
-{
-	int res=-1;
-	//Go through all the material records
-	for (unsigned int i=0;i<mLaneMaterial.size();i++)
-	{
-		//check if the s_check belongs to the current record
-		if (s_check >= mLaneMaterial.at(i).GetS())
-			res=i;	//assign it to the result id
-		else 
-			break;	//if not, break;
-	}
-	return res;		//return the result: 0 to MaxInt as the index to the record containing s_check or -1 if nothing found
-}
-int Lane::CheckVisibilityInterval(double s_check)
-{
-	int res=-1;
-	//Go through all the visibility records
-	for (unsigned int i=0;i<mLaneVisibility.size();i++)
-	{
-		//check if the s_check belongs to the current record
-		if (s_check >= mLaneVisibility.at(i).GetS())
-			res=i;	//assign it to the result id
-		else 
-			break;	//if not, break;
-	}
-	return res;		//return the result: 0 to MaxInt as the index to the record containing s_check or -1 if nothing found
-}
-int Lane::CheckSpeedInterval(double s_check)
-{
-	int res=-1;
-	//Go through all the speed records
-	for (unsigned int i=0;i<mLaneSpeed.size();i++)
-	{
-		//check if the s_check belongs to the current record
-		if (s_check >= mLaneSpeed.at(i).GetS())
-			res=i;	//assign it to the result id
-		else 
-			break;	//if not, break;
-	}
-	return res;		//return the result: 0 to MaxInt as the index to the record containing s_check or -1 if nothing found
-}
-int Lane::CheckAccessInterval(double s_check)
-{
-	int res=-1;
-	//Go through all the access records
-	for (unsigned int i=0;i<mLaneAccess.size();i++)
-	{
-		//check if the s_check belongs to the current record
-		if (s_check >= mLaneAccess.at(i).GetS())
-			res=i;	//assign it to the result id
-		else 
-			break;	//if not, break;
-	}
-	return res;		//return the result: 0 to MaxInt as the index to the record containing s_check or -1 if nothing found
-}
-int Lane::CheckHeightInterval(double s_check)
-{
-	int res=-1;
-	//Go through all the height records
-	for (unsigned int i=0;i<mLaneHeight.size();i++)
-	{
-		//check if the s_check belongs to the current record
-		if (s_check >= mLaneHeight.at(i).GetS())
-			res=i;	//assign it to the result id
-		else 
-			break;	//if not, break;
-	}
-	return res;		//return the result: 0 to MaxInt as the index to the record containing s_check or -1 if nothing found
-}
-
-/**
-*	Evaluate the record and return the width value
-*/
-
-double  Lane::GetBorderValue(double s_check)
-{
-    double retVal=0;
-    //find the record where s_check belongs
-    int index=CheckBorderInterval(s_check);
-    //If found, return the type
-    if (index>=0)
-        retVal= mLaneBorder.at(index).GetValue(s_check);
-    return retVal;
-}
-
-double  Lane::GetWidthValue(double s_check)
-{
-	double retVal=0;
-	//find the record where s_check belongs
-	int index=CheckWidthInterval(s_check);
-	//If found, return the type
-	if (index>=0)
-		retVal= mLaneWidth.at(index).GetValue(s_check);
-	return retVal;
-}
-
-/**
-*	Evaluate the record and return the height object
-*/
-LaneHeight  Lane::GetHeightValue(double s_check)
-{
-	LaneHeight  retVal(0,0,0);
-	//find the record where s_check belongs
-	int index=CheckHeightInterval(s_check);
-	//If found, return the type
-	if (index>=0)
-	{
-		retVal.SetInner(mLaneHeight.at(index).GetInner());
-		retVal.SetOuter(mLaneHeight.at(index).GetOuter());
-	}
-	return retVal;
-}
-
-
-void Lane::SetuserData(std::string struserData)
-{
-    muserData = struserData;
-}
-
-void Lane::GetuserData(std::string &struserData)
-{
-    struserData = muserData;
-}
-
-/**
-*	Evaluate the road marks records and return the road mark object corresponding to the provided s-offset
-*/
-LaneRoadMark Lane::GetRoadMarkValue(double s_check)
-{
-	LaneRoadMark returnRoadMark;
-	//find the record where s_check belongs
-	int index=CheckRoadMarkInterval(s_check);
-	//If found, return the params 
-	if (index>=0)
-	{
-		returnRoadMark.SetColor(mLaneRoadMark.at(index).GetColor());
-		returnRoadMark.SetLaneChange(mLaneRoadMark.at(index).GetLaneChange());
-		returnRoadMark.SetType(mLaneRoadMark.at(index).GetType());
-		returnRoadMark.SetWeight(mLaneRoadMark.at(index).GetWeight());
-		returnRoadMark.SetWidth(mLaneRoadMark.at(index).GetWidth());
-	}
-
-	return returnRoadMark;
-
-}
-
-/**
-* Destructor
-* Delete all the members of the vectors:
-* mLaneWidth, mRoadMark, mLaneMaterial, mLaneVisibility, mLaneSpeed, mLaneAccess, mLaneHeight
-*/
-Lane::~Lane()
-{
-	// DELETING LANE WIDTHS
-	mLaneWidth.clear();
-
-	// DELETING LANE ROAD MARKS
-	mLaneRoadMark.clear();
-
-	// DELETING LANE MATERIAL
-	mLaneMaterial.clear();
-
-	// DELETING LANE VISIBILITY
-	mLaneVisibility.clear();
-
-	// DELETING LANE SPEED
-	mLaneSpeed.clear();
-
-	// DELETING LANE ACCESS
-	mLaneAccess.clear();
-
-	// DELETING LANE HEIGHTS
-	mLaneHeight.clear();
-
-    //DELETE LANE BORDERS
-    mLaneBorder.clear();
-}
-
-
-/**
- * @brief LaneWidth::LaneWidth
- * @param s
- * @param a
- * @param b
- * @param c
- * @param d
- */
-LaneBorder::LaneBorder(double s, double a, double b, double c, double d):ThirdOrderPolynom(s,a,b,c,d)
-{}
-
-/**
-* Lane width class. Holds all the data that describes a lane width
-*
-*
-*
-*
-*
-*/
-
-/**
-* Constructor
-* @param s s-offset of the record starting from the lane section s-offset
-* @ param a,b,c,d The 4 parameters of the polynomial
-*/
-LaneWidth::LaneWidth(double s, double a, double b, double c, double d):ThirdOrderPolynom (s,a,b,c,d)
-{}
-
-/**
-* Road mark class. Holds all the data that describes a road mark
-*
-*
-*
-*
-*
-*/
-
-/*
-* Constructors
-*/
-LaneRoadMark::LaneRoadMark()
-{	mSOffset=0, mType="none"; mWeight="standard"; mColor="standard"; mWidth=0.75; mLaneChange="both"; 	}
-//-------------
-LaneRoadMark::LaneRoadMark(double sOffset, string type, string weight, string color, double width, string laneChange)
-{	mSOffset=sOffset; mType=type; mWeight=weight; mColor=color; mWidth=width; mLaneChange=laneChange;	
-}
-//-------------
-LaneRoadMark::LaneRoadMark(double sOffset, string type, string weight, string color, double width)
-{	mSOffset=sOffset; mType=type; mWeight=weight; mColor=color; mWidth=width; mLaneChange="both"; }
-
-/*
-* Methods that set the parameters of the road mark
-*/
-void LaneRoadMark::SetS(double value)
-{	mSOffset = value;	}
-void LaneRoadMark::SetType(string type)
-{	mType=type;	}
-void LaneRoadMark::SetWeight(string weight)
-{	mWeight=weight;	}
-void LaneRoadMark::SetColor(string color)
-{	mColor=color;	}
-void LaneRoadMark::SetWidth(double value)
-{	mWidth=value;	}
-void LaneRoadMark::SetLaneChange(string laneChange)
-{	mLaneChange=laneChange;	}
-
-
-/*
-* Methods that return the parameters of the road mark
-*/
-double LaneRoadMark::GetS()
-{	return mSOffset;	}
-string LaneRoadMark::GetType()
-{	return mType;	}
-string LaneRoadMark::GetWeight()
-{	return mWeight;	}
-string LaneRoadMark::GetColor()
-{	return mColor;	}
-double LaneRoadMark::GetWidth()
-{	return mWidth;	}
-string LaneRoadMark::GetLaneChange()
-{	return mLaneChange;	}
-
-/**
-* Lane material class. Contains all the data that describes a lane material
-*
-*
-*
-*
-*
-*/
-
-/*
-* Constructor
-*/
-LaneMaterial::LaneMaterial (double sOffset, string surface, double friction, double roughness)
-{	mSOffset=sOffset; mSurface=surface; mFriction=friction; mRoughness=roughness;	}
-
-/*
-* Methods that return the parameters of the lane material
-*/
-double LaneMaterial::GetS()
-{	return mSOffset;	}
-string LaneMaterial::GetSurface()
-{	return mSurface;	}
-double LaneMaterial::GetFriction()
-{	return mFriction;	}
-double LaneMaterial::GetRoughness()
-{	return mRoughness;	}
-
-/*
-* Methods that set the parameters of the lane material
-*/
-void LaneMaterial::SetS(double value)
-{	mSOffset=value;	}
-void LaneMaterial::SetSurface(string surface)
-{	mSurface=surface;	}
-void LaneMaterial::SetFriction(double value)
-{	mFriction=value;	}
-void LaneMaterial::SetRoughness(double value)
-{	mRoughness=value;	}
-
-
-/**
-* Lane visibility class. Contains all the data that describes lane visibility record
-*
-*
-*
-*
-*
-*/
-
-/*
-* Constructor
-*/
-LaneVisibility::LaneVisibility(double sOffset, double forward, double back, double left, double right)
-{	mSOffset=sOffset; mForward=forward; mBack=back; mLeft=left; mRight=right;	}
-
-/*
-* Methods that return the parameters of the lane visibility
-*/
-double LaneVisibility::GetS()
-{	return mSOffset;	}
-double LaneVisibility::GetForward()
-{	return mForward;	}
-double LaneVisibility::GetBack()
-{	return mBack;	}
-double LaneVisibility::GetLeft()
-{	return mLeft;	}
-double LaneVisibility::GetRight()
-{	return mRight;	}
-
-/*
-* Methods that set the parameters of the lane visibility
-*/
-void LaneVisibility::SetS(double value)
-{	mSOffset=value;	}
-void LaneVisibility::SetForward(double value)
-{	mForward=value;	}
-void LaneVisibility::SetBack(double value)
-{	mBack=value;	}
-void LaneVisibility::SetLeft(double value)
-{	mLeft=value;	}
-void LaneVisibility::SetRight(double value)
-{	mRight=value;	}
-
-
-/**
-* Lane speed class. Contains all the data that describes lane speed record
-*
-*
-*
-*
-*
-*/
-
-/*
-* Constructor
-*/
-LaneSpeed::LaneSpeed (double sOffset, double max)
-{	mSOffset=sOffset; mMax=max;}
-
-/*
-* Methods that return the parameters of the lane speed
-*/
-double LaneSpeed::GetS()
-{	return mSOffset;	}
-double LaneSpeed::GetMax()
-{	return mMax;	}
-
-/*
-* Methods that set the parameters of the lane speed
-*/
-void LaneSpeed::SetS(double value)
-{	mSOffset=value;	}
-void LaneSpeed::SetMax(double value)
-{	mMax=value;	}
-
-
-/**
-* Lane access class. Contains all the data that describes lane access record
-*
-*
-*
-*
-*
-*/
-/*
-* Constructor
-*/
-LaneAccess::LaneAccess (double sOffset, string restriction)
-{	mSOffset=sOffset; mRestriction = restriction;	}
-
-/*
-* Methods that return the parameters of the lane access
-*/
-double LaneAccess::GetS()
-{	return mSOffset;	}
-string LaneAccess::GetRestriction()
-{	return mRestriction;	}
-
-/*
-* Methods that set the parameters of the lane access
-*/
-void LaneAccess::SetS(double value)
-{	mSOffset=value;	}
-void LaneAccess::SetRestriction(string restriction)
-{	mRestriction=restriction;	}
-
-/**
-* Lane height class. Contains all the data that describes lane access record
-*
-*
-*
-*
-*
-*/
-/*
-* Constructors
-*/
-LaneHeight::LaneHeight()
-{mSOffset=0; mInner=0; mOuter=0;}
-LaneHeight::LaneHeight (double sOffset, double inner, double outer)
-{	mSOffset=sOffset; mInner=inner; mOuter=outer;	}
-
-/*
-* Methods that return the parameters of the lane height
-*/
-double LaneHeight::GetS()
-{	return mSOffset;	}
-double LaneHeight::GetInner()
-{	return mInner;	}
-double LaneHeight::GetOuter()
-{	return mOuter;	}
-
-/*
-* Methods that set the parameters of the lane height
-*/
-void LaneHeight::SetS(double value)
-{	mSOffset=value;	}
-void LaneHeight::SetInner(double value)
-{	mInner=value;	}
-void LaneHeight::SetOuter(double value)
-{	mOuter=value;	}
-
-/**
-* Lane offset class. Contains all the data that describes lane offset record
-*
-*
-*
-*
-*
-*/
-
-/*
-* Constructors
-*/
-LaneOffset::LaneOffset()
-{    ms = 0; ma=0; mb=0; mc=0; md=0;}
-
-LaneOffset::LaneOffset(double sOffset, double a, double b, double c, double d)
-{   ms = sOffset; ma = a; mb = b; mc = c; md = d;}
-
-/*
-* Methods that return the parameters of the lane height
-*/
-double LaneOffset::GetS()
-{   return ms;}
-double LaneOffset::Geta()
-{   return ma;}
-double LaneOffset::Getb()
-{   return mb;}
-double LaneOffset::Getc()
-{   return mc;}
-double LaneOffset::Getd()
-{   return md;}
-
-/**
-* Check if the tested s-offset is inside the lane offset interval
-* @param A double s-offset value that has to be checked
-* @return Return true if the s-offset value belongs to current lane section, false otherwise
-*/
-bool LaneOffset::CheckInterval(double s_check)
-{
-    if (s_check>=ms)
-        return true;
-    else
-        return false;
-}
-
-/*
-* Methods that set the parameters of the lane offset
-*/
-void LaneOffset::SetS(double value)
-{   ms = value;}
-void LaneOffset::Seta(double value)
-{   ma = value;}
-void LaneOffset::Setb(double value)
-{   mb = value;}
-void LaneOffset::Setc(double value)
-{   mc = value;}
-void LaneOffset::Setd(double value)
-{   md = value;}

+ 0 - 853
src/tool/map_lanetoxodr/OpenDrive/Lane.h

@@ -1,853 +0,0 @@
-#ifndef LANE_H
-#define LANE_H
-
-#include "Road.h"
-#include "OtherStructures.h"
-#include <vector>
-#include <string>
-
-
-//Prototypes
-class LaneSection;
-class LaneSectionSample;
-class Lane;
-class LaneWidth;
-class LaneRoadMark;
-class LaneMaterial;
-class LaneVisibility;
-class LaneSpeed;
-class LaneAccess;
-class LaneHeight;
-class LaneBorder;
-
-using std::vector;
-using std::string;
-
-/**
-* Lane section class. Holds all the lane section information
-*
-*
-*
-*
-*/
-class LaneSection
-{
-private:
-	/**
-	* Record parameters
-	*/
-	double mS;
-    string msingleSide;
-	vector<Lane> mLaneVector;
-
-	unsigned int mLastAddedLane;
-
-public:
-	/**
-	* Constructor. Sets basic lane section parameters
-	* @param s s-offset of the lane section
-	*/
-	LaneSection (double s);
-
-	/**
-	* Add a lane to the lane section
-	* @param side the side of the road to which the lane will be added
-	* @param id ID of the lane
-	* @param type Type of the lane (Section 6.5 of the OpenDRIVE specification) 
-	* @param level Level parameter of the road
-	* @param sort Defines if the lanes should be sorted when added. True by default
-	*/
-	unsigned int AddLane(short int side, int id, string type, bool level, bool sort=true);
-
-
-	/**
-	* Delete the lane at the provided index
-	*/
-	void DeleteLane(unsigned int index);
-
-	/**
-	* Delete the outside left or right lane 
-	*/
-	void DeleteLeftLane();
-	void DeleteRigthLane();
-
-	/**
-	* Get the last lane
-	* @return A pointer to Lane object
-	*/
-	Lane* GetLastLane();
-
-	/**
-	* Get the last added lane (which might not be the one from the end of the vector)
-	* @return A pointer to Lane object
-	*/
-	Lane* GetLastAddedLane();
-
-	/**
-	* Get the last left lane
-	* @return A pointer to Lane object
-	*/
-	Lane* GetLastLeftLane();
-
-	/**
-	* Get the last right lane
-	* @return A pointer to Lane object
-	*/
-	Lane* GetLastRightLane();
-
-	/**
-	* Get the last center lane
-	* @return A pointer to Lane object
-	*/
-	Lane* GetLastCenterLane();
-
-	/**
-	* Get the lane by providing its index
-	* @param i Index of the lane to be returned
-	* @return A pointer to Lane object
-	*/
-	Lane* GetLane(unsigned int i);
-
-	/**
-	* Get the lane number
-	* @return Unsigned int with that stores the number of lanes
-	*/
-	unsigned int GetLaneCount();
-
-	/**
-	* Get the lane vector
-	* @return A pointer to a vector of type Lane
-	*/
-	vector<Lane>* GetLaneVector();
-
-	/**
-	* Get the lane section s-offset
-	*/
-	double GetS();
-
-	/**
-	* Get the lane section final s-offset which is the s-offset of the last record of the lane section
-	*/
-	double GetS2();
-
-	/**
-	* Set the lane section s-offset
-	*/
-	void SetS(double value);
-
-
-	/**
-	* Check if the tested s-offset is inside the lane section interval
-	* @param A double s-offset value that has to be checked
-	* @return Return true if the s-offset value belongs to current lane section, false otherwise
-	*/
-	bool CheckInterval(double s_check);
-
-	/**
-	* Return the lane-0 index in the lanes vector
-	* @return An unsigned int value with the index
-	*/
-	unsigned int GetZeroLaneIndex();
-
-	/**
-	* Return the number of left lanes
-	* @return An unsigned int value with the number of left lanes
-	*/
-	unsigned int GetLeftLaneCount();
-
-	/**
-	* Return the number of central lanes
-	* @return An unsigned int value with the number of central lanes
-	*/
-	unsigned int GetCenterLaneCount();
-
-	/**
-	* Return the number of right lanes
-	* @return An unsigned int value with the number of right lanes
-	*/
-	unsigned int GetRightLaneCount();
-
-	/**
-	* Fill a special structure with all the lane / lane section data that is sampled at a provided s-offset position along the road
-	* @param s_chek s-offset along the road at which to sample the lane section
-	* @param laneSectionSample The structure that has to be filled with the sampled data
-	* @return Returns true if the operation was successful. 
-	*/
-	bool FillLaneSectionSample(double s_check, LaneSectionSample& laneSectionSample);
-
-	/**
-	* Destructor. Delete all the members of the vectors: mLeft, mCenter, mRight
-	*/
-	~LaneSection();
-
-    void SetSingleSide(string singleSide);
-    string GetSingleSide();
-};
-
-
-/**
-* Lane Section Sample. Holds all the lane information at a certain S value including lane widths, levels, 
-* heights, etc
-*
-*
-*
-*
-*/ 
-class LaneSectionSample
-{
-private:
-	/*
-	*	All the vectors for the data that is sampled. For ease of use the structure is divided into left and right lane groups.
-	*
-	*/
-	vector<string> mLeftTypeVector;
-	vector<double> mLeftWidthVector;
-	vector<LaneHeight> mLeftHeightVector;
-	vector<LaneRoadMark> mLeftRoadMarkVector;
-	vector<bool> mLeftLevelVector;
-
-	vector<string> mRightTypeVector;
-	vector<double> mRightWidthVector;
-	vector<LaneHeight> mRightHeightVector;
-	vector<LaneRoadMark> mRightRoadMarkVector;
-	vector<bool> mRightLevelVector;
-public:
-	LaneSectionSample();
-
-	/*
-	* Add various elements to the structure. Depending on the the value to be added, various input parameters are used.
-	* The methods are divided into left and right for left and right sides of the road.
-	*/
-	void AddLeftType(string type);
-	void AddLeftWidth(double width);
-	void AddLeftHeight(LaneHeight height);
-	void AddLeftRoadMark(LaneRoadMark roadMark);
-	void AddLeftLevel(bool level);
-
-	void AddRightType(string type);
-	void AddRightWidth(double width);
-	void AddRightHeight(LaneHeight height);
-	void AddRightRoadMark(LaneRoadMark roadMark);
-	void AddRightLevel(bool level);
-
-	void AddLeftRecord(string type, double width, LaneHeight height, LaneRoadMark roadMark, bool level);
-	void AddRightRecord(string type, double width, LaneHeight height, LaneRoadMark roadMark, bool level);
-
-	/*
-	* Get various elements of the structure. The methods return type depends on the elements that are returned.
-	* The methods are divided into left and right for left and right sides of the road.
-	*/
-	string GetLeftType(unsigned int i);
-	double GetLeftWidth(unsigned int i);
-	LaneHeight GetLeftHeight(unsigned int i);
-	LaneRoadMark GetLeftRoadMark(unsigned int i);
-	bool GetLeftLevel(unsigned int i);
-
-	string GetRightType(unsigned int i);
-	double GetRightWidth(unsigned int i);
-	LaneHeight GetRightHeight(unsigned int i);
-	LaneRoadMark GetRightRoadMark(unsigned int i);
-	bool GetRightLevel(unsigned int i);
-
-	/*
-	* Get the number of elements in the vectors
-	*/
-	unsigned int GetLeftVectorsSize();
-	unsigned int GetRightVectorsSize();
-
-	/*
-	* Get the various record vectors. The vector type depends on the record
-	* The methods are divided into left and right for left and right sides of the road.
-	*/
-	vector<string>* GetLeftTypeVector();
-	vector<double>* GetLeftWidthVector();
-	vector<LaneHeight>* GetLeftHeigthVector();
-	vector<LaneRoadMark>* GetLeftRoadMarkVector();
-	vector<bool>* GetLeftLevelVector();
-
-	vector<string>* GetRightTypeVector();
-	vector<double>* GetRightWidthVector();
-	vector<LaneHeight>* GetRightHeigthVector();
-	vector<LaneRoadMark>* GetRightRoadMarkVector();
-	vector<bool>* GetRightLevelVector();
-
-
-	/*
-	* Clear the vectors
-	*/
-	void ClearVectors();
-
-};
-
-
-
-/**
-* Lane class. Holds all the record data that describes a lane
-*
-*
-*
-*
-*
-*/
-class Lane
-{
-private:
-	/**
-	*	Record parameters
-	*/
-	short int mSide; //0 = center, -1 = right, 1=left
-	int mId;
-	string mType; 
-	bool mLevel; //true or false(default)
-
-	//links
-	bool mPredecessorExists;
-	int mPredecessor;
-	bool mSuccessorExists;
-	int mSuccessor;
-
-	//Width
-	vector <LaneWidth> mLaneWidth;
-	//Road Mark
-	vector <LaneRoadMark> mLaneRoadMark;
-	//Lane Material
-	vector <LaneMaterial> mLaneMaterial;
-	//Lane Visibility
-	vector <LaneVisibility> mLaneVisibility;
-	//Lane Speed
-	vector <LaneSpeed> mLaneSpeed;
-	//Lane Access
-	vector<LaneAccess> mLaneAccess;
-	//Lane Height
-	vector<LaneHeight> mLaneHeight;
-    //Lane Border
-    vector<LaneBorder> mLaneBorder;
-
-
-	unsigned int mLastAddedLaneWidth;
-	unsigned int mLastAddedLaneRoadMark;
-	unsigned int mLastAddedLaneMaterial;
-	unsigned int mLastAddedLaneVisibility;
-	unsigned int mLastAddedLaneSpeed;
-	unsigned int mLastAddedLaneAccess;
-	unsigned int mLastAddedLaneHeight;
-    unsigned int mLastAddedLaneBorder;
-
-    string muserData;
-
-public:
-	/**
-	*	Constructor
-	*/
-	Lane(short int side, int id, string type, bool level);
-	/**
-	*	Operator less, Used to sort the lanes
-	*/
-	bool operator<(Lane rhs)const { return (mId < rhs.mId); }
-
-
-	/**
-	*	Various set methods.
-	*/
-	void SetSide(short int side);
-	void SetId(int id);
-	void SetType(string type);
-	void SetLevel(bool level);
-	void SetPredecessor(int predecessor);
-	void SetSuccessor(int successor);
-
-	/**
-	*	Remove lane linkage methods.
-	*/
-	void RemovePredecessor();
-	void RemoveSuccessor();
-
-	/**
-	 * Methods used to add child records to the respective vectors
-	 */
-	unsigned int AddWidthRecord(double s, double a, double b, double c, double d);
-	unsigned int AddRoadMarkRecord(double sOffset, string type, string weight, string color, double width, string laneChange);
-	unsigned int AddMaterialRecord(double sOffset, string surface, double friction, double roughness);
-	unsigned int AddVisibilityRecord(double sOffset, double forward, double back, double left, double right);
-	unsigned int AddSpeedRecord(double sOffset, double max);
-	unsigned int AddAccessRecord(double sOffset, string restriction);
-	unsigned int AddHeightRecord(double sOffset, double inner, double outer);
-    unsigned int AddBorderRecord(double s, double a, double b, double c, double d);
-
-	/**
-	 * Methods used to clone child records in the respective vectors
-	 */
-	unsigned int CloneLaneWidth(unsigned int index);
-	unsigned int CloneLaneRoadMark(unsigned int index);
-	unsigned int CloneLaneMaterial(unsigned int index);
-	unsigned int CloneLaneVisibility(unsigned int index);
-	unsigned int CloneLaneSpeed(unsigned int index);
-	unsigned int CloneLaneAccess(unsigned int index);
-	unsigned int CloneLaneHeight(unsigned int index);
-    unsigned int CloneLaneBorder(unsigned int index);
-
-	/**
-	 * Methods used to delete child records from the respective vectors
-	 */
-	void DeleteLaneWidth(unsigned int index);
-	void DeleteLaneRoadMark(unsigned int index);
-	void DeleteLaneMaterial(unsigned int index);
-	void DeleteLaneVisibility(unsigned int index);
-	void DeleteLaneSpeed(unsigned int index);
-	void DeleteLaneAccess(unsigned int index);
-	void DeleteLaneHeight(unsigned int index);
-    void DeleteLaneBoder(unsigned int index);
-
-
-	/**
-	*	Getters of the lane parameters
-	*/
-	int GetSide();
-	int GetId();
-	string GetType();
-	bool GetLevel();
-
-	/**
-	*	Check if linkage information is provided
-	*/
-	bool IsPredecessorSet();
-	int GetPredecessor();
-	bool IsSuccessorSet();
-	int GetSuccessor();
-
-	/**
-	*	Get pointers to the records vectors
-	*/
-	vector <LaneWidth> *GetLaneWidthVector();
-	vector <LaneRoadMark> *GetLaneRoadMarkVector();
-	vector <LaneMaterial> *GetLaneMaterialVector();
-	vector <LaneVisibility> *GetLaneVisibilityVector();
-	vector <LaneSpeed> *GetLaneSpeedVector();
-	vector <LaneAccess> *GetLaneAccessVector();
-	vector <LaneHeight> *GetLaneHeightVector();
-    vector <LaneBorder> *GetLaneBorderVector();
-
-
-	/**
-	*	Get the number of elements in a certain vector
-	*/
-	unsigned int GetLaneWidthCount();
-	unsigned int GetLaneRoadMarkCount();
-	unsigned int GetLaneMaterialCount();
-	unsigned int GetLaneVisibilityCount();
-	unsigned int GetLaneSpeedCount();
-	unsigned int GetLaneAccessCount();
-	unsigned int GetLaneHeightCount();
-    unsigned int GetLaneBorderCount();
-
-
-	/**
-	*	Get the elements of a certain vectors at position i
-	*/
-	LaneWidth* GetLaneWidth(unsigned int i); 
-	LaneRoadMark* GetLaneRoadMark(unsigned int i);
-	LaneMaterial* GetLaneMaterial(unsigned int i);
-	LaneVisibility* GetLaneVisibility(unsigned int i);
-	LaneSpeed* GetLaneSpeed(unsigned int i);
-	LaneAccess* GetLaneAccess(unsigned int i);
-	LaneHeight* GetLaneHeight(unsigned int i);
-    LaneBorder* GetLaneBorder(unsigned int i);
-
-
-	/**
-	*	Get the last elements of a certain vectors
-	*/
-	LaneWidth* GetLastLaneWidth(); 
-	LaneRoadMark* GetLastLaneRoadMark();
-	LaneMaterial* GetLastLaneMaterial();
-	LaneVisibility* GetLastLaneVisibility();
-	LaneSpeed* GetLastLaneSpeed();
-	LaneAccess* GetLastLaneAccess();
-	LaneHeight* GetLastLaneHeight();
-    LaneBorder* GetLastLaneBorder();
-
-	/**
-	*	Get the last added elements of a certain vectors (their position might not be at the end of the vector)
-	*/
-	LaneWidth* GetLastAddedLaneWidth(); 
-	LaneRoadMark* GetLastAddedLaneRoadMark();
-	LaneMaterial* GetLastAddedLaneMaterial();
-	LaneVisibility* GetLastAddedLaneVisibility();
-	LaneSpeed* GetLastAddedLaneSpeed();
-	LaneAccess* GetLastAddedLaneAccess();
-	LaneHeight* GetLastAddedLaneHeight();
-    LaneBorder* GetLastAddedLaneBorder();
-
-	/**
-	*	Check the intervals and return the index of the records that applies to the provided s-offset
-	*/
-	int CheckWidthInterval(double s_check);
-	int CheckRoadMarkInterval(double s_check);
-	int CheckMaterialInterval(double s_check);
-	int CheckVisibilityInterval(double s_check);
-	int CheckSpeedInterval(double s_check);
-	int CheckAccessInterval(double s_check);
-	int CheckHeightInterval(double s_check);
-    int CheckBorderInterval(double s_check);
-
-
-    void GetuserData(std::string & struserData);
-    void SetuserData(std::string struserData);
-
-
-    double GetBorderValue(double s_check);
-	/**
-	*	Evaluate the record and return the width value
-	*/
-	double GetWidthValue(double s_check);
-
-	/**
-	*	Evaluate the record and return the height object
-	*/
-	LaneHeight GetHeightValue(double s_check);
-
-	/**
-	*	Evaluate the road marks records and return the road mark object corresponding to the provided s-offset
-	*/
-	LaneRoadMark GetRoadMarkValue(double s_check);
-
-
-	/**
-	* Destructor
-	* Delete all the members of the vectors:
-	* mLaneWidth, mRoadMark, mLaneMaterial, mLaneVisibility, mLaneSpeed, mLaneAccess, mLaneHeight
-	*/
-	~Lane();
-	//--------------
-
-};
-
-
-/**
- * @brief The LaneBorder class Holds all the data of border
- */
-class LaneBorder : public ThirdOrderPolynom
-{
-public:
-    /**
-    * Constructor
-    * @param s s-offset of the record starting from the lane section s-offset
-    * @ param a,b,c,d The 4 parameters of the polynomial
-    */
-    LaneBorder(double s, double a, double b, double c, double d);
-};
-
-
-/**
-* Lane width class. Holds all the data that describes a lane width
-*
-*
-*
-*
-*
-*/
-class LaneWidth : public ThirdOrderPolynom
-{
-public:
-
-	/**
-	* Constructor
-	* @param s s-offset of the record starting from the lane section s-offset
-	* @ param a,b,c,d The 4 parameters of the polynomial
-	*/
-	LaneWidth(double s, double a, double b, double c, double d);
-
-};
-
-/**
-* Road mark class. Holds all the data that describes a road mark
-*
-*
-*
-*
-*
-*/
-class LaneRoadMark
-{
-private:
-
-	/*
-	* Parameters of the road mark
-	*/
-	double mSOffset;
-	string mType;
-	string mWeight;
-	string mColor; 
-	double mWidth;
-	string mLaneChange;
-public:
-	/*
-	* Constructors
-	*/
-	LaneRoadMark();
-	LaneRoadMark(double sOffset, string type, string weight, string color, double width, string laneChange);
-	LaneRoadMark(double sOffset, string type, string weight, string color, double width);
-
-	/*
-	* Methods that set the parameters of the road mark
-	*/
-	void SetS(double value);
-	void SetType(string type);
-	void SetWeight(string weight);
-	void SetColor(string color);
-	void SetWidth(double value);
-	void SetLaneChange(string laneChange);
-
-	/*
-	* Methods that return the parameters of the road mark
-	*/
-	double GetS();
-	string GetType();
-	string GetWeight();
-	string GetColor();
-	double GetWidth();
-	string GetLaneChange();
-
-};
-
-/**
-* Lane material class. Contains all the data that describes a lane material
-*
-*
-*
-*
-*
-*/
-class LaneMaterial
-{
-private:
-	/*
-	* Parameters that describe the lane material
-	*/
-	double mSOffset;
-	string mSurface;
-	double mFriction;
-	double mRoughness;
-public:
-
-	/*
-	* Constructor
-	*/
-	LaneMaterial (double sOffset, string surface, double friction, double roughness);
-
-	/*
-	* Methods that return the parameters of the lane material
-	*/
-	double GetS();
-	string GetSurface();
-	double GetFriction();
-	double GetRoughness();
-
-	/*
-	* Methods that set the parameters of the lane material
-	*/
-	void SetS(double value);
-	void SetSurface(string surface);
-	void SetFriction(double value);
-	void SetRoughness(double value);
-
-};
-
-/**
-* Lane visibility class. Contains all the data that describes lane visibility record
-*
-*
-*
-*
-*
-*/
-class LaneVisibility
-{
-private:
-	/*
-	* Parameters that describe the lane visibility
-	*/
-	double mSOffset;
-	double mForward;
-	double mBack;
-	double mLeft;
-	double mRight;
-public:
-	/*
-	* Constructor
-	*/
-	LaneVisibility(double sOffset, double forward, double back, double left, double right);
-
-	/*
-	* Methods that return the parameters of the lane visibility
-	*/
-	double GetS();
-	double GetForward();
-	double GetBack();
-	double GetLeft();
-	double GetRight();
-
-	/*
-	* Methods that set the parameters of the lane visibility
-	*/
-	void SetS(double value);
-	void SetForward(double value);
-	void SetBack(double value);
-	void SetLeft(double value);
-	void SetRight(double value);
-
-};
-
-/**
-* Lane speed class. Contains all the data that describes lane speed record
-*
-*
-*
-*
-*
-*/
-class LaneSpeed
-{
-private:
-	/*
-	* Parameters that describe the lane speed
-	*/
-	double mSOffset;
-	double mMax;
-public:
-	/*
-	* Constructor
-	*/
-	LaneSpeed (double sOffset, double max);
-
-	/*
-	* Methods that return the parameters of the lane speed
-	*/
-	double GetS();
-	double GetMax();
-
-	/*
-	* Methods that set the parameters of the lane speed
-	*/
-	void SetS(double value);
-	void SetMax(double value);
-};
-
-/**
-* Lane access class. Contains all the data that describes lane access record
-*
-*
-*
-*
-*
-*/
-class LaneAccess
-{
-private:
-	/*
-	* Parameters that describe the lane access
-	*/
-	double mSOffset;
-	string mRestriction;
-public:
-	/*
-	* Constructor
-	*/
-	LaneAccess (double sOffset, string restriction);
-
-	/*
-	* Methods that return the parameters of the lane access
-	*/
-	double GetS();
-	string GetRestriction();
-
-	/*
-	* Methods that set the parameters of the lane access
-	*/
-	void SetS(double value);
-	void SetRestriction(string restriction);
-};
-
-/**
-* Lane height class. Contains all the data that describes lane access record
-*
-*
-*
-*
-*
-*/
-class LaneHeight
-{
-private:
-	/*
-	* Parameters that describe the lane height
-	*/
-	double mSOffset;
-	double mInner;
-	double mOuter;
-public:
-	/*
-	* Constructors
-	*/
-	LaneHeight();
-	LaneHeight (double sOffset, double inner, double outer);
-
-	/*
-	* Methods that return the parameters of the lane height
-	*/
-	double GetS();
-	double GetInner();
-	double GetOuter();
-
-	/*
-	* Methods that set the parameters of the lane height
-	*/
-	void SetS(double value);
-	void SetInner(double value);
-	void SetOuter(double value);
-};
-
-//----------------------------------------------------------------------------------
-
-
-class LaneOffset
-{
-private:
-    /*
-    * Parameters that describe the lane offeset
-    */
-    double ms;
-    double ma;
-    double mb;
-    double mc;
-    double md;
-public:
-    /*
-    * Constructors
-    */
-    LaneOffset();
-    LaneOffset (double sOffset, double a, double b,double c,double d);
-
-
-    /*
-    * Methods that return the parameters of the lane offset
-    */
-    double GetS();
-    double Geta();
-    double Getb();
-    double Getc();
-    double Getd();
-
-    bool CheckInterval(double s_check);
-
-    /*
-    * Methods that set the parameters of the lane offset
-    */
-    void SetS(double value);
-    void Seta(double value);
-    void Setb(double value);
-    void Setc(double value);
-    void Setd(double value);
-};
-
-#endif

+ 0 - 1190
src/tool/map_lanetoxodr/OpenDrive/ObjectSignal.cpp

@@ -1,1190 +0,0 @@
-#include "ObjectSignal.h"
-
-#include <iostream>
-
-
-Object_outlines_outline::Object_outlines_outline()
-{
-
-}
-
-Object_outlines::Object_outlines()
-{
-
-}
-
-Object_material::Object_material()
-{
-
-}
-
-int Object_material::Getsurface(string & surface)
-{
-    if(msurface.size()<1)return 0;
-    surface = msurface[0];
-    return 1;
-}
-
-int Object_material::Getfriction(double & friction)
-{
-    if(mfriction.size()<1)return 0;
-    friction = mfriction[0];
-    return 1;
-}
-
-int Object_material::Getroughness(double & roughness)
-{
-    if(mroughness.size()<1)return 0;
-    roughness = mroughness[0];
-    return 1;
-}
-
-void Object_material::Setsurface(string surface)
-{
-    if(msurface.size()>0)msurface.clear();
-    msurface.push_back(surface);
-}
-
-void Object_material::Setfriction(double friction)
-{
-    if(mfriction.size()>0)mfriction.clear();
-    mfriction.push_back(friction);
-}
-
-void Object_material::Setroughness(double roughness)
-{
-    if(mroughness.size()>0)mroughness.clear();
-    mroughness.push_back(roughness);
-}
-
-Object_repeat::Object_repeat(double s,double length,double distance,double tStart,double tEnd,double heightStart,
-              double heightEnd,double zOffsetStart,double zOffsetEnd)
-{
-    ms = s;
-    mlength = length;
-    mdistance = distance;
-    mtStart = tStart;
-    mtEnd = tEnd;
-    mheightStart = heightStart;
-    mheightEnd = heightEnd;
-    mzOffsetStart = zOffsetStart;
-    mzOffsetEnd = zOffsetEnd;
-}
-
-double Object_repeat::Gets()
-{
-    return ms;
-}
-
-double Object_repeat::Getlength()
-{
-    return mlength;
-}
-
-double Object_repeat::Getdistance()
-{
-    return mdistance;
-}
-
-double Object_repeat::GettStart()
-{
-    return mtStart;
-}
-
-double Object_repeat::GettEnd()
-{
-    return mtEnd;
-}
-
-double Object_repeat::GetheightStart()
-{
-    return mheightStart;
-}
-
-double Object_repeat::GetheightEnd()
-{
-    return mheightEnd;
-}
-
-double Object_repeat::GetzOffsetStart()
-{
-    return mzOffsetStart;
-}
-
-double Object_repeat::GetzOffsetEnd()
-{
-    return mzOffsetEnd;
-}
-
-
-void Object_repeat::Sets(double s)
-{
-    ms = s;
-}
-
-void Object_repeat::Setlength(double length)
-{
-    mlength = length;
-}
-
-void Object_repeat::Setdistance(double distance)
-{
-    mdistance = distance;
-}
-
-void Object_repeat::SettStart(double tStart)
-{
-    mtStart = tStart;
-}
-
-void Object_repeat::SettEnd(double tEnd)
-{
-    mtEnd = tEnd;
-}
-
-void Object_repeat::SetheightStart(double heightStart)
-{
-    mheightStart = heightStart;
-}
-
-void Object_repeat::SetheightEnd(double heightEnd)
-{
-    mheightEnd = heightEnd;
-}
-
-void Object_repeat::SetzOffsetStart(double zOffsetStart)
-{
-    mzOffsetStart = zOffsetStart;
-}
-
-void Object_repeat::SetzOffsetEnd(double zOffsetEnd)
-{
-    mzOffsetEnd = zOffsetEnd;
-}
-
-
-int Object_repeat::GetwidthStart(double & widthStart)
-{
-    if(mwidthStart.size() <1)return 0;
-    widthStart = mwidthStart[0];
-    return 1;
-}
-
-int Object_repeat::GetwidthEnd(double & widthEnd)
-{
-    if(mwidthEnd.size() < 1)return 0;
-    widthEnd = mwidthEnd[0];
-    return 1;
-}
-
-int Object_repeat::GetlengthStart(double & lengthStart)
-{
-    if(mlengthStart.size() < 1)return 0;
-    lengthStart = mlengthStart[0];
-    return 1;
-}
-
-int Object_repeat::GetlengthEnd(double & lengthEnd)
-{
-    if(mlengthEnd.size() < 1)return 0;
-    lengthEnd = mlengthEnd[0];
-    return 1;
-}
-
-int Object_repeat::GetradiusStart(double & radiusStart)
-{
-    if(mradiusStart.size() < 1)return 0;
-    radiusStart = mradiusStart[0];
-    return 1;
-}
-
-int Object_repeat::GetradiusEnd(double & radiusEnd)
-{
-    if(mradiusEnd.size() < 1)return 0;
-    radiusEnd = mradiusEnd[0];
-    return 1;
-}
-
-void Object_repeat::DeletewidthStart()
-{
-    if(mwidthStart.size() > 0)mwidthStart.clear();
-}
-
-void Object_repeat::DeletewidthEnd()
-{
-    if(mwidthEnd.size() > 0)mwidthEnd.clear();
-}
-
-void Object_repeat::DeletelengthStart()
-{
-    if(mlengthStart.size() > 0)mlengthStart.clear();
-}
-
-void Object_repeat::DeletelengthEnd()
-{
-    if(mlengthEnd.size() > 0)mlengthEnd.clear();
-}
-
-void Object_repeat::DeleteradiusStart()
-{
-    if(mradiusStart.size() > 0)mradiusStart.clear();
-}
-
-void Object_repeat::DeleteradiusEnd()
-{
-    if(mradiusEnd.size() > 0)mradiusEnd.clear();
-}
-
-void Object_repeat::SetwidthStart(double  widthStart)
-{
-    if(mwidthStart.size() > 0)mwidthStart.clear();
-    mwidthStart.push_back(widthStart);
-}
-
-void Object_repeat::SetwidthEnd(double  widthEnd)
-{
-    if(mwidthEnd.size() > 0)mwidthEnd.clear();
-    mwidthEnd.push_back(widthEnd);
-}
-
-void Object_repeat::SetlengthStart(double  lengthStart)
-{
-    if(mlengthStart.size() > 0)mlengthStart.clear();
-    mlengthStart.push_back(lengthStart);
-}
-
-void Object_repeat::SetlengthEnd(double  lengthEnd)
-{
-    if(mlengthEnd.size() > 0)mlengthEnd.clear();
-    mlengthEnd.push_back(lengthEnd);
-}
-
-void Object_repeat::SetradiusStart(double  radiusStart)
-{
-    if(mradiusStart.size() > 0)mradiusStart.clear();
-    mradiusStart.push_back(radiusStart);
-}
-
-void Object_repeat::SetradiusEnd(double  radiusEnd)
-{
-    if(mradiusEnd.size() > 0)mradiusEnd.clear();
-    mradiusEnd.push_back(radiusEnd);
-}
-
-/**
-* Check if the tested s-offset is inside the lane offset interval
-* @param A double s-offset value that has to be checked
-* @return Return true if the s-offset value belongs to current lane section, false otherwise
-*/
-bool Object_repeat::CheckInterval(double s_check)
-{
-    if (s_check>=ms)
-        return true;
-    else
-        return false;
-}
-
-Object_parkingSpace::Object_parkingSpace()
-{
-    maccess = "all";
-}
-
-void Object_parkingSpace::Setaccess(std::string access)
-{
-    maccess = access;
-}
-
-void Object_parkingSpace::Setrestrictions(std::string restrictions)
-{
-    mrestrictions = restrictions;
-}
-
-string Object_parkingSpace::Getaccess()
-{
-    return maccess;
-}
-
-string Object_parkingSpace::Getrestrictions()
-{
-    return mrestrictions;
-}
-
-/**
- * Copy constructor
- */
-Object_parkingSpace::Object_parkingSpace (const Object_parkingSpace& parkingSpace)
-{
-    if(this != &parkingSpace)
-    {
-        mrestrictions = parkingSpace.mrestrictions;
-        maccess = parkingSpace.maccess;
-    }
-}
-
-/**
- * Assignment operator overload
- */
-const Object_parkingSpace& Object_parkingSpace::operator=(const Object_parkingSpace& rhs)
-{
-    if (this!= &rhs)
-    {
-        mrestrictions = rhs.mrestrictions;
-        maccess = rhs.maccess;
-    }
-}
-
-Object::Object(std::string id, double s, double t, double zOffset)
-{
-    mid = id;
-    ms = s;
-    mt = t;
-    mzOffset = zOffset;
-}
-
-double Object::Gett()
-{
-    return mt;
-}
-
-double Object::GetzOffset()
-{
-    return mzOffset;
-}
-
-string Object::Gettype()
-{
-    return mtype;
-}
-
-int Object::GetvalidLength(double &validLength)
-{
-    if(mvalidLength.size()<1)return 0;
-    validLength = mvalidLength[0];
-    return 1;
-}
-
-string Object::Getorientation()
-{
-    return morientation;
-}
-
-string Object::Getsubtype()
-{
-    return msubtype;
-}
-
-string Object::Getdynamic()
-{
-    return mdynamic;
-}
-
-int Object::Gethdg(double &hdg)
-{
-    if(mhdg.size()<1)return 0;
-    hdg = mhdg[0];
-    return 1;
-}
-
-string Object::Getname()
-{
-    return mname;
-}
-
-int Object::Getpitch(double &pitch)
-{
-    if(mpitch.size()<1)return 0;
-    pitch = mpitch[0];
-    return 1;
-}
-
-string Object::Getid()
-{
-    return mid;
-}
-
-int Object::Getroll(double &roll)
-{
-    if(mroll.size()<1)return 0;
-    roll = mroll[0];
-    return 1;
-}
-
-int Object::Getheight(double &height)
-{
-    if(mheight.size()<1)return 0;
-    height = mheight[0];
-    return 1;
-}
-
-double Object::Gets()
-{
-    return ms;
-}
-
-int Object::Getlength(double &length)
-{
-    if(mlength.size()<1)return 0;
-    length = mlength[0];
-    return 1;
-}
-
-int Object::Getwidth(double &width)
-{
-    if(mwidth.size()<1)return 0;
-    width = mwidth[0];
-    return 1;
-}
-
-int Object::Getradius(double &radius)
-{
-    if(mradius.size()<1)return 0;
-    radius = mradius[0];
-    return 1;
-}
-
-int Object::GetparkingSpace(Object_parkingSpace &parkingSpace)
-{
-    if(mObject_parkingSpace.size()<1)return 0;
-    parkingSpace = mObject_parkingSpace[0];
-    return 1;
-}
-
-void Object::Sett(double t)
-{
-    mt = t;
-}
-
-void Object::SetzOffset(double zOffset)
-{
-    mzOffset = zOffset;
-}
-void Object::Settype(string type)
-{
-    mtype = type;
-}
-
-void Object::SetvalidLength(double  validLength)
-{
-    if(mvalidLength.size() > 0)mvalidLength.clear();
-    mvalidLength.push_back(validLength);
-}
-
-void Object::Setorientation(string orientation)
-{
-    morientation = orientation;
-}
-
-void Object::Setsubtype(string subtype)
-{
-    msubtype = subtype;
-}
-
-void Object::Setdynamic(string dynamic)
-{
-    mdynamic = dynamic;
-}
-
-void Object::Sethdg(double  hdg)
-{
-    if(mhdg.size()>0)mhdg.clear();
-    mhdg.push_back(hdg);
-}
-
-void Object::Setname(string name)
-{
-    mname = name;
-}
-
-void Object::Setpitch(double pitch)
-{
-    if(mpitch.size()>0)mpitch.clear();
-    mpitch.push_back(pitch);
-}
-
-void Object::Setid(string id)
-{
-    mid = id;
-}
-
-void Object::Setroll(double  roll)
-{
-    if(mroll.size()>0)mroll.clear();
-    mroll.push_back(roll);
-}
-
-void Object::Setheight(double height)
-{
-    if(mheight.size()>0)mheight.clear();
-    mheight.push_back(height);
-}
-
-void Object::Sets(double s)
-{
-    ms = s;
-}
-
-void Object::Setlength(double length)
-{
-    if(mlength.size()>0)mlength.clear();
-    mlength.push_back(length);
-}
-
-void Object::Setwidth(double width)
-{
-    if(mwidth.size()>0)mwidth.clear();
-    mwidth.push_back(width);
-}
-
-void Object::Setradius(double radius)
-{
-    if(mradius.size()>0)mradius.clear();
-    mradius.push_back(radius);
-}
-
-void Object::SetparkingSpace(Object_parkingSpace parkingSpace)
-{
-    if(mObject_parkingSpace.size()>0)mObject_parkingSpace.clear();
-    mObject_parkingSpace.push_back(parkingSpace);
-}
-
-vector<Object_repeat> * Object::GetObjectrepeatVector()
-{
-    return &mObject_repeat;
-}
-
-Object_repeat* Object::GetObjectrepeat(unsigned int i)
-{
-    if ((mObject_repeat.size()>0)&&(i<(mObject_repeat.size())))
-        return &(mObject_repeat.at(i));
-    else
-        return NULL;
-}
-
-unsigned int Object::GetObjectrepeatCount()
-{
-    return mObject_repeat.size();
-}
-
-Object_repeat*			Object::GetLastObjectrepeat()
-{
-    if (mObject_repeat.size()>0)
-        return &mObject_repeat.at(mObject_repeat.size()-1);
-    else
-        return NULL;
-}
-
-Object_repeat*			Object::GetLastAddedObjectrepeat()
-{
-    if(mLastAddedObjectrepeat<mObject_repeat.size())
-        return &mObject_repeat.at(mLastAddedObjectrepeat);
-    else
-        return NULL;
-}
-
-unsigned int Object::AddObjectrepeat(double s,double length,double distance,double tStart,double tEnd,
-                             double heightStart,double heightEnd,double zOffsetStart,double zOffsetEnd)
-{
-    unsigned int index = CheckObjectrepeatInterval(s)+1;
-    if(index>=GetObjectrepeatCount()) mObject_repeat.push_back(Object_repeat(s,length,distance,tStart,tEnd,heightStart,heightEnd,zOffsetStart,zOffsetEnd));
-    else mObject_repeat.insert(mObject_repeat.begin()+index, Object_repeat(s,length,distance,tStart,tEnd,heightStart,heightEnd,zOffsetStart,zOffsetEnd));
-    mLastAddedObjectrepeat=index;
-    return index;
-}
-
-unsigned int Object::CloneObjectrepeat(unsigned int index)
-{
-    if(index<(mObject_repeat.size()-1))
-        mObject_repeat.insert(mObject_repeat.begin()+index+1, mObject_repeat[index]);
-    else if(index==mObject_repeat.size()-1)
-        mObject_repeat.push_back(mObject_repeat[index]);
-    mLastAddedObjectrepeat=index+1;
-    return mLastAddedObjectrepeat;
-}
-
-void Object::DeleteObjectrepeat(unsigned int index)
-{
-    mObject_repeat.erase(mObject_repeat.begin()+index);
-}
-
-int Object::CheckObjectrepeatInterval(double s_check)
-{
-    int res=-1;
-    //Go through all the lane section records
-    for (unsigned int i=0;i<mObject_repeat.size();i++)
-    {
-        //check if the s_check belongs to the current record
-        if (mObject_repeat.at(i).CheckInterval(s_check))
-            res=i;	//assign it to the result id
-        else
-            break;	//if not, break;
-    }
-    return res;		//return the result: 0 to MaxInt as the index to the record containing s_check or -1 if nothing found
-
-}
-
-vector<Object_material> * Object::GetObjectmaterialVector()
-{
-    return &mObject_material;
-}
-
-Object_material* Object::GetObjectmaterial(unsigned int i)
-{
-    if ((mObject_material.size()>0)&&(i<(mObject_material.size())))
-        return &(mObject_material.at(i));
-    else
-        return NULL;
-}
-unsigned int Object::GetObjectmaterialCount()
-{
-    return mObject_material.size();
-}
-
-Object_material*			Object::GetLastObjectmaterial()
-{
-    if (mObject_material.size()>0)
-        return &mObject_material.at(mObject_material.size()-1);
-    else
-        return NULL;
-}
-
-Object_material*			Object::GetLastAddedObjectmaterial()
-{
-    if(mLastAddedObjectmaterial<mObject_material.size())
-        return &mObject_material.at(mLastAddedObjectmaterial);
-    else
-        return NULL;
-}
-
-unsigned int Object::AddObjectmaterial()
-{
-    mObject_material.push_back(Object_material());
-    mLastAddedObjectmaterial = mObject_material.size()-1;
-    return mLastAddedObjectmaterial;
-}
-
-unsigned int Object::CloneObjectmaterial(unsigned int index)
-{
-    if(index<(mObject_material.size()-1))
-        mObject_material.insert(mObject_material.begin()+index+1, mObject_material[index]);
-    else if(index==mObject_material.size()-1)
-        mObject_material.push_back(mObject_material[index]);
-    mLastAddedObjectmaterial=index+1;
-    return mLastAddedObjectmaterial;
-}
-
-void Object::DeleteObjectmaterial(unsigned int index)
-{
-    mObject_material.erase(mObject_material.begin()+index);
-}
-
-
-signal_positionRoad::signal_positionRoad(double s, double t, double zOffset, double hOffset, double pitch, double roll)
-{
-    ms = s;
-    mt = t;
-    mzOffset = zOffset;
-    mhOffset = hOffset;
-    mpitch = pitch;
-    mroll = roll;
-}
-
-double signal_positionRoad::Gets()
-{
-    return ms;
-}
-
-double signal_positionRoad::Gett()
-{
-    return mt;
-}
-
-double signal_positionRoad::GetzOffset()
-{
-    return mzOffset;
-}
-
-double signal_positionRoad::GethOffset()
-{
-    return mhOffset;
-}
-
-double signal_positionRoad::Getpitch()
-{
-    return mpitch;
-}
-
-double signal_positionRoad::Getroll()
-{
-    return mroll;
-}
-
-void signal_positionRoad::Sets(double s)
-{
-    ms = s;
-}
-
-void signal_positionRoad::Sett(double t)
-{
-    mt = t;
-}
-
-void signal_positionRoad::SetzOffset(double zOffset)
-{
-    mzOffset = zOffset;
-}
-
-void signal_positionRoad::SethOffset(double hOffset)
-{
-    mhOffset = hOffset;
-}
-
-void signal_positionRoad::Setpitch(double pitch)
-{
-    mpitch = pitch;
-}
-
-void signal_positionRoad::Setroll(double roll)
-{
-    mroll = roll;
-}
-
-signal_positionInertial::signal_positionInertial(double x, double y,double z, double hdg, double pitch, double roll)
-{
-    mx = x;
-    my = y;
-    mz = z;
-    mhdg = hdg;
-    mpitch = pitch;
-    mroll = roll;
-}
-
-double signal_positionInertial::Getx()
-{
-    return mx;
-}
-
-double signal_positionInertial::Gety()
-{
-    return my;
-}
-
-double signal_positionInertial::Getz()
-{
-    return mz;
-}
-
-double signal_positionInertial::Gethdg()
-{
-    return mhdg;
-}
-
-double signal_positionInertial::Getpitch()
-{
-    return mpitch;
-}
-
-double signal_positionInertial::Getroll()
-{
-    return mroll;
-}
-
-void signal_positionInertial::Setx(double x)
-{
-    mx = x;
-}
-
-void signal_positionInertial::Sety(double y)
-{
-    my = y;
-}
-
-void signal_positionInertial::Setz(double z)
-{
-    mz = z;
-}
-
-void signal_positionInertial::Sethdg(double hdg)
-{
-    mhdg = hdg;
-}
-
-void signal_positionInertial::Setpitch(double pitch)
-{
-    mpitch = pitch;
-}
-
-void signal_positionInertial::Setroll(double roll)
-{
-    mroll = roll;
-}
-
-
-signal_laneValidity::signal_laneValidity(int fromLane,int toLane)
-{
-    mfromLane = fromLane;
-    mtoLane = toLane;
-}
-
-int signal_laneValidity::GetfromLane()
-{
-    return mfromLane;
-}
-
-int signal_laneValidity::GettoLane()
-{
-    return mtoLane;
-}
-
-void signal_laneValidity::SetfromLane(int fromLane)
-{
-    mfromLane = fromLane;
-}
-
-void signal_laneValidity::SettoLane(int toLane)
-{
-    mtoLane = toLane;
-}
-
-
-Signal::Signal(double s, double t, std::string id, std::string name, bool dynamic,string orientation,
-               double zOffset, string type, std::string country, std::string countryRevision,
-               string subtype, double hOffset, double pitch, double roll, double height, double width)
-{
-    ms = s;
-    mt = t;
-    mid = id;
-    mname = name;
-    mdynamic = dynamic;
-    morientation = orientation;
-    mzOffset = zOffset;
-    mtype = type;
-    mcountry = country;
-    mcountryRevision = countryRevision;
-    msubtype = subtype;
-    mhOffset = hOffset;
-    mpitch = pitch;
-    mroll = roll;
-    mheight = height;
-    mwidth = width;
-    mpsignal_laneValidity = 0;
-    mpsignal_positionInertial = 0;
-    mpsignal_positionRoad = new signal_positionRoad(s,t,zOffset,hOffset,pitch,roll);
-}
-
-Signal::Signal()
-{
-    mpsignal_positionInertial = 0;
-    mpsignal_positionRoad = 0;
-    mpsignal_laneValidity = 0;
-
-}
-Signal::~Signal()
-{
-    if(mpsignal_laneValidity != 0)delete mpsignal_laneValidity;
-    if(mpsignal_positionInertial != 0)delete mpsignal_positionInertial;
-    if(mpsignal_positionRoad != 0)delete mpsignal_positionRoad;
-}
-
-Signal& Signal::operator=(const Signal& x)
-{
-    if (this != &x)
-    {
-        this->ms = x.ms;
-        this->mt = x.mt;
-        this->mid = x.mid;
-        this->mname = x.mname;
-        this->mdynamic = x.mdynamic;
-        this->morientation = x.morientation;
-        this->mzOffset = x.mzOffset;
-        this->mtype = x.mtype;
-        this->mcountry = x.mcountry;
-        this->mcountryRevision = x.mcountryRevision;
-        this->msubtype = x.msubtype;
-        this->mhOffset = x.mhOffset;
-        this->mpitch = x.mpitch;
-        this->mroll = x.mroll;
-        this->mheight = x.mheight;
-        this->mwidth = x.mwidth;
-        this->mpsignal_positionInertial = 0;
-        if(x.mpsignal_positionInertial != 0)
-        {
-            this->mpsignal_positionInertial = new signal_positionInertial(x.mpsignal_positionInertial->Getx(),
-                                                                      x.mpsignal_positionInertial->Gety(),
-                                                                      x.mpsignal_positionInertial->Getz(),
-                                                                      x.mpsignal_positionInertial->Gethdg(),
-                                                                      x.mpsignal_positionInertial->Getpitch(),
-                                                                      x.mpsignal_positionInertial->Getroll());
-        }
-        this->mpsignal_laneValidity = 0;
-        if(x.mpsignal_laneValidity != 0)
-        {
-            this->mpsignal_laneValidity = new signal_laneValidity(x.mpsignal_laneValidity->GetfromLane(),
-                                                              x.mpsignal_laneValidity->GettoLane());
-        }
-        this->mpsignal_positionRoad = new signal_positionRoad(ms,mt,mzOffset,mhOffset,mpitch,mroll);
-    }
-    return *this;
-}
-
-Signal::Signal(const Signal &x)
-{
-    ms = x.ms;
-    mt = x.mt;
-    mid = x.mid;
-    mname = x.mname;
-    mdynamic = x.mdynamic;
-    morientation = x.morientation;
-    mzOffset = x.mzOffset;
-    mtype = x.mtype;
-    mcountry = x.mcountry;
-    mcountryRevision = x.mcountryRevision;
-    msubtype = x.msubtype;
-    mhOffset = x.mhOffset;
-    mpitch = x.mpitch;
-    mroll = x.mroll;
-    mheight = x.mheight;
-    mwidth = x.mwidth;
-    this->mpsignal_positionInertial = 0;
-    if(x.mpsignal_positionInertial != 0)
-    {
-        this->mpsignal_positionInertial = new signal_positionInertial(x.mpsignal_positionInertial->Getx(),
-                                                                  x.mpsignal_positionInertial->Gety(),
-                                                                  x.mpsignal_positionInertial->Getz(),
-                                                                  x.mpsignal_positionInertial->Gethdg(),
-                                                                  x.mpsignal_positionInertial->Getpitch(),
-                                                                  x.mpsignal_positionInertial->Getroll());
-    }
-    this->mpsignal_laneValidity = 0;
-    if(x.mpsignal_laneValidity != 0)
-    {
-        this->mpsignal_laneValidity = new signal_laneValidity(x.mpsignal_laneValidity->GetfromLane(),
-                                                          x.mpsignal_laneValidity->GettoLane());
-    }
-    mpsignal_positionRoad = new signal_positionRoad(ms,mt,mzOffset,mhOffset,mpitch,mroll);
-}
-
-double Signal::Gets()
-{
-    return ms;
-}
-
-double Signal::Gett()
-{
-    return mt;
-}
-
-string Signal::Getid()
-{
-    return mid;
-}
-
-string Signal::Getname()
-{
-    return mname;
-}
-
-bool Signal::Getdynamic()
-{
-    return mdynamic;
-}
-
-string Signal::Getorientation()
-{
-    return morientation;
-}
-
-double Signal::GetzOffset()
-{
-    return mzOffset;
-}
-
-string Signal::Gettype()
-{
-    return mtype;
-}
-
-string Signal::Getcountry()
-{
-    return mcountry;
-}
-
-string Signal::GetcountryRevision()
-{
-    return mcountryRevision;
-}
-
-string Signal::Getsubtype()
-{
-    return msubtype;
-}
-
-double Signal::GethOffset()
-{
-    return mhOffset;
-}
-
-double Signal::Getpitch()
-{
-    return mpitch;
-}
-
-double Signal::Getroll()
-{
-    return mroll;
-}
-
-double Signal::Getheight()
-{
-    return mheight;
-}
-
-double Signal::Getwidth()
-{
-    return mwidth;
-}
-
-signal_positionRoad * Signal::GetpositionRoad()
-{
-    return mpsignal_positionRoad;
-}
-
-signal_positionInertial * Signal::GetpositionInertial()
-{
-    return mpsignal_positionInertial;
-}
-
-void Signal::Sets(double s)
-{
-    ms = s;
-}
-
-void Signal::Sett(double t)
-{
-    mt = t;
-}
-
-void Signal::Setid(std::string id)
-{
-    mid = id;
-}
-
-void Signal::Setname(std::string name)
-{
-    mname = name;
-}
-
-void Signal::Setdynamic(bool dynamic)
-{
-    mdynamic = dynamic;
-}
-
-void Signal::Setorientation(std::string orientation)
-{
-    morientation = orientation;
-}
-
-void Signal::SetzOffset(double zOffset)
-{
-    mzOffset = zOffset;
-}
-
-void Signal::Settype(string type)
-{
-    mtype = type;
-}
-
-void Signal::Setcountry(std::string country)
-{
-    mcountry = country;
-}
-
-void Signal::SetcountryRevision(std::string countryRevision)
-{
-    mcountryRevision = countryRevision;
-}
-
-void Signal::Setsubtype(string subtype)
-{
-    msubtype = subtype;
-}
-
-void Signal::SethOffset(double hOffset)
-{
-    mhOffset = hOffset;
-}
-
-void Signal::Setpitch(double pitch)
-{
-    mpitch = pitch;
-}
-
-void Signal::Setroll(double roll)
-{
-    mroll = roll;
-}
-
-void Signal::Setheight(double height)
-{
-    mheight = height;
-}
-
-void Signal::Setwidth(double width)
-{
-    mwidth = width;
-}
-
-void Signal::SetlaneValidity(int fromLane, int toLane)
-{
-    if(mpsignal_laneValidity == 0)
-    {
-        mpsignal_laneValidity = new signal_laneValidity(fromLane,toLane);
-    }
-    else
-    {
-        mpsignal_laneValidity->SetfromLane(fromLane);
-        mpsignal_laneValidity->SettoLane(toLane);
-    }
-}
-
-void Signal::SetpositionRoad(double s, double t, double zOffset, double hOffset, double pitch,double roll)
-{
-    if(mpsignal_positionRoad == 0)
-    {
-        mpsignal_positionRoad = new signal_positionRoad(s,t,zOffset,hOffset,pitch,roll);
-    }
-    else
-    {
-        mpsignal_positionRoad->Sets(s);
-        mpsignal_positionRoad->Sett(t);
-        mpsignal_positionRoad->SetzOffset(zOffset);
-        mpsignal_positionRoad->SethOffset(hOffset);
-        mpsignal_positionRoad->Setpitch(pitch);
-        mpsignal_positionRoad->Setroll(roll);
-    }
-}
-
-void Signal::SetpositionInertial(double x, double y, double z, double hdg, double pitch, double roll)
-{
-    if(mpsignal_positionInertial == 0)
-    {
-        mpsignal_positionInertial = new signal_positionInertial(x,y,z,hdg,pitch,roll);
-    }
-    else
-    {
-        mpsignal_positionInertial->Setx(x);
-        mpsignal_positionInertial->Sety(y);
-        mpsignal_positionInertial->Setz(z);
-        mpsignal_positionInertial->Sethdg(hdg);
-        mpsignal_positionInertial->Setpitch(pitch);
-        mpsignal_positionInertial->Setroll(roll);
-    }
-}
-
-signal_laneValidity * Signal::GetlaneValidity()
-{
-    return mpsignal_laneValidity;
-}
-
-
-
-

+ 0 - 386
src/tool/map_lanetoxodr/OpenDrive/ObjectSignal.h

@@ -1,386 +0,0 @@
-#ifndef OBJECTSIGNAL_H
-#define OBJECTSIGNAL_H
-
-#include <vector>
-#include <string>
-
-using std::vector;
-using std::string;
-
-class Object_outlines_outline
-{
-private:
-    vector<int> mid;
-    vector<string> mfillType;
-    vector<bool> mouter;
-    vector<bool> mclosed;
-    vector<string> mlaneTYpe;
-public:
-    Object_outlines_outline();
-};
-
-class Object_outlines
-{
-private:
-    vector<Object_outlines_outline> moutline;
-
-public:
-    Object_outlines();
-};
-
-class Object_material
-{
-private:
-    vector<string> msurface;
-    vector<double> mfriction;
-    vector<double> mroughness;
-
-public:
-    Object_material();
-
-    int Getsurface(string & surface);
-    int Getfriction(double & friction);
-    int Getroughness(double & roughness);
-
-    void Setsurface(string surface);
-    void Setfriction(double friction);
-    void Setroughness(double roughness);
-};
-
-class Object_repeat
-{
-private:
-    double ms;
-    double mlength;
-    double mdistance;
-    double mtStart;
-    double mtEnd;
-    double mheightStart;
-    double mheightEnd;
-    double mzOffsetStart;
-    double mzOffsetEnd;
-    vector<double> mwidthStart;
-    vector<double> mwidthEnd;
-    vector<double> mlengthStart;
-    vector<double> mlengthEnd;
-    vector<double> mradiusStart;
-    vector<double> mradiusEnd;
-
-public:
-    Object_repeat(double s,double length,double distance,double tStart,double tEnd,double heightStart,
-                  double heightEnd,double zOffsetStart,double zOffsetEnd);
-
-    double Gets();
-    double Getlength();
-    double Getdistance();
-    double GettStart();
-    double GettEnd();
-    double GetheightStart();
-    double GetheightEnd();
-    double GetzOffsetStart();
-    double GetzOffsetEnd();
-
-
-    void Sets(double s);
-    void Setlength(double length);
-    void Setdistance(double distance);
-    void SettStart(double tStart);
-    void SettEnd(double tEnd);
-    void SetheightStart(double heightStart);
-    void SetheightEnd(double heightEnd);
-    void SetzOffsetStart(double zOffsetStart);
-    void SetzOffsetEnd(double zOffsetEnd);
-
-
-    int GetwidthStart(double & widthStart);
-    int GetwidthEnd(double & widthEnd);
-    int GetlengthStart(double & lengthStart);
-    int GetlengthEnd(double & lengthEnd);
-    int GetradiusStart(double & radiusStart);
-    int GetradiusEnd(double & radiusEnd);
-
-    void DeletewidthStart();
-    void DeletewidthEnd();
-    void DeletelengthStart();
-    void DeletelengthEnd();
-    void DeleteradiusStart();
-    void DeleteradiusEnd();
-
-    void SetwidthStart(double  widthStart);
-    void SetwidthEnd(double  widthEnd);
-    void SetlengthStart(double  lengthStart);
-    void SetlengthEnd(double  lengthEnd);
-    void SetradiusStart(double  radiusStart);
-    void SetradiusEnd(double  radiusEnd);
-
-    bool CheckInterval(double s_check);
-
-
-};
-
-class Object_parkingSpace
-{
-private:
-    string maccess;
-    string mrestrictions;
-
-public:
-    Object_parkingSpace();
-
-    void Setaccess(string access);
-    void Setrestrictions(string restrictions);
-
-    string Getaccess();
-    string Getrestrictions();
-
-    /**
-     * Copy constructor
-     */
-    Object_parkingSpace (const Object_parkingSpace& parkingSpace);
-
-    /**
-     * Assignment operator overload
-     */
-    const Object_parkingSpace& operator=(const Object_parkingSpace& rhs);
-};
-
-//***********************************************************************************
-//Object
-//***********************************************************************************
-class Object
-{
-private:
-    double mt;
-    double mzOffset;
-    string mtype;
-    vector<double> mvalidLength;
-    string morientation;
-    string msubtype;
-    string mdynamic;
-    vector<double> mhdg;
-    string mname;
-    vector<double> mpitch;
-    string mid;
-    vector<double> mroll;
-    vector<double> mheight;
-    double ms;
-    vector<double> mlength;
-    vector<double> mwidth;
-    vector<double> mradius;
-
-    vector<Object_parkingSpace> mObject_parkingSpace;
-    vector<Object_repeat> mObject_repeat;
-    vector<Object_material> mObject_material;
-
-    unsigned int mLastAddedObjectrepeat;
-    unsigned int mLastAddedObjectmaterial;
-
-public:
-
-    Object(string id,double s,double t, double zOffset);
-
-    double Gett();
-    double GetzOffset();
-    string Gettype();
-    int GetvalidLength(double & validLength);
-    string Getorientation();
-    string Getsubtype();
-    string Getdynamic();
-    int Gethdg(double & hdg);
-    string Getname();
-    int Getpitch(double & pitch);
-    string Getid();
-    int Getroll(double & roll);
-    int Getheight(double & height);
-    double Gets();
-    int Getlength(double & length);
-    int Getwidth(double & width);
-    int Getradius(double & radius);
-
-    int GetparkingSpace(Object_parkingSpace & parkingSpace);
-
-    void Sett(double t);
-    void SetzOffset(double zOffset);
-    void Settype(string type);
-    void SetvalidLength(double  validLength);
-    void Setorientation(string orientation);
-    void Setsubtype(string subtype);
-    void Setdynamic(string dynamic);
-    void Sethdg(double  hdg);
-    void Setname(string name);
-    void Setpitch(double pitch);
-    void Setid(string id);
-    void Setroll(double  roll);
-    void Setheight(double height);
-    void Sets(double s);
-    void Setlength(double length);
-    void Setwidth(double width);
-    void Setradius(double radius);
-
-    void SetparkingSpace(Object_parkingSpace parkingSpace);
-
-    vector<Object_repeat> * GetObjectrepeatVector();
-    Object_repeat* GetObjectrepeat(unsigned int i);
-    unsigned int GetObjectrepeatCount();
-    Object_repeat*			GetLastObjectrepeat();
-    Object_repeat*			GetLastAddedObjectrepeat();
-    unsigned int AddObjectrepeat(double s,double length,double distance,double tStart,double tEnd,
-                                 double heightStart,double heightEnd,double zOffsetStart,double zOffsetEnd);
-    unsigned int CloneObjectrepeat(unsigned int index);
-    void DeleteObjectrepeat(unsigned int index);
-    int CheckObjectrepeatInterval(double s_check);
-
-    vector<Object_material> * GetObjectmaterialVector();
-    Object_material* GetObjectmaterial(unsigned int i);
-    unsigned int GetObjectmaterialCount();
-    Object_material*			GetLastObjectmaterial();
-    Object_material*			GetLastAddedObjectmaterial();
-    unsigned int AddObjectmaterial();
-    unsigned int CloneObjectmaterial(unsigned int index);
-    void DeleteObjectmaterial(unsigned int index);
-};
-//----------------------------------------------------------------------------------
-
-
-
-class signal_positionRoad
-{
-private:
-    double ms;
-    double mt;
-    double mzOffset;
-    double mhOffset;
-    double mpitch;
-    double mroll;
-public:
-    signal_positionRoad(double s,double t,double zOffset,double hOffset, double pitch,double roll);
-    double Gets();
-    double Gett();
-    double GetzOffset();
-    double GethOffset();
-    double Getpitch();
-    double Getroll();
-    void Sets(double s);
-    void Sett(double t);
-    void SetzOffset(double zOffset);
-    void SethOffset(double hOffset);
-    void Setpitch(double pitch);
-    void Setroll(double roll);
-};
-
-class signal_positionInertial
-{
-private:
-    double mx;
-    double my;
-    double mz;
-    double mhdg;
-    double mpitch;
-    double mroll;
-public:
-    signal_positionInertial(double x,double y,double z,double hdg,double pitch,double roll );
-    double Getx();
-    double Gety();
-    double Getz();
-    double Gethdg();
-    double Getpitch();
-    double Getroll();
-    void Setx(double x);
-    void Sety(double y);
-    void Setz(double z);
-    void Sethdg(double hdg);
-    void Setpitch(double pitch);
-    void Setroll(double roll);
-};
-
-class signal_laneValidity
-{
-private:
-    int mfromLane;
-    int mtoLane;
-public:
-    signal_laneValidity(int fromLane,int toLane);
-    int GetfromLane();
-    int GettoLane();
-    void SetfromLane(int fromLane);
-    void SettoLane(int toLane);
-};
-
-
-//***********************************************************************************
-//Signal
-//***********************************************************************************
-class Signal
-{
-private:
-    double ms;
-    double mt;
-    string mid;
-    string mname;
-    bool mdynamic;
-    string morientation;
-    double mzOffset;
-    string mtype;
-    string mcountry;
-    string mcountryRevision;
-    string msubtype;
-    double mhOffset;
-    double mpitch;
-    double mroll;
-    double mheight;
-    double mwidth;
-    signal_positionRoad * mpsignal_positionRoad;
-    signal_positionInertial * mpsignal_positionInertial;
-    signal_laneValidity * mpsignal_laneValidity;
-public:
-    Signal(double s,double t,string id,string name,bool dynamic,string orientation,double zOffset,string type,string country,string countryRevision,
-           string subtype,double hOffset,double pitch,double roll ,double height,double width);
-    Signal();
-    ~Signal();
-    Signal& operator=(const Signal& x);
-    Signal(const Signal & x);
-    double Gets();
-    double Gett();
-    string Getid();
-    string Getname();
-    bool Getdynamic();
-    string Getorientation();
-    double GetzOffset();
-    string Gettype();
-    string Getcountry();
-    string GetcountryRevision();
-    string Getsubtype();
-    double GethOffset();
-    double Getpitch();
-    double Getroll();
-    double Getheight();
-    double Getwidth();
-    signal_positionRoad * GetpositionRoad();
-    signal_positionInertial * GetpositionInertial();
-    signal_laneValidity * GetlaneValidity();
-    void Sets(double s);
-    void Sett(double t);
-    void Setid(string id);
-    void Setname(string name);
-    void Setdynamic(bool dynamic);
-    void Setorientation(string orientation);
-    void SetzOffset(double zOffset);
-    void Settype(string type);
-    void Setcountry(string country);
-    void SetcountryRevision(string countryRevision);
-    void Setsubtype(string subtype);
-    void SethOffset(double hOffset);
-    void Setpitch(double pitch);
-    void Setroll(double roll);
-    void Setheight(double height);
-    void Setwidth(double width);
-    void SetlaneValidity(int fromLane, int toLane);
-    void SetpositionRoad(double s,double t, double zOffset,double hOffset,double pitch,double roll);
-    void SetpositionInertial(double x,double y, double z, double hdg,double pitch,double roll);
-
-
-};
-//----------------------------------------------------------------------------------
-
-
-#endif

+ 0 - 381
src/tool/map_lanetoxodr/OpenDrive/OpenDrive.cpp

@@ -1,381 +0,0 @@
-#include "OpenDrive.h"
-
-
-//***********************************************************************************
-//OpenDRIVE Structure
-//***********************************************************************************
-/**
- * Constructor
- */
-OpenDrive::OpenDrive()
-{
-	mHeader=NULL;
-}
-
-
-/**
- * Sets the header of the OpenDrive file
- */
-void OpenDrive::SetHeader(unsigned short int revMajor, unsigned short int revMinor, string name, float version, string date, 
-						  double north, double south, double east,double west)
-{	
-	if (mHeader==NULL)
-		mHeader=new Header(revMajor, revMinor, name, version, date, north, south, east, west);
-	else
-	{
-		mHeader->SetAllParams(revMajor, revMinor, name, version, date, north, south, east, west);
-	}
-
-}
-
-void OpenDrive::SetHeader(unsigned short int revMajor, unsigned short int revMinor, string name, float version, string date,
-                          double north, double south, double east,double west,double lat0,double lon0,double hdg0)
-{
-    if (mHeader==NULL)
-        mHeader=new Header(revMajor, revMinor, name, version, date, north, south, east, west,lat0,lon0,hdg0);
-    else
-    {
-        mHeader->SetAllParams(revMajor, revMinor, name, version, date, north, south, east, west,lat0,lon0,hdg0);
-    }
-
-}
-
-/**
- * Methods used to add records to the respective vectors
- */
-unsigned int OpenDrive::AddRoad(string name, double length, string id, string junction)
-{
-	unsigned int index=GetRoadCount();
-	// Adds the new road to the end of the vector
-	mRoadVector.push_back(Road(name, length, id, junction));
-	// Saves the index of the newly added road
-	mLastAddedRoad=index;
-	return index;
-}
-unsigned int OpenDrive::AddJunction(string name, string id)
-{
-	unsigned int index=GetJunctionCount();
-	// Adds the new junction to the end of the vector
-	mJunctionVector.push_back(Junction(name,id));
-	// Saves the index of the newly added junction
-	mLastAddedJunction=index;
-	return index;
-}
-
-/**
- * Methods used to delete records from the respective vectors
- */
-void OpenDrive::DeleteRoad(unsigned int index)
-{
-	mRoadVector.erase(mRoadVector.begin()+index);
-}
-void OpenDrive::DeleteJunction(unsigned int index)
-{
-	mJunctionVector.erase(mJunctionVector.begin()+index);
-}
-
-//-------------------------------------------------
-
-/**
- * Getters for the last child records in their respective vectors
- */
-Road* OpenDrive::GetLastRoad()
-{	
-	if (mRoadVector.size()>0)
-		return &(mRoadVector.at(mRoadVector.size()-1));
-	else
-		return NULL;
-}
-Junction* OpenDrive::GetLastJunction()
-{
-	if (mJunctionVector.size()>0)
-		return &(mJunctionVector.at(mJunctionVector.size()-1));
-	else
-		return NULL;
-}
-
-/**
- * Getters for the last added records in their respective vectors
- */
-Road* OpenDrive::GetLastAddedRoad()
-{	
-	if(mLastAddedRoad<mRoadVector.size())
-		return &mRoadVector.at(mLastAddedRoad);
-	else
-		return NULL;
-}
-
-/**
- * Getter for the OpenDrive header
- */
-Header* OpenDrive::GetHeader()
-{ 
-	return mHeader;
-}
-
-/**
- * Getters for the records and their vectors
- */
-// Road records
-vector<Road> * OpenDrive::GetRoadVector()
-{
-	return &mRoadVector;
-}
-Road* OpenDrive::GetRoad(unsigned int i)
-{	
-	if ((i < mRoadVector.size())&&( mRoadVector.size()>0))
-		return &(mRoadVector.at(i));	
-	else
-		return NULL;
-}
-unsigned int OpenDrive::GetRoadCount()
-{	
-	return mRoadVector.size();	
-}
-// Junction records
-vector<Junction> * OpenDrive::GetJunctionVector()
-{
-	return &mJunctionVector;
-}
-Junction* OpenDrive::GetJunction(unsigned int i)
-{	if (i < mJunctionVector.size())
-		return &(mJunctionVector.at(i));
-	else
-		return NULL;
-}
-unsigned int OpenDrive::GetJunctionCount()
-{	
-	return mJunctionVector.size();	
-}
-//-------------------------------------------------
-
-/**
- * Clears the OpenDrive structure, could be used to start a new document
- */
-void OpenDrive::Clear()
-{
-	mRoadVector.clear();
-	mJunctionVector.clear();
-}
-
-OpenDrive::OpenDrive (const OpenDrive& openDrive)
-{
-    mRoadVector = openDrive.mRoadVector;
-    mJunctionVector = openDrive.mJunctionVector;
-    Header * pHeader = openDrive.mHeader;
-    if(pHeader != NULL)
-    {
-        unsigned short int revMajor,revMinor;
-        std::string name,date;
-        float version;
-        double north,south,east,west,lat0,lon0,hdg0;
-        pHeader->GetAllParams(revMajor,revMinor,name,version,date,north,south,east,west,lat0,lon0,hdg0);
-
-        mHeader = new Header(revMajor,revMinor,name,version,date,north,south,east,west,lat0,lon0,hdg0);
-
-    }
-    else
-    {
-        mHeader == NULL;
-    }
-}
-
-const OpenDrive& OpenDrive::operator=(const OpenDrive& rhs)
-{
-    mRoadVector = rhs.mRoadVector;
-    mJunctionVector = rhs.mJunctionVector;
-    Header * pHeader = rhs.mHeader;
-    if(pHeader != NULL)
-    {
-        unsigned short int revMajor,revMinor;
-        std::string name,date;
-        float version;
-        double north,south,east,west,lat0,lon0,hdg0;
-        pHeader->GetAllParams(revMajor,revMinor,name,version,date,north,south,east,west,lat0,lon0,hdg0);
-
-        mHeader = new Header(revMajor,revMinor,name,version,date,north,south,east,west,lat0,lon0,hdg0);
-
-    }
-    else
-    {
-        mHeader == NULL;
-    }
-}
-
-/**
- * Destructor
- */
-OpenDrive::~OpenDrive()
-{
-	if (mHeader!=NULL)
-		delete mHeader;
-
-	// DELETING ROADS
-	mRoadVector.clear();
-
-	// DELETING JUNCTIONS
-	mJunctionVector.clear();
-}
-
-
-//***********************************************************************************
-//Header
-//***********************************************************************************
-/**
- * Constructor that initializes the base properties
- */
-Header::Header(unsigned short int revMajor, unsigned short int revMinor, string name, float version, string date, 
-			   double north, double south, double east,double west)
-{
-	mRevMajor=revMajor;
-	mRevMinor=revMinor;
-	mName=name;
-	mVersion=version;
-	mDate=date;
-	mNorth=north;
-	mSouth=south;
-	mEast=east;
-	mWest=west;
-
-}
-
-Header::Header(unsigned short int revMajor, unsigned short int revMinor, string name, float version, string date,
-               double north, double south, double east,double west,double lat0,double lon0,double hdg0)
-{
-    mRevMajor=revMajor;
-    mRevMinor=revMinor;
-    mName=name;
-    mVersion=version;
-    mDate=date;
-    mNorth=north;
-    mSouth=south;
-    mEast=east;
-    mWest=west;
-
-    mLat0=lat0;
-    mLon0=lon0;
-    mHdg0=hdg0;
-
-}
-
-/**
- * Getter for all properties
- */
-void Header::GetAllParams(unsigned short int &revMajor, unsigned short int &revMinor, string &name, float &version, string &date, 
-						  double &north, double &south, double &east,double &west)
-{
-	revMajor=mRevMajor;
-	revMinor=mRevMinor;
-	name=mName;
-	version=mVersion;
-	date=mDate;
-	north=mNorth;
-	south=mSouth;
-	east=mEast;
-	west=mWest;
-
-}
-
-void Header::GetAllParams(unsigned short int &revMajor, unsigned short int &revMinor, string &name, float &version, string &date,
-                          double &north, double &south, double &east,double &west,double &lat0,double &lon0, double & hdg0)
-{
-    revMajor=mRevMajor;
-    revMinor=mRevMinor;
-    name=mName;
-    version=mVersion;
-    date=mDate;
-    north=mNorth;
-    south=mSouth;
-    east=mEast;
-    west=mWest;
-    lat0=mLat0;
-    lon0=mLon0;
-    hdg0=mHdg0;
-
-}
-
-
-void Header::GetXYValues(double &north, double &south, double &east,double &west)
-{
-	north=mNorth;
-	south=mSouth;
-	east=mEast;
-	west=mWest;
-}
-
-/**
- * Setter for all properties
- */
-void Header::SetAllParams(unsigned short int revMajor, unsigned short int revMinor, string name, float version, string date, 
-						  double north, double south, double east,double west)
-{
-	mRevMajor=revMajor;
-	mRevMinor=revMinor;
-	mName=name;
-	mVersion=version;
-	mDate=date;
-	mNorth=north;
-	mSouth=south;
-	mEast=east;
-	mWest=west;
-}
-
-void Header::SetAllParams(unsigned short int revMajor, unsigned short int revMinor, string name, float version, string date,
-                          double north, double south, double east,double west,double lat0,double lon0,double hdg0)
-{
-    mRevMajor=revMajor;
-    mRevMinor=revMinor;
-    mName=name;
-    mVersion=version;
-    mDate=date;
-    mNorth=north;
-    mSouth=south;
-    mEast=east;
-    mWest=west;
-    mLat0=lat0;
-    mLon0=lon0;
-    mHdg0=hdg0;
-}
-void Header::SetXYValues(double north, double south, double east,double west)
-{
-	mNorth=north;
-	mSouth=south;
-	mEast=east;
-	mWest=west;
-}
-
-void Header::GetLat0Lon0(double &lat0, double &lon0)
-{
-    lat0 = mLat0;
-    lon0 = mLon0;
-}
-
-void Header::GetVendor(std::string &strvendor)
-{
-    strvendor = mVendor;
-}
-
-void Header::SetVendor(std::string strvendor)
-{
-    mVendor = strvendor;
-}
-
-void Header::GetgeoReference(std::string &strgeoReference)
-{
-     strgeoReference = mgeoReference;
-}
-
-void Header::GetuserData(std::string &struserData)
-{
-    struserData = muserData;
-}
-
-void Header::SetgeoReference(std::string strgeoReference)
-{
-    mgeoReference = strgeoReference;
-}
-
-void Header::SetuserData(std::string struserData)
-{
-    muserData = struserData;
-}

+ 0 - 202
src/tool/map_lanetoxodr/OpenDrive/OpenDrive.h

@@ -1,202 +0,0 @@
-#ifndef OPENDRIVE_H
-#define OPENDRIVE_H
-
-#include <vector>
-#include <string>
-
-#include "Road.h"
-//--Prototypes--
-//main
-class Header;
-//--------------
-
-
-using std::vector;
-using std::string;
-
-
-/**
- * The main class in OpenDrive structure
- * Holds the two vectors of the top-level records: ROAD and JUNCTION
- * Has methods to add, get and delete those records
- * From this class - one could get access to any record in OpenDrive structure
- * going down the hierarchy
- */
-class OpenDrive
-{
-private:
-	/**
-	 * Header of the OpenDrive file
-	 */
-	Header* mHeader;
-
-	/**
-	 * Vectors used to store the top-level ROAD and JUNCTION records
-	 */
-	vector<Road> mRoadVector;
-	vector<Junction> mJunctionVector;
-	
-	/**
-	 * Indices of the last added records
-	 */
-	unsigned int mLastAddedRoad;
-	unsigned int mLastAddedJunction;
-
-//	//-------------------------------------------------
-
-//	/**
-//	 * Copy constructor, makes the object non-copyable
-//	 */
-
-
-public:
-	/**
-	 * Constructor
-	 */
-	OpenDrive();
-
-    OpenDrive (const OpenDrive& openDrive);
-    const OpenDrive& operator=(const OpenDrive& rhs);
-
-	//-------------------------------------------------
-
-	/**
-	 * Sets the header of the OpenDrive file
-	 */
-	void SetHeader(unsigned short int revMajor, unsigned short int revMinor, string name, float version, string date, 
-					double north, double south, double east,double west);
-
-    /**
-     * Sets the header of the OpenDrive file  Added by Yuchuli,2019.11.04
-     */
-    void SetHeader(unsigned short int revMajor, unsigned short int revMinor, string name, float version, string date,
-                    double north, double south, double east,double west,double lat0,double lon0,double hdg0);
-	
-	/**
-	 * Methods used to add records to the respective vectors
-	 */
-	unsigned int AddRoad(string name, double length, string id, string junction);
-	unsigned int AddJunction(string name, string id);
-
-	/**
-	 * Methods used to delete records from the respective vectors
-	 */
-	void DeleteRoad(unsigned int index);
-	void DeleteJunction(unsigned int index);
-
-	//-------------------------------------------------
-
-	/**
-	 * Getters for the last child records in their respective vectors
-	 */
-	Road* GetLastRoad();
-	Junction* GetLastJunction();
-
-	/**
-	 * Getters for the last added records in their respective vectors
-	 */
-	Road* GetLastAddedRoad();
-
-	/**
-	 * Getter for the OpenDrive header
-	 */
-	Header* GetHeader();
-
-	/**
-	 * Getters for the records and their vectors
-	 */
-	// Road records
-	vector<Road> * GetRoadVector();
-	Road* GetRoad(unsigned int i);
-	unsigned int GetRoadCount();
-	// Junction records
-	vector<Junction> * GetJunctionVector();
-	Junction* GetJunction(unsigned int i);
-	unsigned int GetJunctionCount();
-	
-	//-------------------------------------------------
-
-
-	/**
-	 * Clears the OpenDrive structure, could be used to start a new document
-	 */
-	void Clear();
-
-
-	/**
-	 * Destructor
-	 */
-	~OpenDrive();
-};
-
-
-/**
- * Class used to store the heading details of the OpenDrive file
- */
-class Header
-{
-private:
-	/**
-	 * Base properties
-	 */
-	unsigned short int mRevMajor;
-	unsigned short int mRevMinor;
-	string mName;
-	float mVersion;
-	string mDate;
-	double mNorth;
-	double mSouth;
-	double mEast;
-	double mWest;
-    string mVendor;
-
-    //Added by Yuchuli,2019.11.04
-    double mLat0;
-    double mLon0;
-    double mHdg0;
-
-    string mgeoReference;
-    string muserData;
-
-public:
-	/**
-	 * Constructor that initializes the base properties
-	 */
-	Header(unsigned short int revMajor, unsigned short int revMinor, string name, float version, string date, 
-		double north, double south, double east,double west);
-
-    Header(unsigned short int revMajor, unsigned short int revMinor, string name, float version, string date,
-        double north, double south, double east,double west,double lat0,double lon0, double hdg0);
-	
-	/**
-	 * Getter for all properties
-	 */
-	void GetAllParams(unsigned short int &revMajor, unsigned short int &revMinor, string &name, float &version, string &date, 
-		double &north, double &south, double &east,double &west);
-    void GetAllParams(unsigned short int &revMajor, unsigned short int &revMinor, string &name, float &version, string &date,
-        double &north, double &south, double &east,double &west,double &lat0,double &lon0, double & hdg0);
-	void GetXYValues(double &north, double &south, double &east,double &west);
-    void GetVendor(std::string & strvendor);
-
-    void GetgeoReference(std::string & strgeoReference);
-    void GetuserData(std::string & struserData);
-	
-	/**
-	 * Setter for all properties
-	 */
-	void SetAllParams(unsigned short int revMajor, unsigned short int revMinor, string name, float version, string date, 
-		double north, double south, double east,double west);
-	void SetXYValues(double north, double south, double east,double west);
-
-    void SetAllParams(unsigned short int revMajor, unsigned short int revMinor, string name, float version, string date,
-        double north, double south, double east,double west,double lat0,double lon0,double hdg0);
-    void SetVendor(std::string strvendor);
-    void SetgeoReference(std::string strgeoReference);
-    void SetuserData(std::string struserData);
-
-
-    void GetLat0Lon0(double & lat0,double & lon0);
-};
-
-
-#endif

+ 0 - 1687
src/tool/map_lanetoxodr/OpenDrive/OpenDriveXmlParser.cpp

@@ -1,1687 +0,0 @@
-#include "OpenDriveXmlParser.h"
-#include <iostream>
-#include <algorithm>
-//#include "windows.h"
-
-using std::cout;
-using std::endl;
-
-/**
- * Constructor which saves a reference to OpenDrive structure
- */
-OpenDriveXmlParser::OpenDriveXmlParser (OpenDrive* openDriveObj)
-{	
-	mOpenDrive=openDriveObj;	
-}
-
-/**
- * The following methods are used to read the data from the XML file and fill in the the OpenDrive structure
- * Methods follow the hierarchical structure and are called automatically when ReadFile is executed
- */
-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;
-    string strvendor;
-
-    //Added By Yuchuli,2019.11.04
-    double lat0;
-    double lon0;
-    double hdg0;
-
-	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;
-	}
-
-
-    if(node->QueryDoubleAttribute("lat0",&lat0) != TIXML_SUCCESS)
-    {
-        lon0 = 119.0;
-    }
-    if(node->QueryDoubleAttribute("lon0",&lon0) != TIXML_SUCCESS)
-    {
-        lat0 = 39.0;
-    }
-    checker+=node->QueryDoubleAttribute("hdg0",&hdg0);
-
-    mOpenDrive->SetHeader(revMajor, revMinor, name, version, date, north, south, east, west,lat0,lon0,hdg0);
-
-    if(node->QueryStringAttribute("vendor",&strvendor) == TIXML_SUCCESS)
-    {
-        mOpenDrive->GetHeader()->SetVendor(strvendor);
-    }
-
-    TiXmlElement *nodegeo=node->FirstChildElement("geoReference");
-    if(nodegeo != NULL)
-    {
-
-        TiXmlPrinter *printer = new TiXmlPrinter();
-        nodegeo->Accept(printer );//保存该节点及其子节点到字符串
-        std::string str = printer->Str();
-        mOpenDrive->GetHeader()->SetgeoReference(str);
-    }
-
-    TiXmlElement *nodeuserData=node->FirstChildElement("userData");
-    if(nodeuserData != NULL)
-    {
-
-        TiXmlPrinter *printer = new TiXmlPrinter();
-        nodeuserData->Accept(printer );//保存该节点及其子节点到字符串
-        std::string str = printer->Str();
-        mOpenDrive->GetHeader()->SetuserData(str);
-    }
-	return true;
-
-}
-//--------------
-
-bool OpenDriveXmlParser::ReadRoad(TiXmlElement *node)
-{
-	//Read road attributes
-	string name;
-	double length;
-	string id;
-	string junction;
-    string rule;
-    bool bHaverule = false;
-
-	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;
-	}
-
-    if(node->QueryStringAttribute("rule",&rule) == TIXML_SUCCESS)
-    {
-        bHaverule = true;
-    }
-
-    if(node->QueryStringAttribute("name",&name) != TIXML_SUCCESS)
-    {
-        name = "";
-    }
-	//fill in
-	mOpenDrive->AddRoad(name, length, id, junction);
-	Road* road = mOpenDrive->GetLastAddedRoad();
-
-    if(bHaverule)
-    {
-        road->SetRoadRule(rule);
-    }
-
-	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;
-}
-//--------------
-
-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="NA";
-
-		int checker=TIXML_SUCCESS;
-		checker+=node->QueryStringAttribute("elementType",&elementType);
-		checker+=node->QueryStringAttribute("elementId",&elementId);
-		if (elementType.compare("road")==0)
-			checker+=node->QueryStringAttribute("contactPoint",&contactPoint);
-
-		if (checker!=TIXML_SUCCESS)
-		{
-			cout<<"Error parsing Predecessor attributes"<<endl;
-			return false;
-		}
-		road->SetPredecessor(elementType,elementId,contactPoint);
-
-        RoadLink * pRoadLink = road->GetPredecessor();
-        double elementS;
-        string elementDir;
-        if(node->QueryDoubleAttribute("elementS",&elementS) == TIXML_SUCCESS)
-        {
-            pRoadLink->SetElementS(elementS);
-        }
-        if(node->QueryStringAttribute("elementDir",&elementDir) == TIXML_SUCCESS)
-        {
-            pRoadLink->SetELementDir(elementDir);
-        }
-
-		return true;
-
-	}
-	else if (type == 1)
-	{
-		string elementType; 
-		string elementId;
-		string contactPoint="NA";
-
-		int checker=TIXML_SUCCESS;
-		checker+=node->QueryStringAttribute("elementType",&elementType);
-		checker+=node->QueryStringAttribute("elementId",&elementId);
-		if (elementType.compare("road")==0)
-			checker+=node->QueryStringAttribute("contactPoint",&contactPoint);
-
-		if (checker!=TIXML_SUCCESS)
-		{
-			cout<<"Error parsing Successor attributes"<<endl;
-			return false;
-		}
-		road->SetSuccessor(elementType,elementId,contactPoint);
-
-        RoadLink * pRoadLink = road->GetSuccessor();
-        double elementS;
-        string elementDir;
-        if(node->QueryDoubleAttribute("elementS",&elementS) == TIXML_SUCCESS)
-        {
-            pRoadLink->SetElementS(elementS);
-        }
-        if(node->QueryStringAttribute("elementDir",&elementDir) == TIXML_SUCCESS)
-        {
-            pRoadLink->SetELementDir(elementDir);
-        }
-		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"<<endl;
-			return false;
-		}
-		road->SetNeighbor(side,elementId,direction);
-		return true;
-	}
-
-	return false;
-		
-}
-
-//--------------
-
-bool OpenDriveXmlParser::ReadRoadTypeSpeed(RoadType *roadtype, TiXmlElement *node)
-{
-    double maxspeed;
-    string unit = "m/s";
-    int checker=TIXML_SUCCESS;
-    checker+=node->QueryDoubleAttribute("max",&maxspeed);
-    node->QueryStringAttribute("unit",&unit);
-    if(checker != TIXML_SUCCESS)
-    {
-        cout<<"Error Parsing Road Type Speed"<<endl;
-        return false;
-    }
-    roadtype->AddRoadTypeSpeed(maxspeed,unit);
-    return true;
-}
-
-//--------------
-
-bool OpenDriveXmlParser::ReadRoadType (Road* road, TiXmlElement *node)
-{
-	double s;
-	string type;
-    string country;
-
-	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;
-	}
-
-    if(node->QueryStringAttribute("country",&country) == TIXML_SUCCESS)
-    {
-        road->AddRoadType(s,type,country);
-    }
-    else
-    {
-        road->AddRoadType(s,type);
-    }
-
-    RoadType * roadtype = road->GetRoadType(0);
-    TiXmlElement * subNode;
-    subNode=node->FirstChildElement("speed");
-    while (subNode)
-    {
-        ReadRoadTypeSpeed(roadtype, subNode);
-        subNode=subNode->NextSiblingElement("speed");
-    }
-
-
-	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("arc")==0)
-        {
-            ReadGeometryBlock(road, subNode,2);		//load a turn block
-        }
-		else if (subNodeType->ValueStr().compare("poly3")==0)
-		{
-            ReadGeometryBlock(road, subNode,3);		//load a polynom spline block
-		}       
-        else if (subNodeType->ValueStr().compare("paramPoly3")==0)
-        {
-            ReadGeometryBlock(road, subNode,4);		//load a polynom spline block
-        }
-			
-
-		subNode=subNode->NextSiblingElement("geometry");
-
-	}
-	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, 2);
-		break;
-    case 3:
-        ReadGeometry(geomBlock, node, 3);
-        break;
-    case 4:
-        ReadGeometry(geomBlock, node, 4);
-        break;
-    default:
-        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 )
-      {
-	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 arc attributes"<<endl;
-			return false;
-		}
-
-		geomBlock->AddGeometryPoly3(s,x,y,hdg,length,a,b,c,d);
-		break;
-
-    case 4:		//parampoly3,add by Yuchuli 2019.11.1
-        checker=TIXML_SUCCESS;
-        double ua,ub,uc,ud,va,vb,vc,vd;
-        checker+=subNode->QueryDoubleAttribute("aU",&ua);
-        checker+=subNode->QueryDoubleAttribute("bU",&ub);
-        checker+=subNode->QueryDoubleAttribute("cU",&uc);
-        checker+=subNode->QueryDoubleAttribute("dU",&ud);
-        checker+=subNode->QueryDoubleAttribute("aV",&va);
-        checker+=subNode->QueryDoubleAttribute("bV",&vb);
-        checker+=subNode->QueryDoubleAttribute("cV",&vc);
-        checker+=subNode->QueryDoubleAttribute("dV",&vd);
-        if (checker!=TIXML_SUCCESS)
-        {
-            cout<<"Error parsing arc attributes"<<endl;
-            return false;
-        }
-
-        geomBlock->AddGeometryParamPoly3(s,x,y,hdg,length,ua,ub,uc,ud,va,vb,vc,vd);
-        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;
-}
-//--------------
-
-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;
-}
-//--------------
-
-bool OpenDriveXmlParser::ReadLanes (Road* road, TiXmlElement *node)
-{
-	TiXmlElement *subNode = node->FirstChildElement("laneSection");
-	while (subNode)
-	{
-		ReadLaneSections(road, subNode);
-		subNode=subNode->NextSiblingElement("laneSection");
-	}
-
-    subNode = node->FirstChildElement("laneOffset");
-    while (subNode)
-    {
-        ReadLaneOffsets(road, subNode);
-        subNode=subNode->NextSiblingElement("laneOffset");
-    }
-
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlParser::ReadLaneOffsets(Road *road, TiXmlElement *node)
-{
-    int checker=TIXML_SUCCESS;
-    double s,a,b,c,d;
-    checker+=node->QueryDoubleAttribute("s",&s);
-    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 Offset attributes"<<endl;
-        return false;
-    }
-
-    road->AddLaneOffset(s,a,b,c,d);
-
-   return true;
-
-
-}
-
-bool OpenDriveXmlParser::ReadLaneSections (Road* road, TiXmlElement *node)
-{
-
-	int checker=TIXML_SUCCESS;
-	double s;
-    string singleSide;
-	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();
-
-    if(node->QueryStringAttribute("singleSide",&singleSide) == TIXML_SUCCESS)
-    {
-        laneSection->SetSingleSide(singleSide);
-    }
-
-	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;
-	}
-	//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);
-			}
-    }
-
-    //Proceed to the Road border
-    subNode=node->FirstChildElement("border");
-    while (subNode)
-    {
-        ReadLaneBorder(lane, subNode);
-        subNode=subNode->NextSiblingElement("border");
-    }
-
-	//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 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 user Data
-    TiXmlElement *nodeuserData=node->FirstChildElement("userData");
-    if(nodeuserData != NULL)
-    {
-
-        TiXmlPrinter *printer = new TiXmlPrinter();
-        nodeuserData->Accept(printer );//保存该节点及其子节点到字符串
-        std::string str = printer->Str();
-        lane->SetuserData(str);
-    }
-
-	return true;
-}
-//--------------
-
-
-bool OpenDriveXmlParser::ReadLaneBorder(Lane* lane, TiXmlElement *node)
-{
-    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);
-
-    if (checker!=TIXML_SUCCESS)
-    {
-        cout<<"Error parsing Lane Weight attributes"<<endl;
-        return false;
-    }
-
-    lane->AddBorderRecord(sOffset,a,b,c,d);
-
-    return true;
-}
-//--------------
-
-bool OpenDriveXmlParser::ReadLaneWidth(Lane* lane, TiXmlElement *node)
-{
-	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);
-
-	if (checker!=TIXML_SUCCESS)
-	{
-		cout<<"Error parsing Lane Weight attributes"<<endl;
-		return false;
-	}
-
-	lane->AddWidthRecord(sOffset,a,b,c,d);
-
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlParser::ReadLaneRoadMark(Lane* lane, TiXmlElement *node)
-{
-	
-	double sOffset;
-	string type;
-	string weight;
-    string weightdef = "standard";
-	string color; 
-    string colordef = "white";
-	double width;
-	string laneChange;
-
-	int checker=TIXML_SUCCESS;
-	checker+=node->QueryDoubleAttribute("sOffset",&sOffset);
-	checker+=node->QueryStringAttribute("type",&type);
-    if(node->QueryStringAttribute("weight",&weight) != TIXML_SUCCESS)
-    {
-        weight = weightdef;
-    }
-//	checker+=node->QueryStringAttribute("weight",&weight);
-    if(node->QueryStringAttribute("color",&color) != TIXML_SUCCESS)
-    {
-        color = colordef;
-    }
-
-	
-	if (checker!=TIXML_SUCCESS)
-	{
-		cout<<"Error parsing Lane Weight attributes"<<endl;
-		return false;
-	}
-
-	checker+=node->QueryDoubleAttribute("width",&width);
-	if (checker!=TIXML_SUCCESS)
-	{	width=0;	}
-
-	checker=node->QueryStringAttribute("laneChange",&laneChange);
-	if (checker!=TIXML_SUCCESS)
-	{	laneChange = "both"; }
-
-	lane->AddRoadMarkRecord(sOffset,type,weight,color,width,laneChange);
-
-	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 Weight 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 Weight 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 Weight attributes"<<endl;
-		return false;
-	}
-
-	lane->AddSpeedRecord(sOffset,max);
-
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlParser::ReadLaneAccess(Lane* lane, TiXmlElement *node)
-{
-	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 Weight attributes"<<endl;
-		return false;
-	}
-
-	lane->AddAccessRecord(sOffset,restriction);
-
-	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 Weight attributes"<<endl;
-		return false;
-	}
-
-	lane->AddHeightRecord(sOffset,inner,outer);
-
-	return true;
-}
-//--------------
-
-//--------------
-
-bool OpenDriveXmlParser::ReadObjects (Road* road, TiXmlElement *node)
-{
-    TiXmlElement *subNode = node->FirstChildElement("object");
-    while (subNode)
-    {
-        ReadObject(road, subNode);
-        subNode=subNode->NextSiblingElement("object");
-    }
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlParser::ReadObjectMaterial(Object *pObject, TiXmlElement *node)
-{
-    pObject->AddObjectmaterial();
-
-    Object_material * pObject_material = pObject->GetLastAddedObjectmaterial();
-
-    string surface;
-    double friction;
-    double roughness;
-    if(node->QueryStringAttribute("surface",&surface) == TIXML_SUCCESS)
-    {
-        pObject_material->Setsurface(surface);
-    }
-
-    if(node->QueryDoubleAttribute("friction",&friction) == TIXML_SUCCESS)
-    {
-        pObject_material->Setfriction(friction);
-    }
-
-    if(node->QueryDoubleAttribute("roughness",&roughness) == TIXML_SUCCESS)
-    {
-        pObject_material->Setroughness(roughness);
-    }
-
-}
-//--------------
-bool OpenDriveXmlParser::ReadObjectRepeat(Object *pObject, TiXmlElement *node)
-{
-    double s;
-    double length;
-    double distance;
-    double tStart;
-    double tEnd;
-    double heightStart;
-    double heightEnd;
-    double zOffsetStart;
-    double zOffsetEnd;
-
-    double widthStart;
-    double widthEnd;
-    double lengthStart;
-    double lengthEnd;
-    double radiusStart;
-    double radiusEnd;
-
-    int checker=TIXML_SUCCESS;
-    checker+=node->QueryDoubleAttribute("s",&s);
-    checker+=node->QueryDoubleAttribute("length",&length);
-    checker+=node->QueryDoubleAttribute("distance",&distance);
-    checker+=node->QueryDoubleAttribute("tStart",&tStart);
-    checker+=node->QueryDoubleAttribute("tEnd",&tEnd);
-    checker+=node->QueryDoubleAttribute("heightStart",&heightStart);
-    checker+=node->QueryDoubleAttribute("heightEnd",&heightEnd);
-    checker+=node->QueryDoubleAttribute("zOffsetStart",&zOffsetStart);
-    checker+=node->QueryDoubleAttribute("zOffsetEnd",&zOffsetEnd);
-
-    if(checker != TIXML_SUCCESS)
-    {
-        cout<<"Error parsing Object repeat attributes"<<endl;
-        return false;
-    }
-
-    pObject->AddObjectrepeat(s,length,distance,tStart,tEnd,heightStart,heightEnd,zOffsetStart,zOffsetEnd);
-
-    Object_repeat * pObject_repeate = pObject->GetLastAddedObjectrepeat();
-
-    return true;
-
-    if(node->QueryDoubleAttribute("widthStart",&widthStart) == TIXML_SUCCESS)
-    {
-        pObject_repeate->SetwidthStart(widthStart);
-    }
-
-    if(node->QueryDoubleAttribute("widthEnd",&widthEnd) == TIXML_SUCCESS)
-    {
-        pObject_repeate->SetwidthEnd(widthEnd);
-    }
-
-    if(node->QueryDoubleAttribute("lengthStart",&lengthStart) == TIXML_SUCCESS)
-    {
-        pObject_repeate->SetlengthStart(lengthStart);
-    }
-
-    if(node->QueryDoubleAttribute("lengthEnd",&lengthEnd) == TIXML_SUCCESS)
-    {
-        pObject_repeate->SetlengthEnd(lengthEnd);
-    }
-
-    if(node->QueryDoubleAttribute("radiusStart",&radiusStart) == TIXML_SUCCESS)
-    {
-        pObject_repeate->SetradiusStart(radiusStart);
-    }
-
-    if(node->QueryDoubleAttribute("radiusEnd",&radiusEnd) == TIXML_SUCCESS)
-    {
-        pObject_repeate->SetradiusEnd(radiusEnd);
-    }
-
-    return true;
-
-
-}
-//--------------
-bool OpenDriveXmlParser::ReadObjectParkingSpace(Object *pObject, TiXmlElement *node)
-{
-    string access;
-    string restrictions;
-    int checker=TIXML_SUCCESS;
-    checker+=node->QueryStringAttribute("access",&access);
-    if(checker != TIXML_SUCCESS)
-    {
-        cout<<"Error parsing Object Parking Space attributes"<<endl;
-        return false;
-    }
-
-    Object_parkingSpace parkingSpace;
-    parkingSpace.Setaccess(access);
-    if(node->QueryStringAttribute("restrictions",&restrictions) == TIXML_SUCCESS)
-    {
-        parkingSpace.Setrestrictions(restrictions);
-    }
-    pObject->SetparkingSpace(parkingSpace);
-
-    return true;
-
-}
-//--------------
-
-bool OpenDriveXmlParser::ReadObject(Road *road, TiXmlElement *node)
-{
-    double t;
-    double zOffset;
-    string type;
-    double validLength;
-    string orientation;
-    string subtype;
-    string dynamic;
-    double hdg;
-    string name;
-    double pitch;
-    string id;
-    double roll;
-    double height;
-    double s;
-    double length;
-    double width;
-    double radius;
-
-    int checker=TIXML_SUCCESS;
-    checker+=node->QueryDoubleAttribute("s",&s);
-    checker+=node->QueryDoubleAttribute("t",&t);
-    checker+=node->QueryStringAttribute("id",&id);
-    checker+=node->QueryDoubleAttribute("zOffset",&zOffset);
-
-    if (checker!=TIXML_SUCCESS)
-    {
-        cout<<"Error parsing Object attributes"<<endl;
-        return false;
-    }
-
-    road->AddObject(id,s,t,zOffset);
-
-    Object * pobject = road->GetLastAddedObject();
-
-    if(node->QueryStringAttribute("type",&type) == TIXML_SUCCESS)
-    {
-        pobject->Settype(type);
-    }
-
-    if(node->QueryDoubleAttribute("validLength",&validLength) == TIXML_SUCCESS)
-    {
-        pobject->SetvalidLength(validLength);
-    }
-
-    if(node->QueryStringAttribute("orientation",&orientation) == TIXML_SUCCESS)
-    {
-        pobject->Setorientation(orientation);
-    }
-
-    if(node->QueryStringAttribute("subtype",&subtype) == TIXML_SUCCESS)
-    {
-        pobject->Setsubtype(subtype);
-    }
-
-    if(node->QueryStringAttribute("dynamic",&dynamic) == TIXML_SUCCESS)
-    {
-        pobject->Setdynamic(dynamic);
-    }
-
-    if(node->QueryDoubleAttribute("hdg",&hdg) == TIXML_SUCCESS)
-    {
-        pobject->Sethdg(hdg);
-    }
-
-    if(node->QueryStringAttribute("name",&name) == TIXML_SUCCESS)
-    {
-        pobject->Setname(name);
-    }
-
-    if(node->QueryDoubleAttribute("pitch",&pitch) == TIXML_SUCCESS)
-    {
-        pobject->Setpitch(pitch);
-    }
-
-    if(node->QueryDoubleAttribute("roll",&roll) == TIXML_SUCCESS)
-    {
-        pobject->Setroll(roll);
-    }
-
-    if(node->QueryDoubleAttribute("height",&height) == TIXML_SUCCESS)
-    {
-        pobject->Setheight(height);
-    }
-
-    if(node->QueryDoubleAttribute("length",&length) == TIXML_SUCCESS)
-    {
-        pobject->Setlength(length);
-    }
-
-    if(node->QueryDoubleAttribute("width",&width) == TIXML_SUCCESS)
-    {
-        pobject->Setwidth(width);
-    }
-
-    if(node->QueryDoubleAttribute("radius",&radius) == TIXML_SUCCESS)
-    {
-        pobject->Setradius(radius);
-    }
-
-    TiXmlElement *subNode = node->FirstChildElement("parkingSpace");
-    if (subNode)
-    {
-        ReadObjectParkingSpace(pobject, subNode);
-    }
-
-    subNode = node->FirstChildElement("repeat");
-    while (subNode)
-    {
-        ReadObjectRepeat(pobject, subNode);
-        subNode = node->FirstChildElement("repeat");
-    }
-
-    subNode = node->FirstChildElement("material");
-    while (subNode)
-    {
-        ReadObjectMaterial(pobject, subNode);
-        subNode = node->FirstChildElement("material");
-    }
-
-    return true;
-}
-
-//--------------
-
-bool OpenDriveXmlParser::ReadSignals (Road* road, TiXmlElement *node)
-{
-
-    TiXmlElement *subNode = node->FirstChildElement("signal");
-    while (subNode)
-    {
-        ReadSignal(road, subNode);
-        subNode=subNode->NextSiblingElement("signal");
-    }
-    return true;
-
-
-}
-
-bool OpenDriveXmlParser::ReadSignal(Road *road, TiXmlElement *node)
-{
-    double s;
-    double t;
-    string id;
-    string name;
-    bool dynamic;
-    string strdynamic;
-    string orientation;
-    double zOffset;
-    string type;
-    string country;
-    string countryRevision;
-    string subtype;
-    double hOffset;
-    double pitch;
-    double roll;
-    double height;
-    double width;
-
-    int checker=TIXML_SUCCESS;
-    checker+=node->QueryDoubleAttribute("s",&s);
-    checker+=node->QueryDoubleAttribute("t",&t);
-    checker+=node->QueryStringAttribute("id",&id);
-    checker+=node->QueryStringAttribute("name",&name);
-    checker+=node->QueryStringAttribute("dynamic",&strdynamic);
-    checker+=node->QueryStringAttribute("orientation",&orientation);
-    checker+=node->QueryDoubleAttribute("zOffset",&zOffset);
-    checker+=node->QueryStringAttribute("type",&type);
-    checker+=node->QueryStringAttribute("country",&country);
-    checker+=node->QueryStringAttribute("countryRevision",&countryRevision);
-    checker+=node->QueryStringAttribute("subtype",&subtype);
-    checker+=node->QueryDoubleAttribute("hOffset",&hOffset);
-    checker+=node->QueryDoubleAttribute("pitch",&pitch);
-    checker+=node->QueryDoubleAttribute("roll",&roll);
-    checker+=node->QueryDoubleAttribute("height",&height);
-    checker+=node->QueryDoubleAttribute("width",&width);
-    if (checker!=TIXML_SUCCESS)
-    {
-        cout<<"Error parsing Lane Signals attributes"<<endl;
-        return false;
-    }
-    if(strncmp(strdynamic.data(),"no",256) == 0)dynamic = false;
-    else dynamic = true;
-    road->AddSignal(s,t,id,name,dynamic,orientation,zOffset,type,country,countryRevision,subtype,hOffset,
-                    pitch,roll,height,width);
-
-    Signal * pSignal = road->GetSignal(road->GetSignalCount() - 1);
-    TiXmlElement * subNode;
-    //Proceed to Signals
-    subNode=node->FirstChildElement("validity");
-    if (subNode)
-    {
-        ReadSignal_laneValidity(pSignal, subNode);
-    }
-    subNode=node->FirstChildElement("positionInertial");
-    if(subNode)
-    {
-        ReadSignal_positionInertial(pSignal,subNode);
-    }
-    return true;
-}
-
-bool OpenDriveXmlParser::ReadSignal_laneValidity(Signal *pSignal, TiXmlElement *node)
-{
-    int fromLane;
-    int toLane;
-    int checker=TIXML_SUCCESS;
-    checker+=node->QueryIntAttribute("fromLane",&fromLane);
-    checker+=node->QueryIntAttribute("toLane",&toLane);
-    if (checker!=TIXML_SUCCESS)
-    {
-        cout<<"Error parsing laneValidity attributes"<<endl;
-        return false;
-    }
-    pSignal->SetlaneValidity(fromLane,toLane);
-    return true;
-}
-
-bool OpenDriveXmlParser::ReadSignal_positionInertial(Signal *pSignal, TiXmlElement *node)
-{
-    double x,y,z,hdg,pitch,roll;
-    int checker=TIXML_SUCCESS;
-    checker+=node->QueryDoubleAttribute("x",&x);
-    checker+=node->QueryDoubleAttribute("y",&y);
-    checker+=node->QueryDoubleAttribute("z",&z);
-    checker+=node->QueryDoubleAttribute("hdg",&hdg);
-    checker+=node->QueryDoubleAttribute("pitch",&pitch);
-    checker+=node->QueryDoubleAttribute("roll",&roll);
-    if (checker!=TIXML_SUCCESS)
-    {
-        cout<<"Error parsing positionInertial attributes"<<endl;
-        return false;
-    }
-    pSignal->SetpositionInertial(x,y,z,hdg,pitch,roll);
-    return true;
-}
-
-
-//--------------
-
-bool OpenDriveXmlParser::ReadSurface (Road* road, TiXmlElement *node)
-{
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlParser::ReadController (TiXmlElement *node)
-{	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;
-	}
-
-	mOpenDrive->AddJunction(name,id);
-	Junction* junction=mOpenDrive->GetLastJunction();
-
-	//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");
-	}
-
-
-	//Read connection parameters and add them to the lane if available
-	subNode=node->FirstChildElement("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");
-
-	while (subNode)
-	{
-		ReadJunctionController(junction, subNode);
-		subNode=subNode->NextSiblingElement("controller");
-	}
-
-
-	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;
-	}
-
-	junction->AddJunctionConnection(id,incomingRoad,connectingRoad,contactPoint);
-	JunctionConnection* junctionConnetion = junction->GetLastJunctionConnection();
-
-	TiXmlElement *subNode=node->FirstChildElement("laneLink");
-
-	while (subNode)
-	{
-		ReadJunctionConnectionLaneLink(junctionConnetion, subNode);
-		subNode=subNode->NextSiblingElement("laneLink");
-	}
-
-	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;
-}
-
-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;
-}
-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;
-}
-
-
-//---------------------------------------------------------------------------
-/**
- * Reads the data from the OpenDrive structure to a file
- */
-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;
-}
-//--------------

+ 0 - 97
src/tool/map_lanetoxodr/OpenDrive/OpenDriveXmlParser.h

@@ -1,97 +0,0 @@
-#ifndef OPENDRIVEXMLPARSER_H
-#define OPENDRIVEXMLPARSER_H
-
-#include <vector>
-#include <string>
-
-#include <iostream>
-#include <fstream>
-#include "../TinyXML/tinyxml.h"
-
-#include "OpenDrive.h"
-
-/**
- * Class used to parse an XML file and fill in the OpenDrive structure
- *
- */
-class OpenDriveXmlParser
-{
-private:
-	OpenDrive* mOpenDrive;
-public:
-	/**
-	 * Constructor which saves a reference to OpenDrive structure
-	 */
-	OpenDriveXmlParser (OpenDrive* openDriveObj);
-
-	/**
-	 * Reads the data from the OpenDrive structure to a file
-	 */
-	bool ReadFile(std::string fileName);
-
-
-	/**
-	 * The following methods are used to read the data from the XML file and fill in the the OpenDrive structure
-	 * Methods follow the hierarchical structure and are called automatically when ReadFile is executed
-	 */
-	bool ReadHeader (TiXmlElement *node);
-	bool ReadRoad (TiXmlElement *node);
-	bool ReadRoadLinks (Road* road, TiXmlElement *node);
-	bool ReadRoadLink (Road* road, TiXmlElement *node, short int type);
-	bool ReadRoadType (Road* road, TiXmlElement *node);
-	//--------------
-
-    bool ReadRoadTypeSpeed (RoadType * roadtype, TiXmlElement *node);
-
-	bool ReadPlanView(Road* road, TiXmlElement *node);
-	bool ReadGeometryBlock (Road* road, TiXmlElement *&node, short int blockType);
-	bool ReadGeometry(GeometryBlock* geomBlock, TiXmlElement *node, short int geometryType);
-	//--------------
-
-	bool ReadElevationProfile (Road* road, TiXmlElement *node);
-	bool ReadLateralProfile (Road* road, TiXmlElement *node);
-	//--------------
-
-	bool ReadLanes (Road* road, TiXmlElement *node);
-	bool ReadLaneSections (Road* road, TiXmlElement *node);
-	bool ReadLane (LaneSection* laneSection, TiXmlElement *node, short int laneType);
-	bool ReadLaneWidth(Lane* lane, TiXmlElement *node);
-	bool ReadLaneRoadMark(Lane* lane, TiXmlElement *node);
-	bool ReadLaneMaterial(Lane* lane, TiXmlElement *node);
-	bool ReadLaneVisibility(Lane* lane, TiXmlElement *node);
-	bool ReadLaneSpeed(Lane* lane, TiXmlElement *node);
-	bool ReadLaneAccess(Lane* lane, TiXmlElement *node);
-	bool ReadLaneHeight(Lane* lane, TiXmlElement *node);
-    bool ReadLaneOffsets(Road * road,TiXmlElement * node);
-    bool ReadLaneBorder(Lane* lane, TiXmlElement *node);
-	//--------------
-
-	bool ReadObjects (Road* road, TiXmlElement *node);
-    bool ReadObjectRepeat(Object * pObject,TiXmlElement *node);
-    bool ReadObjectMaterial(Object * pObject,TiXmlElement *node);
-    bool ReadObjectParkingSpace(Object * pObject,TiXmlElement *node);
-	bool ReadSignals (Road* road, TiXmlElement *node);
-    bool ReadSignal(Road * road,TiXmlElement * node);
-    bool ReadSignal_positionInertial(Signal * pSignal, TiXmlElement *node);
-    bool ReadSignal_laneValidity(Signal * pSignal,TiXmlElement * node);
-    bool ReadObject(Road * road,TiXmlElement * node);
-	//--------------
-
-	bool ReadSurface (Road* road, TiXmlElement *node);
-	//--------------
-
-	bool ReadController (TiXmlElement *node);
-	//--------------
-
-	bool ReadJunction (TiXmlElement *node);
-	bool ReadJunctionConnection (Junction* junction, TiXmlElement *node);
-	bool ReadJunctionConnectionLaneLink (JunctionConnection* junctionConnection, TiXmlElement *node);
-	//--------------
-
-	bool ReadJunctionPriority (Junction* junction, TiXmlElement *node);
-	bool ReadJunctionController (Junction* junction, TiXmlElement *node);
-	//--------------
-};
-
-
-#endif

+ 0 - 1570
src/tool/map_lanetoxodr/OpenDrive/OpenDriveXmlWriter.cpp

@@ -1,1570 +0,0 @@
-#include "OpenDriveXmlWriter.h"
-#include <iostream>
-#include <algorithm>
-//#include "windows.h"
-
-using std::cout;
-using std::endl;
-
-/**
- * Constructor which saves a reference to OpenDrive structure
- */
-OpenDriveXmlWriter::OpenDriveXmlWriter (OpenDrive* openDriveObj)
-{	
-	mOpenDrive=openDriveObj;	
-}
-
-/**
- * The following methods are used to create the XML representation of the OpenDrive structure
- * Methods follow the same hierarchical structure and are called automatically when WriteFile
- * is executed
- */
-bool OpenDriveXmlWriter::WriteHeader(TiXmlElement *node)
-{
-	//Write the Header
-	unsigned short int revMajor;
-	unsigned short int revMinor;
-	string name;
-	float version;
-	string date;
-	double north;
-	double south;
-	double east;
-	double west;
-    double lat0;
-    double lon0;
-    double hdg0;
-    string strvendor;
-
-	Header *lHeader = mOpenDrive->GetHeader();
-    lHeader->GetAllParams(revMajor, revMinor, name, version, date, north, south, east, west,lat0,lon0,hdg0);
-    lHeader->GetVendor(strvendor);
-
-	TiXmlElement *nodeHeader = new TiXmlElement("header");
-	node->LinkEndChild(nodeHeader);
-
-	nodeHeader->SetAttribute("revMajor",revMajor);
-	nodeHeader->SetAttribute("revMinor",revMinor);
-	nodeHeader->SetAttribute("name",name);
-	nodeHeader->SetDoubleAttribute("version",version);
-	nodeHeader->SetAttribute("date",date);
-
-	std::stringstream snorth;
-	snorth << setprecision(16) << setiosflags (ios_base::scientific) << north;
-	nodeHeader->SetAttribute("north",snorth.str());
-
-	std::stringstream ssouth;
-	ssouth << setprecision(16) << setiosflags (ios_base::scientific) << south;
-	nodeHeader->SetAttribute("south",ssouth.str());
-
-	std::stringstream seast;
-	seast << setprecision(16) << setiosflags (ios_base::scientific) << east;
-	nodeHeader->SetAttribute("east",seast.str());
-
-	std::stringstream swest;
-	swest << setprecision(16) << setiosflags (ios_base::scientific) << west;
-	nodeHeader->SetAttribute("west",swest.str());
-
-    std::stringstream slat0;
-    slat0 << setprecision(16) << setiosflags (ios_base::scientific) << lat0;
-    nodeHeader->SetAttribute("lat0",slat0.str());
-
-    std::stringstream slon0;
-    slon0 << setprecision(16) << setiosflags (ios_base::scientific) << lon0;
-    nodeHeader->SetAttribute("lon0",slon0.str());
-
-    std::stringstream shdg0;
-    shdg0 << setprecision(16) << setiosflags (ios_base::scientific) << hdg0;
-    nodeHeader->SetAttribute("hdg0",shdg0.str());
-
-    if(strvendor.size()>0)
-        nodeHeader->SetAttribute("vendor",strvendor);
-    else
-    {
-        nodeHeader->SetAttribute("vendor","adc");
-    }
-
-    std::string strgeoReference;
-    std::string struserData;
-    lHeader->GetgeoReference(strgeoReference);
-    lHeader->GetuserData(struserData);
-
-    if(strgeoReference != "")
-    {
-        TiXmlElement * nodegeoReference = new TiXmlElement("geoReference");
-        nodegeoReference->Parse(strgeoReference.data(),0,TIXML_ENCODING_UTF8);
-        nodeHeader->LinkEndChild(nodegeoReference);
-
-    }
-
-    if(struserData != "")
-    {
-        TiXmlElement * nodeuserData = new TiXmlElement("userData");
-        nodeuserData->Parse(struserData.data(),0,TIXML_ENCODING_UTF8);
-        nodeHeader->LinkEndChild(nodeuserData);
-
-    }
-
-
-
-
-	return true;
-}
-//--------------
-bool OpenDriveXmlWriter::WriteRoad(TiXmlElement *node, Road *road)
-{
-	//Write road attributes
-	string name;
-	double length;
-	string id;
-	string junction;
-    string rule;
-
-	name = road->GetRoadName();
-	length = road->GetRoadLength();
-	id = road->GetRoadId();
-	junction = road->GetRoadJunction();
-    rule = road->GetRoadRule();
-
-	TiXmlElement *nodeRoad = new TiXmlElement("road");
-	node->LinkEndChild(nodeRoad);
-
-	nodeRoad->SetAttribute("name",name);
-	std::stringstream slength;
-	slength << setprecision(16) << setiosflags (ios_base::scientific) << length;
-	nodeRoad->SetAttribute("length",slength.str());
-	nodeRoad->SetAttribute("id",id);
-	nodeRoad->SetAttribute("junction",junction);
-    if(rule != "")
-    {
-        nodeRoad->SetAttribute("rule",rule);
-    }
-
-	//Fill in
-
-	//Links
-	WriteRoadLinks (nodeRoad,road);
-
-	//Types
-	WriteRoadType(nodeRoad, road);
-
-	//PlanView
-	WritePlanView(nodeRoad, road);
-
-	//ElevationProfile
-	WriteElevationProfile(nodeRoad, road);
-
-	//LateralProfile
-	WriteLateralProfile(nodeRoad, road);
-
-	//Proceed to Lanes
-	WriteLanes(nodeRoad, road);
-
-
-
-
-	//Proceed to Objects
-	WriteObjects(nodeRoad, road);
-
-	//Proceed to Signals
-	WriteSignals(nodeRoad, road);
-
-	/*
-	//Proceed to Surface
-	subNode=node->FirstChildElement("surface");
-	if (subNode)
-	{
-	WriteSurface(road, subNode);
-	}
-	*/
-
-	return true;
-}
-//--------------
-
-bool  OpenDriveXmlWriter::WriteRoadLinks (TiXmlElement *node, Road* road)
-{
-	TiXmlElement* nodeLink = new TiXmlElement("link");
-	node->LinkEndChild(nodeLink);
-
-	RoadLink *lPredecessor = road->GetPredecessor();
-	if(lPredecessor)
-	{
-		TiXmlElement* nodeLinkPredecessor = new TiXmlElement("predecessor");
-		nodeLink->LinkEndChild(nodeLinkPredecessor);
-		nodeLinkPredecessor->SetAttribute("elementType", lPredecessor->GetElementType());
-		nodeLinkPredecessor->SetAttribute("elementId", lPredecessor->GetElementId());
-		nodeLinkPredecessor->SetAttribute("contactPoint", lPredecessor->GetContactPoint());
-        if(lPredecessor->GetElementS()>=0)
-        {
-            std::stringstream ss;
-            ss << setprecision(16) << setiosflags (ios_base::scientific) << lPredecessor->GetElementS();
-            nodeLinkPredecessor->SetAttribute("elementS", ss.str());
-        }
-        if(lPredecessor->GetElementDir() != "")
-        {
-            nodeLinkPredecessor->SetAttribute("elementDir",lPredecessor->GetElementDir());
-        }
-	}
-	RoadLink *lSuccessor = road->GetSuccessor();
-	if(lSuccessor)
-	{
-		TiXmlElement* nodeLinkSuccessor = new TiXmlElement("successor");
-		nodeLink->LinkEndChild(nodeLinkSuccessor);
-		nodeLinkSuccessor->SetAttribute("elementType", lSuccessor->GetElementType());
-		nodeLinkSuccessor->SetAttribute("elementId", lSuccessor->GetElementId());
-		nodeLinkSuccessor->SetAttribute("contactPoint", lSuccessor->GetContactPoint());
-        if(lSuccessor->GetElementS()>=0)
-        {
-            std::stringstream ss;
-            ss << setprecision(16) << setiosflags (ios_base::scientific) << lSuccessor->GetElementS();
-            nodeLinkSuccessor->SetAttribute("elementS", ss.str());
-        }
-        if(lSuccessor->GetElementDir() != "")
-        {
-            nodeLinkSuccessor->SetAttribute("elementDir",lSuccessor->GetElementDir());
-        }
-	}
-	RoadNeighbor *lNeighbor1 = road->GetNeighbor1();
-	if(lNeighbor1)
-	{
-		TiXmlElement* nodeLinkNeighbor1 = new TiXmlElement("neighbor");
-		nodeLink->LinkEndChild(nodeLinkNeighbor1);
-		nodeLinkNeighbor1->SetAttribute("side", lNeighbor1->GetSide());
-		nodeLinkNeighbor1->SetAttribute("elementId", lNeighbor1->GetElementId());
-		nodeLinkNeighbor1->SetAttribute("direction", lNeighbor1->GetDirection());
-	}
-	RoadNeighbor *lNeighbor2 = road->GetNeighbor2();
-	if(lNeighbor2)
-	{
-		TiXmlElement* nodeLinkNeighbor2 = new TiXmlElement("neighbor");
-		nodeLink->LinkEndChild(nodeLinkNeighbor2);
-		nodeLinkNeighbor2->SetAttribute("side", lNeighbor2->GetSide());
-		nodeLinkNeighbor2->SetAttribute("elementId", lNeighbor2->GetElementId());
-		nodeLinkNeighbor2->SetAttribute("direction", lNeighbor2->GetDirection());
-	}
-
-	return true;
-}
-
-//--------------
-
-bool OpenDriveXmlWriter::WriteRoadTypeSpeed(TiXmlElement *node, RoadType *roadtype)
-{
-    double maxSpeed;
-    string unit;
-
-    unsigned int roadTypeSpeedCount = roadtype->GetRoadTypeSpeedCount();
-    for(unsigned int i=0;i<roadTypeSpeedCount;i++)
-    {
-        RoadTypeSpeed * lRoadTypeSpeed = roadtype->GetRoadTypeSpeed(i);
-
-        maxSpeed = lRoadTypeSpeed->GetmaxSpeed();
-        unit = lRoadTypeSpeed->Getunit();
-
-        TiXmlElement * nodeRoadTypeSpeed = new TiXmlElement("speed");
-        node->LinkEndChild(nodeRoadTypeSpeed);
-
-        std::stringstream ss;
-        ss << setprecision(16) << setiosflags (ios_base::scientific) << maxSpeed;
-        nodeRoadTypeSpeed->SetAttribute("max",ss.str());
-        nodeRoadTypeSpeed->SetAttribute("unit",unit);
-    }
-
-    return true;
-}
-
-//--------------
-
-bool OpenDriveXmlWriter::WriteRoadType (TiXmlElement *node, Road* road)
-{
-	double s;
-	string type;
-
-	unsigned int roadTypeCount = road->GetRoadTypeCount();
-	for(unsigned int i=0; i<roadTypeCount; i++)
-	{
-		RoadType *lRoadType = road->GetRoadType(i);
-
-		s=lRoadType->GetS();
-		type=lRoadType->GetType();
-
-		TiXmlElement *nodeRoadType = new TiXmlElement("type");
-		node->LinkEndChild(nodeRoadType);
-
-		std::stringstream ss;
-		ss << setprecision(16) << setiosflags (ios_base::scientific) << s;
-		nodeRoadType->SetAttribute("s",ss.str());
-		nodeRoadType->SetAttribute("type",type);
-
-        WriteRoadTypeSpeed(nodeRoadType,lRoadType);
-	}
-
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WritePlanView(TiXmlElement *node, Road *road)
-{
-	TiXmlElement* nodePlanView = new TiXmlElement("planView");
-	node->LinkEndChild(nodePlanView);
-
-	unsigned int geometryCount = road->GetGeometryBlockCount();
-	for(unsigned int i=0; i<geometryCount; i++)
-	{
-		WriteGeometryBlock(nodePlanView, road->GetGeometryBlock(i));
-	}
-
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WriteGeometryBlock (TiXmlElement *node, GeometryBlock* geometryBlock)
-{
-
-	if(geometryBlock->CheckIfLine())
-	{
-
-        WriteGeometry(node, geometryBlock->GetGeometryAt(0), geometryBlock->GetGeometryAt(0)->GetGeomType());
-	}
-	else
-	{
-		WriteGeometry(node, geometryBlock->GetGeometryAt(0), 1);
-		WriteGeometry(node, geometryBlock->GetGeometryAt(1), 2);
-		WriteGeometry(node, geometryBlock->GetGeometryAt(2), 1);
-	}
-
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WriteGeometry(TiXmlElement *node, RoadGeometry* roadGeometry,  short int geometryType)
-{
-	double s, x, y, hdg, length;
-
-	s=roadGeometry->GetS();
-	x=roadGeometry->GetX();
-	y=roadGeometry->GetY();
-	hdg=roadGeometry->GetHdg();
-	length=roadGeometry->GetLength();
-
-	//Write the geometry node
-	TiXmlElement *nodeGeometry = new TiXmlElement("geometry");
-	node->LinkEndChild(nodeGeometry);
-
-	std::stringstream ss;
-	ss << setprecision(16) << setiosflags (ios_base::scientific) << s;
-	nodeGeometry->SetAttribute("s",ss.str());
-
-	std::stringstream sx;
-	sx << setprecision(16) << setiosflags (ios_base::scientific) << x;
-	nodeGeometry->SetAttribute("x",sx.str());
-
-	std::stringstream sy;
-	sy << setprecision(16) << setiosflags (ios_base::scientific) << y;
-	nodeGeometry->SetAttribute("y",sy.str());
-
-	std::stringstream shdg;
-	shdg << setprecision(16) << setiosflags (ios_base::scientific) << hdg;
-	nodeGeometry->SetAttribute("hdg",shdg.str());
-
-	std::stringstream slength;
-	slength << setprecision(16) << setiosflags (ios_base::scientific) << length;
-	nodeGeometry->SetAttribute("length",slength.str());
-
-
-	//Write the type nodes
-	switch ( geometryType )
-	{
-	case 0:	
-		{
-			//line
-			TiXmlElement *nodeLine = new TiXmlElement("line");
-			nodeGeometry->LinkEndChild(nodeLine);
-			break;
-		}
-	case 1:
-		{		
-			//spiral
-			double curvatureStart, curvatureEnd; 
-			GeometrySpiral *lSpiral=static_cast<GeometrySpiral*>(roadGeometry);
-			curvatureStart=lSpiral->GetCurvatureStart();
-			curvatureEnd=lSpiral->GetCurvatureEnd();
-
-			TiXmlElement *nodeSpiral = new TiXmlElement("spiral");
-			nodeGeometry->LinkEndChild(nodeSpiral);
-
-
-			std::stringstream scurvatureStart;
-			scurvatureStart << setprecision(16) << setiosflags (ios_base::scientific) << curvatureStart;
-			nodeSpiral->SetAttribute("curvStart",scurvatureStart.str());
-
-			std::stringstream scurvatureEnd;
-			scurvatureEnd << setprecision(16) << setiosflags (ios_base::scientific) << curvatureEnd;
-			nodeSpiral->SetAttribute("curvEnd",scurvatureEnd.str());
-			break;
-		}
-	case 2:
-		{		
-			//arc
-			double curvature;
-			GeometryArc *lArc=static_cast<GeometryArc*>(roadGeometry);
-			curvature=lArc->GetCurvature();
-
-			TiXmlElement *nodeArc = new TiXmlElement("arc");
-			nodeGeometry->LinkEndChild(nodeArc);
-
-			std::stringstream scurvature;
-			scurvature << setprecision(16) << setiosflags (ios_base::scientific) << curvature;
-			nodeArc->SetAttribute("curvature",scurvature.str());
-			break;
-		}
-	case 3:
-		{		
-			//poly3
-			break;
-		}
-
-    case 4:
-        {   //paramPoly3 add by Yu Chuli. 2019.11.1
-            double ua,ub,uc,ud,va,vb,vc,vd;
-            GeometryParamPoly3 *lpp3=static_cast<GeometryParamPoly3 *>(roadGeometry);
-
-            ua = lpp3->GetuA();
-            ub = lpp3->GetuB();
-            uc = lpp3->GetuC();
-            ud = lpp3->GetuD();
-            va = lpp3->GetvA();
-            vb = lpp3->GetvB();
-            vc = lpp3->GetvC();
-            vd = lpp3->GetvD();
-
-            TiXmlElement *nodeParamPoly3 = new TiXmlElement("paramPoly3");
-            nodeGeometry->LinkEndChild(nodeParamPoly3);
-
-            std::stringstream sua;
-            sua << setprecision(16) << setiosflags (ios_base::scientific) << ua;
-            nodeParamPoly3->SetAttribute("aU",sua.str());
-
-            std::stringstream sub;
-            sub << setprecision(16) << setiosflags (ios_base::scientific) << ub;
-            nodeParamPoly3->SetAttribute("bU",sub.str());
-
-            std::stringstream suc;
-            suc << setprecision(16) << setiosflags (ios_base::scientific) << uc;
-            nodeParamPoly3->SetAttribute("cU",suc.str());
-
-            std::stringstream sud;
-            sud << setprecision(16) << setiosflags (ios_base::scientific) << ud;
-            nodeParamPoly3->SetAttribute("dU",sud.str());
-
-            std::stringstream sva;
-            sva << setprecision(16) << setiosflags (ios_base::scientific) << va;
-            nodeParamPoly3->SetAttribute("aV",sva.str());
-
-            std::stringstream svb;
-            svb << setprecision(16) << setiosflags (ios_base::scientific) << vb;
-            nodeParamPoly3->SetAttribute("bV",svb.str());
-
-            std::stringstream svc;
-            svc << setprecision(16) << setiosflags (ios_base::scientific) << vc;
-            nodeParamPoly3->SetAttribute("cV",svc.str());
-
-            std::stringstream svd;
-            svd << setprecision(16) << setiosflags (ios_base::scientific) << vd;
-            nodeParamPoly3->SetAttribute("dV",svd.str());
-            break;
-
-        }
-	}
-
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WriteElevationProfile (TiXmlElement *node, Road* road)
-{
-	double s, a, b, c, d;
-
-	TiXmlElement* nodeElevationProfile = new TiXmlElement("elevationProfile");
-	node->LinkEndChild(nodeElevationProfile);
-
-	unsigned int lElevationCount = road->GetElevationCount();
-	for(unsigned int i=0; i<lElevationCount; i++)
-	{
-		Elevation *lElevation = road->GetElevation(i);
-		s=lElevation->GetS();
-		a=lElevation->GetA();
-		b=lElevation->GetB();
-		c=lElevation->GetC();
-		d=lElevation->GetD();
-
-		TiXmlElement *nodeElevation = new TiXmlElement("elevation");
-		nodeElevationProfile->LinkEndChild(nodeElevation);
-
-		std::stringstream ss;
-		ss << setprecision(16) << setiosflags (ios_base::scientific) << s;
-		nodeElevation->SetAttribute("s",ss.str());
-
-		std::stringstream sa;
-		sa << setprecision(16) << setiosflags (ios_base::scientific) << a;
-		nodeElevation->SetAttribute("a",sa.str());
-
-		std::stringstream sb;
-		sb << setprecision(16) << setiosflags (ios_base::scientific) << b;
-		nodeElevation->SetAttribute("b",sb.str());
-
-		std::stringstream sc;
-		sc << setprecision(16) << setiosflags (ios_base::scientific) << c;
-		nodeElevation->SetAttribute("c",sc.str());
-
-		std::stringstream sd;
-		sd << setprecision(16) << setiosflags (ios_base::scientific) << d;
-		nodeElevation->SetAttribute("d",sd.str());
-	}
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WriteLateralProfile (TiXmlElement *node, Road* road)
-{
-	double s, a, b, c, d;
-	string side;
-
-	TiXmlElement* nodeLateralProfile = new TiXmlElement("lateralProfile");
-	node->LinkEndChild(nodeLateralProfile);
-
-	unsigned int lSuperElevationCount = road->GetSuperElevationCount();
-	for(unsigned int i=0; i<lSuperElevationCount; i++)
-	{
-		SuperElevation *lSuperElevation = road->GetSuperElevation(i);
-		s=lSuperElevation->GetS();
-		a=lSuperElevation->GetA();
-		b=lSuperElevation->GetB();
-		c=lSuperElevation->GetC();
-		d=lSuperElevation->GetD();
-
-		TiXmlElement *nodeSuperElevation = new TiXmlElement("superelevation");
-		nodeLateralProfile->LinkEndChild(nodeSuperElevation);
-
-		std::stringstream ss;
-		ss << setprecision(16) << setiosflags (ios_base::scientific) << s;
-		nodeSuperElevation->SetAttribute("s",ss.str());
-
-		std::stringstream sa;
-		sa << setprecision(16) << setiosflags (ios_base::scientific) << a;
-		nodeSuperElevation->SetAttribute("a",sa.str());
-
-		std::stringstream sb;
-		sb << setprecision(16) << setiosflags (ios_base::scientific) << b;
-		nodeSuperElevation->SetAttribute("b",sb.str());
-
-		std::stringstream sc;
-		sc << setprecision(16) << setiosflags (ios_base::scientific) << c;
-		nodeSuperElevation->SetAttribute("c",sc.str());
-
-		std::stringstream sd;
-		sd << setprecision(16) << setiosflags (ios_base::scientific) << d;
-		nodeSuperElevation->SetAttribute("d",sd.str());
-	}
-
-
-	unsigned int lCrossfallCount = road->GetCrossfallCount();
-	for(unsigned int i=0; i<lCrossfallCount; i++)
-	{
-		Crossfall *lCrossfall = road->GetCrossfall(i);
-		s=lCrossfall->GetS();
-		a=lCrossfall->GetA();
-		b=lCrossfall->GetB();
-		c=lCrossfall->GetC();
-		d=lCrossfall->GetD();
-		side=lCrossfall->GetSide();
-
-		TiXmlElement *nodeCrossfall = new TiXmlElement("crossfall");
-		nodeLateralProfile->LinkEndChild(nodeCrossfall);
-
-		nodeCrossfall->SetAttribute("side",side);
-
-		std::stringstream ss;
-		ss << setprecision(16) << setiosflags (ios_base::scientific) << s;
-		nodeCrossfall->SetAttribute("s",ss.str());
-
-		std::stringstream sa;
-		sa << setprecision(16) << setiosflags (ios_base::scientific) << a;
-		nodeCrossfall->SetAttribute("a",sa.str());
-
-		std::stringstream sb;
-		sb << setprecision(16) << setiosflags (ios_base::scientific) << b;
-		nodeCrossfall->SetAttribute("b",sb.str());
-
-		std::stringstream sc;
-		sc << setprecision(16) << setiosflags (ios_base::scientific) << c;
-		nodeCrossfall->SetAttribute("c",sc.str());
-
-		std::stringstream sd;
-		sd << setprecision(16) << setiosflags (ios_base::scientific) << d;
-		nodeCrossfall->SetAttribute("d",sd.str());
-	}
-
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WriteLanes (TiXmlElement *node, Road* road)
-{
-	TiXmlElement* nodeLanes = new TiXmlElement("lanes");
-	node->LinkEndChild(nodeLanes);
-
-	unsigned int lLaneSectionCount = road->GetLaneSectionCount();
-	for(unsigned int i=0; i<lLaneSectionCount; i++)
-	{
-		WriteLaneSections(nodeLanes, road->GetLaneSection(i));
-	}
-
-    unsigned int lLaneOffsetCount = road->GetLaneOffsetCount();
-    for(unsigned int i=0; i<lLaneOffsetCount; i++)
-    {
-        WriteLaneOffset(nodeLanes, road->GetLaneOffset(i));
-    }
-
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WriteLaneSections (TiXmlElement *node, LaneSection *laneSection)
-{
-	double s;
-	s=laneSection->GetS();
-
-	TiXmlElement* nodeLaneSection = new TiXmlElement("laneSection");
-	node->LinkEndChild(nodeLaneSection);
-
-	std::stringstream ss;
-	ss << setprecision(16) << setiosflags (ios_base::scientific) << s;
-	nodeLaneSection->SetAttribute("s",ss.str());
-
-    if(laneSection->GetSingleSide() != "")
-    {
-        nodeLaneSection->SetAttribute("singleSide",laneSection->GetSingleSide());
-    }
-
-	//Fill in lane section
-	short int curType=1;
-	TiXmlElement* nodeLanesLeft=NULL;
-	if(laneSection->GetLeftLaneCount()>0)
-	{
-		nodeLanesLeft = new TiXmlElement("left");
-		nodeLaneSection->LinkEndChild(nodeLanesLeft);
-	}
-	
-	TiXmlElement* nodeLanesCenter = new TiXmlElement("center");
-	nodeLaneSection->LinkEndChild(nodeLanesCenter);
-
-	TiXmlElement* nodeLanesRight=NULL;
-	if(laneSection->GetRightLaneCount()>0)
-	{
-		nodeLanesRight = new TiXmlElement("right");
-		nodeLaneSection->LinkEndChild(nodeLanesRight);
-	}
-
-
-	unsigned int lLaneCount = laneSection->GetLaneCount();
-	for(unsigned int i=0; i<lLaneCount; i++)
-	{
-		Lane *lLane = laneSection->GetLane(i);
-		short int lType=lLane->GetSide();
-		if(lType>0 && nodeLanesLeft!=NULL)
-		{
-			WriteLane(nodeLanesLeft, lLane);
-		}
-		else if(lType==0)
-		{
-			WriteLane(nodeLanesCenter, lLane);
-		}
-		else if(lType<0 && nodeLanesRight!=NULL)
-		{
-			WriteLane(nodeLanesRight, lLane);
-		}
-	}
-
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WriteLaneOffset(TiXmlElement *node, LaneOffset *laneOffset)
-{
-    double s;
-    s=laneOffset->GetS();
-
-    TiXmlElement* nodeLaneSection = new TiXmlElement("laneOffset");
-    node->LinkEndChild(nodeLaneSection);
-
-    nodeLaneSection->SetDoubleAttribute("s",laneOffset->GetS());
-    nodeLaneSection->SetDoubleAttribute("a",laneOffset->Geta());
-    nodeLaneSection->SetDoubleAttribute("b",laneOffset->Getb());
-    nodeLaneSection->SetDoubleAttribute("c",laneOffset->Getc());
-    nodeLaneSection->SetDoubleAttribute("d",laneOffset->Getd());
-
-//    std::stringstream ss;
-//    ss << setprecision(16) << setiosflags (ios_base::scientific) << s;
-//    nodeLaneSection->SetAttribute("s",ss.str());
-
-
-//    ss << setprecision(16) << setiosflags (ios_base::scientific) << laneOffset->Geta();
-//    nodeLaneSection->SetAttribute("a",ss.str());
-
-
-//    ss << setprecision(16) << setiosflags (ios_base::scientific) << laneOffset->Getb();
-//    nodeLaneSection->SetAttribute("b",ss.str());
-
-//    ss << setprecision(16) << setiosflags (ios_base::scientific) << laneOffset->Getc();
-//    nodeLaneSection->SetAttribute("c",ss.str());
-
-//    ss << setprecision(16) << setiosflags (ios_base::scientific) << laneOffset->Getd();
-//    nodeLaneSection->SetAttribute("d",ss.str());
-
-    return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WriteLane (TiXmlElement *node, Lane* lane)
-{
-	//Write Lane attributes
-	int id;
-	string type; 
-	string level; 
-	bool boolLevel;
-	int predecessor;
-	int successor;
-
-	id=lane->GetId();
-	type=lane->GetType();
-	boolLevel=lane->GetLevel();
-	if(boolLevel) level="true";
-	else level="false";
-	predecessor=lane->GetPredecessor();
-	successor=lane->GetSuccessor();
-	
-	TiXmlElement* nodeLane = new TiXmlElement("lane");
-	node->LinkEndChild(nodeLane);
-
-	//Attributes
-	nodeLane->SetAttribute("id",id);
-	nodeLane->SetAttribute("type",type);
-	nodeLane->SetAttribute("level",level);
-	
-	//Links
-	TiXmlElement* nodeLaneLink = new TiXmlElement("link");
-	nodeLane->LinkEndChild(nodeLaneLink);
-	if(lane->IsPredecessorSet())
-	{
-		TiXmlElement* nodeLaneLinkPredecessor = new TiXmlElement("predecessor");
-		nodeLaneLink->LinkEndChild(nodeLaneLinkPredecessor);
-		nodeLaneLinkPredecessor->SetAttribute("id",predecessor);
-	}
-	if(lane->IsSuccessorSet())
-	{
-		TiXmlElement* nodeLaneLinkSuccessor = new TiXmlElement("successor");
-		nodeLaneLink->LinkEndChild(nodeLaneLinkSuccessor);
-		nodeLaneLinkSuccessor->SetAttribute("id",successor);
-	}
-
-	//Lane Width
-	unsigned int lLaneWidthCount = lane->GetLaneWidthCount();
-	for(unsigned int i=0; i<lLaneWidthCount; i++)
-	{
-		WriteLaneWidth(nodeLane, lane->GetLaneWidth(i));
-	}
-
-    //Lane Border
-    unsigned int lLaneBorderCount = lane->GetLaneBorderCount();
-    for(unsigned int i=0; i<lLaneBorderCount; i++)
-    {
-        WriteLaneBorder(nodeLane, lane->GetLaneBorder(i));
-    }
-
-	//Lane Road Mark
-	unsigned int lLaneRoadMark = lane->GetLaneRoadMarkCount();
-	for(unsigned int i=0; i<lLaneRoadMark; i++)
-	{
-		WriteLaneRoadMark(nodeLane, lane->GetLaneRoadMark(i));
-	}
-
-	//Lane Material
-	unsigned int lLaneMaterial = lane->GetLaneMaterialCount();
-	for(unsigned int i=0; i<lLaneMaterial; i++)
-	{
-		WriteLaneMaterial(nodeLane, lane->GetLaneMaterial(i));
-	}
-
-	//Lane Visibility
-	unsigned int lLaneVisibility = lane->GetLaneVisibilityCount();
-	for(unsigned int i=0; i<lLaneVisibility; i++)
-	{
-		WriteLaneVisibility(nodeLane, lane->GetLaneVisibility(i));
-	}
-
-	//Lane speed
-	unsigned int lLaneSpeed = lane->GetLaneSpeedCount();
-	for(unsigned int i=0; i<lLaneSpeed; i++)
-	{
-		WriteLaneSpeed(nodeLane, lane->GetLaneSpeed(i));
-	}
-
-	//Lane access
-	unsigned int lLaneAccess = lane->GetLaneAccessCount();
-	for(unsigned int i=0; i<lLaneAccess; i++)
-	{
-		WriteLaneAccess(nodeLane, lane->GetLaneAccess(i));
-	}
-
-	//Lane height
-	unsigned int lLaneHeight = lane->GetLaneHeightCount();
-	for(unsigned int i=0; i<lLaneHeight; i++)
-	{
-		WriteLaneHeight(nodeLane, lane->GetLaneHeight(i));
-	}
-
-    string struserData;
-    lane->GetuserData(struserData);
-    if(struserData != "")
-    {
-        TiXmlElement * nodeuserData = new TiXmlElement("userData");
-        nodeuserData->Parse(struserData.data(),0,TIXML_ENCODING_UTF8);
-        nodeLane->LinkEndChild(nodeuserData);
-
-    }
-
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WriteLaneBorder(TiXmlElement *node, LaneBorder* laneBorder)
-{
-    double sOffset, a, b, c, d;
-
-    sOffset=laneBorder->GetS();
-    a=laneBorder->GetA();
-    b=laneBorder->GetB();
-    c=laneBorder->GetC();
-    d=laneBorder->GetD();
-
-    TiXmlElement* nodeLaneBorder = new TiXmlElement("border");
-    node->LinkEndChild(nodeLaneBorder);
-
-    std::stringstream ssOffset;
-    ssOffset << setprecision(16) << setiosflags (ios_base::scientific) << sOffset;
-    nodeLaneBorder->SetAttribute("sOffset",ssOffset.str());
-
-    std::stringstream sa;
-    sa << setprecision(16) << setiosflags (ios_base::scientific) << a;
-    nodeLaneBorder->SetAttribute("a",sa.str());
-
-    std::stringstream sb;
-    sb << setprecision(16) << setiosflags (ios_base::scientific) << b;
-    nodeLaneBorder->SetAttribute("b",sb.str());
-
-    std::stringstream sc;
-    sc << setprecision(16) << setiosflags (ios_base::scientific) << c;
-    nodeLaneBorder->SetAttribute("c",sc.str());
-
-    std::stringstream sd;
-    sd << setprecision(16) << setiosflags (ios_base::scientific) << d;
-    nodeLaneBorder->SetAttribute("d",sd.str());
-
-    return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WriteLaneWidth(TiXmlElement *node, LaneWidth* laneWidth)
-{
-	double sOffset, a, b, c, d;
-
-	sOffset=laneWidth->GetS();
-	a=laneWidth->GetA();
-	b=laneWidth->GetB();
-	c=laneWidth->GetC();
-	d=laneWidth->GetD();
-
-	TiXmlElement* nodeLaneWidth = new TiXmlElement("width");
-	node->LinkEndChild(nodeLaneWidth);
-
-	std::stringstream ssOffset;
-	ssOffset << setprecision(16) << setiosflags (ios_base::scientific) << sOffset;
-	nodeLaneWidth->SetAttribute("sOffset",ssOffset.str());
-
-	std::stringstream sa;
-	sa << setprecision(16) << setiosflags (ios_base::scientific) << a;
-	nodeLaneWidth->SetAttribute("a",sa.str());
-
-	std::stringstream sb;
-	sb << setprecision(16) << setiosflags (ios_base::scientific) << b;
-	nodeLaneWidth->SetAttribute("b",sb.str());
-
-	std::stringstream sc;
-	sc << setprecision(16) << setiosflags (ios_base::scientific) << c;
-	nodeLaneWidth->SetAttribute("c",sc.str());
-
-	std::stringstream sd;
-	sd << setprecision(16) << setiosflags (ios_base::scientific) << d;
-	nodeLaneWidth->SetAttribute("d",sd.str());
-
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WriteLaneRoadMark(TiXmlElement *node, LaneRoadMark* laneRoadMark)
-{
-
-	double sOffset;
-	string type;
-	string weight;
-	string color; 
-	double width;
-	string laneChange;
-
-	sOffset=laneRoadMark->GetS();
-	type=laneRoadMark->GetType();
-	weight=laneRoadMark->GetWeight();
-	color=laneRoadMark->GetColor();
-	width=laneRoadMark->GetWidth();
-	laneChange=laneRoadMark->GetLaneChange();
-
-	TiXmlElement* nodeLaneRoadMark = new TiXmlElement("roadMark");
-	node->LinkEndChild(nodeLaneRoadMark);
-
-	std::stringstream ssOffset;
-	ssOffset << setprecision(16) << setiosflags (ios_base::scientific) << sOffset;
-	nodeLaneRoadMark->SetAttribute("sOffset",ssOffset.str());
-	nodeLaneRoadMark->SetAttribute("type",type);
-	nodeLaneRoadMark->SetAttribute("weight",weight);
-	nodeLaneRoadMark->SetAttribute("color",color);
-
-	std::stringstream swidth;
-	swidth << setprecision(16) << setiosflags (ios_base::scientific) << width;
-	nodeLaneRoadMark->SetAttribute("width",swidth.str());
-	nodeLaneRoadMark->SetAttribute("laneChange",laneChange);
-
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WriteLaneMaterial(TiXmlElement *node, LaneMaterial* laneMaterial)
-{
-	double sOffset;
-	string surface;
-	double friction;
-	double roughness;
-
-	sOffset=laneMaterial->GetS();
-	surface=laneMaterial->GetSurface();
-	friction=laneMaterial->GetFriction();
-	roughness=laneMaterial->GetRoughness();
-
-	TiXmlElement* nodeLaneMaterial = new TiXmlElement("material");
-	node->LinkEndChild(nodeLaneMaterial);
-
-	std::stringstream ssOffset;
-	ssOffset << setprecision(16) << setiosflags (ios_base::scientific) << sOffset;
-	nodeLaneMaterial->SetAttribute("sOffset",ssOffset.str());
-	nodeLaneMaterial->SetAttribute("surface",surface);
-
-	std::stringstream sfriction;
-	sfriction << setprecision(16) << setiosflags (ios_base::scientific) << friction;
-	nodeLaneMaterial->SetAttribute("friction",sfriction.str());
-
-	std::stringstream sroughness;
-	sroughness << setprecision(16) << setiosflags (ios_base::scientific) << roughness;
-	nodeLaneMaterial->SetAttribute("roughness",sroughness.str());
-
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WriteLaneVisibility(TiXmlElement *node, LaneVisibility* laneVisibility)
-{
-	double sOffset;
-	double forward;
-	double back;
-	double left;
-	double right;
-
-	sOffset=laneVisibility->GetS();
-	forward=laneVisibility->GetForward();
-	back=laneVisibility->GetBack();
-	left=laneVisibility->GetLeft();
-	right=laneVisibility->GetRight();
-
-	TiXmlElement* nodeLaneVisibility = new TiXmlElement("visibility");
-	node->LinkEndChild(nodeLaneVisibility);
-
-	std::stringstream ssOffset;
-	ssOffset << setprecision(16) << setiosflags (ios_base::scientific) << sOffset;
-	nodeLaneVisibility->SetAttribute("sOffset",ssOffset.str());
-
-	std::stringstream sforward;
-	sforward << setprecision(16) << setiosflags (ios_base::scientific) << forward;
-	nodeLaneVisibility->SetAttribute("forward",sforward.str());
-
-	std::stringstream sback;
-	sback << setprecision(16) << setiosflags (ios_base::scientific) << back;
-	nodeLaneVisibility->SetAttribute("back",sback.str());
-
-	std::stringstream sleft;
-	sleft << setprecision(16) << setiosflags (ios_base::scientific) << left;
-	nodeLaneVisibility->SetAttribute("left",sleft.str());
-
-	std::stringstream sright;
-	sright << setprecision(16) << setiosflags (ios_base::scientific) << right;
-	nodeLaneVisibility->SetAttribute("right",sright.str());
-
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WriteLaneSpeed(TiXmlElement *node, LaneSpeed* laneSpeed)
-{	
-	double sOffset;
-	double max;
-
-	sOffset=laneSpeed->GetS();
-	max=laneSpeed->GetMax();
-
-	TiXmlElement* nodeLaneSpeed = new TiXmlElement("speed");
-	node->LinkEndChild(nodeLaneSpeed);
-
-	std::stringstream ssOffset;
-	ssOffset << setprecision(16) << setiosflags (ios_base::scientific) << sOffset;
-	nodeLaneSpeed->SetAttribute("sOffset",ssOffset.str());
-
-	std::stringstream smax;
-	smax << setprecision(16) << setiosflags (ios_base::scientific) << max;
-	nodeLaneSpeed->SetAttribute("max",smax.str());
-
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WriteLaneAccess(TiXmlElement *node, LaneAccess* laneAccess)
-{
-	double sOffset;
-	string restriction;
-
-	sOffset=laneAccess->GetS();
-	restriction=laneAccess->GetRestriction();
-
-	TiXmlElement* nodeLaneAccess = new TiXmlElement("access");
-	node->LinkEndChild(nodeLaneAccess);
-
-	std::stringstream ssOffset;
-	ssOffset << setprecision(16) << setiosflags (ios_base::scientific) << sOffset;
-	nodeLaneAccess->SetAttribute("sOffset",ssOffset.str());
-	nodeLaneAccess->SetAttribute("restriction",restriction);
-
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WriteLaneHeight(TiXmlElement *node, LaneHeight* laneHeight)
-{
-	double sOffset;
-	double inner;
-	double outer;
-
-	sOffset=laneHeight->GetS();
-	inner=laneHeight->GetInner();
-	outer=laneHeight->GetOuter();
-
-	TiXmlElement* nodeLaneHeight = new TiXmlElement("height");
-	node->LinkEndChild(nodeLaneHeight);
-
-	std::stringstream ssOffset;
-	ssOffset << setprecision(16) << setiosflags (ios_base::scientific) << sOffset;
-	nodeLaneHeight->SetAttribute("sOffset",ssOffset.str());
-
-	std::stringstream sinner;
-	sinner << setprecision(16) << setiosflags (ios_base::scientific) << inner;
-	nodeLaneHeight->SetAttribute("inner",sinner.str());
-
-	std::stringstream souter;
-	souter << setprecision(16) << setiosflags (ios_base::scientific) << outer;
-	nodeLaneHeight->SetAttribute("outer",souter.str());
-	
-	return true;
-}
-//--------------
-
-//--------------
-
-bool OpenDriveXmlWriter::WriteObjects (TiXmlElement *node, Road* road)
-{
-	TiXmlElement* nodeObjects = new TiXmlElement("objects");
-	node->LinkEndChild(nodeObjects);
-
-    unsigned int lObjectCount = road->GetObjectCount();
-    for(unsigned int i=0; i<lObjectCount; i++)
-    {
-        WriteObject(nodeObjects, road->GetObject(i));
-    }
-
-	return true;
-}
-//--------------
-bool OpenDriveXmlWriter::WriteObject(TiXmlElement *node, Object *pObject)
-{
-    TiXmlElement* nodeObject = new TiXmlElement("object");
-    node->LinkEndChild(nodeObject);
-
-    nodeObject->SetDoubleAttribute("t",pObject->Gett());
-    nodeObject->SetDoubleAttribute("zOffset",pObject->GetzOffset());
-    if(pObject->Gettype() != "")
-    {
-        nodeObject->SetAttribute("type",pObject->Gettype());
-    }
-    double validLength;
-    if(pObject->GetvalidLength(validLength) == 1)
-    {
-        nodeObject->SetDoubleAttribute("validLength",validLength);
-    }
-    if(pObject->Getorientation() != "")
-    {
-        nodeObject->SetAttribute("orientation",pObject->Getorientation());
-    }
-    if(pObject->Getsubtype() != "")
-    {
-        nodeObject->SetAttribute("subtype",pObject->Getsubtype());
-    }
-    if(pObject->Getdynamic() != "")
-    {
-        nodeObject->SetAttribute("dynamic",pObject->Getdynamic());
-    }
-    double hdg;
-    if(pObject->Gethdg(hdg) == 1)
-    {
-        nodeObject->SetDoubleAttribute("hdg",hdg);
-    }
-    if(pObject->Getname() != "")
-    {
-        nodeObject->SetAttribute("name",pObject->Getname());
-    }
-    double pitch;
-    if(pObject->Getpitch(pitch) == 1)
-    {
-        nodeObject->SetDoubleAttribute("pitch",pitch);
-    }
-    nodeObject->SetAttribute("id",pObject->Getid());
-    double roll;
-    if(pObject->Getroll(roll) == 1)
-    {
-        nodeObject->SetDoubleAttribute("roll",roll);
-    }
-    double height;
-    if(pObject->Getheight(height) == 1)
-    {
-        nodeObject->SetDoubleAttribute("height",height);
-    }
-    nodeObject->SetDoubleAttribute("s",pObject->Gets());
-    double length;
-    if(pObject->Getlength(length) == 1)
-    {
-        nodeObject->SetDoubleAttribute("length",length);
-    }
-    double width;
-    if(pObject->Getwidth(width) == 1)
-    {
-        nodeObject->SetDoubleAttribute("width",width);
-    }
-    double radius;
-    if(pObject->Getradius(radius) == 1)
-    {
-        nodeObject->SetDoubleAttribute("radius",radius);
-    }
-
-    Object_parkingSpace parkingSpace;
-    if(pObject->GetparkingSpace(parkingSpace) == 1)
-    {
-        WriteObjectParkingSpace(nodeObject,&parkingSpace);
-    }
-
-    unsigned int i;
-
-    unsigned nrepeatcount = pObject->GetObjectrepeatCount();
-    for(i=0;i<nrepeatcount;i++)
-    {
-        Object_repeat * pObject_repeat = pObject->GetObjectrepeat(i);
-        WriteObjectrepeat(nodeObject,pObject_repeat);
-    }
-
-    unsigned nmaterialcount = pObject->GetObjectmaterialCount();
-    for(i=0;i<nmaterialcount;i++)
-    {
-        Object_material * pObject_material = pObject->GetObjectmaterial(i);
-        WriteObjectMaterial(nodeObject,pObject_material);
-    }
-
-    return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WriteObjectrepeat(TiXmlElement * node,Object_repeat * pObject_repeat)
-{
-    double s;
-    double length;
-    double distance;
-    double tStart;
-    double tEnd;
-    double heightStart;
-    double heightEnd;
-    double zOffsetStart;
-    double zOffsetEnd;
-
-    double widthStart;
-    double widthEnd;
-    double lengthStart;
-    double lengthEnd;
-    double radiusStart;
-    double radiusEnd;
-
-    s = pObject_repeat->Gets();
-    length = pObject_repeat->Getlength();
-    distance = pObject_repeat->Getdistance();
-    tStart = pObject_repeat->GettStart();
-    tEnd = pObject_repeat->GettEnd();
-    heightStart = pObject_repeat->GetheightStart();
-    heightEnd = pObject_repeat->GetheightEnd();
-    zOffsetStart = pObject_repeat->GetzOffsetStart();
-    zOffsetEnd = pObject_repeat->GetzOffsetEnd();
-
-    TiXmlElement* nodeObjectRepeat = new TiXmlElement("repeat");
-    node->LinkEndChild(nodeObjectRepeat);
-    nodeObjectRepeat->SetDoubleAttribute("s",s);
-    nodeObjectRepeat->SetDoubleAttribute("length",length);
-    nodeObjectRepeat->SetDoubleAttribute("distance",distance);
-    nodeObjectRepeat->SetDoubleAttribute("tStart",tStart);
-    nodeObjectRepeat->SetDoubleAttribute("tEnd",tEnd);
-    nodeObjectRepeat->SetDoubleAttribute("heightStart",heightStart);
-    nodeObjectRepeat->SetDoubleAttribute("heightEnd",heightEnd);
-    nodeObjectRepeat->SetDoubleAttribute("zOffsetStart",zOffsetStart);
-    nodeObjectRepeat->SetDoubleAttribute("zOffsetEnd",zOffsetEnd);
-
-    if(pObject_repeat->GetwidthStart(widthStart) == 1)
-    {
-        nodeObjectRepeat->SetDoubleAttribute("widthStart",widthStart);
-    }
-    if(pObject_repeat->GetwidthEnd(widthEnd) == 1)
-    {
-        nodeObjectRepeat->SetDoubleAttribute("widthEnd",widthEnd);
-    }
-    if(pObject_repeat->GetlengthStart(lengthStart) == 1)
-    {
-        nodeObjectRepeat->SetDoubleAttribute("lengthStart",lengthStart);
-    }
-    if(pObject_repeat->GetlengthEnd(lengthEnd) == 1)
-    {
-        nodeObjectRepeat->SetDoubleAttribute("lengthEnd",lengthEnd);
-    }
-    if(pObject_repeat->GetradiusStart(radiusStart) == 1)
-    {
-        nodeObjectRepeat->SetDoubleAttribute("radiusStart",radiusStart);
-    }
-    if(pObject_repeat->GetradiusEnd(radiusEnd) == 1)
-    {
-        nodeObjectRepeat->SetDoubleAttribute("radiusEnd",radiusEnd);
-    }
-    return true;
-}
-//--------------
-bool OpenDriveXmlWriter::WriteObjectMaterial(TiXmlElement * node,Object_material * pObject_material)
-{
-    TiXmlElement* nodeObjectMaterial = new TiXmlElement("material");
-    node->LinkEndChild(nodeObjectMaterial);
-    string surface;
-    double friction;
-    double roughness;
-    if(pObject_material->Getsurface(surface) == 1)
-    {
-       nodeObjectMaterial->SetAttribute("surface",surface);
-    }
-    if(pObject_material->Getfriction(friction) == 1)
-    {
-       nodeObjectMaterial->SetDoubleAttribute("friction",friction);
-    }
-    if(pObject_material->Getroughness(roughness) == 1)
-    {
-       nodeObjectMaterial->SetDoubleAttribute("roughness",roughness);
-    }
-    return true;
-}
-
-//--------------
-bool OpenDriveXmlWriter::WriteObjectParkingSpace(TiXmlElement *node, Object_parkingSpace *pObject_parkingSpace)
-{
-    TiXmlElement* nodeObjectParkingSpace = new TiXmlElement("parkingSpace");
-    node->LinkEndChild(nodeObjectParkingSpace);
-    nodeObjectParkingSpace->SetAttribute("access",pObject_parkingSpace->Getaccess());
-    if(pObject_parkingSpace->Getrestrictions() != "")
-    {
-       nodeObjectParkingSpace->SetAttribute("restrictions",pObject_parkingSpace->Getrestrictions());
-    }
-    return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WriteSignals (TiXmlElement *node, Road* road)
-{
-	TiXmlElement* nodeSignals = new TiXmlElement("signals");
-	node->LinkEndChild(nodeSignals);
-
-    unsigned int lSignalSectionCount = road->GetSignalCount();
-    for(unsigned int i=0; i<lSignalSectionCount; i++)
-    {
-        WriteSignal(nodeSignals, road->GetSignal(i));
-    }
-
-	return true;
-}
-
-bool OpenDriveXmlWriter::WriteSignal(TiXmlElement *node, Signal * pSignal)
-{
-    TiXmlElement* nodeSignal = new TiXmlElement("signal");
-    node->LinkEndChild(nodeSignal);
-
-    nodeSignal->SetDoubleAttribute("s",pSignal->Gets());
-    nodeSignal->SetDoubleAttribute("t",pSignal->Gett());
-    nodeSignal->SetAttribute("id",pSignal->Getid());
-    nodeSignal->SetAttribute("name",pSignal->Getname());
-    if(pSignal->Getdynamic() == true)
-    nodeSignal->SetAttribute("dynamic","yes");
-    else
-        nodeSignal->SetAttribute("dynamic","no");
-    nodeSignal->SetAttribute("orientation",pSignal->Getorientation());
-    nodeSignal->SetDoubleAttribute("zOffset",pSignal->GetzOffset());
-    nodeSignal->SetAttribute("type",pSignal->Gettype());
-    nodeSignal->SetAttribute("country",pSignal->Getcountry());
-    nodeSignal->SetAttribute("countryRevision",pSignal->GetcountryRevision());
-    nodeSignal->SetAttribute("subtype",pSignal->Getsubtype());
-    nodeSignal->SetDoubleAttribute("hOffset",pSignal->GethOffset());
-    nodeSignal->SetDoubleAttribute("pitch",pSignal->Getpitch());
-    nodeSignal->SetDoubleAttribute("roll",pSignal->Getroll());
-    nodeSignal->SetDoubleAttribute("height",pSignal->Getheight());
-    nodeSignal->SetDoubleAttribute("width",pSignal->Getwidth());
-
-    signal_laneValidity * psignal_lanevalidity = pSignal->GetlaneValidity();
-    if(psignal_lanevalidity != 0)
-    {
-        WriteSignal_laneValidity(nodeSignal,psignal_lanevalidity);
-    }
-
-    signal_positionInertial * psignal_positionInertial = pSignal->GetpositionInertial();
-    if(psignal_positionInertial != 0)
-    {
-        WriteSignal_positionInertial(nodeSignal,psignal_positionInertial);
-    }
-
-    return true;
-}
-
-bool OpenDriveXmlWriter::WriteSignal_positionInertial(TiXmlElement *node, signal_positionInertial *pSignal_positionInertial)
-{
-    TiXmlElement* nodepositionInertial = new TiXmlElement("positionInertial");
-
-    node->LinkEndChild(nodepositionInertial);
-
-    nodepositionInertial->SetAttribute("x",pSignal_positionInertial->Getx());
-    nodepositionInertial->SetAttribute("y",pSignal_positionInertial->Gety());
-    nodepositionInertial->SetAttribute("z",pSignal_positionInertial->Getz());
-    nodepositionInertial->SetAttribute("hdg",pSignal_positionInertial->Gethdg());
-    nodepositionInertial->SetAttribute("pitch",pSignal_positionInertial->Getpitch());
-    nodepositionInertial->SetAttribute("roll",pSignal_positionInertial->Getroll());
-
-    return true;
-}
-
-bool OpenDriveXmlWriter::WriteSignal_laneValidity(TiXmlElement *node, signal_laneValidity *pSignal_laneValidity)
-{
-    TiXmlElement* nodelaneValidity = new TiXmlElement("validity");
-
-    node->LinkEndChild(nodelaneValidity);
-
-    nodelaneValidity->SetAttribute("fromLane",pSignal_laneValidity->GetfromLane());
-    nodelaneValidity->SetAttribute("toLane",pSignal_laneValidity->GettoLane());
-
-    return true;
-}
-
-//--------------
-
-bool OpenDriveXmlWriter::WriteSurface (TiXmlElement *node, Road* road)
-{
-	return true;
-}
-//--------------
-
-bool OpenDriveXmlWriter::WriteController (TiXmlElement *node)
-{	return true;	}
-//--------------
-
-bool OpenDriveXmlWriter::WriteJunction (TiXmlElement *node, Junction *junction)
-{
-	string name;
-	string id;
-
-	name = junction->GetName();
-	id = junction->GetId();
-
-	TiXmlElement *nodeJunction = new TiXmlElement("junction");
-	node->LinkEndChild(nodeJunction);
-
-	nodeJunction->SetAttribute("name",name);
-	nodeJunction->SetAttribute("id",id);
-
-	//Connections
-	WriteJunctionConnection(nodeJunction, junction);
-
-	//Priorities
-	WriteJunctionPriority(nodeJunction, junction);
-
-	//Controllers
-	WriteJunctionController(nodeJunction, junction);
-
-	return true;
-}
-//--------------
-bool OpenDriveXmlWriter::WriteJunctionConnection (TiXmlElement *node, Junction* junction)
-{
-	string id;
-	string incomingRoad;
-	string connectingRoad;
-	string contactPoint;
-
-	unsigned int junctionConnectionCount = junction->GetJunctionConnectionCount();
-	for(unsigned int i=0; i<junctionConnectionCount; i++)
-	{
-		JunctionConnection *lJunctionConnection = junction->GetJunctionConnection(i);
-
-		id = lJunctionConnection->GetId();
-		incomingRoad = lJunctionConnection->GetIncomingRoad();
-		connectingRoad = lJunctionConnection->GetConnectingRoad();
-		contactPoint = lJunctionConnection->GetContactPoint();
-
-		TiXmlElement *nodeJunctionConnection = new TiXmlElement("connection");
-		node->LinkEndChild(nodeJunctionConnection);
-
-		nodeJunctionConnection->SetAttribute("id",id);
-		nodeJunctionConnection->SetAttribute("incomingRoad",incomingRoad);
-		nodeJunctionConnection->SetAttribute("connectingRoad",connectingRoad);
-		nodeJunctionConnection->SetAttribute("contactPoint",contactPoint);
-
-		//Lane links
-		WriteJunctionConnectionLaneLink(nodeJunctionConnection, lJunctionConnection);
-	}
-
-	return true;
-}
-bool OpenDriveXmlWriter::WriteJunctionConnectionLaneLink (TiXmlElement *node, JunctionConnection* junctionConnection)
-{
-	int from;
-	int to;
-	
-	unsigned int junctionLaneLinkCount = junctionConnection->GetJunctionLaneLinkCount();
-	for(unsigned int i=0; i<junctionLaneLinkCount; i++)
-	{
-		JunctionLaneLink *lJunctionLaneLink = junctionConnection->GetJunctionLaneLink(i);
-
-		from = lJunctionLaneLink->GetFrom();
-		to = lJunctionLaneLink->GetTo();
-
-		TiXmlElement *nodeJunctionLaneLink = new TiXmlElement("laneLink");
-		node->LinkEndChild(nodeJunctionLaneLink);
-
-		nodeJunctionLaneLink->SetAttribute("from",from);
-		nodeJunctionLaneLink->SetAttribute("to",to);
-	}
-	return true;
-}
-
-bool OpenDriveXmlWriter::WriteJunctionPriority (TiXmlElement *node, Junction* junction)
-{
-	string high;
-	string low;
-
-	unsigned int junctionPriorityCount = junction->GetJunctionPriorityCount();
-	for(unsigned int i=0; i<junctionPriorityCount; i++)
-	{
-		JunctionPriorityRoad *lJunctionPriority = junction->GetJunctionPriority(i);
-
-		high = lJunctionPriority->GetHigh();
-		low = lJunctionPriority->GetLow();
-
-		TiXmlElement *nodeJunctionPriority = new TiXmlElement("priority");
-		node->LinkEndChild(nodeJunctionPriority);
-
-		nodeJunctionPriority->SetAttribute("high",high);
-		nodeJunctionPriority->SetAttribute("low",low);
-	}
-
-	return true;
-}
-bool OpenDriveXmlWriter::WriteJunctionController (TiXmlElement *node, Junction* junction)
-{
-	string id;
-	string type;
-
-	unsigned int junctionControllerCount = junction->GetJunctionControllerCount();
-	for(unsigned int i=0; i<junctionControllerCount; i++)
-	{
-		JunctionController *lJunctionController = junction->GetJunctionController(i);
-
-		id = lJunctionController->GetId();
-		type = lJunctionController->GetType();
-
-		TiXmlElement *nodeJunctionController = new TiXmlElement("controller");
-		node->LinkEndChild(nodeJunctionController);
-
-		nodeJunctionController->SetAttribute("id",id);
-		nodeJunctionController->SetAttribute("type",type);
-	}
-	return true;
-}
-
-
-//---------------------------------------------------------------------------
-
-/**
- * Writes the data from the OpenDrive structure to a file
- */
-bool OpenDriveXmlWriter::WriteFile(std::string fileName)
-{
-	// XML document
-	TiXmlDocument doc;
-
-	TiXmlDeclaration* decl = new TiXmlDeclaration( "1.0", "", "" );  
-	doc.LinkEndChild( decl );
-
-	TiXmlElement *rootNode = new TiXmlElement("OpenDRIVE");
-	doc.LinkEndChild(rootNode);
-
-	// Write header
-	WriteHeader(rootNode);
-
-	// Write roads
-	unsigned int roadCount = mOpenDrive->GetRoadCount();
-	for(unsigned int i=0; i<roadCount; i++)
-	{
-		WriteRoad(rootNode, mOpenDrive->GetRoad(i));
-	}
-
-	// Write junctions
-	unsigned int junctionCount = mOpenDrive->GetJunctionCount();
-	for(unsigned int i=0; i<junctionCount; i++)
-	{
-		WriteJunction(rootNode, mOpenDrive->GetJunction(i));
-	}
-
-	// Saves the XML structure to the file
-	doc.SaveFile( fileName ); 
-
-	return true;
-
-}
-//--------------

+ 0 - 98
src/tool/map_lanetoxodr/OpenDrive/OpenDriveXmlWriter.h

@@ -1,98 +0,0 @@
-#ifndef OPENDRIVEXMLWRITER_H
-#define OPENDRIVEXMLWRITER_H
-
-#include <vector>
-#include <string>
-
-#include <iostream>
-#include <iomanip>
-using namespace std;
-#include <fstream>
-#include "../TinyXML/tinyxml.h"
-
-#include "OpenDrive.h"
-
-/**
- * Class used to write the content of the OpenDrive structure to the file
- *
- */
-class OpenDriveXmlWriter
-{
-private:
-	OpenDrive* mOpenDrive;
-public:
-	/**
-	 * Constructor which saves a reference to OpenDrive structure
-	 */
-	OpenDriveXmlWriter (OpenDrive* openDriveObj);
-
-	/**
-	 * Writes the data from the OpenDrive structure to a file
-	 */
-	bool WriteFile(std::string fileName);
-	
-	/**
-	 * The following methods are used to create the XML representation of the OpenDrive structure
-	 * Methods follow the same hierarchical structure and are called automatically when WriteFile
-	 * is executed
-	 */
-	bool WriteHeader (TiXmlElement *node);
-	bool WriteRoad (TiXmlElement *node, Road *road);
-	bool WriteRoadLinks (TiXmlElement *node, Road* road);
-	bool WriteRoadType (TiXmlElement *node, Road* road);
-	//--------------
-
-    bool WriteRoadTypeSpeed(TiXmlElement * node,RoadType * roadtype);
-
-	bool WritePlanView(TiXmlElement *node, Road* road);
-	bool WriteGeometryBlock (TiXmlElement *node, GeometryBlock *geometryBlock);
-	bool WriteGeometry(TiXmlElement *node, RoadGeometry* roadGeometry, short int geometryType);
-	//--------------
-
-	bool WriteElevationProfile (TiXmlElement *node, Road* road);
-	bool WriteLateralProfile (TiXmlElement *node, Road* road);
-	//--------------
-
-	bool WriteLanes (TiXmlElement *node, Road* road);
-	bool WriteLaneSections (TiXmlElement *node, LaneSection *laneSection);
-	bool WriteLane (TiXmlElement *node, Lane* lane);
-	bool WriteLaneWidth(TiXmlElement *node, LaneWidth* laneWidth);
-	bool WriteLaneRoadMark(TiXmlElement *node, LaneRoadMark* laneRoadMark);
-	bool WriteLaneMaterial(TiXmlElement *node, LaneMaterial* laneMaterial);
-	bool WriteLaneVisibility(TiXmlElement *node, LaneVisibility* laneVisibility);
-	bool WriteLaneSpeed(TiXmlElement *node, LaneSpeed* laneSpeed);
-	bool WriteLaneAccess(TiXmlElement *node, LaneAccess* laneAccess);
-	bool WriteLaneHeight(TiXmlElement *node, LaneHeight* laneHeight);
-    bool WriteLaneOffset (TiXmlElement *node, LaneOffset *laneOffset);
-    bool WriteLaneBorder(TiXmlElement *node, LaneBorder* laneWidth);
-	//--------------
-
-	bool WriteObjects (TiXmlElement *node, Road* road);
-    bool WriteObject(TiXmlElement * node, Object * pObject);
-    bool WriteObjectParkingSpace(TiXmlElement * node,Object_parkingSpace * pObject_parkingSpace);
-    bool WriteObjectrepeat(TiXmlElement * node,Object_repeat * pObject_repeat);
-    bool WriteObjectMaterial(TiXmlElement * node,Object_material * pObject_material);
-	bool WriteSignals (TiXmlElement *node, Road* road);
-    bool WriteSignal(TiXmlElement * node, Signal * pSignal);
-    bool WriteSignal_positionInertial(TiXmlElement * node, signal_positionInertial * pSignal_positionInertial);
-    bool WriteSignal_laneValidity(TiXmlElement * node, signal_laneValidity * pSignal_laneValidity);
-	//--------------
-
-	bool WriteSurface (TiXmlElement *node, Road* road);
-	//--------------
-
-	bool WriteController (TiXmlElement *node);
-	//--------------
-
-	bool WriteJunction (TiXmlElement *node, Junction *junction);
-	bool WriteJunctionConnection (TiXmlElement *node, Junction* junction);
-	bool WriteJunctionConnectionLaneLink (TiXmlElement *node, JunctionConnection* junctionConnection);
-	//--------------
-
-	bool WriteJunctionPriority (TiXmlElement *node, Junction* junction);
-	bool WriteJunctionController (TiXmlElement *node, Junction* junction);
-	//--------------
-};
-
-
-#endif

+ 0 - 90
src/tool/map_lanetoxodr/OpenDrive/OtherStructures.cpp

@@ -1,90 +0,0 @@
-#include "OtherStructures.h"
-
-//***********************************************************************************
-//Polynom of third order
-//***********************************************************************************
-/**
- * Constructor that initializes the polynom with base properties
- * 
- * @param s S offset
- * @param a A parameter of the polynom
- * @param b B parameter of the polynom
- * @param c C parameter of the polynom
- * @param d D parameter of the polynom
- */
-ThirdOrderPolynom::ThirdOrderPolynom (double s, double a, double b, double c, double d)
-{	
-	mS=s; mA=a; mB=b; mC=c; mD=d;	
-}
-
-/**
- * Getters for base properties
- */	
-double ThirdOrderPolynom::GetS()
-{
-	return mS;
-}
-double ThirdOrderPolynom::GetA()
-{
-	return mA;
-}
-double ThirdOrderPolynom::GetB()
-{
-	return mB;
-}
-double ThirdOrderPolynom::GetC()
-{
-	return mC;
-}
-
-double ThirdOrderPolynom::GetD()
-{
-	return mD;
-}
-
-/**
- * Setters for base properties
- */
-void ThirdOrderPolynom::SetS(double s)
-{
-	mS=s;
-}
-void ThirdOrderPolynom::SetA(double a)
-{
-	mA=a;
-}
-void ThirdOrderPolynom::SetB(double b)
-{
-	mB=b;
-}
-void ThirdOrderPolynom::SetC(double c)
-{
-	mC=c;
-}
-void ThirdOrderPolynom::SetD(double d)
-{
-	mD=d;
-}
-
-
-/**
- * Method to check if sample S is inside the record interval
- */	
-bool ThirdOrderPolynom::CheckInterval (double s_check)
-{
-	if (s_check>=mS)
-		return true;
-	else 
-		return false;
-}
-
-/**
- * Returns the value at sample S
- */	
-double ThirdOrderPolynom::GetValue(double s_check)
-{
-	double ds = s_check-mS;
-	double value = mA+ mB*ds+ mC*ds*ds + mD*ds*ds*ds;
-	return value;
-}
-//----------------------------------------------------------------------------------

+ 0 - 66
src/tool/map_lanetoxodr/OpenDrive/OtherStructures.h

@@ -1,66 +0,0 @@
-#ifndef OTHERSTRUCTURES_H
-#define OTHERSTRUCTURES_H
-#include <string>
-using std::string;
-
-/**
- * Polynom of third order
- *
- */
-class ThirdOrderPolynom
-{
-protected:
-	double mS;
-	double mA;
-	double mB;
-	double mC;
-	double mD;
-public:
-	/**
-	 * Constructor that initializes the polynom with base properties
-	 * 
-	 * @param s S offset
-	 * @param a A parameter of the polynom
-	 * @param b B parameter of the polynom
-	 * @param c C parameter of the polynom
-	 * @param d D parameter of the polynom
-	 */
-	ThirdOrderPolynom (double s, double a, double b, double c, double d);
-	
-
-	/**
-	 * Setters for base properties
-	 */	
-	void SetS(double s);
-	void SetA(double a);
-	void SetB(double b);
-	void SetC(double c);
-	void SetD(double d);
-	
-
-	/**
-	 * Getters for base properties
-	 */		
-	double GetS();
-	double GetA();
-	double GetB();
-	double GetC();
-	double GetD();
-	
-
-	/**
-	 * Method to check if sample S is inside the record interval
-	 */	
-	bool CheckInterval (double s_check);
-
-	/**
-	 * Returns the value at sample S
-	 */	
-	double GetValue(double s_check);
-
-};
-//----------------------------------------------------------------------------------
-
-
-
-#endif

+ 0 - 1413
src/tool/map_lanetoxodr/OpenDrive/Road.cpp

@@ -1,1413 +0,0 @@
-#include "Road.h"
-#define _USE_MATH_DEFINES
-#include <math.h>
-
-
-
-
-//***********************************************************************************
-//Road segment
-//***********************************************************************************
-/**
- * Constructor 
- */
-Road::Road()
-{	
-	mPredecessor=NULL; mSuccessor=NULL; mNeighbor1=NULL; mNeighbor2=NULL;	
-}
-
-/**
- * Constructor that initializes the road with basic properties
- * 
- * @param name Name of the road
- * @param length Length of the road
- * @param id Unique ID of the road
- * @param junction ID of the junction, this road might be a part of
- */
-Road::Road(string name, double length, string id, string junction)
-{	
-	mPredecessor=NULL; mSuccessor=NULL; mNeighbor1=NULL; mNeighbor2=NULL;	mName=name; mLength=length; mId=id; mJunction=junction;
-}
-
-/**
- * Copy constructor
- */
-Road::Road (const Road& road)
-{
-	mName=road.mName;
-	mLength=road.mLength;
-	mId=road.mId;
-	mJunction=road.mJunction;
-
-	mPredecessor=NULL;
-	mSuccessor=NULL;
-	mNeighbor1=NULL;
-	mNeighbor2=NULL;
-
-	if (road.mPredecessor!=NULL)
-		mPredecessor = new RoadLink(road.mPredecessor->GetElementType(), road.mPredecessor->GetElementId(), road.mPredecessor->GetContactPoint());
-	if (road.mSuccessor!=NULL)
-		mSuccessor = new RoadLink(road.mSuccessor->GetElementType(), road.mSuccessor->GetElementId(), road.mSuccessor->GetContactPoint());
-	if (road.mNeighbor1!=NULL)
-		mNeighbor1 = new RoadNeighbor(road.mNeighbor1->GetSide(), road.mNeighbor1->GetElementId(), road.mNeighbor1->GetDirection());
-	if (road.mNeighbor2!=NULL)
-		mNeighbor2 = new RoadNeighbor(road.mNeighbor2->GetSide(), road.mNeighbor2->GetElementId(), road.mNeighbor2->GetDirection());
-
-	mRoadTypeVector=road.mRoadTypeVector;
-	mGeometryBlockVector=road.mGeometryBlockVector;
-	mElevationVector=road.mElevationVector;
-	mSuperElevationVector=road.mSuperElevationVector;
-	mCrossfallVector=road.mCrossfallVector;
-	mLaneSectionsVector=road.mLaneSectionsVector;
-	mObjectsVector=road.mObjectsVector;
-	mSignalsVector=road.mSignalsVector;
-    mLaneOffsetVector=road.mLaneOffsetVector;
-}
-
-/**
- * Assignment operator overload
- */
-const Road& Road::operator=(const Road& otherRoad)
-{
-	if (this!= &otherRoad)
-	{
-		mName=otherRoad.mName;
-		mLength=otherRoad.mLength;
-		mId=otherRoad.mId;
-		mJunction=otherRoad.mJunction;
-
-		delete mPredecessor;
-		delete mSuccessor;
-		delete mNeighbor1;
-		delete mNeighbor2;
-
-		mPredecessor=NULL;
-		mSuccessor=NULL;
-		mNeighbor1=NULL;
-		mNeighbor2=NULL;
-
-		if (otherRoad.mPredecessor!=NULL)
-			mPredecessor = new RoadLink(otherRoad.mPredecessor->GetElementType(), otherRoad.mPredecessor->GetElementId(), otherRoad.mPredecessor->GetContactPoint());
-		if (otherRoad.mSuccessor!=NULL)
-			mSuccessor = new RoadLink(otherRoad.mSuccessor->GetElementType(), otherRoad.mSuccessor->GetElementId(), otherRoad.mSuccessor->GetContactPoint());
-		if (otherRoad.mNeighbor1!=NULL)
-			mNeighbor1 = new RoadNeighbor(otherRoad.mNeighbor1->GetSide(), otherRoad.mNeighbor1->GetElementId(), otherRoad.mNeighbor1->GetDirection());
-		if (otherRoad.mNeighbor2!=NULL)
-			mNeighbor2 = new RoadNeighbor(otherRoad.mNeighbor2->GetSide(), otherRoad.mNeighbor2->GetElementId(), otherRoad.mNeighbor2->GetDirection());
-
-		mRoadTypeVector=otherRoad.mRoadTypeVector;
-		mGeometryBlockVector=otherRoad.mGeometryBlockVector;
-		mElevationVector=otherRoad.mElevationVector;
-		mSuperElevationVector=otherRoad.mSuperElevationVector;
-		mCrossfallVector=otherRoad.mCrossfallVector;
-		mLaneSectionsVector=otherRoad.mLaneSectionsVector;
-		mObjectsVector=otherRoad.mObjectsVector;
-		mSignalsVector=otherRoad.mSignalsVector;
-        mLaneOffsetVector=otherRoad.mLaneOffsetVector;
-	}
-	return *this;
-}
-//-------------------------------------------------
-
-/**
- * Recalculates the chordline geometry of the road
- */
-void Road::RecalculateGeometry()
-{
-	// Goes through geometry blocks and recalculates their coordinates and headings starting with the second record
-	// so the second geometry will start at the coordinates where the first one ended
-	double length=0;
-	unsigned int lGeometryVectorSize = mGeometryBlockVector.size();
-	if(lGeometryVectorSize>0)
-	{
-		double lS=0;
-		double lX=0;
-		double lY=0;
-		double lHdg=0;
-		mGeometryBlockVector.at(0).GetLastCoords(lS,lX,lY,lHdg);
-		length+=mGeometryBlockVector.at(0).GetBlockLength();
-
-		GeometryBlock *lGeometry;
-		for(unsigned int i=1; i<lGeometryVectorSize; i++)
-		{
-			lGeometry=&mGeometryBlockVector.at(i);
-			lGeometry->Recalculate(lS,lX,lY,lHdg);
-			lGeometry->GetLastCoords(lS,lX,lY,lHdg);
-			length+=lGeometry->GetBlockLength();
-		}
-	}
-
-	mLength=length;
-}
-
-/**
- * Getters for the basic properties of the road
- */
-string Road::GetRoadName() const
-{
-	return mName;
-}
-double Road::GetRoadLength() const
-{
-	return mLength;
-}
-string Road::GetRoadId() const
-{
-	return mId;
-}
-string Road::GetRoadJunction() const
-{
-	return mJunction;
-}
-string Road::GetRoadRule() const
-{
-    return mRule;
-}
-
-/**
- * Getters for the linking properties of the road
- */
-RoadLink* Road::GetPredecessor()
-{	
-	return mPredecessor;	
-}
-RoadLink* Road::GetSuccessor()
-{	
-	return mSuccessor;	
-}
-RoadNeighbor* Road::GetNeighbor1()
-{	
-	return mNeighbor1;	
-}
-RoadNeighbor* Road::GetNeighbor2()
-{	
-	return mNeighbor2;	
-}
-
-
-/**
- * Getters for the child records and their vectors
- */
-// Road type records
-vector<RoadType> *Road::GetRoadTypeVector()
-{
-	return &mRoadTypeVector;
-}
-RoadType* Road::GetRoadType(unsigned int i)
-{	
-	if ((mRoadTypeVector.size()>0)&&(i<mRoadTypeVector.size()))
-		return &mRoadTypeVector.at(i);
-	else
-		return NULL;
-}
-unsigned int Road::GetRoadTypeCount()
-{
-	return mRoadTypeVector.size();
-}
-// Road geometry records
-vector<GeometryBlock> *Road::GetGeometryBlockVector()
-{
-	return &mGeometryBlockVector;
-}
-GeometryBlock* Road::GetGeometryBlock(unsigned int i)
-{	
-	if ((mGeometryBlockVector.size()>0)&&(i<mGeometryBlockVector.size()))
-		return &mGeometryBlockVector.at(i);
-	else
-		return NULL;
-}
-unsigned int Road::GetGeometryBlockCount()
-{
-	return mGeometryBlockVector.size();
-}
-// Road elevation records
-vector<Elevation> *Road::GetElevationVector()
-{
-	return &mElevationVector;
-}
-Elevation*	Road::GetElevation(unsigned int i)
-{	
-	if ((mElevationVector.size()>0)&&(i<mElevationVector.size()))
-		return &mElevationVector.at(i);
-	else
-		return NULL;
-}
-unsigned int Road::GetElevationCount()
-{
-	return mElevationVector.size();
-}
-// Road superelevation records
-vector<SuperElevation> *Road::GetSuperElevationVector()
-{
-	return &mSuperElevationVector;
-}
-SuperElevation*	Road::GetSuperElevation(unsigned int i)
-{	
-	if ((mSuperElevationVector.size()>0)&&(i<mSuperElevationVector.size()))
-		return &mSuperElevationVector.at(i);
-	else
-		return NULL;
-}
-unsigned int Road::GetSuperElevationCount()
-{
-	return mSuperElevationVector.size();
-}
-// Road crossfall records
-vector<Crossfall> *Road::GetCrossfallVector()
-{
-	return &mCrossfallVector;
-}
-Crossfall*	Road::GetCrossfall(unsigned int i)
-{	
-	if ((mCrossfallVector.size()>0)&&(i<mCrossfallVector.size()))
-		return &mCrossfallVector.at(i);
-	else
-		return NULL;
-}
-unsigned int Road::GetCrossfallCount()
-{
-	return mCrossfallVector.size();
-}
-// Road lane section records
-vector<LaneSection> *Road::GetLaneSectionVector()
-{
-	return &mLaneSectionsVector;
-}
-LaneSection*	Road::GetLaneSection(unsigned int i)
-{	
-	if ((mLaneSectionsVector.size()>0)&&(i<mLaneSectionsVector.size()))
-		return &mLaneSectionsVector.at(i);
-	else
-		return NULL;
-}
-unsigned int Road::GetLaneSectionCount()
-{
-	return mLaneSectionsVector.size();
-}
-
-// Road lane offset records
-vector<LaneOffset> * Road::GetLaneOffsetVector()
-{
-    return &mLaneOffsetVector;
-}
-LaneOffset * Road::GetLaneOffset(unsigned int i)
-{
-    if ((mLaneOffsetVector.size()>0)&&(i<mLaneOffsetVector.size()))
-        return &mLaneOffsetVector.at(i);
-    else
-        return NULL;
-}
-unsigned int Road::GetLaneOffsetCount()
-{
-    return mLaneOffsetVector.size();
-}
-// Road object records
-vector<Object> *Road::GetObjectVector()
-{
-	return &mObjectsVector;
-}
-Object*	Road::GetObject(unsigned int i)
-{	
-	if ((mObjectsVector.size()>0)&&(i<mObjectsVector.size()))
-		return &mObjectsVector.at(i);
-	else
-		return NULL;
-}
-unsigned int Road::GetObjectCount()
-{
-	return mObjectsVector.size();
-}
-// Road signal records
-vector<Signal> *Road::GetSignalVector()
-{
-	return &mSignalsVector;
-}
-Signal*	Road::GetSignal(unsigned int i)
-{	
-	if ((mSignalsVector.size()>0)&&(i<mSignalsVector.size()))
-		return &mSignalsVector.at(i);
-	else
-		return NULL;
-}
-unsigned int Road::GetSignalCount()
-{
-	return mSignalsVector.size();
-}
-//-------------------------------------------------
-
-/**
- * Getters for the last child records in their respective vectors
- */
-RoadType* Road::GetLastRoadType()
-{	
-	if (mRoadTypeVector.size()>0)
-		return &mRoadTypeVector.at(mRoadTypeVector.size()-1);
-	else
-		return NULL;
-}
-GeometryBlock* Road::GetLastGeometryBlock()
-{	
-	if (mGeometryBlockVector.size()>0)
-		return &mGeometryBlockVector.at(mGeometryBlockVector.size()-1);
-	else
-		return NULL;
-}
-Elevation*	Road::GetLastElevation()
-{	
-	if (mElevationVector.size()>0)
-		return &mElevationVector.at(mElevationVector.size()-1);
-	else
-		return NULL;
-}
-SuperElevation*	Road::GetLastSuperElevation()
-{	
-	if (mSuperElevationVector.size()>0)
-		return &mSuperElevationVector.at(mSuperElevationVector.size()-1);
-	else
-		return NULL;
-}
-Crossfall*	Road::GetLastCrossfall()
-{	
-	if (mCrossfallVector.size()>0)
-		return &mCrossfallVector.at(mCrossfallVector.size()-1);
-	else
-		return NULL;
-}
-LaneSection*	Road::GetLastLaneSection()
-{	
-	if (mLaneSectionsVector.size()>0)
-		return &mLaneSectionsVector.at(mLaneSectionsVector.size()-1);
-	else
-		return NULL;
-}
-Object*	Road::GetLastObject()
-{	
-	if (mObjectsVector.size()>0)
-		return &mObjectsVector.at(mObjectsVector.size()-1);
-	else
-		return NULL;
-}
-Signal*	Road::GetLastSignal()
-{	
-	if (mSignalsVector.size()>0)
-		return &mSignalsVector.at(mSignalsVector.size()-1);
-	else
-		return NULL;
-}
-
-
-/**
- * Getters for the last added child records in their respective vectors
- */
-RoadType* Road::GetLastAddedRoadType()
-{
-	if(mLastAddedRoadType<mRoadTypeVector.size())
-		return &mRoadTypeVector.at(mLastAddedRoadType);
-	else
-		return NULL;
-}
-GeometryBlock* Road::GetLastAddedGeometryBlock()
-{
-	if(mLastAddedGeometryBlock<mGeometryBlockVector.size())
-		return &mGeometryBlockVector.at(mLastAddedGeometryBlock);
-	else
-		return NULL;
-}
-Elevation* Road::GetLastAddedElevation()
-{
-	if(mLastAddedElevation<mElevationVector.size())
-		return &mElevationVector.at(mLastAddedElevation);
-	else
-		return NULL;
-}
-SuperElevation* Road::GetLastAddedSuperElevation()
-{
-	if(mLastAddedSuperElevation<mSuperElevationVector.size())
-		return &mSuperElevationVector.at(mLastAddedSuperElevation);
-	else
-		return NULL;
-}
-Crossfall* Road::GetLastAddedCrossfall()
-{
-	if(mLastAddedCrossfall<mCrossfallVector.size())
-		return &mCrossfallVector.at(mLastAddedCrossfall);
-	else
-		return NULL;
-}
-LaneSection* Road::GetLastAddedLaneSection()
-{
-	if(mLastAddedLaneSection<mLaneSectionsVector.size())
-		return &mLaneSectionsVector.at(mLastAddedLaneSection);
-	else
-		return NULL;
-}
-Object* Road::GetLastAddedObject()
-{
-	if(mLastAddedObject<mObjectsVector.size())
-		return &mObjectsVector.at(mLastAddedObject);
-	else
-		return NULL;
-}
-Signal* Road::GetLastAddedSignal()
-{
-	if(mLastAddedSignal<mSignalsVector.size())
-		return &mSignalsVector.at(mLastAddedSignal);
-	else
-		return NULL;
-}
-//-------------------------------------------------
-
-/**
- * Setters for the basic road properties
- */
-void Road::SetRoadName(string name)
-{
-	mName=name;
-}
-void Road::SetRoadLength(double length)
-{
-	mLength=length;
-}
-void Road::SetRoadId(string id)
-{
-	mId=id;
-}
-void Road::SetRoadJunction(string junction)
-{
-	mJunction=junction;
-}
-void Road::SetRoadRule(std::string rule)
-{
-    mRule=rule;
-}
-
-/**
- * Setters for the linking road properties
- */
-void Road::SetPredecessor(string elementType, string elementId, string contactPoint)
-{
-	if(mPredecessor!=NULL)
-	{
-		mPredecessor->SetElementType(elementType);
-		mPredecessor->SetElementId(elementId);
-		mPredecessor->SetContactPoint(contactPoint);
-	}
-	else mPredecessor = new RoadLink(elementType, elementId,contactPoint);	
-}
-void Road::SetSuccessor(string elementType, string elementId, string contactPoint)
-{
-	if(mSuccessor!=NULL)
-	{
-		mSuccessor->SetElementType(elementType);
-		mSuccessor->SetElementId(elementId);
-		mSuccessor->SetContactPoint(contactPoint);
-	}
-	else mSuccessor=new RoadLink(elementType, elementId,contactPoint);	
-}
-void Road::SetNeighbor(string side, string elementId, string direction)
-{
-	if (mNeighbor1==NULL)
-		mNeighbor1=new RoadNeighbor(side, elementId, direction);
-	else
-		mNeighbor2=new RoadNeighbor(side, elementId, direction);
-}
-void Road::SetNeighbor1(string side, string elementId, string direction)
-{
-	if (mNeighbor1==NULL) mNeighbor1=new RoadNeighbor(side, elementId, direction);
-}
-void Road::SetNeighbor2(string side, string elementId, string direction)
-{
-	if (mNeighbor2==NULL) mNeighbor2=new RoadNeighbor(side, elementId, direction);
-}
-
-/**
- * Removers for the linking road properties
- */
-void Road::RemovePredecessor()
-{
-	if(mPredecessor!=NULL)
-	{
-		delete mPredecessor;
-		mPredecessor = NULL;
-	}
-}
-void Road::RemoveSuccessor()
-{
-	if(mSuccessor!=NULL)
-	{
-		delete mSuccessor;
-		mSuccessor = NULL;
-	}
-}
-void Road::RemoveNeighbor1()
-{
-	if(mNeighbor1!=NULL)
-	{
-		delete mNeighbor1;
-		mNeighbor1 = NULL;
-	}
-}
-void Road::RemoveNeighbor2()
-{
-	if(mNeighbor2!=NULL)
-	{
-		delete mNeighbor2;
-		mNeighbor2 = NULL;
-	}
-}
-//-------------------------------------------------
-
-/**
- * Methods used to add child records to the respective vectors
- */
-unsigned int Road::AddRoadType(double s, string type,string country)
-{	
-	// Gets the index where the record should be inserted in the vector
-	unsigned int index = CheckRoadTypeInterval(s)+1;
-	// If larger than the record count - push to the back
-    if(index>=GetRoadTypeCount()) mRoadTypeVector.push_back(RoadType(s, type,country));
-	// else insert in the middle
-    else mRoadTypeVector.insert(mRoadTypeVector.begin()+index, RoadType(s, type,country));
-	// Save the last added record index
-	mLastAddedRoadType=index;
-	return index;
-}
-//-------------
-unsigned int Road::AddGeometryBlock()
-{	
-	// Check the first method in the group for details
-
-	unsigned int index=GetGeometryBlockCount();
-	mGeometryBlockVector.push_back(GeometryBlock());
-	mLastAddedGeometryBlock=index;
-	return index;
-}
-//-------------
-unsigned int Road::AddElevation(double s, double a, double b, double c, double d)
-{	
-	// Check the first method in the group for details
-
-	unsigned int index = CheckElevationInterval(s)+1;
-	if(index>=GetElevationCount()) mElevationVector.push_back(Elevation(s,a,b,c,d));
-	else mElevationVector.insert(mElevationVector.begin()+index, Elevation(s,a,b,c,d));
-	mLastAddedElevation=index;
-	return index;
-}
-//-------------
-unsigned int Road::AddSuperElevation(double s, double a, double b, double c, double d)
-{	
-	// Check the first method in the group for details
-
-	unsigned int index = CheckSuperElevationInterval(s)+1;
-	if(index>=GetSuperElevationCount()) mSuperElevationVector.push_back(SuperElevation(s,a,b,c,d));
-	else mSuperElevationVector.insert(mSuperElevationVector.begin()+index, SuperElevation(s,a,b,c,d));
-	mLastAddedSuperElevation=index;
-	return index;
-}
-//-------------
-unsigned int Road::AddCrossfall (string side, double s, double a, double b, double c, double d)
-{	
-	// Check the first method in the group for details
-
-	unsigned int index = CheckCrossfallInterval(s)+1;
-	if(index>=GetCrossfallCount()) mCrossfallVector.push_back(Crossfall(side,s,a,b,c,d));
-	else mCrossfallVector.insert(mCrossfallVector.begin()+index, Crossfall(side,s,a,b,c,d));
-	mLastAddedCrossfall=index;
-	return index;
-}
-//-------------
-unsigned int Road::AddLaneSection(double s)
-{
-	// Check the first method in the group for details
-
-	unsigned int index = CheckLaneSectionInterval(s)+1;
-	if(index>=GetLaneSectionCount()) mLaneSectionsVector.push_back(LaneSection(s));
-	else mLaneSectionsVector.insert(mLaneSectionsVector.begin()+index, LaneSection(s));
-	mLastAddedLaneSection=index;
-	return index;
-}
-
-unsigned int Road::AddLaneOffset(double s, double a, double b, double c, double d)
-{
-    unsigned int index = CheckLaneOffsetInterval(s)+1;
-    if(index>=GetLaneOffsetCount()) mLaneOffsetVector.push_back(LaneOffset(s,a,b,c,d));
-    else mLaneOffsetVector.insert(mLaneOffsetVector.begin()+index, LaneOffset(s,a,b,c,d));
-    mLastAddedLaneOffset=index;
-    return index;
-}
-
-//-------------
-unsigned int Road::AddObject(string id,double s,double t,double zOffset)
-{	
-	// Check the first method in the group for details
-
-	unsigned int index=GetObjectCount();
-    mObjectsVector.push_back(Object(id,s,t,zOffset));
-	mLastAddedObject=index;
-	return index;
-}
-//-------------
-unsigned int Road::AddSignal(double s,double t,string id,string name,bool dynamic,string orientation,double zOffset,string type,string country,string countryRevision,
-                             string subtype,double hOffset,double pitch,double roll ,double height,double width)
-{
-	// Check the first method in the group for details
-
-	unsigned int index=GetSignalCount();
-    Signal x(s,t,id,name,dynamic,orientation,zOffset,type,country,countryRevision,
-             subtype,hOffset,pitch,roll,height,width);
-    mSignalsVector.push_back(x);
-
-//    mSignalsVector.push_back(Signal(s,t,id,name,dynamic,orientation,zOffset,type,country,countryRevision,
-//                                    subtype,hOffset,pitch,roll,height,width));
-	mLastAddedSignal=index;
-	return index;
-}
-//-----------
-
-
-/**
- * Methods used to clone child records in the respective vectors
- */
-unsigned int Road::CloneRoadType(unsigned int index)
-{
-	// Clone the object and insert it in the middle of the vector
-	if(index<mRoadTypeVector.size()-1)
-		mRoadTypeVector.insert(mRoadTypeVector.begin()+index+1, mRoadTypeVector[index]);
-	// or just push it to the back
-	else if(index==mRoadTypeVector.size()-1)
-		mRoadTypeVector.push_back(mRoadTypeVector[index]);
-	// Save the last added record index
-	mLastAddedRoadType=index+1;
-	return mLastAddedRoadType;
-}
-unsigned int Road::CloneElevation(unsigned int index)
-{
-	// Check the first method in the group for details
-
-	if(index<mElevationVector.size()-1)
-		mElevationVector.insert(mElevationVector.begin()+index+1, mElevationVector[index]);
-	else if(index==mElevationVector.size()-1)
-		mElevationVector.push_back(mElevationVector[index]);
-	mLastAddedElevation=index+1;
-	return mLastAddedElevation;
-}
-unsigned int Road::CloneSuperElevation(unsigned int index)
-{
-	// Check the first method in the group for details
-
-	if(index<mSuperElevationVector.size()-1)
-		mSuperElevationVector.insert(mSuperElevationVector.begin()+index+1, mSuperElevationVector[index]);
-	else if(index==mSuperElevationVector.size()-1)
-		mSuperElevationVector.push_back(mSuperElevationVector[index]);
-	mLastAddedSuperElevation=index+1;
-	return mLastAddedSuperElevation;
-}
-unsigned int Road::CloneCrossfall(unsigned int index)
-{
-	// Check the first method in the group for details
-
-	if(index<mCrossfallVector.size()-1)
-		mCrossfallVector.insert(mCrossfallVector.begin()+index+1, mCrossfallVector[index]);
-	else if(index==mCrossfallVector.size()-1)
-		mCrossfallVector.push_back(mCrossfallVector[index]);
-	mLastAddedCrossfall=index+1;
-	return mLastAddedCrossfall;
-}
-unsigned int Road::CloneLaneSection(unsigned int index)
-{
-	// Check the first method in the group for details
-
-	if(index<mLaneSectionsVector.size()-1)
-		mLaneSectionsVector.insert(mLaneSectionsVector.begin()+index+1, mLaneSectionsVector[index]);
-	else if(index==mLaneSectionsVector.size()-1)
-		mLaneSectionsVector.push_back(mLaneSectionsVector[index]);
-	mLastAddedLaneSection=index+1;
-	return mLastAddedLaneSection;
-}
-unsigned int Road::CloneLaneSectionEnd(unsigned int index)
-{
-	// Check the first method in the group for details
-
-	// Clones the lane section, duplicating only the last records in each child category
-	LaneSection lNewLaneSection(mLaneSectionsVector[index].GetS());
-	unsigned int iLaneCount=mLaneSectionsVector[index].GetLaneCount();
-
-	double lHighestS = 0;
-
-	for(unsigned int iLane=0; iLane<iLaneCount; iLane++)
-	{
-		Lane *lLane = mLaneSectionsVector[index].GetLane(iLane);
-		lNewLaneSection.AddLane(lLane->GetSide(), lLane->GetId(), lLane->GetType(), lLane->GetLevel(),false);
-
-		Lane *lNewLane = lNewLaneSection.GetLastAddedLane();
-
-		//width
-		LaneWidth *lWidth = lLane->GetLaneWidth(lLane->GetLaneWidthCount()-1);
-		if(lWidth!=NULL) 
-		{
-			lNewLane->AddWidthRecord(0.0, lWidth->GetA(), lWidth->GetB(), lWidth->GetC(), lWidth->GetD());
-			if(lWidth->GetS()>lHighestS) lHighestS=lWidth->GetS();
-		}
-
-		//road mark
-		LaneRoadMark *lRoadMark = lLane->GetLaneRoadMark(lLane->GetLaneRoadMarkCount()-1);
-		if(lRoadMark!=NULL) 
-		{
-			lNewLane->AddRoadMarkRecord(0.0, lRoadMark->GetType(), lRoadMark->GetWeight(), lRoadMark->GetColor(), lRoadMark->GetWidth(), lRoadMark->GetLaneChange());
-			if(lRoadMark->GetS()>lHighestS) lHighestS=lRoadMark->GetS();
-		}
-
-		//material
-		LaneMaterial *lMaterial = lLane->GetLaneMaterial(lLane->GetLaneMaterialCount()-1);
-		if(lMaterial!=NULL) 
-		{
-			lNewLane->AddMaterialRecord(0.0, lMaterial->GetSurface(), lMaterial->GetFriction(), lMaterial->GetRoughness());
-			if(lMaterial->GetS()>lHighestS) lHighestS=lMaterial->GetS();
-		}
-
-		//visibility
-		LaneVisibility *lVisibility = lLane->GetLaneVisibility(lLane->GetLaneVisibilityCount()-1);
-		if(lVisibility!=NULL) 
-		{
-			lNewLane->AddVisibilityRecord(0.0, lVisibility->GetForward(), lVisibility->GetBack(), lVisibility->GetLeft(), lVisibility->GetRight());
-			if(lVisibility->GetS()>lHighestS) lHighestS=lVisibility->GetS();
-		}
-
-		//speed
-		LaneSpeed *lSpeed = lLane->GetLaneSpeed(lLane->GetLaneSpeedCount()-1);
-		if(lSpeed!=NULL) 
-		{
-			lNewLane->AddSpeedRecord(0.0, lSpeed->GetMax());
-			if(lSpeed->GetS()>lHighestS) lHighestS=lSpeed->GetS();
-		}
-
-		//access
-		LaneAccess *lAccess = lLane->GetLaneAccess(lLane->GetLaneAccessCount()-1);
-		if(lAccess!=NULL) 
-		{
-			lNewLane->AddAccessRecord(0.0, lAccess->GetRestriction());
-			if(lAccess->GetS()>lHighestS) lHighestS=lAccess->GetS();
-		}
-
-		//height
-		LaneHeight *lHeight = lLane->GetLaneHeight(lLane->GetLaneHeightCount()-1);
-		if(lHeight!=NULL) 
-		{
-			lNewLane->AddHeightRecord(0.0, lHeight->GetInner(), lHeight->GetOuter());
-			if(lHeight->GetS()>lHighestS) lHighestS=lHeight->GetS();
-		}
-	}
-
-	lHighestS += mLaneSectionsVector[index].GetS();
-
-	if(index+1 < mLaneSectionsVector.size())
-	{
-		if(lHighestS < mLaneSectionsVector[index+1].GetS())
-			lNewLaneSection.SetS(lHighestS);
-	}
-
-
-	if(index<mLaneSectionsVector.size()-1)
-		mLaneSectionsVector.insert(mLaneSectionsVector.begin()+index+1, lNewLaneSection);
-	else if(index==mLaneSectionsVector.size()-1)
-		mLaneSectionsVector.push_back(lNewLaneSection);
-	mLastAddedLaneSection=index+1;
-	return mLastAddedLaneSection;
-}
-unsigned int Road::CloneObject(unsigned int index)
-{
-	// Check the first method in the group for details
-
-	if(index<mSignalsVector.size()-1)
-		mSignalsVector.insert(mSignalsVector.begin()+index+1, mSignalsVector[index]);
-	else if(index==mSignalsVector.size()-1)
-		mSignalsVector.push_back(mSignalsVector[index]);
-	mLastAddedObject=index+1;
-	return mLastAddedObject;
-}
-unsigned int Road::CloneSignal(unsigned int index)
-{
-	// Check the first method in the group for details
-
-	if(index<mSignalsVector.size()-1)
-		mSignalsVector.insert(mSignalsVector.begin()+index+1, mSignalsVector[index]);
-	else if(index==mSignalsVector.size()-1)
-		mSignalsVector.push_back(mSignalsVector[index]);
-	mLastAddedSignal=index+1;
-	return mLastAddedSignal;
-}
-
-/**
- * Methods used to delete child records from the respective vectors
- */
-void Road::DeleteRoadType(unsigned int index)
-{
-	mRoadTypeVector.erase(mRoadTypeVector.begin()+index);
-}
-void Road::DeleteGeometryBlock(unsigned int index)
-{
-	mGeometryBlockVector.erase(mGeometryBlockVector.begin()+index);
-}
-void Road::DeleteElevation(unsigned int index)
-{
-	mElevationVector.erase(mElevationVector.begin()+index);
-}
-void Road::DeleteSuperElevation(unsigned int index)
-{
-	mSuperElevationVector.erase(mSuperElevationVector.begin()+index);
-}
-void Road::DeleteCrossfall(unsigned int index)
-{
-	mCrossfallVector.erase(mCrossfallVector.begin()+index);
-}
-void Road::DeleteLaneSection(unsigned int index)
-{
-	mLaneSectionsVector.erase(mLaneSectionsVector.begin()+index);
-}
-void Road::DeleteLaneOffset(unsigned int index)
-{
-    mLaneOffsetVector.erase(mLaneOffsetVector.begin()+index);
-}
-void Road::DeleteObject(unsigned int index)
-{
-	mObjectsVector.erase(mObjectsVector.begin()+index);
-}
-void Road::DeleteSignal(unsigned int index)
-{
-	mSignalsVector.erase(mSignalsVector.begin()+index);
-}
-
-//-------------------------------------------------
-// EVALUATION METHODS
-
-/**
- * Geometry evaluation
- */
-bool Road::CheckGeometryInterval (double s_check)
-{
-	string tmp;
-	return CheckGeometryInterval(s_check,tmp);
-}
-//-----------
-bool Road::CheckGeometryInterval (double s_check, string &roadId)
-{
-	for (unsigned int i=0;i<mGeometryBlockVector.size();i++)
-	{
-		if (mGeometryBlockVector.at(i).CheckInterval(s_check))
-		{
-			roadId=mId;
-			return true;
-		}
-	}
-	roadId="N/A";
-	return false;
-}
-//-----------
-short int Road::GetGeometryCoords(double s_check, double &retX, double &retY)
-{
-	double tmp;
-	return GetGeometryCoords(s_check,retX,retY, tmp);
-}
-//-------------
-short int Road::GetGeometryCoords(double s_check, double &retX, double &retY, double &retHDG)
-{
-	//go trough all of the blocks
-	for (unsigned int i=0; i<mGeometryBlockVector.size();i++)
-	{
-		//Check the block and get coords.
-		short int res=mGeometryBlockVector.at(i).GetCoords(s_check,retX,retY, retHDG);
-		// If the returned value is one of the geometry types (for 0=line,1=arc and 2=spiral) then the result has been found and parameters filled, so, return the value
-		if (res>=0  ) 
-			return res;
-	}
-	//if s_check does not belong to the road, return -999
-	return -999;
-}
-//-----------
-
-/**
- * Other evaluation
- */
-int  Road::CheckRoadTypeInterval(double s_check)
-{
-	int res=-1;
-	//Go through all the road type records
-	for (unsigned int i=0;i<mRoadTypeVector.size();i++)
-	{
-		//check if the s_check belongs to the current record
-		if (s_check >= mRoadTypeVector.at(i).GetS())
-			res=i;	//assign it to the result id
-		else 
-			break;	//if not, break;
-	}
-	return res;		//return the result: 0 to MaxInt as the index to the record containing s_check or -1 if nothing found
-}
-//-----------
-string  Road::GetRoadTypeValue(double s_check)
-{
-	string retType="unknown";
-	//find the record where s_check belongs
-	int index=	CheckRoadTypeInterval(s_check);
-	//If found, return the type
-	if (index>=0)
-		retType= mRoadTypeVector.at(index).GetType();
-	return retType;
-}
-//-----------
-int  Road::CheckElevationInterval(double s_check)
-{
-	int res=-1;
-	//Go through all the road type records
-	for (unsigned int i=0;i<mElevationVector.size();i++)
-	{
-		//check if the s_check belongs to the current record
-		if (mElevationVector.at(i).CheckInterval(s_check))
-			res=i;	//assign it to the result id
-		else 
-			break;	//if not, break;
-	}
-	return res;		//return the result: 0 to MaxInt as the index to the record containing s_check or -1 if nothing found
-}
-//-----------
-double  Road::GetElevationValue (double s_check)
-{
-	double retVal=0;
-	//find the record where s_check belongs
-	int index=CheckElevationInterval(s_check);
-	//If found, return the type
-	if (index>=0)
-		retVal= (mElevationVector.at(index).GetValue(s_check));
-	return retVal;
-
-}
-//-----------
-int  Road::CheckSuperElevationInterval(double s_check)
-{
-	int res=-1;
-	//Go through all the road type records
-	for (unsigned int i=0;i<mSuperElevationVector.size();i++)
-	{
-		//check if the s_check belongs to the current record
-		if (mSuperElevationVector.at(i).CheckInterval(s_check))
-			res=i;	//assign it to the result id
-		else 
-			break;	//if not, break;
-	}
-	return res;		//return the result: 0 to MaxInt as the index to the record containing s_check or -1 if nothing found
-}
-//-----------
-double  Road::GetSuperElevationValue (double s_check)
-{
-	double retVal=0;
-	//find the record where s_check belongs
-	int index=CheckSuperElevationInterval(s_check);
-	//If found, return the type
-	if (index>=0)
-		retVal= (mSuperElevationVector.at(index).GetValue(s_check));
-
-	return retVal;
-}
-//-----------
-int  Road::CheckCrossfallInterval(double s_check)
-{
-	int res=-1;
-	//Go through all the road type records
-	for (unsigned int i=0;i<mCrossfallVector.size();i++)
-	{
-		//check if the s_check belongs to the current record
-		if (mCrossfallVector.at(i).CheckInterval(s_check))
-			res=i;	//assign it to the result id
-		else 
-			break;	//if not, break;
-	}
-	return res;		//return the result: 0 to MaxInt as the index to the record containing s_check or -1 if nothing found
-}
-//-----------
-void  Road::GetCrossfallValue (double s_check, double &angleLeft, double &angleRight)
-{
-	angleLeft=0.0;
-	angleRight=0.0;
-	//find the record where s_check belongs
-	int index=CheckCrossfallInterval(s_check);
-	//If found, return the type
-	string side;
-	double angle=0.0;
-	if (index>=0)
-	{
-		angle =(mCrossfallVector.at(index).GetValue(s_check));
-		side=(mCrossfallVector.at(index).GetSide());
-	}
-	
-	if (side.compare("left")==0)
-	{
-		angleLeft=-angle;
-	}
-	else if (side.compare("right")==0)
-	{
-		angleRight=-angle;
-	}
-	else
-	{
-		angleLeft=-angle;
-		angleRight=-angle;
-	}
-}
-//-----------
-int  Road::CheckLaneSectionInterval(double s_check)
-{
-	int res=-1;
-	//Go through all the lane section records
-	for (unsigned int i=0;i<mLaneSectionsVector.size();i++)
-	{
-		//check if the s_check belongs to the current record
-		if (mLaneSectionsVector.at(i).CheckInterval(s_check))
-			res=i;	//assign it to the result id
-		else 
-			break;	//if not, break;
-	}
-	return res;		//return the result: 0 to MaxInt as the index to the record containing s_check or -1 if nothing found
-}
-//-----------
-int Road::CheckLaneOffsetInterval(double s_check)
-{
-    int res=-1;
-    //Go through all the lane section records
-    for (unsigned int i=0;i<mLaneOffsetVector.size();i++)
-    {
-        //check if the s_check belongs to the current record
-        if (mLaneOffsetVector.at(i).CheckInterval(s_check))
-            res=i;	//assign it to the result id
-        else
-            break;	//if not, break;
-    }
-    return res;		//return the result: 0 to MaxInt as the index to the record containing s_check or -1 if nothing found
-
-}
-//-----------
-void  Road::FillLaneSectionSample(double s_check, LaneSectionSample& laneSectionSample)
-{
-	int index=CheckLaneSectionInterval(s_check);
-	if (index>=0)
-		mLaneSectionsVector.at(index).FillLaneSectionSample(s_check,laneSectionSample);
-}
-
-//-------------------------------------------------
-
-/**
- * Destructor
- */
-Road::~Road()
-{
-	delete mPredecessor;
-	delete mSuccessor;
-	delete mNeighbor1;
-	delete mNeighbor2;
-
-	// DELETING ROAD TYPES
-	mRoadTypeVector.clear();
-
-	// DELETING GEOMETRY BLOKS
-	mGeometryBlockVector.clear();
-
-	// DELETING ELEVATIONS
-	mElevationVector.clear();
-
-	// DELETING SUPERELEVATION
-	mSuperElevationVector.clear();
-
-	// DELETING CROSSFALL
-	mCrossfallVector.clear();
-
-	// DELETING LANE SECTIONS
-	mLaneSectionsVector.clear();
-
-	// DELETING OBJECTS
-	mObjectsVector.clear();
-
-	// DELETING SIGNALS
-	mSignalsVector.clear();
-}
-
-
-
-
-//***********************************************************************************
-//Road Link Record
-//***********************************************************************************
-/**
- * Constructor which intializes the basic properties
- */
-RoadLink::RoadLink(string elementType, string elementId, string contactPoint)
-{
-	mElementType=elementType;
-	mElementId=elementId;
-	mContactPoint=contactPoint;
-}
-
-/**
- * Getters for the basic properties
- */
-string RoadLink::GetElementType()
-{	
-	return mElementType;	
-}
-string RoadLink::GetElementId()
-{	
-	return mElementId;	
-}
-string RoadLink::GetContactPoint()
-{	
-	return mContactPoint;	
-}
-double RoadLink::GetElementS()
-{
-    return mElementS;
-}
-string RoadLink::GetElementDir()
-{
-    return mElementDir;
-}
-
-/**
- * Setters for the basic properties
- */
-void RoadLink::SetElementType(string elementType)
-{	
-	mElementType=elementType;	
-}
-void RoadLink::SetElementId(string elementId)
-{	
-	mElementId=elementId;
-}
-void RoadLink::SetContactPoint(string contactPoint)
-{	
-	mContactPoint=contactPoint;	
-}
-void RoadLink::SetElementS(double value)
-{
-    mElementS = value;
-}
-void RoadLink::SetELementDir(std::string elementdir)
-{
-    mElementDir = elementdir;
-}
-
-
-//***********************************************************************************
-//Road Neighbor Record
-//***********************************************************************************
-/**
- * Constructor which intializes the basic properties
- */
-RoadNeighbor::RoadNeighbor(string side, string elementId, string direction)
-{
-	mSide=side;
-	mElementId=elementId;
-	mDirection=direction;
-}
-/**
- * Getters for the basic properties
- */
-string RoadNeighbor::GetSide()
-{	
-	return mSide;	
-}
-string RoadNeighbor::GetElementId()
-{	
-	return mElementId;	
-}
-string RoadNeighbor::GetDirection()
-{	
-	return mDirection;	
-}
-
-/**
- * Setters for the basic properties
- */
-void RoadNeighbor::SetSide(string side)
-{	
-	mSide=side;	
-}
-void RoadNeighbor::SetElementId(string elementId)
-{	
-	mElementId=elementId;	
-}
-void RoadNeighbor::SetDirection(string direction)
-{	
-	mDirection=direction;	
-}
-
-
-//***********************************************************************************
-//Road Type
-//***********************************************************************************
-/**
- * Constructor which intializes the basic properties
- */
-RoadType::RoadType (double s, string type,string country)
-{	
-    mS=s; mType=type;mCountry = country;
-}
-
-/**
- * Setters for the basic properties
- */
-void RoadType::SetS(double value)
-{
-	mS=value;
-}
-void RoadType::SetType(string type)
-{
-	mType=type;
-}
-void RoadType::SetCountry(std::string country)
-{
-    mCountry = country;
-}
-
-/**
- * Getters for the basic properties
- */
-double RoadType::GetS()
-{
-	return mS;
-}
-string RoadType::GetType()
-{
-	return mType;
-}
-string RoadType::GetCountry()
-{
-    return mCountry;
-}
-
-vector<RoadTypeSpeed> * RoadType::GetRoadTypeSpeedVector()
-{
-    return &mRoadTypeSpeedVector;
-}
-
-unsigned int RoadType::GetRoadTypeSpeedCount()
-{
-    return mRoadTypeSpeedVector.size();
-}
-
-RoadTypeSpeed * RoadType::GetRoadTypeSpeed(unsigned int i)
-{
-    if ((mRoadTypeSpeedVector.size()>0)&&(i<mRoadTypeSpeedVector.size()))
-        return &mRoadTypeSpeedVector.at(i);
-    else
-        return NULL;
-}
-
-unsigned int RoadType::AddRoadTypeSpeed(double maxSpeed, std::string unit)
-{
-    RoadTypeSpeed rts(maxSpeed,unit);
-    if(mRoadTypeSpeedVector.size()>0)mRoadTypeSpeedVector.clear();
-    mRoadTypeSpeedVector.push_back(rts);
-    return mRoadTypeSpeedVector.size()-1;
-}
-
-void RoadType::DeleteRoadTypeSpeed(unsigned int index)
-{
-    if(index >= 1)
-    {
-        return;
-    }
-    mRoadTypeSpeedVector.clear();
-}
-
-
-
-
-//***********************************************************************************
-//Road Type Speed
-//***********************************************************************************
-/**
- * Constructor which intializes the basic properties
- */
-
-RoadTypeSpeed::RoadTypeSpeed(double maxSpeed, std::string unit)
-{
-    mmaxSpeed = maxSpeed;
-    munit = unit;
-}
-
-/**
- * Setters for the basic properties
- */
-void RoadTypeSpeed::SetmaxSpeed(double value)
-{
-    mmaxSpeed = value;
-}
-void RoadTypeSpeed::Setunit(std::string unit)
-{
-    munit = unit;
-}
-
-/**
- * Getters for the basic properties
- */
-double RoadTypeSpeed::GetmaxSpeed()
-{
-    return mmaxSpeed;
-}
-string RoadTypeSpeed::Getunit()
-{
-    return munit;
-}
-
-
-
-//***********************************************************************************
-//Elevation record
-//***********************************************************************************
-/**
- * Constructor which intializes the basic properties
- */
-Elevation::Elevation(double s, double a, double b, double c, double d): ThirdOrderPolynom(s,a,b,c,d)
-{}
-
-
-
-
-
-//***********************************************************************************
-//Elevation record
-//***********************************************************************************
-/**
- * Constructor which intializes the basic properties
- */
-SuperElevation::SuperElevation(double s, double a, double b, double c, double d): ThirdOrderPolynom(s,a,b,c,d)
-{}
-
-
-
-
-
-//***********************************************************************************
-//Crossfall Record
-//***********************************************************************************
-/**
- * Constructor which intializes the basic properties
- */
-Crossfall::Crossfall (string side, double s, double a, double b, double c, double d):ThirdOrderPolynom(s,a,b,c,d)
-{	
-	mSide=side;	
-}
-
-/**
- * Getters for the crossfall side
- */
-string Crossfall::GetSide()
-{
-	return mSide;
-}
-
-/**
- * Setters for the crossfall side
- */
-void Crossfall::SetSide(string side)
-{
-	mSide=side;
-}
-

+ 0 - 567
src/tool/map_lanetoxodr/OpenDrive/Road.h

@@ -1,567 +0,0 @@
-#ifndef ROAD_H
-#define ROAD_H
-
-#include <vector>
-#include <string>
-
-#include "RoadGeometry.h"
-#include "Lane.h"
-#include "Junction.h"
-#include "ObjectSignal.h"
-#include "OtherStructures.h"
-
-//--Prototypes--
-//road
-class Road;
-class RoadLink;
-class RoadNeighbor;
-class RoadTypeSpeed;
-class RoadType;
-class GeometryBlock;
-class Elevation;
-class SuperElevation;
-class Crossfall;
-//lanes
-class LaneSection;
-class LaneSectionSample;
-class LaneOffset;
-//objects, signals
-class Object;
-class Signal;
-//--------------
-
-using std::vector;
-using std::string;
-
-/**
- * One of the main classes in OpenDrive structure
- * Holds the properties of the Road record and vectors for child records
- * Has methods to add, clone, get and delete those child records
- * as well as evaluation methods used, for example, to render the road
- *
- */
-class Road
-{
-private:
-	// Main road record properties
-	string mName;
-	double mLength;
-	string mId;
-	string mJunction;
-    string mRule;
-
-	// Linking complex properties (have multiple sub-properties)
-	RoadLink* mPredecessor;
-	RoadLink* mSuccessor;
-	RoadNeighbor* mNeighbor1;
-	RoadNeighbor* mNeighbor2;
-
-	/**
-	 * Vectors used to store the child records of the road
-	 * such as chordline geometry, elevation profiles, etc
-	 */
-	// Road type vector
-	vector<RoadType> mRoadTypeVector;
-	// Geometry block vector
-	vector<GeometryBlock> mGeometryBlockVector; 
-	// Elevation Profile vector
-	vector<Elevation> mElevationVector;
-	// Superelevation vector
-	vector<SuperElevation> mSuperElevationVector;
-	// Crossfall vector
-	vector<Crossfall> mCrossfallVector;
-	// Lane Section vector
-	vector<LaneSection> mLaneSectionsVector;
-    // Lane offset vector
-    vector<LaneOffset> mLaneOffsetVector;
-	// Objects vectors
-	vector<Object> mObjectsVector;
-	// Signal vector
-	vector<Signal> mSignalsVector;
-
-	/**
-	 * Indices of the last added child records
-	 */
-	unsigned int mLastAddedRoadType;
-	unsigned int mLastAddedGeometryBlock;
-	unsigned int mLastAddedElevation;
-	unsigned int mLastAddedSuperElevation;
-	unsigned int mLastAddedCrossfall;
-	unsigned int mLastAddedLaneSection;
-    unsigned int mLastAddedLaneOffset;
-	unsigned int mLastAddedObject;
-	unsigned int mLastAddedSignal;
-
-public:
-	/**
-	 * Constructor
-	 */
-	Road();
-
-	/**
-	 * Constructor that initializes the road with base properties
-	 * 
-	 * @param name Name of the road
-	 * @param length Length of the road
-	 * @param id Unique ID of the road
-	 * @param junction ID of the junction, this road might be a part of
-	 */
-	Road(string name, double length, string id, string junction);
-
-	/**
-	 * Copy constructor
-	 */
-	Road (const Road& road);
-
-	/**
-	 * Assignment operator overload
-	 */
-	const Road& operator=(const Road& rhs);
-	//-------------------------------------------------
-
-	/**
-	 * Getters for the base properties of the road
-	 */
-	string GetRoadName() const;
-	double GetRoadLength() const;
-	string GetRoadId() const;
-	string GetRoadJunction() const;
-    string GetRoadRule() const;
-	
-	/**
-	 * Getters for the linking properties of the road
-	 */
-	RoadLink* GetPredecessor();
-	RoadLink* GetSuccessor();
-	RoadNeighbor* GetNeighbor1();
-	RoadNeighbor* GetNeighbor2();
-
-	/**
-	 * Getters for the child records and their vectors
-	 */
-	// Road type records
-	vector<RoadType> *GetRoadTypeVector();
-	RoadType* GetRoadType(unsigned int i);
-	unsigned int GetRoadTypeCount();
-	// Road geometry records
-	vector<GeometryBlock> *GetGeometryBlockVector();
-	GeometryBlock* GetGeometryBlock(unsigned int i);
-	unsigned int GetGeometryBlockCount();
-	// Road elevation records
-	vector<Elevation> *GetElevationVector();
-	Elevation*	GetElevation(unsigned int i);
-	unsigned int GetElevationCount();
-	// Road superelevation records
-	vector<SuperElevation> *GetSuperElevationVector();
-	SuperElevation*	GetSuperElevation(unsigned int i);
-	unsigned int GetSuperElevationCount();
-	// Road crossfall records
-	vector<Crossfall> *GetCrossfallVector();
-	Crossfall*	GetCrossfall(unsigned int i);
-	unsigned int GetCrossfallCount();
-	// Road lane section records
-	vector<LaneSection> *GetLaneSectionVector();
-	LaneSection*	GetLaneSection(unsigned int i);
-	unsigned int GetLaneSectionCount();
-    //Road lane offset records
-    vector<LaneOffset> * GetLaneOffsetVector();
-    LaneOffset* GetLaneOffset(unsigned int i);
-    unsigned int GetLaneOffsetCount();
-	// Road object records
-	vector<Object> *GetObjectVector();
-	Object*	GetObject(unsigned int i);
-	unsigned int GetObjectCount();
-	// Road signal records
-	vector<Signal> *GetSignalVector();
-	Signal*	GetSignal(unsigned int i);
-	unsigned int GetSignalCount();
-	//-------------------------------------------------
-
-	/**
-	 * Getters for the last child records in their respective vectors
-	 */
-	RoadType*		GetLastRoadType();
-	GeometryBlock*	GetLastGeometryBlock();
-	Elevation*		GetLastElevation();
-	SuperElevation*	GetLastSuperElevation();
-	Crossfall*		GetLastCrossfall();
-	LaneSection*	GetLastLaneSection();
-	Object*			GetLastObject();
-	Signal*			GetLastSignal();
-
-	/**
-	 * Getters for the last added child records in their respective vectors
-	 */
-	RoadType*		GetLastAddedRoadType();
-	GeometryBlock*	GetLastAddedGeometryBlock();
-	Elevation*		GetLastAddedElevation();
-	SuperElevation*	GetLastAddedSuperElevation();
-	Crossfall*		GetLastAddedCrossfall();
-	LaneSection*	GetLastAddedLaneSection();
-	Object*			GetLastAddedObject();
-	Signal*			GetLastAddedSignal();
-
-	//-------------------------------------------------
-
-	/**
-	 * Setters for the base road properties
-	 */
-	void SetRoadName(string name);
-	void SetRoadLength(double length);
-	void SetRoadId(string roadId);
-	void SetRoadJunction(string junction);
-    void SetRoadRule(string rule);
-
-	/**
-	 * Setters for the linking road properties
-	 */
-	void SetPredecessor(string elementType, string elementId, string contactPoint);
-	void SetSuccessor(string elementType, string elementId, string contactPoint);
-	void SetNeighbor(string side, string elementId, string direction);
-	void SetNeighbor1(string side, string elementId, string direction);
-	void SetNeighbor2(string side, string elementId, string direction);
-	
-	/**
-	 * Removers for the linking road properties
-	 */
-	void RemovePredecessor();
-	void RemoveSuccessor();
-	void RemoveNeighbor1();
-	void RemoveNeighbor2();
-
-	//-------------------------------------------------
-
-	/**
-	 * Methods used to add child records to the respective vectors
-	 */
-    unsigned int AddRoadType(double s, string type,string country = "");
-	unsigned int AddGeometryBlock();
-	unsigned int AddElevation(double s, double a, double b, double c, double d);
-	unsigned int AddSuperElevation(double s, double a, double b, double c, double d);
-	unsigned int AddCrossfall (string side, double s, double a, double b, double c, double d);
-	unsigned int AddLaneSection(double s);
-    unsigned int AddLaneOffset(double s,double a,double b,double c,double d);
-    unsigned int AddObject(string id,double s,double t,double zOffset);
-    unsigned int AddSignal(double s,double t,string id,string name,bool dynamic,string orientation,double zOffset,string type,string country,string countryRevision,
-                           string subtype,double hOffset,double pitch,double roll ,double height,double width);
-
-	/**
-	 * Methods used to clone child records in the respective vectors
-	 */
-	unsigned int CloneRoadType(unsigned int index);
-	unsigned int CloneElevation(unsigned int index);
-	unsigned int CloneSuperElevation(unsigned int index);
-	unsigned int CloneCrossfall(unsigned int index);
-	unsigned int CloneLaneSection(unsigned int index);
-	unsigned int CloneLaneSectionEnd(unsigned int index);
-	unsigned int CloneObject(unsigned int index);
-	unsigned int CloneSignal(unsigned int index);
-
-	/**
-	 * Methods used to delete child records from the respective vectors
-	 */
-	void DeleteRoadType(unsigned int index);
-	void DeleteGeometryBlock(unsigned int index);
-	void DeleteElevation(unsigned int index);
-	void DeleteSuperElevation(unsigned int index);
-	void DeleteCrossfall(unsigned int index);
-	void DeleteLaneSection(unsigned int index);
-    void DeleteLaneOffset(unsigned int index);
-	void DeleteObject(unsigned int index);
-	void DeleteSignal(unsigned int index);
-	
-	//-------------------------------------------------
-
-	/**
-	 * Recalculates the chordline geometry of the road
-	 */
-	void RecalculateGeometry();
-
-	//-------------------------------------------------
-	// EVALUATION METHODS
-
-	/**
-	 * Geometry evaluation
-	 */
-	bool CheckGeometryInterval (double s_check);
-	bool CheckGeometryInterval (double s_check, string &roadId);
-	short int GetGeometryCoords(double s_check, double &retX, double &retY);
-	short int GetGeometryCoords(double s_check, double &retX, double &retY, double &retHDG);
-	
-
-	/**
-	 * Other evaluation
-	 */
-	int CheckRoadTypeInterval(double s_check);
-	string GetRoadTypeValue(double s_check);
-
-	int CheckElevationInterval(double s_check);
-	double GetElevationValue (double s_check);
-
-	int CheckSuperElevationInterval(double s_check);
-	double GetSuperElevationValue (double s_check);
-
-	int CheckCrossfallInterval(double s_check);
-	void GetCrossfallValue (double s_check, double &angleLeft, double &angleRight);
-
-	int CheckLaneSectionInterval(double s_check);
-	void FillLaneSectionSample(double s_check, LaneSectionSample &laneSectionSample);
-
-    int CheckLaneOffsetInterval(double s_check);
-	
-	//-------------------------------------------------
-
-	/**
-	 * Destructor
-	 */
-	~Road();
-};
-
-
-//----------------------------------------------------------------------------------
-/**
- * RoadLink class is used to store information about road's predecessors/successors
- *
- *
- *
- *
- */
-class RoadLink
-{
-private:
-	/**
-	 * Base properties of a successor/predecessor record
-	 */
-	string mElementType;
-	string mElementId;
-	string mContactPoint;
-
-    double mElementS = -1.0;
-    string mElementDir;
-
-public:
-	/**
-	 * Constructor which intializes the base properties
-	 */
-	RoadLink(string elementType, string elementId, string contactPoint);
-	
-	/**
-	 * Setters for the base properties
-	 */
-	void SetElementType(string elementType);
-	void SetElementId(string elementId);
-	void SetContactPoint(string contactPoint);
-
-    void SetElementS(double value);
-    void SetELementDir(string elementdir);
-	
-
-	/**
-	 * Getters for the base properties
-	 */
-	string GetElementType();
-	string GetElementId();
-	string GetContactPoint();
-
-    double GetElementS();
-    string GetElementDir();
-};
-
-
-
-//----------------------------------------------------------------------------------
-/**
- * RoadLink class is used to store information about road's neighbors
- *
- *
- *
- *
- */
-class RoadNeighbor
-{
-private:
-	/**
-	 * Base properties of a neighbor record
-	 */
-	string mSide;
-	string mElementId;
-	string mDirection;
-public:
-	/**
-	 * Constructor which intializes the base properties
-	 */
-	RoadNeighbor(string side, string elementId, string direction);
-	
-	/**
-	 * Setters for the base properties
-	 */
-	void SetSide(string side);
-	void SetElementId(string elementId);
-	void SetDirection(string direction);
-	
-	/**
-	 * Getters for the base properties
-	 */
-	string GetSide();
-	string GetElementId();
-	string GetDirection();
-};
-
-/**
- * RoadType class is used to store information about a road type speed record
- *
- *
- *
- *
- */
-class RoadTypeSpeed
-{
-private:
-    /**
-     * Base properties of a road type speed
-     */
-    double mmaxSpeed;
-    string munit;
-
-public:
-    /**
-     * Constructor which intializes the base properties
-     */
-    RoadTypeSpeed (double maxSpeed, string unit);
-
-    /**
-     * Setters for the base properties
-     */
-    void SetmaxSpeed(double value);
-    void Setunit(string unit);
-
-    /**
-     * Getters for the base properties
-     */
-    double GetmaxSpeed();
-    string Getunit();
-
-};
-
-//----------------------------------------------------------------------------------
-/**
- * RoadType class is used to store information about a road type record
- *
- *
- *
- *
- */
-class RoadType
-{
-private:
-	/**
-	 * Base properties of a road type
-	 */
-	double mS;
-	string mType;
-    string mCountry;
-
-    // Road type vector
-    vector<RoadTypeSpeed> mRoadTypeSpeedVector;
-
-public:
-	/**
-	 * Constructor which intializes the base properties
-	 */
-    RoadType (double s, string type,string country="");
-	
-	/**
-	 * Setters for the base properties
-	 */
-	void SetS(double value);
-	void SetType(string type);
-    void SetCountry(string country);
-	
-	/**
-	 * Getters for the base properties
-	 */
-	double GetS();
-	string GetType();
-    string GetCountry();
-
-    // Road type Speed records
-    vector<RoadTypeSpeed> *GetRoadTypeSpeedVector();
-    RoadTypeSpeed * GetRoadTypeSpeed(unsigned int i);
-    unsigned int GetRoadTypeSpeedCount();
-
-    unsigned int AddRoadTypeSpeed(double maxSpeed,string unit);
-    void DeleteRoadTypeSpeed(unsigned int index);
-};
-
-//----------------------------------------------------------------------------------
-/**
- * Elevation class is used to store information about a road elevation record
- * It inherits the Polynom class and has no additional properties
- *
- *
- *
- */
-class Elevation : public ThirdOrderPolynom
-{
-public:
-	/**
-	 * Constructor which intializes the base properties
-	 */
-	Elevation(double s, double a, double b, double c, double d);
-};
-//----------------------------------------------------------------------------------
-
-
-/**
- * Superlevation class is used to store information about a road superelevation record
- * It inherits the Polynom class and has no additional properties
- *
- *
- *
- */
-class SuperElevation : public ThirdOrderPolynom
-{
-public:
-	/**
-	 * Constructor which intializes the base properties
-	 */
-	SuperElevation(double s, double a, double b, double c, double d);
-};
-//----------------------------------------------------------------------------------
-
-/**
- * Crossfall class is used to store information about a road superelevation record
- * It inherits the Polynom class and has one additional properties
- *
- *
- *
- */
-class Crossfall : public ThirdOrderPolynom
-{
-private:
-	/**
-	 * Base crossfall property
-	 */
-	string mSide;
-	
-public:
-	/**
-	 * Constructor which intializes the base properties
-	 */
-	Crossfall (string side, double s, double a, double b, double c, double d);
-	
-	/**
-	 * Setter for the crossfall side
-	 */
-	void SetSide(string side);
-	
-	/**
-	 * Getter for the crossfall side
-	 */
-	string GetSide();
-};
-
-//----------------------------------------------------------------------------------
-
-
-#endif

+ 0 - 1170
src/tool/map_lanetoxodr/OpenDrive/RoadGeometry.cpp

@@ -1,1170 +0,0 @@
-#include "RoadGeometry.h"
-#define _USE_MATH_DEFINES
-#include <math.h>
-
-//#define PI 3.14159265358979323846264338327950288
-extern int fresnl( double , double *, double * );
-
-
-//***********************************************************************************
-//Road Geometry Base Class
-//***********************************************************************************
-/**
- * Constructor that initializes the base properties of teh record
- */
-RoadGeometry::RoadGeometry(double s, double x, double y, double hdg, double length)
-{
-	mS=s;	mX=x; mY=y, mHdg=hdg, mLength=length;
-	mS2=s+length;
-}
-
-/**
- * Computes the required vars
- */
-void RoadGeometry::ComputeVars()
-{}
-
-/**
- * Clones and returns the new geometry record
- */
-RoadGeometry* RoadGeometry::Clone() const
-{
-	return new RoadGeometry(mS,mX,mY, mHdg, mLength);
-}
-//-------------------------------------------------
-
-/**
- * Sets the type of the geometry
- * 0: Line, 1: Arc, 2: Spiral
- */
-void RoadGeometry::SetGeomType(short int geomType)
-{	
-	mGeomType = geomType;	
-}
-
-
-double RoadGeometry::CalcHdg(double x0, double y0, double x1, double y1)
-{
-    if(x0 == x1)
-    {
-        if(y0 < y1)
-        {
-            return M_PI/2.0;
-        }
-        else
-            return M_PI*3.0/2.0;
-    }
-
-    double ratio = (y1-y0)/(x1-x0);
-
-    double hdg = atan(ratio);
-
-    if(ratio > 0)
-    {
-        if(y1 > y0)
-        {
-
-        }
-        else
-        {
-            hdg = hdg + M_PI;
-        }
-    }
-    else
-    {
-        if(y1 > y0)
-        {
-            hdg = hdg + M_PI;
-        }
-        else
-        {
-            hdg = hdg + 2.0*M_PI;
-        }
-    }
-
-    return hdg;
-}
-
-/**
- * Setter for the base properties
- */
-void RoadGeometry::SetBase(double s, double x, double y, double hdg, double length, bool recalculate)
-{
-	mS=s;
-	mX=x;
-	mY=y;
-	mHdg=hdg;
-	mLength=length;
-	mS2=mS+mLength;
-	if(recalculate) ComputeVars();
-}
-void RoadGeometry::SetS(double s)
-{
-	mS=s;
-	mS2=mS+mLength;
-	ComputeVars();
-}
-void RoadGeometry::SetX(double x)
-{
-	mX=x;
-}
-void RoadGeometry::SetY(double y)
-{
-	mY=y;
-}
-void RoadGeometry::SetHdg(double hdg)
-{
-	mHdg=hdg;
-	ComputeVars();
-}
-void RoadGeometry::SetLength(double length)
-{
-	mLength=length;
-	mS2=mS+mLength;
-	ComputeVars();
-}
-//-------------------------------------------------
-
-/**
- * Getter for the geometry type
- */
-short int RoadGeometry::GetGeomType()
-{	
-	return mGeomType;
-}
-
-/**
- * Getter for the base properties
- */
-double RoadGeometry::GetS()
-{
-	return mS;
-}
-double RoadGeometry::GetS2()
-{
-	return mS2;
-}
-double RoadGeometry::GetX()
-{
-	return mX;
-}
-double RoadGeometry::GetY()
-{
-	return mY;
-}
-double RoadGeometry::GetHdg()
-{
-	return mHdg;
-}
-double RoadGeometry::GetLength()
-{
-	return mLength;
-}
-
-//-------------------------------------------------
-
-/**
- * Checks if the sample S gets in the current block interval
- */
-bool RoadGeometry::CheckInterval (double s_check)
-{
-	if ((s_check >= mS) && (s_check<=mS2))
-		return true;
-	else
-		return false;
-}
-
-/**
- * Gets the coordinates at the sample S offset
- */
-void  RoadGeometry::GetCoords(double s_check, double &retX, double &retY)
-{
-	double tmp;
-	GetCoords(s_check, retX, retY, tmp);
-}
-void RoadGeometry::GetCoords(double s_check, double &retX, double &retY, double &retHDG)
-{}
-
-
-
-//***********************************************************************************
-//Line geometry 
-//***********************************************************************************
-/**
- * Constructor that initializes the base properties of the record
- */
-GeometryLine::GeometryLine (double s, double x, double y, double hdg, double length):	RoadGeometry(s, x, y, hdg, length)
-{	
-	SetGeomType(0);	
-}
-
-/**
- * Clones and returns the new geometry record
- */
-RoadGeometry* GeometryLine::Clone() const
-{
-	GeometryLine* ret=new GeometryLine(mS,mX,mY, mHdg, mLength);
-	return ret;
-}
-
-//-------------------------------------------------
-
-/**
- * Setter for the base properties
- */
-void GeometryLine::SetAll(double s, double x, double y, double hdg, double length)
-{
-	SetBase(s,x,y,hdg,length,false);
-	ComputeVars();
-}
-
-//-------------------------------------------------
-
-/**
- * Gets the coordinates at the sample S offset
- */
-void GeometryLine::GetCoords(double s_check, double &retX, double &retY, double &retHDG)
-{
-	double newLength=s_check-mS;
-	//find the end of the chord line
-	retX=mX+cos(mHdg)*newLength;
-	retY=mY+sin(mHdg)*newLength;
-
-	retHDG=mHdg;
-}
-
-
-
-
-
-//***********************************************************************************
-//Arc geometry
-//***********************************************************************************
-/**
- * Constructor that initializes the base properties of the record
- */
-GeometryArc::GeometryArc (double s, double x, double y, double hdg, double length, double curvature):	RoadGeometry(s, x, y, hdg, length)
-{
-    SetGeomType(2);
-	mCurvature=curvature;
-
-	ComputeVars();
-}
-
-/**
- * Computes the required vars
- */
-void GeometryArc::ComputeVars()
-{
-	double radius=0.0;
-	//if curvature is 0, radius is also 0, otherwise, radius is 1/curvature
-	if (fabs(mCurvature)>1.00e-15)
-	{
-		radius = fabs(1.0/mCurvature);
-	}
-	//calculate the start angle for the arc plot
-	if (mCurvature<=0)
-		mStartAngle=mHdg+M_PI_2; 
-	else
-		mStartAngle=mHdg-M_PI_2;
-
-	mCircleX=mX+cos(mStartAngle-M_PI)*radius;
-	mCircleY=mY+sin(mStartAngle-M_PI)*radius;
-}
-
-/**
- * Clones and returns the new geometry record
- */
-RoadGeometry* GeometryArc::Clone() const
-{
-	GeometryArc* ret=new GeometryArc(mS,mX,mY, mHdg, mLength, mCurvature);
-	return ret;
-}
-
-//-------------------------------------------------
-
-/**
- * Setter for the base properties
- */
-void GeometryArc::SetAll(double s, double x, double y, double hdg, double length, double curvature)
-{
-	SetBase(s,x,y,hdg,length,false);
-	mCurvature=curvature;
-	
-	ComputeVars();
-}
-void GeometryArc::SetCurvature(double curvature)
-{
-	mCurvature=curvature;
-	ComputeVars();
-}
-
-//-------------------------------------------------
-
-/**
- * Getter for the base properties
- */
-double GeometryArc::GetCurvature()
-{
-	return mCurvature;
-}
-
-//-------------------------------------------------
-
-/**
- * Gets the coordinates at the sample S offset
- */
-void GeometryArc::GetCoords(double s_check, double &retX, double &retY, double &retHDG)
-{
-	//s from the beginning of the segment
-	double currentLength = s_check - mS;
-	double endAngle=mStartAngle;
-	double radius=0.0;
-	//if curvature is 0, radius is also 0, so don't add anything to the initial radius, 
-	//otherwise, radius is 1/curvature so the central angle can be calculated and added to the initial direction
-	if (fabs(mCurvature)>1.00e-15)
-	{
-		endAngle+= currentLength/(1.0/mCurvature);
-		radius = fabs(1.0/mCurvature);
-	}
-
-	//coords on the arc for given s value
-	retX=mCircleX+cos(endAngle)*radius;
-	retY=mCircleY+sin(endAngle)*radius;
-
-	//heading at the given position
-	if (mCurvature<=0)
-		retHDG=endAngle-M_PI_2; 
-	else
-		retHDG=endAngle+M_PI_2;
-}
-
-
-
-
-
-
-//***********************************************************************************
-//Spiral geometry
-//***********************************************************************************
-const double GeometrySpiral::sqrtPiO2=sqrt(M_PI_2);
-/**
- * Constructor that initializes the base properties of the record
- */
-GeometrySpiral::GeometrySpiral (double s, double x, double y, double hdg, double length, double curvatureStart,double curvatureEnd):	RoadGeometry(s, x, y, hdg, length)
-{
-    SetGeomType(1);
-	mCurvatureStart=curvatureStart;
-	mCurvatureEnd=curvatureEnd;
-	ComputeVars();
-}
-
-/**
- * Computes the required vars
- */
-void GeometrySpiral::ComputeVars()
-{
-	mA=0;
-
-	//if the curvatureEnd is the non-zero curvature, then the motion is in normal direction along the spiral
-	if ((fabs(mCurvatureEnd)>1.00e-15)&&(fabs(mCurvatureStart)<=1.00e-15))
-	{
-		mNormalDir=true;
-		mCurvature=mCurvatureEnd;
-		//Calculate the normalization term : a = 1.0/sqrt(2*End_Radius*Total_Curve_Length) 
-		mA=1.0/sqrt(2*1.0/fabs(double(mCurvature))*mLength);			
-		//Denormalization Factor
-		mDenormalizeFactor=1.0/mA;	
-
-		//Calculate the sine and cosine of the heading angle used to rotate the spiral according to the heading
-		mRotCos=cos(mHdg);
-		mRotSin=sin(mHdg);
-	}
-	//else the motion is in the inverse direction along the spiral
-	else
-	{
-		mNormalDir=false;
-		mCurvature=mCurvatureStart;
-		//Calculate the normalization term : a = 1.0/sqrt(2*End_Radius*Total_Curve_Length) 
-		mA=1.0/sqrt(2*1.0/fabs(mCurvature)*mLength);			
-
-		//Because we move in the inverse direction, we need to rotate the curve according to the heading
-		//around the last point of the normalized spiral
-		//Calculate the total length, normalize it and divide by sqrtPiO2, then, calculate the position of the final point.
-		double L=(mS2-mS)*mA/sqrtPiO2;							
-		fresnl(L,&mEndY,&mEndX);
-		//Invert the curve if the curvature is negative
-		if (mCurvature<0)
-			mEndY=-mEndY;
-
-		//Denormalization factor
-		mDenormalizeFactor=1.0/mA;									
-		//Find the x,y coords of the final point of the curve in local curve coordinates
-		mEndX*=mDenormalizeFactor*sqrtPiO2;						
-		mEndY*=mDenormalizeFactor*sqrtPiO2;
-
-		//Calculate the tangent angle
-		differenceAngle=L*L*(sqrtPiO2*sqrtPiO2);
-		double diffAngle;
-		//Calculate the tangent and heading angle difference that will be used to rotate the spiral
-		if (mCurvature<0)
-		{
-			diffAngle=mHdg-differenceAngle-M_PI;
-		}
-		else
-		{
-			diffAngle=mHdg+differenceAngle-M_PI;
-		}
-
-		//Calculate the sine and cosine of the difference angle
-		mRotCos=cos(diffAngle);
-		mRotSin=sin(diffAngle);
-	}
-}
-
-/**
- * Clones and returns the new geometry record
- */
-RoadGeometry* GeometrySpiral::Clone() const
-{
-	GeometrySpiral* ret=new GeometrySpiral(mS,mX,mY, mHdg, mLength, mCurvatureStart, mCurvatureEnd);
-	return ret;
-}
-
-
-//-------------------------------------------------
-
-/**
- * Setter for the base properties
- */
-void GeometrySpiral::SetAll(double s, double x, double y, double hdg, double length, double curvatureStart,double curvatureEnd)
-{
-	SetBase(s,x,y,hdg,length,false);
-	mCurvatureStart=curvatureStart;
-	mCurvatureEnd=curvatureEnd;
-	ComputeVars();
-}
-void GeometrySpiral::SetCurvatureStart(double curvature)
-{
-	mCurvatureStart=curvature;
-	ComputeVars();
-}
-void GeometrySpiral::SetCurvatureEnd(double curvature)
-{
-	mCurvatureEnd=curvature;
-	ComputeVars();
-}
-
-//-------------------------------------------------
-
-/**
- * Getter for the base properties
- */
-double GeometrySpiral::GetCurvatureStart()
-{
-	return mCurvatureStart;
-}
-double GeometrySpiral::GetCurvatureEnd()
-{
-	return mCurvatureEnd;
-}
-
-//-------------------------------------------------
-/**
- * Gets the coordinates at the sample S offset
- */
-void GeometrySpiral::GetCoords(double s_check, double &retX, double &retY, double &retHDG)
-{
-	double l=0.0;
-	double tmpX=0.0, tmpY=0.0;
-
-	//Depending on the moving direction, calculate the length of the curve from its beginning to the current point and normalize
-	//it by multiplying with the "a" normalization term
-	//Cephes lib for solving Fresnel Integrals, uses cos/sin (PI/2 * X^2) format in its function.
-	//So, in order to use the function, transform the argument (which is just L) by dividing it by the sqrt(PI/2) factor and multiply the results by it.
-	if (mNormalDir)
-	{ 
-		l=(s_check-mS)*mA/sqrtPiO2;
-	}
-	else
-	{
-		l=(mS2-s_check)*mA/sqrtPiO2;		
-	}
-
-	//Solve the Fresnel Integrals
-	fresnl(l,&tmpY,&tmpX);
-	//If the curvature is negative, invert the curve on the Y axis
-	if (mCurvature<0)
-		tmpY=-tmpY;
-
-	//Denormalize the results and multiply by the sqrt(PI/2) term
-	tmpX*=mDenormalizeFactor*sqrtPiO2;	
-	tmpY*=mDenormalizeFactor*sqrtPiO2;
-
-	//Calculate the heading at the found position. Kill the sqrt(PI/2) term that was added to the L
-	l=(s_check-mS)*mA;
-	double tangentAngle = l*l;
-	if (mCurvature<0)
-		tangentAngle=-tangentAngle;
-	retHDG=mHdg+tangentAngle;
-
-
-	if (!mNormalDir)
-	{
-		//If we move in the inverse direction, translate the spiral in order to rotate around its final point
-		tmpX-=mEndX;	
-		tmpY-=mEndY;
-		//also invert the spiral in the y axis
-		tmpY=-tmpY;
-	}
-
-	//Translate the curve to the required position and rotate it according to the heading
-	retX=mX+ tmpX*mRotCos-tmpY*mRotSin;
-	retY=mY+ tmpY*mRotCos+tmpX*mRotSin;
-}
-
-
-
-
-
-//***********************************************************************************
-//Cubic Polynom geometry. Has to be implemented
-//***********************************************************************************
-/**
- * Constructor that initializes the base properties of the record
- */
-GeometryPoly3::GeometryPoly3 (double s, double x, double y, double hdg, double length, double a, double b,double c, double d ):	RoadGeometry(s, x, y, hdg, length)
-{	
-	SetGeomType(3); mA=a; mB=b; mC=c; mD=d;	
-    UpdateSamplePoint();
-}
-
-void GeometryPoly3::UpdateSamplePoint()
-{
-    double u = 0.0;
-    double du = 0.1;
-    geosamplepoint gsp;
-    gsp.s = 0;
-    gsp.x = mA;
-    gsp.y = 0.0;
-    vector<geosamplepoint> xvectorgeosample;
-    xvectorgeosample.clear();
-    xvectorgeosample.push_back(gsp);
-    u = du;
-    double v;
-    double flen = 0.0;
-    double oldu,oldv;
-    oldu = xvectorgeosample[0].x;
-    oldv = xvectorgeosample[0].y;
-    while(flen <= mLength)
-    {
-        double fdis = 0;
-        v = mA + mB*u + mC*u*u + mD*u*u*u;
-        fdis = sqrt(pow(u- oldu,2)+pow(v-oldv,2));
-        oldu = u;
-        oldv = v;
-        flen = flen + fdis;
-
-        gsp.s = flen;
-        gsp.x = u;
-        gsp.y = v;
-        xvectorgeosample.push_back(gsp);
-
-        if(fdis < 0.05)
-        {
-            if(fdis > 0)
-            {
-                du = du * 0.1/fdis;
-            }
-        }
-        if(fdis > 0.2)
-        {
-            du = du * 0.1/fdis;
-        }
-        u = u + du;
-
-
-    }
-
-    if(xvectorgeosample.size() < 2)
-    {
-        mvectorgeosample.clear();
-        gsp.s = 0;
-        gsp.x = mX;
-        gsp.y = mY;
-        gsp.fHdg = mHdg;
-        mvectorgeosample.push_back(gsp);
-        return;
-    }
-
-    double ds = 0.1;
-    double s =0;
-    int ipos1 = 0;
-    int ipos2= 1;
-    mvectorgeosample.clear();
-    while(s<mLength)
-    {
-        while(xvectorgeosample[ipos2].s<=s)
-        {
-            if(ipos2 == (xvectorgeosample.size()-1))
-            {
-                ipos1 = ipos2;
-                break;
-            }
-            else
-            {
-                ipos2++;
-                ipos1 = ipos2 -1;
-            }
-        }
-
-        gsp.s = s;
-        if(ipos1 == ipos2)
-        {
-            gsp.x = xvectorgeosample[ipos1].x;
-            gsp.y = xvectorgeosample[ipos1].y;
-            if(ipos1 == 0)
-            {
-                gsp.fHdg = mHdg;
-            }
-            else
-            {
-                gsp.fHdg = CalcHdg(xvectorgeosample[ipos1-1].x,xvectorgeosample[ipos1-1].y,
-                        xvectorgeosample[ipos1].x,xvectorgeosample[ipos1].y);
-            }
-
-        }
-        else
-        {
-            double fratio = 0.5;
-            double x1,y1,x2,y2;
-            x1 = xvectorgeosample[ipos1].x;
-            y1 = xvectorgeosample[ipos1].y;
-            x2 = xvectorgeosample[ipos2].x;
-            y2 = xvectorgeosample[ipos2].y;
-            if(xvectorgeosample[ipos1].s != xvectorgeosample[ipos2].s)
-            {
-                fratio = (s - xvectorgeosample[ipos1].s)/(xvectorgeosample[ipos2].s - xvectorgeosample[ipos1].s);
-            }
-            gsp.x = x1 + fratio * (x2 - x1);
-            gsp.y = y1 + fratio * (y2 - y1);
-            if(mvectorgeosample.size() == 0)
-            {
-                gsp.fHdg = mHdg;
-            }
-            else
-            {
-                gsp.fHdg = (mvectorgeosample[mvectorgeosample.size() -1].x,mvectorgeosample[mvectorgeosample.size() -1].y,
-                        gsp.x,gsp.y);
-            }
-        }
-        mvectorgeosample.push_back(gsp);
-
-        s = s+ ds;
-    }
-
-//    vector<geosamplepoint> * pxvectorgeosample = &mvectorgeosample;
-    mbHaveSample = true;
-
-}
-
-/**
- * Clones and returns the new geometry record
- */
-RoadGeometry* GeometryPoly3::Clone() const
-{
-	GeometryPoly3* ret=new GeometryPoly3(mS,mX,mY, mHdg, mLength, mA, mB, mC, mD);
-	return ret;
-}
-
-//-------------------------------------------------
-/**
- * Setter for the base properties
- */
-void GeometryPoly3::SetAll(double s, double x, double y, double hdg, double length, double a,double b,double c,double d)
-{
-	SetBase(s,x,y,hdg,length,false);
-	mA=a;
-	mB=b;
-	mC=c;
-	mD=d;
-	ComputeVars();
-    UpdateSamplePoint();
-}
-
-//GetA to GetD, Added by Yuchuli
-double GeometryPoly3::GetA()
-{
-    return mA;
-}
-
-double GeometryPoly3::GetB()
-{
-    return mB;
-}
-
-double GeometryPoly3::GetC()
-{
-    return mC;
-}
-
-double GeometryPoly3::GetD()
-{
-    return mD;
-}
-
-
-void GeometryPoly3::GetCoords(double s_check, double &retX, double &retY, double &retHDG)
-{
-    if(mbHaveSample &&(mvectorgeosample.size() > 1))
-    {
-        double fpos = s_check/0.1;
-        unsigned int ipos = fpos;
-        double temX,temY,temHDG;
-        if(ipos<=0)
-        {
-            temX = mvectorgeosample[ipos].x;
-            temY = mvectorgeosample[ipos].y;
-            temHDG = mHdg;
-        }
-        else
-        {
-            if(ipos>=(mvectorgeosample.size()-1))
-            {
-                temX = mvectorgeosample[mvectorgeosample.size()-1].x;
-                temY = mvectorgeosample[mvectorgeosample.size()-1].y;
-                temHDG = mvectorgeosample[mvectorgeosample.size() -1].fHdg;
-            }
-            else
-            {
-                temX = mvectorgeosample[ipos].x;
-                temY = mvectorgeosample[ipos].y;
-                temHDG = mvectorgeosample[ipos].fHdg;
-            }
-        }
-        retX = mX + temX*cos(mHdg) - temY*sin(mHdg);
-        retY = mY + temX*sin(mHdg) + temY*cos(mHdg);
-        retHDG = mHdg + temHDG;
-        if(retHDG >= 2.0*M_PI)retHDG = retHDG - 2.0*M_PI;
-        return;
-    }
-    double currentLength = s_check - mS;
-    double flen = 0;
-    double u=0;
-    double v;
-    double x,y;
-    double oldx,oldy;
-    oldx = mX;
-    oldy = mY;
-    double du =0.1;
-    retHDG = mHdg;
-    if(currentLength<du)
-    {
-        retX = mX;
-        retY = mY;
-        retHDG = mHdg;
-        return;
-    }
-    u = du;
-    while(flen <= currentLength)
-    {
-        double fdis = 0;
-        v = mA + mB*u + mC*u*u + mD*u*u*u;
-        x = mX + u*cos(mHdg) - v*sin(mHdg);
-        y = mY + u*sin(mHdg) + v*cos(mHdg);
-        fdis = sqrt(pow(x- oldx,2)+pow(y-oldy,2));
-        oldx = x;
-        oldy = y;
-        flen = flen + fdis;
-        u = u + du;
-        retHDG = CalcHdg(oldx,oldy,x,y);
-
-    }
-}
-//***********************************************************************************
-//Cubic Polynom geometry. Has to be implemented.  Added By Yuchuli
-//***********************************************************************************
-
-/**
- * Constructor that initializes the base properties of the record
- */
-GeometryParamPoly3::GeometryParamPoly3 (double s, double x, double y, double hdg, double length,double ua,double ub,double uc,double ud,double va, double vb, double vc,double vd  ):	RoadGeometry(s, x, y, hdg, length)
-{
-    SetGeomType(4); muA=ua; muB=ub; muC=uc; muD=ud;mvA=va; mvB=vb; mvC=vc; mvD=vd;
-}
-
-/**
- * Clones and returns the new geometry record
- */
-RoadGeometry* GeometryParamPoly3::Clone() const
-{
-    GeometryParamPoly3* ret=new GeometryParamPoly3(mS,mX,mY, mHdg, mLength, muA, muB, muC, muD,mvA,mvB,mvC,mvD);
-    return ret;
-}
-
-void GeometryParamPoly3::UpdateSamplePoint()
-{
-
-}
-//-------------------------------------------------
-/**
- * Setter for the base properties
- */
-void GeometryParamPoly3::SetAll(double s, double x, double y, double hdg, double length, double ua,double ub,double uc,double ud,double va, double vb, double vc,double vd )
-{
-    SetBase(s,x,y,hdg,length,false);
-    muA=ua;
-    muB=ub;
-    muC=uc;
-    muD=ud;
-    mvA=va;
-    mvB=vb;
-    mvC=vc;
-    mvD=vd;
-    ComputeVars();
-}
-
-double GeometryParamPoly3::GetuA(){return muA;}
-double GeometryParamPoly3::GetuB(){return muB;}
-double GeometryParamPoly3::GetuC(){return muC;}
-double GeometryParamPoly3::GetuD(){return muD;}
-double GeometryParamPoly3::GetvA(){return mvA;}
-double GeometryParamPoly3::GetvB(){return mvB;}
-double GeometryParamPoly3::GetvC(){return mvC;}
-double GeometryParamPoly3::GetvD(){return mvD;}
-
-void GeometryParamPoly3::GetCoords(double s_check, double &retX, double &retY, double &retHDG)
-{
-    double pRange = 1.0;
-    if(mLength == 0)
-    {
-        retX = mX;
-        retY = mY;
-        retHDG = mHdg;
-    }
-    if(mbNormal)
-    {
-        pRange = s_check/mLength;
-        if(pRange<0)pRange = 0.0;
-        if(pRange>1.0)pRange = 1.0;
-    }
-    else
-    {
-        pRange = s_check;
-    }
-    double xtem,ytem;
-    xtem = muA + muB * pRange +  muC * pRange*pRange +  muD * pRange*pRange*pRange;
-    ytem = mvA + mvB * pRange + mvC * pRange*pRange + mvD * pRange*pRange*pRange;
-    retX = xtem*cos(mHdg) - ytem * sin(mHdg) + mX;
-    retY = xtem*sin(mHdg) + ytem * cos(mHdg) + mY;
-    if(s_check<0.1)
-    {
-        retHDG = mHdg;
-    }
-    else
-    {
-        if(mbNormal)
-        {
-            pRange = (s_check-0.1)/mLength;
-            if(pRange<0)pRange = 0.0;
-            if(pRange>1.0)pRange = 1.0;
-        }
-        else
-        {
-            pRange = s_check - 0.1;
-        }
-        xtem = muA + muB * pRange + muC * pRange*pRange + muD * pRange*pRange*pRange;
-        ytem = mvA + mvB * pRange + mvC * pRange*pRange + mvD * pRange*pRange*pRange;
-        double x = xtem*cos(mHdg) - ytem * sin(mHdg) + mX;
-        double y = xtem*sin(mHdg) + ytem * cos(mHdg) + mY;
-        retHDG = CalcHdg(x,y,retX,retY);
-    }
-}
-
-//***********************************************************************************
-//Base class for Geometry blocks
-//***********************************************************************************
-/**
- * Constructor
- */
-GeometryBlock::GeometryBlock()
-{}
-
-/**
- * Copy constructor
- */
-GeometryBlock::GeometryBlock(const GeometryBlock& geomBlock)
-{
-	for (vector<RoadGeometry*>::const_iterator member = geomBlock.mGeometryBlockElement.begin();	member != geomBlock.mGeometryBlockElement.end();	 member++)
-		mGeometryBlockElement.push_back((*member)->Clone());
-
-}
-
-/**
- * Assignment operator overload
- */
-const GeometryBlock& GeometryBlock::operator=(const GeometryBlock& otherGeomBlock)
-{
-	if (this!= &otherGeomBlock)
-	{
-
-		for (vector<RoadGeometry*>::iterator member = mGeometryBlockElement.begin();	member != mGeometryBlockElement.end();	 member++)
-		{
-			if(GeometryLine *line = dynamic_cast<GeometryLine *>(*member))
-			{
-				delete line;
-			}
-			else if(GeometryArc *arc = dynamic_cast<GeometryArc *>(*member))
-			{
-				delete arc;
-			}
-			else if(GeometrySpiral *spiral = dynamic_cast<GeometrySpiral *>(*member))
-			{
-				delete spiral;
-			}
-			else if(GeometryPoly3 *poly = dynamic_cast<GeometryPoly3 *>(*member))
-			{
-				delete poly;
-			}
-            else if(GeometryParamPoly3 * parampoly = dynamic_cast<GeometryParamPoly3 *>(*member) )
-            {
-                delete parampoly;
-            }
-		}
-		mGeometryBlockElement.clear();
-
-		for (vector<RoadGeometry*>::const_iterator member = otherGeomBlock.mGeometryBlockElement.begin();	member != otherGeomBlock.mGeometryBlockElement.end();	 member++)
-			mGeometryBlockElement.push_back((*member)->Clone());
-	}
-	return *this;
-}
-
-
-//-------------------------------------------------
-
-/**
- * Methods used to add geometry recors to the geometry record vector
- */
-void GeometryBlock::AddGeometryLine(double s, double x, double y, double hdg, double length)
-{	
-	mGeometryBlockElement.push_back(new GeometryLine(s, x, y, hdg, length));	
-}
-void GeometryBlock::AddGeometryArc(double s, double x, double y, double hdg, double length, double curvature)
-{	
-	mGeometryBlockElement.push_back(new GeometryArc(s, x, y, hdg, length, curvature));	
-}
-void GeometryBlock::AddGeometrySpiral(double s, double x, double y, double hdg, double length, double curvatureStart,double curvatureEnd)
-{	
-	mGeometryBlockElement.push_back(new GeometrySpiral(s, x, y, hdg, length, curvatureStart, curvatureEnd));	
-}
-void GeometryBlock::AddGeometryPoly3(double s, double x, double y, double hdg, double length, double a,double b,double c,double d)
-{	
-	mGeometryBlockElement.push_back(new GeometryPoly3(s, x, y, hdg, length, a, b, c, d));	
-}
-void GeometryBlock::AddGeometryParamPoly3(double s, double x, double y, double hdg, double length, double ua, double ub, double uc, double ud, double va, double vb, double vc, double vd)
-{
-    mGeometryBlockElement.push_back(new GeometryParamPoly3(s,x,y,hdg,length,ua,ub,uc,ud,va,vb,vc,vd));
-}
-
-//-------------------------------------------------
-
-/**
- * Getter for the geometry record at a given index position of the vector
- */
-RoadGeometry* GeometryBlock::GetGeometryAt(int index)
-{
-	return mGeometryBlockElement.at(index);
-}
-
-/**
- * Getter for the overal block length (summ of geometry record lengths)
- */
-double GeometryBlock::GetBlockLength()
-{
-	double lTotal=0;
-	for (unsigned int i=0;i<mGeometryBlockElement.size();i++)
-	{
-		lTotal+=mGeometryBlockElement.at(i)->GetLength();
-	}
-	return lTotal;
-}
-
-/**
- *  Checks if the block is a straight line block or a turn
- */
-bool GeometryBlock::CheckIfLine()
-{
-	if(mGeometryBlockElement.size()>1) return false;
-	else return true;
-}
-
-//-------------------------------------------------
-
-/**
- * Recalculates the geometry blocks when one of the geometry records is modified
- * Makes sure that every geometry records starts where the previous record ends
- */
-void GeometryBlock::Recalculate(double s, double x, double y, double hdg)
-{
-	double lS=s;
-	double lX=x;
-	double lY=y;
-	double lHdg=hdg;
-
-	if(mGeometryBlockElement.size()==1)
-	{
-		GeometryLine *lGeometryLine	=  static_cast<GeometryLine*>(mGeometryBlockElement.at(0));
-		if(lGeometryLine!=NULL)
-		{
-			// Updates the line to reflect the changes of the previous block
-			lGeometryLine->SetBase(lS,lX,lY,lHdg,lGeometryLine->GetLength());
-		}
-	}
-	else if(mGeometryBlockElement.size()==3)
-	{
-		GeometrySpiral *lGeometrySpiral1	=  static_cast<GeometrySpiral*>(mGeometryBlockElement.at(0));
-		GeometryArc *lGeometryArc			=  static_cast<GeometryArc*>(mGeometryBlockElement.at(1));
-		GeometrySpiral *lGeometrySpiral2	=  static_cast<GeometrySpiral*>(mGeometryBlockElement.at(2));
-		if(lGeometrySpiral1!=NULL && lGeometryArc!=NULL && lGeometrySpiral2!=NULL)
-		{
-			// Updates the first spiral to reflect the changes of the previous block
-			lGeometrySpiral1->SetBase(lS,lX,lY,lHdg,lGeometrySpiral1->GetLength());
-
-			// Reads the new coords of the spiral
-			lS=lGeometrySpiral1->GetS2();
-			lGeometrySpiral1->GetCoords(lS,lX,lY,lHdg);
-
-			// Updates the arc to reflect the changes to the first spiral
-			lGeometryArc->SetBase(lS,lX,lY,lHdg,lGeometryArc->GetLength());
-
-			// Reads the new coords of the arc
-			lS=lGeometryArc->GetS2();
-			lGeometryArc->GetCoords(lS,lX,lY,lHdg);
-
-			// Updates the second spiral to reflect hte changes to the arc
-			lGeometrySpiral2->SetBase(lS,lX,lY,lHdg,lGeometrySpiral2->GetLength());
-		}
-	}
-}
-
-//-------------------------------------------------
-
-/**
- *  Gets the S at the end of the block
- */
-double GeometryBlock::GetLastS2()
-{
-	if(mGeometryBlockElement.size()>0)
-		return mGeometryBlockElement.at(mGeometryBlockElement.size()-1)->GetS2();
-	else
-		return 0;
-}
-
-/**
- *  Gets the last geometry in the geometry vector
- */
-RoadGeometry* GeometryBlock::GetLastGeometry()
-{
-	return mGeometryBlockElement.at(mGeometryBlockElement.size()-1);
-}
-
-/**
- *  Gets the coordinates at the end of the last geometry
- */
-short int GeometryBlock::GetLastCoords(double &s, double &retX, double &retY, double &retHDG)
-{
-	int lSize = mGeometryBlockElement.size();
-	if(lSize>0)
-	{
-		RoadGeometry* lGeometry = mGeometryBlockElement.at(lSize-1);
-		s = lGeometry->GetS2();
-		lGeometry->GetCoords(s, retX, retY, retHDG);
-	}
-	else
-	{
-		s=0;
-		retX=0;
-		retY=0;
-		retHDG=0;
-	}
-	return 0;
-}
-
-/**
- *  Check if sample S belongs to this block
- */
-bool GeometryBlock::CheckInterval(double s_check)
-{
-	for (unsigned int i=0;i<mGeometryBlockElement.size();i++)
-	{
-		//if the s_check belongs to one of the geometries
-		if (mGeometryBlockElement.at(i)->CheckInterval(s_check))
-			return true;
-	}
-	return false;
-}
-
-/**
- *  Gets the coordinates at the sample S offset
- */
-short int GeometryBlock::GetCoords(double s_check, double &retX, double &retY)
-{
-	double tmp;
-	return GetCoords(s_check, retX, retY, tmp);
-}
-
-/**
- *  Gets the coordinates and heading at the end of the last geometry 
- */
-short int  GeometryBlock::GetCoords(double s_check, double &retX, double &retY, double &retHDG)
-{
-	// go through all the elements
-	for (unsigned int i=0;i<mGeometryBlockElement.size();i++)
-	{
-		//if the s_check belongs to one of the geometries
-		if (mGeometryBlockElement.at(i)->CheckInterval(s_check))
-		{
-			//get the x,y coords and return the type of the geometry
-			mGeometryBlockElement.at(i)->GetCoords(s_check, retX, retY, retHDG);
-			return mGeometryBlockElement.at(i)->GetGeomType();
-		}
-	}
-	//if nothing found, return -999
-	return -999;
-
-}
-
-//-------------------------------------------------
-/**
- *  Destructor
- */
-GeometryBlock::~GeometryBlock()
-{
-	// Clears the geometry record vector
-	for (vector<RoadGeometry*>::iterator member = mGeometryBlockElement.begin();	member != mGeometryBlockElement.end();	 member++)
-	{
-		if(GeometryLine *line = dynamic_cast<GeometryLine *>(*member))
-		{
-			delete line;
-		}
-		else if(GeometryArc *arc = dynamic_cast<GeometryArc *>(*member))
-		{
-			delete arc;
-		}
-		else if(GeometrySpiral *spiral = dynamic_cast<GeometrySpiral *>(*member))
-		{
-			delete spiral;
-		}
-		else if(GeometryPoly3 *poly = dynamic_cast<GeometryPoly3 *>(*member))
-		{
-			delete poly;
-		}
-        else if(GeometryParamPoly3 *parampoly = dynamic_cast<GeometryParamPoly3 *>(*member))
-        {
-            delete parampoly;
-        }
-	}
-	mGeometryBlockElement.clear();
-}
-
-//----------------------------------------------------------------------------------

+ 0 - 473
src/tool/map_lanetoxodr/OpenDrive/RoadGeometry.h

@@ -1,473 +0,0 @@
-#ifndef ROADGEOMETRY_H
-#define ROADGEOMETRY_H
-
-#include <vector>
-#include <string>
-
-//Prototypes
-class RoadGeometry;
-class GeometryLine;
-class GeometrySpiral;
-class GeometryArc;
-
-using std::vector;
-using std::string;
-
-
-
-class geosamplepoint
-{
-public:
-    double s;
-    double x;
-    double y;
-    double fHdg;
-};
-
-/**
- * RoadGeometry class is responsible for storing the basic chordline geometry properties
- *
- */
-class RoadGeometry
-{
-protected:
-	/**
-	 * Base record properties
-	 */
-	double mS;
-	double mX;
-	double mY;
-	double mHdg;
-	double mLength;
-	double mS2;
-    short int mGeomType;	//0-line, 2-arc, 1-spiral 3-poly3 4-parampoly3
-
-
-public:
-    static double CalcHdg(double x0,double y0,double x1,double y1);
-
-public:
-	/**
-	 * Constructor that initializes the base properties of teh record
-	 */
-	RoadGeometry(double s, double x, double y, double hdg, double length);
-	
-	/**
-	 * Clones and returns the new geometry record
-	 */
-	virtual RoadGeometry* Clone() const;
-	
-	//-------------------------------------------------
-
-	/**
-	 * Sets the type of the geometry
-	 * 0: Line, 1: Arc, 2: Spiral
-	 */
-	void SetGeomType(short int geomType);
-	
-	/**
-	 * Setter for the base properties
-	 */
-	void SetBase(double s, double x, double y, double hdg, double length, bool recalculate=true);
-	void SetS(double s);
-	void SetX(double x);
-	void SetY(double y);
-	void SetHdg(double hdg);
-	void SetLength(double length);
-
-	//-------------------------------------------------
-	/**
-	 * Getter for the geometry type
-	 */
-	short int GetGeomType();
-	
-	/**
-	 * Getter for the base properties
-	 */
-	double GetS();
-	double GetS2();
-	double GetX();
-	double GetY();
-	double GetHdg();
-	double GetLength();
-
-	//-------------------------------------------------
-
-	/**
-	 * Evaluation methods
-	 */
-	virtual bool CheckInterval (double s_check);
-	virtual void GetCoords(double s_check, double &retX, double &retY);
-	virtual void GetCoords(double s_check, double &retX, double &retY, double &retHDG);
-protected:
-
-	/**
-	 * Computes the required vars
-	 */
-	virtual void ComputeVars();
-};
-
-
-//----------------------------------------------------------------------------------
-/**
- * GeometryLine inherits the RoadGeometry class but adds no additional properties
- *
- */
-class GeometryLine:public RoadGeometry
-{
-public:
-	/**
-	 * Constructor that initializes the base properties of the record
-	 */
-	GeometryLine (double s, double x, double y, double hdg, double length);
-
-	/**
-	 * Clones and returns the new geometry record
-	 */
-	RoadGeometry* Clone() const;
-	
-	//-------------------------------------------------
-
-	/**
-	 * Setter for the base properties
-	 */
-	void SetAll(double s, double x, double y, double hdg, double length);
-
-	//-------------------------------------------------
-
-	/**
-	 * Gets the coordinates at the sample S offset
-	 */
-	void GetCoords(double s_check, double &retX, double &retY, double &retHDG);
-
-};
-//----------------------------------------------------------------------------------
-/**
- * GeometryArc inherits the RoadGeometry class and adds Curvature property
- *
- */
-class GeometryArc: public RoadGeometry
-{
-private:
-	/**
-	 * Base record properties
-	 */
-	double mCurvature;
-	
-	/**
-	 * Optimization related variables
-	 */ 
-	double mCircleX;
-	double mCircleY;
-
-	/**
-	 * Computation variables
-	 */
-	double mStartAngle;
-
-public:
-	/**
-	 * Constructor that initializes the base properties of the record
-	 */
-	GeometryArc (double s, double x, double y, double hdg, double length, double curvature);
-
-	/**
-	 * Clones and returns the new geometry record
-	 */
-	RoadGeometry* Clone() const;
-
-	//-------------------------------------------------
-	
-	/**
-	 * Setter for the base properties
-	 */
-	void SetAll(double s, double x, double y, double hdg, double length, double curvature);
-	void SetCurvature(double curvature);
-
-	//-------------------------------------------------
-
-	/**
-	 * Getter for the base properties
-	 */
-	double GetCurvature();
-	
-	//-------------------------------------------------
-
-	/**
-	 * Gets the coordinates at the sample S offset
-	 */
-	void GetCoords(double s_check, double &retX, double &retY, double &retHDG);
-protected:
-
-	/**
-	 * Computes the required vars
-	 */
-	virtual void ComputeVars();
-};
-
-
-
-//----------------------------------------------------------------------------------
-/**
- * GeometrySpiral inherits the RoadGeometry class and adds Curvature properties
- *
- */
-class GeometrySpiral: public RoadGeometry
-{
-private:
-	/**
-	 * Base record properties
-	 */
-	double mCurvatureStart;
-	double mCurvatureEnd;
-
-	/**
-	 * Computation variables
-	 */
-	static const double sqrtPiO2;
-	double mA;
-	double mCurvature;
-	double mDenormalizeFactor;
-	double mEndX;
-	double mEndY;
-	bool mNormalDir;
-
-	double differenceAngle;
-	double mRotCos;
-	double mRotSin;
-
-public:
-	/**
-	 * Constructor that initializes the base properties of the record
-	 */
-	GeometrySpiral (double s, double x, double y, double hdg, double length, double curvatureStart,double curvatureEnd);
-
-	/**
-	 * Clones and returns the new geometry record
-	 */
-	RoadGeometry* Clone() const;
-
-	//-------------------------------------------------
-
-	/**
-	 * Setter for the base properties
-	 */
-	void SetAll(double s, double x, double y, double hdg, double length, double curvatureStart,double curvatureEnd);
-	void SetCurvatureStart(double curvature);
-	void SetCurvatureEnd(double curvature);
-	
-	//-------------------------------------------------
-	/**
-	 * Getter for the base properties
-	 */
-	double GetCurvatureStart();
-	double GetCurvatureEnd();
-	
-	//-------------------------------------------------
-	/**
-	 * Gets the coordinates at the sample S offset
-	 */
-	void GetCoords(double s_check, double &retX, double &retY, double &retHDG);
-protected:
-
-	/**
-	 * Computes the required vars
-	 */
-	virtual void ComputeVars();
-};
-
-
-//----------------------------------------------------------------------------------
-/**
- * GeometryPoly3 inherits the RoadGeometry class and adds polynomial properties
- *
- */
-class GeometryPoly3: public RoadGeometry
-{
-private:
-	/**
-	 * Base record properties
-	 */
-	double mA;
-	double mB;
-	double mC;
-	double mD;
-
-private:
-    vector<geosamplepoint> mvectorgeosample;
-    bool mbHaveSample = false;
-    void UpdateSamplePoint();
-public:
-	/**
-	 * Constructor that initializes the base properties of the record
-	 */
-	GeometryPoly3 (double s, double x, double y, double hdg, double length, double a,double b,double c,double d );
-
-	/**
-	 * Clones and returns the new geometry record
-	 */
-	RoadGeometry* Clone() const;
-	
-	//-------------------------------------------------
-	/**
-	 * Setter for the base properties
-	 */
-	void SetAll(double s, double x, double y, double hdg, double length, double a,double b,double c,double d);
-
-
-    double GetA();
-    double GetB();
-    double GetC();
-    double GetD();
-
-    void GetCoords(double s_check, double &retX, double &retY, double &retHDG);
-
-};
-
-//----------------------------------------------------------------------------------
-/**
- * GeometryPoly3 inherits the RoadGeometry class and adds polynomial properties, Added By Yuchuli,2019.11.1
- *
- */
-class GeometryParamPoly3: public RoadGeometry
-{
-private:
-    /**
-     * Base record properties
-     */
-    double muA;
-    double muB;
-    double muC;
-    double muD;
-
-    double mvA;
-    double mvB;
-    double mvC;
-    double mvD;
-
-    bool mbNormal = true;
-
-private:
-    vector<geosamplepoint> mvectorgeosample;
-    bool mbHaveSample = false;
-    void UpdateSamplePoint();
-
-public:
-    /**
-     * Constructor that initializes the base properties of the record
-     */
-    GeometryParamPoly3 (double s, double x, double y, double hdg, double length, double ua,double ub,double uc,double ud,double va, double vb, double vc,double vd );
-
-    /**
-     * Clones and returns the new geometry record
-     */
-    RoadGeometry* Clone() const;
-
-    //-------------------------------------------------
-    /**
-     * Setter for the base properties
-     */
-    void SetAll(double s, double x, double y, double hdg, double length, double a,double b,double c,double d,double va, double vb, double vc,double vd );
-
-
-    double GetuA();
-    double GetuB();
-    double GetuC();
-    double GetuD();
-    double GetvA();
-    double GetvB();
-    double GetvC();
-    double GetvD();
-
-    void GetCoords(double s_check, double &retX, double &retY, double &retHDG);
-};
-
-
-
-//----------------------------------------------------------------------------------
-/**
- * GeometryBlock is a class used to combine multiple geometry records into blocks.
- * The basic use for this is to combine spiral-arc-spiral sequence of records into 
- * a signel "Turn" block for an easier way to define turns, keeping close to the
- * road building practice of curvature use for transitions between straight segments and arcs
- */
-class GeometryBlock
-{
-private:
-	/**
-	 * Vector of geometry records that make up a block
-	 */
-	vector<RoadGeometry*> mGeometryBlockElement;
-public:
-	/**
-	 * Constructor
-	 */
-	GeometryBlock();
-	
-	/**
-	 * Copy constructor
-	 */
-	GeometryBlock(const GeometryBlock& geomBlock);
-
-	/**
-	 * Assignment operator overload
-	 */
-	const GeometryBlock& operator=(const GeometryBlock& otherGeomBlock);
-	
-	//-------------------------------------------------
-
-	/**
-	 * Methods used to add geometry recors to the geometry record vector
-	 */
-	void AddGeometryLine(double s, double x, double y, double hdg, double length);
-	void AddGeometryArc(double s, double x, double y, double hdg, double length, double curvature);
-	void AddGeometrySpiral(double s, double x, double y, double hdg, double length, double curvatureStart,double curvatureEnd);
-	void AddGeometryPoly3(double s, double x, double y, double hdg, double length, double a,double b,double c,double d);
-    void AddGeometryParamPoly3(double s, double x, double y, double hdg, double length, double ua,double ub,double uc,double ud,double va,double vb,double vc,double vd);
-	
-	//-------------------------------------------------
-
-	/**
-	 * Getter for the geometry record at a given index position of the vector
-	 */
-	RoadGeometry* GetGeometryAt(int index);
-
-	/**
-	 * Getter for the overal block length (summ of geometry record lengths)
-	 */
-	double GetBlockLength();
-
-	/**
-	 *  Checks if the block is a straight line block or a turn
-	 */
-	bool CheckIfLine();
-	
-	//-------------------------------------------------
-
-	/**
-	 * Recalculates the geometry blocks when one of the geometry records is modified
-	 * Makes sure that every geometry records starts where the previous record ends
-	 */
-	void Recalculate(double s, double x, double y, double hdg);
-
-	//-------------------------------------------------
-
-	/**
-	 *  Evaluation methods
-	 */
-	double GetLastS2();
-	RoadGeometry* GetLastGeometry();
-	virtual short int GetLastCoords(double &s, double &retX, double &retY, double &retHDG);
-	bool CheckInterval(double s_check);
-	virtual short int GetCoords(double s_check, double &retX, double &retY);
-	virtual short int GetCoords(double s_check, double &retX, double &retY, double &retHDG);
-
-	//-------------------------------------------------
-	/**
-	 *  Destructor
-	 */
-	~GeometryBlock();
-};
-
-
-#endif

+ 37 - 0
src/tool/map_lanetoxodr/dialogroadborrow.cpp

@@ -0,0 +1,37 @@
+#include "dialogroadborrow.h"
+#include "ui_dialogroadborrow.h"
+
+#include "mainwindow.h"
+
+#include <QMessageBox>
+
+DialogRoadBorrow::DialogRoadBorrow(OpenDrive * pxodr,std::string strdefroad,QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::DialogRoadBorrow)
+{
+    ui->setupUi(this);
+
+    mpxodr = pxodr;
+
+
+    ui->comboBox_borrowmode->addItem("All");
+    ui->comboBox_borrowmode->addItem("R2L");
+    ui->comboBox_borrowmode->addItem("L2R");
+    int i;
+    int nroadcount = mpxodr->GetRoadCount();
+    for(i=0;i<nroadcount;i++)
+    {
+        const char * strname = mpxodr->GetRoad(i)->GetRoadId().data();
+        ui->comboBox_Road->addItem(strname);
+
+    }
+
+    MainWindow::ComboToString(strdefroad,ui->comboBox_Road);
+
+    setWindowTitle("Road Borrow");
+}
+
+DialogRoadBorrow::~DialogRoadBorrow()
+{
+    delete ui;
+}

+ 29 - 0
src/tool/map_lanetoxodr/dialogroadborrow.h

@@ -0,0 +1,29 @@
+#ifndef DIALOGROADBORROW_H
+#define DIALOGROADBORROW_H
+
+#include <QDialog>
+
+#include "OpenDrive/OpenDrive.h"
+
+#include "dialogroadborrow.h"
+
+
+namespace Ui {
+class DialogRoadBorrow;
+}
+
+class DialogRoadBorrow : public QDialog
+{
+    Q_OBJECT
+
+public:
+    explicit DialogRoadBorrow(OpenDrive * pxodr,std::string strdefroad,QWidget *parent = nullptr);
+    ~DialogRoadBorrow();
+
+private:
+    Ui::DialogRoadBorrow *ui;
+
+    OpenDrive * mpxodr;
+};
+
+#endif // DIALOGROADBORROW_H

+ 183 - 0
src/tool/map_lanetoxodr/dialogroadborrow.ui

@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>DialogRoadBorrow</class>
+ <widget class="QDialog" name="DialogRoadBorrow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>953</width>
+    <height>587</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dialog</string>
+  </property>
+  <widget class="QPushButton" name="pushButton_Delete">
+   <property name="geometry">
+    <rect>
+     <x>715</x>
+     <y>165</y>
+     <width>89</width>
+     <height>25</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Delete</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label">
+   <property name="geometry">
+    <rect>
+     <x>30</x>
+     <y>60</y>
+     <width>67</width>
+     <height>17</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Road</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_2">
+   <property name="geometry">
+    <rect>
+     <x>172</x>
+     <y>100</y>
+     <width>70</width>
+     <height>17</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Length</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_3">
+   <property name="geometry">
+    <rect>
+     <x>30</x>
+     <y>170</y>
+     <width>101</width>
+     <height>17</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Borrow</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_4">
+   <property name="geometry">
+    <rect>
+     <x>32</x>
+     <y>250</y>
+     <width>67</width>
+     <height>17</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>s</string>
+   </property>
+  </widget>
+  <widget class="QLineEdit" name="lineEdit_t">
+   <property name="geometry">
+    <rect>
+     <x>350</x>
+     <y>250</y>
+     <width>113</width>
+     <height>25</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QComboBox" name="comboBox_Borrow">
+   <property name="geometry">
+    <rect>
+     <x>170</x>
+     <y>160</y>
+     <width>261</width>
+     <height>31</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_5">
+   <property name="geometry">
+    <rect>
+     <x>250</x>
+     <y>250</y>
+     <width>67</width>
+     <height>17</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>length</string>
+   </property>
+  </widget>
+  <widget class="QLineEdit" name="lineEdit_s">
+   <property name="geometry">
+    <rect>
+     <x>120</x>
+     <y>250</y>
+     <width>113</width>
+     <height>25</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_6">
+   <property name="geometry">
+    <rect>
+     <x>490</x>
+     <y>250</y>
+     <width>67</width>
+     <height>17</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>mode</string>
+   </property>
+  </widget>
+  <widget class="QLineEdit" name="lineEdit_RoadLen">
+   <property name="geometry">
+    <rect>
+     <x>270</x>
+     <y>100</y>
+     <width>113</width>
+     <height>25</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="pushButton_Add">
+   <property name="geometry">
+    <rect>
+     <x>540</x>
+     <y>165</y>
+     <width>89</width>
+     <height>25</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Add</string>
+   </property>
+  </widget>
+  <widget class="QComboBox" name="comboBox_Road">
+   <property name="geometry">
+    <rect>
+     <x>170</x>
+     <y>50</y>
+     <width>231</width>
+     <height>31</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QComboBox" name="comboBox_borrowmode">
+   <property name="geometry">
+    <rect>
+     <x>560</x>
+     <y>250</y>
+     <width>181</width>
+     <height>31</height>
+    </rect>
+   </property>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 2 - 2
src/tool/map_lanetoxodr/main.cpp

@@ -7,7 +7,7 @@
 
 #ifndef ANDROID
 
-//#include "ivbacktrace.h"
+#include "ivbacktrace.h"
 
 #endif
 
@@ -57,7 +57,7 @@ int main(int argc, char *argv[])
 
 #ifndef ANDROID
 
-//    RegisterIVBackTrace();
+    RegisterIVBackTrace();
 #endif
     QApplication a(argc, argv);
 

+ 7 - 0
src/tool/map_lanetoxodr/mainwindow.cpp

@@ -5346,3 +5346,10 @@ void MainWindow::SaveBack()
     mnNotSave++;
     mpfb->SetOpenDrive(mxodr);
 }
+
+void MainWindow::on_actionEdit_Road_Borrow_triggered()
+{
+    std::string strroadid = mpCBRoad->currentText().toStdString();
+    DialogRoadBorrow rbd(&mxodr,strroadid,this);
+    int res = rbd.exec();
+}

+ 3 - 0
src/tool/map_lanetoxodr/mainwindow.h

@@ -46,6 +46,7 @@
 #include "roadeditdialog.h"
 #include "dialogaddroadfromrtk.h"
 #include "dialogcalcs.h"
+#include "dialogroadborrow.h"
 
 #include "filebackup.h"
 
@@ -201,6 +202,8 @@ private slots:
 
     void on_actionBack_triggered();
 
+    void on_actionEdit_Road_Borrow_triggered();
+
 private:
 
 

+ 7 - 0
src/tool/map_lanetoxodr/mainwindow.ui

@@ -42,8 +42,10 @@
     <addaction name="actionSet_Speed"/>
     <addaction name="actionSet_Traffic_Light"/>
     <addaction name="actionCalc_Road_S"/>
+    <addaction name="actionEdit_Road_Borrow"/>
     <addaction name="separator"/>
     <addaction name="actionBack"/>
+    <addaction name="separator"/>
    </widget>
    <widget class="QMenu" name="menuTool">
     <property name="title">
@@ -140,6 +142,11 @@
     <string>回退</string>
    </property>
   </action>
+  <action name="actionEdit_Road_Borrow">
+   <property name="text">
+    <string>Edit Road Borrow</string>
+   </property>
+  </action>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
  <resources>

+ 5 - 0
src/tool/map_lanetoxodr/map_lanetoxodr.pro

@@ -35,6 +35,7 @@ SOURCES += \
     dialogeditroadmark.cpp \
     dialoglanefromrtk.cpp \
     dialoglaneoffset.cpp \
+    dialogroadborrow.cpp \
     dialogroadmerge.cpp \
     dialogroadmirror.cpp \
     dialogroadmove.cpp \
@@ -79,6 +80,7 @@ HEADERS += \
     dialogeditroadmark.h \
     dialoglanefromrtk.h \
     dialoglaneoffset.h \
+    dialogroadborrow.h \
     dialogroadmerge.h \
     dialogroadmirror.h \
     dialogroadmove.h \
@@ -118,6 +120,7 @@ FORMS += \
         dialogeditroadmark.ui \
         dialoglanefromrtk.ui \
         dialoglaneoffset.ui \
+        dialogroadborrow.ui \
         dialogroadmerge.ui \
         dialogroadmirror.ui \
         dialogroadmove.ui \
@@ -147,6 +150,8 @@ LIBS += -L$$PWD/../../../bin/ -lxmlparam -lmodulecomm -livlog -livfault -livback
 
 INCLUDEPATH += $$PWD/../../include/msgtype
 
+INCLUDEPATH += $$PWD/../../common/common/xodr
+
 
 
 

+ 3 - 0
src/tool/map_lanetoxodr/roadeditdialog.cpp

@@ -52,6 +52,8 @@ RoadEditDialog::RoadEditDialog(OpenDrive * pxodr,std::string strdefroad,QWidget
 
     MainWindow::ComboToString(strdefroad,ui->comboBox_Road);
 
+    setWindowTitle("Edit Road");
+
 }
 
 RoadEditDialog::~RoadEditDialog()
@@ -609,3 +611,4 @@ void RoadEditDialog::on_pushButton_EditLaneOffset_clicked()
     DialogLaneOffset dlglaneoffset(mpCurRoad,this);
     dlglaneoffset.exec();
 }
+

+ 5 - 5
src/tool/map_lanetoxodr/roadeditdialog.ui

@@ -263,7 +263,7 @@
    <property name="geometry">
     <rect>
      <x>1013</x>
-     <y>210</y>
+     <y>426</y>
      <width>181</width>
      <height>31</height>
     </rect>
@@ -276,7 +276,7 @@
    <property name="geometry">
     <rect>
      <x>1010</x>
-     <y>283</y>
+     <y>499</y>
      <width>191</width>
      <height>31</height>
     </rect>
@@ -289,7 +289,7 @@
    <property name="geometry">
     <rect>
      <x>1010</x>
-     <y>356</y>
+     <y>572</y>
      <width>191</width>
      <height>31</height>
     </rect>
@@ -302,7 +302,7 @@
    <property name="geometry">
     <rect>
      <x>1010</x>
-     <y>431</y>
+     <y>647</y>
      <width>191</width>
      <height>31</height>
     </rect>
@@ -315,7 +315,7 @@
    <property name="geometry">
     <rect>
      <x>1010</x>
-     <y>506</y>
+     <y>722</y>
      <width>191</width>
      <height>31</height>
     </rect>