Browse Source

change tool/map_lanetoxodr. if straight contact, add a option for select line.

yuchuli 3 years ago
parent
commit
8f4d679e8c
2 changed files with 17 additions and 2 deletions
  1. 15 2
      src/tool/map_lanetoxodr/mainwindow.cpp
  2. 2 0
      src/tool/map_lanetoxodr/mainwindow.h

+ 15 - 2
src/tool/map_lanetoxodr/mainwindow.cpp

@@ -1105,6 +1105,12 @@ void MainWindow::CreateTab1View(QTabWidget * p)
     pLE->setGeometry(nXPos,nYPos,nLEWidth,nLEHeight);
     mpLERoadType = pLE;
 
+    mpCBStraightType = new QCheckBox(pGroup);
+    mpCBStraightType->setText("Line Only");
+    mpCBStraightType->setChecked(false);
+    mpCBStraightType->setGeometry(nXPos,nYPos,nLEWidth,nLEHeight);
+    mpCBStraightType->setVisible(false);
+
     mpCBRoadType->setCurrentIndex(0);
     mpLBRoadType->setVisible(true);
     mpLERoadType->setVisible(true);
@@ -3474,7 +3480,7 @@ void MainWindow::onClickCreateRoad()
     case 1:
         {
             double fdis = sqrt(pow(startx - endx,2) +pow(starty -endy,2));
-            if((fdis<10) || (starthdg == endhdg))
+            if((fdis<10) || (starthdg == endhdg) ||(mpCBStraightType->isChecked()))
             {
                 xvectorgeo = CreateLineGeo(startx,starty,starthdg,endx,endy,endhdg);
             }
@@ -3961,13 +3967,15 @@ void MainWindow::onChangeRoadType(int index)
 {
     if(index == 1)
     {
-       mpLBRoadType->setVisible(false);
+       mpLBRoadType->setVisible(true);
        mpLERoadType->setVisible(false);
+       mpCBStraightType->setVisible(true);
     }
     else
     {
         mpLBRoadType->setVisible(true);
         mpLERoadType->setVisible(true);
+        mpCBStraightType->setVisible(false);
     }
 
     if(index == 0)
@@ -3976,6 +3984,11 @@ void MainWindow::onChangeRoadType(int index)
         mpLERoadType->setText("6.0");
     }
 
+    if(index == 1)
+    {
+        mpLBRoadType->setText("Type:");
+    }
+
     if(index == 2)
     {
         mpLBRoadType->setText("Extend:");

+ 2 - 0
src/tool/map_lanetoxodr/mainwindow.h

@@ -291,6 +291,8 @@ private:
 
     QLabel * mpLBRoadType;
 
+    QCheckBox * mpCBStraightType;
+
     double mx0,my0;
 
     OpenDrive mxodr;