Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
colorEagleStdio
qplanetosm
提交
b1162949
qplanetosm
项目概览
colorEagleStdio
/
qplanetosm
通知
118
Star
10
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
qplanetosm
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
b1162949
编写于
4月 01, 2024
作者:
首席大数据架构师
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of git@gitcode.net:coloreaglestdio/qplanetosm.git into develop
上级
59a7a80c
f8f854a5
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
1516 addition
and
44 deletion
+1516
-44
.gitignore
.gitignore
+4
-2
geocalc/geocalc.h
geocalc/geocalc.h
+1436
-0
geocalc/readme.md
geocalc/readme.md
+2
-0
qtviewer_planetosm/main.cpp
qtviewer_planetosm/main.cpp
+2
-2
qtviewer_planetosm/osmtiles/layer_tiles.cpp
qtviewer_planetosm/osmtiles/layer_tiles.cpp
+2
-2
qtvplugin_grid/CMakeLists.txt
qtvplugin_grid/CMakeLists.txt
+13
-12
qtvplugin_grid/qtvplugin_grid.cpp
qtvplugin_grid/qtvplugin_grid.cpp
+57
-26
未找到文件。
.gitignore
浏览文件 @
b1162949
...
...
@@ -13,11 +13,13 @@ __pycache__
[Rr]elease/
[Rr]eleases/
x64/
build/
build
*
/
bld/
[Bb]in/
[Oo]bj/
*.kdev*
.kdev*
kdev*.*
# Roslyn cache directories
*.ide/
...
...
geocalc/geocalc.h
0 → 100644
浏览文件 @
b1162949
此差异已折叠。
点击以展开。
geocalc/readme.md
0 → 100644
浏览文件 @
b1162949
Project:
https://gitcode.com/colorEagleStdio/geocalc
\ No newline at end of file
qtviewer_planetosm/main.cpp
浏览文件 @
b1162949
...
...
@@ -74,8 +74,8 @@ int main(int argc, char *argv[])
std
::
string
strCmd
=
map_to_string
(
mp
).
toStdString
()
+
"
\n
"
;
if
(
w
.
stdio_is_on
())
{
fputs
(
strCmd
.
c_str
(),
stdout
);
fflush
(
stdout
);
//
fputs(strCmd.c_str(),stdout);
//
fflush(stdout);
}
});
...
...
qtviewer_planetosm/osmtiles/layer_tiles.cpp
浏览文件 @
b1162949
...
...
@@ -190,13 +190,13 @@ namespace QTVOSM{
if
(
!
m_pViewer
||
m_bVisible
==
false
||
m_bActive
==
false
)
return
false
;
int
nLevel
=
m_pViewer
->
level
();
const
int
ad
=
event
->
angleDelta
().
x
()
+
event
->
angleDelta
().
y
();
if
(
ad
<
0
)
if
(
ad
>
0
)
{
nLevel
++
;
if
(
nLevel
>
20
)
nLevel
=
20
;
}
else
if
(
ad
>
0
)
else
if
(
ad
<
0
)
{
nLevel
--
;
if
(
nLevel
<
0
)
...
...
qtvplugin_grid/CMakeLists.txt
浏览文件 @
b1162949
...
...
@@ -15,33 +15,34 @@ find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED)
find_package
(
Qt
${
QT_VERSION_MAJOR
}
COMPONENTS Widgets REQUIRED
)
set
(
PRJ_HEADERS
../qtviewer_planetosm/osmtiles/layer_interface.h
../qtviewer_planetosm/osmtiles/viewer_interface.h
qtvplugin_grid.h
../qtviewer_planetosm/osmtiles/layer_interface.h
../qtviewer_planetosm/osmtiles/viewer_interface.h
../geocalc/geocalc.h
qtvplugin_grid.h
)
set
(
PRJ_SOURCES
qtvplugin_grid.cpp
qtvplugin_grid.cpp
)
set
(
PRJ_FORMS
qtvplugin_grid.ui
qtvplugin_grid.ui
)
set
(
PRJ_RESOURCES
resources.qrc
qtvplugin_grid_zh_CN.ts
resources.qrc
qtvplugin_grid_zh_CN.ts
)
add_library
(
qtvplugin_grid SHARED
${
PRJ_HEADERS
}
${
PRJ_SOURCES
}
${
PRJ_FORMS
}
${
PRJ_RESOURCES
}
${
PRJ_HEADERS
}
${
PRJ_SOURCES
}
${
PRJ_FORMS
}
${
PRJ_RESOURCES
}
)
target_compile_definitions
(
qtvplugin_grid PRIVATE PLANETOSM_EXPORT_DLL
)
target_link_libraries
(
qtvplugin_grid PRIVATE
Qt
${
QT_VERSION_MAJOR
}
::Widgets
Qt
${
QT_VERSION_MAJOR
}
::Widgets
)
qtvplugin_grid/qtvplugin_grid.cpp
浏览文件 @
b1162949
...
...
@@ -13,6 +13,7 @@
#include <QMessageBox>
#include <QSettings>
#include <math.h>
#include "../geocalc/geocalc.h"
#include "../qtviewer_planetosm/interface_utils.h"
/*!
* The plugin dynamic library (.dll in windows or .so in linux) will be loaded into memory only once.
...
...
@@ -132,8 +133,8 @@ QWidget * qtvplugin_grid::load_prop_window()
void
qtvplugin_grid
::
cb_paintEvent
(
QPainter
*
pImage
)
{
int
step_level
[
12
]
=
{
20
,
20
,
10
,
10
,
5
,
5
,
2
,
1
,
1
,
1
,
1
,
1
};
double
dstep_level
[
12
]
=
{
0.5
,
0.2
,
0.1
,
0.05
,
0.02
,
0.01
,
0.005
,
0.002
,
0.001
,
0.0005
,
0.0005
/
2
,
0.0005
/
4
};
int
step_level
[
12
]
=
{
20
,
20
,
10
,
10
,
5
,
5
,
2
,
1
,
1
,
1
,
1
,
1
};
double
dstep_level
[
12
]
=
{
0.5
,
0.2
,
0.1
,
0.05
,
0.02
,
0.01
,
0.005
,
0.002
,
0.001
,
0.0005
,
0.0005
/
2
,
0.0005
/
4
};
if
(
!
m_pVi
||
m_bVisible
==
false
)
return
;
QRect
rect
=
m_pVi
->
windowRect
();
...
...
@@ -208,7 +209,7 @@ void qtvplugin_grid::cb_paintEvent( QPainter * pImage )
if
(
false
==
m_pVi
->
CV_LLA2DP
(
lat
,
lon_right
,
&
DP_right
,
&
DP_bottom
))
continue
;
pImage
->
drawLine
(
DP_left
,
DP_top
,
DP_right
,
DP_bottom
);
sprintf
(
str
,
"%-9.4f"
,
lat
);
sprintf
(
str
,
"%-9.4f"
,
lat
);
pImage
->
drawText
(
DP_left
,
DP_top
-
8
,
str
);
}
for
(
double
lon
=
int
(
lon_left
*
(
1
/
step
)
-
1.5
)
*
step
;
lon
<=
int
(
lon_right
*
(
1
/
step
)
+
1.5
)
*
step
&&
m_pVi
->
level
()
>
0
;
lon
+=
step
)
...
...
@@ -227,7 +228,7 @@ void qtvplugin_grid::cb_paintEvent( QPainter * pImage )
dLon
+=
360
;
while
(
dLon
>
180
)
dLon
-=
360
;
sprintf
(
str
,
"%-9.4f"
,(
float
)
dLon
);
sprintf
(
str
,
"%-9.4f"
,(
float
)
dLon
);
pImage
->
drawText
(
DP_left
,
DP_bottom
-
16
,
str
);
}
...
...
@@ -245,37 +246,67 @@ void qtvplugin_grid::cb_paintEvent( QPainter * pImage )
}
//ellips_geodesic
static
const
int
maxBufSize
=
65536
*
4
;
static
std
::
shared_ptr
<
double
[][
3
]
>
lla_buf
(
new
double
[
maxBufSize
][
3
]);
static
std
::
shared_ptr
<
double
>
dis_buf
(
new
double
[
maxBufSize
]);
static
std
::
shared_ptr
<
double
>
ang_buf
(
new
double
[
maxBufSize
]);
double
(
*
pLLAbuf
)[
3
]
=
lla_buf
.
get
();
double
*
pDisbuf
=
dis_buf
.
get
();
double
*
pAngbuf
=
ang_buf
.
get
();
using
CES_GEOCALC
::
ellips_geodesic
;
int
x1
,
y1
,
x2
,
y2
;
int
sz
=
m_list_points
.
size
();
QPen
pen_text
(
QColor
(
0
,
0
,
255
));
for
(
int
i
=
0
;
i
<
sz
-
1
;
++
i
)
int
m_nZoom
=
m_pVi
->
level
();
for
(
int
i
=
0
;
i
<
sz
;
++
i
)
{
m_pVi
->
CV_LLA2DP
(
m_list_points
[
i
].
x
(),
m_list_points
[
i
].
y
(),
&
x1
,
&
y1
);
m_pVi
->
CV_LLA2DP
(
m_list_points
[
i
+
1
].
x
(),
m_list_points
[
i
+
1
].
y
(),
&
x2
,
&
y2
);
pImage
->
setPen
(
pen_area
);
pImage
->
drawLine
(
x1
,
y1
,
x2
,
y2
);
if
(
i
==
sz
-
1
&&
bFinished
)
break
;
QPointF
startP
=
m_list_points
[
i
];
QPointF
endP
=
(
i
<
sz
-
1
)
?
m_list_points
[
i
+
1
]
:
m_pt_end
;
//Calc rough dis using spere.
double
sita
;
double
dis
=
CalDistance
(
m_list_points
[
i
].
x
(),
m_list_points
[
i
+
1
].
x
(),
m_list_points
[
i
].
y
(),
m_list_points
[
i
+
1
].
y
(),
&
sita
);
sprintf
(
str
,
"%.2lfkm"
,
dis
/
1000.0
);
pImage
->
setPen
(
pen_text
);
QPointF
pos
=
QLineF
(
x1
,
y1
,
x2
,
y2
).
pointAt
(
i
*
0.8
/
sz
+
0.1
);
pImage
->
drawText
(
pos
,
str
);
}
if
(
bFinished
==
false
&&
sz
>
0
)
{
m_pVi
->
CV_LLA2DP
(
m_list_points
.
last
().
x
(),
m_list_points
.
last
().
y
(),
&
x1
,
&
y1
);
m_pVi
->
CV_LLA2DP
(
m_pt_end
.
x
(),
m_pt_end
.
y
(),
&
x2
,
&
y2
);
double
roughDis
=
CalDistance
(
startP
.
x
(),
endP
.
x
(),
startP
.
y
(),
endP
.
y
(),
&
sita
);
//Calc span
int
span
=
roughDis
/
1000
/
100
;
if
(
span
<
1
)
span
=
1
;
double
llaA
[
3
]{
startP
.
x
(),
startP
.
y
(),
0
},
llaB
[
3
]{
endP
.
x
(),
endP
.
y
(),
0
};
pImage
->
setPen
(
pen_area
);
pImage
->
drawLine
(
x1
,
y1
,
x2
,
y2
);
double
sita
;
double
dis
=
CalDistance
(
m_list_points
.
last
().
x
(),
m_pt_end
.
x
(),
m_list_points
.
last
().
y
(),
m_pt_end
.
y
(),
&
sita
);
sprintf
(
str
,
"%.1lfkm"
,
dis
/
1000.0
);
pImage
->
setPen
(
pen_text
);
QPointF
pos
=
QLineF
(
x1
,
y1
,
x2
,
y2
).
pointAt
(
1
*
0.8
/
sz
+
0.1
);
pImage
->
drawText
(
pos
,
str
);
int
nRes
=
ellips_geodesic
(
llaA
,
llaB
,
maxBufSize
,
span
,
pLLAbuf
,
nullptr
,
pDisbuf
,
pAngbuf
,
nullptr
,
false
,
true
,
1000
);
if
(
nRes
)
{
for
(
int
j
=
0
;
j
<
nRes
-
1
;
++
j
)
{
for
(
int
k
=-
1
;
k
<
2
;
++
k
)
{
m_pVi
->
CV_LLA2DP
(
pLLAbuf
[
j
][
0
],
pLLAbuf
[
j
][
1
]
+
k
*
360
,
&
x1
,
&
y1
);
m_pVi
->
CV_LLA2DP
(
pLLAbuf
[
j
+
1
][
0
],
pLLAbuf
[
j
+
1
][
1
]
+
k
*
360
,
&
x2
,
&
y2
);
if
(
fabs
(
pLLAbuf
[
j
][
1
]
-
pLLAbuf
[
j
+
1
][
1
])
<
90
)
{
pImage
->
drawLine
(
x1
,
y1
,
x2
,
y2
);
if
((((
j
+
1
)
%
20
==
0
)
&&
(
j
+
20
<
nRes
-
2
))
||
j
==
nRes
-
2
)
{
pImage
->
setPen
(
pen_text
);
pImage
->
drawEllipse
(
x2
-
3
,
y2
-
3
,
7
,
7
);
sprintf
(
str
,
"%.1lf"
,
pDisbuf
[
j
-
1
<
0
?
0
:
j
-
1
]
/
1000.0
);
pImage
->
drawText
(
QPoint
(
x2
,
y2
-
8
),
str
);
sprintf
(
str
,
"%.1lf"
,
pAngbuf
[
j
-
1
<
0
?
0
:
j
-
1
]);
pImage
->
drawText
(
QPoint
(
x2
,
y2
+
16
),
str
);
pImage
->
setPen
(
pen_area
);
}
}
}
}
}
}
pImage
->
setPen
(
oldpen
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录