|
@@ -2,9 +2,13 @@
|
|
|
|
|
|
#include <QFile>
|
|
|
#include "gnss_coordinate_convert.h"
|
|
|
+#include <QDateTime>
|
|
|
|
|
|
#include "geofit.h"
|
|
|
#include "circlefitting.h"
|
|
|
+#include "mainwindow.h"
|
|
|
+
|
|
|
+extern MainWindow * gw;
|
|
|
|
|
|
NDSDataProc::NDSDataProc()
|
|
|
{
|
|
@@ -16,19 +20,25 @@ NDSDataProc::NDSDataProc()
|
|
|
//-2 can't open vehicle data file
|
|
|
//-3 no valid line data.
|
|
|
//-4 no valid vehicle data.
|
|
|
-int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath)
|
|
|
+int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath,OpenDrive * mpxodr)
|
|
|
{
|
|
|
+ mnProc = 0;
|
|
|
+ mstrState = "Loading Data.";
|
|
|
QFile xFileline;
|
|
|
QFile xFilevehicle;
|
|
|
xFileline.setFileName(strlinepath.data());
|
|
|
xFilevehicle.setFileName(strvehiclepath.data());
|
|
|
if(!xFileline.open(QIODevice::ReadOnly))
|
|
|
{
|
|
|
+ mnProc = 100;
|
|
|
+ mstrState = " Can't Read Line File. ";
|
|
|
return -1;
|
|
|
}
|
|
|
if(!xFilevehicle.open(QIODevice::ReadOnly))
|
|
|
{
|
|
|
xFileline.close();
|
|
|
+ mnProc = 100;
|
|
|
+ mstrState = " Can't Read Vehicle File. ";
|
|
|
return -2;
|
|
|
}
|
|
|
|
|
@@ -70,6 +80,8 @@ int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath)
|
|
|
{
|
|
|
xFileline.close();
|
|
|
xFilevehicle.close();
|
|
|
+ mnProc = 100;
|
|
|
+ mstrState = " No Line Data. ";
|
|
|
return -3;
|
|
|
}
|
|
|
|
|
@@ -109,15 +121,20 @@ int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath)
|
|
|
|
|
|
if(xvectorvehicle.size()<2)
|
|
|
{
|
|
|
+ mnProc = 100;
|
|
|
+ mstrState = " No Vehicle Data. ";
|
|
|
return -4 ;
|
|
|
}
|
|
|
|
|
|
|
|
|
double flon0,flat0;
|
|
|
|
|
|
- flon0 = xvectorvehicle[0].lon;
|
|
|
- flat0 = xvectorvehicle[0].lat;
|
|
|
-
|
|
|
+ if(mpxodr->GetRoadCount() == 0)
|
|
|
+ {
|
|
|
+ flon0 = xvectorvehicle[0].lon;
|
|
|
+ flat0 = xvectorvehicle[0].lat;
|
|
|
+ mpxodr->SetHeader(1,1,"adcmap",1.1,QDateTime::currentDateTime().toString("yyyy-MM-dd").toLatin1().data(),0,0,0,0,flat0,flon0,360);
|
|
|
+ }
|
|
|
double x0,y0;
|
|
|
GaussProjCal(flon0,flat0,&x0,&y0);
|
|
|
|
|
@@ -125,6 +142,8 @@ int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath)
|
|
|
int nlinecount = xvectorline.size();
|
|
|
int nvehiclecount = xvectorvehicle.size();
|
|
|
|
|
|
+ mnProc = 10;
|
|
|
+ mstrState = " Calulation x y. ";
|
|
|
for(i=0;i<nvehiclecount;i++)
|
|
|
{
|
|
|
iv::nds_vehicle * p;
|
|
@@ -148,6 +167,8 @@ int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath)
|
|
|
|
|
|
int nlinenow = 0;
|
|
|
|
|
|
+ mnProc = 20;
|
|
|
+ mstrState = " Get Vehicle And Line Relation. ";
|
|
|
for(i=0;i<nvehiclecount;i++)
|
|
|
{
|
|
|
if(nlinenow >= nlinecount)
|
|
@@ -206,6 +227,7 @@ int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath)
|
|
|
double fdismin = 100000;
|
|
|
double fdismax = 0;
|
|
|
|
|
|
+
|
|
|
int nvlsize = xvectorvl.size();
|
|
|
fS = 0;
|
|
|
for(i=1;i<nvlsize;i++)
|
|
@@ -213,6 +235,7 @@ int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath)
|
|
|
iv::nds_vehicle v1 = xvectorvehicle[xvectorvl[i-1].mvehindex];
|
|
|
iv::nds_vehicle v2 = xvectorvehicle[xvectorvl[i].mvehindex];
|
|
|
double fdis = sqrt(pow(v1.frel_x - v2.frel_x,2) + pow(v1.frel_y - v2.frel_y,2));
|
|
|
+ xvectorvehicle[xvectorvl[i].mvehindex].fdistolast = fdis;
|
|
|
fS = fS + fdis;
|
|
|
if(fdis<fdismin)fdismin = fdis;
|
|
|
if(fdis>fdismax)fdismax = fdis;
|
|
@@ -227,6 +250,7 @@ int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath)
|
|
|
if(fhdg<0)fhdg = fhdg + 2.0*M_PI;
|
|
|
pv1->fhdg = fhdg;
|
|
|
iv::nds_line * pline1 = &xvectorline[xvectorvl[i].mvectorlineindex[0]];
|
|
|
+ pv1->flanewidth = pline1->lanewidth;
|
|
|
iv::nds_line * pline2 = NULL;
|
|
|
if(xvectorvl[i].mvectorlineindex.size()>=2)
|
|
|
{
|
|
@@ -256,6 +280,8 @@ int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath)
|
|
|
}
|
|
|
|
|
|
|
|
|
+ mnProc = 30;
|
|
|
+ mstrState = " Fitting Geo. ";
|
|
|
|
|
|
std::cout<<" fdis "<<fS<<" min "<<fdismin<<" max "<<fdismax<<std::endl;
|
|
|
|
|
@@ -324,7 +350,7 @@ int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath)
|
|
|
|
|
|
if((nrange <= 2)||bLineOk||bArcOk)
|
|
|
{
|
|
|
- if(bLineOk)
|
|
|
+ if((bLineOk)||(nrange<=2))
|
|
|
{
|
|
|
std::cout<<"use line"<<std::endl;
|
|
|
geobase xgeo;
|
|
@@ -345,24 +371,12 @@ int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath)
|
|
|
xgeo.mfLen = sqrt(pow(x1-x0,2)+pow(y1-y0,2));
|
|
|
xgeo.mnType = 0;
|
|
|
fStartX = x0;
|
|
|
- fStartX = y0;
|
|
|
+ fStartY = y0;
|
|
|
fStartHdg = xgeo.mfHdg;
|
|
|
fEndX = x1;
|
|
|
fEndY = y1;
|
|
|
- fEndHdg = fStartHdg;
|
|
|
-// if(bFirst)
|
|
|
-// {
|
|
|
-// xgeo.mfX = x_veh[0];
|
|
|
-// xgeo.mfY = y_veh[0];
|
|
|
-// bFirst = false;
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// xgeo.mfX = fXLast;
|
|
|
-// xgeo.mfY = fYLast;
|
|
|
-// }
|
|
|
-// fXLast = xgeo.mfX + xgeo.mfLen * cos(xgeo.mfHdg);
|
|
|
-// fYLast = xgeo.mfY + xgeo.mfLen * sin(xgeo.mfHdg);
|
|
|
+ fEndHdg = xgeo.mfHdg;
|
|
|
+
|
|
|
xvectorgeo.push_back(xgeo);
|
|
|
}
|
|
|
else
|
|
@@ -389,23 +403,6 @@ int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath)
|
|
|
fEndX = xgeo.mfEndX;
|
|
|
fEndY = xgeo.mfEndY;
|
|
|
fEndHdg = xgeo.mfHdgEnd;
|
|
|
-// if(bFirst)
|
|
|
-// {
|
|
|
-// xgeo.mfX = x_veh[0];
|
|
|
-// xgeo.mfY = y_veh[0];
|
|
|
-// xgeo.mfEndX = ep.x() + (x_veh[0] - sp.x());
|
|
|
-// xgeo.mfEndY = ep.y() + (y_veh[0] - sp.y());
|
|
|
-// bFirst = false;
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// xgeo.mfX = fXLast;
|
|
|
-// xgeo.mfY = fYLast;
|
|
|
-// xgeo.mfEndX = ep.x() + (fXLast - sp.x());
|
|
|
-// xgeo.mfEndY = ep.y() + (fYLast - sp.y());
|
|
|
-// }
|
|
|
-// fXLast = xgeo.mfEndX;
|
|
|
-// fYLast = xgeo.mfEndY;
|
|
|
xvectorgeo.push_back(xgeo);
|
|
|
}
|
|
|
}
|
|
@@ -417,6 +414,8 @@ int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath)
|
|
|
fLastHdg,fStartX,fStartY,fStartHdg);
|
|
|
if(xvectorgeobe.size()>0)
|
|
|
{
|
|
|
+ xvectorgeobe[0].mnStartPoint = ncurpos-1;
|
|
|
+ xvectorgeobe[0].mnEndPoint = ncurpos;
|
|
|
xvectorgeo.insert(xvectorgeo.begin()+(xvectorgeo.size()-1),xvectorgeobe[0]);
|
|
|
}
|
|
|
}
|
|
@@ -439,14 +438,298 @@ int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath)
|
|
|
nrange = nrange -1;
|
|
|
if(nrange<2)nrange = 2;
|
|
|
}
|
|
|
- if(ncurpos>=(xvectorvl.size()-1))bComplete = true;
|
|
|
+ if(ncurpos>=(int)(xvectorvl.size()-1))
|
|
|
+ {
|
|
|
+ if(ncurpos == (int)(xvectorvl.size()-1))
|
|
|
+ {
|
|
|
+ std::cout<<"Last section, 2 Points, use line."<<std::endl;
|
|
|
+ VectorXd x_veh1(2);
|
|
|
+ VectorXd y_veh1(2);
|
|
|
+ x_veh1[0] = fLastX;
|
|
|
+ y_veh1[0] = fLastY;
|
|
|
+ x_veh1[1] = xvectorvehicle[xvectorvl[ncurpos].mvehindex].fx;
|
|
|
+ y_veh1[1] = xvectorvehicle[xvectorvl[ncurpos].mvehindex].fy;
|
|
|
+ auto coeffs = polyfit(x_veh1, y_veh1, 1);
|
|
|
+
|
|
|
+ geobase xgeo;
|
|
|
+ xgeo.mnStartPoint = ncurpos-1;
|
|
|
+ xgeo.mnEndPoint = ncurpos;
|
|
|
+
|
|
|
+ xgeo.mfA = coeffs[1];
|
|
|
+ xgeo.mfB = -1;
|
|
|
+ xgeo.mfC = coeffs[0];
|
|
|
+ xgeo.mfHdg = geofit::Inst().CalcHdg(x_veh1[0],y_veh1[0],x_veh1[1],y_veh1[1]);
|
|
|
+ xgeo.mfX = x_veh1[0];
|
|
|
+ xgeo.mfY = y_veh1[0];
|
|
|
+ xgeo.mfLen = sqrt(pow(x_veh1[1]-x_veh1[0],2)+pow(y_veh1[1]-y_veh1[0],2));
|
|
|
+ xgeo.mnType = 0;
|
|
|
+ xvectorgeo.push_back(xgeo);
|
|
|
+ }
|
|
|
+ bComplete = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ double snow = 0;
|
|
|
+ for(i=0;i<(int)xvectorgeo.size();i++)
|
|
|
+ {
|
|
|
+ geobase * pgeo = &xvectorgeo[i];
|
|
|
+// std::cout<<"geo len: "<<pgeo->mfLen<<" type"<<pgeo->mnType<<std::endl;
|
|
|
+ double tems = 0;
|
|
|
+ for(j=(pgeo->mnStartPoint+1);j<=pgeo->mnEndPoint;j++)
|
|
|
+ {
|
|
|
+ xvectorvehicle[xvectorvl[j].mvehindex].s = snow + tems + xvectorvehicle[xvectorvl[j].mvehindex].fdistolast;
|
|
|
+ tems = tems + xvectorvehicle[xvectorvl[j].mvehindex].fdistolast;
|
|
|
+ }
|
|
|
+ snow = snow + pgeo->mfLen;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ mnProc = 90;
|
|
|
+ mstrState = " Fitting Width and Height. ";
|
|
|
+ //Width
|
|
|
+ std::vector<iv::widthabcd> xvectorwidthabcd;
|
|
|
+ bComplete = false;
|
|
|
+ ncurpos = 0;
|
|
|
+ nrange = xvectorvl.size();
|
|
|
+ double flanewidtherror = 0.1; //1cm
|
|
|
+ while(bComplete == false)
|
|
|
+ {
|
|
|
+ double ele_coff[4];
|
|
|
+ for(j=0;j<4;j++)ele_coff[j] = 0;
|
|
|
+ if(nrange>0)ele_coff[0] = xvectorvehicle[xvectorvl[ncurpos].mvehindex].flanewidth;
|
|
|
+ int M = nrange;
|
|
|
+ VectorXd x_vehhg(M);
|
|
|
+ VectorXd y_vehhg(M);
|
|
|
+ for(j=0;j<M;j++)
|
|
|
+ {
|
|
|
+ x_vehhg[j] = xvectorvehicle[xvectorvl[ncurpos+j].mvehindex].s - xvectorvehicle[xvectorvl[ncurpos].mvehindex].s;
|
|
|
+ y_vehhg[j] =xvectorvehicle[xvectorvl[ncurpos+j].mvehindex].flanewidth;
|
|
|
+ }
|
|
|
+ int MX = 3;
|
|
|
+ if(M<4)MX = M -1;
|
|
|
+ if(MX>3)MX = 3;
|
|
|
+ if(MX>0)
|
|
|
+ {
|
|
|
+ VectorXd coeffs = polyfit(x_vehhg, y_vehhg, MX);
|
|
|
+ for(j=0;j<=MX;j++)
|
|
|
+ {
|
|
|
+ ele_coff[j] = coeffs[j];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ double ferror = 0;
|
|
|
+ for(j=0;j<M;j++)
|
|
|
+ {
|
|
|
+ double s = x_vehhg[j];
|
|
|
+ double fvalue = fabs(ele_coff[0] + ele_coff[1]*s + ele_coff[2]*s*s+ele_coff[3]*s*s*s - y_vehhg[j]);
|
|
|
+ if(fvalue>ferror)ferror = fvalue;
|
|
|
+ }
|
|
|
+ if(ferror>flanewidtherror)
|
|
|
+ {
|
|
|
+ if(nrange>10)nrange = nrange/2;
|
|
|
+ else nrange = nrange -1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ iv::widthabcd xabcd;
|
|
|
+ xabcd.s = xvectorvehicle[xvectorvl[ncurpos].mvehindex].s;
|
|
|
+ xabcd.A = ele_coff[0];
|
|
|
+ xabcd.B = ele_coff[1];
|
|
|
+ xabcd.C = ele_coff[2];
|
|
|
+ xabcd.D = ele_coff[3];
|
|
|
+ xvectorwidthabcd.push_back(xabcd);
|
|
|
+ ncurpos = ncurpos + nrange-1;
|
|
|
+ nrange = xvectorvl.size() - ncurpos;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ncurpos>=(int)(xvectorvl.size()-1))
|
|
|
+ {
|
|
|
+ bComplete = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ std::vector<iv::eleabcd> xvectoreleabcd;
|
|
|
+ bComplete = false;
|
|
|
+ ncurpos = 0;
|
|
|
+ nrange = xvectorvl.size();
|
|
|
+ double feleerror = 0.5; //1cm
|
|
|
+ while(bComplete == false)
|
|
|
+ {
|
|
|
+ double ele_coff[4];
|
|
|
+ for(j=0;j<4;j++)ele_coff[j] = 0;
|
|
|
+ if(nrange>0)ele_coff[0] = xvectorvehicle[xvectorvl[ncurpos].mvehindex].height;
|
|
|
+ int M = nrange;
|
|
|
+ VectorXd x_vehhg(M);
|
|
|
+ VectorXd y_vehhg(M);
|
|
|
+ for(j=0;j<M;j++)
|
|
|
+ {
|
|
|
+ x_vehhg[j] = xvectorvehicle[xvectorvl[ncurpos+j].mvehindex].s - xvectorvehicle[xvectorvl[ncurpos].mvehindex].s;
|
|
|
+ y_vehhg[j] =xvectorvehicle[xvectorvl[ncurpos+j].mvehindex].height;
|
|
|
+ }
|
|
|
+ int MX = 3;
|
|
|
+ if(M<4)MX = M -1;
|
|
|
+ if(MX>3)MX = 3;
|
|
|
+ if(MX>0)
|
|
|
+ {
|
|
|
+ VectorXd coeffs = polyfit(x_vehhg, y_vehhg, MX);
|
|
|
+ for(j=0;j<=MX;j++)
|
|
|
+ {
|
|
|
+ ele_coff[j] = coeffs[j];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ double ferror = 0;
|
|
|
+ for(j=0;j<M;j++)
|
|
|
+ {
|
|
|
+ double s = x_vehhg[j];
|
|
|
+ double fvalue = fabs(ele_coff[0] + ele_coff[1]*s + ele_coff[2]*s*s+ele_coff[3]*s*s*s - y_vehhg[j]);
|
|
|
+ if(fvalue>feleerror)ferror = fvalue;
|
|
|
+ }
|
|
|
+ if(ferror>flanewidtherror)
|
|
|
+ {
|
|
|
+ if(nrange>10)nrange = nrange/2;
|
|
|
+ else nrange = nrange -1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ iv::eleabcd xabcd;
|
|
|
+ xabcd.s = xvectorvehicle[xvectorvl[ncurpos].mvehindex].s;
|
|
|
+ xabcd.A = ele_coff[0];
|
|
|
+ xabcd.B = ele_coff[1];
|
|
|
+ xabcd.C = ele_coff[2];
|
|
|
+ xabcd.D = ele_coff[3];
|
|
|
+ xvectoreleabcd.push_back(xabcd);
|
|
|
+ ncurpos = ncurpos + nrange-1;
|
|
|
+ nrange = xvectorvl.size() - ncurpos;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ncurpos>=(int)(xvectorvl.size()-1))
|
|
|
+ {
|
|
|
+ bComplete = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ std::cout<<" last s: "<<xvectorvehicle[xvectorvl[nvlsize-1].mvehindex].s<<std::endl;
|
|
|
+
|
|
|
std::cout<<" geo size "<<xvectorgeo.size()<<std::endl;
|
|
|
|
|
|
|
|
|
std::cout<<"complete "<<std::endl;
|
|
|
|
|
|
+ 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;
|
|
|
+ j= 0;
|
|
|
+// for(j=0;j<4;j++)
|
|
|
+ for(j=0;j<xvectorgeo.size();j++)
|
|
|
+ {
|
|
|
+
|
|
|
+ p->AddGeometryBlock();
|
|
|
+ GeometryBlock * pgb = p->GetGeometryBlock(j);
|
|
|
+
|
|
|
+ geobase * pline;
|
|
|
+ geobase * pbez;
|
|
|
+ geobase * parc;
|
|
|
+
|
|
|
+ switch(xvectorgeo[j].mnType)
|
|
|
+ {
|
|
|
+ case 0:
|
|
|
+ pline = &xvectorgeo[j];
|
|
|
+ pgb->AddGeometryLine(s,pline->mfX,pline->mfY,pline->mfHdg,pline->mfLen);
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ parc = &xvectorgeo[j];
|
|
|
+ pgb->AddGeometryArc(s,parc->mfX,parc->mfY,parc->mfHdgStart,parc->mfLen,1.0/parc->mR);
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ pbez = &xvectorgeo[j];
|
|
|
+ std::cout<<"u0:"<<pbez->mfu[0]<<std::endl;
|
|
|
+ pgb->AddGeometryParamPoly3(s,pbez->mfX,pbez->mfY,
|
|
|
+ pbez->mfHdg,pbez->mfLen,pbez->mfu[0],
|
|
|
+ pbez->mfu[1],pbez->mfu[2],pbez->mfu[3],pbez->mfv[0],
|
|
|
+ pbez->mfv[1],pbez->mfv[2],pbez->mfv[3]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ s = s + xvectorgeo[j].mfLen;
|
|
|
+ }
|
|
|
+
|
|
|
+ p->AddLaneSection(0);
|
|
|
|
|
|
+ LaneSection * pLS = p->GetLaneSection(0);
|
|
|
+
|
|
|
+ pLS->AddLane(0,0,"none",false);
|
|
|
+ pLS->AddLane(-1,(-1)*(pLS->GetRightLaneCount()+1),"driving",false);
|
|
|
+ Lane * pLane = pLS->GetLastRightLane();
|
|
|
+ for(j=0;j<(int)xvectorwidthabcd.size();j++)
|
|
|
+ {
|
|
|
+ iv::widthabcd * pwa = &xvectorwidthabcd[j];
|
|
|
+ pLane->AddWidthRecord(pwa->s,pwa->A,pwa->B,pwa->C,pwa->D);
|
|
|
+ }
|
|
|
+
|
|
|
+ for(j=0;j<(int)xvectoreleabcd.size();j++)
|
|
|
+ {
|
|
|
+ iv::eleabcd * pwa = &xvectoreleabcd[j];
|
|
|
+ p->AddElevation(pwa->s,pwa->A,pwa->B,pwa->C,pwa->D);
|
|
|
+ }
|
|
|
+
|
|
|
+ int noldtype = 0;
|
|
|
+ int ntype = 0;
|
|
|
+ Lane * pCenterLane = pLS->GetLastCenterLane();
|
|
|
+ if(nvlsize > 0)
|
|
|
+ {
|
|
|
+ ntype = xvectorvehicle[xvectorvl[0].mvehindex].nleftlanetype;
|
|
|
+ pCenterLane->AddRoadMarkRecord(xvectorvehicle[xvectorvl[0].mvehindex].s,roadmarktypetostr(ntype),"standard","white",0.15,"none");
|
|
|
+ noldtype = ntype;
|
|
|
+ }
|
|
|
+ for(i=1;i<(int)(nvlsize-1);i++)
|
|
|
+ {
|
|
|
+ int ntype = xvectorvehicle[xvectorvl[i].mvehindex].nleftlanetype;
|
|
|
+ if(ntype!= noldtype )
|
|
|
+ {
|
|
|
+ pCenterLane->AddRoadMarkRecord(xvectorvehicle[xvectorvl[i].mvehindex].s,roadmarktypetostr(ntype),"standard","white",0.15,"none");
|
|
|
+ noldtype = ntype;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ noldtype = 0;
|
|
|
+ ntype = 0;
|
|
|
+ if(nvlsize > 0)
|
|
|
+ {
|
|
|
+ ntype = xvectorvehicle[xvectorvl[0].mvehindex].nrightlanetype;
|
|
|
+ pLane->AddRoadMarkRecord(xvectorvehicle[xvectorvl[0].mvehindex].s,roadmarktypetostr(ntype),"standard","white",0.15,"none");
|
|
|
+ noldtype = ntype;
|
|
|
+ }
|
|
|
+ for(i=1;i<(int)(nvlsize-1);i++)
|
|
|
+ {
|
|
|
+ int ntype = xvectorvehicle[xvectorvl[i].mvehindex].nrightlanetype;
|
|
|
+ if(ntype!= noldtype )
|
|
|
+ {
|
|
|
+ pLane->AddRoadMarkRecord(xvectorvehicle[xvectorvl[i].mvehindex].s,roadmarktypetostr(ntype),"standard","white",0.15,"none");
|
|
|
+ noldtype = ntype;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ mnProc = 100;
|
|
|
+ mstrState = " Complete. ";
|
|
|
return 0;
|
|
|
}
|
|
|
+
|
|
|
+std::string NDSDataProc::roadmarktypetostr(int ntype)
|
|
|
+{
|
|
|
+ switch (ntype) {
|
|
|
+ case 1:
|
|
|
+ return "none";
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ return "broken";
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ return "solid";
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ return "none";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+}
|