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.
106 lines
2.8 KiB
C++
106 lines
2.8 KiB
C++
#include "routeglobalvariant.h"
|
|
|
|
//NotifyManager* notifyManager = NULL; //全局消息通知管理对象初始化
|
|
|
|
|
|
RouteGlobalVariant::RouteGlobalVariant()
|
|
{
|
|
|
|
|
|
}
|
|
|
|
void RouteGlobalVariant::getTemporaryStyle(UGStyle &temporaryStyle)
|
|
{
|
|
temporaryStyle.SetLineStyle(6);
|
|
temporaryStyle.SetLineColor(UGRGB(10,5,5));
|
|
temporaryStyle.SetLineWidth(1);
|
|
}
|
|
|
|
void RouteGlobalVariant::getHighLightStyle(UGStyle &highLightStyle)
|
|
{
|
|
highLightStyle.SetLineStyle(6);
|
|
highLightStyle.SetLineColor(UGRGB(0,0,255));
|
|
highLightStyle.SetLineWidth(1);
|
|
}
|
|
|
|
//获取航线类型的Style
|
|
UGStyle RouteGlobalVariant::getRouteStyle(int routeType)
|
|
{
|
|
UGStyle style;
|
|
style.SetLineWidth(1);
|
|
style.SetLineColor(getRouteTypeColor(routeType));
|
|
// style.SetLineCapStyle(1);
|
|
return style;
|
|
}
|
|
//获取航线类型的Style3D
|
|
UGStyle3D RouteGlobalVariant::getRouteStyle3D(int routeType)
|
|
{
|
|
UGStyle3D style3D;
|
|
style3D.SetLineColor3D(getRouteTypeColor(routeType));
|
|
style3D.SetLineWidth(2);
|
|
// style3D.SetLineCapStyle(0);
|
|
style3D.SetAltitudeMode(AltitudeMode::Absolute);
|
|
|
|
return style3D;
|
|
}
|
|
|
|
void RouteGlobalVariant::getTemporaryStyle3D(UGStyle3D &temporaryStyle)
|
|
{
|
|
temporaryStyle.SetLineStyle(6);
|
|
temporaryStyle.SetLineColor3D(UGRGB(255,255,255));
|
|
temporaryStyle.SetLineWidth(1);
|
|
temporaryStyle.SetAltitudeMode(AltitudeMode::Absolute);
|
|
}
|
|
|
|
void RouteGlobalVariant::getHighLightStyle3D(UGStyle3D &highLightStyle)
|
|
{
|
|
highLightStyle.SetLineStyle(6);
|
|
highLightStyle.SetLineColor3D(UGRGB(0,0,255));
|
|
highLightStyle.SetLineWidth(1);
|
|
highLightStyle.SetAltitudeMode(AltitudeMode::Absolute);
|
|
}
|
|
|
|
//获取航线类型
|
|
QMap<int, QString> RouteGlobalVariant::getRouteType()
|
|
{
|
|
QMap<int,QString> RouteType; //航线类型
|
|
// 航线类型
|
|
RouteType[1] = u8"飞行航线";
|
|
RouteType[2] = u8"应急航线";
|
|
RouteType[3] = u8"回收航线";
|
|
RouteType[4] = u8"围栏航线";
|
|
RouteType[5] = u8"通场航线";
|
|
RouteType[6] = u8"跑道航线";
|
|
return RouteType;
|
|
}
|
|
|
|
//获取各航线类型颜色
|
|
UGColor RouteGlobalVariant::getRouteTypeColor(int Type)
|
|
{
|
|
QMap<int,UGColor> colors;
|
|
colors[1] = UGRGB(77,175,74); //飞行航线
|
|
colors[2] = UGRGB(228,26,28); //应急航线
|
|
colors[3] = UGRGB(255,255,51); //回收航线
|
|
colors[4] = UGRGB(255,127,0); //围栏航线
|
|
colors[5] = UGRGB(55,126,184); //通场航线
|
|
colors[6] = UGRGB(152,78,163); //跑道航线
|
|
|
|
return colors[Type];
|
|
}
|
|
|
|
//获取注记Style
|
|
UGTextStyle RouteGlobalVariant::getLabelTextStyle(int routeType)
|
|
{
|
|
UGTextStyle textStyle;
|
|
textStyle.SetSize(16);
|
|
textStyle.SetForeColor(getRouteTypeColor(routeType));
|
|
return textStyle;
|
|
}
|
|
|
|
UGTextStyle3D RouteGlobalVariant::getLabelTextStyle3D()
|
|
{
|
|
UGTextStyle3D textStyle3D;
|
|
textStyle3D.m_dScale = 2;
|
|
return textStyle3D;
|
|
}
|