|
@@ -1,7 +1,17 @@
|
|
|
#include "ivmapview.h"
|
|
|
|
|
|
#define VIEW_WIDTH 1100
|
|
|
-#define VIEW_HEIGHT 1100
|
|
|
+#define VIEW_HEIGHT 900
|
|
|
+
|
|
|
+double glon0 = 117.0866293;
|
|
|
+double glat0 = 39.1364713;
|
|
|
+//double glon0 = 117;
|
|
|
+//double glat0 = 39;
|
|
|
+double ghdg0 = 360;
|
|
|
+
|
|
|
+#include "pos_def.h"
|
|
|
+
|
|
|
+extern std::vector<iv::pos_def> gvectorpos;
|
|
|
|
|
|
#include <math.h>
|
|
|
//高斯投影由经纬度(Unit:DD)反算大地坐标(含带号,Unit:Metres)
|
|
@@ -46,6 +56,114 @@ static bool LoadXODR(std::string strpath,OpenDrive & xxodr)
|
|
|
xp.ReadFile(strpath);
|
|
|
}
|
|
|
|
|
|
+static int getmnfac(OpenDrive & mxodr,double & fmovex,double & fmovey)
|
|
|
+{
|
|
|
+ int nrtn = 1;
|
|
|
+
|
|
|
+ int i;
|
|
|
+ double fxmin,fxmax,fymin,fymax;
|
|
|
+ fxmin = std::numeric_limits<double>::max() *(1.0);
|
|
|
+ fxmax = std::numeric_limits<double>::max()*(-1.0);
|
|
|
+ fymin = std::numeric_limits<double>::max() *(1.0);
|
|
|
+ fymax = std::numeric_limits<double>::max()*(-1.0);
|
|
|
+ bool bHaveRealRoad = false;
|
|
|
+ for(i=0;i<mxodr.GetRoadCount();i++)
|
|
|
+ {
|
|
|
+ int j;
|
|
|
+
|
|
|
+ Road * pRoad = mxodr.GetRoad(i);
|
|
|
+ if(pRoad->GetRoadLength()<0.1)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ bHaveRealRoad = true;
|
|
|
+ for(j=0;j<mxodr.GetRoad(i)->GetGeometryBlockCount();j++)
|
|
|
+ {
|
|
|
+ GeometryBlock * pgeob = pRoad->GetGeometryBlock(j);
|
|
|
+ double x,y;
|
|
|
+
|
|
|
+ RoadGeometry * pg;
|
|
|
+ pg = pgeob->GetGeometryAt(0);
|
|
|
+
|
|
|
+ x = pg->GetX();
|
|
|
+ y = pg->GetY();
|
|
|
+
|
|
|
+ if(x>fxmax)fxmax = x;
|
|
|
+ if(x<fxmin)fxmin = x;
|
|
|
+ if(y>fymax)fymax = y;
|
|
|
+ if(y<fymin)fymin = y;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ double x,y,hdg;
|
|
|
+
|
|
|
+ int nco = pRoad->GetGeometryCoords(pRoad->GetRoadLength()-0.1,x,y,hdg);
|
|
|
+ if(nco >= 0)
|
|
|
+ {
|
|
|
+ if(x>fxmax)fxmax = x;
|
|
|
+ if(x<fxmin)fxmin = x;
|
|
|
+ if(y>fymax)fymax = y;
|
|
|
+ if(y<fymin)fymin = y;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(bHaveRealRoad == false)
|
|
|
+ {
|
|
|
+ std::cout<<"No Real Road."<<std::endl;
|
|
|
+ return 1.0;
|
|
|
+ }
|
|
|
+
|
|
|
+ fmovex = 0;
|
|
|
+ fmovey = 0;
|
|
|
+ if(((fxmax>1000)&&(fxmin>1000))||((fxmax<-1000)&&(fxmin<-1000)))
|
|
|
+ {
|
|
|
+ fmovex = (fxmax + fxmin)/2.0;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(((fymax>1000)&&(fymin>1000))||((fymax<-1000)&&(fymin<-1000)))
|
|
|
+ {
|
|
|
+ fmovey = (fymax + fymin)/2.0;
|
|
|
+ }
|
|
|
+
|
|
|
+ double fabsxmax = fabs(fxmax);
|
|
|
+ if(fabsxmax < fabs(fxmin))fabsxmax = fabs(fxmin);
|
|
|
+ double fabsymax = fabs(fymax);
|
|
|
+ if(fabsymax < fabs(fymin))fabsymax = fabs(fymin);
|
|
|
+ int nfacx=1;
|
|
|
+ if(fabsxmax!= 0)
|
|
|
+ {
|
|
|
+ nfacx = (VIEW_WIDTH/2)/(fabsxmax*1.2);
|
|
|
+ }
|
|
|
+ int nfacy = 1;
|
|
|
+ if(fabsymax != 0)
|
|
|
+ {
|
|
|
+ nfacy = (VIEW_HEIGHT/2)/(fabsymax*1.2);
|
|
|
+ }
|
|
|
+ if(nfacx<1)nfacx = 1;
|
|
|
+ if(nfacy<1)nfacy = 1;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(nfacx < nfacy)nrtn = nfacx;
|
|
|
+ else nrtn = nfacy;
|
|
|
+
|
|
|
+ if(nrtn<=1)
|
|
|
+ {
|
|
|
+ nrtn = 1;
|
|
|
+ return nrtn;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(nrtn >(VIEW_WIDTH/1600))
|
|
|
+ {
|
|
|
+ nrtn = nrtn/(VIEW_WIDTH/1600);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return nrtn;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
ivmapview::ivmapview()
|
|
|
{
|
|
|
image = new QImage(VIEW_WIDTH, VIEW_HEIGHT, QImage::Format_RGB32);//画布的初始化大小设为300*300,使用32位颜色
|
|
@@ -55,6 +173,36 @@ ivmapview::ivmapview()
|
|
|
std::vector<iv::ObstacleBasic> * pobs = new std::vector<iv::ObstacleBasic>();
|
|
|
mobs.reset(pobs);
|
|
|
mnavigation_data.clear();
|
|
|
+
|
|
|
+ LoadXODR("./map.xodr",mxodr);
|
|
|
+
|
|
|
+ double fmovex,fmovey;
|
|
|
+ mnfac = getmnfac(mxodr,fmovex,fmovey);
|
|
|
+
|
|
|
+ mfViewMoveX = mfViewMoveX - fmovex;
|
|
|
+ mfViewMoveY = mfViewMoveY - fmovey;
|
|
|
+
|
|
|
+ mnMoveX = VIEW_WIDTH/2;
|
|
|
+ mnMoveY = VIEW_HEIGHT/2;
|
|
|
+
|
|
|
+ mnDefmnfac = mnfac;
|
|
|
+ mnDefMoveX = mnMoveX;
|
|
|
+ mnDefMoveY = mnMoveY;
|
|
|
+
|
|
|
+// mnfac = 100;
|
|
|
+// mnfac = 20;
|
|
|
+
|
|
|
+ unsigned short int revMajor,revMinor;
|
|
|
+ std::string name,date;
|
|
|
+ float version;
|
|
|
+ double north,south,east,west,lat0,lon0,hdg0;
|
|
|
+ if(mxodr.GetHeader() != 0)
|
|
|
+ {
|
|
|
+ mxodr.GetHeader()->GetAllParams(revMajor,revMinor,name,version,date,north,south,east,west,lat0,lon0,hdg0);
|
|
|
+ glat0 = lat0;
|
|
|
+ glon0 = lon0;
|
|
|
+ }
|
|
|
+ GaussProjCal(glon0,glat0,&mx0,&my0);
|
|
|
}
|
|
|
|
|
|
void ivmapview::run()
|
|
@@ -62,6 +210,8 @@ void ivmapview::run()
|
|
|
while(!QThread::isInterruptionRequested())
|
|
|
{
|
|
|
bool bNeedUpdate = false;
|
|
|
+ if(mnMapMode == 0 )
|
|
|
+ {
|
|
|
qint64 xTime = QDateTime::currentMSecsSinceEpoch();
|
|
|
if(mnavigation_data.size()> 0)
|
|
|
{
|
|
@@ -83,10 +233,339 @@ void ivmapview::run()
|
|
|
|
|
|
if(bNeedUpdate)paint();
|
|
|
msleep(100);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ paintxodr();
|
|
|
+ msleep(100);
|
|
|
+ std::cout<<"paint."<<std::endl;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
+void ivmapview::paintxodr()
|
|
|
+{
|
|
|
+ QTime x;
|
|
|
+ x.start();
|
|
|
+ // qDebug("painter.");
|
|
|
+
|
|
|
+
|
|
|
+ qint64 xTime = QDateTime::currentMSecsSinceEpoch();
|
|
|
+ std::vector<iv::MAP_GPS_INS> xnavigation_data;
|
|
|
+ iv::gps::gpsimu xgpsimu;
|
|
|
+ mMutexMap.lock();
|
|
|
+ xnavigation_data = mnavigation_data;
|
|
|
+ mMutexMap.unlock();
|
|
|
+
|
|
|
+ mMutexPaint.lock();
|
|
|
+
|
|
|
+ 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++)
|
|
|
+ {
|
|
|
+ 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;
|
|
|
+ {
|
|
|
+ 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)
|
|
|
+ {
|
|
|
+ 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)
|
|
|
+ {
|
|
|
+ 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));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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)));
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ QPen pen;
|
|
|
+ pen.setWidth(3);
|
|
|
+ pen.setColor(Qt::green);
|
|
|
+ painter->setPen(pen);
|
|
|
+
|
|
|
+ double x0,y0;
|
|
|
+ GaussProjCal(glon0,glat0,&x0,&y0);
|
|
|
+ int nMapSize = xnavigation_data.size();
|
|
|
+ for(i=0;i<nMapSize;i++)
|
|
|
+ {
|
|
|
+ double x,y;
|
|
|
+// GaussProjCal(xnavigation_data.at(i).gps_lng,xnavigation_data.at(i).gps_lat,&x,&y);
|
|
|
+ x = xnavigation_data.at(i).gps_x;
|
|
|
+ y = xnavigation_data.at(i).gps_y;
|
|
|
+ x = x-x0;
|
|
|
+ y= y-y0;
|
|
|
+
|
|
|
+ x = x + mfViewMoveX;
|
|
|
+ y = y + mfViewMoveY;
|
|
|
+ painter->drawPoint((int)(x*mnfac),(int)(y*(-1.0*mnfac)));
|
|
|
+ }
|
|
|
+
|
|
|
+ painter->setPen(Qt::blue);
|
|
|
+
|
|
|
+
|
|
|
+ if((xTime - mnTimeGPSUpdate)<3000)
|
|
|
+ {
|
|
|
+ mMutexGPS.lock();
|
|
|
+ xgpsimu.CopyFrom(mgpsimu);
|
|
|
+ mMutexGPS.unlock();
|
|
|
+
|
|
|
+ painter->setPen(Qt::green);
|
|
|
+ QPoint xP[4];
|
|
|
+
|
|
|
+ double x[4],y[4];
|
|
|
+ double x0[4],y0[4];
|
|
|
+ double xu = mnMarkSize*3;
|
|
|
+ x0[0] = -xu;y0[0] = -xu;
|
|
|
+ x0[1] = xu*2; y0[1] = 0;
|
|
|
+ x0[2] = -xu;y0[2] =xu;
|
|
|
+ x0[3] = 0; y0[3] = 0;
|
|
|
+
|
|
|
+ double xnow,ynow,hdgnow;
|
|
|
+ hdgnow = (90- xgpsimu.heading()) * M_PI/180.0;
|
|
|
+ GaussProjCal(xgpsimu.lon(),xgpsimu.lat(),&xnow,&ynow);
|
|
|
+ double xz,yz;
|
|
|
+ GaussProjCal(glon0,glat0,&xz,&yz);
|
|
|
+ xnow = xnow - xz;
|
|
|
+ ynow = ynow - yz;
|
|
|
+
|
|
|
+ double hr= hdgnow;
|
|
|
+ for(i=0;i<4;i++)
|
|
|
+ {
|
|
|
+ x[i] = x0[i]*cos(hr) +y0[i]*sin(hr);
|
|
|
+ y[i] = y0[i]*cos(hr) - x0[i]*sin(hr);
|
|
|
+ xP[i].setX((xnow + mfViewMoveX)*mnfac + x[i]);
|
|
|
+ xP[i].setY((ynow + mfViewMoveY)*mnfac*(-1) + y[i]);
|
|
|
+ }
|
|
|
+
|
|
|
+ // painter->drawRect(mfManualX*mnfac-5,mfManualY*mnfac*(-1)-5,10,10);
|
|
|
+
|
|
|
+ painter->drawPolygon(xP,4);
|
|
|
+ painter->setPen(Qt::black);
|
|
|
+ }
|
|
|
+
|
|
|
+ int nstationsize = gvectorpos.size();
|
|
|
+
|
|
|
+ for(i=0;i<nstationsize;i++)
|
|
|
+ {
|
|
|
+
|
|
|
+ double xpos,ypos;
|
|
|
+ GaussProjCal(gvectorpos[i].mflon,gvectorpos[i].mflat,&xpos,&ypos);
|
|
|
+ double xz,yz;
|
|
|
+ GaussProjCal(glon0,glat0,&xz,&yz);
|
|
|
+
|
|
|
+ xpos = xpos - xz;
|
|
|
+ ypos = ypos - yz;
|
|
|
+
|
|
|
+
|
|
|
+ painter->setPen(Qt::red);
|
|
|
+ painter->setBrush(Qt::red)
|
|
|
+; if(i != mnStationIndex)
|
|
|
+ painter->drawEllipse(QPoint((xpos + mfViewMoveX)*mnfac ,(ypos + mfViewMoveX)*mnfac*(-1)),mnMarkSize,mnMarkSize);
|
|
|
+ else
|
|
|
+ painter->drawEllipse(QPoint((xpos + mfViewMoveX)*mnfac ,(ypos + mfViewMoveX)*mnfac*(-1)),2*mnMarkSize,2*mnMarkSize);
|
|
|
+
|
|
|
+ painter->setBrush(Qt::NoBrush);
|
|
|
+ painter->setPen(Qt::black);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ painter->end();
|
|
|
+
|
|
|
+ mMutexPaint.unlock();
|
|
|
+ mbImageUpdate = true;
|
|
|
+
|
|
|
+ std::cout<<" draw map use: "<<(QDateTime::currentMSecsSinceEpoch() - xTime)<<std::endl;
|
|
|
+
|
|
|
+}
|
|
|
|
|
|
void ivmapview::paint()
|
|
|
{
|
|
@@ -443,7 +922,12 @@ void ivmapview::setfusion(iv::fusion::fusionobjectarray &xfusion)
|
|
|
|
|
|
void ivmapview::setMapMode(int nMode)
|
|
|
{
|
|
|
- mnMapMode = 1;
|
|
|
+ mnMapMode = nMode;
|
|
|
+}
|
|
|
+
|
|
|
+void ivmapview::setStationIndex(int nStationIndex)
|
|
|
+{
|
|
|
+ mnStationIndex = nStationIndex;
|
|
|
}
|
|
|
|
|
|
|