|
@@ -54,7 +54,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
|
|
|
|
|
scene = new QGraphicsScene;
|
|
scene = new QGraphicsScene;
|
|
|
|
|
|
- mpscene = new QGraphicsScene;//(-300, -300, 600, 600);
|
|
|
|
|
|
+// mpscene = new QGraphicsScene;//(-300, -300, 600, 600);
|
|
|
|
+ mpscene = new QGraphicsScene(0,0,VIEW_WIDTH,VIEW_HEIGHT);
|
|
mpscene->setBackgroundBrush(Qt::darkGreen);
|
|
mpscene->setBackgroundBrush(Qt::darkGreen);
|
|
|
|
|
|
|
|
|
|
@@ -377,7 +378,7 @@ void MainWindow::paintEvent(QPaintEvent *)
|
|
{
|
|
{
|
|
if(mbRefresh)
|
|
if(mbRefresh)
|
|
{
|
|
{
|
|
- UpdateScene();
|
|
|
|
|
|
+ // UpdateScene();
|
|
}
|
|
}
|
|
myview->setScene(mpscene);
|
|
myview->setScene(mpscene);
|
|
myview->show();
|
|
myview->show();
|
|
@@ -1196,8 +1197,11 @@ void MainWindow::onClickXY(double x, double y)
|
|
double lon,lat;
|
|
double lon,lat;
|
|
selx = mClickX;
|
|
selx = mClickX;
|
|
sely = mClickY * (-1);
|
|
sely = mClickY * (-1);
|
|
- selx = selx/((double )mnfac);
|
|
|
|
- sely = sely/((double)mnfac);
|
|
|
|
|
|
+ if(mnViewMode == 0)
|
|
|
|
+ {
|
|
|
|
+ selx = selx/((double )mnfac);
|
|
|
|
+ sely = sely/((double)mnfac);
|
|
|
|
+ }
|
|
mpLE_SelX->setText(QString::number(selx,'f',3));
|
|
mpLE_SelX->setText(QString::number(selx,'f',3));
|
|
mpLE_SelY->setText(QString::number(sely,'f',3));
|
|
mpLE_SelY->setText(QString::number(sely,'f',3));
|
|
|
|
|
|
@@ -5082,7 +5086,7 @@ void MainWindow::UpdateScene()
|
|
|
|
|
|
void MainWindow::UpdateSceneRoad(Road *pRoad)
|
|
void MainWindow::UpdateSceneRoad(Road *pRoad)
|
|
{
|
|
{
|
|
- RoadDigit xrd(pRoad,0.5);
|
|
|
|
|
|
+ RoadDigit xrd(pRoad,3.0);
|
|
std::vector<iv::RoadDigitUnit> * pvectorrdu = xrd.GetRDU();
|
|
std::vector<iv::RoadDigitUnit> * pvectorrdu = xrd.GetRDU();
|
|
int nsize = pvectorrdu->size();
|
|
int nsize = pvectorrdu->size();
|
|
int i;
|
|
int i;
|
|
@@ -5106,7 +5110,7 @@ void MainWindow::UpdateSceneRoad(Road *pRoad)
|
|
xpath.closeSubpath();
|
|
xpath.closeSubpath();
|
|
QGraphicsPathItem * pitem = new QGraphicsPathItem;
|
|
QGraphicsPathItem * pitem = new QGraphicsPathItem;
|
|
pitem->setPath(xpath);
|
|
pitem->setPath(xpath);
|
|
- pitem->setPos(mfViewMoveX,mfViewMoveY);
|
|
|
|
|
|
+ pitem->setPos(mfViewMoveX +VIEW_WIDTH/2,-mfViewMoveY+VIEW_HEIGHT/2);
|
|
int nlanetype = xvepre.at(k).mnlanetype;
|
|
int nlanetype = xvepre.at(k).mnlanetype;
|
|
if(xvepre.at(k).mnlane<=0)nlanetype = xvepre.at(k+1).mnlanetype;
|
|
if(xvepre.at(k).mnlane<=0)nlanetype = xvepre.at(k+1).mnlanetype;
|
|
QColor brushcolor = Qt::darkGray;
|
|
QColor brushcolor = Qt::darkGray;
|
|
@@ -5231,7 +5235,7 @@ void MainWindow::UpdateSceneRoad(Road *pRoad)
|
|
}
|
|
}
|
|
pitem->setBrush(brushcolor);
|
|
pitem->setBrush(brushcolor);
|
|
pitem->setPen(QPen(brushcolor,0.001));
|
|
pitem->setPen(QPen(brushcolor,0.001));
|
|
- pitem->setPos(mfViewMoveX,mfViewMoveY);
|
|
|
|
|
|
+ pitem->setPos(mfViewMoveX + VIEW_WIDTH/2,-mfViewMoveY +VIEW_HEIGHT/2);
|
|
mpscene->addItem(pitem);
|
|
mpscene->addItem(pitem);
|
|
mvectorviewitem.push_back(pitem);
|
|
mvectorviewitem.push_back(pitem);
|
|
}
|
|
}
|
|
@@ -5250,6 +5254,10 @@ void MainWindow::UpdateSceneRoad(Road *pRoad)
|
|
|
|
|
|
void MainWindow::onViewModeChange(int index)
|
|
void MainWindow::onViewModeChange(int index)
|
|
{
|
|
{
|
|
|
|
+ if(index == 1)
|
|
|
|
+ {
|
|
|
|
+ UpdateScene();
|
|
|
|
+ }
|
|
mnViewMode = index;
|
|
mnViewMode = index;
|
|
mbRefresh = true;
|
|
mbRefresh = true;
|
|
update();
|
|
update();
|