|
@@ -597,14 +597,11 @@ void CollectConvert::convertconnect(iv::map::roadconnect *pconnect, OpenDrive *p
|
|
|
for(i=0;i<xvectorgeo2.size();i++)xroadlen2 = xroadlen2 + xvectorgeo2[i].mfLen;
|
|
|
|
|
|
int index1 = pxodr->AddRoad("",xroadlen1, QString::number(groadid).toStdString(),"-1");groadid++;
|
|
|
- int index2 = mxodr.AddRoad("",xroadlen2, QString::number(groadid).toStdString(),"-1");groadid++;
|
|
|
- Road * proad2 = mxodr.GetRoad(index2);
|
|
|
- Road * proad1 = mxodr.GetRoad(index1);
|
|
|
+ int index2 = pxodr->AddRoad("",xroadlen2, QString::number(groadid).toStdString(),"-1");groadid++;
|
|
|
+ Road * proad2 = pxodr->GetRoad(index2);
|
|
|
+ Road * proad1 = pxodr->GetRoad(index1);
|
|
|
|
|
|
|
|
|
- p1 = mxodr.GetRoad(nroad1index);
|
|
|
- p2 = mxodr.GetRoad(nroad2index);
|
|
|
-
|
|
|
// OpenDrive * px = &mxodr;
|
|
|
double s = 0;
|
|
|
int j;
|
|
@@ -680,104 +677,6 @@ void CollectConvert::convertconnect(iv::map::roadconnect *pconnect, OpenDrive *p
|
|
|
pLS2->SetS(0);
|
|
|
pLS2->AddLane(0,0,"none",false);
|
|
|
|
|
|
- double * pswidth,*pewidth;
|
|
|
- int nlanecount = mvectorrc[0].mvectorlc.size();
|
|
|
- std::vector<std::string> strvectorlanetype;
|
|
|
- pswidth = new double[nlanecount];
|
|
|
- pewidth = new double[nlanecount];
|
|
|
- std::shared_ptr<double> ppswidth,ppewidth;
|
|
|
- ppswidth.reset(pswidth);
|
|
|
- ppewidth.reset(pewidth);
|
|
|
-
|
|
|
- for(i=0;i<nlanecount;i++)
|
|
|
- {
|
|
|
- pswidth[i] = getlanewidth(p1,mvectorrc[0].mvectorlc.at(i).ml1,bFromstart);
|
|
|
- strvectorlanetype.push_back(getlanetype(p1,mvectorrc[0].mvectorlc.at(i).ml1,bFromstart));
|
|
|
-
|
|
|
- }
|
|
|
- for(i=0;i<nlanecount;i++)
|
|
|
- {
|
|
|
- pewidth[i] = getlanewidth(p2,mvectorrc[0].mvectorlc.at(i).ml2,bTostart);
|
|
|
- }
|
|
|
-
|
|
|
- double * pa,*pb;
|
|
|
- pa = new double[nlanecount];
|
|
|
- pb = new double[nlanecount];
|
|
|
- std::shared_ptr<double> ppa,ppb;
|
|
|
- ppa.reset(pa);
|
|
|
- ppb.reset(pb);
|
|
|
-
|
|
|
- for(i=0;i<nlanecount;i++)
|
|
|
- {
|
|
|
- pa[i] = pswidth[i];
|
|
|
- pb[i] = (pewidth[i] - pa[i])/(xroadlen1+xroadlen2);
|
|
|
- }
|
|
|
-
|
|
|
- for(i=0;i<nlanecount;i++)
|
|
|
- {
|
|
|
- pLS1->AddLane(-1,(i+1)*(-1),strvectorlanetype[i],false,false);
|
|
|
- Lane * pLL = pLS1->GetLane(pLS1->GetLaneCount() - 1);
|
|
|
-
|
|
|
- pLL->AddWidthRecord(0,pa[i],pb[i],
|
|
|
- 0,0);
|
|
|
-// pLL->AddRoadMarkRecord(0,"solid","standard","standard",0.15,"false");
|
|
|
-
|
|
|
- pLS2->AddLane(-1,(i+1)*(-1),strvectorlanetype[i],false,false);
|
|
|
- pLL = pLS2->GetLane(pLS2->GetLaneCount() - 1);
|
|
|
-
|
|
|
- pLL->AddWidthRecord(0,pa[i]+pb[i]*xroadlen1 ,pb[i],
|
|
|
- 0,0);
|
|
|
-// pLL->AddRoadMarkRecord(0,"solid","standard","standard",0.15,"false");
|
|
|
-
|
|
|
- }
|
|
|
- int noplanecount = mvectorrc[0].mvectorlcop.size();
|
|
|
- if(noplanecount > 0)
|
|
|
- {
|
|
|
- pswidth = new double[noplanecount];
|
|
|
- pewidth = new double[noplanecount];
|
|
|
- ppswidth.reset(pswidth);
|
|
|
- ppewidth.reset(pewidth);
|
|
|
-
|
|
|
- strvectorlanetype.clear();
|
|
|
- for(i=0;i<noplanecount;i++)
|
|
|
- {
|
|
|
- pswidth[i] = getlanewidth(p1,mvectorrc[0].mvectorlcop.at(i).ml1,bFromstart);
|
|
|
- strvectorlanetype.push_back(getlanetype(p1,mvectorrc[0].mvectorlcop.at(i).ml1,bFromstart));
|
|
|
- }
|
|
|
- for(i=0;i<noplanecount;i++)
|
|
|
- {
|
|
|
- pewidth[i] = getlanewidth(p2,mvectorrc[0].mvectorlcop.at(i).ml2,bTostart);
|
|
|
- }
|
|
|
-
|
|
|
- pa = new double[noplanecount];
|
|
|
- pb = new double[noplanecount];
|
|
|
- ppa.reset(pa);
|
|
|
- ppb.reset(pb);
|
|
|
-
|
|
|
- for(i=0;i<noplanecount;i++)
|
|
|
- {
|
|
|
- pa[i] = pswidth[i];
|
|
|
- pb[i] = (pewidth[i] - pa[i])/xroadlen;
|
|
|
- }
|
|
|
-
|
|
|
- for(i=0;i<noplanecount;i++)
|
|
|
- {
|
|
|
- pLS1->AddLane(1,(i+1),strvectorlanetype[i],false,false);
|
|
|
- Lane * pLL = pLS1->GetLane(pLS1->GetLaneCount() - 1);
|
|
|
-
|
|
|
- pLL->AddWidthRecord(0,pa[i],pb[i],
|
|
|
- 0,0);
|
|
|
- // pLL->AddRoadMarkRecord(0,"solid","standard","standard",0.15,"false");
|
|
|
-
|
|
|
- pLS2->AddLane(1,(i+1),strvectorlanetype[i],false,false);
|
|
|
- pLL = pLS2->GetLane(pLS2->GetLaneCount() - 1);
|
|
|
-
|
|
|
- pLL->AddWidthRecord(0,pa[i]+pb[i]*xroadlen1 ,pb[i],
|
|
|
- 0,0);
|
|
|
-// pLL->AddRoadMarkRecord(0,"solid","standard","standard",0.15,"false");
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
|
|
|
}
|