|
@@ -0,0 +1,144 @@
|
|
|
|
+#include "dialogeditlane.h"
|
|
|
|
+#include "ui_dialogeditlane.h"
|
|
|
|
+
|
|
|
|
+DialogEditLane::DialogEditLane(Road * pRoad,QWidget *parent) :
|
|
|
|
+ QDialog(parent),
|
|
|
|
+ ui(new Ui::DialogEditLane)
|
|
|
|
+{
|
|
|
|
+ mpRoad = pRoad;
|
|
|
|
+ ui->setupUi(this);
|
|
|
|
+
|
|
|
|
+ ui->comboBox_LaneType->addItem("shoulder");
|
|
|
|
+ ui->comboBox_LaneType->addItem("border");
|
|
|
|
+ ui->comboBox_LaneType->addItem("driving");
|
|
|
|
+ ui->comboBox_LaneType->addItem("stop");
|
|
|
|
+ ui->comboBox_LaneType->addItem("none");
|
|
|
|
+ ui->comboBox_LaneType->addItem("parking");
|
|
|
|
+ ui->comboBox_LaneType->addItem("biking");
|
|
|
|
+ ui->comboBox_LaneType->addItem("sidewalk");
|
|
|
|
+ ui->comboBox_LaneType->addItem("median");
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ int nsection = pRoad->GetLaneSectionCount();
|
|
|
|
+ int i;
|
|
|
|
+ for(i=0;i<nsection;i++)
|
|
|
|
+ {
|
|
|
|
+ LaneSection * pLS = pRoad->GetLaneSection(i);
|
|
|
|
+ QString stritemname = QString("s=") + QString::number(pLS->GetS());
|
|
|
|
+ ui->comboBox_LaneSection->addItem(stritemname);
|
|
|
|
+ }
|
|
|
|
+ if(nsection > 0)on_comboBox_LaneSection_currentIndexChanged(0);
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+DialogEditLane::~DialogEditLane()
|
|
|
|
+{
|
|
|
|
+ delete ui;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void DialogEditLane::on_comboBox_LaneSection_currentIndexChanged(int index)
|
|
|
|
+{
|
|
|
|
+ if(mpRoad == 0)return;
|
|
|
|
+ LaneSection * pLS = mpRoad->GetLaneSection(index);
|
|
|
|
+ ui->comboBox_Lane->clear();
|
|
|
|
+ mpCurLS = pLS;
|
|
|
|
+ if(pLS == 0)return;
|
|
|
|
+ int nLaneCount = pLS->GetLaneCount();
|
|
|
|
+
|
|
|
|
+ int i;
|
|
|
|
+ for(i=0;i<nLaneCount;i++)
|
|
|
|
+ {
|
|
|
|
+ Lane * pLane = pLS->GetLane(i);
|
|
|
|
+ QString stritemname = QString::number(pLane->GetId());
|
|
|
|
+ ui->comboBox_Lane->addItem(stritemname);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(nLaneCount > 0)on_comboBox_Lane_currentIndexChanged(0);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void DialogEditLane::on_comboBox_Lane_currentIndexChanged(int index)
|
|
|
|
+{
|
|
|
|
+ if(mpCurLS == 0)return;
|
|
|
|
+ Lane * pLane = mpCurLS->GetLane(index);
|
|
|
|
+ ui->comboBox_Width->clear();
|
|
|
|
+ if(pLane == 0)return;
|
|
|
|
+ int nWidthCount = pLane->GetLaneWidthCount();
|
|
|
|
+ int i;
|
|
|
|
+ for(i=0;i<nWidthCount;i++)
|
|
|
|
+ {
|
|
|
|
+ LaneWidth * pLaneWidth = pLane->GetLaneWidth(i);
|
|
|
|
+ QString stritemname = QString("sOffset=") + QString::number(pLaneWidth->GetS());
|
|
|
|
+ ui->comboBox_Width->addItem(stritemname);
|
|
|
|
+ }
|
|
|
|
+ mpCurLane = pLane;
|
|
|
|
+ if(nWidthCount > 0)on_comboBox_Width_currentIndexChanged(0);
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ ui->lineEdit_sOffset->setText("");
|
|
|
|
+ ui->lineEdit_a->setText("");
|
|
|
|
+ ui->lineEdit_b->setText("");
|
|
|
|
+ ui->lineEdit_c->setText("");
|
|
|
|
+ ui->lineEdit_d->setText("");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ std::string strlanetype = pLane->GetType();
|
|
|
|
+
|
|
|
|
+ ui->comboBox_LaneType->setCurrentIndex(4);
|
|
|
|
+ if(strlanetype == "shoulder")ui->comboBox_LaneType->setCurrentIndex(0);
|
|
|
|
+ if(strlanetype == "border")ui->comboBox_LaneType->setCurrentIndex(1);
|
|
|
|
+ if(strlanetype == "driving")ui->comboBox_LaneType->setCurrentIndex(2);
|
|
|
|
+ if(strlanetype == "stop")ui->comboBox_LaneType->setCurrentIndex(3);
|
|
|
|
+ if(strlanetype == "none")ui->comboBox_LaneType->setCurrentIndex(4);
|
|
|
|
+ if(strlanetype == "parking")ui->comboBox_LaneType->setCurrentIndex(5);
|
|
|
|
+ if(strlanetype == "biking")ui->comboBox_LaneType->setCurrentIndex(6);
|
|
|
|
+ if(strlanetype == "sidewalk")ui->comboBox_LaneType->setCurrentIndex(7);
|
|
|
|
+ if(strlanetype == "median")ui->comboBox_LaneType->setCurrentIndex(8);
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void DialogEditLane::on_comboBox_Width_currentIndexChanged(int index)
|
|
|
|
+{
|
|
|
|
+ if(mpCurLane == 0)return;
|
|
|
|
+ LaneWidth * pLaneWidth = mpCurLane->GetLaneWidth(index);
|
|
|
|
+ if(pLaneWidth == 0)return;
|
|
|
|
+ ui->lineEdit_sOffset->setText(QString::number(pLaneWidth->GetS()));
|
|
|
|
+ ui->lineEdit_a->setText(QString::number(pLaneWidth->GetA()));
|
|
|
|
+ ui->lineEdit_b->setText(QString::number(pLaneWidth->GetB()));
|
|
|
|
+ ui->lineEdit_c->setText(QString::number(pLaneWidth->GetC()));
|
|
|
|
+ ui->lineEdit_d->setText(QString::number(pLaneWidth->GetD()));
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void DialogEditLane::on_pushButton_AddLeftLane_clicked()
|
|
|
|
+{
|
|
|
|
+ if(mpCurLS == 0)return;
|
|
|
|
+ // mpCurLS->AddLane()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void DialogEditLane::on_pushButton_AddRIghtLane_clicked()
|
|
|
|
+{
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void DialogEditLane::on_pushButton_DeleteLane_clicked()
|
|
|
|
+{
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void DialogEditLane::on_pushButton_AddLaneWidth_clicked()
|
|
|
|
+{
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void DialogEditLane::on_pushButton_ChangeLaneWidth_clicked()
|
|
|
|
+{
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void DialogEditLane::on_pushButton_DeleteLaneWidth_clicked()
|
|
|
|
+{
|
|
|
|
+
|
|
|
|
+}
|