dialogroadobject.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. #include "dialogroadobject.h"
  2. #include "ui_dialogroadobject.h"
  3. #include <QMessageBox>
  4. static std::string strobjecttypelist[] ={"none","obstacle","car","pole",
  5. "tree","vegetation","barrier","building","parkingSpace","patch",
  6. "railing","trafficIsland","crosswalk","streetLamp","gantry",
  7. "soundBarrier","van","bus","trailer","bike","motorbike",
  8. "tram","train","pedestrian","wind","roadMark"};
  9. const static int objectlistcount = 26;
  10. DialogRoadObject::DialogRoadObject(Road * pRoad,QWidget *parent) :
  11. QDialog(parent),
  12. ui(new Ui::DialogRoadObject)
  13. {
  14. ui->setupUi(this);
  15. mpRoad = pRoad;
  16. if(pRoad == 0)
  17. {
  18. ui->pushButton_add->setEnabled(false);
  19. ui->pushButton_change->setEnabled(false);
  20. ui->pushButton_delete->setEnabled(false);
  21. }
  22. else
  23. {
  24. ui->lineEdit_RoadID->setText(pRoad->GetRoadId().data());
  25. ui->lineEdit_RoadLen->setText(QString::number(pRoad->GetRoadLength()));
  26. }
  27. CreateView();
  28. int i;
  29. for(i=0;i<objectlistcount;i++)
  30. {
  31. mpCBtype->addItem(strobjecttypelist[i].data());
  32. }
  33. mpCBtype->setCurrentIndex(8);
  34. mpCBdynamic->addItem("no");
  35. mpCBdynamic->addItem("yes");
  36. mpCBdynamic->addItem("undefined");
  37. mpCBdynamic->setCurrentIndex(2);
  38. mpCBorientation->addItem("+");
  39. mpCBorientation->addItem("-");
  40. mpCBorientation->addItem("none");
  41. mpCBorientation->addItem("undefined");
  42. mpCBorientation->setCurrentIndex(3);
  43. if(pRoad != 0)
  44. {
  45. int nobjectcount = pRoad->GetObjectCount();
  46. for(i=0;i<nobjectcount;i++)
  47. {
  48. Object * pObject = pRoad->GetObject(i);
  49. ui->comboBox_Object->addItem("Object s:"+QString::number(pObject->Gets()));
  50. }
  51. }
  52. setWindowTitle("Edit Road Object");
  53. }
  54. DialogRoadObject::~DialogRoadObject()
  55. {
  56. delete ui;
  57. }
  58. void DialogRoadObject::CreateView()
  59. {
  60. int startpos_x = 30;
  61. int startpos_y = 150;
  62. int nSpace = 300;
  63. int nLabelWidth = 100;
  64. int nLEWidth = 150;
  65. int nHeight = 30;
  66. int nVSpace = 50;
  67. int nVIndex = 0;
  68. mpLEt = ViewCreate::CreateLE(startpos_x+0*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"t",this);
  69. mpLEzOffset = ViewCreate::CreateLE(startpos_x+1*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"zOffset",this);
  70. mpCBtype = ViewCreate::CreateCB(startpos_x+2*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"type",this);
  71. nVIndex++;
  72. mpLEvalidLength = ViewCreate::CreateLE(startpos_x+0*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"validLength",this);
  73. mpCBorientation = ViewCreate::CreateCB(startpos_x+1*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"orientation",this);
  74. mpLEsubtype = ViewCreate::CreateLE(startpos_x+2*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"subtype",this);
  75. nVIndex++;
  76. mpCBdynamic = ViewCreate::CreateCB(startpos_x+0*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"dynamic",this);
  77. mpLEhdg = ViewCreate::CreateLE(startpos_x+1*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"hdg",this);
  78. mpLEname = ViewCreate::CreateLE(startpos_x+2*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"name",this);
  79. nVIndex++;
  80. mpLEpitch = ViewCreate::CreateLE(startpos_x+0*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"pitch",this);
  81. mpLEid = ViewCreate::CreateLE(startpos_x+1*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"id",this);
  82. mpLEroll = ViewCreate::CreateLE(startpos_x+2*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"roll",this);
  83. nVIndex++;
  84. mpLEheight = ViewCreate::CreateLE(startpos_x+0*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"height",this);
  85. mpLEs = ViewCreate::CreateLE(startpos_x+1*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"s",this);
  86. mpLElength = ViewCreate::CreateLE(startpos_x+2*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"length",this);
  87. nVIndex++;
  88. mpLEwidth = ViewCreate::CreateLE(startpos_x+0*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"width",this);
  89. mpLEradius = ViewCreate::CreateLE(startpos_x+1*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"radius",this);
  90. int nPBSpace = 200;
  91. int nPBWidth = 150;
  92. nVIndex++;
  93. mpPBmaterial = ViewCreate::CreatePB(startpos_x+0*nPBSpace,startpos_y+nVIndex*nVSpace,nPBWidth,nHeight,"material",this);
  94. mpPBrepeat = ViewCreate::CreatePB(startpos_x+1*nPBSpace,startpos_y+nVIndex*nVSpace,nPBWidth,nHeight,"repeat",this);
  95. mpPBparkingspace = ViewCreate::CreatePB(startpos_x+2*nPBSpace,startpos_y+nVIndex*nVSpace,nPBWidth,nHeight,"parkingspace",this);
  96. mpPBoutlines = ViewCreate::CreatePB(startpos_x+3*nPBSpace,startpos_y+nVIndex*nVSpace,nPBWidth,nHeight,"outlines",this);
  97. nVIndex++;
  98. mpPBoutline = ViewCreate::CreatePB(startpos_x+0*nPBSpace,startpos_y+nVIndex*nVSpace,nPBWidth,nHeight,"outline",this);
  99. mpPBmarkings = ViewCreate::CreatePB(startpos_x+1*nPBSpace,startpos_y+nVIndex*nVSpace,nPBWidth,nHeight,"markings",this);
  100. mpPBborders = ViewCreate::CreatePB(startpos_x+2*nPBSpace,startpos_y+nVIndex*nVSpace,nPBWidth,nHeight,"borders",this);
  101. mpPBvalidity = ViewCreate::CreatePB(startpos_x+3*nPBSpace,startpos_y+nVIndex*nVSpace,nPBWidth,nHeight,"validity",this);
  102. connect(mpPBmaterial,SIGNAL(clicked(bool)),this,SLOT(onClickMaterial()));
  103. connect(mpPBrepeat,SIGNAL(clicked(bool)),this,SLOT(onClickRepeat()));
  104. connect(mpPBparkingspace,SIGNAL(clicked(bool)),this,SLOT(onClickParkingSpace()));
  105. connect(mpPBoutlines,SIGNAL(clicked(bool)),this,SLOT(onClickOutlines()));
  106. connect(mpPBoutline,SIGNAL(clicked(bool)),this,SLOT(onClickOutline()));
  107. }
  108. void DialogRoadObject::on_pushButton_add_clicked()
  109. {
  110. Road * pRoad = mpRoad;
  111. if(pRoad == 0)return;
  112. if(ViewCreate::CheckLE(mpLEid,"id",true,this) == false)return;
  113. string id = mpLEid->text().toStdString();
  114. if(ViewCreate::CheckLE(mpLEt,"t",true,this) == false)return;
  115. double t = mpLEt->text().toDouble();
  116. if(ViewCreate::CheckLE(mpLEs,"s",true,this) == false)return;
  117. double s = mpLEs->text().toDouble();
  118. if(ViewCreate::CheckLE(mpLEzOffset,"zOffset",true,this) == false)return;
  119. double zOffset = mpLEzOffset->text().toDouble();
  120. double length,width,hdg;
  121. if(mpCBtype->currentText() == "parkingSpace")
  122. {
  123. if(ViewCreate::CheckLE(mpLElength,"length",true,this) == false)return;
  124. // length = mpLElength->text().toDouble();
  125. if(ViewCreate::CheckLE(mpLEwidth,"width",true,this) == false)return;
  126. width = mpLEwidth->text().toDouble();
  127. if(ViewCreate::CheckLE(mpLEhdg,"hdg",true,this) == false)return;
  128. hdg = mpLEhdg->text().toDouble();
  129. }
  130. pRoad->AddObject(id,s,t,zOffset);
  131. Object * pObject = pRoad->GetLastAddedObject();
  132. pObject->Settype(mpCBtype->currentText().toStdString());
  133. if(ViewCreate::CheckLE(mpLEvalidLength,"validLength",false,this))
  134. {
  135. pObject->SetvalidLength(mpLEvalidLength->text().toDouble());
  136. }
  137. if(mpCBorientation->currentIndex() != 3)
  138. {
  139. pObject->Setorientation(mpCBorientation->currentText().toStdString());
  140. }
  141. if(ViewCreate::CheckLE(mpLEsubtype,"subtype",false,this))
  142. {
  143. pObject->Setsubtype(mpLEsubtype->text().toStdString());
  144. }
  145. if(mpCBdynamic->currentIndex()!= 2)
  146. {
  147. pObject->Setdynamic(mpCBdynamic->currentText().toStdString());
  148. }
  149. if(ViewCreate::CheckLE(mpLEname,"name",false,this))
  150. {
  151. pObject->Setname(mpLEname->text().toStdString());
  152. }
  153. if(ViewCreate::CheckLE(mpLEhdg,"hdg",false,this))
  154. {
  155. pObject->Sethdg(mpLEhdg->text().toDouble());
  156. }
  157. if(ViewCreate::CheckLE(mpLEpitch,"pitch",false,this))
  158. {
  159. pObject->Setpitch(mpLEpitch->text().toDouble());
  160. }
  161. if(ViewCreate::CheckLE(mpLEroll,"roll",false,this))
  162. {
  163. pObject->Setroll(mpLEroll->text().toDouble());
  164. }
  165. if(ViewCreate::CheckLE(mpLEheight,"height",false,this))
  166. {
  167. pObject->Setheight(mpLEheight->text().toDouble());
  168. }
  169. if(ViewCreate::CheckLE(mpLElength,"length",false,this))
  170. {
  171. pObject->Setlength(mpLElength->text().toDouble());
  172. }
  173. if(ViewCreate::CheckLE(mpLEwidth,"width",false,this))
  174. {
  175. pObject->Setwidth(mpLEwidth->text().toDouble());
  176. }
  177. if(ViewCreate::CheckLE(mpLEradius,"radius",false,this))
  178. {
  179. pObject->Setradius(mpLEradius->text().toDouble());
  180. }
  181. ui->comboBox_Object->addItem("Object s:"+QString::number(pObject->Gets()));
  182. }
  183. void DialogRoadObject::on_comboBox_Object_currentIndexChanged(int index)
  184. {
  185. Road * pRoad = mpRoad;
  186. if(pRoad == 0)return;
  187. if(index < 0)return;
  188. if(index >= (int)mpRoad->GetObjectCount())
  189. {
  190. return;
  191. }
  192. Object * pObject = mpRoad->GetObject(index);
  193. if(pObject == 0)return;
  194. mpLEt->setText(QString::number(pObject->Gett()));
  195. mpLEzOffset->setText(QString::number(pObject->GetzOffset()));
  196. string type = pObject->Gettype();
  197. int i;
  198. for(i=0;i<objectlistcount;i++)
  199. {
  200. if(strobjecttypelist[i] == type)break;
  201. }
  202. if(i<objectlistcount)mpCBtype->setCurrentIndex(i);
  203. double validLength;
  204. if(pObject->GetvalidLength(validLength) == 1)
  205. {
  206. mpLEvalidLength->setText(QString::number(validLength));
  207. }
  208. else
  209. mpLEvalidLength->setText("");
  210. string strorientation = pObject->Getorientation();
  211. if(strorientation == "")
  212. {
  213. mpCBorientation->setCurrentIndex(3);
  214. }
  215. else
  216. {
  217. if(strorientation == "+")mpCBorientation->setCurrentIndex(0);
  218. else
  219. {
  220. if(strorientation == "-")mpCBorientation->setCurrentIndex(1);
  221. else mpCBorientation->setCurrentIndex(2);
  222. }
  223. }
  224. string strtype = pObject->Getsubtype();
  225. if(strtype != "")pObject->Setsubtype(strtype);
  226. string strdynamic = pObject->Getdynamic();
  227. if(strdynamic == "")
  228. {
  229. mpCBdynamic->setCurrentIndex(2);
  230. }
  231. else
  232. {
  233. if(strdynamic == "no")mpCBdynamic->setCurrentIndex(0);
  234. else mpCBdynamic->setCurrentIndex(1);
  235. }
  236. double hdg;
  237. if(pObject->Gethdg(hdg) == 1)mpLEhdg->setText(QString::number(hdg));
  238. else mpLEhdg->setText("");
  239. mpLEname->setText(pObject->Getname().data());
  240. double pitch;
  241. if(pObject->Getpitch(pitch) == 1)mpLEpitch->setText(QString::number(pitch));
  242. else mpLEpitch->setText("");
  243. mpLEid->setText(pObject->Getid().data());
  244. double roll;
  245. if(pObject->Getroll(roll) == 1)mpLEroll->setText(QString::number(roll));
  246. else mpLEroll->setText("");
  247. double height;
  248. if(pObject->Getheight(height) == 1)mpLEheight->setText(QString::number(height));
  249. else mpLEheight->setText("");
  250. mpLEs->setText(QString::number(pObject->Gets()));
  251. double length;
  252. if(pObject->Getlength(length) == 1)mpLElength->setText(QString::number(length));
  253. else mpLElength->setText("");
  254. double width;
  255. if(pObject->Getwidth(width) == 1)mpLEwidth->setText(QString::number(width));
  256. else mpLEwidth->setText("");
  257. double radius;
  258. if(pObject->Getradius(radius) == 1)mpLEradius->setText(QString::number(radius));
  259. else mpLEradius->setText("");
  260. }
  261. void DialogRoadObject::on_pushButton_delete_clicked()
  262. {
  263. if(mpRoad == 0)return;
  264. Road * pRoad = mpRoad;
  265. if(pRoad->GetObjectCount() == 0)
  266. {
  267. QMessageBox::warning(this,"Warning","No Object.",QMessageBox::YesAll);
  268. return;
  269. }
  270. int index = ui->comboBox_Object->currentIndex();
  271. if(index<0)return;
  272. if(index >= (int)mpRoad->GetObjectCount())return;
  273. pRoad->DeleteObject(index);
  274. ui->comboBox_Object->removeItem(index);
  275. }
  276. void DialogRoadObject::on_pushButton_change_clicked()
  277. {
  278. if(mpRoad == 0)return;
  279. Road * pRoad = mpRoad;
  280. if(pRoad->GetObjectCount() == 0)
  281. {
  282. QMessageBox::warning(this,"Warning","No Object.",QMessageBox::YesAll);
  283. return;
  284. }
  285. int index = ui->comboBox_Object->currentIndex();
  286. if(index<0)return;
  287. if(index >= (int)mpRoad->GetObjectCount())return;
  288. Object * pObject = mpRoad->GetObject(index);
  289. if(pObject == 0)
  290. {
  291. QMessageBox::warning(this,"Warning","Can't found Object.",QMessageBox::YesAll);
  292. return;
  293. }
  294. if(ViewCreate::CheckLE(mpLEid,"id",true,this) == false)return;
  295. string id = mpLEid->text().toStdString();
  296. if(ViewCreate::CheckLE(mpLEt,"t",true,this) == false)return;
  297. double t = mpLEt->text().toDouble();
  298. if(ViewCreate::CheckLE(mpLEs,"s",true,this) == false)return;
  299. double s = mpLEs->text().toDouble();
  300. if(ViewCreate::CheckLE(mpLEzOffset,"zOffset",true,this) == false)return;
  301. double zOffset = mpLEzOffset->text().toDouble();
  302. // double length,width,hdg;
  303. if(mpCBtype->currentText() == "parkingSpace")
  304. {
  305. if(ViewCreate::CheckLE(mpLElength,"length",true,this) == false)return;
  306. // length = mpLElength->text().toDouble();
  307. if(ViewCreate::CheckLE(mpLEwidth,"width",true,this) == false)return;
  308. // width = mpLEwidth->text().toDouble();
  309. if(ViewCreate::CheckLE(mpLEhdg,"hdg",true,this) == false)return;
  310. // hdg = mpLEhdg->text().toDouble();
  311. }
  312. pObject->Setid(id);
  313. pObject->Sets(s);
  314. pObject->Sett(t);
  315. pObject->SetzOffset(zOffset);
  316. pObject->Settype(mpCBtype->currentText().toStdString());
  317. if(ViewCreate::CheckLE(mpLEvalidLength,"validLength",false,this))
  318. {
  319. pObject->SetvalidLength(mpLEvalidLength->text().toDouble());
  320. }
  321. if(mpCBorientation->currentIndex() != 3)
  322. {
  323. pObject->Setorientation(mpCBorientation->currentText().toStdString());
  324. }
  325. if(ViewCreate::CheckLE(mpLEsubtype,"subtype",false,this))
  326. {
  327. pObject->Setsubtype(mpLEsubtype->text().toStdString());
  328. }
  329. if(mpCBdynamic->currentIndex()!= 2)
  330. {
  331. pObject->Setdynamic(mpCBdynamic->currentText().toStdString());
  332. }
  333. if(ViewCreate::CheckLE(mpLEhdg,"hdg",false,this))
  334. {
  335. pObject->Sethdg(mpLEhdg->text().toDouble());
  336. }
  337. if(ViewCreate::CheckLE(mpLEname,"name",false,this))
  338. {
  339. pObject->Setname(mpLEname->text().toStdString());
  340. }
  341. if(ViewCreate::CheckLE(mpLEpitch,"pitch",false,this))
  342. {
  343. pObject->Setpitch(mpLEpitch->text().toDouble());
  344. }
  345. if(ViewCreate::CheckLE(mpLEroll,"roll",false,this))
  346. {
  347. pObject->Setroll(mpLEroll->text().toDouble());
  348. }
  349. if(ViewCreate::CheckLE(mpLEheight,"height",false,this))
  350. {
  351. pObject->Setheight(mpLEheight->text().toDouble());
  352. }
  353. if(ViewCreate::CheckLE(mpLElength,"length",false,this))
  354. {
  355. pObject->Setlength(mpLElength->text().toDouble());
  356. }
  357. if(ViewCreate::CheckLE(mpLEwidth,"width",false,this))
  358. {
  359. pObject->Setwidth(mpLEwidth->text().toDouble());
  360. }
  361. if(ViewCreate::CheckLE(mpLEradius,"radius",false,this))
  362. {
  363. pObject->Setradius(mpLEradius->text().toDouble());
  364. }
  365. QMessageBox::information(this,"Info","Change Object Successfull.",QMessageBox::YesAll);
  366. }
  367. void DialogRoadObject::onClickMaterial()
  368. {
  369. if(mpRoad == 0)return;
  370. Road * pRoad = mpRoad;
  371. if(pRoad->GetObjectCount() == 0)
  372. {
  373. QMessageBox::warning(this,"Warning","No Object.",QMessageBox::YesAll);
  374. return;
  375. }
  376. int index = ui->comboBox_Object->currentIndex();
  377. if(index<0)return;
  378. if(index >= (int)mpRoad->GetObjectCount())return;
  379. Object * pObject = mpRoad->GetObject(index);
  380. if(pObject == 0)
  381. {
  382. QMessageBox::warning(this,"Warning","Can't found Object.",QMessageBox::YesAll);
  383. return;
  384. }
  385. DialogRoadObject_material dlgmaterail(pObject);
  386. dlgmaterail.exec();
  387. }
  388. void DialogRoadObject::onClickRepeat()
  389. {
  390. if(mpRoad == 0)return;
  391. Road * pRoad = mpRoad;
  392. if(pRoad->GetObjectCount() == 0)
  393. {
  394. QMessageBox::warning(this,"Warning","No Object.",QMessageBox::YesAll);
  395. return;
  396. }
  397. int index = ui->comboBox_Object->currentIndex();
  398. if(index<0)return;
  399. if(index >= (int)mpRoad->GetObjectCount())return;
  400. Object * pObject = mpRoad->GetObject(index);
  401. if(pObject == 0)
  402. {
  403. QMessageBox::warning(this,"Warning","Can't found Object.",QMessageBox::YesAll);
  404. return;
  405. }
  406. DialogRoadObject_repeat dlgrepeat(pObject);
  407. dlgrepeat.exec();
  408. }
  409. void DialogRoadObject::onClickParkingSpace()
  410. {
  411. if(mpRoad == 0)return;
  412. Road * pRoad = mpRoad;
  413. if(pRoad->GetObjectCount() == 0)
  414. {
  415. QMessageBox::warning(this,"Warning","No Object.",QMessageBox::YesAll);
  416. return;
  417. }
  418. int index = ui->comboBox_Object->currentIndex();
  419. if(index<0)return;
  420. if(index >= (int)mpRoad->GetObjectCount())return;
  421. Object * pObject = mpRoad->GetObject(index);
  422. if(pObject == 0)
  423. {
  424. QMessageBox::warning(this,"Warning","Can't found Object.",QMessageBox::YesAll);
  425. return;
  426. }
  427. DialogRoadObject_parkingSpace dlgparkingspace(pObject);
  428. dlgparkingspace.exec();
  429. }
  430. void DialogRoadObject::onClickOutlines()
  431. {
  432. if(mpRoad == 0)return;
  433. Road * pRoad = mpRoad;
  434. if(pRoad->GetObjectCount() == 0)
  435. {
  436. QMessageBox::warning(this,"Warning","No Object.",QMessageBox::YesAll);
  437. return;
  438. }
  439. int index = ui->comboBox_Object->currentIndex();
  440. if(index<0)return;
  441. if(index >= (int)mpRoad->GetObjectCount())return;
  442. Object * pObject = mpRoad->GetObject(index);
  443. if(pObject == 0)
  444. {
  445. QMessageBox::warning(this,"Warning","Can't found Object.",QMessageBox::YesAll);
  446. return;
  447. }
  448. DialogRoadObject_Outlines dlgoutlines(pObject);
  449. dlgoutlines.exec();
  450. }
  451. void DialogRoadObject::onClickOutline()
  452. {
  453. if(mpRoad == 0)return;
  454. Road * pRoad = mpRoad;
  455. if(pRoad->GetObjectCount() == 0)
  456. {
  457. QMessageBox::warning(this,"Warning","No Object.",QMessageBox::YesAll);
  458. return;
  459. }
  460. int index = ui->comboBox_Object->currentIndex();
  461. if(index<0)return;
  462. if(index >= (int)mpRoad->GetObjectCount())return;
  463. Object * pObject = mpRoad->GetObject(index);
  464. if(pObject == 0)
  465. {
  466. QMessageBox::warning(this,"Warning","Can't found Object.",QMessageBox::YesAll);
  467. return;
  468. }
  469. DialogRoadObject_outline dlgoutline(pObject);
  470. dlgoutline.exec();
  471. }