|
@@ -244,237 +244,239 @@ void MainWindow::AdjustWPos(QSize sizemain)
|
|
|
|
|
|
void MainWindow::ExecPainter()
|
|
|
{
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
QTime x;
|
|
|
x.start();
|
|
|
// qDebug("painter.");
|
|
|
-
|
|
|
- painter->begin(image);
|
|
|
- qDebug("time is %d",x.elapsed());
|
|
|
- image->fill(QColor(255, 255, 255));//对画布进行填充
|
|
|
-
|
|
|
+
|
|
|
+ painter->begin(image);
|
|
|
+ qDebug("time is %d",x.elapsed());
|
|
|
+ image->fill(QColor(255, 255, 255));//对画布进行填充
|
|
|
+
|
|
|
// std::vector<iv::GPSData> navigation_data = brain->navigation_data;
|
|
|
- painter->setRenderHint(QPainter::Antialiasing, true);//设置反锯齿模式,好看一点
|
|
|
-
|
|
|
- painter->translate(mnMoveX,mnMoveY);
|
|
|
-
|
|
|
-
|
|
|
- painter->setPen(Qt::black);
|
|
|
-
|
|
|
- painter->drawLine(VIEW_WIDTH/(-2),0,VIEW_WIDTH/2,0);
|
|
|
- painter->drawLine(0,VIEW_HEIGHT/(-2),0,VIEW_HEIGHT/2);
|
|
|
-
|
|
|
- int i;
|
|
|
-
|
|
|
-
|
|
|
- // int nfac = 5;;
|
|
|
-
|
|
|
-
|
|
|
- painter->setPen(Qt::blue);
|
|
|
- int nfac = mnfac;
|
|
|
- for(i=0;i<mxodr.GetRoadCount();i++)
|
|
|
+ painter->setRenderHint(QPainter::Antialiasing, true);//设置反锯齿模式,好看一点
|
|
|
+
|
|
|
+ painter->translate(mnMoveX,mnMoveY);
|
|
|
+
|
|
|
+
|
|
|
+ painter->setPen(Qt::black);
|
|
|
+
|
|
|
+ painter->drawLine(VIEW_WIDTH/(-2),0,VIEW_WIDTH/2,0);
|
|
|
+ painter->drawLine(0,VIEW_HEIGHT/(-2),0,VIEW_HEIGHT/2);
|
|
|
+
|
|
|
+ int i;
|
|
|
+
|
|
|
+
|
|
|
+ // int nfac = 5;;
|
|
|
+
|
|
|
+
|
|
|
+ painter->setPen(Qt::blue);
|
|
|
+ int nfac = mnfac;
|
|
|
+ for(i=0;i<mxodr.GetRoadCount();i++)
|
|
|
+ {
|
|
|
+ int j;
|
|
|
+ Road * pRoad = mxodr.GetRoad(i);
|
|
|
+ for(j=0;j<mxodr.GetRoad(i)->GetGeometryBlockCount();j++)
|
|
|
{
|
|
|
- int j;
|
|
|
- Road * pRoad = mxodr.GetRoad(i);
|
|
|
- for(j=0;j<mxodr.GetRoad(i)->GetGeometryBlockCount();j++)
|
|
|
+ GeometryBlock * pgeob = pRoad->GetGeometryBlock(j);
|
|
|
+ double x,y;
|
|
|
+ double x_center,y_center;
|
|
|
+ double R;
|
|
|
+ RoadGeometry * pg;
|
|
|
+ GeometryArc * parc;
|
|
|
+ GeometryParamPoly3 * ppp3;
|
|
|
+ GeometrySpiral *pSpiral;
|
|
|
+ GeometryPoly3 *ppoly;
|
|
|
+ double rel_x,rel_y,rel_hdg;
|
|
|
+ pg = pgeob->GetGeometryAt(0);
|
|
|
+
|
|
|
+ x = pg->GetX();
|
|
|
+ y = pg->GetY();
|
|
|
+
|
|
|
+ switch (pg->GetGeomType()) {
|
|
|
+ case 0:
|
|
|
+ x = x + mfViewMoveX;
|
|
|
+ y = y + mfViewMoveY;
|
|
|
+ painter->drawLine(QPoint(x*mnfac,y*mnfac*(-1)),
|
|
|
+ QPoint((x + pg->GetLength() * cos(pg->GetHdg()))*mnfac,(y + pg->GetLength() * sin(pg->GetHdg()))*mnfac*(-1)));
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 1:
|
|
|
+ pSpiral = (GeometrySpiral * )pg;
|
|
|
{
|
|
|
- GeometryBlock * pgeob = pRoad->GetGeometryBlock(j);
|
|
|
- double x,y;
|
|
|
- double x_center,y_center;
|
|
|
- double R;
|
|
|
- RoadGeometry * pg;
|
|
|
- GeometryArc * parc;
|
|
|
- GeometryParamPoly3 * ppp3;
|
|
|
- GeometrySpiral *pSpiral;
|
|
|
- GeometryPoly3 *ppoly;
|
|
|
- double rel_x,rel_y,rel_hdg;
|
|
|
- pg = pgeob->GetGeometryAt(0);
|
|
|
-
|
|
|
- x = pg->GetX();
|
|
|
- y = pg->GetY();
|
|
|
-
|
|
|
- switch (pg->GetGeomType()) {
|
|
|
- case 0:
|
|
|
+ int ncount = pSpiral->GetLength() * mnfac;
|
|
|
+ double sstep = pSpiral->GetLength()/((double)ncount);
|
|
|
+ int k;
|
|
|
+ double x0,y0,hdg0,s0;
|
|
|
+ x0 = pSpiral->GetX();
|
|
|
+ y0 = pSpiral->GetY();
|
|
|
+ s0 = pSpiral->GetS();
|
|
|
+ hdg0 = pSpiral->GetHdg() ;
|
|
|
+ painter->setPen(Qt::red);
|
|
|
+ for(k=0;k<ncount;k++)
|
|
|
+ {
|
|
|
+ pSpiral->GetCoords(s0+sstep*k,rel_x,rel_y,rel_hdg);
|
|
|
+
|
|
|
+ x = rel_x;
|
|
|
+ y = rel_y;
|
|
|
x = x + mfViewMoveX;
|
|
|
y = y + mfViewMoveY;
|
|
|
- painter->drawLine(QPoint(x*mnfac,y*mnfac*(-1)),
|
|
|
- QPoint((x + pg->GetLength() * cos(pg->GetHdg()))*mnfac,(y + pg->GetLength() * sin(pg->GetHdg()))*mnfac*(-1)));
|
|
|
- break;
|
|
|
-
|
|
|
- case 1:
|
|
|
- pSpiral = (GeometrySpiral * )pg;
|
|
|
- {
|
|
|
- int ncount = pSpiral->GetLength() * mnfac;
|
|
|
- double sstep = pSpiral->GetLength()/((double)ncount);
|
|
|
- int k;
|
|
|
- double x0,y0,hdg0,s0;
|
|
|
- x0 = pSpiral->GetX();
|
|
|
- y0 = pSpiral->GetY();
|
|
|
- s0 = pSpiral->GetS();
|
|
|
- hdg0 = pSpiral->GetHdg() ;
|
|
|
- painter->setPen(Qt::red);
|
|
|
- for(k=0;k<ncount;k++)
|
|
|
- {
|
|
|
- pSpiral->GetCoords(s0+sstep*k,rel_x,rel_y,rel_hdg);
|
|
|
-
|
|
|
- x = rel_x;
|
|
|
- y = rel_y;
|
|
|
- x = x + mfViewMoveX;
|
|
|
- y = y + mfViewMoveY;
|
|
|
- painter->drawPoint((int)(x*mnfac),(int)(y*(-1.0*mnfac)));
|
|
|
-
|
|
|
- }
|
|
|
- painter->setPen(Qt::blue);
|
|
|
- }
|
|
|
-
|
|
|
-// qDebug("spi");
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- {
|
|
|
- parc = (GeometryArc *)pg;
|
|
|
- R = abs(1.0/parc->GetCurvature());
|
|
|
- if(parc->GetCurvature() > 0)
|
|
|
+ painter->drawPoint((int)(x*mnfac),(int)(y*(-1.0*mnfac)));
|
|
|
+
|
|
|
+ }
|
|
|
+ painter->setPen(Qt::blue);
|
|
|
+ }
|
|
|
+
|
|
|
+ // qDebug("spi");
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ parc = (GeometryArc *)pg;
|
|
|
+ R = abs(1.0/parc->GetCurvature());
|
|
|
+ if(parc->GetCurvature() > 0)
|
|
|
+ {
|
|
|
+ x_center = pg->GetX() + R *cos(pg->GetHdg() + M_PI/2.0);
|
|
|
+ y_center = pg->GetY() + R * sin(pg->GetHdg() + M_PI/2.0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ x_center = pg->GetX() + R *cos(pg->GetHdg() -M_PI/2.0);
|
|
|
+ y_center = pg->GetY() + R * sin(pg->GetHdg() - M_PI/2.0);
|
|
|
+ }
|
|
|
+
|
|
|
+ int k;
|
|
|
+ int ncount = parc->GetLength() * mnfac ;
|
|
|
+ double curv = parc->GetCurvature();
|
|
|
+ double hdgstep;
|
|
|
+ double hdg0 = parc->GetHdg();
|
|
|
+ double hdgnow = parc->GetHdg();
|
|
|
+ if(ncount > 0) hdgstep= (parc->GetLength()/R)/ncount;
|
|
|
+ for(k=0;k<ncount;k++)
|
|
|
+ {
|
|
|
+ double x_draw,y_draw;
|
|
|
+
|
|
|
+ if(curv > 0)
|
|
|
{
|
|
|
- x_center = pg->GetX() + R *cos(pg->GetHdg() + M_PI/2.0);
|
|
|
- y_center = pg->GetY() + R * sin(pg->GetHdg() + M_PI/2.0);
|
|
|
+ hdgnow = hdg0 + k*hdgstep;
|
|
|
+ x_draw = x_center + R *cos(hdgnow - M_PI/2.0);
|
|
|
+ y_draw = y_center + R * sin(hdgnow - M_PI/2.0);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- x_center = pg->GetX() + R *cos(pg->GetHdg() -M_PI/2.0);
|
|
|
- y_center = pg->GetY() + R * sin(pg->GetHdg() - M_PI/2.0);
|
|
|
- }
|
|
|
-
|
|
|
- int k;
|
|
|
- int ncount = parc->GetLength() * mnfac ;
|
|
|
- double curv = parc->GetCurvature();
|
|
|
- double hdgstep;
|
|
|
- double hdg0 = parc->GetHdg();
|
|
|
- double hdgnow = parc->GetHdg();
|
|
|
- if(ncount > 0) hdgstep= (parc->GetLength()/R)/ncount;
|
|
|
- for(k=0;k<ncount;k++)
|
|
|
- {
|
|
|
- double x_draw,y_draw;
|
|
|
-
|
|
|
- if(curv > 0)
|
|
|
- {
|
|
|
- hdgnow = hdg0 + k*hdgstep;
|
|
|
- x_draw = x_center + R *cos(hdgnow - M_PI/2.0);
|
|
|
- y_draw = y_center + R * sin(hdgnow - M_PI/2.0);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- hdgnow = hdg0 - k * hdgstep;
|
|
|
- x_draw = x_center + R *cos(hdgnow + M_PI/2.0);
|
|
|
- y_draw = y_center + R * sin(hdgnow + M_PI/2.0);
|
|
|
- }
|
|
|
- x_draw = x_draw + mfViewMoveX;
|
|
|
- y_draw = y_draw + mfViewMoveY;
|
|
|
- painter->drawPoint(x_draw * mnfac ,y_draw * mnfac *(-1));
|
|
|
- }
|
|
|
+ hdgnow = hdg0 - k * hdgstep;
|
|
|
+ x_draw = x_center + R *cos(hdgnow + M_PI/2.0);
|
|
|
+ y_draw = y_center + R * sin(hdgnow + M_PI/2.0);
|
|
|
}
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- {
|
|
|
- painter->setPen(Qt::red);
|
|
|
- ppoly = (GeometryPoly3 *)pg;
|
|
|
- x = pg->GetX();
|
|
|
- y = pg->GetY();
|
|
|
- double A,B,C,D;
|
|
|
- A = ppoly->GetA();
|
|
|
- B = ppoly->GetB();
|
|
|
- C = ppoly->GetC();
|
|
|
- D = ppoly->GetD();
|
|
|
- const double steplim = 0.1;
|
|
|
- double du = steplim;
|
|
|
- double u = 0;
|
|
|
- double v = 0;
|
|
|
- double oldx,oldy;
|
|
|
- oldx = x;
|
|
|
- oldy = y;
|
|
|
- double xstart,ystart;
|
|
|
- xstart = x;
|
|
|
- ystart = y;
|
|
|
- double hdgstart = ppoly->GetHdg();
|
|
|
- double flen = 0;
|
|
|
- while(flen < ppoly->GetLength())
|
|
|
- {
|
|
|
-// double fdis = 0;
|
|
|
-// v = A + B*u + C*u*u + D*u*u*u;
|
|
|
-// x = xstart + u*cos(hdgstart) - v*sin(hdgstart);
|
|
|
-// y = ystart + u*sin(hdgstart) + v*cos(hdgstart);
|
|
|
-// fdis = sqrt(pow(x- oldx,2)+pow(y-oldy,2));
|
|
|
-// oldx = x;
|
|
|
-// oldy = y;
|
|
|
-// if(fdis>(steplim*2.0))du = du/2.0;
|
|
|
-// flen = flen + fdis;
|
|
|
-// u = u + du;
|
|
|
- double fHdg;
|
|
|
- ppoly->GetCoords(flen,x,y,fHdg);
|
|
|
- // std::cout<<" x: "<<x<<" y:"<<y<<std::endl;
|
|
|
- x = x + mfViewMoveX;
|
|
|
- y = y + mfViewMoveY;
|
|
|
- painter->drawPoint((int)(x*mnfac),(int)(y*(-1.0*mnfac)));
|
|
|
- flen = flen + steplim;
|
|
|
- }
|
|
|
- painter->setPen(Qt::blue);
|
|
|
- }
|
|
|
- break;
|
|
|
- case 4:
|
|
|
- {
|
|
|
- ppp3 = (GeometryParamPoly3 * )pg;
|
|
|
- int ncount = ppp3->GetLength()* mnfac;
|
|
|
- double sstep;
|
|
|
- if(ncount > 0)sstep = ppp3->GetLength()/ncount;
|
|
|
- else sstep = 10000.0;
|
|
|
- double s = 0;
|
|
|
- while(s < ppp3->GetLength())
|
|
|
- {
|
|
|
- double xtem,ytem;
|
|
|
- xtem = ppp3->GetuA() + ppp3->GetuB() * s + ppp3->GetuC() * s*s + ppp3->GetuD() * s*s*s;
|
|
|
- ytem = ppp3->GetvA() + ppp3->GetvB() * s + ppp3->GetvC() * s*s + ppp3->GetvD() * s*s*s;
|
|
|
- x = xtem*cos(ppp3->GetHdg()) - ytem * sin(ppp3->GetHdg()) + ppp3->GetX();
|
|
|
- y = xtem*sin(ppp3->GetHdg()) + ytem * cos(ppp3->GetHdg()) + ppp3->GetY();
|
|
|
- x = x + mfViewMoveX;
|
|
|
- y = y + mfViewMoveY;
|
|
|
- painter->drawPoint((int)(x*mnfac),(int)(y*(-1.0*mnfac)));
|
|
|
- s = s+ sstep;
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
+ x_draw = x_draw + mfViewMoveX;
|
|
|
+ y_draw = y_draw + mfViewMoveY;
|
|
|
+ painter->drawPoint(x_draw * mnfac ,y_draw * mnfac *(-1));
|
|
|
}
|
|
|
-
|
|
|
- // painter->drawPoint((int)(x*mnfac),(int)(y*(-1.0*mnfac)));
|
|
|
-
|
|
|
}
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ painter->setPen(Qt::red);
|
|
|
+ ppoly = (GeometryPoly3 *)pg;
|
|
|
+ x = pg->GetX();
|
|
|
+ y = pg->GetY();
|
|
|
+ double A,B,C,D;
|
|
|
+ A = ppoly->GetA();
|
|
|
+ B = ppoly->GetB();
|
|
|
+ C = ppoly->GetC();
|
|
|
+ D = ppoly->GetD();
|
|
|
+ const double steplim = 0.1;
|
|
|
+ double du = steplim;
|
|
|
+ double u = 0;
|
|
|
+ double v = 0;
|
|
|
+ double oldx,oldy;
|
|
|
+ oldx = x;
|
|
|
+ oldy = y;
|
|
|
+ double xstart,ystart;
|
|
|
+ xstart = x;
|
|
|
+ ystart = y;
|
|
|
+ double hdgstart = ppoly->GetHdg();
|
|
|
+ double flen = 0;
|
|
|
+ while(flen < ppoly->GetLength())
|
|
|
+ {
|
|
|
+ // double fdis = 0;
|
|
|
+ // v = A + B*u + C*u*u + D*u*u*u;
|
|
|
+ // x = xstart + u*cos(hdgstart) - v*sin(hdgstart);
|
|
|
+ // y = ystart + u*sin(hdgstart) + v*cos(hdgstart);
|
|
|
+ // fdis = sqrt(pow(x- oldx,2)+pow(y-oldy,2));
|
|
|
+ // oldx = x;
|
|
|
+ // oldy = y;
|
|
|
+ // if(fdis>(steplim*2.0))du = du/2.0;
|
|
|
+ // flen = flen + fdis;
|
|
|
+ // u = u + du;
|
|
|
+ double fHdg;
|
|
|
+ ppoly->GetCoords(flen,x,y,fHdg);
|
|
|
+ // std::cout<<" x: "<<x<<" y:"<<y<<std::endl;
|
|
|
+ x = x + mfViewMoveX;
|
|
|
+ y = y + mfViewMoveY;
|
|
|
+ painter->drawPoint((int)(x*mnfac),(int)(y*(-1.0*mnfac)));
|
|
|
+ flen = flen + steplim;
|
|
|
+ }
|
|
|
+ painter->setPen(Qt::blue);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ {
|
|
|
+ ppp3 = (GeometryParamPoly3 * )pg;
|
|
|
+ int ncount = ppp3->GetLength()* mnfac;
|
|
|
+ double sstep;
|
|
|
+ if(ncount > 0)sstep = ppp3->GetLength()/ncount;
|
|
|
+ else sstep = 10000.0;
|
|
|
+ double s = 0;
|
|
|
+ while(s < ppp3->GetLength())
|
|
|
+ {
|
|
|
+ double fhdg;
|
|
|
+ ppp3->GetCoords(ppp3->GetS() + s,x,y,fhdg);
|
|
|
+// double xtem,ytem;
|
|
|
+// xtem = ppp3->GetuA() + ppp3->GetuB() * s + ppp3->GetuC() * s*s + ppp3->GetuD() * s*s*s;
|
|
|
+// ytem = ppp3->GetvA() + ppp3->GetvB() * s + ppp3->GetvC() * s*s + ppp3->GetvD() * s*s*s;
|
|
|
+// x = xtem*cos(ppp3->GetHdg()) - ytem * sin(ppp3->GetHdg()) + ppp3->GetX();
|
|
|
+// y = xtem*sin(ppp3->GetHdg()) + ytem * cos(ppp3->GetHdg()) + ppp3->GetY();
|
|
|
+ x = x + mfViewMoveX;
|
|
|
+ y = y + mfViewMoveY;
|
|
|
+ painter->drawPoint((int)(x*mnfac),(int)(y*(-1.0*mnfac)));
|
|
|
+ s = s+ sstep;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ // painter->drawPoint((int)(x*mnfac),(int)(y*(-1.0*mnfac)));
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- if(mbClick)
|
|
|
- {
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(mbClick)
|
|
|
+ {
|
|
|
painter->setPen(Qt::red);
|
|
|
painter->drawEllipse(QPoint(mClickX ,mClickY),mnMarkSize,mnMarkSize);
|
|
|
-
|
|
|
+
|
|
|
painter->setPen(Qt::black);
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
if(mbSetObj)
|
|
|
{
|
|
|
painter->setPen(Qt::green);
|
|
|
painter->drawRect(mfObjX*mnfac-mnMarkSize,mfObjY*mnfac*(-1)-mnMarkSize,mnMarkSize*2,mnMarkSize*2);
|
|
|
-
|
|
|
+
|
|
|
painter->setPen(Qt::black);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if(mbSetManualStart)
|
|
|
{
|
|
|
painter->setPen(Qt::blue);
|
|
|
QPoint xP[4];
|
|
|
-
|
|
|
+
|
|
|
double x[4],y[4];
|
|
|
double x0[4],y0[4];
|
|
|
double xu = mnMarkSize;
|
|
@@ -490,18 +492,18 @@ void MainWindow::ExecPainter()
|
|
|
xP[i].setX(mfManualX*mnfac + x[i]);
|
|
|
xP[i].setY(mfManualY*mnfac*(-1) + y[i]);
|
|
|
}
|
|
|
-
|
|
|
-// painter->drawRect(mfManualX*mnfac-5,mfManualY*mnfac*(-1)-5,10,10);
|
|
|
-
|
|
|
+
|
|
|
+ // painter->drawRect(mfManualX*mnfac-5,mfManualY*mnfac*(-1)-5,10,10);
|
|
|
+
|
|
|
painter->drawPolygon(xP,4);
|
|
|
painter->setPen(Qt::black);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if(mbGPSViewUpdate)
|
|
|
{
|
|
|
painter->setPen(Qt::green);
|
|
|
QPoint xP[4];
|
|
|
-
|
|
|
+
|
|
|
double x[4],y[4];
|
|
|
double x0[4],y0[4];
|
|
|
double xu = mnMarkSize;
|
|
@@ -517,34 +519,34 @@ void MainWindow::ExecPainter()
|
|
|
xP[i].setX((mfNowX + mfViewMoveX)*mnfac + x[i]);
|
|
|
xP[i].setY((mfNowY + mfViewMoveY)*mnfac*(-1) + y[i]);
|
|
|
}
|
|
|
-
|
|
|
-// painter->drawRect(mfManualX*mnfac-5,mfManualY*mnfac*(-1)-5,10,10);
|
|
|
-
|
|
|
+
|
|
|
+ // painter->drawRect(mfManualX*mnfac-5,mfManualY*mnfac*(-1)-5,10,10);
|
|
|
+
|
|
|
painter->drawPolygon(xP,4);
|
|
|
painter->setPen(Qt::black);
|
|
|
mbGPSViewUpdate = false;
|
|
|
}
|
|
|
-
|
|
|
- painter->setPen(Qt::green);
|
|
|
- mMutexNavi.lock();
|
|
|
- double x0,y0;
|
|
|
- GaussProjCal(glon0,glat0,&x0,&y0);
|
|
|
- int nMapSize = m_navigation_data.size();
|
|
|
- for(i=0;i<nMapSize;i++)
|
|
|
- {
|
|
|
- double x,y;
|
|
|
- GaussProjCal(m_navigation_data.at(i)->gps_lng,m_navigation_data.at(i)->gps_lat,&x,&y);
|
|
|
- x = x-x0;
|
|
|
- y= y-y0;
|
|
|
-
|
|
|
- x = x + mfViewMoveX;
|
|
|
- y = y + mfViewMoveY;
|
|
|
- painter->drawPoint((int)(x*mnfac),(int)(y*(-1.0*mnfac)));
|
|
|
- }
|
|
|
- mMutexNavi.unlock();
|
|
|
-
|
|
|
-
|
|
|
- painter->end();
|
|
|
+
|
|
|
+ painter->setPen(Qt::green);
|
|
|
+ mMutexNavi.lock();
|
|
|
+ double x0,y0;
|
|
|
+ GaussProjCal(glon0,glat0,&x0,&y0);
|
|
|
+ int nMapSize = m_navigation_data.size();
|
|
|
+ for(i=0;i<nMapSize;i++)
|
|
|
+ {
|
|
|
+ double x,y;
|
|
|
+ GaussProjCal(m_navigation_data.at(i)->gps_lng,m_navigation_data.at(i)->gps_lat,&x,&y);
|
|
|
+ x = x-x0;
|
|
|
+ y= y-y0;
|
|
|
+
|
|
|
+ x = x + mfViewMoveX;
|
|
|
+ y = y + mfViewMoveY;
|
|
|
+ painter->drawPoint((int)(x*mnfac),(int)(y*(-1.0*mnfac)));
|
|
|
+ }
|
|
|
+ mMutexNavi.unlock();
|
|
|
+
|
|
|
+
|
|
|
+ painter->end();
|
|
|
}
|
|
|
|
|
|
//刷新
|