You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
1.3 KiB
C++

#include "plane.h"
#include "translator.h"
Plane::Plane()
{
}
Plane::Plane(QString planeName,int planeType, double lon, double lat,double heading)
{
this->planeName = planeName;
m_pGeoPoint = new UGGeoPoint();
m_pGeoPoint->SetX(lon);
m_pGeoPoint->SetY(lat);
this->heading = heading;
m_pGeoPoint->SetStyle(getPlaneStyle(planeType));
}
//设置飞机位置
void Plane::setPosition(double lon,double lat)
{
m_pGeoPoint->SetX(lon);
m_pGeoPoint->SetY(lat);
}
double Plane::getPointX()
{
return m_pGeoPoint->GetX();
}
double Plane::getPointY()
{
return m_pGeoPoint->GetY();
}
double Plane::getHeading()
{
return this->heading;
}
UGGeoPoint *Plane::getGeometry()
{
return m_pGeoPoint;
}
QString Plane::getPlaneName()
{
return planeName;
}
// 获取飞机图标
UGStyle* Plane::getPlaneStyle(int planeType)
{
UGStyle* pStyle = new UGStyle;
pStyle->SetMarkerSize(8);
pStyle->SetMarkerAngle(-90);
switch (planeType) {
case 0:// 98
break;
case 1: // 981a
break;
case 2: //981c
// pStyle->SetMarkerStyle(1);
pStyle->SetPicturePath(Translator::QStr2UGStr("D:/supermap-iobjectscpp/MyProject/MapDisplay/Resources/Plane/FH-981C.png"));
break;
case 3: //预留
break;
default:
break;
}
return pStyle;
}