|
@@ -0,0 +1,190 @@
|
|
|
+#include "dialogroadobject_outlines.h"
|
|
|
+#include "ui_dialogroadobject_outlines.h"
|
|
|
+
|
|
|
+static std::string gstr_e_outlineFillType[] ={"grass","concrete","cobble","asphalt",
|
|
|
+ "pavement","gravel","soil"};
|
|
|
+
|
|
|
+static const int goutlineFillTypeCount = 7;
|
|
|
+
|
|
|
+static std::string gstr_e_laneType[] = {"shoulder","border","driving","stop","none",
|
|
|
+ "restricted","parking","median","biking","sidewalk",
|
|
|
+ "curb","exit","entry","onRamp","offRamp",
|
|
|
+ "connectingRamp","bidirectional","special1","special2","special3",
|
|
|
+ "roadWorks","tram","rail","bus","taxi",
|
|
|
+ "HOV","mwyEntry","mwyExit"};
|
|
|
+
|
|
|
+static const int glaneTypeCount = 33;
|
|
|
+
|
|
|
+DialogRoadObject_Outlines::DialogRoadObject_Outlines(Object * pObject,QWidget *parent) :
|
|
|
+ QDialog(parent),
|
|
|
+ ui(new Ui::DialogRoadObject_Outlines)
|
|
|
+{
|
|
|
+ ui->setupUi(this);
|
|
|
+
|
|
|
+ mpObject = pObject;
|
|
|
+
|
|
|
+ CreateView();
|
|
|
+
|
|
|
+ int i;
|
|
|
+ for(i=0;i<goutlineFillTypeCount;i++)
|
|
|
+ {
|
|
|
+ mpCBfillType->addItem(gstr_e_outlineFillType[i].data());
|
|
|
+ }
|
|
|
+
|
|
|
+ for(i=0;i<glaneTypeCount;i++)
|
|
|
+ {
|
|
|
+ mpCBlaneType->addItem(gstr_e_laneType[i].data());
|
|
|
+ }
|
|
|
+
|
|
|
+ mpCBouter->addItem("true");
|
|
|
+ mpCBouter->addItem("false");
|
|
|
+
|
|
|
+ mpCBclosed->addItem("true");
|
|
|
+ mpCBclosed->addItem("false");
|
|
|
+
|
|
|
+ setWindowTitle("Edit Road Object Outlines");
|
|
|
+}
|
|
|
+
|
|
|
+DialogRoadObject_Outlines::~DialogRoadObject_Outlines()
|
|
|
+{
|
|
|
+ delete ui;
|
|
|
+}
|
|
|
+
|
|
|
+void DialogRoadObject_Outlines::CreateView()
|
|
|
+{
|
|
|
+ int startpos_x = 30;
|
|
|
+ int startpos_y = 30;
|
|
|
+ int nSpace = 260;
|
|
|
+ int nLabelWidth = 80;
|
|
|
+ int nLEWidth = 150;
|
|
|
+ int nHeight = 35;
|
|
|
+ int nVSpace = 60;
|
|
|
+ int nVIndex = 0;
|
|
|
+
|
|
|
+ mpLEstatus = ViewCreate::CreateLE(startpos_x+0*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"status",this);
|
|
|
+ nVIndex++;
|
|
|
+
|
|
|
+ mpLEid = ViewCreate::CreateLE(startpos_x+0*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"id",this);
|
|
|
+ mpCBfillType = ViewCreate::CreateCB(startpos_x+1*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"fillType",this);
|
|
|
+
|
|
|
+ nVIndex++;
|
|
|
+ mpCBouter = ViewCreate::CreateCB(startpos_x+0*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"outer",this);
|
|
|
+ mpCBclosed = ViewCreate::CreateCB(startpos_x+1*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"closed",this);
|
|
|
+
|
|
|
+ nVIndex++;
|
|
|
+ mpCBlaneType = ViewCreate::CreateCB(startpos_x+0*nSpace,startpos_y+nVIndex*nVSpace,nLabelWidth,nLEWidth,nHeight,"laneType",this);
|
|
|
+
|
|
|
+ nVIndex++;
|
|
|
+ int nPBSpace = 150;
|
|
|
+ int nPBWidth = 100;
|
|
|
+ mpPBSet = ViewCreate::CreatePB(startpos_x+0*nPBSpace,startpos_y+nVIndex*nVSpace,nPBWidth,nHeight,"Set",this);
|
|
|
+ mpPBReset = ViewCreate::CreatePB(startpos_x+1*nPBSpace,startpos_y+nVIndex*nVSpace,nPBWidth,nHeight,"Reset",this);
|
|
|
+ mpPBChange = ViewCreate::CreatePB(startpos_x+2*nPBSpace,startpos_y+nVIndex*nVSpace,nPBWidth,nHeight,"Change",this);
|
|
|
+
|
|
|
+ connect(mpPBSet,SIGNAL(clicked(bool)),this,SLOT(onClickSet()));
|
|
|
+ connect(mpPBReset,SIGNAL(clicked(bool)),this,SLOT(onClickReset()));
|
|
|
+ connect(mpPBChange,SIGNAL(clicked(bool)),this,SLOT(onClickChange()));
|
|
|
+}
|
|
|
+
|
|
|
+void DialogRoadObject_Outlines::onClickSet()
|
|
|
+{
|
|
|
+ Object_outlines xoutlines;
|
|
|
+
|
|
|
+ Object * pObject = mpObject;
|
|
|
+
|
|
|
+ if(mpObject == 0)return;
|
|
|
+
|
|
|
+ Object_outlines_outline xoutline;
|
|
|
+
|
|
|
+ if(ViewCreate::CheckLE(mpLEid,"id",false,this) == true)
|
|
|
+ {
|
|
|
+ int id = mpLEid->text().toInt();
|
|
|
+ xoutline.Setid(id);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ xoutline.SetlaneType(mpCBlaneType->currentText().toStdString());
|
|
|
+
|
|
|
+ xoutlines.SetObject_outlines_outline(xoutline);
|
|
|
+
|
|
|
+ pObject->Setoutlines(xoutlines);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void DialogRoadObject_Outlines::onClickReset()
|
|
|
+{
|
|
|
+ if(mpObject == 0)return;
|
|
|
+
|
|
|
+ Object * pObject = mpObject;
|
|
|
+
|
|
|
+ pObject->Resetoutlines();
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void DialogRoadObject_Outlines::onClickChange()
|
|
|
+{
|
|
|
+ onClickSet();
|
|
|
+ QMessageBox::information(this,"Info","Change outlines succefully.",QMessageBox::YesAll);
|
|
|
+}
|
|
|
+
|
|
|
+void DialogRoadObject_Outlines::UpdateStatus()
|
|
|
+{
|
|
|
+ if(mpObject == 0)return;
|
|
|
+ Object * pObject = mpObject;
|
|
|
+
|
|
|
+ Object_outlines * pObject_outlines = pObject->Getoutlines();
|
|
|
+ if(pObject_outlines == NULL)
|
|
|
+ {
|
|
|
+ mpLEid->setText("");
|
|
|
+ mpLEstatus->setText("NO outlines");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ mpLEstatus->setText("HAVE outlines");
|
|
|
+ Object_outlines_outline xoutline;
|
|
|
+ if(pObject_outlines->GetObject_outlines_outline(xoutline) == 1)
|
|
|
+ {
|
|
|
+ int id;
|
|
|
+ if(xoutline.Getid(id) == 1)
|
|
|
+ {
|
|
|
+ mpLEid->setText(QString::number(id));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ mpLEid->setText("");
|
|
|
+ }
|
|
|
+ std::string strfillType;
|
|
|
+ if(xoutline.GetfillType(strfillType) == 1)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|