Browse Source

change tool/map_lanetoxodr.add move rotate and mirror function.

yuchuli 3 years ago
parent
commit
6ba56b2a57

+ 146 - 0
src/tool/map_lanetoxodr/dialogroadmirror.cpp

@@ -0,0 +1,146 @@
+#include "dialogroadmirror.h"
+#include "ui_dialogroadmirror.h"
+
+#include "gnss_coordinate_convert.h"
+
+#include <math.h>
+
+#include <mainwindow.h>
+
+extern MainWindow * gw;
+
+extern double glon0 ;
+extern double glat0 ;
+
+DialogRoadMirror::DialogRoadMirror(OpenDrive * pxodr,Road * pRoad,QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::DialogRoadMirror)
+{
+    ui->setupUi(this);
+    mpxodr = pxodr;
+    mpRoad = pRoad;
+
+    if(pRoad != 0)
+    {
+        setWindowTitle(QString(pRoad->GetRoadId().data()));
+    }
+}
+
+DialogRoadMirror::~DialogRoadMirror()
+{
+    delete ui;
+}
+
+void DialogRoadMirror::on_pushButton_Mirror_clicked()
+{
+
+    double x0,y0;
+    double rel_x,rel_y;
+    double x,y;
+    double flon,flat;
+    flon = ui->lineEdit_Lon->text().toDouble();
+    flat = ui->lineEdit_Lat->text().toDouble();
+    GaussProjCal(glon0,glat0,&x0,&y0);
+    GaussProjCal(flon,flat,&x,&y);
+    rel_x = x - x0;
+    rel_y = y - y0;
+
+    double hdg = (90 - ui->lineEdit_Heading->text().toDouble())*M_PI/180.0;
+    while(hdg < 0)hdg = hdg + 2.0*M_PI;
+    while(hdg >= 2.0*M_PI)hdg = hdg - 2.0*M_PI;
+
+    x0 = rel_x;
+    y0 = rel_y;
+    double hdg0 = hdg;
+
+    Road newroad = *mpRoad;
+
+    int i;
+    int ngeobcount = mpRoad->GetGeometryBlockCount();
+    for(i=0;i<ngeobcount;i++)
+    {
+        double x,y,hdg;
+        RoadGeometry * pgeo = newroad.GetGeometryBlock(i)->GetGeometryAt(0);
+        if(pgeo == 0)continue;
+        x = newroad.GetGeometryBlock(i)->GetGeometryAt(0)->GetX();
+        y = newroad.GetGeometryBlock(i)->GetGeometryAt(0)->GetY();
+        hdg = newroad.GetGeometryBlock(i)->GetGeometryAt(0)->GetHdg();
+
+        x = x-x0;
+        y = y- y0;
+
+        double s,t;
+        double frotate = hdg0*(-1);
+        s = x*cos(frotate) -y*sin(frotate) ;
+        t = x*sin(frotate) +y*cos(frotate);
+        hdg = hdg + frotate;
+        while(hdg<0)hdg = hdg + 2.0*M_PI;
+        while(hdg>=2.0*M_PI)hdg = hdg - 2.0*M_PI;
+
+        x = s;
+        y = t*(-1);
+        hdg = hdg*(-1);
+
+        while(hdg<0)hdg = hdg + 2.0*M_PI;
+        while(hdg>=2.0*M_PI)hdg = hdg - 2.0*M_PI;
+
+        frotate = hdg0;
+
+        s = x*cos(frotate) -y*sin(frotate) ;
+        t = x*sin(frotate) +y*cos(frotate);
+        hdg = hdg + frotate;
+        while(hdg<0)hdg = hdg + 2.0*M_PI;
+        while(hdg>=2.0*M_PI)hdg = hdg - 2.0*M_PI;
+
+
+        newroad.GetGeometryBlock(i)->GetGeometryAt(0)->SetX(s + x0);
+        newroad.GetGeometryBlock(i)->GetGeometryAt(0)->SetY(t + y0);
+        newroad.GetGeometryBlock(i)->GetGeometryAt(0)->SetHdg(hdg);
+
+        if(pgeo->GetGeomType() == 1)
+        {
+            GeometrySpiral * pSpiral = (GeometrySpiral *)pgeo;
+            double startcurv = pSpiral->GetCurvatureStart() *(-1);
+            double endcurv = pSpiral->GetCurvatureEnd() *(-1);
+            pSpiral->SetCurvatureStart(startcurv);
+            pSpiral->SetCurvatureEnd(endcurv);
+        }
+
+        if(pgeo->GetGeomType() == 2)
+        {
+            GeometryArc * pArc = (GeometryArc *)pgeo;
+            double curv = pArc->GetCurvature();
+            pArc->SetCurvature(curv*(-1));
+        }
+    }
+
+    int nnewroadid = gw->CreateRoadID();
+    newroad.SetRoadId(QString::number(nnewroadid).toStdString());
+
+    mpxodr->GetRoadVector()->push_back(newroad);
+
+    bool bSaveOldRoad = true;
+    QMessageBox::StandardButton button;
+    char strout[256];
+    snprintf(strout,256,"New Road id is %d. Keep the old road.",nnewroadid);
+    button=QMessageBox::question(this,tr("Quest"),QString(strout),QMessageBox::Yes|QMessageBox::No);
+    if(button==QMessageBox::No)
+    {
+        bSaveOldRoad = false;
+    }
+    else if(button==QMessageBox::Yes)
+    {
+        bSaveOldRoad = true;
+    }
+
+    if(bSaveOldRoad == false)
+    {
+        int nroadindex = xodrfunc::GetRoadIndex(mpxodr,mpRoad);
+        if(nroadindex >= 0)
+        {
+            mpxodr->DeleteRoad(nroadindex);
+        }
+    }
+
+    this->accept();
+}

+ 32 - 0
src/tool/map_lanetoxodr/dialogroadmirror.h

@@ -0,0 +1,32 @@
+#ifndef DIALOGROADMIRROR_H
+#define DIALOGROADMIRROR_H
+
+#include <QDialog>
+
+#include "OpenDrive/OpenDrive.h"
+
+#include <QMessageBox>
+
+namespace Ui {
+class DialogRoadMirror;
+}
+
+class DialogRoadMirror : public QDialog
+{
+    Q_OBJECT
+
+public:
+    explicit DialogRoadMirror(OpenDrive * pxodr,Road * pRoad, QWidget *parent = nullptr);
+    ~DialogRoadMirror();
+
+private slots:
+    void on_pushButton_Mirror_clicked();
+
+private:
+    Ui::DialogRoadMirror *ui;
+
+    OpenDrive * mpxodr;
+    Road * mpRoad;
+};
+
+#endif // DIALOGROADMIRROR_H

+ 101 - 0
src/tool/map_lanetoxodr/dialogroadmirror.ui

@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>DialogRoadMirror</class>
+ <widget class="QDialog" name="DialogRoadMirror">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>532</width>
+    <height>377</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dialog</string>
+  </property>
+  <widget class="QLineEdit" name="lineEdit_Lon">
+   <property name="geometry">
+    <rect>
+     <x>250</x>
+     <y>40</y>
+     <width>181</width>
+     <height>41</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLineEdit" name="lineEdit_Lat">
+   <property name="geometry">
+    <rect>
+     <x>250</x>
+     <y>120</y>
+     <width>181</width>
+     <height>41</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLineEdit" name="lineEdit_Heading">
+   <property name="geometry">
+    <rect>
+     <x>250</x>
+     <y>200</y>
+     <width>181</width>
+     <height>41</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="pushButton_Mirror">
+   <property name="geometry">
+    <rect>
+     <x>210</x>
+     <y>280</y>
+     <width>111</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Mirror</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label">
+   <property name="geometry">
+    <rect>
+     <x>110</x>
+     <y>55</y>
+     <width>91</width>
+     <height>17</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Longitude</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_2">
+   <property name="geometry">
+    <rect>
+     <x>112</x>
+     <y>138</y>
+     <width>67</width>
+     <height>17</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Latitude</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_3">
+   <property name="geometry">
+    <rect>
+     <x>110</x>
+     <y>220</y>
+     <width>101</width>
+     <height>17</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Heading(°)</string>
+   </property>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 102 - 0
src/tool/map_lanetoxodr/dialogroadmove.cpp

@@ -0,0 +1,102 @@
+#include "dialogroadmove.h"
+#include "ui_dialogroadmove.h"
+
+#include <math.h>
+
+#include <mainwindow.h>
+
+extern MainWindow * gw;
+
+DialogRoadMove::DialogRoadMove(OpenDrive * pxodr,Road * pRoad, QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::DialogRoadMove)
+{
+    ui->setupUi(this);
+
+    mpxodr = pxodr;
+    mpRoad = pRoad;
+
+    if(pRoad != 0)
+    {
+        setWindowTitle(QString(pRoad->GetRoadId().data()));
+    }
+}
+
+DialogRoadMove::~DialogRoadMove()
+{
+    delete ui;
+}
+
+void DialogRoadMove::on_pushButton_Move_clicked()
+{
+    if(mpRoad == 0)
+    {
+        QMessageBox::warning(this,"Warning","Not have road.",QMessageBox::YesAll);
+        return;
+    }
+
+    double fMoveX = ui->lineEdit_normal->text().toDouble();
+    double fMoveY = ui->lineEdit_dir->text().toDouble();
+
+    if((fMoveX == 0)&&(fMoveY == 0))
+    {
+        QMessageBox::StandardButton button;
+        button=QMessageBox::question(this,tr("生成道路"),QString(tr("是否在原来位置生成道路")),QMessageBox::Yes|QMessageBox::No);
+        if(button==QMessageBox::No)
+        {
+            return;
+        }
+        else if(button==QMessageBox::Yes)
+        {
+
+        }
+    }
+
+    Road newroad = *mpRoad;
+
+    double hdg = 0;
+    if(mpRoad->GetGeometryBlockCount()>0)
+    {
+        hdg = mpRoad->GetGeometryBlock(0)->GetGeometryAt(0)->GetHdg();
+    }
+
+    double yoff = fMoveX*sin(hdg+M_PI/2.0) + fMoveY *sin(hdg);
+    double xoff = fMoveX*cos(hdg+M_PI/2.0) + fMoveY *cos(hdg);
+    int i;
+    int ngeobcount = mpRoad->GetGeometryBlockCount();
+    for(i=0;i<ngeobcount;i++)
+    {
+        newroad.GetGeometryBlock(i)->GetGeometryAt(0)->SetX(newroad.GetGeometryBlock(i)->GetGeometryAt(0)->GetX() + xoff);
+        newroad.GetGeometryBlock(i)->GetGeometryAt(0)->SetY(newroad.GetGeometryBlock(i)->GetGeometryAt(0)->GetY() + yoff);
+    }
+
+    int nnewroadid = gw->CreateRoadID();
+    newroad.SetRoadId(QString::number(nnewroadid).toStdString());
+
+    mpxodr->GetRoadVector()->push_back(newroad);
+
+    bool bSaveOldRoad = true;
+    QMessageBox::StandardButton button;
+    char strout[256];
+    snprintf(strout,256,"New Road id is %d. Keep the old road.",nnewroadid);
+    button=QMessageBox::question(this,tr("Quest"),QString(strout),QMessageBox::Yes|QMessageBox::No);
+    if(button==QMessageBox::No)
+    {
+        bSaveOldRoad = false;
+    }
+    else if(button==QMessageBox::Yes)
+    {
+        bSaveOldRoad = true;
+    }
+
+    if(bSaveOldRoad == false)
+    {
+        int nroadindex = xodrfunc::GetRoadIndex(mpxodr,mpRoad);
+        if(nroadindex >= 0)
+        {
+            mpxodr->DeleteRoad(nroadindex);
+        }
+    }
+
+    this->accept();
+}

+ 32 - 0
src/tool/map_lanetoxodr/dialogroadmove.h

@@ -0,0 +1,32 @@
+#ifndef DIALOGROADMOVE_H
+#define DIALOGROADMOVE_H
+
+#include <QDialog>
+
+#include "OpenDrive/OpenDrive.h"
+
+#include <QMessageBox>
+
+namespace Ui {
+class DialogRoadMove;
+}
+
+class DialogRoadMove : public QDialog
+{
+    Q_OBJECT
+
+public:
+    explicit DialogRoadMove(OpenDrive * pxodr,Road * pRoad, QWidget *parent = nullptr);
+    ~DialogRoadMove();
+
+private slots:
+    void on_pushButton_Move_clicked();
+
+private:
+    Ui::DialogRoadMove *ui;
+
+    OpenDrive * mpxodr;
+    Road * mpRoad;
+};
+
+#endif // DIALOGROADMOVE_H

+ 78 - 0
src/tool/map_lanetoxodr/dialogroadmove.ui

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>DialogRoadMove</class>
+ <widget class="QDialog" name="DialogRoadMove">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>552</width>
+    <height>283</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dialog</string>
+  </property>
+  <widget class="QPushButton" name="pushButton_Move">
+   <property name="geometry">
+    <rect>
+     <x>200</x>
+     <y>170</y>
+     <width>89</width>
+     <height>25</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Move</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label">
+   <property name="geometry">
+    <rect>
+     <x>60</x>
+     <y>100</y>
+     <width>181</width>
+     <height>21</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Road Direction</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_2">
+   <property name="geometry">
+    <rect>
+     <x>60</x>
+     <y>40</y>
+     <width>171</width>
+     <height>17</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Road Normal Direction</string>
+   </property>
+  </widget>
+  <widget class="QLineEdit" name="lineEdit_normal">
+   <property name="geometry">
+    <rect>
+     <x>300</x>
+     <y>32</y>
+     <width>161</width>
+     <height>31</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLineEdit" name="lineEdit_dir">
+   <property name="geometry">
+    <rect>
+     <x>300</x>
+     <y>95</y>
+     <width>161</width>
+     <height>31</height>
+    </rect>
+   </property>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 117 - 0
src/tool/map_lanetoxodr/dialogroadrotate.cpp

@@ -0,0 +1,117 @@
+#include "dialogroadrotate.h"
+#include "ui_dialogroadrotate.h"
+
+#include <math.h>
+
+#include <mainwindow.h>
+
+extern MainWindow * gw;
+
+DialogRoadRotate::DialogRoadRotate(OpenDrive * pxodr,Road * pRoad, QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::DialogRoadRotate)
+{
+    ui->setupUi(this);
+
+    mpxodr = pxodr;
+    mpRoad = pRoad;
+
+    if(pRoad != 0)
+    {
+        setWindowTitle(QString(pRoad->GetRoadId().data()));
+    }
+}
+
+DialogRoadRotate::~DialogRoadRotate()
+{
+    delete ui;
+}
+
+void DialogRoadRotate::on_pushButton_Rotate_clicked()
+{
+    if(mpRoad == 0)
+    {
+        QMessageBox::warning(this,"Warning","Not have road.",QMessageBox::YesAll);
+        return;
+    }
+
+    double frotate = ui->lineEdit_rotatedegree->text().toDouble() *M_PI/180.0;
+
+    if(frotate == 0)
+    {
+        QMessageBox::StandardButton button;
+        button=QMessageBox::question(this,tr("生成道路"),QString(tr("是否在原来位置生成道路")),QMessageBox::Yes|QMessageBox::No);
+        if(button==QMessageBox::No)
+        {
+            return;
+        }
+        else if(button==QMessageBox::Yes)
+        {
+
+        }
+    }
+
+    Road newroad = *mpRoad;
+    double hdg0 = 0;
+    double x0 = 0;
+    double y0 = 0;
+    if(mpRoad->GetGeometryBlockCount()>0)
+    {
+        hdg0 = mpRoad->GetGeometryBlock(0)->GetGeometryAt(0)->GetHdg();
+        x0 = mpRoad->GetGeometryBlock(0)->GetGeometryAt(0)->GetX();
+        y0 = mpRoad->GetGeometryBlock(0)->GetGeometryAt(0)->GetY();
+    }
+
+    int i;
+    int ngeobcount = mpRoad->GetGeometryBlockCount();
+    for(i=0;i<ngeobcount;i++)
+    {
+        double x,y,hdg;
+        x = newroad.GetGeometryBlock(i)->GetGeometryAt(0)->GetX();
+        y = newroad.GetGeometryBlock(i)->GetGeometryAt(0)->GetY();
+        hdg = newroad.GetGeometryBlock(i)->GetGeometryAt(0)->GetHdg();
+
+        double s,t;
+        s = (x-x0)*cos(frotate) -(y-y0)*sin(frotate) + x0;
+        t = (x-x0)*sin(frotate) +(y-y0)*cos(frotate) + y0;
+        hdg = hdg + frotate;
+        while(hdg<0)hdg = hdg + 2.0*M_PI;
+        while(hdg>=2.0*M_PI)hdg = hdg - 2.0*M_PI;
+
+
+        newroad.GetGeometryBlock(i)->GetGeometryAt(0)->SetX(s);
+        newroad.GetGeometryBlock(i)->GetGeometryAt(0)->SetY(t);
+        newroad.GetGeometryBlock(i)->GetGeometryAt(0)->SetHdg(hdg);
+    }
+
+    int nnewroadid = gw->CreateRoadID();
+    newroad.SetRoadId(QString::number(nnewroadid).toStdString());
+
+    mpxodr->GetRoadVector()->push_back(newroad);
+
+    bool bSaveOldRoad = true;
+    QMessageBox::StandardButton button;
+    char strout[256];
+    snprintf(strout,256,"New Road id is %d. Keep the old road.",nnewroadid);
+    button=QMessageBox::question(this,tr("Quest"),QString(strout),QMessageBox::Yes|QMessageBox::No);
+    if(button==QMessageBox::No)
+    {
+        bSaveOldRoad = false;
+    }
+    else if(button==QMessageBox::Yes)
+    {
+        bSaveOldRoad = true;
+    }
+
+    if(bSaveOldRoad == false)
+    {
+        int nroadindex = xodrfunc::GetRoadIndex(mpxodr,mpRoad);
+        if(nroadindex >= 0)
+        {
+            mpxodr->DeleteRoad(nroadindex);
+        }
+    }
+
+    this->accept();
+
+}

+ 32 - 0
src/tool/map_lanetoxodr/dialogroadrotate.h

@@ -0,0 +1,32 @@
+#ifndef DIALOGROADROTATE_H
+#define DIALOGROADROTATE_H
+
+#include <QDialog>
+
+#include "OpenDrive/OpenDrive.h"
+
+#include <QMessageBox>
+
+namespace Ui {
+class DialogRoadRotate;
+}
+
+class DialogRoadRotate : public QDialog
+{
+    Q_OBJECT
+
+public:
+    explicit DialogRoadRotate(OpenDrive * pxodr,Road * pRoad, QWidget *parent = nullptr);
+    ~DialogRoadRotate();
+
+private slots:
+    void on_pushButton_Rotate_clicked();
+
+private:
+    Ui::DialogRoadRotate *ui;
+
+    OpenDrive * mpxodr;
+    Road * mpRoad;
+};
+
+#endif // DIALOGROADROTATE_H

+ 55 - 0
src/tool/map_lanetoxodr/dialogroadrotate.ui

@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>DialogRoadRotate</class>
+ <widget class="QDialog" name="DialogRoadRotate">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>487</width>
+    <height>242</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dialog</string>
+  </property>
+  <widget class="QLineEdit" name="lineEdit_rotatedegree">
+   <property name="geometry">
+    <rect>
+     <x>250</x>
+     <y>66</y>
+     <width>181</width>
+     <height>31</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label">
+   <property name="geometry">
+    <rect>
+     <x>90</x>
+     <y>70</y>
+     <width>131</width>
+     <height>21</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Degree(°)</string>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="pushButton_Rotate">
+   <property name="geometry">
+    <rect>
+     <x>170</x>
+     <y>140</y>
+     <width>121</width>
+     <height>31</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Rotate</string>
+   </property>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 9 - 0
src/tool/map_lanetoxodr/map_lanetoxodr.pro

@@ -34,6 +34,9 @@ SOURCES += \
     dialogeditroadmark.cpp \
     dialoglanefromrtk.cpp \
     dialogroadmerge.cpp \
+    dialogroadmirror.cpp \
+    dialogroadmove.cpp \
+    dialogroadrotate.cpp \
     dialogroadsplit.cpp \
     ivxodrtool.cpp \
         main.cpp \
@@ -79,6 +82,9 @@ HEADERS += \
     dialogeditroadmark.h \
     dialoglanefromrtk.h \
     dialogroadmerge.h \
+    dialogroadmirror.h \
+    dialogroadmove.h \
+    dialogroadrotate.h \
     dialogroadsplit.h \
     ivxodrtool.h \
         mainwindow.h \
@@ -120,6 +126,9 @@ FORMS += \
         dialogeditroadmark.ui \
         dialoglanefromrtk.ui \
         dialogroadmerge.ui \
+        dialogroadmirror.ui \
+        dialogroadmove.ui \
+        dialogroadrotate.ui \
         dialogroadsplit.ui \
         mainwindow.ui \
         roadeditdialog.ui \

+ 72 - 0
src/tool/map_lanetoxodr/roadeditdialog.cpp

@@ -480,3 +480,75 @@ void RoadEditDialog::on_pushButton_RoadMerge_clicked()
     }
     on_comboBox_Road_currentIndexChanged(ncurindex);
 }
+
+void RoadEditDialog::on_pushButton_MoveRoad_clicked()
+{
+    if(mpCurRoad == 0)
+    {
+        QMessageBox::warning(this,"Warning","Not Select Road");
+        return;
+    }
+
+    DialogRoadMove roadmove(mpxodr,mpCurRoad,this);
+    roadmove.exec();
+
+    unsigned int ncurindex = ui->comboBox_Road->currentIndex();
+    ui->comboBox_Road->clear();
+    int i;
+    int nroadcount = mpxodr->GetRoadCount();
+    for(i=0;i<nroadcount;i++)
+    {
+        const char * strname = mpxodr->GetRoad(i)->GetRoadId().data();
+        ui->comboBox_Road->addItem(strname);
+
+    }
+    on_comboBox_Road_currentIndexChanged(ncurindex);
+}
+
+void RoadEditDialog::on_pushButton_RotateRoad_clicked()
+{
+    if(mpCurRoad == 0)
+    {
+        QMessageBox::warning(this,"Warning","Not Select Road");
+        return;
+    }
+
+    DialogRoadRotate roadrotate(mpxodr,mpCurRoad,this);
+    roadrotate.exec();
+
+    unsigned int ncurindex = ui->comboBox_Road->currentIndex();
+    ui->comboBox_Road->clear();
+    int i;
+    int nroadcount = mpxodr->GetRoadCount();
+    for(i=0;i<nroadcount;i++)
+    {
+        const char * strname = mpxodr->GetRoad(i)->GetRoadId().data();
+        ui->comboBox_Road->addItem(strname);
+
+    }
+    on_comboBox_Road_currentIndexChanged(ncurindex);
+}
+
+void RoadEditDialog::on_pushButton_MirrorRoad_clicked()
+{
+    if(mpCurRoad == 0)
+    {
+        QMessageBox::warning(this,"Warning","Not Select Road");
+        return;
+    }
+
+    DialogRoadMirror roadmirror(mpxodr,mpCurRoad,this);
+    roadmirror.exec();
+
+    unsigned int ncurindex = ui->comboBox_Road->currentIndex();
+    ui->comboBox_Road->clear();
+    int i;
+    int nroadcount = mpxodr->GetRoadCount();
+    for(i=0;i<nroadcount;i++)
+    {
+        const char * strname = mpxodr->GetRoad(i)->GetRoadId().data();
+        ui->comboBox_Road->addItem(strname);
+
+    }
+    on_comboBox_Road_currentIndexChanged(ncurindex);
+}

+ 9 - 0
src/tool/map_lanetoxodr/roadeditdialog.h

@@ -16,6 +16,9 @@
 #include "dialoglanefromrtk.h"
 #include "dialogroadsplit.h"
 #include "dialogroadmerge.h"
+#include "dialogroadmove.h"
+#include "dialogroadrotate.h"
+#include "dialogroadmirror.h"
 
 namespace Ui {
 class RoadEditDialog;
@@ -51,6 +54,12 @@ private slots:
 
     void on_pushButton_RoadMerge_clicked();
 
+    void on_pushButton_MoveRoad_clicked();
+
+    void on_pushButton_RotateRoad_clicked();
+
+    void on_pushButton_MirrorRoad_clicked();
+
 private:
     Ui::RoadEditDialog *ui;
     OpenDrive * mpxodr;