|
@@ -50,6 +50,8 @@ DialogRoadObject::DialogRoadObject(Road * pRoad,QWidget *parent) :
|
|
mpCBorientation->addItem("undefined");
|
|
mpCBorientation->addItem("undefined");
|
|
mpCBorientation->setCurrentIndex(3);
|
|
mpCBorientation->setCurrentIndex(3);
|
|
|
|
|
|
|
|
+ if(pRoad != 0)
|
|
|
|
+ {
|
|
|
|
|
|
int nobjectcount = pRoad->GetObjectCount();
|
|
int nobjectcount = pRoad->GetObjectCount();
|
|
for(i=0;i<nobjectcount;i++)
|
|
for(i=0;i<nobjectcount;i++)
|
|
@@ -58,6 +60,8 @@ DialogRoadObject::DialogRoadObject(Road * pRoad,QWidget *parent) :
|
|
ui->comboBox_Object->addItem("Object s:"+QString::number(pObject->Gets()));
|
|
ui->comboBox_Object->addItem("Object s:"+QString::number(pObject->Gets()));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
setWindowTitle("Edit Road Object");
|
|
setWindowTitle("Edit Road Object");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -116,6 +120,7 @@ void DialogRoadObject::CreateView()
|
|
connect(mpPBmaterial,SIGNAL(clicked(bool)),this,SLOT(onClickMaterial()));
|
|
connect(mpPBmaterial,SIGNAL(clicked(bool)),this,SLOT(onClickMaterial()));
|
|
connect(mpPBrepeat,SIGNAL(clicked(bool)),this,SLOT(onClickRepeat()));
|
|
connect(mpPBrepeat,SIGNAL(clicked(bool)),this,SLOT(onClickRepeat()));
|
|
connect(mpPBparkingspace,SIGNAL(clicked(bool)),this,SLOT(onClickParkingSpace()));
|
|
connect(mpPBparkingspace,SIGNAL(clicked(bool)),this,SLOT(onClickParkingSpace()));
|
|
|
|
+ connect(mpPBoutlines,SIGNAL(clicked(bool)),this,SLOT(onClickOutlines()));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -123,6 +128,8 @@ void DialogRoadObject::CreateView()
|
|
void DialogRoadObject::on_pushButton_add_clicked()
|
|
void DialogRoadObject::on_pushButton_add_clicked()
|
|
{
|
|
{
|
|
Road * pRoad = mpRoad;
|
|
Road * pRoad = mpRoad;
|
|
|
|
+ if(pRoad == 0)return;
|
|
|
|
+
|
|
if(ViewCreate::CheckLE(mpLEid,"id",true,this) == false)return;
|
|
if(ViewCreate::CheckLE(mpLEid,"id",true,this) == false)return;
|
|
string id = mpLEid->text().toStdString();
|
|
string id = mpLEid->text().toStdString();
|
|
|
|
|
|
@@ -139,7 +146,7 @@ void DialogRoadObject::on_pushButton_add_clicked()
|
|
if(mpCBtype->currentText() == "parkingSpace")
|
|
if(mpCBtype->currentText() == "parkingSpace")
|
|
{
|
|
{
|
|
if(ViewCreate::CheckLE(mpLElength,"length",true,this) == false)return;
|
|
if(ViewCreate::CheckLE(mpLElength,"length",true,this) == false)return;
|
|
- length = mpLElength->text().toDouble();
|
|
|
|
|
|
+// length = mpLElength->text().toDouble();
|
|
|
|
|
|
if(ViewCreate::CheckLE(mpLEwidth,"width",true,this) == false)return;
|
|
if(ViewCreate::CheckLE(mpLEwidth,"width",true,this) == false)return;
|
|
width = mpLEwidth->text().toDouble();
|
|
width = mpLEwidth->text().toDouble();
|
|
@@ -223,7 +230,7 @@ void DialogRoadObject::on_comboBox_Object_currentIndexChanged(int index)
|
|
Road * pRoad = mpRoad;
|
|
Road * pRoad = mpRoad;
|
|
if(pRoad == 0)return;
|
|
if(pRoad == 0)return;
|
|
if(index < 0)return;
|
|
if(index < 0)return;
|
|
- if(index >= mpRoad->GetObjectCount())
|
|
|
|
|
|
+ if(index >= (int)mpRoad->GetObjectCount())
|
|
{
|
|
{
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -324,7 +331,7 @@ void DialogRoadObject::on_pushButton_delete_clicked()
|
|
|
|
|
|
int index = ui->comboBox_Object->currentIndex();
|
|
int index = ui->comboBox_Object->currentIndex();
|
|
if(index<0)return;
|
|
if(index<0)return;
|
|
- if(index >= mpRoad->GetObjectCount())return;
|
|
|
|
|
|
+ if(index >= (int)mpRoad->GetObjectCount())return;
|
|
|
|
|
|
pRoad->DeleteObject(index);
|
|
pRoad->DeleteObject(index);
|
|
ui->comboBox_Object->removeItem(index);
|
|
ui->comboBox_Object->removeItem(index);
|
|
@@ -342,7 +349,7 @@ void DialogRoadObject::on_pushButton_change_clicked()
|
|
|
|
|
|
int index = ui->comboBox_Object->currentIndex();
|
|
int index = ui->comboBox_Object->currentIndex();
|
|
if(index<0)return;
|
|
if(index<0)return;
|
|
- if(index >= mpRoad->GetObjectCount())return;
|
|
|
|
|
|
+ if(index >= (int)mpRoad->GetObjectCount())return;
|
|
|
|
|
|
Object * pObject = mpRoad->GetObject(index);
|
|
Object * pObject = mpRoad->GetObject(index);
|
|
if(pObject == 0)
|
|
if(pObject == 0)
|
|
@@ -364,17 +371,17 @@ void DialogRoadObject::on_pushButton_change_clicked()
|
|
double zOffset = mpLEzOffset->text().toDouble();
|
|
double zOffset = mpLEzOffset->text().toDouble();
|
|
|
|
|
|
|
|
|
|
- double length,width,hdg;
|
|
|
|
|
|
+// double length,width,hdg;
|
|
if(mpCBtype->currentText() == "parkingSpace")
|
|
if(mpCBtype->currentText() == "parkingSpace")
|
|
{
|
|
{
|
|
if(ViewCreate::CheckLE(mpLElength,"length",true,this) == false)return;
|
|
if(ViewCreate::CheckLE(mpLElength,"length",true,this) == false)return;
|
|
- length = mpLElength->text().toDouble();
|
|
|
|
|
|
+// length = mpLElength->text().toDouble();
|
|
|
|
|
|
if(ViewCreate::CheckLE(mpLEwidth,"width",true,this) == false)return;
|
|
if(ViewCreate::CheckLE(mpLEwidth,"width",true,this) == false)return;
|
|
- width = mpLEwidth->text().toDouble();
|
|
|
|
|
|
+// width = mpLEwidth->text().toDouble();
|
|
|
|
|
|
if(ViewCreate::CheckLE(mpLEhdg,"hdg",true,this) == false)return;
|
|
if(ViewCreate::CheckLE(mpLEhdg,"hdg",true,this) == false)return;
|
|
- hdg = mpLEhdg->text().toDouble();
|
|
|
|
|
|
+ // hdg = mpLEhdg->text().toDouble();
|
|
}
|
|
}
|
|
|
|
|
|
pObject->Setid(id);
|
|
pObject->Setid(id);
|
|
@@ -459,7 +466,7 @@ void DialogRoadObject::onClickMaterial()
|
|
|
|
|
|
int index = ui->comboBox_Object->currentIndex();
|
|
int index = ui->comboBox_Object->currentIndex();
|
|
if(index<0)return;
|
|
if(index<0)return;
|
|
- if(index >= mpRoad->GetObjectCount())return;
|
|
|
|
|
|
+ if(index >= (int)mpRoad->GetObjectCount())return;
|
|
|
|
|
|
Object * pObject = mpRoad->GetObject(index);
|
|
Object * pObject = mpRoad->GetObject(index);
|
|
if(pObject == 0)
|
|
if(pObject == 0)
|
|
@@ -485,7 +492,7 @@ void DialogRoadObject::onClickRepeat()
|
|
|
|
|
|
int index = ui->comboBox_Object->currentIndex();
|
|
int index = ui->comboBox_Object->currentIndex();
|
|
if(index<0)return;
|
|
if(index<0)return;
|
|
- if(index >= mpRoad->GetObjectCount())return;
|
|
|
|
|
|
+ if(index >= (int)mpRoad->GetObjectCount())return;
|
|
|
|
|
|
Object * pObject = mpRoad->GetObject(index);
|
|
Object * pObject = mpRoad->GetObject(index);
|
|
if(pObject == 0)
|
|
if(pObject == 0)
|
|
@@ -511,7 +518,7 @@ void DialogRoadObject::onClickParkingSpace()
|
|
|
|
|
|
int index = ui->comboBox_Object->currentIndex();
|
|
int index = ui->comboBox_Object->currentIndex();
|
|
if(index<0)return;
|
|
if(index<0)return;
|
|
- if(index >= mpRoad->GetObjectCount())return;
|
|
|
|
|
|
+ if(index >= (int)mpRoad->GetObjectCount())return;
|
|
|
|
|
|
Object * pObject = mpRoad->GetObject(index);
|
|
Object * pObject = mpRoad->GetObject(index);
|
|
if(pObject == 0)
|
|
if(pObject == 0)
|
|
@@ -525,3 +532,29 @@ void DialogRoadObject::onClickParkingSpace()
|
|
dlgparkingspace.exec();
|
|
dlgparkingspace.exec();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void DialogRoadObject::onClickOutlines()
|
|
|
|
+{
|
|
|
|
+ if(mpRoad == 0)return;
|
|
|
|
+ Road * pRoad = mpRoad;
|
|
|
|
+ if(pRoad->GetObjectCount() == 0)
|
|
|
|
+ {
|
|
|
|
+ QMessageBox::warning(this,"Warning","No Object.",QMessageBox::YesAll);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ int index = ui->comboBox_Object->currentIndex();
|
|
|
|
+ if(index<0)return;
|
|
|
|
+ if(index >= (int)mpRoad->GetObjectCount())return;
|
|
|
|
+
|
|
|
|
+ Object * pObject = mpRoad->GetObject(index);
|
|
|
|
+ if(pObject == 0)
|
|
|
|
+ {
|
|
|
|
+ QMessageBox::warning(this,"Warning","Can't found Object.",QMessageBox::YesAll);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ DialogRoadObject_Outlines dlgoutlines(pObject);
|
|
|
|
+
|
|
|
|
+ dlgoutlines.exec();
|
|
|
|
+}
|
|
|
|
+
|