From 4e4b2ff9b404239b320d4cf6527e26ade7a36c78 Mon Sep 17 00:00:00 2001
From: codeboss <2422523675@qq.com>
Date: Sat, 14 Jun 2025 13:07:51 +0800
Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E6=94=B9=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ComponentBasic/ComponentBasic.vcxproj | 4 ++--
ComponentBasic/ComponentBasic.vcxproj.filters | 4 ++--
ComponentBasic/MapRoute.cpp | 1 -
ComponentBasic/RouteManage.cpp | 1 +
ComponentBasic/{MapRoute.h => RouteManage.h} | 0
ComponentBasic/VisibleCube.h | 4 ++--
MessageBasic/MessageBasic.vcxproj | 2 ++
MessageBasic/MessageBasic.vcxproj.filters | 8 +++++++
MessageBasic/messagebasic.h | 10 ++++-----
MessageBasic/route_access.cpp | 1 +
MessageBasic/route_access.h | 6 +++++
StandardGlobe/standardglobe.cpp | 14 ++++++------
StandardGlobe/standardglobe.h | 22 +++++++++++++------
13 files changed, 51 insertions(+), 26 deletions(-)
delete mode 100644 ComponentBasic/MapRoute.cpp
create mode 100644 ComponentBasic/RouteManage.cpp
rename ComponentBasic/{MapRoute.h => RouteManage.h} (100%)
create mode 100644 MessageBasic/route_access.cpp
create mode 100644 MessageBasic/route_access.h
diff --git a/ComponentBasic/ComponentBasic.vcxproj b/ComponentBasic/ComponentBasic.vcxproj
index 5490af2..f19f805 100644
--- a/ComponentBasic/ComponentBasic.vcxproj
+++ b/ComponentBasic/ComponentBasic.vcxproj
@@ -104,13 +104,13 @@
-
+
-
+
diff --git a/ComponentBasic/ComponentBasic.vcxproj.filters b/ComponentBasic/ComponentBasic.vcxproj.filters
index 2671eab..cf48e34 100644
--- a/ComponentBasic/ComponentBasic.vcxproj.filters
+++ b/ComponentBasic/ComponentBasic.vcxproj.filters
@@ -32,7 +32,7 @@
Header Files
-
+
Header Files
@@ -43,7 +43,7 @@
Source Files
-
+
Source Files
diff --git a/ComponentBasic/MapRoute.cpp b/ComponentBasic/MapRoute.cpp
deleted file mode 100644
index 8e5ec34..0000000
--- a/ComponentBasic/MapRoute.cpp
+++ /dev/null
@@ -1 +0,0 @@
-#include "MapRoute.h"
diff --git a/ComponentBasic/RouteManage.cpp b/ComponentBasic/RouteManage.cpp
new file mode 100644
index 0000000..2c02b1b
--- /dev/null
+++ b/ComponentBasic/RouteManage.cpp
@@ -0,0 +1 @@
+#include "RouteManage.h"
diff --git a/ComponentBasic/MapRoute.h b/ComponentBasic/RouteManage.h
similarity index 100%
rename from ComponentBasic/MapRoute.h
rename to ComponentBasic/RouteManage.h
diff --git a/ComponentBasic/VisibleCube.h b/ComponentBasic/VisibleCube.h
index 11536d6..61e1838 100644
--- a/ComponentBasic/VisibleCube.h
+++ b/ComponentBasic/VisibleCube.h
@@ -15,8 +15,8 @@ class COMPONENTBASIC_EXPORT VisibleCubePlugin : public ProcList<
{
private:
std::weak_ptr _bind_entity;
- D3Data _self_d3;
- LLAPos _self_lla;
+ VolumeData _self_d3;
+ LonLatAltPos _self_lla;
Posture _self_posture;
public:
diff --git a/MessageBasic/MessageBasic.vcxproj b/MessageBasic/MessageBasic.vcxproj
index 4fd6859..47ae430 100644
--- a/MessageBasic/MessageBasic.vcxproj
+++ b/MessageBasic/MessageBasic.vcxproj
@@ -100,9 +100,11 @@
+
+
diff --git a/MessageBasic/MessageBasic.vcxproj.filters b/MessageBasic/MessageBasic.vcxproj.filters
index 4412b74..20f25c0 100644
--- a/MessageBasic/MessageBasic.vcxproj.filters
+++ b/MessageBasic/MessageBasic.vcxproj.filters
@@ -32,5 +32,13 @@
Header Files
+
+ Header Files
+
+
+
+
+ Source Files
+
\ No newline at end of file
diff --git a/MessageBasic/messagebasic.h b/MessageBasic/messagebasic.h
index f849d35..02285d9 100644
--- a/MessageBasic/messagebasic.h
+++ b/MessageBasic/messagebasic.h
@@ -94,7 +94,7 @@ struct Posture {
///
/// 三维数据结构定义
///
-struct D3Data {
+struct VolumeData {
double _length_m = 0;
double _width_m = 0;
double _height_m = 0;
@@ -104,9 +104,9 @@ struct D3Data {
/// 体积盒详细数据定义
///
struct MESSAGEBASIC_EXPORT Box3DDesc : public AbstractMessage {
- D3Data _d3_data;
+ VolumeData _d3_data;
Posture _posture_d3;
- LLAPos _lla_pos;
+ LonLatAltPos _lla_pos;
Box3DDesc();
@@ -116,7 +116,7 @@ struct MESSAGEBASIC_EXPORT Box3DDesc : public AbstractMessage {
};
struct MESSAGEBASIC_EXPORT Set3DBoxD3Data : public AbstractMessage {
- D3Data _d3_data;
+ VolumeData _d3_data;
Set3DBoxD3Data();
@@ -138,7 +138,7 @@ struct MESSAGEBASIC_EXPORT Set3DBoxPosture : public AbstractMessage
struct MESSAGEBASIC_EXPORT Set3DBoxLLAPos : public AbstractMessage
{
- LLAPos _lla_pos;
+ LonLatAltPos _lla_pos;
Set3DBoxLLAPos();
diff --git a/MessageBasic/route_access.cpp b/MessageBasic/route_access.cpp
new file mode 100644
index 0000000..70f0a2d
--- /dev/null
+++ b/MessageBasic/route_access.cpp
@@ -0,0 +1 @@
+#include "route_access.h"
diff --git a/MessageBasic/route_access.h b/MessageBasic/route_access.h
new file mode 100644
index 0000000..f2f0597
--- /dev/null
+++ b/MessageBasic/route_access.h
@@ -0,0 +1,6 @@
+#pragma once
+#include "messagebasic.h"
+
+struct NewPlainRoute : public AbstractMessage {
+ QList lonlatList;
+};
\ No newline at end of file
diff --git a/StandardGlobe/standardglobe.cpp b/StandardGlobe/standardglobe.cpp
index 7d1438d..705641e 100644
--- a/StandardGlobe/standardglobe.cpp
+++ b/StandardGlobe/standardglobe.cpp
@@ -11,7 +11,7 @@ StandardGlobe::StandardGlobe()
{
}
-ECEFPos StandardGlobe::llaToEcef(const LLAPos& v)
+ECEFPos StandardGlobe::llaToEcef(const LonLatAltPos& v)
{
// 计算距离球心距离
auto axis_r_g = v._alt_m + _radius_m;
@@ -27,7 +27,7 @@ ECEFPos StandardGlobe::llaToEcef(const LLAPos& v)
return ECEFPos{ axis_x, axis_y, axis_z };
}
-LLAPos StandardGlobe::ecefToLLA(const ECEFPos& v)
+LonLatAltPos StandardGlobe::ecefToLLA(const ECEFPos& v)
{
auto r2 = std::sqrt(v._x_pos * v._x_pos + v._y_pos * v._y_pos);
auto rad_lon = acos(v._x_pos / r2);
@@ -36,7 +36,7 @@ LLAPos StandardGlobe::ecefToLLA(const ECEFPos& v)
auto rx = std::sqrt(v._x_pos * v._x_pos + v._y_pos * v._y_pos + v._z_pos * v._z_pos);
auto rad_lat = asin(v._z_pos / rx);
- LLAPos ret;
+ LonLatAltPos ret;
ret._lon_deg = rad2d(rad_lon);
ret._lat_deg = rad2d(rad_lat);
ret._alt_m = rx - _radius_m;
@@ -44,7 +44,7 @@ LLAPos StandardGlobe::ecefToLLA(const ECEFPos& v)
return ret;
}
-void StandardGlobe::getDistanceWithTargetLLA(const LLAPos& base, const LLAPos& target, double& dist, double& azi)
+void StandardGlobe::getDistanceWithTargetLLA(const LonLatAltPos& base, const LonLatAltPos& target, double& dist, double& azi)
{
// ecef矢量
auto vec_base = llaToEcef(base).getVec3();
@@ -75,7 +75,7 @@ void StandardGlobe::getDistanceWithTargetLLA(const LLAPos& base, const LLAPos& t
}
#include
-void StandardGlobe::getTargetLLAWithDistance(const LLAPos& base, double dist, double azi, LLAPos& target)
+void StandardGlobe::getTargetLLAWithDistance(const LonLatAltPos& base, double dist, double azi, LonLatAltPos& target)
{
auto ecef_bvec = llaToEcef(base).getVec3().normalized();
QQuaternion u0(-deg2a(azi), ecef_bvec);
@@ -96,7 +96,7 @@ void StandardGlobe::getTargetLLAWithDistance(const LLAPos& base, double dist, do
target = ecefToLLA(sv);
}
-PolarPos StandardGlobe::getPolarWithLLA(const LLAPos& base, const LLAPos& target)
+PolarPos StandardGlobe::getPolarWithLLA(const LonLatAltPos& base, const LonLatAltPos& target)
{
// ecef矢量
auto vec_base = llaToEcef(base).getVec3();
@@ -134,7 +134,7 @@ PolarPos StandardGlobe::getPolarWithLLA(const LLAPos& base, const LLAPos& target
return p;
}
-LLAPos StandardGlobe::getLLAWithPolar(const LLAPos& base, const PolarPos& target)
+LonLatAltPos StandardGlobe::getLLAWithPolar(const LonLatAltPos& base, const PolarPos& target)
{
auto ecef_b = llaToEcef(base).getVec3();
auto u_azi = QQuaternion(-deg2a(target._azimuth_deg), ecef_b.normalized());
diff --git a/StandardGlobe/standardglobe.h b/StandardGlobe/standardglobe.h
index 91074ab..2c3bf9c 100644
--- a/StandardGlobe/standardglobe.h
+++ b/StandardGlobe/standardglobe.h
@@ -4,10 +4,18 @@
class QVector3D;
+///
+/// 经纬度坐标
+///
+struct LonLatPos {
+ double _lon_deg = 0;
+ double _lat_deg = 0;
+};
+
///
/// 经纬高坐标系坐标
///
-struct LLAPos {
+struct LonLatAltPos {
double _lon_deg = 0;
double _lat_deg = 0;
double _alt_m = 0;
@@ -56,8 +64,8 @@ private:
public:
StandardGlobe();
- static ECEFPos llaToEcef(const LLAPos &v);
- static LLAPos ecefToLLA(const ECEFPos &v);
+ static ECEFPos llaToEcef(const LonLatAltPos &v);
+ static LonLatAltPos ecefToLLA(const ECEFPos &v);
///
/// 根据LLA坐标获取两点之间的大地线长度和b->t初始方位角,warning:本计算忽视LLA的高度值
///
@@ -65,7 +73,7 @@ public:
///
///
///
- static void getDistanceWithTargetLLA(const LLAPos &base, const LLAPos &target, double &dist, double &azi);
+ static void getDistanceWithTargetLLA(const LonLatAltPos &base, const LonLatAltPos &target, double &dist, double &azi);
///
/// 根据两点之间的大地线长度和b->t初始方位角,计算目标LLA定位坐标
///
@@ -73,19 +81,19 @@ public:
///
///
///
- static void getTargetLLAWithDistance(const LLAPos& base, double dist, double azi, LLAPos& target);
+ static void getTargetLLAWithDistance(const LonLatAltPos& base, double dist, double azi, LonLatAltPos& target);
///
/// 通过LLA坐标,获取目标极坐标
///
///
///
///
- static PolarPos getPolarWithLLA(const LLAPos &base, const LLAPos &target);
+ static PolarPos getPolarWithLLA(const LonLatAltPos &base, const LonLatAltPos &target);
///
/// 通过极坐标,获取目标LLA坐标
///
///
///
///
- static LLAPos getLLAWithPolar(const LLAPos &base, const PolarPos &target);
+ static LonLatAltPos getLLAWithPolar(const LonLatAltPos &base, const PolarPos &target);
};