|
@@ -1,10 +1,14 @@
|
|
|
#include "dialogroadsplit.h"
|
|
|
#include "ui_dialogroadsplit.h"
|
|
|
|
|
|
+#include "xodrfunc.h"
|
|
|
|
|
|
#include "mainwindow.h"
|
|
|
extern MainWindow * gw;
|
|
|
|
|
|
+extern double glon0 ;
|
|
|
+extern double glat0;
|
|
|
+
|
|
|
DialogRoadSplit::DialogRoadSplit(Road * pRoad,OpenDrive * pxodr,QWidget *parent) :
|
|
|
QDialog(parent),
|
|
|
ui(new Ui::DialogRoadSplit)
|
|
@@ -520,3 +524,30 @@ int DialogRoadSplit::SplitSignal(Road *proad1, Road *proad2, vector<Signal> xvec
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
|
+
|
|
|
+void DialogRoadSplit::on_pushButton_spliatatpos_clicked()
|
|
|
+{
|
|
|
+ Road * pRoad = 0;
|
|
|
+ GeometryBlock * pgeob;
|
|
|
+ double fdis,nearx,neary,hdg;
|
|
|
+ double fs;
|
|
|
+ int nlane;
|
|
|
+ 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;
|
|
|
+ if(xodrfunc::GetNearPoint(rel_x,rel_y,mpxodr,&pRoad,&pgeob,fdis,nearx,neary,hdg,50,&fs,&nlane,true) == 0)
|
|
|
+ {
|
|
|
+ SplitRoad(mpxodr,pRoad,fs);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ QMessageBox::warning(this,"Warning","Position is Fast",QMessageBox::YesAll);
|
|
|
+ }
|
|
|
+}
|