Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
colorEagleStdio
qplanetosm
提交
21f4af05
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 搜索 >>
提交
21f4af05
编写于
1月 05, 2016
作者:
丁劲犇
😸
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop'
上级
d3d47703
324636b7
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
306 addition
and
324 deletion
+306
-324
qtvplugin_geomarker/qtvplugin_geomarker.cpp
qtvplugin_geomarker/qtvplugin_geomarker.cpp
+25
-31
qtvplugin_geomarker/qtvplugin_geomarker.h
qtvplugin_geomarker/qtvplugin_geomarker.h
+10
-12
qtvplugin_geomarker/qtvplugin_geomarker.pro
qtvplugin_geomarker/qtvplugin_geomarker.pro
+2
-1
qtvplugin_geomarker/qtvplugin_geomarker.ui
qtvplugin_geomarker/qtvplugin_geomarker.ui
+103
-192
qtvplugin_geomarker/qtvplugin_geomarker_func.cpp
qtvplugin_geomarker/qtvplugin_geomarker_func.cpp
+36
-0
qtvplugin_geomarker/qtvplugin_geomarker_uimethods.cpp
qtvplugin_geomarker/qtvplugin_geomarker_uimethods.cpp
+96
-84
qtvplugin_grid/qtvplugin_grid.cpp
qtvplugin_grid/qtvplugin_grid.cpp
+29
-1
qtvplugin_grid/qtvplugin_grid.h
qtvplugin_grid/qtvplugin_grid.h
+5
-3
未找到文件。
qtvplugin_geomarker/qtvplugin_geomarker.cpp
浏览文件 @
21f4af05
...
...
@@ -54,6 +54,24 @@ qtvplugin_geomarker::qtvplugin_geomarker(QWidget *parent) :
m_pLineStyleModel
->
appendRow
(
new
QStandardItem
(
"CustomDashLine"
));
ui
->
comboBox_linePad
->
setModel
(
m_pLineStyleModel
);
m_pFillStyleModel
=
new
QStandardItemModel
(
this
);
m_pFillStyleModel
->
appendRow
(
new
QStandardItem
(
"NoBrush"
));
m_pFillStyleModel
->
appendRow
(
new
QStandardItem
(
"SolidPattern"
));
m_pFillStyleModel
->
appendRow
(
new
QStandardItem
(
"Dense1Pattern"
));
m_pFillStyleModel
->
appendRow
(
new
QStandardItem
(
"Dense2Pattern"
));
m_pFillStyleModel
->
appendRow
(
new
QStandardItem
(
"Dense3Pattern"
));
m_pFillStyleModel
->
appendRow
(
new
QStandardItem
(
"Dense4Pattern"
));
m_pFillStyleModel
->
appendRow
(
new
QStandardItem
(
"Dense5Pattern"
));
m_pFillStyleModel
->
appendRow
(
new
QStandardItem
(
"Dense6Pattern"
));
m_pFillStyleModel
->
appendRow
(
new
QStandardItem
(
"Dense7Pattern"
));
m_pFillStyleModel
->
appendRow
(
new
QStandardItem
(
"HorPattern"
));
m_pFillStyleModel
->
appendRow
(
new
QStandardItem
(
"VerPattern"
));
m_pFillStyleModel
->
appendRow
(
new
QStandardItem
(
"CrossPattern"
));
m_pFillStyleModel
->
appendRow
(
new
QStandardItem
(
"BDiagPattern"
));
m_pFillStyleModel
->
appendRow
(
new
QStandardItem
(
"FDiagPattern"
));
m_pFillStyleModel
->
appendRow
(
new
QStandardItem
(
"DiagCrossPattern"
));
ui
->
comboBox_fillPad
->
setModel
(
m_pFillStyleModel
);
m_bNeedRefresh
=
false
;
m_nTimerID_refreshUI
=
startTimer
(
2000
);
}
...
...
@@ -364,7 +382,7 @@ void qtvplugin_geomarker::refreshMarks()
m_bNeedRefresh
=
true
;
}
void
qtvplugin_geomarker
::
update_line
(
const
QString
&
name
,
double
lat1
,
double
lon1
,
double
lat2
,
double
lon2
,
const
QColor
&
color
,
int
width
)
void
qtvplugin_geomarker
::
update_line
(
const
QString
&
name
,
double
lat1
,
double
lon1
,
double
lat2
,
double
lon2
,
QPen
pen
)
{
//Get raw Item by name
QTVP_GEOMARKER
::
geoItemBase
*
base
=
m_pScene
->
geoitem_by_name
(
name
);
...
...
@@ -382,20 +400,8 @@ void qtvplugin_geomarker::update_line(const QString & name,double lat1, double l
pitem
=
new
QTVP_GEOMARKER
::
geoGraphicsLineItem
(
name
,
this
->
m_pVi
,
lat1
,
lon1
,
lat2
,
lon2
);
Qt
::
PenStyle
pst
[]
=
{
Qt
::
NoPen
,
Qt
::
SolidLine
,
Qt
::
DashLine
,
Qt
::
DotLine
,
Qt
::
DashDotLine
,
Qt
::
DashDotDotLine
,
Qt
::
CustomDashLine
};
int
ptdd
=
ui
->
comboBox_linePad
->
currentIndex
();
if
(
ptdd
<
0
||
ptdd
>=
7
)
ptdd
=
1
;
pitem
->
setPen
(
QPen
(
QBrush
(
color
),
width
,
pst
[
ptdd
]));
pitem
->
setPen
(
pen
);
if
(
false
==
this
->
m_pScene
->
addItem
(
pitem
,
0
))
{
...
...
@@ -414,7 +420,7 @@ void qtvplugin_geomarker::update_line(const QString & name,double lat1, double l
}
}
void
qtvplugin_geomarker
::
update_region
(
const
QString
&
name
,
const
QPolygonF
latlons
,
const
QColor
&
colorEdge
,
const
QColor
&
colorFill
,
int
widt
h
)
void
qtvplugin_geomarker
::
update_region
(
const
QString
&
name
,
const
QPolygonF
latlons
,
QPen
pen
,
QBrush
brus
h
)
{
//Get raw Item by name
QTVP_GEOMARKER
::
geoItemBase
*
base
=
m_pScene
->
geoitem_by_name
(
name
);
...
...
@@ -432,21 +438,9 @@ void qtvplugin_geomarker::update_region (const QString & name,const QPolygonF l
pitem
=
new
QTVP_GEOMARKER
::
geoGraphicsPolygonItem
(
name
,
this
->
m_pVi
,
latlons
);
Qt
::
PenStyle
pst
[]
=
{
Qt
::
NoPen
,
Qt
::
SolidLine
,
Qt
::
DashLine
,
Qt
::
DotLine
,
Qt
::
DashDotLine
,
Qt
::
DashDotDotLine
,
Qt
::
CustomDashLine
};
int
ptdd
=
ui
->
comboBox_linePad
->
currentIndex
();
if
(
ptdd
<
0
||
ptdd
>=
7
)
ptdd
=
1
;
pitem
->
setPen
(
QPen
(
QBrush
(
colorEdge
),
width
,
pst
[
ptdd
]));
pitem
->
setBrush
(
QColor
(
colorFill
));
pitem
->
setPen
(
pen
);
pitem
->
setBrush
(
brush
);
if
(
false
==
this
->
m_pScene
->
addItem
(
pitem
,
0
))
{
if
(
base
!=
pitem
)
...
...
qtvplugin_geomarker/qtvplugin_geomarker.h
浏览文件 @
21f4af05
...
...
@@ -41,6 +41,7 @@ private:
int
m_nTimerID_refreshUI
;
bool
m_bNeedRefresh
;
QStandardItemModel
*
m_pLineStyleModel
;
QStandardItemModel
*
m_pFillStyleModel
;
QStandardItemModel
*
m_pGeoItemModel
;
QStandardItemModel
*
m_pGeoPropModel
;
private:
...
...
@@ -56,9 +57,9 @@ private:
QString
color2string
(
const
QColor
&
c
);
template
<
class
T
>
void
update_point
(
const
QString
&
name
,
double
lat
,
double
lon
,
const
QColor
&
colorEdge
,
const
QColor
&
colorFill
,
int
width
,
int
height
);
void
update_line
(
const
QString
&
name
,
double
lat1
,
double
lon1
,
double
lat2
,
double
lon2
,
const
QColor
&
color
,
int
width
);
void
update_region
(
const
QString
&
name
,
const
QPolygonF
latlons
,
const
QColor
&
colorEdge
,
const
QColor
&
colorFill
,
int
widt
h
);
void
update_point
(
const
QString
&
name
,
double
lat
,
double
lon
,
int
width
,
int
height
,
QPen
pen
,
QBrush
brush
);
void
update_line
(
const
QString
&
name
,
double
lat1
,
double
lon1
,
double
lat2
,
double
lon2
,
QPen
pen
);
void
update_region
(
const
QString
&
name
,
const
QPolygonF
latlons
,
QPen
pen
,
QBrush
brus
h
);
protected:
layer_interface
*
load_initial_plugin
(
QString
strSLibPath
,
viewer_interface
*
ptrviewer
);
QWidget
*
load_prop_window
();
...
...
@@ -77,28 +78,25 @@ protected:
bool
cb_event
(
const
QMap
<
QString
,
QVariant
>
);
void
timerEvent
(
QTimerEvent
*
e
);
QMap
<
QString
,
QVariant
>
call_func
(
const
QMap
<
QString
,
QVariant
>
/*paras*/
);
protected
slots
:
void
on_pushButton_update_clicked
();
void
on_radioButton_tool_point_toggled
(
bool
);
void
on_radioButton_tool_line_toggled
(
bool
);
void
on_radioButton_tool_polygon_toggled
(
bool
);
void
on_toolButton_selColor_pointEdge_clicked
();
void
on_toolButton_selColor_pointcolorFill_clicked
();
void
on_toolButton_selColor_regionEdge_clicked
();
void
on_toolButton_selColor_regionFill_clicked
();
void
on_toolButton_selColorPen_clicked
();
void
on_toolButton_selColorFill_clicked
();
void
on_tableView_marks_doubleClicked
(
const
QModelIndex
&
index
);
void
on_pushButton_prop_update_clicked
();
void
on_pushButton_prop_delete_clicked
();
void
on_pushButton_del_clicked
();
void
on_pushButton_pickToLine1_clicked
();
void
on_pushButton_pickToLine2_clicked
();
void
on_toolButton_selColor_clicked
();
void
on_pushButton_getRegion_clicked
();
};
template
<
class
T
>
void
qtvplugin_geomarker
::
update_point
(
const
QString
&
name
,
double
lat
,
double
lon
,
const
QColor
&
colorEdge
,
const
QColor
&
colorFill
,
int
width
,
int
height
)
void
qtvplugin_geomarker
::
update_point
(
const
QString
&
name
,
double
lat
,
double
lon
,
int
width
,
int
height
,
QPen
pen
,
QBrush
brush
)
{
//Get raw Item by name
QTVP_GEOMARKER
::
geoItemBase
*
base
=
m_pScene
->
geoitem_by_name
(
name
);
...
...
@@ -117,8 +115,8 @@ void qtvplugin_geomarker::update_point(const QString & name,double lat, double l
this
->
m_pVi
,
lat
,
lon
,
width
,
height
);
pitem
->
setPen
(
QPen
(
colorEdge
)
);
pitem
->
setBrush
(
QBrush
(
colorFill
)
);
pitem
->
setPen
(
pen
);
pitem
->
setBrush
(
brush
);
if
(
false
==
this
->
m_pScene
->
addItem
(
pitem
,
0
))
{
...
...
qtvplugin_geomarker/qtvplugin_geomarker.pro
浏览文件 @
21f4af05
...
...
@@ -20,7 +20,8 @@ SOURCES += \
geographicsrectitem
.
cpp
\
qtvplugin_geomarker_uimethods
.
cpp
\
geographicslineitem
.
cpp
\
geographicspolygonitem
.
cpp
geographicspolygonitem
.
cpp
\
qtvplugin_geomarker_func
.
cpp
HEADERS
+=
\
..
/
qtviewer_planetosm
/
osmtiles
/
layer_interface
.
h
\
...
...
qtvplugin_geomarker/qtvplugin_geomarker.ui
浏览文件 @
21f4af05
...
...
@@ -6,29 +6,14 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
577
</width>
<height>
488
</height>
<width>
612
</width>
<height>
534
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Grid
</string>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_15"
>
<property
name=
"spacing"
>
<number>
1
</number>
</property>
<property
name=
"leftMargin"
>
<number>
1
</number>
</property>
<property
name=
"topMargin"
>
<number>
1
</number>
</property>
<property
name=
"rightMargin"
>
<number>
1
</number>
</property>
<property
name=
"bottomMargin"
>
<number>
1
</number>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_4"
>
<item>
<widget
class=
"QGroupBox"
name=
"groupBox"
>
<property
name=
"title"
>
...
...
@@ -128,7 +113,7 @@
</widget>
</item>
<item>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_
5
"
>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_
8
"
>
<item>
<widget
class=
"QStackedWidget"
name=
"stackedWidget_marks"
>
<property
name=
"sizePolicy"
>
...
...
@@ -226,48 +211,6 @@
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_4"
>
<item>
<widget
class=
"QLabel"
name=
"label_14"
>
<property
name=
"text"
>
<string>
Edge color
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_PointColorEdge"
/>
</item>
<item>
<widget
class=
"QToolButton"
name=
"toolButton_selColor_pointEdge"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_6"
>
<item>
<widget
class=
"QLabel"
name=
"label_16"
>
<property
name=
"text"
>
<string>
Fill Color
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_PointColorFill"
/>
</item>
<item>
<widget
class=
"QToolButton"
name=
"toolButton_selColor_pointcolorFill"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget
class=
"QRadioButton"
name=
"radioButton_PointRect"
>
<property
name=
"text"
>
...
...
@@ -369,58 +312,6 @@
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_12"
>
<item>
<widget
class=
"QLabel"
name=
"label_11"
>
<property
name=
"text"
>
<string>
width
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QSpinBox"
name=
"spinBox_lineWidth"
>
<property
name=
"minimum"
>
<number>
1
</number>
</property>
<property
name=
"maximum"
>
<number>
256
</number>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_19"
>
<property
name=
"text"
>
<string>
pad
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QComboBox"
name=
"comboBox_linePad"
/>
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_11"
>
<item>
<widget
class=
"QLabel"
name=
"label_12"
>
<property
name=
"text"
>
<string>
color
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_lineColor"
/>
</item>
<item>
<widget
class=
"QToolButton"
name=
"toolButton_selColor"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget
class=
"QWidget"
name=
"page_region"
>
...
...
@@ -439,48 +330,6 @@
</property>
</widget>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_5"
>
<item>
<widget
class=
"QLabel"
name=
"label_17"
>
<property
name=
"text"
>
<string>
Edge color
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_RegionColorEdge"
/>
</item>
<item>
<widget
class=
"QToolButton"
name=
"toolButton_selColor_regionEdge"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_13"
>
<item>
<widget
class=
"QLabel"
name=
"label_18"
>
<property
name=
"text"
>
<string>
Fill Color
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_RegionColorFill"
/>
</item>
<item>
<widget
class=
"QToolButton"
name=
"toolButton_selColor_regionFill"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_14"
>
<item>
...
...
@@ -520,52 +369,100 @@
<property
name=
"title"
>
<string>
Properties
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_9"
>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_5"
>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_6"
>
<item>
<widget
class=
"QLabel"
name=
"label_11"
>
<property
name=
"text"
>
<string>
Pen width
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QSpinBox"
name=
"spinBox_penWidth"
>
<property
name=
"minimum"
>
<number>
1
</number>
</property>
<property
name=
"maximum"
>
<number>
256
</number>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_19"
>
<property
name=
"text"
>
<string>
Pen Style
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QComboBox"
name=
"comboBox_linePad"
/>
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_11"
>
<item>
<widget
class=
"QLabel"
name=
"label_12"
>
<property
name=
"text"
>
<string>
Pen Color
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_PenColor"
/>
</item>
<item>
<widget
class=
"QToolButton"
name=
"toolButton_selColorPen"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_1
7
"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_1
2
"
>
<item>
<widget
class=
"QTableView"
name=
"tableView_props"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"MinimumExpanding"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
<widget
class=
"QLabel"
name=
"label_16"
>
<property
name=
"text"
>
<string>
Fill Color
</string>
</property>
</widget>
</item>
<item>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_8"
>
<item>
<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>
<widget
class=
"QPushButton"
name=
"pushButton_prop_delete"
>
<property
name=
"text"
>
<string>
Delete
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"pushButton_prop_update"
>
<property
name=
"text"
>
<string>
Update
</string>
</property>
</widget>
</item>
</layout>
<widget
class=
"QLineEdit"
name=
"lineEdit_FillColor"
/>
</item>
<item>
<widget
class=
"QToolButton"
name=
"toolButton_selColorFill"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_21"
>
<property
name=
"text"
>
<string>
Fill Style
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QComboBox"
name=
"comboBox_fillPad"
/>
</item>
</layout>
</item>
<item>
<widget
class=
"QTableView"
name=
"tableView_props"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"MinimumExpanding"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_8"
>
<item>
...
...
@@ -578,6 +475,13 @@
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_prop_name"
/>
</item>
<item>
<widget
class=
"QPushButton"
name=
"pushButton_prop_delete"
>
<property
name=
"text"
>
<string>
Delete
</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
...
...
@@ -592,6 +496,13 @@
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_prop_string"
/>
</item>
<item>
<widget
class=
"QPushButton"
name=
"pushButton_prop_update"
>
<property
name=
"text"
>
<string>
Update
</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
...
...
qtvplugin_geomarker/qtvplugin_geomarker_func.cpp
0 → 100644
浏览文件 @
21f4af05
#include "qtvplugin_geomarker.h"
#include "ui_qtvplugin_geomarker.h"
/**
* geomarker supports these function calls.
*
*
* ATTENTION!THIS FUNCTION IS NOT THREAD SAFE! Calls should be made only in main thread, also called "UI Thread"
* @param paras the key-value style paraments.
* @return QMap<QString, QVariant> the key-value style return values.
*/
QMap
<
QString
,
QVariant
>
qtvplugin_geomarker
::
call_func
(
const
QMap
<
QString
,
QVariant
>
paras
)
{
QMap
<
QString
,
QVariant
>
res
;
if
(
paras
.
contains
(
"function"
))
{
QString
funct
=
paras
[
"function"
].
toString
();
if
(
funct
==
"update_point"
)
{
}
else
if
(
funct
==
"update_line"
)
{
}
else
if
(
funct
==
"update_polygon"
)
{
}
else
res
[
"error"
]
=
QString
(
"unknown function
\"
%1
\"
."
).
arg
(
funct
);
}
else
res
[
"error"
]
=
"
\"
function
\"
keyword not specified, nothing to do."
;
return
std
::
move
(
res
);
}
qtvplugin_geomarker/qtvplugin_geomarker_uimethods.cpp
浏览文件 @
21f4af05
...
...
@@ -80,37 +80,21 @@ void qtvplugin_geomarker::on_radioButton_tool_polygon_toggled(bool b)
if
(
b
)
ui
->
stackedWidget_marks
->
setCurrentIndex
(
2
);
}
void
qtvplugin_geomarker
::
on_toolButton_selColor
_pointEdge
_clicked
()
void
qtvplugin_geomarker
::
on_toolButton_selColor
Pen
_clicked
()
{
QString
str
=
ui
->
lineEdit_P
ointColorEdge
->
text
();
QString
str
=
ui
->
lineEdit_P
enColor
->
text
();
QColor
col
=
QColorDialog
::
getColor
(
string2color
(
str
),
this
,
tr
(
"Select Color"
),
QColorDialog
::
ShowAlphaChannel
|
QColorDialog
::
DontUseNativeDialog
);
if
(
col
.
isValid
())
ui
->
lineEdit_P
ointColorEdge
->
setText
(
color2string
(
col
));
ui
->
lineEdit_P
enColor
->
setText
(
color2string
(
col
));
}
void
qtvplugin_geomarker
::
on_toolButton_selColor
_pointcolor
Fill_clicked
()
void
qtvplugin_geomarker
::
on_toolButton_selColorFill_clicked
()
{
QString
str
=
ui
->
lineEdit_
PointColorFill
->
text
();
QString
str
=
ui
->
lineEdit_
FillColor
->
text
();
QColor
col
=
QColorDialog
::
getColor
(
string2color
(
str
),
this
,
tr
(
"Select Color"
),
QColorDialog
::
ShowAlphaChannel
|
QColorDialog
::
DontUseNativeDialog
);
if
(
col
.
isValid
())
ui
->
lineEdit_PointColorFill
->
setText
(
color2string
(
col
));
}
void
qtvplugin_geomarker
::
on_toolButton_selColor_regionEdge_clicked
()
{
QString
str
=
ui
->
lineEdit_RegionColorEdge
->
text
();
QColor
col
=
QColorDialog
::
getColor
(
string2color
(
str
),
this
,
tr
(
"Select Color"
),
QColorDialog
::
ShowAlphaChannel
|
QColorDialog
::
DontUseNativeDialog
);
if
(
col
.
isValid
())
ui
->
lineEdit_RegionColorEdge
->
setText
(
color2string
(
col
));
}
void
qtvplugin_geomarker
::
on_toolButton_selColor_regionFill_clicked
()
{
QString
str
=
ui
->
lineEdit_RegionColorFill
->
text
();
QColor
col
=
QColorDialog
::
getColor
(
string2color
(
str
),
this
,
tr
(
"Select Color"
),
QColorDialog
::
ShowAlphaChannel
|
QColorDialog
::
DontUseNativeDialog
);
if
(
col
.
isValid
())
ui
->
lineEdit_RegionColorFill
->
setText
(
color2string
(
col
));
ui
->
lineEdit_FillColor
->
setText
(
color2string
(
col
));
}
void
qtvplugin_geomarker
::
on_pushButton_pickToLine1_clicked
()
...
...
@@ -125,14 +109,6 @@ void qtvplugin_geomarker::on_pushButton_pickToLine2_clicked()
ui
->
lineEdit_lineLon2
->
setText
(
ui
->
lineEdit_point_lon
->
text
());
}
void
qtvplugin_geomarker
::
on_toolButton_selColor_clicked
()
{
QString
str
=
ui
->
lineEdit_lineColor
->
text
();
QColor
col
=
QColorDialog
::
getColor
(
string2color
(
str
),
this
,
tr
(
"Select Color"
),
QColorDialog
::
ShowAlphaChannel
|
QColorDialog
::
DontUseNativeDialog
);
if
(
col
.
isValid
())
ui
->
lineEdit_lineColor
->
setText
(
color2string
(
col
));
}
void
qtvplugin_geomarker
::
SaveSettingsToIni
()
{
...
...
@@ -149,27 +125,24 @@ void qtvplugin_geomarker::SaveSettingsToIni()
settings
.
setValue
(
"ui/lineEdit_point_lon"
,
ui
->
lineEdit_point_lon
->
text
());
settings
.
setValue
(
"ui/spinBox_point_width"
,
ui
->
spinBox_point_width
->
value
());
settings
.
setValue
(
"ui/spinBox_point_size_height"
,
ui
->
spinBox_point_size_height
->
value
());
settings
.
setValue
(
"ui/lineEdit_PointColorEdge"
,
ui
->
lineEdit_PointColorEdge
->
text
());
settings
.
setValue
(
"ui/lineEdit_PointColorFill"
,
ui
->
lineEdit_PointColorFill
->
text
());
int
radioButton_PointRect
=
0
;
if
(
ui
->
radioButton_PointRound
->
isChecked
()
==
true
)
radioButton_PointRect
=
1
;
else
radioButton_PointRect
=
0
;
settings
.
setValue
(
"ui/radioButton_PointRect"
,
radioButton_PointRect
);
settings
.
setValue
(
"ui/lineEdit_PenColor"
,
ui
->
lineEdit_PenColor
->
text
());
settings
.
setValue
(
"ui/lineEdit_FillColor"
,
ui
->
lineEdit_FillColor
->
text
());
settings
.
setValue
(
"ui/lineEdit_prop_name"
,
ui
->
lineEdit_prop_name
->
text
());
settings
.
setValue
(
"ui/lineEdit_prop_string"
,
ui
->
lineEdit_prop_string
->
text
());
settings
.
setValue
(
"ui/lineEdit_lineLat1"
,
ui
->
lineEdit_lineLat1
->
text
());
settings
.
setValue
(
"ui/lineEdit_lineLat2"
,
ui
->
lineEdit_lineLat2
->
text
());
settings
.
setValue
(
"ui/lineEdit_lineLon1"
,
ui
->
lineEdit_lineLon1
->
text
());
settings
.
setValue
(
"ui/lineEdit_lineLon2"
,
ui
->
lineEdit_lineLon2
->
text
());
settings
.
setValue
(
"ui/spinBox_lineWidth"
,
ui
->
spinBox_lineWidth
->
value
());
settings
.
setValue
(
"ui/lineEdit_lineColor"
,
ui
->
lineEdit_lineColor
->
text
());
settings
.
setValue
(
"ui/spinBox_penWidth"
,
ui
->
spinBox_penWidth
->
value
());
settings
.
setValue
(
"ui/comboBox_linePad"
,
ui
->
comboBox_linePad
->
currentIndex
());
settings
.
setValue
(
"ui/lineEdit_RegionColorEdge"
,
ui
->
lineEdit_RegionColorEdge
->
text
());
settings
.
setValue
(
"ui/lineEdit_RegionColorFill"
,
ui
->
lineEdit_RegionColorFill
->
text
());
settings
.
setValue
(
"ui/comboBox_fillPad"
,
ui
->
comboBox_fillPad
->
currentIndex
());
settings
.
setValue
(
"ui/plainTextEdit_corners"
,
ui
->
plainTextEdit_corners
->
toPlainText
());
}
...
...
@@ -203,10 +176,10 @@ void qtvplugin_geomarker::loadSettingsFromIni()
ui
->
spinBox_point_width
->
setValue
(
spinBox_point_width
);
int
spinBox_point_size_height
=
settings
.
value
(
"ui/spinBox_point_size_height"
,
8
).
toInt
();
ui
->
spinBox_point_size_height
->
setValue
(
spinBox_point_size_height
);
QString
lineEdit_P
ointColorEdge
=
settings
.
value
(
"ui/lineEdit_PointColorEdge
"
,
color2string
(
QColor
(
0
,
0
,
0
,
128
))).
toString
();
ui
->
lineEdit_P
ointColorEdge
->
setText
(
lineEdit_PointColorEdge
);
QString
lineEdit_
PointColorFill
=
settings
.
value
(
"ui/lineEdit_PointColorFill
"
,
color2string
(
QColor
(
255
,
255
,
255
,
128
))).
toString
();
ui
->
lineEdit_
PointColorFill
->
setText
(
lineEdit_PointColorFill
);
QString
lineEdit_P
enColor
=
settings
.
value
(
"ui/lineEdit_PenColor
"
,
color2string
(
QColor
(
0
,
0
,
0
,
128
))).
toString
();
ui
->
lineEdit_P
enColor
->
setText
(
lineEdit_PenColor
);
QString
lineEdit_
FillColor
=
settings
.
value
(
"ui/lineEdit_FillColor
"
,
color2string
(
QColor
(
255
,
255
,
255
,
128
))).
toString
();
ui
->
lineEdit_
FillColor
->
setText
(
lineEdit_FillColor
);
int
radioButton_PointRect
=
settings
.
value
(
"ui/radioButton_PointRect"
,
0
).
toInt
();
switch
(
radioButton_PointRect
)
{
...
...
@@ -233,17 +206,13 @@ void qtvplugin_geomarker::loadSettingsFromIni()
ui
->
lineEdit_lineLon1
->
setText
(
lineEdit_lineLon1
);
QString
lineEdit_lineLon2
=
settings
.
value
(
"ui/lineEdit_lineLon2"
,
"0"
).
toString
();
ui
->
lineEdit_lineLon2
->
setText
(
lineEdit_lineLon2
);
int
spinBox_lineWidth
=
settings
.
value
(
"ui/spinBox_lineWidth"
,
3
).
toInt
();
ui
->
spinBox_lineWidth
->
setValue
(
spinBox_lineWidth
);
QString
lineEdit_lineColor
=
settings
.
value
(
"ui/lineEdit_lineColor"
,
"0"
).
toString
();
ui
->
lineEdit_lineColor
->
setText
(
lineEdit_lineColor
);
int
spinBox_penWidth
=
settings
.
value
(
"ui/spinBox_penWidth"
,
3
).
toInt
();
ui
->
spinBox_penWidth
->
setValue
(
spinBox_penWidth
);
int
comboBox_linePad
=
settings
.
value
(
"ui/comboBox_linePad"
,
1
).
toInt
();
ui
->
comboBox_linePad
->
setCurrentIndex
(
comboBox_linePad
);
int
comboBox_fillPad
=
settings
.
value
(
"ui/comboBox_fillPad"
,
1
).
toInt
();
ui
->
comboBox_fillPad
->
setCurrentIndex
(
comboBox_fillPad
);
QString
lineEdit_RegionColorEdge
=
settings
.
value
(
"ui/lineEdit_RegionColorEdge"
,
"0"
).
toString
();
ui
->
lineEdit_RegionColorEdge
->
setText
(
lineEdit_RegionColorEdge
);
QString
lineEdit_RegionColorFill
=
settings
.
value
(
"ui/lineEdit_RegionColorFill"
,
"0"
).
toString
();
ui
->
lineEdit_RegionColorFill
->
setText
(
lineEdit_RegionColorFill
);
QString
plainTextEdit_corners
=
settings
.
value
(
"ui/plainTextEdit_corners"
,
"0"
).
toString
();
ui
->
plainTextEdit_corners
->
setPlainText
(
plainTextEdit_corners
);
...
...
@@ -254,19 +223,65 @@ void qtvplugin_geomarker::on_pushButton_update_clicked()
return
;
QString
name
=
ui
->
lineEdit_currentID
->
text
();
SaveSettingsToIni
();
//Get pen and brush settings
Qt
::
PenStyle
pst
[]
=
{
Qt
::
NoPen
,
Qt
::
SolidLine
,
Qt
::
DashLine
,
Qt
::
DotLine
,
Qt
::
DashDotLine
,
Qt
::
DashDotDotLine
,
Qt
::
CustomDashLine
};
Qt
::
BrushStyle
bst
[]
=
{
Qt
::
NoBrush
,
Qt
::
SolidPattern
,
Qt
::
Dense1Pattern
,
Qt
::
Dense2Pattern
,
Qt
::
Dense3Pattern
,
Qt
::
Dense4Pattern
,
Qt
::
Dense5Pattern
,
Qt
::
Dense6Pattern
,
Qt
::
Dense7Pattern
,
Qt
::
HorPattern
,
Qt
::
VerPattern
,
Qt
::
CrossPattern
,
Qt
::
BDiagPattern
,
Qt
::
FDiagPattern
,
Qt
::
DiagCrossPattern
};
int
ptdd
=
ui
->
comboBox_linePad
->
currentIndex
();
if
(
ptdd
<
0
||
ptdd
>=
7
)
ptdd
=
1
;
QColor
penColor
=
string2color
(
ui
->
lineEdit_PenColor
->
text
());
int
penWidth
=
ui
->
spinBox_penWidth
->
value
();
QPen
pen
;
//(QBrush(color),width,pst[ptdd]);
pen
.
setColor
(
penColor
);
pen
.
setWidth
(
penWidth
);
pen
.
setStyle
(
pst
[
ptdd
]);
int
btdd
=
ui
->
comboBox_fillPad
->
currentIndex
();
if
(
btdd
<
0
||
btdd
>=
15
)
btdd
=
1
;
QColor
brushColor
=
string2color
(
ui
->
lineEdit_FillColor
->
text
());
QBrush
brush
;
brush
.
setColor
(
brushColor
);
brush
.
setStyle
(
bst
[
btdd
]);
if
(
ui
->
radioButton_tool_point
->
isChecked
())
{
double
lat
=
ui
->
lineEdit_point_lat
->
text
().
toDouble
();
double
lon
=
ui
->
lineEdit_point_lon
->
text
().
toDouble
();
int
tp
=
ui
->
radioButton_PointRect
->
isChecked
()
?
0
:
1
;
QColor
colorEdge
(
string2color
(
ui
->
lineEdit_PointColorEdge
->
text
()));
QColor
colorFill
(
string2color
(
ui
->
lineEdit_PointColorFill
->
text
()));
int
width
=
ui
->
spinBox_point_width
->
value
();
int
height
=
ui
->
spinBox_point_size_height
->
value
();
if
(
tp
==
0
)
update_point
<
QTVP_GEOMARKER
::
geoGraphicsRectItem
>
(
name
,
lat
,
lon
,
colorEdge
,
colorFill
,
width
,
height
);
update_point
<
QTVP_GEOMARKER
::
geoGraphicsRectItem
>
(
name
,
lat
,
lon
,
width
,
height
,
pen
,
brush
);
else
update_point
<
QTVP_GEOMARKER
::
geoGraphicsEllipseItem
>
(
name
,
lat
,
lon
,
colorEdge
,
colorFill
,
width
,
height
);
update_point
<
QTVP_GEOMARKER
::
geoGraphicsEllipseItem
>
(
name
,
lat
,
lon
,
width
,
height
,
pen
,
brush
);
}
else
if
(
ui
->
radioButton_tool_line
->
isChecked
())
{
...
...
@@ -274,15 +289,10 @@ void qtvplugin_geomarker::on_pushButton_update_clicked()
double
lat2
=
ui
->
lineEdit_lineLat2
->
text
().
toDouble
();
double
lon1
=
ui
->
lineEdit_lineLon1
->
text
().
toDouble
();
double
lon2
=
ui
->
lineEdit_lineLon2
->
text
().
toDouble
();
int
lineWidth
=
ui
->
spinBox_lineWidth
->
value
();
QColor
lineColor
=
string2color
(
ui
->
lineEdit_lineColor
->
text
());
update_line
(
name
,
lat1
,
lon1
,
lat2
,
lon2
,
lineColor
,
lineWidth
);
update_line
(
name
,
lat1
,
lon1
,
lat2
,
lon2
,
pen
);
}
else
if
(
ui
->
radioButton_tool_polygon
->
isChecked
())
{
QColor
colorEdge
(
string2color
(
ui
->
lineEdit_RegionColorEdge
->
text
()));
QColor
colorFill
(
string2color
(
ui
->
lineEdit_RegionColorFill
->
text
()));
int
width
=
ui
->
spinBox_lineWidth
->
value
();
QPolygonF
latlons
;
QString
strPlainTexts
=
ui
->
plainTextEdit_corners
->
toPlainText
();
strPlainTexts
.
remove
(
' '
);
...
...
@@ -291,7 +301,6 @@ void qtvplugin_geomarker::on_pushButton_update_clicked()
strPlainTexts
.
remove
(
'\015'
);
strPlainTexts
.
remove
(
'\012'
);
QStringList
lst
=
strPlainTexts
.
split
(
QRegExp
(
"[,;]"
),
QString
::
SkipEmptyParts
);
//qDebug()<<lst;
int
c
=
0
;
QPointF
ll
;
foreach
(
QString
s
,
lst
)
...
...
@@ -304,7 +313,7 @@ void qtvplugin_geomarker::on_pushButton_update_clicked()
latlons
.
push_back
(
ll
);
}
if
(
latlons
.
size
())
update_region
(
name
,
latlons
,
colorEdge
,
colorFill
,
widt
h
);
update_region
(
name
,
latlons
,
pen
,
brus
h
);
}
else
...
...
@@ -406,6 +415,9 @@ void qtvplugin_geomarker::refreshItemUI(QString markname)
if
(
item
)
{
ui
->
lineEdit_currentID
->
setText
(
item
->
item_name
());
//Update Pen and brush
QPen
pen
;
QBrush
brush
;
switch
(
item
->
item_type
())
{
case
QTVP_GEOMARKER
::
ITEAMTYPE_RECT_POINT
:
...
...
@@ -413,13 +425,11 @@ void qtvplugin_geomarker::refreshItemUI(QString markname)
QTVP_GEOMARKER
::
geoGraphicsRectItem
*
pitem
=
dynamic_cast
<
QTVP_GEOMARKER
::
geoGraphicsRectItem
*>
(
item
);
if
(
!
pitem
)
break
;
pen
=
pitem
->
pen
();
brush
=
pitem
->
brush
();
ui
->
lineEdit_point_lat
->
setText
(
QString
(
"%1"
).
arg
(
pitem
->
lat
(),
0
,
'f'
,
14
));
ui
->
lineEdit_point_lon
->
setText
(
QString
(
"%1"
).
arg
(
pitem
->
lon
(),
0
,
'f'
,
14
));
ui
->
radioButton_PointRect
->
setChecked
(
true
);
QColor
colorEdge
=
pitem
->
pen
().
color
();
ui
->
lineEdit_PointColorEdge
->
setText
(
color2string
(
colorEdge
));
QColor
colorFill
=
pitem
->
brush
().
color
();
ui
->
lineEdit_PointColorFill
->
setText
(
color2string
(
colorFill
));
ui
->
spinBox_point_width
->
setValue
(
pitem
->
width
());
ui
->
spinBox_point_size_height
->
setValue
(
pitem
->
height
());
}
...
...
@@ -429,13 +439,11 @@ void qtvplugin_geomarker::refreshItemUI(QString markname)
QTVP_GEOMARKER
::
geoGraphicsEllipseItem
*
pitem
=
dynamic_cast
<
QTVP_GEOMARKER
::
geoGraphicsEllipseItem
*>
(
item
);
if
(
!
pitem
)
break
;
pen
=
pitem
->
pen
();
brush
=
pitem
->
brush
();
ui
->
lineEdit_point_lat
->
setText
(
QString
(
"%1"
).
arg
(
pitem
->
lat
(),
0
,
'f'
,
14
));
ui
->
lineEdit_point_lon
->
setText
(
QString
(
"%1"
).
arg
(
pitem
->
lon
(),
0
,
'f'
,
14
));
ui
->
radioButton_PointRound
->
setChecked
(
true
);
QColor
colorEdge
=
pitem
->
pen
().
color
();
ui
->
lineEdit_PointColorEdge
->
setText
(
color2string
(
colorEdge
));
QColor
colorFill
=
pitem
->
brush
().
color
();
ui
->
lineEdit_PointColorFill
->
setText
(
color2string
(
colorFill
));
ui
->
spinBox_point_width
->
setValue
(
pitem
->
width
());
ui
->
spinBox_point_size_height
->
setValue
(
pitem
->
height
());
}
...
...
@@ -445,16 +453,11 @@ void qtvplugin_geomarker::refreshItemUI(QString markname)
QTVP_GEOMARKER
::
geoGraphicsLineItem
*
pitem
=
dynamic_cast
<
QTVP_GEOMARKER
::
geoGraphicsLineItem
*>
(
item
);
if
(
!
pitem
)
break
;
pen
=
pitem
->
pen
();
ui
->
lineEdit_lineLat1
->
setText
(
QString
(
"%1"
).
arg
(
pitem
->
lat1
(),
0
,
'f'
,
14
));
ui
->
lineEdit_lineLat2
->
setText
(
QString
(
"%1"
).
arg
(
pitem
->
lat2
(),
0
,
'f'
,
14
));
ui
->
lineEdit_lineLon1
->
setText
(
QString
(
"%1"
).
arg
(
pitem
->
lon1
(),
0
,
'f'
,
14
));
ui
->
lineEdit_lineLon2
->
setText
(
QString
(
"%1"
).
arg
(
pitem
->
lon2
(),
0
,
'f'
,
14
));
QColor
color
=
pitem
->
pen
().
color
();
ui
->
lineEdit_lineColor
->
setText
(
color2string
(
color
));
int
width
=
pitem
->
pen
().
width
();
ui
->
spinBox_point_width
->
setValue
(
width
);
Qt
::
PenStyle
st
=
pitem
->
pen
().
style
();
ui
->
comboBox_linePad
->
setCurrentIndex
((
int
)
st
);
}
break
;
case
QTVP_GEOMARKER
::
ITEAMTYPE_REGION
:
...
...
@@ -462,25 +465,34 @@ void qtvplugin_geomarker::refreshItemUI(QString markname)
QTVP_GEOMARKER
::
geoGraphicsPolygonItem
*
pitem
=
dynamic_cast
<
QTVP_GEOMARKER
::
geoGraphicsPolygonItem
*>
(
item
);
if
(
!
pitem
)
break
;
pen
=
pitem
->
pen
();
brush
=
pitem
->
brush
();
QPolygonF
pol
=
pitem
->
llas
();
QString
strPlainText
;
foreach
(
QPointF
p
,
pol
)
strPlainText
+=
QString
(
"%1,%2
\n
"
).
arg
(
p
.
y
(),
0
,
'f'
,
14
).
arg
(
p
.
x
(),
0
,
'f'
,
14
);
ui
->
plainTextEdit_corners
->
setPlainText
(
strPlainText
);
QColor
color
=
pitem
->
pen
().
color
();
ui
->
lineEdit_RegionColorEdge
->
setText
(
color2string
(
color
));
int
width
=
pitem
->
pen
().
width
();
ui
->
spinBox_point_width
->
setValue
(
width
);
Qt
::
PenStyle
st
=
pitem
->
pen
().
style
();
ui
->
comboBox_linePad
->
setCurrentIndex
((
int
)
st
);
QColor
colorFill
=
pitem
->
brush
().
color
();
ui
->
lineEdit_RegionColorFill
->
setText
(
color2string
(
colorFill
));
}
break
;
default:
break
;
}
//end switch
QColor
colorPen
=
pen
.
color
();
ui
->
lineEdit_PenColor
->
setText
(
color2string
(
colorPen
));
QColor
colorFill
=
brush
.
color
();
ui
->
lineEdit_FillColor
->
setText
(
color2string
(
colorFill
));
int
penwidth
=
pen
.
width
();
ui
->
spinBox_penWidth
->
setValue
(
penwidth
);
Qt
::
PenStyle
st
=
pen
.
style
();
int
nst
=
int
(
st
);
if
(
nst
>=
0
&&
nst
<
ui
->
comboBox_linePad
->
count
())
ui
->
comboBox_linePad
->
setCurrentIndex
((
int
)
st
);
Qt
::
BrushStyle
bs
=
brush
.
style
();
int
nbs
=
int
(
bs
);
if
(
nbs
>=
0
&&
nbs
<
ui
->
comboBox_fillPad
->
count
())
ui
->
comboBox_fillPad
->
setCurrentIndex
((
int
)
nbs
);
refreshProps
(
item
);
}
//end if item
...
...
qtvplugin_grid/qtvplugin_grid.cpp
浏览文件 @
21f4af05
...
...
@@ -365,7 +365,6 @@ void qtvplugin_grid::CalArea()
double
*
PointX
=
new
double
[
Count
];
double
*
PointY
=
new
double
[
Count
];
char
*
buffertmp
=
new
char
[
2048
];
//转换为经纬度
bool
Valid
=
true
;
strMsg
+=
"Points:
\n
"
;
//Length
...
...
@@ -426,6 +425,14 @@ void qtvplugin_grid::CalArea()
ui
->
plainTextEdit_RES
->
setPlainText
(
strMsg
);
}
/**
* @brief Classical Polygon Area caculate method
*
* @param PointX the x points
* @param PointY the y points
* @param Count the points' count
* @return double area.
*/
double
qtvplugin_grid
::
GetArea
(
double
*
PointX
,
double
*
PointY
,
int
Count
)
{
const
double
pi
=
3.1415926535897932384626433832795
;
...
...
@@ -588,6 +595,16 @@ double qtvplugin_grid::GetArea(double * PointX,double * PointY,int Count)
}
/**
* @brief Calculate distance between 2 positions
*
* @param dLatStart start latitude
* @param dLatEnd end latitude
* @param dLonStart start longitude
* @param dLonEnd end longitude
* @param psita the earth center angle in polar
* @return double distance.
*/
double
qtvplugin_grid
::
CalDistance
(
double
dLatStart
,
double
dLatEnd
,
double
dLonStart
,
double
dLonEnd
,
double
*
psita
)
{
//deg to rad
...
...
@@ -623,6 +640,17 @@ double qtvplugin_grid::CalDistance(double dLatStart,double dLatEnd,double dLonSt
return
dist
;
}
/**
* function calls avaliable:
* 1.function=get_region, no other para needed. returns current selected region's cornor points, in lat, lon; size=N;lat0=XX;lon0=XX;
* lat1=XX;lon1=XX;lat2=XX;lon2=XX;...;latN-1=XX;lonN-1=XX.
* 2.function=get_ruler_status, no other para needed.returns whether ruler tool is active now, status=0 means not active, status=-1 means active.
* 3.function=set_ruler_status, with para status, will set ruler status to given value.
* please notice that the function should be called from the MAIN THREAD ONLY.
*
* @param paras the key-value style paraments.
* @return QMap<QString, QVariant> the key-value style return paraments.
*/
QMap
<
QString
,
QVariant
>
qtvplugin_grid
::
call_func
(
const
QMap
<
QString
,
QVariant
>
paras
)
{
QMap
<
QString
,
QVariant
>
res
;
...
...
qtvplugin_grid/qtvplugin_grid.h
浏览文件 @
21f4af05
...
...
@@ -10,9 +10,11 @@ namespace Ui {
class
qtvplugin_grid
;
}
using
namespace
QTVOSM
;
/*!
\brief qtvplugin_grid
/*! qtvplugin_grid support distance and area measuring. function calls avaliable:
1.function=get_region, no other para needed. returns current selected region's cornor points, in lat, lon; size=N;lat0=XX;lon0=XX;
lat1=XX;lon1=XX;lat2=XX;lon2=XX;...;latN-1=XX;lonN-1=XX.
2.function=get_ruler_status, no other para needed.returns whether ruler tool is active now, status=0 means not active, status=-1 means active.
3.function=set_ruler_status, with para status, will set ruler status to given value.
\class qtvplugin_grid qtvplugin_grid.h "qtvplugin_grid/qtvplugin_grid.h"
*/
class
qtvplugin_grid
:
public
QWidget
,
public
layer_interface
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录