Browse Source

change map_lanetoxodr.

yuchuli 2 years ago
parent
commit
e9c7799be0

+ 145 - 1
src/common/common/xodr/OpenDrive/Lane.cpp

@@ -1538,6 +1538,16 @@ void LaneRoadMark::SetWidth(double value)
 {	mWidth=value;	}
 void LaneRoadMark::SetLaneChange(string laneChange)
 {	mLaneChange=laneChange;	}
+void LaneRoadMark::SetLaneRoadMarkType(LaneRoadMarkType  laneRoadMarkType)
+{
+//    ResetLaneRoadMarkType();
+    std::vector<LaneRoadMarkType> * px = &mvectorLaneRoadMarkType;
+    mvectorLaneRoadMarkType.push_back(laneRoadMarkType);
+}
+void LaneRoadMark::ResetLaneRoadMarkType()
+{
+    mvectorLaneRoadMarkType.clear();
+}
 
 
 /*
@@ -1555,6 +1565,13 @@ double LaneRoadMark::GetWidth()
 {	return mWidth;	}
 string LaneRoadMark::GetLaneChange()
 {	return mLaneChange;	}
+int LaneRoadMark::GetLaneRoadMarkType(LaneRoadMarkType & laneRoadMarkType)
+{
+    if(mvectorLaneRoadMarkType.size() == 0)return 0;
+    laneRoadMarkType = mvectorLaneRoadMarkType[0];
+    return 1;
+}
+
 
 /**
 * Lane material class. Contains all the data that describes a lane material
@@ -1865,8 +1882,135 @@ int LaneRoadMarkLine::Getcolor(std::string & color)   //same with rule
 }
 
 
+
 /*
-* Methods that set the parameters of the lane offset
+* Methods that set the parameters of the lane roadmark type
+*/
+
+
+LaneRoadMarkType::LaneRoadMarkType(std::string strname,double fwidth)
+{
+    mstrname = strname;
+    mfwidth = fwidth;
+}
+
+/*
+* Methods that return the parameters of the lane roadmark
+*/
+
+std::string LaneRoadMarkType::Getname()
+{
+    return mstrname;
+}
+
+double LaneRoadMarkType::GetWidth()
+{
+    return mfwidth;
+}
+
+/*
+* Methods that set the parameters of the lane roadmark
+*/
+
+void LaneRoadMarkType::Setname(std::string name)
+{
+    mstrname = name;
+}
+
+void LaneRoadMarkType::SetWidth(double width)
+{
+    mfwidth = width;
+}
+
+
+/**
+ * Methods used to add child records to the respective vectors
+ */
+unsigned int LaneRoadMarkType::AddLaneRoadMarkLine(double length, double space, double tOffset, double sOffset)
+{
+    mvetorLaneRoadMarkLine.push_back(LaneRoadMarkLine(length,space,tOffset,sOffset));
+    mLastAddedLaneRoadMarkLine = static_cast<unsigned int >(mvetorLaneRoadMarkLine.size())  -1;
+    return  mLastAddedLaneRoadMarkLine;
+}
+
+/**
+ * Methods used to clone child records in the respective vectors
+ */
+unsigned int LaneRoadMarkType::CloneLaneRoadMarkLine(unsigned int index)
+{
+    if(index<(mvetorLaneRoadMarkLine.size()-1))
+        mvetorLaneRoadMarkLine.insert(mvetorLaneRoadMarkLine.begin()+index+1, mvetorLaneRoadMarkLine[index]);
+    else if(index==mvetorLaneRoadMarkLine.size()-1)
+        mvetorLaneRoadMarkLine.push_back(mvetorLaneRoadMarkLine[index]);
+    mLastAddedLaneRoadMarkLine=index+1;
+    return mLastAddedLaneRoadMarkLine;
+}
+
+/**
+ * Methods used to delete child records from the respective vectors
+ */
+void LaneRoadMarkType::DeleteLaneRoadMarkLine(unsigned int index)
+{
+    mvetorLaneRoadMarkLine.erase(mvetorLaneRoadMarkLine.begin()+index);
+}
+
+
+/**
+*	Get pointers to the records vectors
+*/
+vector <LaneRoadMarkLine> * LaneRoadMarkType::GetLaneRoadMarkLineVector()
+{
+    return &mvetorLaneRoadMarkLine;
+}
+
+
+
+/**
+*	Get the number of elements in a certain vector
+*/
+unsigned int LaneRoadMarkType::GetLaneRoadMarkLineCount()
+{
+    return  static_cast<unsigned int >(mvetorLaneRoadMarkLine.size()) ;
+}
+
+
+/**
+*	Get the elements of a certain vectors at position i
+*/
+LaneRoadMarkLine* LaneRoadMarkType::GetLaneRoadMarkLine(unsigned int i)
+{
+    if ((mvetorLaneRoadMarkLine.size()>0)&&(i<mvetorLaneRoadMarkLine.size()))
+        return &mvetorLaneRoadMarkLine.at(i);
+    else
+        return NULL;
+}
+
+
+/**
+*	Get the last elements of a certain vectors
+*/
+LaneRoadMarkLine* LaneRoadMarkType::GetLastLaneRoadMarkLine()
+{
+    if (mvetorLaneRoadMarkLine.size()>0)
+        return &mvetorLaneRoadMarkLine.at(mvetorLaneRoadMarkLine.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)
+*/
+LaneRoadMarkLine* LaneRoadMarkType::GetLastAddedLaneRoadMarkLine()
+{
+    if(mLastAddedLaneRoadMarkLine<mvetorLaneRoadMarkLine.size())
+        return &mvetorLaneRoadMarkLine.at(mLastAddedLaneRoadMarkLine);
+    else
+        return NULL;
+}
+
+
+/*
+* Methods that set the parameters of the lane roadmark line
 */
 void LaneRoadMarkLine::Setlength(double length)
 {

+ 91 - 51
src/common/common/xodr/OpenDrive/Lane.h

@@ -20,6 +20,7 @@ class LaneSpeed;
 class LaneAccess;
 class LaneHeight;
 class LaneBorder;
+class LaneRoadMarkType;
 
 using std::vector;
 using std::string;
@@ -601,7 +602,7 @@ private:
 	double mWidth;
 	string mLaneChange;
 
-    vector<LaneRoadMarkLine> mvetorLaneRoadMarkLine;
+    vector<LaneRoadMarkType> mvectorLaneRoadMarkType;
 
 public:
 	/*
@@ -621,6 +622,9 @@ public:
 	void SetWidth(double value);
 	void SetLaneChange(string laneChange);
 
+    void SetLaneRoadMarkType(LaneRoadMarkType  laneRoadMarkType);
+    void ResetLaneRoadMarkType();
+
 	/*
 	* Methods that return the parameters of the road mark
 	*/
@@ -630,56 +634,9 @@ public:
 	string GetColor();
 	double GetWidth();
 	string GetLaneChange();
+    int GetLaneRoadMarkType(LaneRoadMarkType & laneRoadMarkType);
 
-    /**
-     * Methods used to add child records to the respective vectors
-     */
-    unsigned int AddLaneRoadMarkLine(double s, double a, double b, double c, double d);
 
-    /**
-     * Methods used to clone child records in the respective vectors
-     */
-    unsigned int CloneLaneRoadMarkLine(unsigned int index);
-
-    /**
-     * Methods used to delete child records from the respective vectors
-     */
-    void DeleteLaneRoadMarkLine(unsigned int index);
-
-
-    /**
-    *	Get pointers to the records vectors
-    */
-    vector <LaneRoadMarkLine> *GetLaneRoadMarkLineVector();
-
-
-
-    /**
-    *	Get the number of elements in a certain vector
-    */
-    unsigned int GetLaneRoadMarkLineCount();
-
-
-    /**
-    *	Get the elements of a certain vectors at position i
-    */
-    LaneWidth* GetLaneRoadMarkLine(unsigned int i);
-
-
-    /**
-    *	Get the last elements of a certain vectors
-    */
-    LaneWidth* GetLastLaneRoadMarkLine();
-
-    /**
-    *	Get the last added elements of a certain vectors (their position might not be at the end of the vector)
-    */
-    LaneWidth* GetLastAddedLaneRoadMarkLine();
-
-
-    /**
-    *	Check the intervals and return the index of the records that applies to the provided s-offset
-    */
 
 
 };
@@ -926,6 +883,89 @@ public:
 
 //----------------------------------------------------------------------------------
 
+class LaneRoadMarkType
+{
+private:
+    /*
+    * Parameters that describe the lane roadmark type
+    */
+    std::string mstrname;
+    double mfwidth;
+
+    vector<LaneRoadMarkLine> mvetorLaneRoadMarkLine;
+
+    unsigned int mLastAddedLaneRoadMarkLine;
+
+public:
+    /*
+    * Constructors
+    */
+    LaneRoadMarkType(std::string strname,double fwidth);
+
+    /*
+    * Methods that return the parameters of the lane roadmark
+    */
+
+    std::string Getname();
+    double GetWidth();
+
+    /*
+    * Methods that set the parameters of the lane roadmark
+    */
+
+    void Setname(std::string name);
+    void SetWidth(double width);
+
+    /**
+     * Methods used to add child records to the respective vectors
+     */
+    unsigned int AddLaneRoadMarkLine(double length, double space, double tOffset, double sOffset);
+
+    /**
+     * Methods used to clone child records in the respective vectors
+     */
+    unsigned int CloneLaneRoadMarkLine(unsigned int index);
+
+    /**
+     * Methods used to delete child records from the respective vectors
+     */
+    void DeleteLaneRoadMarkLine(unsigned int index);
+
+
+    /**
+    *	Get pointers to the records vectors
+    */
+    vector <LaneRoadMarkLine> *GetLaneRoadMarkLineVector();
+
+
+
+    /**
+    *	Get the number of elements in a certain vector
+    */
+    unsigned int GetLaneRoadMarkLineCount();
+
+
+    /**
+    *	Get the elements of a certain vectors at position i
+    */
+    LaneRoadMarkLine* GetLaneRoadMarkLine(unsigned int i);
+
+
+    /**
+    *	Get the last elements of a certain vectors
+    */
+    LaneRoadMarkLine* GetLastLaneRoadMarkLine();
+
+    /**
+    *	Get the last added elements of a certain vectors (their position might not be at the end of the vector)
+    */
+    LaneRoadMarkLine* GetLastAddedLaneRoadMarkLine();
+
+
+};
+
+//----------------------------------------------------------------------------------
+
 class LaneRoadMarkLine
 {
 private:
@@ -947,7 +987,7 @@ public:
 
 
     /*
-    * Methods that return the parameters of the lane offset
+    * Methods that return the parameters of the lane roadmark
     */
     double Getlength();
     double Getspace();
@@ -959,7 +999,7 @@ public:
 
 
     /*
-    * Methods that set the parameters of the lane offset
+    * Methods that set the parameters of the lane roadmark
     */
     void Setlength(double length);
     void Setspace(double space);

+ 86 - 0
src/common/common/xodr/OpenDrive/OpenDriveXmlParser.cpp

@@ -1033,10 +1033,96 @@ bool OpenDriveXmlParser::ReadLaneRoadMark(Lane* lane, TiXmlElement *node)
 
 	lane->AddRoadMarkRecord(sOffset,type,weight,color,width,laneChange);
 
+    LaneRoadMark * pLaneRoadMark = lane->GetLastAddedLaneRoadMark();
+
+    TiXmlElement *subNode =node->FirstChildElement("type");
+    if(subNode)
+    {
+        ReadLaneRoadMarkType(pLaneRoadMark, subNode);
+    }
+
 	return true;
 }
 //--------------
 
+bool OpenDriveXmlParser::ReadLaneRoadMarkType(LaneRoadMark * planeRoadMark,TiXmlElement *node)
+{
+    string name;
+    double width;
+
+    int checker=TIXML_SUCCESS;
+    checker+=node->QueryStringAttribute("name",&name);
+    checker+=node->QueryDoubleAttribute("width",&width);
+
+    if (checker!=TIXML_SUCCESS)
+    {
+        cout<<"Error parsing Lane RoadMark Type attributes"<<endl;
+        return false;
+    }
+
+    LaneRoadMarkType laneRoadMarkType(name,width);
+
+    TiXmlElement *subNode =node->FirstChildElement("line");
+    while(subNode)
+    {
+        ReadLaneRoadMarkTypeLine(&laneRoadMarkType, subNode);
+        subNode=subNode->NextSiblingElement("line");
+    }
+
+    planeRoadMark->SetLaneRoadMarkType(laneRoadMarkType);
+
+
+
+    return true;
+}
+
+//--------------
+
+bool OpenDriveXmlParser::ReadLaneRoadMarkTypeLine(LaneRoadMarkType * planeRoadMarkType, TiXmlElement *node)
+{
+    double length;
+    double space;
+    double tOffset;
+    double sOffset;
+
+    int checker=TIXML_SUCCESS;
+    checker+=node->QueryDoubleAttribute("length",&length);
+    checker+=node->QueryDoubleAttribute("space",&space);
+    checker+=node->QueryDoubleAttribute("tOffset",&tOffset);
+    checker+=node->QueryDoubleAttribute("sOffset",&sOffset);
+
+    if (checker!=TIXML_SUCCESS)
+    {
+        cout<<"Error parsing Lane RoadMark Type line attributes"<<endl;
+        return false;
+    }
+
+    planeRoadMarkType->AddLaneRoadMarkLine(length,space,tOffset,sOffset);
+
+    LaneRoadMarkLine * planeRoadMarkLine = planeRoadMarkType->GetLastAddedLaneRoadMarkLine();
+
+    std::string rule,color;
+    double width;
+    if (node->QueryStringAttribute("rule",&rule) ==TIXML_SUCCESS)
+    {
+        planeRoadMarkLine->Setrule(rule);
+    }
+
+    if (node->QueryStringAttribute("color",&color) ==TIXML_SUCCESS)
+    {
+        planeRoadMarkLine->Setcolor(color);
+    }
+
+    if (node->QueryDoubleAttribute("width",&width) ==TIXML_SUCCESS)
+    {
+        planeRoadMarkLine->Setwidth(width);
+    }
+
+    return true;
+}
+
+//--------------
+
 bool OpenDriveXmlParser::ReadLaneMaterial(Lane* lane, TiXmlElement *node)
 {
 	double sOffset;

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

@@ -57,6 +57,8 @@ public:
 	bool ReadLane (LaneSection* laneSection, TiXmlElement *node, short int laneType);
 	bool ReadLaneWidth(Lane* lane, TiXmlElement *node);
 	bool ReadLaneRoadMark(Lane* lane, TiXmlElement *node);
+    bool ReadLaneRoadMarkType(LaneRoadMark * planeRoadMark,TiXmlElement *node);
+    bool ReadLaneRoadMarkTypeLine(LaneRoadMarkType * planeRoadMarkType, TiXmlElement *node);
 	bool ReadLaneMaterial(Lane* lane, TiXmlElement *node);
 	bool ReadLaneVisibility(Lane* lane, TiXmlElement *node);
 	bool ReadLaneSpeed(Lane* lane, TiXmlElement *node);

+ 78 - 0
src/common/common/xodr/OpenDrive/OpenDriveXmlWriter.cpp

@@ -992,10 +992,88 @@ bool OpenDriveXmlWriter::WriteLaneRoadMark(TiXmlElement *node, LaneRoadMark* lan
 	nodeLaneRoadMark->SetAttribute("width",swidth.str());
 	nodeLaneRoadMark->SetAttribute("laneChange",laneChange);
 
+    LaneRoadMarkType laneRoadMarkType("broken",0.15);
+    if(laneRoadMark->GetLaneRoadMarkType(laneRoadMarkType) == 1)
+    {
+        WriteLaneRoadMarkType(nodeLaneRoadMark,&laneRoadMarkType);
+    }
+
 	return true;
 }
 //--------------
 
+bool OpenDriveXmlWriter::WriteLaneRoadMarkType(TiXmlElement *node, LaneRoadMarkType * laneRoadMarkType)
+{
+    std::string name;
+    double width;
+    name = laneRoadMarkType->Getname();
+    width = laneRoadMarkType->GetWidth();
+
+    TiXmlElement* nodeLaneRoadMarkType = new TiXmlElement("type");
+    node->LinkEndChild(nodeLaneRoadMarkType);
+
+    nodeLaneRoadMarkType->SetAttribute("name",name);
+    nodeLaneRoadMarkType->SetDoubleAttribute("width",width);
+
+    unsigned int nCount = laneRoadMarkType->GetLaneRoadMarkLineCount();
+    unsigned int i;
+    for(i=0;i<nCount;i++)
+    {
+        LaneRoadMarkLine * pLaneRoadMarkLine = laneRoadMarkType->GetLaneRoadMarkLine(i);
+        if(pLaneRoadMarkLine != NULL)
+        {
+            WriteLaneRoadMarkLine(nodeLaneRoadMarkType,pLaneRoadMarkLine);
+        }
+    }
+
+    return true;
+}
+
+//--------------
+
+bool OpenDriveXmlWriter::WriteLaneRoadMarkLine(TiXmlElement *node, LaneRoadMarkLine * laneRoadMarkLine)
+{
+    double length;
+    double space;
+    double tOffset;
+    double sOffset;
+
+    length = laneRoadMarkLine->Getlength();
+    space = laneRoadMarkLine->Getspace();
+    tOffset = laneRoadMarkLine->GettOffset();
+    sOffset = laneRoadMarkLine->GetsOffset();
+
+    std::string rule;
+    std::string color;
+    double width;
+
+    TiXmlElement* nodeLaneRoadMarkTypeLine = new TiXmlElement("line");
+    node->LinkEndChild(nodeLaneRoadMarkTypeLine);
+
+    nodeLaneRoadMarkTypeLine->SetDoubleAttribute("length",length);
+    nodeLaneRoadMarkTypeLine->SetDoubleAttribute("space",space);
+    nodeLaneRoadMarkTypeLine->SetDoubleAttribute("tOffset",tOffset);
+    nodeLaneRoadMarkTypeLine->SetDoubleAttribute("sOffset",sOffset);
+
+    if(laneRoadMarkLine->Getcolor(color) == 1)
+    {
+        nodeLaneRoadMarkTypeLine->SetAttribute("color",color);
+    }
+
+    if(laneRoadMarkLine->Getrule(rule) == 1)
+    {
+        nodeLaneRoadMarkTypeLine->SetAttribute("rule",rule);
+    }
+
+    if(laneRoadMarkLine->Getwidth(width) == 1)
+    {
+        nodeLaneRoadMarkTypeLine->SetDoubleAttribute("width",width);
+    }
+
+    return  true;
+}
+//--------------
+
 bool OpenDriveXmlWriter::WriteLaneMaterial(TiXmlElement *node, LaneMaterial* laneMaterial)
 {
 	double sOffset;

+ 4 - 0
src/common/common/xodr/OpenDrive/OpenDriveXmlWriter.h

@@ -58,6 +58,8 @@ public:
 	bool WriteLane (TiXmlElement *node, Lane* lane);
 	bool WriteLaneWidth(TiXmlElement *node, LaneWidth* laneWidth);
 	bool WriteLaneRoadMark(TiXmlElement *node, LaneRoadMark* laneRoadMark);
+    bool WriteLaneRoadMarkType(TiXmlElement *node, LaneRoadMarkType * laneRoadMarkType);
+    bool WriteLaneRoadMarkLine(TiXmlElement *node, LaneRoadMarkLine * laneRoadMarkLine);
 	bool WriteLaneMaterial(TiXmlElement *node, LaneMaterial* laneMaterial);
 	bool WriteLaneVisibility(TiXmlElement *node, LaneVisibility* laneVisibility);
 	bool WriteLaneSpeed(TiXmlElement *node, LaneSpeed* laneSpeed);
@@ -65,6 +67,8 @@ public:
 	bool WriteLaneHeight(TiXmlElement *node, LaneHeight* laneHeight);
     bool WriteLaneOffset (TiXmlElement *node, LaneOffset *laneOffset);
     bool WriteLaneBorder(TiXmlElement *node, LaneBorder* laneWidth);
+
+
 	//--------------
 
     bool WriteRoadNoavoids(TiXmlElement *node, Road* road);

+ 12 - 3
src/include/proto/cdadraw.proto

@@ -3,12 +3,20 @@ syntax = "proto2";
 package iv.map;
 
 message cdalane
+{
+
+	required double lanewidth	= 1; //车道宽度
+	required int32 lanetype		= 2; //车道类型 "shoulder","border","driving","stop","none","parking","biking","sidewalk","median"
+
+};
+
+message cdalanemarkline
 {
 	required int32 lanemarkcolor	= 1; //车道线颜色  0 白色 1 黄色
 	required int32 lanemarktype 	= 2; //车道线类型    0 虚线 1 实线 2 双虚线  3 双实线  4 虚实线 5 实虚线  6 无
-	required double lanewidth	= 3; //车道宽度
-	required int32 lanetype		= 4; //车道类型 "shoulder","border","driving","stop","none","parking","biking","sidewalk","median"
-	required double lanemarkwidth	= 5; //
+	required double lanemarkwidth	= 3; //
+	required double lanemarklinelength = 4;
+	required double lanemarklinespace = 5;
 };
 
 message cdageo
@@ -24,6 +32,7 @@ message cdadraw
 	repeated cdageo mgeos		=2;  //路段
 	required int32 mroadtype	=3;  //道路类型  0 高速公路  1 城市  2 乡村
 	required int32  mroadele	=4;  //坡度  0 平路  1 缓上坡  2 上坡  3 缓下坡 4 下坡
+	repeated cdalanemarkline mlanemarkline	=5;  //车道线
 };
 
 

+ 131 - 12
src/tool/map_lanetoxodr/dialogaddroadfromcda.cpp

@@ -27,11 +27,22 @@ DialogAddRoadFromCDA::DialogAddRoadFromCDA(OpenDrive * pxodr, QWidget *parent) :
     pgeo->set_geolen(100.0);
 
     iv::map::cdalane * plane = mcdadraw.add_mlanes();
-    plane->set_lanemarkcolor(0);
-    plane->set_lanemarktype(0);
     plane->set_lanewidth(3.6);
     plane->set_lanetype(2);
 
+    iv::map::cdalanemarkline * planemarkline = mcdadraw.add_mlanemarkline();
+    planemarkline->set_lanemarkcolor(0);
+    planemarkline->set_lanemarktype(0);
+    planemarkline->set_lanemarklinelength(6);
+    planemarkline->set_lanemarklinespace(6);
+    planemarkline->set_lanemarkwidth(0.15);
+    planemarkline = mcdadraw.add_mlanemarkline();
+    planemarkline->set_lanemarkcolor(0);
+    planemarkline->set_lanemarktype(0);
+    planemarkline->set_lanemarklinelength(6);
+    planemarkline->set_lanemarklinespace(6);
+    planemarkline->set_lanemarkwidth(0.15);
+
     mcdadraw.set_mroadtype(0);
     mcdadraw.set_mroadele(0);
 
@@ -160,6 +171,12 @@ void DialogAddRoadFromCDA::UpdateView()
     {
         ui->comboBox_Lane->addItem(QString(tr("车道"))+QString::number(i+1));
     }
+    ui->comboBox_LaneMark->clear();
+    int nlanemarklinecount = static_cast<int>(pcdadraw->mlanemarkline_size());
+    for(i=0;i<nlanemarklinecount;i++)
+    {
+        ui->comboBox_LaneMark->addItem(QString(tr("车道线"))+QString::number(i));
+    }
     ui->lineEdit_roadlen->setText(QString::number(fRoadLen));
 }
 
@@ -174,8 +191,8 @@ void DialogAddRoadFromCDA::on_comboBox_Lane_currentIndexChanged(int index)
         return;
     }
     iv::map::cdalane * plane = mcdadraw.mutable_mlanes(index);
-    ui->comboBox_lanecolor->setCurrentIndex(plane->lanemarkcolor());
-    ui->comboBox_lanemarktype->setCurrentIndex(plane->lanemarktype());
+//    ui->comboBox_lanecolor->setCurrentIndex(plane->lanemarkcolor());
+//    ui->comboBox_lanemarktype->setCurrentIndex(plane->lanemarktype());
     ui->lineEdit_lanewidth->setText(QString::number(plane->lanewidth(),'f',2));
     ui->comboBox_lanetype->setCurrentIndex(plane->lanetype());
 }
@@ -205,18 +222,51 @@ void DialogAddRoadFromCDA::on_pushButton_laneadd_clicked()
        return;
    }
    iv::map::cdalane * plane = pcdadraw->add_mlanes();
-   plane->set_lanemarkcolor(ui->comboBox_lanecolor->currentIndex());
-   plane->set_lanemarktype(ui->comboBox_lanemarktype->currentIndex());
+//   plane->set_lanemarkcolor(ui->comboBox_lanecolor->currentIndex());
+//   plane->set_lanemarktype(ui->comboBox_lanemarktype->currentIndex());
    plane->set_lanewidth(flanewidth);
    plane->set_lanetype(ui->comboBox_lanetype->currentIndex());
    double flanemarkwidth = ui->lineEdit_lanemarkwidth->text().toDouble();
    if(flanemarkwidth<0.001)flanemarkwidth = 0.15;
-   plane->set_lanemarkwidth(flanemarkwidth);
+//   plane->set_lanemarkwidth(flanemarkwidth);
+
+   if(pcdadraw->mlanes_size() == 1)
+   {
+       iv::map::cdalanemarkline * planemarkline = mcdadraw.add_mlanemarkline();
+       planemarkline->set_lanemarkcolor(0);
+       planemarkline->set_lanemarktype(0);
+       planemarkline->set_lanemarklinelength(6);
+       planemarkline->set_lanemarklinespace(6);
+       planemarkline->set_lanemarkwidth(0.15);
+       planemarkline = mcdadraw.add_mlanemarkline();
+       planemarkline->set_lanemarkcolor(0);
+       planemarkline->set_lanemarktype(0);
+       planemarkline->set_lanemarklinelength(6);
+       planemarkline->set_lanemarklinespace(6);
+       planemarkline->set_lanemarkwidth(0.15);
+   }
+   else
+   {
+       iv::map::cdalanemarkline * planemarkline = mcdadraw.add_mlanemarkline();
+       planemarkline->set_lanemarkcolor(0);
+       planemarkline->set_lanemarktype(0);
+       planemarkline->set_lanemarklinelength(6);
+       planemarkline->set_lanemarklinespace(6);
+       planemarkline->set_lanemarkwidth(0.15);
+   }
 
    int nlanecount = static_cast<int>(pcdadraw->mlanes_size()) ;
    ui->comboBox_Lane->addItem(QString(tr("车道"))+QString::number(nlanecount));
    ui->comboBox_Lane->setCurrentIndex(nlanecount-1);
    ui->lineEdit_roadlanecount->setText(QString::number(nlanecount));
+
+   ui->comboBox_LaneMark->clear();
+   int nlanemarklinecount = static_cast<int>(pcdadraw->mlanemarkline_size());
+   int i;
+   for(i=0;i<nlanemarklinecount;i++)
+   {
+       ui->comboBox_LaneMark->addItem(QString(tr("车道线"))+QString::number(i));
+   }
 }
 
 void DialogAddRoadFromCDA::on_pushButton_lanedel_clicked()
@@ -261,6 +311,35 @@ void DialogAddRoadFromCDA::on_pushButton_lanedel_clicked()
     {
         ui->comboBox_Lane->setCurrentIndex((nlanecount-1));
     }
+
+    if(pcdadraw->mlanes_size() == 0)
+    {
+        pcdadraw->clear_mlanemarkline();
+    }
+    else
+    {
+        iv::map::cdadraw xtemp;
+        for(i=0;i<pcdadraw->mlanemarkline_size();i++)
+        {
+            if(i == (index+1))continue;
+            iv::map::cdalanemarkline * planemark = xtemp.add_mlanemarkline();
+            planemark->CopyFrom(pcdadraw->mlanemarkline(i));
+        }
+        pcdadraw->clear_mlanemarkline();
+        for(i=0;i<xtemp.mlanemarkline_size();i++)
+        {
+            iv::map::cdalanemarkline * planemark = pcdadraw->add_mlanemarkline();
+            planemark->CopyFrom(xtemp.mlanemarkline(i));
+        }
+    }
+
+    ui->comboBox_LaneMark->clear();
+    int nlanemarklinecount = static_cast<int>(pcdadraw->mlanemarkline_size());
+    for(i=0;i<nlanemarklinecount;i++)
+    {
+        ui->comboBox_LaneMark->addItem(QString(tr("车道线"))+QString::number(i));
+    }
+
 }
 
 void DialogAddRoadFromCDA::on_pushButton_lanechange_clicked()
@@ -280,13 +359,13 @@ void DialogAddRoadFromCDA::on_pushButton_lanechange_clicked()
     }
 
     iv::map::cdalane * plane = pcdadraw->mutable_mlanes(index);
-    plane->set_lanemarkcolor(ui->comboBox_lanecolor->currentIndex());
-    plane->set_lanemarktype(ui->comboBox_lanemarktype->currentIndex());
+//    plane->set_lanemarkcolor(ui->comboBox_lanecolor->currentIndex());
+//    plane->set_lanemarktype(ui->comboBox_lanemarktype->currentIndex());
     plane->set_lanewidth(flanewidth);
     plane->set_lanetype(ui->comboBox_lanetype->currentIndex());
-    double flanemarkwidth = ui->lineEdit_lanemarkwidth->text().toDouble();
-    if(flanemarkwidth<0.001)flanemarkwidth = 0.15;
-    plane->set_lanemarkwidth(flanemarkwidth);
+ //   double flanemarkwidth = ui->lineEdit_lanemarkwidth->text().toDouble();
+ //   if(flanemarkwidth<0.001)flanemarkwidth = 0.15;
+//    plane->set_lanemarkwidth(flanemarkwidth);
     ui->comboBox_Lane->setCurrentIndex(index);
     QMessageBox::information(this,tr("Info"),tr("Change Lane Successfully."),QMessageBox::YesAll);
 }
@@ -511,3 +590,43 @@ void DialogAddRoadFromCDA::on_pushButton_Load_clicked()
     }
     delete input;
 }
+
+void DialogAddRoadFromCDA::on_comboBox_LaneMark_currentIndexChanged(int index)
+{
+    iv::map::cdadraw * pcdadraw = &mcdadraw;
+    if(index<0)return;
+    if(index>=pcdadraw->mlanemarkline_size())
+    {
+        std::cout<<" index big than lane mark size."<<std::endl;
+        return;
+    }
+    iv::map::cdalanemarkline * planemarkline = mcdadraw.mutable_mlanemarkline(index);
+    ui->comboBox_lanecolor->setCurrentIndex(planemarkline->lanemarkcolor());
+    ui->comboBox_lanemarktype->setCurrentIndex(planemarkline->lanemarktype());
+    ui->lineEdit_lanemarkwidth->setText(QString::number(planemarkline->lanemarkwidth(),'f',3));
+    ui->lineEdit_lanemarklinelength->setText(QString::number(planemarkline->lanemarklinelength(),'f',3));
+    ui->lineEdit_lanemarklinespace->setText(QString::number(planemarkline->lanemarklinespace(),'f',3));
+
+}
+
+void DialogAddRoadFromCDA::on_pushButton_laneMarkChange_clicked()
+{
+    iv::map::cdadraw * pcdadraw = &mcdadraw;
+    if(pcdadraw->mlanemarkline_size() == 0)
+    {
+        QMessageBox::warning(this,tr("Warning"),tr("No Lane Mark Line."),QMessageBox::YesAll);
+        return;
+    }
+
+
+    int index = ui->comboBox_LaneMark->currentIndex();
+    iv::map::cdalanemarkline * pmarkline = pcdadraw->mutable_mlanemarkline(index);
+
+    pmarkline->set_lanemarkcolor(ui->comboBox_lanecolor->currentIndex());
+    pmarkline->set_lanemarktype(ui->comboBox_lanemarktype->currentIndex());
+    double flanemarkwidth = ui->lineEdit_lanemarkwidth->text().toDouble();
+    if(flanemarkwidth<0.001)flanemarkwidth = 0.15;
+    pmarkline->set_lanemarkwidth(flanemarkwidth);
+    pmarkline->set_lanemarklinelength(ui->lineEdit_lanemarklinelength->text().toDouble());
+    pmarkline->set_lanemarklinespace(ui->lineEdit_lanemarklinespace->text().toDouble());
+}

+ 4 - 0
src/tool/map_lanetoxodr/dialogaddroadfromcda.h

@@ -43,6 +43,10 @@ private slots:
 
     void on_pushButton_Load_clicked();
 
+    void on_comboBox_LaneMark_currentIndexChanged(int index);
+
+    void on_pushButton_laneMarkChange_clicked();
+
 private:
     Ui::DialogAddRoadFromCDA *ui;
     OpenDrive * mpxodr;

+ 184 - 83
src/tool/map_lanetoxodr/dialogaddroadfromcda.ui

@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>900</width>
-    <height>690</height>
+    <width>910</width>
+    <height>800</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -40,7 +40,7 @@
    <property name="geometry">
     <rect>
      <x>358</x>
-     <y>617</y>
+     <y>717</y>
      <width>161</width>
      <height>51</height>
     </rect>
@@ -98,66 +98,20 @@
   <widget class="QGroupBox" name="groupBox">
    <property name="geometry">
     <rect>
-     <x>63</x>
+     <x>60</x>
      <y>123</y>
      <width>781</width>
-     <height>271</height>
+     <height>131</height>
     </rect>
    </property>
    <property name="title">
-    <string>车道线设置</string>
+    <string>车道设置</string>
    </property>
-   <widget class="QComboBox" name="comboBox_lanemarktype">
-    <property name="geometry">
-     <rect>
-      <x>531</x>
-      <y>84</y>
-      <width>161</width>
-      <height>41</height>
-     </rect>
-    </property>
-   </widget>
-   <widget class="QLabel" name="label_7">
-    <property name="geometry">
-     <rect>
-      <x>410</x>
-      <y>85</y>
-      <width>121</width>
-      <height>41</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string>车道线类型:</string>
-    </property>
-   </widget>
-   <widget class="QLabel" name="label_6">
-    <property name="geometry">
-     <rect>
-      <x>30</x>
-      <y>84</y>
-      <width>121</width>
-      <height>41</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string>车道线颜色:</string>
-    </property>
-   </widget>
    <widget class="QLineEdit" name="lineEdit_lanewidth">
     <property name="geometry">
      <rect>
       <x>150</x>
-      <y>140</y>
-      <width>161</width>
-      <height>41</height>
-     </rect>
-    </property>
-   </widget>
-   <widget class="QComboBox" name="comboBox_lanecolor">
-    <property name="geometry">
-     <rect>
-      <x>150</x>
-      <y>85</y>
+      <y>86</y>
       <width>161</width>
       <height>41</height>
      </rect>
@@ -167,7 +121,7 @@
     <property name="geometry">
      <rect>
       <x>30</x>
-      <y>140</y>
+      <y>86</y>
       <width>101</width>
       <height>41</height>
      </rect>
@@ -242,7 +196,7 @@
     <property name="geometry">
      <rect>
       <x>410</x>
-      <y>140</y>
+      <y>86</y>
       <width>121</width>
       <height>41</height>
      </rect>
@@ -255,41 +209,18 @@
     <property name="geometry">
      <rect>
       <x>530</x>
-      <y>140</y>
+      <y>86</y>
       <width>161</width>
       <height>41</height>
      </rect>
     </property>
    </widget>
-   <widget class="QLineEdit" name="lineEdit_lanemarkwidth">
-    <property name="geometry">
-     <rect>
-      <x>150</x>
-      <y>200</y>
-      <width>161</width>
-      <height>41</height>
-     </rect>
-    </property>
-   </widget>
-   <widget class="QLabel" name="label_14">
-    <property name="geometry">
-     <rect>
-      <x>30</x>
-      <y>200</y>
-      <width>101</width>
-      <height>41</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string>车道线宽度:</string>
-    </property>
-   </widget>
   </widget>
   <widget class="QGroupBox" name="groupBox_2">
    <property name="geometry">
     <rect>
-     <x>61</x>
-     <y>402</y>
+     <x>60</x>
+     <y>514</y>
      <width>781</width>
      <height>181</height>
     </rect>
@@ -456,7 +387,7 @@
    <property name="geometry">
     <rect>
      <x>60</x>
-     <y>617</y>
+     <y>717</y>
      <width>161</width>
      <height>51</height>
     </rect>
@@ -469,7 +400,7 @@
    <property name="geometry">
     <rect>
      <x>690</x>
-     <y>617</y>
+     <y>717</y>
      <width>161</width>
      <height>51</height>
     </rect>
@@ -478,6 +409,176 @@
     <string>导入</string>
    </property>
   </widget>
+  <widget class="QGroupBox" name="groupBox_3">
+   <property name="geometry">
+    <rect>
+     <x>60</x>
+     <y>262</y>
+     <width>781</width>
+     <height>241</height>
+    </rect>
+   </property>
+   <property name="title">
+    <string>车道线设置</string>
+   </property>
+   <widget class="QComboBox" name="comboBox_lanemarktype">
+    <property name="geometry">
+     <rect>
+      <x>520</x>
+      <y>84</y>
+      <width>161</width>
+      <height>41</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QComboBox" name="comboBox_lanecolor">
+    <property name="geometry">
+     <rect>
+      <x>139</x>
+      <y>85</y>
+      <width>161</width>
+      <height>41</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_6">
+    <property name="geometry">
+     <rect>
+      <x>19</x>
+      <y>84</y>
+      <width>121</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>车道线颜色:</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_7">
+    <property name="geometry">
+     <rect>
+      <x>399</x>
+      <y>85</y>
+      <width>121</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>车道线类型:</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_lanemarkwidth">
+    <property name="geometry">
+     <rect>
+      <x>140</x>
+      <y>139</y>
+      <width>161</width>
+      <height>41</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_14">
+    <property name="geometry">
+     <rect>
+      <x>20</x>
+      <y>139</y>
+      <width>101</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>车道线宽度:</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_15">
+    <property name="geometry">
+     <rect>
+      <x>20</x>
+      <y>30</y>
+      <width>141</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>车道线:</string>
+    </property>
+   </widget>
+   <widget class="QComboBox" name="comboBox_LaneMark">
+    <property name="geometry">
+     <rect>
+      <x>140</x>
+      <y>30</y>
+      <width>161</width>
+      <height>41</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="pushButton_laneMarkChange">
+    <property name="geometry">
+     <rect>
+      <x>340</x>
+      <y>30</y>
+      <width>101</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>修改</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_lanemarklinelength">
+    <property name="geometry">
+     <rect>
+      <x>140</x>
+      <y>190</y>
+      <width>161</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string/>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_16">
+    <property name="geometry">
+     <rect>
+      <x>20</x>
+      <y>190</y>
+      <width>101</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>标线长度:</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_lanemarklinespace">
+    <property name="geometry">
+     <rect>
+      <x>520</x>
+      <y>190</y>
+      <width>161</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string/>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_17">
+    <property name="geometry">
+     <rect>
+      <x>400</x>
+      <y>190</y>
+      <width>101</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>标线间隔:</string>
+    </property>
+   </widget>
+  </widget>
  </widget>
  <resources/>
  <connections/>

+ 118 - 14
src/tool/map_lanetoxodr/function/cdaproc.cpp

@@ -80,7 +80,21 @@ int CDAProc::ProcIntersectionRoad(OpenDrive * pxodr, iv::map::cdadraw * pcdadraw
         LaneSection * pLS = pRoad->GetLaneSection(0);
         pLS->AddLane(0,0,"none",false);
         Lane * pcenterlane = pLS->GetLastAddedLane();
-        pcenterlane->AddRoadMarkRecord(0,"solid solid","standard","yellow",0.15,"none");
+        iv::map::cdalanemarkline * pmark = pcdadraw->mutable_mlanemarkline(0);
+        if(pmark == NULL)
+            pcenterlane->AddRoadMarkRecord(0,"solid solid","standard","yellow",0.15,"none");
+        else
+        {
+            pcenterlane->AddRoadMarkRecord(0,cda_lanemarktype_sel[pmark->lanemarktype()],"standard",
+                    cda_lanemarkcolor_sel[pmark->lanemarkcolor()],pmark->lanemarkwidth(),"none");
+            if(pmark->lanemarktype() == 0)
+            {
+                LaneRoadMark * pLaneRoadMark = pcenterlane->GetLastAddedLaneRoadMark();
+                LaneRoadMarkType laneRoadMarkType(cda_lanemarktype_sel[pmark->lanemarktype()],pmark->lanemarkwidth());
+                laneRoadMarkType.AddLaneRoadMarkLine(pmark->lanemarklinelength(),pmark->lanemarklinespace(),0,0);
+                pLaneRoadMark->SetLaneRoadMarkType(laneRoadMarkType);
+            }
+        }
 
         int j;
         for(j=0;j<nlanecount;j++)
@@ -90,13 +104,34 @@ int CDAProc::ProcIntersectionRoad(OpenDrive * pxodr, iv::map::cdadraw * pcdadraw
             Lane * pnewlane = pLS->GetLastAddedLane();
 
             pnewlane->AddWidthRecord(0,pcdalane->lanewidth(),0,0,0);
-            pnewlane->AddRoadMarkRecord(0,cda_lanemarktype_sel[pcdalane->lanemarktype()],"standard",cda_lanemarkcolor_sel[pcdalane->lanemarkcolor()],pcdalane->lanemarkwidth(),"none");
-
+            pmark = pcdadraw->mutable_mlanemarkline(j+1);
+            if(pmark != NULL)
+            {
+                pnewlane->AddRoadMarkRecord(0,cda_lanemarktype_sel[pmark->lanemarktype()],"standard",
+                        cda_lanemarkcolor_sel[pmark->lanemarkcolor()],pmark->lanemarkwidth(),"none");
+                if(pmark->lanemarktype() == 0)
+                {
+                    LaneRoadMark * pLaneRoadMark = pnewlane->GetLastAddedLaneRoadMark();
+                    LaneRoadMarkType laneRoadMarkType(cda_lanemarktype_sel[pmark->lanemarktype()],pmark->lanemarkwidth());
+                    laneRoadMarkType.AddLaneRoadMarkLine(pmark->lanemarklinelength(),pmark->lanemarklinespace(),0,0);
+                    pLaneRoadMark->SetLaneRoadMarkType(laneRoadMarkType);
+                }
+            }
             pLS->AddLane(1,(j+1)*(1),cda_lanetype_sel[pcdalane->lanetype()],false,true);
             pnewlane = pLS->GetLastAddedLane();
             pnewlane->AddWidthRecord(0,pcdalane->lanewidth(),0,0,0);
-            pnewlane->AddRoadMarkRecord(0,cda_lanemarktype_sel[pcdalane->lanemarktype()],"standard",cda_lanemarkcolor_sel[pcdalane->lanemarkcolor()],pcdalane->lanemarkwidth(),"none");
-
+            if(pmark != NULL)
+            {
+                pnewlane->AddRoadMarkRecord(0,cda_lanemarktype_sel[pmark->lanemarktype()],"standard",
+                        cda_lanemarkcolor_sel[pmark->lanemarkcolor()],pmark->lanemarkwidth(),"none");
+                if(pmark->lanemarktype() == 0)
+                {
+                    LaneRoadMark * pLaneRoadMark = pnewlane->GetLastAddedLaneRoadMark();
+                    LaneRoadMarkType laneRoadMarkType(cda_lanemarktype_sel[pmark->lanemarktype()],pmark->lanemarkwidth());
+                    laneRoadMarkType.AddLaneRoadMarkLine(pmark->lanemarklinelength(),pmark->lanemarklinespace(),0,0);
+                    pLaneRoadMark->SetLaneRoadMarkType(laneRoadMarkType);
+                }
+            }
         }
         if(i==2)
         {
@@ -692,7 +727,21 @@ int CDAProc::ProcCDA(iv::map::cdadraw & xcdadraw,OpenDrive * pxodr)
             LaneSection * pLS = pRoad->GetLaneSection(0);
             pLS->AddLane(0,0,"none",false);
             Lane * pcenterlane = pLS->GetLastAddedLane();
-            pcenterlane->AddRoadMarkRecord(0,"solid solid","standard","yellow",0.15,"none");
+            iv::map::cdalanemarkline * pmark = xcdadraw.mutable_mlanemarkline(0);
+            if(pmark == NULL)
+                pcenterlane->AddRoadMarkRecord(0,"solid solid","standard","yellow",0.15,"none");
+            else
+            {
+                pcenterlane->AddRoadMarkRecord(0,cda_lanemarktype_sel[pmark->lanemarktype()],"standard",
+                        cda_lanemarkcolor_sel[pmark->lanemarkcolor()],pmark->lanemarkwidth(),"none");
+                if(pmark->lanemarktype() == 0)
+                {
+                    LaneRoadMark * pLaneRoadMark = pcenterlane->GetLastAddedLaneRoadMark();
+                    LaneRoadMarkType laneRoadMarkType(cda_lanemarktype_sel[pmark->lanemarktype()],pmark->lanemarkwidth());
+                    laneRoadMarkType.AddLaneRoadMarkLine(pmark->lanemarklinelength(),pmark->lanemarklinespace(),0,0);
+                    pLaneRoadMark->SetLaneRoadMarkType(laneRoadMarkType);
+                }
+            }
 
             int j;
             iv::map::cdadraw * pcdadraw = &xcdadraw;
@@ -704,13 +753,32 @@ int CDAProc::ProcCDA(iv::map::cdadraw & xcdadraw,OpenDrive * pxodr)
                 Lane * pnewlane = pLS->GetLastAddedLane();
 
                 pnewlane->AddWidthRecord(0,pcdalane->lanewidth(),0,0,0);
-                pnewlane->AddRoadMarkRecord(0,cda_lanemarktype_sel[pcdalane->lanemarktype()],"standard",cda_lanemarkcolor_sel[pcdalane->lanemarkcolor()],pcdalane->lanemarkwidth(),"none");
+                pmark = xcdadraw.mutable_mlanemarkline(j+1);
+                if(pmark != NULL)
+                {
+                    pnewlane->AddRoadMarkRecord(0,cda_lanemarktype_sel[pmark->lanemarktype()],"standard",
+                            cda_lanemarkcolor_sel[pmark->lanemarkcolor()],pmark->lanemarkwidth(),"none");
+                    if(pmark->lanemarktype() == 0)
+                    {
+                        LaneRoadMark * pLaneRoadMark = pnewlane->GetLastAddedLaneRoadMark();
+                        LaneRoadMarkType laneRoadMarkType(cda_lanemarktype_sel[pmark->lanemarktype()],pmark->lanemarkwidth());
+                        laneRoadMarkType.AddLaneRoadMarkLine(pmark->lanemarklinelength(),pmark->lanemarklinespace(),0,0);
+                        pLaneRoadMark->SetLaneRoadMarkType(laneRoadMarkType);
+                    }
+                }
 
                 pLS->AddLane(1,(j+1)*(1),cda_lanetype_sel[pcdalane->lanetype()],false,true);
                 pnewlane = pLS->GetLastAddedLane();
                 pnewlane->AddWidthRecord(0,pcdalane->lanewidth(),0,0,0);
-                pnewlane->AddRoadMarkRecord(0,cda_lanemarktype_sel[pcdalane->lanemarktype()],"standard",cda_lanemarkcolor_sel[pcdalane->lanemarkcolor()],pcdalane->lanemarkwidth(),"none");
-
+                pnewlane->AddRoadMarkRecord(0,cda_lanemarktype_sel[pmark->lanemarktype()],"standard",
+                        cda_lanemarkcolor_sel[pmark->lanemarkcolor()],pmark->lanemarkwidth(),"none");
+                if(pmark->lanemarktype() == 0)
+                {
+                    LaneRoadMark * pLaneRoadMark = pnewlane->GetLastAddedLaneRoadMark();
+                    LaneRoadMarkType laneRoadMarkType(cda_lanemarktype_sel[pmark->lanemarktype()],pmark->lanemarkwidth());
+                    laneRoadMarkType.AddLaneRoadMarkLine(pmark->lanemarklinelength(),pmark->lanemarklinespace(),0,0);
+                    pLaneRoadMark->SetLaneRoadMarkType(laneRoadMarkType);
+                }
             }
         }
         if(pgeo->geotype() == 1)
@@ -729,7 +797,21 @@ int CDAProc::ProcCDA(iv::map::cdadraw & xcdadraw,OpenDrive * pxodr)
             LaneSection * pLS = pRoad->GetLaneSection(0);
             pLS->AddLane(0,0,"none",false);
             Lane * pcenterlane = pLS->GetLastAddedLane();
-            pcenterlane->AddRoadMarkRecord(0,"solid solid","standard","yellow",0.15,"none");
+            iv::map::cdalanemarkline * pmark = xcdadraw.mutable_mlanemarkline(0);
+            if(pmark == NULL)
+                pcenterlane->AddRoadMarkRecord(0,"solid solid","standard","yellow",0.15,"none");
+            else
+            {
+                pcenterlane->AddRoadMarkRecord(0,cda_lanemarktype_sel[pmark->lanemarktype()],"standard",
+                        cda_lanemarkcolor_sel[pmark->lanemarkcolor()],pmark->lanemarkwidth(),"none");
+                if(pmark->lanemarktype() == 0)
+                {
+                    LaneRoadMark * pLaneRoadMark = pcenterlane->GetLastAddedLaneRoadMark();
+                    LaneRoadMarkType laneRoadMarkType(cda_lanemarktype_sel[pmark->lanemarktype()],pmark->lanemarkwidth());
+                    laneRoadMarkType.AddLaneRoadMarkLine(pmark->lanemarklinelength(),pmark->lanemarklinespace(),0,0);
+                    pLaneRoadMark->SetLaneRoadMarkType(laneRoadMarkType);
+                }
+            }
 
             int j;
             iv::map::cdadraw * pcdadraw = &xcdadraw;
@@ -741,13 +823,35 @@ int CDAProc::ProcCDA(iv::map::cdadraw & xcdadraw,OpenDrive * pxodr)
                 Lane * pnewlane = pLS->GetLastAddedLane();
 
                 pnewlane->AddWidthRecord(0,pcdalane->lanewidth(),0,0,0);
-                pnewlane->AddRoadMarkRecord(0,cda_lanemarktype_sel[pcdalane->lanemarktype()],"standard",cda_lanemarkcolor_sel[pcdalane->lanemarkcolor()],pcdalane->lanemarkwidth(),"none");
-
+                pmark = xcdadraw.mutable_mlanemarkline(j+1);
+                if(pmark != NULL)
+                {
+                    pnewlane->AddRoadMarkRecord(0,cda_lanemarktype_sel[pmark->lanemarktype()],"standard",
+                            cda_lanemarkcolor_sel[pmark->lanemarkcolor()],pmark->lanemarkwidth(),"none");
+                    if(pmark->lanemarktype() == 0)
+                    {
+                        LaneRoadMark * pLaneRoadMark = pnewlane->GetLastAddedLaneRoadMark();
+                        LaneRoadMarkType laneRoadMarkType(cda_lanemarktype_sel[pmark->lanemarktype()],pmark->lanemarkwidth());
+                        laneRoadMarkType.AddLaneRoadMarkLine(pmark->lanemarklinelength(),pmark->lanemarklinespace(),0,0);
+                        pLaneRoadMark->SetLaneRoadMarkType(laneRoadMarkType);
+                    }
+                }
                 pLS->AddLane(1,(j+1)*(1),cda_lanetype_sel[pcdalane->lanetype()],false,true);
                 pnewlane = pLS->GetLastAddedLane();
                 pnewlane->AddWidthRecord(0,pcdalane->lanewidth(),0,0,0);
-                pnewlane->AddRoadMarkRecord(0,cda_lanemarktype_sel[pcdalane->lanemarktype()],"standard",cda_lanemarkcolor_sel[pcdalane->lanemarkcolor()],pcdalane->lanemarkwidth(),"none");
-
+                pmark = xcdadraw.mutable_mlanemarkline(j+1);
+                if(pmark != NULL)
+                {
+                    pnewlane->AddRoadMarkRecord(0,cda_lanemarktype_sel[pmark->lanemarktype()],"standard",
+                            cda_lanemarkcolor_sel[pmark->lanemarkcolor()],pmark->lanemarkwidth(),"none");
+                    if(pmark->lanemarktype() == 0)
+                    {
+                        LaneRoadMark * pLaneRoadMark = pnewlane->GetLastAddedLaneRoadMark();
+                        LaneRoadMarkType laneRoadMarkType(cda_lanemarktype_sel[pmark->lanemarktype()],pmark->lanemarkwidth());
+                        laneRoadMarkType.AddLaneRoadMarkLine(pmark->lanemarklinelength(),pmark->lanemarklinespace(),0,0);
+                        pLaneRoadMark->SetLaneRoadMarkType(laneRoadMarkType);
+                    }
+                }
             }
         }
         if(pgeo->geotype() == 2)