|
@@ -0,0 +1,166 @@
|
|
|
+#include "dialogroadobject_outline_cornerroad.h"
|
|
|
+#include "ui_dialogroadobject_outline_cornerroad.h"
|
|
|
+
|
|
|
+DialogRoadObject_Outline_cornerRoad::DialogRoadObject_Outline_cornerRoad(Object_outlines_outline * poutline,int ntype,QWidget *parent) :
|
|
|
+ QDialog(parent),
|
|
|
+ ui(new Ui::DialogRoadObject_Outline_cornerRoad)
|
|
|
+{
|
|
|
+ ui->setupUi(this);
|
|
|
+
|
|
|
+ mpoutline = poutline;
|
|
|
+
|
|
|
+ mntype = ntype;
|
|
|
+ if(ntype == 1)
|
|
|
+ {
|
|
|
+ ui->label_s->setText("u");
|
|
|
+ ui->label_t->setText("v");
|
|
|
+ ui->label_dz->setText("z");
|
|
|
+ ui->label_corner->setText("cornerLocal");
|
|
|
+ }
|
|
|
+
|
|
|
+ UpdateCB();
|
|
|
+
|
|
|
+ if(ntype == 0)
|
|
|
+ setWindowTitle("Edit Road Object Outline cornerRoad");
|
|
|
+ else
|
|
|
+ setWindowTitle("Edit Road Object Outline cornerLocal");
|
|
|
+}
|
|
|
+
|
|
|
+DialogRoadObject_Outline_cornerRoad::~DialogRoadObject_Outline_cornerRoad()
|
|
|
+{
|
|
|
+ delete ui;
|
|
|
+}
|
|
|
+
|
|
|
+void DialogRoadObject_Outline_cornerRoad::on_pushButton_Add_clicked()
|
|
|
+{
|
|
|
+ if(mpoutline == NULL)return;
|
|
|
+
|
|
|
+ if(mntype == 0)
|
|
|
+ {
|
|
|
+ if(ViewCreate::CheckLE(ui->lineEdit_s,"s",true,this) == false)return;
|
|
|
+ if(ViewCreate::CheckLE(ui->lineEdit_t,"t",true,this) == false)return;
|
|
|
+ if(ViewCreate::CheckLE(ui->lineEdit_dz,"dz",true,this) == false)return;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if(ViewCreate::CheckLE(ui->lineEdit_s,"u",true,this) == false)return;
|
|
|
+ if(ViewCreate::CheckLE(ui->lineEdit_t,"v",true,this) == false)return;
|
|
|
+ if(ViewCreate::CheckLE(ui->lineEdit_dz,"z",true,this) == false)return;
|
|
|
+ }
|
|
|
+ if(ViewCreate::CheckLE(ui->lineEdit_height,"height",true,this) == false)return;
|
|
|
+
|
|
|
+ if(mntype == 0)
|
|
|
+ {
|
|
|
+ mpoutline->AddcornerRoad(ui->lineEdit_s->text().toDouble(),
|
|
|
+ ui->lineEdit_t->text().toDouble(),
|
|
|
+ ui->lineEdit_dz->text().toDouble(),
|
|
|
+ ui->lineEdit_height->text().toDouble());
|
|
|
+ Object_outlines_outline_cornerRoad * pcornerRoad = mpoutline->GetLastAddedcornerRoad();
|
|
|
+ if(ViewCreate::CheckLE(ui->lineEdit_id,"id",false,this) == true)
|
|
|
+ {
|
|
|
+ pcornerRoad->Setid(ui->lineEdit_id->text().toInt());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ mpoutline->AddcornerLocal(ui->lineEdit_s->text().toDouble(),
|
|
|
+ ui->lineEdit_t->text().toDouble(),
|
|
|
+ ui->lineEdit_dz->text().toDouble(),
|
|
|
+ ui->lineEdit_height->text().toDouble());
|
|
|
+ Object_outlines_outline_cornerLocal * pcornerLocal = mpoutline->GetLastAddedcornerLocal();
|
|
|
+ if(ViewCreate::CheckLE(ui->lineEdit_id,"id",false,this) == true)
|
|
|
+ {
|
|
|
+ pcornerLocal->Setid(ui->lineEdit_id->text().toInt());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ UpdateCB();
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void DialogRoadObject_Outline_cornerRoad::on_pushButton_Delete_clicked()
|
|
|
+{
|
|
|
+ if(mpoutline == NULL)return;
|
|
|
+}
|
|
|
+
|
|
|
+void DialogRoadObject_Outline_cornerRoad::on_pushButton_Change_clicked()
|
|
|
+{
|
|
|
+ if(mpoutline == NULL)return;
|
|
|
+}
|
|
|
+
|
|
|
+void DialogRoadObject_Outline_cornerRoad::UpdateCB()
|
|
|
+{
|
|
|
+ ui->comboBox_corner->clear();
|
|
|
+ if(mpoutline == NULL)return;
|
|
|
+ if(mntype == 0)
|
|
|
+ {
|
|
|
+ unsigned ncornerRoadCount = mpoutline->GetcornerRoadCount();
|
|
|
+ unsigned i;
|
|
|
+ for(i=0;i<ncornerRoadCount;i++)
|
|
|
+ {
|
|
|
+ ui->comboBox_corner->addItem("cornerRoad "+ QString::number(i));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ unsigned ncornerLocalCount = mpoutline->GetcornerLocalCount();
|
|
|
+ unsigned i;
|
|
|
+ for(i=0;i<ncornerLocalCount;i++)
|
|
|
+ {
|
|
|
+ ui->comboBox_corner->addItem("cornerLocal "+ QString::number(i));
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void DialogRoadObject_Outline_cornerRoad::on_comboBox_corner_currentIndexChanged(int index)
|
|
|
+{
|
|
|
+ if(index <0)return;
|
|
|
+
|
|
|
+ if(mpoutline == NULL)return;
|
|
|
+
|
|
|
+ if(mntype == 0)
|
|
|
+ {
|
|
|
+ Object_outlines_outline_cornerRoad * pcornerRoad = mpoutline->GetcornerRoad(index);
|
|
|
+ if(pcornerRoad == NULL)
|
|
|
+ {
|
|
|
+ qDebug(" DialogRoadObject_Outline_cornerRoad::on_comboBox_corner_currentIndexChanged get cornerRoad Fail,index:%d",index);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ui->lineEdit_s->setText(QString::number(pcornerRoad->Gets()));
|
|
|
+ ui->lineEdit_t->setText(QString::number(pcornerRoad->Gett()));
|
|
|
+ ui->lineEdit_dz->setText(QString::number(pcornerRoad->Getdz()));
|
|
|
+ ui->lineEdit_height->setText(QString::number(pcornerRoad->Getheight()));
|
|
|
+ int id;
|
|
|
+ if(pcornerRoad->Getid(id) == 1)
|
|
|
+ {
|
|
|
+ ui->lineEdit_id->setText(QString::number(id));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ui->lineEdit_id->setText("");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Object_outlines_outline_cornerLocal * pcornerLocal = mpoutline->GetcornerLocal(index);
|
|
|
+ if(pcornerLocal == NULL)
|
|
|
+ {
|
|
|
+ qDebug(" DialogRoadObject_Outline_cornerRoad::on_comboBox_corner_currentIndexChanged get cornerRoad Fail,index:%d",index);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ui->lineEdit_s->setText(QString::number(pcornerLocal->Getu()));
|
|
|
+ ui->lineEdit_t->setText(QString::number(pcornerLocal->Getv()));
|
|
|
+ ui->lineEdit_dz->setText(QString::number(pcornerLocal->Getz()));
|
|
|
+ ui->lineEdit_height->setText(QString::number(pcornerLocal->Getheight()));
|
|
|
+ int id;
|
|
|
+ if(pcornerLocal->Getid(id) == 1)
|
|
|
+ {
|
|
|
+ ui->lineEdit_id->setText(QString::number(id));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ui->lineEdit_id->setText("");
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|