Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
colorEagleStdio
qplanetosm
提交
51d26373
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 搜索 >>
提交
51d26373
编写于
4月 20, 2020
作者:
丁劲犇
😸
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Major improvement of geomarker.
上级
3279f746
变更
25
展开全部
隐藏空白更改
内联
并排
Showing
25 changed file
with
1404 addition
and
1261 deletion
+1404
-1261
qplanetosm.pro
qplanetosm.pro
+4
-3
qtvplugin_geomarker/geographicsellipseitem.cpp
qtvplugin_geomarker/geographicsellipseitem.cpp
+30
-1
qtvplugin_geomarker/geographicsellipseitem.h
qtvplugin_geomarker/geographicsellipseitem.h
+9
-8
qtvplugin_geomarker/geographicslineitem.cpp
qtvplugin_geomarker/geographicslineitem.cpp
+29
-1
qtvplugin_geomarker/geographicslineitem.h
qtvplugin_geomarker/geographicslineitem.h
+9
-8
qtvplugin_geomarker/geographicsmultilineitem.cpp
qtvplugin_geomarker/geographicsmultilineitem.cpp
+30
-1
qtvplugin_geomarker/geographicsmultilineitem.h
qtvplugin_geomarker/geographicsmultilineitem.h
+9
-12
qtvplugin_geomarker/geographicspixmapitem.cpp
qtvplugin_geomarker/geographicspixmapitem.cpp
+30
-1
qtvplugin_geomarker/geographicspixmapitem.h
qtvplugin_geomarker/geographicspixmapitem.h
+9
-8
qtvplugin_geomarker/geographicspolygonitem.cpp
qtvplugin_geomarker/geographicspolygonitem.cpp
+30
-1
qtvplugin_geomarker/geographicspolygonitem.h
qtvplugin_geomarker/geographicspolygonitem.h
+9
-8
qtvplugin_geomarker/geographicsrectitem.cpp
qtvplugin_geomarker/geographicsrectitem.cpp
+31
-1
qtvplugin_geomarker/geographicsrectitem.h
qtvplugin_geomarker/geographicsrectitem.h
+9
-8
qtvplugin_geomarker/geographicsscene.cpp
qtvplugin_geomarker/geographicsscene.cpp
+1
-48
qtvplugin_geomarker/geographicsscene.h
qtvplugin_geomarker/geographicsscene.h
+2
-6
qtvplugin_geomarker/geoitembase.h
qtvplugin_geomarker/geoitembase.h
+4
-6
qtvplugin_geomarker/qtvplugin_geomarker.cpp
qtvplugin_geomarker/qtvplugin_geomarker.cpp
+891
-925
qtvplugin_geomarker/qtvplugin_geomarker.h
qtvplugin_geomarker/qtvplugin_geomarker.h
+0
-1
qtvplugin_geomarker/qtvplugin_geomarker_uimethods.cpp
qtvplugin_geomarker/qtvplugin_geomarker_uimethods.cpp
+27
-40
test_container/test_container.pro
test_container/test_container.pro
+2
-0
test_container/testcontainer.cpp
test_container/testcontainer.cpp
+26
-1
test_container/testcontainer.h
test_container/testcontainer.h
+2
-2
test_container/testcontainer.ui
test_container/testcontainer.ui
+92
-85
test_container/testcontainer_linux.cpp
test_container/testcontainer_linux.cpp
+27
-1
test_container/testcontainer_linux.ui
test_container/testcontainer_linux.ui
+92
-85
未找到文件。
qplanetosm.pro
浏览文件 @
51d26373
...
...
@@ -11,10 +11,11 @@ SUBDIRS += \
qtwidget_planetosm
.
file
=
qtviewer_planetosm
/
qtwidget_planetosm
.
pro
win32
:
{
contains
(
DEFINES
,
BUILD_ACTIVEX_OSM
){
win32
:
contains
(
DEFINES
,
BUILD_ACTIVEX_OSM
)
{
message
(
"Build ActiveX!"
)
SUBDIRS
+=
\
qtaxviewer_planetosm
qtaxviewer_planetosm
.
file
=
qtviewer_planetosm
/
qtaxviewer_planetosm
.
pro
}
}
else
{
message
(
"Do NOT Build ActiveX!"
)
}
qtvplugin_geomarker/geographicsellipseitem.cpp
浏览文件 @
51d26373
#include "geographicsellipseitem.h"
#
include
"geographicsellipseitem.h"
#include "../qtviewer_planetosm/osmtiles/viewer_interface.h"
#include <assert.h>
#include <QGraphicsSceneMouseEvent>
...
...
@@ -43,6 +43,35 @@ namespace QTVP_GEOMARKER{
}
}
void
geoGraphicsEllipseItem
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
/*= nullptr*/
)
{
if
(
vi
())
{
const
int
cv
=
vi
()
->
level
();
if
(
cv
!=
level
())
{
adjust_coords
(
cv
);
setLevel
(
cv
);
}
}
QGraphicsEllipseItem
::
paint
(
painter
,
option
,
widget
);
}
QRectF
geoGraphicsEllipseItem
::
boundingRect
()
const
{
QRectF
rect
=
QGraphicsEllipseItem
::
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
geoGraphicsEllipseItem
::
setSize
(
qreal
pxwidth
,
qreal
pxheight
)
{
double
px
,
py
;
...
...
qtvplugin_geomarker/geographicsellipseitem.h
浏览文件 @
51d26373
#ifndef GEOGRAPHICSELLIPSEITEM_H
#
ifndef
GEOGRAPHICSELLIPSEITEM_H
#define GEOGRAPHICSELLIPSEITEM_H
#include <QGraphicsEllipseItem>
...
...
@@ -12,16 +12,20 @@ namespace QTVP_GEOMARKER{
qreal
m_width
;
qreal
m_height
;
protected:
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
mouseDoubleClickEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
);
void
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
);
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
override
;
void
mouseDoubleClickEvent
(
QGraphicsSceneMouseEvent
*
event
)
override
;
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
)
override
;
void
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
)
override
;
void
adjust_coords
(
int
nNewLevel
)
override
;
QPointF
label_pos
()
override
;
public:
explicit
geoGraphicsEllipseItem
(
QString
name
,
QTVOSM
::
viewer_interface
*
pVi
,
qreal
cent_lat
=
90
,
qreal
cent_lon
=
0
,
qreal
pxwidth
=
8
,
qreal
pxheight
=
8
);
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
=
nullptr
)
override
;
QRectF
boundingRect
()
const
override
;
public:
qreal
lat
()
const
{
return
m_lat
;}
qreal
lon
()
const
{
return
m_lon
;}
...
...
@@ -29,9 +33,6 @@ namespace QTVP_GEOMARKER{
qreal
height
()
const
{
return
m_height
;}
void
setSize
(
qreal
pxwidth
,
qreal
pxheight
);
void
setGeo
(
qreal
cent_lat
,
qreal
cent_lon
);
void
adjust_coords
(
int
nNewLevel
);
QPointF
label_pos
();
QPointF
center_pos
(){
return
rect
().
center
();}
};
}
#endif // GEOGRAPHICSELLIPSEITEM_H
qtvplugin_geomarker/geographicslineitem.cpp
浏览文件 @
51d26373
#include "geographicslineitem.h"
#
include
"geographicslineitem.h"
#include "../qtviewer_planetosm/osmtiles/viewer_interface.h"
#include <assert.h>
#include <QGraphicsSceneMouseEvent>
...
...
@@ -60,7 +60,35 @@ namespace QTVP_GEOMARKER{
setLine
(
l1
.
x1
()
*
ratio
,
l1
.
y1
()
*
ratio
,
l1
.
x2
()
*
ratio
,
l1
.
y2
()
*
ratio
);
}
}
void
geoGraphicsLineItem
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
/*= nullptr*/
)
{
if
(
vi
())
{
const
int
cv
=
vi
()
->
level
();
if
(
cv
!=
level
())
{
adjust_coords
(
cv
);
setLevel
(
cv
);
}
}
QGraphicsLineItem
::
paint
(
painter
,
option
,
widget
);
}
QRectF
geoGraphicsLineItem
::
boundingRect
()
const
{
QRectF
rect
=
QGraphicsLineItem
::
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
geoGraphicsLineItem
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
QGraphicsLineItem
::
mousePressEvent
(
event
);
...
...
qtvplugin_geomarker/geographicslineitem.h
浏览文件 @
51d26373
#ifndef GEOGRAPHICSLINEITEM_H
#
ifndef
GEOGRAPHICSLINEITEM_H
#define GEOGRAPHICSLINEITEM_H
#include <QGraphicsLineItem>
...
...
@@ -13,10 +13,12 @@ namespace QTVP_GEOMARKER{
qreal
m_lon2
;
void
unwarrp
();
protected:
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
mouseDoubleClickEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
);
void
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
);
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
override
;
void
mouseDoubleClickEvent
(
QGraphicsSceneMouseEvent
*
event
)
override
;
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
)
override
;
void
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
)
override
;
void
adjust_coords
(
int
nNewLevel
)
override
;
QPointF
label_pos
()
override
;
public:
explicit
geoGraphicsLineItem
(
QString
name
,
QTVOSM
::
viewer_interface
*
pVi
,
qreal
lat1
=
90
,
...
...
@@ -24,15 +26,14 @@ namespace QTVP_GEOMARKER{
qreal
lat2
=
90
,
qreal
lon2
=
0
);
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
=
nullptr
)
override
;
QRectF
boundingRect
()
const
override
;
public:
qreal
lat1
()
const
{
return
m_lat1
;}
qreal
lon1
()
const
{
return
m_lon1
;}
qreal
lat2
()
const
{
return
m_lat2
;}
qreal
lon2
()
const
{
return
m_lon2
;}
void
setGeo
(
qreal
lat1
,
qreal
lon1
,
qreal
lat2
,
qreal
lon2
);
void
adjust_coords
(
int
nNewLevel
);
QPointF
label_pos
();
QPointF
center_pos
(){
return
this
->
line
().
pointAt
(
0.5
);}
};
}
#endif // GEOGRAPHICSLINEITEM_H
qtvplugin_geomarker/geographicsmultilineitem.cpp
浏览文件 @
51d26373
#include "geographicsmultilineitem.h"
#
include
"geographicsmultilineitem.h"
#include "../qtviewer_planetosm/osmtiles/viewer_interface.h"
#include <assert.h>
#include <QGraphicsSceneMouseEvent>
...
...
@@ -68,6 +68,35 @@ namespace QTVP_GEOMARKER{
this
->
setPath
(
p
);
}
}
void
geoGraphicsMultilineItem
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
/*= nullptr*/
)
{
if
(
vi
())
{
const
int
cv
=
vi
()
->
level
();
if
(
cv
!=
level
())
{
adjust_coords
(
cv
);
setLevel
(
cv
);
}
}
QGraphicsPathItem
::
paint
(
painter
,
option
,
widget
);
}
QRectF
geoGraphicsMultilineItem
::
boundingRect
()
const
{
QRectF
rect
=
QGraphicsPathItem
::
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
geoGraphicsMultilineItem
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
...
...
qtvplugin_geomarker/geographicsmultilineitem.h
浏览文件 @
51d26373
#ifndef GEOGRAPHICSMULTILINEITEM_H
#
ifndef
GEOGRAPHICSMULTILINEITEM_H
#define GEOGRAPHICSMULTILINEITEM_H
#include <QGraphicsPathItem>
...
...
@@ -11,24 +11,21 @@ namespace QTVP_GEOMARKER{
QPolygonF
m_llap
;
void
unwarrp
();
protected:
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
mouseDoubleClickEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
);
void
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
);
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
override
;
void
mouseDoubleClickEvent
(
QGraphicsSceneMouseEvent
*
event
)
override
;
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
)
override
;
void
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
)
override
;
void
adjust_coords
(
int
nNewLevel
)
override
;
QPointF
label_pos
()
override
;
public:
explicit
geoGraphicsMultilineItem
(
QString
name
,
QTVOSM
::
viewer_interface
*
pVi
,
const
QPolygonF
&
lla_polygon
);
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
=
nullptr
)
override
;
QRectF
boundingRect
()
const
override
;
public:
QPolygonF
llas
()
const
{
return
m_llap
;}
void
setGeo
(
const
QPolygonF
&
lla_polygon
);
void
adjust_coords
(
int
nNewLevel
);
QPointF
label_pos
();
QPointF
center_pos
(){
qreal
x
=
path
().
elementAt
(
0
).
x
;
qreal
y
=
path
().
elementAt
(
0
).
y
;
return
QPointF
(
x
,
y
);
}
};
}
#endif // geoGraphicsMultilineItem_H
qtvplugin_geomarker/geographicspixmapitem.cpp
浏览文件 @
51d26373
#include "geographicspixmapitem.h"
#
include
"geographicspixmapitem.h"
#include "../qtviewer_planetosm/osmtiles/viewer_interface.h"
#include <assert.h>
#include <math.h>
...
...
@@ -43,6 +43,35 @@ 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
)
{
...
...
qtvplugin_geomarker/geographicspixmapitem.h
浏览文件 @
51d26373
#ifndef GEOGRAPHICSPIXMAPITEM_H
#
ifndef
GEOGRAPHICSPIXMAPITEM_H
#define GEOGRAPHICSPIXMAPITEM_H
#include <QGraphicsPixmapItem>
...
...
@@ -19,24 +19,25 @@ namespace QTVP_GEOMARKER{
qreal
m_lon
;
const
tag_icon
*
m_pIcon
;
protected:
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
mouseDoubleClickEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
);
void
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
);
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
override
;
void
mouseDoubleClickEvent
(
QGraphicsSceneMouseEvent
*
event
)
override
;
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
)
override
;
void
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
)
override
;
void
adjust_coords
(
int
ncurrLevel
)
override
;
QPointF
label_pos
()
override
;
public:
explicit
geoGraphicsPixmapItem
(
QString
name
,
QTVOSM
::
viewer_interface
*
pVi
,
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
;}
qreal
lon
()
const
{
return
m_lon
;}
void
setGeo
(
qreal
cent_lat
,
qreal
cent_lon
);
void
setPixmap
(
const
tag_icon
&
icon
);
void
adjust_coords
(
int
ncurrLevel
);
QPointF
label_pos
();
QPointF
center_pos
(){
return
offset
();}
};
}
#endif // GEOGRAPHICSELLIPSEITEM_H
qtvplugin_geomarker/geographicspolygonitem.cpp
浏览文件 @
51d26373
#include "geographicspolygonitem.h"
#
include
"geographicspolygonitem.h"
#include "../qtviewer_planetosm/osmtiles/viewer_interface.h"
#include <assert.h>
#include <QGraphicsSceneMouseEvent>
...
...
@@ -68,6 +68,35 @@ namespace QTVP_GEOMARKER{
this
->
setPolygon
(
p
);
}
}
void
geoGraphicsPolygonItem
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
/*= nullptr*/
)
{
if
(
vi
())
{
const
int
cv
=
vi
()
->
level
();
if
(
cv
!=
level
())
{
adjust_coords
(
cv
);
setLevel
(
cv
);
}
}
QGraphicsPolygonItem
::
paint
(
painter
,
option
,
widget
);
}
QRectF
geoGraphicsPolygonItem
::
boundingRect
()
const
{
QRectF
rect
=
QGraphicsPolygonItem
::
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
geoGraphicsPolygonItem
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
...
...
qtvplugin_geomarker/geographicspolygonitem.h
浏览文件 @
51d26373
#ifndef GEOGRAPHICSPOLYGONITEM_H
#
ifndef
GEOGRAPHICSPOLYGONITEM_H
#define GEOGRAPHICSPOLYGONITEM_H
#include <QGraphicsPolygonItem>
...
...
@@ -11,20 +11,21 @@ namespace QTVP_GEOMARKER{
QPolygonF
m_llap
;
void
unwarrp
();
protected:
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
mouseDoubleClickEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
);
void
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
);
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
override
;
void
mouseDoubleClickEvent
(
QGraphicsSceneMouseEvent
*
event
)
override
;
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
)
override
;
void
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
)
override
;
void
adjust_coords
(
int
nNewLevel
)
override
;
QPointF
label_pos
()
override
;
public:
explicit
geoGraphicsPolygonItem
(
QString
name
,
QTVOSM
::
viewer_interface
*
pVi
,
const
QPolygonF
&
lla_polygon
);
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
=
nullptr
)
override
;
QRectF
boundingRect
()
const
override
;
public:
QPolygonF
llas
()
const
{
return
m_llap
;}
void
setGeo
(
const
QPolygonF
&
lla_polygon
);
void
adjust_coords
(
int
nNewLevel
);
QPointF
label_pos
();
QPointF
center_pos
(){
return
this
->
polygon
().
first
();}
};
}
#endif // GEOGRAPHICSPOLYGONITEM_H
qtvplugin_geomarker/geographicsrectitem.cpp
浏览文件 @
51d26373
#include "geographicsrectitem.h"
#
include
"geographicsrectitem.h"
#include "../qtviewer_planetosm/osmtiles/viewer_interface.h"
#include <assert.h>
#include <math.h>
...
...
@@ -44,6 +44,36 @@ namespace QTVP_GEOMARKER{
rect
.
height
());
}
}
void
geoGraphicsRectItem
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
/*= nullptr*/
)
{
if
(
vi
())
{
const
int
cv
=
vi
()
->
level
();
if
(
cv
!=
level
())
{
adjust_coords
(
cv
);
setLevel
(
cv
);
}
}
QGraphicsRectItem
::
paint
(
painter
,
option
,
widget
);
}
QRectF
geoGraphicsRectItem
::
boundingRect
()
const
{
QRectF
rect
=
QGraphicsRectItem
::
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
geoGraphicsRectItem
::
setSize
(
qreal
pxwidth
,
qreal
pxheight
)
{
...
...
qtvplugin_geomarker/geographicsrectitem.h
浏览文件 @
51d26373
#ifndef GEOGRAPHICSRECTITEM_H
#
ifndef
GEOGRAPHICSRECTITEM_H
#define GEOGRAPHICSRECTITEM_H
#include <QGraphicsRectItem>
...
...
@@ -12,16 +12,19 @@ namespace QTVP_GEOMARKER{
qreal
m_width
;
qreal
m_height
;
protected:
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
mouseDoubleClickEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
);
void
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
);
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
override
;
void
mouseDoubleClickEvent
(
QGraphicsSceneMouseEvent
*
event
)
override
;
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
)
override
;
void
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
)
override
;
void
adjust_coords
(
int
ncurrLevel
)
override
;
public:
explicit
geoGraphicsRectItem
(
QString
name
,
QTVOSM
::
viewer_interface
*
pVi
,
qreal
cent_lat
=
90
,
qreal
cent_lon
=
0
,
qreal
pxwidth
=
8
,
qreal
pxheight
=
8
);
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
=
nullptr
)
override
;
QRectF
boundingRect
()
const
override
;
public:
qreal
lat
()
const
{
return
m_lat
;}
qreal
lon
()
const
{
return
m_lon
;}
...
...
@@ -29,9 +32,7 @@ namespace QTVP_GEOMARKER{
qreal
height
()
const
{
return
m_height
;}
void
setSize
(
qreal
pxwidth
,
qreal
pxheight
);
void
setGeo
(
qreal
cent_lat
,
qreal
cent_lon
);
void
adjust_coords
(
int
ncurrLevel
);
QPointF
label_pos
();
QPointF
center_pos
(){
return
rect
().
center
();}
QPointF
label_pos
()
override
;
};
}
#endif // GEOGRAPHICSELLIPSEITEM_H
qtvplugin_geomarker/geographicsscene.cpp
浏览文件 @
51d26373
#include "geographicsscene.h"
#
include
"geographicsscene.h"
#include "geoitembase.h"
#include <QGraphicsItem>
#include <algorithm>
...
...
@@ -64,53 +64,6 @@ namespace QTVP_GEOMARKER{
}
/**
* @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
;
if
(
total_items
()
<
1024
)
{
for
(
QMap
<
QString
,
geoItemBase
*
>::
iterator
p
=
m_map_items
.
begin
();
p
!=
m_map_items
.
end
();
++
p
)
{
geoItemBase
*
base
=
p
.
value
();
//when this function is called, base->level() is the old level from which
// current map is zoomed.
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
);
}
}
else
m_queue_level_change
=
geo_items
();
}
bool
geoGraphicsScene
::
deal_level_queue
()
{
int
bneedref
=
0
;
for
(
int
i
=
0
;
i
<
1024
&&
m_queue_level_change
.
empty
()
==
false
;
++
i
)
{
++
bneedref
;
geoItemBase
*
base
=
m_queue_level_change
.
first
();
m_queue_level_change
.
pop_front
();
//when this function is called, base->level() is the old level from which
// current map is zoomed.
base
->
adjust_coords
(
currentNewLevel
);
//After adjust_coords above, the item "base" is considered to
// have a valid coord corresponds to current newLevel
base
->
setLevel
(
currentNewLevel
);
}
if
(
m_queue_level_change
.
empty
()
==
true
&&
bneedref
)
return
true
;
return
false
;
}
geoItemBase
*
geoGraphicsScene
::
geoitem_by_name
(
const
QString
&
name
)
{
...
...
qtvplugin_geomarker/geographicsscene.h
浏览文件 @
51d26373
#ifndef GEOGRAPHICSSCENE_H
#
ifndef
GEOGRAPHICSSCENE_H
#define GEOGRAPHICSSCENE_H
#include <QGraphicsScene>
...
...
@@ -26,10 +26,10 @@ namespace QTVP_GEOMARKER{
geoGraphicsScene
(
QObject
*
parent
=
0
);
geoGraphicsScene
(
const
QRectF
&
sceneRect
,
QObject
*
parent
=
0
);
geoGraphicsScene
(
qreal
x
,
qreal
y
,
qreal
width
,
qreal
height
,
QObject
*
parent
=
0
);
int
currentLevel
()
const
{
return
currentNewLevel
;}
private:
QMap
<
QString
,
geoItemBase
*
>
m_map_items
;
int
currentNewLevel
;
QList
<
geoItemBase
*
>
m_queue_level_change
;
//Overload public functions to provate.
QGraphicsEllipseItem
*
addEllipse
(
const
QRectF
&
rect
,
const
QPen
&
pen
=
QPen
(),
const
QBrush
&
brush
=
QBrush
())
{
return
QGraphicsScene
::
addEllipse
(
rect
,
pen
,
brush
);}
...
...
@@ -58,14 +58,10 @@ namespace QTVP_GEOMARKER{
void
addItem
(
QGraphicsItem
*
item
){
return
QGraphicsScene
::
addItem
(
item
);}
void
removeItem
(
QGraphicsItem
*
item
){
return
QGraphicsScene
::
removeItem
(
item
);}
public
:
//for many items, we just change level coords in timer, batch mode.
bool
deal_level_queue
();
double
progress_queue
()
{
return
1
-
m_queue_level_change
.
size
()
*
1.0
/
m_map_items
.
size
();}
//For mutithread opertaions, you should call lock_scene first, and call unlock scene when over
bool
addItem
(
geoItemBase
*
item
,
int
/*reserved*/
);
void
removeItem
(
geoItemBase
*
item
,
int
/*reserved*/
);
geoItemBase
*
geoitem_by_name
(
const
QString
&
name
);
void
adjust_item_coords
(
int
currentLevel
);
QList
<
geoItemBase
*>
geo_items
();
QList
<
QString
>
geo_item_names
();
int
total_items
()
{
return
m_map_items
.
count
();}
...
...
qtvplugin_geomarker/geoitembase.h
浏览文件 @
51d26373
#ifndef GEOITEMBASE_H
#
ifndef
GEOITEMBASE_H
#define GEOITEMBASE_H
#include <QPointF>
#include <QRectF>
...
...
@@ -69,8 +69,10 @@ namespace QTVP_GEOMARKER{
protected:
void
setLevel
(
int
currlevel
);
QTVOSM
::
viewer_interface
*
vi
(){
return
m_pVi
;}
virtual
void
adjust_coords
(
int
nNewLevel
)
=
0
;
virtual
QPointF
label_pos
()
=
0
;
public:
int
level
()
{
return
m_nCurrentLevel
;}
int
level
()
const
{
return
m_nCurrentLevel
;}
geo_item_type
item_type
()
const
{
return
m_type
;}
void
set_item_type
(
geo_item_type
tp
)
{
m_type
=
tp
;}
QString
item_name
()
const
{
return
m_name
;}
...
...
@@ -93,10 +95,6 @@ namespace QTVP_GEOMARKER{
bool
props_visible
();
bool
is_selected
();
void
set_selected
(
bool
bsel
);
public:
virtual
void
adjust_coords
(
int
nNewLevel
)
=
0
;
virtual
QPointF
label_pos
()
=
0
;
virtual
QPointF
center_pos
()
=
0
;
};
}
#endif // GEOITEMBASE_H
qtvplugin_geomarker/qtvplugin_geomarker.cpp
浏览文件 @
51d26373
此差异已折叠。
点击以展开。
qtvplugin_geomarker/qtvplugin_geomarker.h
浏览文件 @
51d26373
...
...
@@ -112,7 +112,6 @@ private:
*/
int
m_nTimerID_refreshUI
;
int
m_nTimerID_refreshMap
;
int
m_nTimerID_levelQueue
;
quint64
m_nDivideTimer
;
bool
m_bNeedRefresh
;
bool
m_bNeedUpdateView
;
...
...
qtvplugin_geomarker/qtvplugin_geomarker_uimethods.cpp
浏览文件 @
51d26373
#include "qtvplugin_geomarker.h"
#
include
"qtvplugin_geomarker.h"
#include "ui_qtvplugin_geomarker.h"
#include <QSettings>
#include <QColorDialog>
...
...
@@ -60,19 +60,6 @@ void qtvplugin_geomarker::timerEvent(QTimerEvent * e)
m_pVi
->
UpdateWindow
();
m_nTimerID_refreshMap
=
startTimer
(
97
);
}
else
if
(
m_nTimerID_levelQueue
==
e
->
timerId
())
{
killTimer
(
m_nTimerID_levelQueue
);
++
m_nDivideTimer
;
if
(
true
==
m_pScene
->
deal_level_queue
())
m_pVi
->
UpdateWindow
();
else
if
(
m_nDivideTimer
%
20
==
0
)
{
if
(
m_pScene
->
progress_queue
()
<
0.999
)
m_pVi
->
UpdateWindow
();
}
m_nTimerID_levelQueue
=
startTimer
(
119
);
}
}
...
...
@@ -814,18 +801,18 @@ void qtvplugin_geomarker::on_pushButton_QTV_save_clicked()
);
if
(
newfm
.
size
()
>
2
)
{
if
(
newfm
.
right
(
3
).
toUpper
()
==
"XML"
)
{
if
(
true
==
xml_save
(
newfm
))
{
settings
.
setValue
(
"history/last_save_xml_dir"
,
newfm
);
//QMessageBox::information(this,tr("succeed"),tr("Successfully saved XML file") + newfm);
}
else
QMessageBox
::
warning
(
this
,
tr
(
"failed"
),
tr
(
"Save XML file"
)
+
newfm
+
tr
(
" Failed"
));
}
else
{
if
(
newfm
.
right
(
3
).
toUpper
()
==
"XML"
)
{
if
(
true
==
xml_save
(
newfm
))
{
settings
.
setValue
(
"history/last_save_xml_dir"
,
newfm
);
//QMessageBox::information(this,tr("succeed"),tr("Successfully saved XML file") + newfm);
}
else
QMessageBox
::
warning
(
this
,
tr
(
"failed"
),
tr
(
"Save XML file"
)
+
newfm
+
tr
(
" Failed"
));
}
else
{
if
(
true
==
cmd_save
(
newfm
))
{
settings
.
setValue
(
"history/last_save_xml_dir"
,
newfm
);
...
...
@@ -833,7 +820,7 @@ void qtvplugin_geomarker::on_pushButton_QTV_save_clicked()
}
else
QMessageBox
::
warning
(
this
,
tr
(
"failed"
),
tr
(
"Save CMD file"
)
+
newfm
+
tr
(
" Failed"
));
}
}
}
}
...
...
@@ -846,18 +833,18 @@ void qtvplugin_geomarker::on_pushButton_QTV_load_clicked()
);
if
(
newfm
.
size
()
>
2
)
{
if
(
newfm
.
right
(
3
).
toUpper
()
==
"XML"
)
{
if
(
true
==
xml_load
(
newfm
))
{
settings
.
setValue
(
"history/last_open_xml_dir"
,
newfm
);
//QMessageBox::information(this,tr("succeed"),tr("Successfully load XML file") + newfm);
}
else
QMessageBox
::
warning
(
this
,
tr
(
"failed"
),
tr
(
"Load XML file"
)
+
newfm
+
tr
(
" Failed"
));
}
else
{
if
(
newfm
.
right
(
3
).
toUpper
()
==
"XML"
)
{
if
(
true
==
xml_load
(
newfm
))
{
settings
.
setValue
(
"history/last_open_xml_dir"
,
newfm
);
//QMessageBox::information(this,tr("succeed"),tr("Successfully load XML file") + newfm);
}
else
QMessageBox
::
warning
(
this
,
tr
(
"failed"
),
tr
(
"Load XML file"
)
+
newfm
+
tr
(
" Failed"
));
}
else
{
if
(
true
==
cmd_load
(
newfm
))
{
settings
.
setValue
(
"history/last_open_xml_dir"
,
newfm
);
...
...
@@ -865,7 +852,7 @@ void qtvplugin_geomarker::on_pushButton_QTV_load_clicked()
}
else
QMessageBox
::
warning
(
this
,
tr
(
"failed"
),
tr
(
"Load CMD file"
)
+
newfm
+
tr
(
" Failed"
));
}
}
}
scheduleRefreshMarks
();
m_pVi
->
UpdateWindow
();
...
...
test_container/test_container.pro
浏览文件 @
51d26373
...
...
@@ -23,12 +23,14 @@ HEADERS += testcontainer.h
DEFINES
+=
BUILD_ACTIVEX_OSM
win32
:
contains
(
DEFINES
,
BUILD_ACTIVEX_OSM
){
message
(
"Invoke ActiveX!"
);
FORMS
+=
testcontainer
.
ui
SOURCES
+=
testcontainer
.
cpp
win32
-
g
++
{
QMAKE_CXXFLAGS
+=
-
std
=
c
++
11
}
}
else
{
message
(
"Not Invoke ActiveX!"
);
FORMS
+=
testcontainer_linux
.
ui
SOURCES
+=
testcontainer_linux
.
cpp
}
...
...
test_container/testcontainer.cpp
浏览文件 @
51d26373
#include "testcontainer.h"
#
include
"testcontainer.h"
#include "ui_testcontainer.h"
#include <QAxBase>
#include <QDebug>
...
...
@@ -584,3 +584,28 @@ void testcontainer::on_pushButton_QTV_default_style_clicked()
QMessageBox
::
information
(
this
,
"geomarker::selection_delete"
,
res
);
}
void
testcontainer
::
on_pushButton_QTV_test_10000_clicked
()
{
for
(
int
i
=
0
;
i
<
10000
;
++
i
)
{
ui
->
osmmap
->
osm_layer_call_function
(
"geomarker"
,
QString
(
"function=update_point;name=ID%1;type=%2;"
"lat=%3;lon=%4;"
"style_pen=1;color_pen=%5,%6,%7,128;"
"width_pen=1;style_brush=1;color_brush=%7,%6,%5,128;"
"width=%8;height=%9;"
)
.
arg
(
i
+
10
)
.
arg
(
rand
()
%
2
+
1
)
.
arg
((
rand
()
%
17000
-
8500
)
/
100.0
)
.
arg
((
rand
()
%
18000
-
9000
)
/
50.0
)
.
arg
(
rand
()
%
255
)
.
arg
(
rand
()
%
255
)
.
arg
(
rand
()
%
255
)
.
arg
(
rand
()
%
16
+
4
)
.
arg
(
rand
()
%
16
+
4
)
);
}
}
test_container/testcontainer.h
浏览文件 @
51d26373
#ifndef TESTCONTAINER_H
#
ifndef
TESTCONTAINER_H
#define TESTCONTAINER_H
#include <QDialog>
...
...
@@ -45,7 +45,7 @@ protected slots:
void
on_pushButton_QTV_test_geo_del_sel_clicked
();
void
on_pushButton_QTV_default_style_clicked
();
void
on_osmmap_map_event
(
QMap
<
QString
,
QVariant
>
p
);
void
on_pushButton_QTV_test_10000_clicked
();
};
#endif // TESTCONTAINER_H
test_container/testcontainer.ui
浏览文件 @
51d26373
...
...
@@ -16,17 +16,37 @@
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"
3"
column=
"0
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
cach
e"
>
<item
row=
"
7"
column=
"1
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
layer_mov
e"
>
<property
name=
"text"
>
<string>
cache Fold
er
</string>
<string>
order a lay
er
</string>
</property>
</widget>
</item>
<item
row=
"13"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_polygon"
>
<item
row=
"19"
column=
"0"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
40
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"13"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_request"
>
<property
name=
"text"
>
<string>
add a polygon
</string>
<string>
get info
</string>
</property>
</widget>
</item>
<item
row=
"8"
column=
"1"
>
<widget
class=
"QLabel"
name=
"label_QTV_5"
>
<property
name=
"text"
>
<string>
Grid measure
</string>
</property>
</widget>
</item>
...
...
@@ -37,73 +57,73 @@
</property>
</widget>
</item>
<item
row=
"
9
"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
grid_enable
"
>
<item
row=
"
7
"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
layers
"
>
<property
name=
"text"
>
<string>
measure on/off
</string>
<string>
enum layers
</string>
</property>
</widget>
</item>
<item
row=
"
8
"
column=
"1"
>
<widget
class=
"Q
Label"
name=
"label_QTV_5
"
>
<item
row=
"
1
"
column=
"1"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_autodl
"
>
<property
name=
"text"
>
<string>
Grid measure
</string>
<string>
connect
</string>
</property>
</widget>
</item>
<item
row=
"
6
"
column=
"0"
>
<widget
class=
"Q
Label"
name=
"label_QTV_3
"
>
<item
row=
"
15
"
column=
"0"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_geo_displayMod
"
>
<property
name=
"text"
>
<string>
Layer control
</string>
<string>
display mod
</string>
</property>
</widget>
</item>
<item
row=
"1
1"
column=
"1
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
line
"
>
<item
row=
"1
"
column=
"0
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
adds
"
>
<property
name=
"text"
>
<string>
add
a line
</string>
<string>
add
ress
</string>
</property>
</widget>
</item>
<item
row=
"
5"
column=
"0
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
navigat
e"
>
<item
row=
"
11"
column=
"1
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
lin
e"
>
<property
name=
"text"
>
<string>
navigat
e
</string>
<string>
add a lin
e
</string>
</property>
</widget>
</item>
<item
row=
"1
3
"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_
test_request
"
>
<item
row=
"1
7
"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_
default_style
"
>
<property
name=
"text"
>
<string>
get info
</string>
<string>
default_style
</string>
</property>
</widget>
</item>
<item
row=
"1
0
"
column=
"0"
>
<widget
class=
"Q
Label"
name=
"label_QTV_6
"
>
<item
row=
"1
4
"
column=
"0"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_resource
"
>
<property
name=
"text"
>
<string>
Plugin test:
</string>
<string>
res save/load
</string>
</property>
</widget>
</item>
<item
row=
"1
"
column=
"1
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
autodl
"
>
<item
row=
"1
3"
column=
"0
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
polygon
"
>
<property
name=
"text"
>
<string>
connect
</string>
<string>
add a polygon
</string>
</property>
</widget>
</item>
<item
row=
"
14
"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
resourc
e"
>
<item
row=
"
9
"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
grid_enabl
e"
>
<property
name=
"text"
>
<string>
res save/load
</string>
<string>
measure on/off
</string>
</property>
</widget>
</item>
<item
row=
"1
5
"
column=
"0"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_geo_displayMod
"
>
<item
row=
"1
0
"
column=
"0"
>
<widget
class=
"Q
Label"
name=
"label_QTV_6
"
>
<property
name=
"text"
>
<string>
display mod
</string>
<string>
Plugin test:
</string>
</property>
</widget>
</item>
...
...
@@ -114,79 +134,66 @@
</property>
</widget>
</item>
<item
row=
"
10"
column=
"1
"
>
<widget
class=
"QLabel"
name=
"label_QTV_
7
"
>
<item
row=
"
4"
column=
"0
"
>
<widget
class=
"QLabel"
name=
"label_QTV_
2
"
>
<property
name=
"text"
>
<string>
geo marker
</string>
<string>
Navigate
</string>
</property>
</widget>
</item>
<item
row=
"
7"
column=
"1
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
layer_move
"
>
<item
row=
"
17"
column=
"0
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
geo_del_sel
"
>
<property
name=
"text"
>
<string>
order a layer
</string>
<string>
delete selection
</string>
</property>
</widget>
</item>
<item
row=
"
8"
column=
"0
"
>
<widget
class=
"Q
Label"
name=
"label_QTV_4
"
>
<item
row=
"
14"
column=
"1
"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_xml
"
>
<property
name=
"text"
>
<string>
Plugin test:
</string>
<string>
marks save/load
</string>
</property>
</widget>
</item>
<item
row=
"
1
"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
adds
"
>
<item
row=
"
5
"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
navigate
"
>
<property
name=
"text"
>
<string>
address
</string>
<string>
navigate
</string>
</property>
</widget>
</item>
<item
row=
"
4"
column=
"0
"
>
<widget
class=
"QLabel"
name=
"label_QTV_
2
"
>
<item
row=
"
10"
column=
"1
"
>
<widget
class=
"QLabel"
name=
"label_QTV_
7
"
>
<property
name=
"text"
>
<string>
Navigate
</string>
<string>
geo marker
</string>
</property>
</widget>
</item>
<item
row=
"18"
column=
"0"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
40
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"9"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_grid_getPolygon"
>
<item
row=
"3"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_cache"
>
<property
name=
"text"
>
<string>
get polygon
</string>
<string>
cache Folder
</string>
</property>
</widget>
</item>
<item
row=
"
7
"
column=
"0"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_layers
"
>
<item
row=
"
6
"
column=
"0"
>
<widget
class=
"Q
Label"
name=
"label_QTV_3
"
>
<property
name=
"text"
>
<string>
enum layers
</string>
<string>
Layer control
</string>
</property>
</widget>
</item>
<item
row=
"
16
"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_g
eo_clear_sel
"
>
<item
row=
"
9
"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_g
rid_getPolygon
"
>
<property
name=
"text"
>
<string>
clear selecti
on
</string>
<string>
get polyg
on
</string>
</property>
</widget>
</item>
<item
row=
"
11
"
column=
"0"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_mark
"
>
<item
row=
"
8
"
column=
"0"
>
<widget
class=
"Q
Label"
name=
"label_QTV_4
"
>
<property
name=
"text"
>
<string>
add marks
</string>
<string>
Plugin test:
</string>
</property>
</widget>
</item>
...
...
@@ -197,24 +204,24 @@
</property>
</widget>
</item>
<item
row=
"1
4
"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
xm
l"
>
<item
row=
"1
6
"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
geo_clear_se
l"
>
<property
name=
"text"
>
<string>
marks save/load
</string>
<string>
clear selection
</string>
</property>
</widget>
</item>
<item
row=
"1
7
"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
geo_del_sel
"
>
<item
row=
"1
1
"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
mark
"
>
<property
name=
"text"
>
<string>
delete selection
</string>
<string>
add marks
</string>
</property>
</widget>
</item>
<item
row=
"1
7"
column=
"1
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_
default_style
"
>
<item
row=
"1
8"
column=
"0
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_
test_10000
"
>
<property
name=
"text"
>
<string>
default_style
</string>
<string>
10000 marks
</string>
</property>
</widget>
</item>
...
...
test_container/testcontainer_linux.cpp
浏览文件 @
51d26373
#include "testcontainer.h"
#
include
"testcontainer.h"
#include "ui_testcontainer_linux.h"
#include <QDebug>
#include <QMessageBox>
...
...
@@ -550,3 +550,29 @@ void testcontainer::on_pushButton_QTV_default_style_clicked()
QMessageBox
::
information
(
this
,
"geomarker::selection_delete"
,
res
);
}
void
testcontainer
::
on_pushButton_QTV_test_10000_clicked
()
{
for
(
int
i
=
0
;
i
<
10000
;
++
i
)
{
ui
->
osmmap
->
osm_layer_call_function
(
"geomarker"
,
QString
(
"function=update_point;name=ID%1;type=%2;"
"lat=%3;lon=%4;"
"style_pen=1;color_pen=%5,%6,%7,128;"
"width_pen=1;style_brush=1;color_brush=%7,%6,%5,128;"
"width=%8;height=%9;"
)
.
arg
(
i
+
10
)
.
arg
(
rand
()
%
2
+
1
)
.
arg
((
rand
()
%
17000
-
8500
)
/
100.0
)
.
arg
((
rand
()
%
18000
-
9000
)
/
50.0
)
.
arg
(
rand
()
%
255
)
.
arg
(
rand
()
%
255
)
.
arg
(
rand
()
%
255
)
.
arg
(
rand
()
%
16
+
4
)
.
arg
(
rand
()
%
16
+
4
)
);
}
}
test_container/testcontainer_linux.ui
浏览文件 @
51d26373
...
...
@@ -16,73 +16,73 @@
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"
6"
column=
"0
"
>
<widget
class=
"Q
Label"
name=
"label_QTV_3
"
>
<item
row=
"
13"
column=
"1
"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_request
"
>
<property
name=
"text"
>
<string>
Layer control
</string>
<string>
get info
</string>
</property>
</widget>
</item>
<item
row=
"
5
"
column=
"0"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_navigate
"
>
<item
row=
"
6
"
column=
"0"
>
<widget
class=
"Q
Label"
name=
"label_QTV_3
"
>
<property
name=
"text"
>
<string>
navigate
</string>
<string>
Layer control
</string>
</property>
</widget>
</item>
<item
row=
"
3"
column=
"0
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
cache
"
>
<item
row=
"
16"
column=
"1
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
geo_clear_sel
"
>
<property
name=
"text"
>
<string>
c
ache Folder
</string>
<string>
c
lear selection
</string>
</property>
</widget>
</item>
<item
row=
"1
1
"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
mark
"
>
<item
row=
"1
4
"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
resource
"
>
<property
name=
"text"
>
<string>
add marks
</string>
<string>
res save/load
</string>
</property>
</widget>
</item>
<item
row=
"
8"
column=
"0
"
>
<widget
class=
"Q
Label"
name=
"label_QTV_4
"
>
<item
row=
"
15"
column=
"1
"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_geo_selectionMod
"
>
<property
name=
"text"
>
<string>
Plugin test:
</string>
<string>
selection mod
</string>
</property>
</widget>
</item>
<item
row=
"
0"
column=
"0
"
>
<widget
class=
"Q
Label"
name=
"label_qtv
"
>
<item
row=
"
1"
column=
"1
"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_autodl
"
>
<property
name=
"text"
>
<string>
background osm conn
</string>
<string>
connect
</string>
</property>
</widget>
</item>
<item
row=
"
1
"
column=
"1"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_autodl
"
>
<item
row=
"
8
"
column=
"1"
>
<widget
class=
"Q
Label"
name=
"label_QTV_5
"
>
<property
name=
"text"
>
<string>
connect
</string>
<string>
Grid measure
</string>
</property>
</widget>
</item>
<item
row=
"
9
"
column=
"1"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_grid_getPolygon
"
>
<item
row=
"
10
"
column=
"1"
>
<widget
class=
"Q
Label"
name=
"label_QTV_7
"
>
<property
name=
"text"
>
<string>
ge
t polygon
</string>
<string>
ge
o marker
</string>
</property>
</widget>
</item>
<item
row=
"1
4
"
column=
"0"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_resource
"
>
<item
row=
"1
0
"
column=
"0"
>
<widget
class=
"Q
Label"
name=
"label_QTV_6
"
>
<property
name=
"text"
>
<string>
res save/load
</string>
<string>
Plugin test:
</string>
</property>
</widget>
</item>
<item
row=
"
9"
column=
"0
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
grid_enabl
e"
>
<item
row=
"
7"
column=
"1
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
layer_mov
e"
>
<property
name=
"text"
>
<string>
measure on/off
</string>
<string>
order a layer
</string>
</property>
</widget>
</item>
...
...
@@ -100,54 +100,41 @@
</property>
</widget>
</item>
<item
row=
"1
0
"
column=
"1"
>
<widget
class=
"Q
Label"
name=
"label_QTV_7
"
>
<item
row=
"1
4
"
column=
"1"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_xml
"
>
<property
name=
"text"
>
<string>
geo marker
</string>
<string>
marks save/load
</string>
</property>
</widget>
</item>
<item
row=
"
7
"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_l
ayer_mov
e"
>
<item
row=
"
11
"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_l
in
e"
>
<property
name=
"text"
>
<string>
order a layer
</string>
<string>
add a line
</string>
</property>
</widget>
</item>
<item
row=
"
8"
column=
"1
"
>
<widget
class=
"Q
Label"
name=
"label_QTV_5
"
>
<item
row=
"
5"
column=
"0
"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_navigate
"
>
<property
name=
"text"
>
<string>
Grid measur
e
</string>
<string>
navigat
e
</string>
</property>
</widget>
</item>
<item
row=
"
10"
column=
"0
"
>
<widget
class=
"Q
Label"
name=
"label_QTV_6
"
>
<item
row=
"
9"
column=
"1
"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_grid_getPolygon
"
>
<property
name=
"text"
>
<string>
Plugin test:
</string>
<string>
get polygon
</string>
</property>
</widget>
</item>
<item
row=
"
4
"
column=
"0"
>
<widget
class=
"Q
Label"
name=
"label_QTV_2
"
>
<item
row=
"
9
"
column=
"0"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_grid_enable
"
>
<property
name=
"text"
>
<string>
Navigate
</string>
<string>
measure on/off
</string>
</property>
</widget>
</item>
<item
row=
"18"
column=
"0"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
40
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"13"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_polygon"
>
<property
name=
"text"
>
...
...
@@ -155,66 +142,86 @@
</property>
</widget>
</item>
<item
row=
"1
3"
column=
"1
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
request
"
>
<item
row=
"1
1"
column=
"0
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
mark
"
>
<property
name=
"text"
>
<string>
get info
</string>
<string>
add marks
</string>
</property>
</widget>
</item>
<item
row=
"1
1"
column=
"1
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
line
"
>
<item
row=
"1
5"
column=
"0
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_
geo_displayMod
"
>
<property
name=
"text"
>
<string>
add a line
</string>
<string>
display mod
</string>
</property>
</widget>
</item>
<item
row=
"
16
"
column=
"0"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_geo_selected_marks
"
>
<item
row=
"
8
"
column=
"0"
>
<widget
class=
"Q
Label"
name=
"label_QTV_4
"
>
<property
name=
"text"
>
<string>
selected_marks
</string>
<string>
Plugin test:
</string>
</property>
</widget>
</item>
<item
row=
"
14"
column=
"1
"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_xml
"
>
<item
row=
"
4"
column=
"0
"
>
<widget
class=
"Q
Label"
name=
"label_QTV_2
"
>
<property
name=
"text"
>
<string>
marks save/load
</string>
<string>
Navigate
</string>
</property>
</widget>
</item>
<item
row=
"1
5"
column=
"1
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_geo_
selectionMod
"
>
<item
row=
"1
7"
column=
"0
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_geo_
del_sel
"
>
<property
name=
"text"
>
<string>
selection mod
</string>
<string>
delete selection
</string>
</property>
</widget>
</item>
<item
row=
"
15
"
column=
"0"
>
<widget
class=
"Q
PushButton"
name=
"pushButton_QTV_test_geo_displayMod
"
>
<item
row=
"
0
"
column=
"0"
>
<widget
class=
"Q
Label"
name=
"label_qtv
"
>
<property
name=
"text"
>
<string>
display mod
</string>
<string>
background osm conn
</string>
</property>
</widget>
</item>
<item
row=
"16"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_geo_clear_sel"
>
<item
row=
"19"
column=
"0"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
40
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"17"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_default_style"
>
<property
name=
"text"
>
<string>
clear selection
</string>
<string>
default_style
</string>
</property>
</widget>
</item>
<item
row=
"1
7
"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_geo_
del_sel
"
>
<item
row=
"1
6
"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_geo_
selected_marks
"
>
<property
name=
"text"
>
<string>
delete selection
</string>
<string>
selected_marks
</string>
</property>
</widget>
</item>
<item
row=
"
17"
column=
"1
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_
default_styl
e"
>
<item
row=
"
3"
column=
"0
"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_
test_cach
e"
>
<property
name=
"text"
>
<string>
default_style
</string>
<string>
cache Folder
</string>
</property>
</widget>
</item>
<item
row=
"18"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"pushButton_QTV_test_10000"
>
<property
name=
"text"
>
<string>
10000 makrs
</string>
</property>
</widget>
</item>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录