Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
colorEagleStdio
qplanetosm
提交
3c83a95a
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 搜索 >>
提交
3c83a95a
编写于
4月 29, 2020
作者:
丁劲犇
😸
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.ActiveX need export DllRegisitServer.
2.Pixmap Items' coordinates should be recaled when level changed.
上级
51d26373
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
924 addition
and
924 deletion
+924
-924
qtviewer_planetosm/osm_frame_widget.cpp
qtviewer_planetosm/osm_frame_widget.cpp
+1
-1
qtviewer_planetosm/qtaxviewer_planetosm.def
qtviewer_planetosm/qtaxviewer_planetosm.def
+1
-0
qtvplugin_geomarker/geographicspixmapitem.cpp
qtvplugin_geomarker/geographicspixmapitem.cpp
+0
-30
qtvplugin_geomarker/geographicspixmapitem.h
qtvplugin_geomarker/geographicspixmapitem.h
+0
-2
qtvplugin_geomarker/geographicsscene.cpp
qtvplugin_geomarker/geographicsscene.cpp
+27
-0
qtvplugin_geomarker/geographicsscene.h
qtvplugin_geomarker/geographicsscene.h
+3
-0
qtvplugin_geomarker/qtvplugin_geomarker.cpp
qtvplugin_geomarker/qtvplugin_geomarker.cpp
+892
-891
未找到文件。
qtviewer_planetosm/osm_frame_widget.cpp
浏览文件 @
3c83a95a
qtviewer_planetosm/qtaxviewer_planetosm.def
浏览文件 @
3c83a95a
...
...
@@ -5,3 +5,4 @@ DllGetClassObject @2
DllRegisterServer @3
DllUnregisterServer @4
DumpIDL @5
DllInstall @6
qtvplugin_geomarker/geographicspixmapitem.cpp
浏览文件 @
3c83a95a
...
...
@@ -43,36 +43,6 @@ namespace QTVP_GEOMARKER{
QGraphicsPixmapItem
::
setTransformOriginPoint
(
oldlefttop_x
*
ratio
,
oldlefttop_y
*
ratio
);
}
}
void
geoGraphicsPixmapItem
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
/*= nullptr*/
)
{
if
(
vi
())
{
const
int
cv
=
vi
()
->
level
();
if
(
cv
!=
level
())
{
adjust_coords
(
cv
);
setLevel
(
cv
);
}
}
QGraphicsPixmapItem
::
paint
(
painter
,
option
,
widget
);
}
QRectF
geoGraphicsPixmapItem
::
boundingRect
()
const
{
QRectF
rect
=
QGraphicsPixmapItem
::
boundingRect
();
auto
v
=
vi
();
if
(
v
&&
v
->
level
()
!=
level
())
{
double
ratio
=
pow
(
2.0
,(
v
->
level
()
-
level
()));
QPointF
center
=
rect
.
center
();
rect
.
setRect
(
center
.
x
()
*
ratio
-
rect
.
width
()
/
2
,
center
.
y
()
*
ratio
-
rect
.
height
()
/
2
,
rect
.
width
(),
rect
.
height
());
}
return
rect
;
}
void
geoGraphicsPixmapItem
::
setPixmap
(
const
tag_icon
&
icon
)
{
this
->
m_pIcon
=
&
icon
;
...
...
qtvplugin_geomarker/geographicspixmapitem.h
浏览文件 @
3c83a95a
...
...
@@ -30,8 +30,6 @@ namespace QTVP_GEOMARKER{
,
const
tag_icon
*
pIcon
,
qreal
cent_lat
=
90
,
qreal
cent_lon
=
0
);
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
=
nullptr
)
override
;
QRectF
boundingRect
()
const
override
;
public:
const
tag_icon
*
icon
(){
return
m_pIcon
;}
qreal
lat
()
const
{
return
m_lat
;}
...
...
qtvplugin_geomarker/geographicsscene.cpp
浏览文件 @
3c83a95a
...
...
@@ -19,6 +19,27 @@ namespace QTVP_GEOMARKER{
:
QGraphicsScene
(
x
,
y
,
width
,
height
,
parent
)
{
}
/**
* @brief sequentially call virtual function geoItemBase::adjust_coords for every geoItemBase object.
*
* Since the scene coord will be zoomed in / out together with level change, all graphics items' coords should
* be recalculated in time. the method adjust_item_coords will do this automatically,
* @param newLevel the level to which current map is zoomed.
*/
void
geoGraphicsScene
::
adjust_item_coords
(
int
newLevel
)
{
currentNewLevel
=
newLevel
;
for
(
QSet
<
geoItemBase
*
>::
iterator
p
=
m_set_iconitems
.
begin
();
p
!=
m_set_iconitems
.
end
();
++
p
)
{
geoItemBase
*
base
=
*
p
;
base
->
adjust_coords
(
newLevel
);
//After adjust_coords above, the item "base" is considered to
// have a valid coord corresponds to current newLevel
base
->
setLevel
(
newLevel
);
}
}
bool
geoGraphicsScene
::
addItem
(
geoItemBase
*
item
,
int
/*reserved*/
)
{
...
...
@@ -35,12 +56,16 @@ namespace QTVP_GEOMARKER{
this
->
removeItem
(
oldItem
,
0
);
this
->
m_map_items
[
namec
]
=
item
;
this
->
addItem
(
pg
);
if
(
item
->
item_type
()
==
ITEAMTYPE_PIXMAP
)
m_set_iconitems
.
insert
(
item
);
}
}
else
{
this
->
addItem
(
pg
);
this
->
m_map_items
[
namec
]
=
item
;
if
(
item
->
item_type
()
==
ITEAMTYPE_PIXMAP
)
m_set_iconitems
.
insert
(
item
);
}
res
=
true
;
}
...
...
@@ -58,6 +83,8 @@ namespace QTVP_GEOMARKER{
{
this
->
removeItem
(
pg
);
m_map_items
.
remove
(
c_name
);
if
(
item
->
item_type
()
==
ITEAMTYPE_PIXMAP
)
m_set_iconitems
.
remove
(
item
);
delete
item
;
}
}
...
...
qtvplugin_geomarker/geographicsscene.h
浏览文件 @
3c83a95a
...
...
@@ -3,6 +3,7 @@
#include <QGraphicsScene>
#include <QMap>
#include <QSet>
namespace
QTVP_GEOMARKER
{
class
geoItemBase
;
/**
...
...
@@ -27,8 +28,10 @@ namespace QTVP_GEOMARKER{
geoGraphicsScene
(
const
QRectF
&
sceneRect
,
QObject
*
parent
=
0
);
geoGraphicsScene
(
qreal
x
,
qreal
y
,
qreal
width
,
qreal
height
,
QObject
*
parent
=
0
);
int
currentLevel
()
const
{
return
currentNewLevel
;}
void
adjust_item_coords
(
int
currentLevel
);
private:
QMap
<
QString
,
geoItemBase
*
>
m_map_items
;
QSet
<
geoItemBase
*
>
m_set_iconitems
;
int
currentNewLevel
;
//Overload public functions to provate.
QGraphicsEllipseItem
*
addEllipse
(
const
QRectF
&
rect
,
const
QPen
&
pen
=
QPen
(),
const
QBrush
&
brush
=
QBrush
())
...
...
qtvplugin_geomarker/qtvplugin_geomarker.cpp
浏览文件 @
3c83a95a
...
...
@@ -295,6 +295,7 @@ void qtvplugin_geomarker::cb_levelChanged(int level)
//Adjust new Scene rect
QRectF
rect
(
0
,
0
,
256
*
(
1
<<
level
),
256
*
(
1
<<
level
));
this
->
set_visible
(
false
);
m_pScene
->
adjust_item_coords
(
level
);
m_pScene
->
setSceneRect
(
rect
);
this
->
set_visible
(
true
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录