|
@@ -3118,6 +3118,10 @@ void MainWindow::onClickCreateRoad()
|
|
startx = p1->GetGeometryBlock(0)->GetGeometryAt(0)->GetX();
|
|
startx = p1->GetGeometryBlock(0)->GetGeometryAt(0)->GetX();
|
|
starty = p1->GetGeometryBlock(0)->GetGeometryAt(0)->GetY();
|
|
starty = p1->GetGeometryBlock(0)->GetGeometryAt(0)->GetY();
|
|
|
|
|
|
|
|
+ if(p1->GetLaneOffsetCount()>0)
|
|
|
|
+ {
|
|
|
|
+ off1 = off1 - p1->GetLaneOffset(0)->Geta();
|
|
|
|
+ }
|
|
startx = startx + off1 * cos(starthdg -M_PI/2.0);
|
|
startx = startx + off1 * cos(starthdg -M_PI/2.0);
|
|
starty = starty + off1 * sin(starthdg -M_PI/2.0);
|
|
starty = starty + off1 * sin(starthdg -M_PI/2.0);
|
|
|
|
|
|
@@ -3139,9 +3143,20 @@ void MainWindow::onClickCreateRoad()
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
off1 = getoff(p1,mvectorrc[0].mvectorlc[0].ml1,false);
|
|
off1 = getoff(p1,mvectorrc[0].mvectorlc[0].ml1,false);
|
|
|
|
+ if(p1->GetLaneOffsetCount()>0)
|
|
|
|
+ {
|
|
|
|
+ LaneOffset * pLO = p1->GetLaneOffset(p1->GetLaneOffsetCount()-1);
|
|
|
|
+ double froadlen = p1->GetRoadLength();
|
|
|
|
+ double sdis = froadlen - pLO->GetS();
|
|
|
|
+ double foffset = pLO->Geta() + pLO->Getb()*(sdis) + pLO->Getc() * sdis * sdis
|
|
|
|
+ +pLO->Getd() * sdis * sdis * sdis;
|
|
|
|
+ off1 = off1 - foffset;
|
|
|
|
+ }
|
|
startx = startx + off1 * cos(starthdg -M_PI/2.0);
|
|
startx = startx + off1 * cos(starthdg -M_PI/2.0);
|
|
starty = starty + off1 * sin(starthdg -M_PI/2.0);
|
|
starty = starty + off1 * sin(starthdg -M_PI/2.0);
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
startheight = 0;
|
|
startheight = 0;
|
|
if(p1->GetElevationCount()>0)
|
|
if(p1->GetElevationCount()>0)
|
|
{
|
|
{
|
|
@@ -3160,6 +3175,10 @@ void MainWindow::onClickCreateRoad()
|
|
endy = p2->GetGeometryBlock(0)->GetGeometryAt(0)->GetY();
|
|
endy = p2->GetGeometryBlock(0)->GetGeometryAt(0)->GetY();
|
|
endhdg = p2->GetGeometryBlock(0)->GetGeometryAt(0)->GetHdg();
|
|
endhdg = p2->GetGeometryBlock(0)->GetGeometryAt(0)->GetHdg();
|
|
|
|
|
|
|
|
+ if(p2->GetLaneOffsetCount()>0)
|
|
|
|
+ {
|
|
|
|
+ off2 = off2 - p2->GetLaneOffset(0)->Geta();
|
|
|
|
+ }
|
|
endx = endx + off2 * cos(endhdg -M_PI/2.0);
|
|
endx = endx + off2 * cos(endhdg -M_PI/2.0);
|
|
endy = endy + off2 * sin(endhdg -M_PI/2.0);
|
|
endy = endy + off2 * sin(endhdg -M_PI/2.0);
|
|
|
|
|
|
@@ -3178,6 +3197,15 @@ void MainWindow::onClickCreateRoad()
|
|
QMessageBox::warning(this,"warn","get end error.");
|
|
QMessageBox::warning(this,"warn","get end error.");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ if(p2->GetLaneOffsetCount()>0)
|
|
|
|
+ {
|
|
|
|
+ LaneOffset * pLO = p2->GetLaneOffset(p2->GetLaneOffsetCount()-1);
|
|
|
|
+ double froadlen = p2->GetRoadLength();
|
|
|
|
+ double sdis = froadlen - pLO->GetS();
|
|
|
|
+ double foffset = pLO->Geta() + pLO->Getb()*(sdis) + pLO->Getc() * sdis * sdis
|
|
|
|
+ +pLO->Getd() * sdis * sdis * sdis;
|
|
|
|
+ off2 = off2 - foffset;
|
|
|
|
+ }
|
|
endx = endx + off2 * cos(endhdg -M_PI/2.0);
|
|
endx = endx + off2 * cos(endhdg -M_PI/2.0);
|
|
endy = endy + off2 * sin(endhdg -M_PI/2.0);
|
|
endy = endy + off2 * sin(endhdg -M_PI/2.0);
|
|
endhdg = endhdg +M_PI;if(endhdg >=2.0*M_PI)endhdg = endhdg -2.0*M_PI;
|
|
endhdg = endhdg +M_PI;if(endhdg >=2.0*M_PI)endhdg = endhdg -2.0*M_PI;
|