Explorar o código

change map_lanetoxodr. add nds extend 100.

yuchuli %!s(int64=2) %!d(string=hai) anos
pai
achega
84e91b1ff5
Modificáronse 1 ficheiros con 14 adicións e 0 borrados
  1. 14 0
      src/tool/map_lanetoxodr/function/ndsdataproc.cpp

+ 14 - 0
src/tool/map_lanetoxodr/function/ndsdataproc.cpp

@@ -22,6 +22,7 @@ NDSDataProc::NDSDataProc()
 //-4 no valid vehicle data.
 int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath,OpenDrive * mpxodr,int nleftlanecount,int nrightlanecount)
 {
+    double fExtend = 100;
     mnProc = 0;
     mstrState = "Loading Data.";
     QFile xFileline;
@@ -568,6 +569,8 @@ int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath,
         }
     }
 
+
+
     std::vector<iv::eleabcd> xvectoreleabcd;
     bComplete = false;
     ncurpos = 0;
@@ -638,6 +641,7 @@ int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath,
     mpxodr->AddRoad("",xvectorvehicle[xvectorvl[nvlsize-1].mvehindex].s, QString::number(gw->CreateRoadID()).toStdString(),"-1");
     Road * p = mpxodr->GetRoad(mpxodr->GetRoadCount() - 1);
 
+
   //  p->AddElevation(0,xlaneheightcoff.A,xlaneheightcoff.B,xlaneheightcoff.C,xlaneheightcoff.D);
 
     double s = 0;
@@ -787,6 +791,16 @@ int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath,
         }
     }
 
+    if(fExtend>0.1)
+    {
+        double endx,endy,endhdg;
+        p->GetGeometryCoords(p->GetRoadLength()-0.001,endx,endy,endhdg);
+        p->AddGeometryBlock();
+        GeometryBlock * pgeob = p->GetLastAddedGeometryBlock();
+        pgeob->AddGeometryLine(p->GetRoadLength(),endx,endy,endhdg,fExtend);
+        p->SetRoadLength(p->GetRoadLength()+ fExtend);
+    }
+
 
     mnProc = 100;
     mstrState = " Complete. ";