mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-01 21:39:15 +02:00
Compare commits
48 Commits
Author | SHA1 | Date | |
---|---|---|---|
d5415179e4 | |||
b6b64065fb | |||
be75165088 | |||
3e60d0c84a | |||
4589478957 | |||
a4c20f8924 | |||
09833474f1 | |||
804c76a6b8 | |||
21da89cad1 | |||
f8deb573b0 | |||
2bfa6b8c1b | |||
6312570d5a | |||
23391de792 | |||
df8e8d76b8 | |||
1034c52b39 | |||
cc8704ff20 | |||
7a9e4171f9 | |||
625451c041 | |||
ef7b863003 | |||
c7f76f3009 | |||
7700ded936 | |||
e8fee5e587 | |||
450b6a3c39 | |||
e73b9f36c5 | |||
0d79dca72e | |||
e49b217b55 | |||
1067ef7352 | |||
80f3f74b47 | |||
e741fab183 | |||
7c434381a3 | |||
22c2204047 | |||
b0af165e53 | |||
0e0dcdd721 | |||
02a7445f86 | |||
55cae2d0cd | |||
9f5e09a664 | |||
1d90ae460c | |||
4c97b427fe | |||
095897d016 | |||
0596c86ea1 | |||
33f6ce2e0e | |||
5b2ac6cde2 | |||
7ff8002387 | |||
515d801e58 | |||
b75d805947 | |||
ae27b53eb1 | |||
edae24f443 | |||
d1dc4251f0 |
@ -1,4 +1,4 @@
|
||||
version: 13.22.{build}
|
||||
version: 13.23.{build}
|
||||
|
||||
configuration:
|
||||
- Release
|
||||
|
14
gpxsee.pro
14
gpxsee.pro
@ -3,7 +3,7 @@ unix:!macx:!android {
|
||||
} else {
|
||||
TARGET = GPXSee
|
||||
}
|
||||
VERSION = 13.22
|
||||
VERSION = 13.23
|
||||
|
||||
|
||||
QT += core \
|
||||
@ -39,12 +39,9 @@ HEADERS += src/common/config.h \
|
||||
src/common/greatcircle.h \
|
||||
src/common/programpaths.h \
|
||||
src/common/tifffile.h \
|
||||
src/common/downloader.h \
|
||||
src/common/polygon.h \
|
||||
src/common/color.h \
|
||||
src/common/csv.h \
|
||||
src/common/dem.h \
|
||||
src/common/demloader.h \
|
||||
src/GUI/crosshairitem.h \
|
||||
src/GUI/motioninfoitem.h \
|
||||
src/GUI/pluginparameters.h \
|
||||
@ -122,6 +119,8 @@ HEADERS += src/common/config.h \
|
||||
src/data/gpsdumpparser.h \
|
||||
src/data/style.h \
|
||||
src/data/twonavparser.h \
|
||||
src/map/downloader.h \
|
||||
src/map/demloader.h \
|
||||
src/map/ENC/attributes.h \
|
||||
src/map/ENC/mapdata.h \
|
||||
src/map/ENC/atlasdata.h \
|
||||
@ -196,6 +195,7 @@ HEADERS += src/common/config.h \
|
||||
src/map/sqlitemap.h \
|
||||
src/map/utm.h \
|
||||
src/map/map.h \
|
||||
src/map/dem.h \
|
||||
src/map/maplist.h \
|
||||
src/map/onlinemap.h \
|
||||
src/map/tile.h \
|
||||
@ -281,10 +281,7 @@ SOURCES += src/main.cpp \
|
||||
src/common/greatcircle.cpp \
|
||||
src/common/programpaths.cpp \
|
||||
src/common/tifffile.cpp \
|
||||
src/common/downloader.cpp \
|
||||
src/common/csv.cpp \
|
||||
src/common/dem.cpp \
|
||||
src/common/demloader.cpp \
|
||||
src/GUI/crosshairitem.cpp \
|
||||
src/GUI/motioninfoitem.cpp \
|
||||
src/GUI/pluginparameters.cpp \
|
||||
@ -347,6 +344,8 @@ SOURCES += src/main.cpp \
|
||||
src/GUI/pngexportdialog.cpp \
|
||||
src/GUI/projectioncombobox.cpp \
|
||||
src/GUI/passwordedit.cpp \
|
||||
src/map/downloader.cpp \
|
||||
src/map/demloader.cpp \
|
||||
src/map/ENC/atlasdata.cpp \
|
||||
src/map/ENC/mapdata.cpp \
|
||||
src/map/ENC/rastertile.cpp \
|
||||
@ -436,6 +435,7 @@ SOURCES += src/main.cpp \
|
||||
src/map/geocentric.cpp \
|
||||
src/map/jnxmap.cpp \
|
||||
src/map/map.cpp \
|
||||
src/map/dem.cpp \
|
||||
src/map/geotiffmap.cpp \
|
||||
src/map/image.cpp \
|
||||
src/map/mbtilesmap.cpp \
|
||||
|
@ -168,6 +168,7 @@
|
||||
<file alias="deviation-dolphin.png">icons/map/marine/deviation-dolphin.png</file>
|
||||
<file alias="kelp.png">icons/map/marine/kelp.png</file>
|
||||
<file alias="eddies.png">icons/map/marine/eddies.png</file>
|
||||
<file alias="dome.png">icons/map/marine/dome.png</file>
|
||||
</qresource>
|
||||
|
||||
<!-- Mapsforge rendertheme -->
|
||||
|
BIN
icons/map/marine/dome.png
Normal file
BIN
icons/map/marine/dome.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 263 B |
@ -1894,7 +1894,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="645"/>
|
||||
<source>Lightening:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Clarejar:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="702"/>
|
||||
|
@ -1887,7 +1887,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="645"/>
|
||||
<source>Lightening:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Focos:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="702"/>
|
||||
|
@ -1870,7 +1870,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="645"/>
|
||||
<source>Lightening:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Világosítás:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="702"/>
|
||||
|
@ -172,7 +172,7 @@
|
||||
<message>
|
||||
<location filename="../src/data/data.cpp" line="180"/>
|
||||
<source>GPSDump files</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>GPSDump 파일</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/data/data.cpp" line="181"/>
|
||||
@ -414,7 +414,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="276"/>
|
||||
<source>Clear list</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>목록 지우기</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="288"/>
|
||||
@ -571,12 +571,12 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="458"/>
|
||||
<source>Download data DEM</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>데이터 DEM 다운로드</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="464"/>
|
||||
<source>Download map DEM</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>지도 DEM 다운로드</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="469"/>
|
||||
@ -586,7 +586,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="472"/>
|
||||
<source>Show hillshading</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>언덕 음영 표시</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="480"/>
|
||||
@ -708,7 +708,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="646"/>
|
||||
<source>Open recent</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>최근 열기</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="671"/>
|
||||
@ -1025,13 +1025,13 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="1961"/>
|
||||
<source>DEM tiles download limit exceeded. If you really need data for such a huge area, download the files manually.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>DEM 타일 다운로드 제한을 초과했습니다. 이렇게 넓은 지역에 대한 데이터가 정말 필요하다면 수동으로 파일을 다운로드하세요.</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../src/GUI/gui.cpp" line="1964"/>
|
||||
<source>Download %n DEM tiles?</source>
|
||||
<translation type="unfinished">
|
||||
<numerusform></numerusform>
|
||||
<translation>
|
||||
<numerusform>%n개의 DEM 타일을 다운로드하시겠습니까?</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -1442,7 +1442,7 @@
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="265"/>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="628"/>
|
||||
<source>px</source>
|
||||
<translation type="unfinished">px</translation>
|
||||
<translation>px</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="163"/>
|
||||
@ -1840,27 +1840,27 @@
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="306"/>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="644"/>
|
||||
<source>Opacity:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>불투명:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="646"/>
|
||||
<source>Blur radius:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>흐림 반경:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="648"/>
|
||||
<source>Azimuth:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>방위:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="649"/>
|
||||
<source>Altitude:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>고도:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="650"/>
|
||||
<source>Z Factor:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Z 요인:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="655"/>
|
||||
@ -1871,7 +1871,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="656"/>
|
||||
<source>Hillshading</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>언덕 음영</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="676"/>
|
||||
@ -1892,7 +1892,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="645"/>
|
||||
<source>Lightening:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>라이트닝:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="702"/>
|
||||
|
@ -1033,7 +1033,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="1961"/>
|
||||
<source>DEM tiles download limit exceeded. If you really need data for such a huge area, download the files manually.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Nedlastingsgrensen for DEM-fliser er overskredet. Hvis du virkelig trenger data for et så stort område, last ned filene manuelt.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="1977"/>
|
||||
@ -1770,7 +1770,7 @@
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="265"/>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="628"/>
|
||||
<source>px</source>
|
||||
<translation type="unfinished">px</translation>
|
||||
<translation>px</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="301"/>
|
||||
@ -1887,7 +1887,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="645"/>
|
||||
<source>Lightening:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Bleking:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="702"/>
|
||||
|
@ -860,14 +860,14 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="1961"/>
|
||||
<source>DEM tiles download limit exceeded. If you really need data for such a huge area, download the files manually.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>DEM-kartrutors nedladdningsgräns har överskridits. Ladda ner filer manuellt, om du verkligen behöver data för ett så stort område.</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../src/GUI/gui.cpp" line="1964"/>
|
||||
<source>Download %n DEM tiles?</source>
|
||||
<translation type="unfinished">
|
||||
<numerusform></numerusform>
|
||||
<numerusform></numerusform>
|
||||
<translation>
|
||||
<numerusform>Vill du ladda ner %n DEM-kartruta?</numerusform>
|
||||
<numerusform>Vill du ladda ner %n DEM-kartrutor?</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -966,12 +966,12 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="458"/>
|
||||
<source>Download data DEM</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Ladda ner data DEM</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="464"/>
|
||||
<source>Download map DEM</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Ladda ner karta DEM</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="739"/>
|
||||
@ -1750,7 +1750,7 @@
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="265"/>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="628"/>
|
||||
<source>px</source>
|
||||
<translation type="unfinished">px</translation>
|
||||
<translation>px</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="175"/>
|
||||
@ -1835,27 +1835,27 @@
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="306"/>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="644"/>
|
||||
<source>Opacity:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Opacitet:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="646"/>
|
||||
<source>Blur radius:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Oskärperadie:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="648"/>
|
||||
<source>Azimuth:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Azimut:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="649"/>
|
||||
<source>Altitude:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Altitud:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="650"/>
|
||||
<source>Z Factor:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Z-faktor:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="655"/>
|
||||
@ -1866,7 +1866,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="656"/>
|
||||
<source>Hillshading</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Bergskuggning</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="676"/>
|
||||
@ -1887,7 +1887,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="645"/>
|
||||
<source>Lightening:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Belysning:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="702"/>
|
||||
|
@ -1885,7 +1885,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="645"/>
|
||||
<source>Lightening:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Işıklandırma:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="702"/>
|
||||
|
@ -576,7 +576,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="472"/>
|
||||
<source>Show hillshading</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Показати затінення пагорба</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="480"/>
|
||||
@ -752,10 +752,10 @@
|
||||
<message numerus="yes">
|
||||
<location filename="../src/GUI/gui.cpp" line="1964"/>
|
||||
<source>Download %n DEM tiles?</source>
|
||||
<translation type="unfinished">
|
||||
<numerusform></numerusform>
|
||||
<numerusform></numerusform>
|
||||
<numerusform></numerusform>
|
||||
<translation>
|
||||
<numerusform>Завантажити %n плитку DEM?</numerusform>
|
||||
<numerusform>Завантажити %n плитки DEM?</numerusform>
|
||||
<numerusform>Завантажити %n плиток DEM?</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -1034,7 +1034,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="1961"/>
|
||||
<source>DEM tiles download limit exceeded. If you really need data for such a huge area, download the files manually.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Перевищено ліміт завантаження плиток DEM. Якщо вам дійсно потрібні дані для такої величезної території, завантажте файли вручну.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="1977"/>
|
||||
@ -1753,7 +1753,7 @@
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="265"/>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="628"/>
|
||||
<source>px</source>
|
||||
<translation type="unfinished">px</translation>
|
||||
<translation>ап</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="301"/>
|
||||
@ -1822,27 +1822,27 @@
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="306"/>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="644"/>
|
||||
<source>Opacity:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Непрозорість:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="646"/>
|
||||
<source>Blur radius:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Радіус розмиття:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="648"/>
|
||||
<source>Azimuth:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Азимут:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="649"/>
|
||||
<source>Altitude:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Висота:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="650"/>
|
||||
<source>Z Factor:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Фактор Z:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="655"/>
|
||||
@ -1853,7 +1853,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="656"/>
|
||||
<source>Hillshading</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Затінення пагорба</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="676"/>
|
||||
@ -1874,7 +1874,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="645"/>
|
||||
<source>Lightening:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Освітлення:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="702"/>
|
||||
|
@ -37,7 +37,7 @@ Unicode true
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "13.22"
|
||||
!define VERSION "13.23"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||
|
@ -13,8 +13,8 @@
|
||||
#endif // Q_OS_ANDROID
|
||||
#include "common/programpaths.h"
|
||||
#include "common/config.h"
|
||||
#include "common/downloader.h"
|
||||
#include "common/dem.h"
|
||||
#include "map/downloader.h"
|
||||
#include "map/dem.h"
|
||||
#include "map/ellipsoid.h"
|
||||
#include "map/gcs.h"
|
||||
#include "map/conversion.h"
|
||||
|
@ -39,8 +39,9 @@ void CadenceGraph::setInfo()
|
||||
clearInfo();
|
||||
}
|
||||
|
||||
QList<GraphItem*> CadenceGraph::loadData(const Data &data)
|
||||
QList<GraphItem*> CadenceGraph::loadData(const Data &data, Map *map)
|
||||
{
|
||||
Q_UNUSED(map);
|
||||
QList<GraphItem*> graphs;
|
||||
|
||||
for (int i = 0; i < data.tracks().count(); i++) {
|
||||
|
@ -14,7 +14,7 @@ public:
|
||||
~CadenceGraph();
|
||||
|
||||
QString label() const {return tr("Cadence");}
|
||||
QList<GraphItem*> loadData(const Data &data);
|
||||
QList<GraphItem*> loadData(const Data &data, Map *map);
|
||||
void clear();
|
||||
void showTracks(bool show);
|
||||
|
||||
|
@ -118,14 +118,14 @@ GraphItem *ElevationGraph::loadGraph(const Graph &graph, PathType type,
|
||||
return gi;
|
||||
}
|
||||
|
||||
QList<GraphItem*> ElevationGraph::loadData(const Data &data)
|
||||
QList<GraphItem*> ElevationGraph::loadData(const Data &data, Map *map)
|
||||
{
|
||||
QList<GraphItem*> graphs;
|
||||
GraphItem *primary, *secondary;
|
||||
|
||||
for (int i = 0; i < data.tracks().count(); i++) {
|
||||
QColor color(_palette.nextColor());
|
||||
const GraphPair &gp = data.tracks().at(i).elevation();
|
||||
const GraphPair &gp = data.tracks().at(i).elevation(map);
|
||||
|
||||
primary = loadGraph(gp.primary(), TrackPath, color, true);
|
||||
secondary = primary
|
||||
@ -137,7 +137,7 @@ QList<GraphItem*> ElevationGraph::loadData(const Data &data)
|
||||
}
|
||||
for (int i = 0; i < data.routes().count(); i++) {
|
||||
QColor color(_palette.nextColor());
|
||||
const GraphPair &gp = data.routes().at(i).elevation();
|
||||
const GraphPair &gp = data.routes().at(i).elevation(map);
|
||||
|
||||
primary = loadGraph(gp.primary(), RoutePath, color, true);
|
||||
secondary = primary
|
||||
|
@ -14,7 +14,7 @@ public:
|
||||
~ElevationGraph();
|
||||
|
||||
QString label() const {return tr("Elevation");}
|
||||
QList<GraphItem*> loadData(const Data &data);
|
||||
QList<GraphItem*> loadData(const Data &data, Map *map);
|
||||
void clear();
|
||||
void setUnits(enum Units units);
|
||||
void showTracks(bool show);
|
||||
|
@ -43,8 +43,9 @@ void GearRatioGraph::setInfo()
|
||||
clearInfo();
|
||||
}
|
||||
|
||||
QList<GraphItem*> GearRatioGraph::loadData(const Data &data)
|
||||
QList<GraphItem*> GearRatioGraph::loadData(const Data &data, Map *map)
|
||||
{
|
||||
Q_UNUSED(map);
|
||||
QList<GraphItem*> graphs;
|
||||
|
||||
for (int i = 0; i < data.tracks().count(); i++) {
|
||||
|
@ -15,7 +15,7 @@ public:
|
||||
~GearRatioGraph();
|
||||
|
||||
QString label() const {return tr("Gear ratio");}
|
||||
QList<GraphItem*> loadData(const Data &data);
|
||||
QList<GraphItem*> loadData(const Data &data, Map *map);
|
||||
void clear();
|
||||
void showTracks(bool show);
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "units.h"
|
||||
#include "timetype.h"
|
||||
|
||||
class Map;
|
||||
class Data;
|
||||
class GraphItem;
|
||||
|
||||
@ -24,7 +25,7 @@ public:
|
||||
virtual ~GraphTab() {}
|
||||
|
||||
virtual QString label() const = 0;
|
||||
virtual QList<GraphItem*> loadData(const Data &data) = 0;
|
||||
virtual QList<GraphItem*> loadData(const Data &data, Map *map) = 0;
|
||||
virtual void clear() {GraphView::clear();}
|
||||
virtual void setUnits(enum Units units) {GraphView::setUnits(units);}
|
||||
virtual void setGraphType(GraphType type) {GraphView::setGraphType(type);}
|
||||
|
@ -29,10 +29,10 @@
|
||||
#include <QGeoPositionInfoSource>
|
||||
#include "common/config.h"
|
||||
#include "common/programpaths.h"
|
||||
#include "common/downloader.h"
|
||||
#include "common/demloader.h"
|
||||
#include "data/data.h"
|
||||
#include "data/poi.h"
|
||||
#include "map/downloader.h"
|
||||
#include "map/demloader.h"
|
||||
#include "map/maplist.h"
|
||||
#include "map/emptymap.h"
|
||||
#include "map/crs.h"
|
||||
@ -1145,7 +1145,7 @@ void GUI::loadData(const Data &data)
|
||||
_pathName = QString();
|
||||
|
||||
for (int i = 0; i < _tabs.count(); i++)
|
||||
graphs.append(_tabs.at(i)->loadData(data));
|
||||
graphs.append(_tabs.at(i)->loadData(data, _map));
|
||||
if (updateGraphTabs())
|
||||
_splitter->refresh();
|
||||
paths = _mapView->loadData(data);
|
||||
|
@ -39,8 +39,9 @@ void HeartRateGraph::setInfo()
|
||||
clearInfo();
|
||||
}
|
||||
|
||||
QList<GraphItem*> HeartRateGraph::loadData(const Data &data)
|
||||
QList<GraphItem*> HeartRateGraph::loadData(const Data &data, Map *map)
|
||||
{
|
||||
Q_UNUSED(map);
|
||||
QList<GraphItem*> graphs;
|
||||
|
||||
for (int i = 0; i < data.tracks().count(); i++) {
|
||||
|
@ -14,7 +14,7 @@ public:
|
||||
~HeartRateGraph();
|
||||
|
||||
QString label() const {return tr("Heart rate");}
|
||||
QList<GraphItem*> loadData(const Data &data);
|
||||
QList<GraphItem*> loadData(const Data &data, Map *map);
|
||||
void clear();
|
||||
void showTracks(bool show);
|
||||
|
||||
|
@ -39,8 +39,9 @@ void PowerGraph::setInfo()
|
||||
clearInfo();
|
||||
}
|
||||
|
||||
QList<GraphItem*> PowerGraph::loadData(const Data &data)
|
||||
QList<GraphItem*> PowerGraph::loadData(const Data &data, Map *map)
|
||||
{
|
||||
Q_UNUSED(map);
|
||||
QList<GraphItem*> graphs;
|
||||
|
||||
for (int i = 0; i < data.tracks().count(); i++) {
|
||||
|
@ -14,7 +14,7 @@ public:
|
||||
~PowerGraph();
|
||||
|
||||
QString label() const {return tr("Power");}
|
||||
QList<GraphItem*> loadData(const Data &data);
|
||||
QList<GraphItem*> loadData(const Data &data, Map *map);
|
||||
void clear();
|
||||
void showTracks(bool show);
|
||||
|
||||
|
@ -69,8 +69,9 @@ GraphItem *SpeedGraph::loadGraph(const Graph &graph, const Track &track,
|
||||
return gi;
|
||||
}
|
||||
|
||||
QList<GraphItem*> SpeedGraph::loadData(const Data &data)
|
||||
QList<GraphItem*> SpeedGraph::loadData(const Data &data, Map *map)
|
||||
{
|
||||
Q_UNUSED(map);
|
||||
QList<GraphItem*> graphs;
|
||||
|
||||
for (int i = 0; i < data.tracks().count(); i++) {
|
||||
|
@ -16,7 +16,7 @@ public:
|
||||
~SpeedGraph();
|
||||
|
||||
QString label() const {return tr("Speed");}
|
||||
QList<GraphItem*> loadData(const Data &data);
|
||||
QList<GraphItem*> loadData(const Data &data, Map *map);
|
||||
void clear();
|
||||
void setUnits(Units units);
|
||||
void setTimeType(TimeType type);
|
||||
|
@ -43,8 +43,9 @@ void TemperatureGraph::setInfo()
|
||||
clearInfo();
|
||||
}
|
||||
|
||||
QList<GraphItem*> TemperatureGraph::loadData(const Data &data)
|
||||
QList<GraphItem*> TemperatureGraph::loadData(const Data &data, Map *map)
|
||||
{
|
||||
Q_UNUSED(map);
|
||||
QList<GraphItem*> graphs;
|
||||
|
||||
for (int i = 0; i < data.tracks().count(); i++) {
|
||||
|
@ -14,7 +14,7 @@ public:
|
||||
~TemperatureGraph();
|
||||
|
||||
QString label() const {return tr("Temperature");}
|
||||
QList<GraphItem*> loadData(const Data &data);
|
||||
QList<GraphItem*> loadData(const Data &data, Map *map);
|
||||
void clear();
|
||||
void setUnits(enum Units units);
|
||||
void showTracks(bool show);
|
||||
|
@ -25,7 +25,7 @@ ToolTip WaypointItem::info() const
|
||||
tt.insert(qApp->translate("WaypointItem", "Name"), _waypoint.name());
|
||||
tt.insert(qApp->translate("WaypointItem", "Coordinates"),
|
||||
Format::coordinates(_waypoint.coordinates(), _format));
|
||||
QPair<qreal, qreal> elevations(_waypoint.elevations());
|
||||
QPair<qreal, qreal> elevations(_waypoint.elevations(_map));
|
||||
if (!std::isnan(elevations.first)) {
|
||||
QString val = Format::elevation(elevations.first, _units);
|
||||
if (!std::isnan(elevations.second))
|
||||
@ -71,7 +71,7 @@ ToolTip WaypointItem::info() const
|
||||
}
|
||||
|
||||
WaypointItem::WaypointItem(const Waypoint &waypoint, Map *map,
|
||||
QGraphicsItem *parent) : GraphicsItem(parent)
|
||||
QGraphicsItem *parent) : GraphicsItem(parent), _map(map)
|
||||
{
|
||||
_waypoint = waypoint;
|
||||
_showLabel = false;
|
||||
@ -93,6 +93,12 @@ WaypointItem::WaypointItem(const Waypoint &waypoint, Map *map,
|
||||
setAcceptHoverEvents(true);
|
||||
}
|
||||
|
||||
void WaypointItem::setMap(Map *map)
|
||||
{
|
||||
_map = map;
|
||||
setPos(map->ll2xy(_waypoint.coordinates()));
|
||||
}
|
||||
|
||||
void WaypointItem::updateCache()
|
||||
{
|
||||
QPainterPath p;
|
||||
|
@ -17,7 +17,7 @@ public:
|
||||
|
||||
const Waypoint &waypoint() const {return _waypoint;}
|
||||
|
||||
void setMap(Map *map) {setPos(map->ll2xy(_waypoint.coordinates()));}
|
||||
void setMap(Map *map);
|
||||
void setSize(int size);
|
||||
void setColor(const QColor &color);
|
||||
void showLabel(bool show);
|
||||
@ -51,6 +51,8 @@ private:
|
||||
|
||||
Waypoint _waypoint;
|
||||
|
||||
Map *_map;
|
||||
|
||||
QColor _color;
|
||||
int _size;
|
||||
bool _showLabel;
|
||||
|
@ -19,9 +19,9 @@ public:
|
||||
private:
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) || defined(Q_OS_ANDROID)
|
||||
QTextCodec *_codec;
|
||||
#else // QT 6.5
|
||||
#else // QT 6 || ANDROID
|
||||
QStringDecoder _decoder;
|
||||
#endif // QT 6.5
|
||||
#endif // QT 6 || ANDROID
|
||||
};
|
||||
|
||||
#endif // TEXTCODEC_H
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include <QtEndian>
|
||||
#include "fitparser.h"
|
||||
|
||||
|
||||
#define FIT_MAGIC 0x5449462E // .FIT
|
||||
|
||||
#define RECORD_MESSAGE 20
|
||||
@ -10,60 +9,6 @@
|
||||
#define COURSE_POINT 32
|
||||
#define TIMESTAMP_FIELD 253
|
||||
|
||||
class Event {
|
||||
public:
|
||||
Event() : id(0), type(0), data(0) {}
|
||||
|
||||
quint8 id;
|
||||
quint8 type;
|
||||
quint32 data;
|
||||
};
|
||||
|
||||
struct FileHeader {
|
||||
quint8 headerSize;
|
||||
quint8 protocolVersion;
|
||||
quint16 profileVersion;
|
||||
quint32 dataSize;
|
||||
quint32 magic;
|
||||
};
|
||||
|
||||
struct FITParser::Field {
|
||||
quint8 id;
|
||||
quint8 size;
|
||||
quint8 type;
|
||||
};
|
||||
|
||||
class FITParser::MessageDefinition {
|
||||
public:
|
||||
MessageDefinition() : endian(0), globalId(0), numFields(0), fields(0),
|
||||
numDevFields(0), devFields(0) {}
|
||||
~MessageDefinition() {delete[] fields; delete[] devFields;}
|
||||
|
||||
quint8 endian;
|
||||
quint16 globalId;
|
||||
quint8 numFields;
|
||||
Field *fields;
|
||||
quint8 numDevFields;
|
||||
Field *devFields;
|
||||
};
|
||||
|
||||
class FITParser::CTX {
|
||||
public:
|
||||
CTX(QFile *file, QVector<Waypoint> &waypoints)
|
||||
: file(file), waypoints(waypoints), len(0), endian(0), timestamp(0),
|
||||
ratio(NAN) {}
|
||||
|
||||
QFile *file;
|
||||
QVector<Waypoint> &waypoints;
|
||||
quint32 len;
|
||||
quint8 endian;
|
||||
quint32 timestamp;
|
||||
MessageDefinition defs[16];
|
||||
qreal ratio;
|
||||
Trackpoint trackpoint;
|
||||
SegmentData segment;
|
||||
};
|
||||
|
||||
static QMap<int, QString> coursePointSymbolsInit()
|
||||
{
|
||||
QMap<int, QString> map;
|
||||
@ -178,22 +123,14 @@ bool FITParser::skipValue(CTX &ctx, quint8 size)
|
||||
|
||||
bool FITParser::parseDefinitionMessage(CTX &ctx, quint8 header)
|
||||
{
|
||||
int local_id = header & 0x0f;
|
||||
MessageDefinition *def = &(ctx.defs[local_id]);
|
||||
quint8 i;
|
||||
MessageDefinition *def = &(ctx.defs[header & 0x0f]);
|
||||
quint8 numFields;
|
||||
|
||||
|
||||
if (def->fields) {
|
||||
delete[] def->fields;
|
||||
def->fields = 0;
|
||||
}
|
||||
if (def->devFields) {
|
||||
delete[] def->devFields;
|
||||
def->devFields = 0;
|
||||
}
|
||||
def->fields.clear();
|
||||
def->devFields.clear();
|
||||
|
||||
// reserved/unused
|
||||
if (!readValue(ctx, i))
|
||||
if (!skipValue(ctx, 1))
|
||||
return false;
|
||||
|
||||
// endianness
|
||||
@ -209,40 +146,35 @@ bool FITParser::parseDefinitionMessage(CTX &ctx, quint8 header)
|
||||
if (!readValue(ctx, def->globalId))
|
||||
return false;
|
||||
|
||||
// number of records
|
||||
if (!readValue(ctx, def->numFields))
|
||||
// definition records
|
||||
if (!readValue(ctx, numFields))
|
||||
return false;
|
||||
|
||||
// definition records
|
||||
def->fields = new Field[def->numFields];
|
||||
for (i = 0; i < def->numFields; i++) {
|
||||
static_assert(sizeof(def->fields[i]) == 3, "Invalid Field alignment");
|
||||
if (!readData(ctx.file, (char*)&(def->fields[i]),
|
||||
sizeof(def->fields[i])))
|
||||
def->fields.resize(numFields);
|
||||
for (int i = 0; i < def->fields.size(); i++) {
|
||||
if (!readData(ctx.file, (char*)&(def->fields[i]), sizeof(Field)))
|
||||
return false;
|
||||
ctx.len -= sizeof(def->fields[i]);
|
||||
ctx.len -= sizeof(Field);
|
||||
}
|
||||
|
||||
// developer definition records
|
||||
if (header & 0x20) {
|
||||
if (!readValue(ctx, def->numDevFields))
|
||||
if (!readValue(ctx, numFields))
|
||||
return false;
|
||||
|
||||
def->devFields = new Field[def->numDevFields];
|
||||
for (i = 0; i < def->numDevFields; i++) {
|
||||
static_assert(sizeof(def->fields[i]) == 3, "Invalid Field alignment");
|
||||
if (!readData(ctx.file, (char*)&(def->devFields[i]),
|
||||
sizeof(def->devFields[i])))
|
||||
def->devFields.resize(numFields);
|
||||
for (int i = 0; i < def->devFields.size(); i++) {
|
||||
if (!readData(ctx.file, (char*)&(def->devFields[i]), sizeof(Field)))
|
||||
return false;
|
||||
ctx.len -= sizeof(def->devFields[i]);
|
||||
ctx.len -= sizeof(Field);
|
||||
}
|
||||
} else
|
||||
def->numDevFields = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FITParser::readField(CTX &ctx, Field *field, QVariant &val, bool &valid)
|
||||
bool FITParser::readField(CTX &ctx, const Field *field, QVariant &val,
|
||||
bool &valid)
|
||||
{
|
||||
bool ret;
|
||||
|
||||
@ -299,22 +231,20 @@ bool FITParser::readField(CTX &ctx, Field *field, QVariant &val, bool &valid)
|
||||
|
||||
bool FITParser::parseData(CTX &ctx, const MessageDefinition *def)
|
||||
{
|
||||
Field *field;
|
||||
QVariant val;
|
||||
bool valid;
|
||||
Event event;
|
||||
Waypoint waypoint;
|
||||
|
||||
|
||||
if (!def->fields && !def->devFields) {
|
||||
if (!def->fields.size() && !def->devFields.size()) {
|
||||
_errorString = "Undefined data message";
|
||||
return false;
|
||||
}
|
||||
|
||||
ctx.endian = def->endian;
|
||||
|
||||
for (int i = 0; i < def->numFields; i++) {
|
||||
field = &def->fields[i];
|
||||
for (int i = 0; i < def->fields.size(); i++) {
|
||||
const Field *field = &def->fields.at(i);
|
||||
if (!readField(ctx, field, val, valid))
|
||||
return false;
|
||||
if (!valid)
|
||||
@ -416,12 +346,9 @@ bool FITParser::parseData(CTX &ctx, const MessageDefinition *def)
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < def->numDevFields; i++) {
|
||||
field = &def->devFields[i];
|
||||
if (!readField(ctx, field, val, valid))
|
||||
for (int i = 0; i < def->devFields.size(); i++)
|
||||
if (!readField(ctx, &def->devFields.at(i), val, valid))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (def->globalId == EVENT_MESSAGE) {
|
||||
if ((event.id == 42 || event.id == 43) && event.type == 3) {
|
||||
@ -453,15 +380,15 @@ bool FITParser::parseData(CTX &ctx, const MessageDefinition *def)
|
||||
|
||||
bool FITParser::parseDataMessage(CTX &ctx, quint8 header)
|
||||
{
|
||||
int local_id = header & 0xf;
|
||||
MessageDefinition *def = &(ctx.defs[local_id]);
|
||||
int localId = header & 0xf;
|
||||
MessageDefinition *def = &(ctx.defs[localId]);
|
||||
return parseData(ctx, def);
|
||||
}
|
||||
|
||||
bool FITParser::parseCompressedMessage(CTX &ctx, quint8 header)
|
||||
{
|
||||
int local_id = (header >> 5) & 3;
|
||||
MessageDefinition *def = &(ctx.defs[local_id]);
|
||||
int localId = (header >> 5) & 3;
|
||||
MessageDefinition *def = &(ctx.defs[localId]);
|
||||
ctx.timestamp += header & 0x1f;
|
||||
return parseData(ctx, def);
|
||||
}
|
||||
@ -487,7 +414,6 @@ bool FITParser::parseHeader(CTX &ctx)
|
||||
quint16 crc;
|
||||
qint64 len;
|
||||
|
||||
static_assert(sizeof(hdr) == 12, "Invalid FileHeader alignment");
|
||||
len = ctx.file->read((char*)&hdr, sizeof(hdr));
|
||||
if (len < 0) {
|
||||
_errorString = "I/O error";
|
||||
@ -515,7 +441,6 @@ bool FITParser::parse(QFile *file, QList<TrackData> &tracks,
|
||||
Q_UNUSED(polygons);
|
||||
CTX ctx(file, waypoints);
|
||||
|
||||
|
||||
if (!parseHeader(ctx))
|
||||
return false;
|
||||
|
||||
|
@ -3,25 +3,72 @@
|
||||
|
||||
#include "parser.h"
|
||||
|
||||
class QFile;
|
||||
|
||||
class FITParser : public Parser
|
||||
{
|
||||
public:
|
||||
FITParser()
|
||||
{
|
||||
static_assert(sizeof(Field) == 3, "Invalid Field alignment");
|
||||
static_assert(sizeof(FileHeader) == 12, "Invalid FileHeader alignment");
|
||||
}
|
||||
|
||||
bool parse(QFile *file, QList<TrackData> &tracks, QList<RouteData> &routes,
|
||||
QList<Area> &polygons, QVector<Waypoint> &waypoints);
|
||||
QString errorString() const {return _errorString;}
|
||||
int errorLine() const {return 0;}
|
||||
|
||||
private:
|
||||
struct Field;
|
||||
class MessageDefinition;
|
||||
class CTX;
|
||||
struct Event
|
||||
{
|
||||
Event() : data(0), id(0), type(0) {}
|
||||
|
||||
quint32 data;
|
||||
quint8 id;
|
||||
quint8 type;
|
||||
};
|
||||
struct FileHeader
|
||||
{
|
||||
quint8 headerSize;
|
||||
quint8 protocolVersion;
|
||||
quint16 profileVersion;
|
||||
quint32 dataSize;
|
||||
quint32 magic;
|
||||
};
|
||||
struct Field
|
||||
{
|
||||
quint8 id;
|
||||
quint8 size;
|
||||
quint8 type;
|
||||
};
|
||||
struct MessageDefinition
|
||||
{
|
||||
MessageDefinition() : globalId(0), endian(0) {}
|
||||
|
||||
QVector<Field> fields;
|
||||
QVector<Field> devFields;
|
||||
quint16 globalId;
|
||||
quint8 endian;
|
||||
};
|
||||
struct CTX {
|
||||
CTX(QFile *file, QVector<Waypoint> &waypoints)
|
||||
: file(file), waypoints(waypoints), len(0), endian(0), timestamp(0),
|
||||
ratio(NAN) {}
|
||||
|
||||
QFile *file;
|
||||
QVector<Waypoint> &waypoints;
|
||||
quint32 len;
|
||||
quint8 endian;
|
||||
quint32 timestamp;
|
||||
MessageDefinition defs[16];
|
||||
qreal ratio;
|
||||
Trackpoint trackpoint;
|
||||
SegmentData segment;
|
||||
};
|
||||
|
||||
bool readData(QFile *file, char *data, size_t size);
|
||||
template<class T> bool readValue(CTX &ctx, T &val);
|
||||
bool skipValue(CTX &ctx, quint8 size);
|
||||
bool readField(CTX &ctx, Field *field, QVariant &val, bool &valid);
|
||||
bool readField(CTX &ctx, const Field *field, QVariant &val, bool &valid);
|
||||
|
||||
bool parseHeader(CTX &ctx);
|
||||
bool parseRecord(CTX &ctx);
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "common/dem.h"
|
||||
#include "map/map.h"
|
||||
#include "route.h"
|
||||
|
||||
bool Route::_useDEM = false;
|
||||
@ -49,19 +49,17 @@ Graph Route::gpsElevation() const
|
||||
return graph;
|
||||
}
|
||||
|
||||
Graph Route::demElevation() const
|
||||
Graph Route::demElevation(Map *map) const
|
||||
{
|
||||
Graph graph;
|
||||
QDateTime date;
|
||||
GraphSegment gs(date);
|
||||
|
||||
DEM::lock();
|
||||
for (int i = 0; i < _data.size(); i++) {
|
||||
qreal dem = DEM::elevation(_data.at(i).coordinates());
|
||||
qreal dem = map->elevation(_data.at(i).coordinates());
|
||||
if (!std::isnan(dem))
|
||||
gs.append(GraphPoint(_distance.at(i), NAN, dem));
|
||||
}
|
||||
DEM::unlock();
|
||||
|
||||
if (gs.size() >= 2)
|
||||
graph.append(gs);
|
||||
@ -72,18 +70,18 @@ Graph Route::demElevation() const
|
||||
return graph;
|
||||
}
|
||||
|
||||
GraphPair Route::elevation() const
|
||||
GraphPair Route::elevation(Map *map) const
|
||||
{
|
||||
if (_useDEM) {
|
||||
Graph dem(demElevation());
|
||||
Graph dem(demElevation(map));
|
||||
return (dem.isEmpty())
|
||||
? GraphPair(gpsElevation(), Graph())
|
||||
: GraphPair(dem, _show2ndElevation ? gpsElevation() : Graph());
|
||||
} else {
|
||||
Graph gps(gpsElevation());
|
||||
return (gps.isEmpty())
|
||||
? GraphPair(demElevation(), Graph())
|
||||
: GraphPair(gps, _show2ndElevation ? demElevation() : Graph());
|
||||
? GraphPair(demElevation(map), Graph())
|
||||
: GraphPair(gps, _show2ndElevation ? demElevation(map) : Graph());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,8 @@
|
||||
#include "graph.h"
|
||||
#include "path.h"
|
||||
|
||||
class Map;
|
||||
|
||||
class Route
|
||||
{
|
||||
public:
|
||||
@ -13,7 +15,7 @@ public:
|
||||
|
||||
const RouteData &data() const {return _data;}
|
||||
Path path() const;
|
||||
GraphPair elevation() const;
|
||||
GraphPair elevation(Map *map) const;
|
||||
qreal distance() const;
|
||||
|
||||
const QString &name() const {return _data.name();}
|
||||
@ -30,7 +32,7 @@ public:
|
||||
|
||||
private:
|
||||
Graph gpsElevation() const;
|
||||
Graph demElevation() const;
|
||||
Graph demElevation(Map *map) const;
|
||||
|
||||
RouteData _data;
|
||||
QVector<qreal> _distance;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "common/dem.h"
|
||||
#include "map/map.h"
|
||||
#include "track.h"
|
||||
|
||||
|
||||
@ -277,11 +277,10 @@ Graph Track::gpsElevation() const
|
||||
return ret;
|
||||
}
|
||||
|
||||
Graph Track::demElevation() const
|
||||
Graph Track::demElevation(Map *map) const
|
||||
{
|
||||
Graph ret;
|
||||
|
||||
DEM::lock();
|
||||
for (int i = 0; i < _data.size(); i++) {
|
||||
const SegmentData &sd = _data.at(i);
|
||||
if (sd.size() < 2)
|
||||
@ -290,7 +289,7 @@ Graph Track::demElevation() const
|
||||
GraphSegment gs(seg.start);
|
||||
|
||||
for (int j = 0; j < sd.size(); j++) {
|
||||
qreal dem = DEM::elevation(sd.at(j).coordinates());
|
||||
qreal dem = map->elevation(sd.at(j).coordinates());
|
||||
if (std::isnan(dem) || seg.outliers.contains(j))
|
||||
continue;
|
||||
gs.append(GraphPoint(seg.distance.at(j), seg.time.at(j), dem));
|
||||
@ -299,7 +298,6 @@ Graph Track::demElevation() const
|
||||
if (gs.size() >= 2)
|
||||
ret.append(filter(gs, _elevationWindow));
|
||||
}
|
||||
DEM::unlock();
|
||||
|
||||
if (_data.style().color().isValid())
|
||||
ret.setColor(_data.style().color());
|
||||
@ -307,18 +305,18 @@ Graph Track::demElevation() const
|
||||
return ret;
|
||||
}
|
||||
|
||||
GraphPair Track::elevation() const
|
||||
GraphPair Track::elevation(Map *map) const
|
||||
{
|
||||
if (_useDEM) {
|
||||
Graph dem(demElevation());
|
||||
Graph dem(demElevation(map));
|
||||
return (dem.isEmpty())
|
||||
? GraphPair(gpsElevation(), Graph())
|
||||
: GraphPair(dem, _show2ndElevation ? gpsElevation() : Graph());
|
||||
} else {
|
||||
Graph gps(gpsElevation());
|
||||
return (gps.isEmpty())
|
||||
? GraphPair(demElevation(), Graph())
|
||||
: GraphPair(gps, _show2ndElevation ? demElevation() : Graph());
|
||||
? GraphPair(demElevation(map), Graph())
|
||||
: GraphPair(gps, _show2ndElevation ? demElevation(map) : Graph());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "graph.h"
|
||||
#include "path.h"
|
||||
|
||||
class Map;
|
||||
|
||||
class Track
|
||||
{
|
||||
@ -17,7 +18,7 @@ public:
|
||||
|
||||
Path path() const;
|
||||
|
||||
GraphPair elevation() const;
|
||||
GraphPair elevation(Map *map) const;
|
||||
GraphPair speed() const;
|
||||
Graph heartRate() const;
|
||||
Graph temperature() const;
|
||||
@ -68,7 +69,7 @@ private:
|
||||
qreal lastTime(int seg);
|
||||
bool discardStopPoint(const Segment &seg, int i) const;
|
||||
|
||||
Graph demElevation() const;
|
||||
Graph demElevation(Map *map) const;
|
||||
Graph gpsElevation() const;
|
||||
Graph reportedSpeed() const;
|
||||
Graph computedSpeed() const;
|
||||
|
@ -1,18 +1,16 @@
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include "common/dem.h"
|
||||
#include "map/map.h"
|
||||
#include "waypoint.h"
|
||||
|
||||
bool Waypoint::_useDEM = false;
|
||||
bool Waypoint::_show2ndElevation = false;
|
||||
QHash<QString, QPixmap> Waypoint::_symbolIcons;
|
||||
|
||||
QPair<qreal, qreal> Waypoint::elevations() const
|
||||
QPair<qreal, qreal> Waypoint::elevations(Map *map) const
|
||||
{
|
||||
if (_useDEM) {
|
||||
DEM::lock();
|
||||
qreal dem = DEM::elevation(coordinates());
|
||||
DEM::unlock();
|
||||
qreal dem = map->elevation(coordinates());
|
||||
if (!std::isnan(dem))
|
||||
return QPair<qreal, qreal>(dem, _show2ndElevation ? elevation()
|
||||
: NAN);
|
||||
@ -20,12 +18,10 @@ QPair<qreal, qreal> Waypoint::elevations() const
|
||||
return QPair<qreal, qreal>(elevation(), NAN);
|
||||
} else {
|
||||
if (hasElevation()) {
|
||||
DEM::lock();
|
||||
qreal dem = _show2ndElevation ? DEM::elevation(coordinates()) : NAN;
|
||||
DEM::unlock();
|
||||
qreal dem = _show2ndElevation ? map->elevation(coordinates()) : NAN;
|
||||
return QPair<qreal, qreal>(elevation(), dem);
|
||||
} else
|
||||
return QPair<qreal, qreal>(DEM::elevation(coordinates()), NAN);
|
||||
return QPair<qreal, qreal>(map->elevation(coordinates()), NAN);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,8 @@
|
||||
#include "link.h"
|
||||
#include "style.h"
|
||||
|
||||
class Map;
|
||||
|
||||
class Waypoint
|
||||
{
|
||||
public:
|
||||
@ -33,7 +35,7 @@ public:
|
||||
qreal elevation() const {return _elevation;}
|
||||
const PointStyle &style() const {return _style;}
|
||||
|
||||
QPair<qreal, qreal> elevations() const;
|
||||
QPair<qreal, qreal> elevations(Map *map) const;
|
||||
|
||||
void setCoordinates(const Coordinates &coordinates)
|
||||
{_coordinates = coordinates;}
|
||||
|
@ -26,6 +26,7 @@
|
||||
#define RESTRN 131
|
||||
#define TRAFIC 172
|
||||
#define VALDCO 174
|
||||
#define VERCLR 181
|
||||
#define WATLEV 187
|
||||
|
||||
#define I_CATACH 17000
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "GUI/units.h"
|
||||
#include "objects.h"
|
||||
#include "attributes.h"
|
||||
#include "mapdata.h"
|
||||
@ -287,13 +288,22 @@ MapData::Point::Point(uint type, const Coordinates &c, const QString &label,
|
||||
}
|
||||
}
|
||||
|
||||
MapData::Poly::Poly(uint type, const Polygon &path,
|
||||
const QVector<QByteArray> ¶ms) : _type(type), _path(path)
|
||||
MapData::Poly::Poly(uint type, const Polygon &path, const QString &label,
|
||||
const QVector<QByteArray> ¶ms, uint HUNI) : _type(type), _path(path)
|
||||
{
|
||||
if (type == TYPE(DEPARE) && params.size())
|
||||
_type = SUBTYPE(DEPARE, depthLevel(params.at(0)));
|
||||
else if (type == TYPE(TSSLPT) && params.size())
|
||||
_param = QVariant(params.at(0).toDouble());
|
||||
else if ((type == TYPE(BRIDGE) || type == TYPE(I_BRIDGE))
|
||||
&& params.size()) {
|
||||
double clr = params.at(0).toDouble();
|
||||
if (clr > 0) {
|
||||
_label = QString::fromUtf8("\xE2\x86\x95") + UNIT_SPACE
|
||||
+ QString::number(clr) + UNIT_SPACE + hUnits(HUNI);
|
||||
}
|
||||
} else if (type>>16 == LNDARE || type>>16 == SEAARE)
|
||||
_label = label;
|
||||
}
|
||||
|
||||
MapData::Line::Line(uint type, const QVector<Coordinates> &path,
|
||||
@ -638,6 +648,9 @@ MapData::Attr MapData::polyAttr(const ISO8211::Record &r, uint OBJL)
|
||||
const QVector<QVariant> &av = ATTF->data().at(i);
|
||||
uint key = av.at(0).toUInt();
|
||||
|
||||
if (key == OBJNAM)
|
||||
label = QString::fromLatin1(av.at(1).toByteArray());
|
||||
|
||||
if ((OBJL == RESARE && key == CATREA)
|
||||
|| (OBJL == I_RESARE && key == CATREA)
|
||||
|| (OBJL == ACHARE && key == CATACH)
|
||||
@ -657,6 +670,9 @@ MapData::Attr MapData::polyAttr(const ISO8211::Record &r, uint OBJL)
|
||||
if ((OBJL == TSSLPT && key == ORIENT)
|
||||
|| (OBJL == DEPARE && key == DRVAL1))
|
||||
params[0] = av.at(1).toByteArray();
|
||||
if ((OBJL == BRIDGE && key == VERCLR)
|
||||
|| (OBJL == I_BRIDGE && key == VERCLR))
|
||||
params[0] = av.at(1).toByteArray();
|
||||
}
|
||||
|
||||
return Attr(subtype, label, params);
|
||||
@ -689,18 +705,18 @@ MapData::Line *MapData::lineObject(const ISO8211::Record &r,
|
||||
}
|
||||
|
||||
MapData::Poly *MapData::polyObject(const ISO8211::Record &r,
|
||||
const RecordMap &vc, const RecordMap &ve, uint COMF, uint OBJL)
|
||||
const RecordMap &vc, const RecordMap &ve, uint COMF, uint OBJL, uint HUNI)
|
||||
{
|
||||
Polygon path(polyGeometry(r, vc, ve, COMF));
|
||||
Attr attr(polyAttr(r, OBJL));
|
||||
|
||||
return (path.isEmpty() ? 0 : new Poly(SUBTYPE(OBJL, attr.subtype()), path,
|
||||
attr.params()));
|
||||
attr.label(), attr.params(), HUNI));
|
||||
}
|
||||
|
||||
bool MapData::processRecord(const ISO8211::Record &record,
|
||||
QVector<ISO8211::Record> &fe, RecordMap &vi, RecordMap &vc, RecordMap &ve,
|
||||
RecordMap &vf, uint &COMF, uint &SOMF)
|
||||
RecordMap &vf, uint &COMF, uint &SOMF, uint &HUNI)
|
||||
{
|
||||
if (record.size() < 2)
|
||||
return false;
|
||||
@ -735,6 +751,8 @@ bool MapData::processRecord(const ISO8211::Record &record,
|
||||
} else if (ba == "DSPM") {
|
||||
if (!(f.subfield("COMF", &COMF) && f.subfield("SOMF", &SOMF)))
|
||||
return false;
|
||||
if (!f.subfield("HUNI", &HUNI))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -746,7 +764,7 @@ MapData::MapData(const QString &path)
|
||||
QVector<ISO8211::Record> fe;
|
||||
ISO8211 ddf(path);
|
||||
ISO8211::Record record;
|
||||
uint PRIM, OBJL, COMF = 1, SOMF = 1;
|
||||
uint PRIM, OBJL, COMF = 1, SOMF = 1, HUNI = 1;
|
||||
Poly *poly;
|
||||
Line *line;
|
||||
Point *point;
|
||||
@ -756,7 +774,7 @@ MapData::MapData(const QString &path)
|
||||
if (!ddf.readDDR())
|
||||
return;
|
||||
while (ddf.readRecord(record))
|
||||
if (!processRecord(record, fe, vi, vc, ve, vf, COMF, SOMF))
|
||||
if (!processRecord(record, fe, vi, vc, ve, vf, COMF, SOMF, HUNI))
|
||||
qWarning("Invalid S-57 record");
|
||||
|
||||
for (int i = 0; i < fe.size(); i++) {
|
||||
@ -793,7 +811,7 @@ MapData::MapData(const QString &path)
|
||||
warning(f, PRIM);
|
||||
break;
|
||||
case PRIM_A:
|
||||
if ((poly = polyObject(r, vc, ve, COMF, OBJL))) {
|
||||
if ((poly = polyObject(r, vc, ve, COMF, OBJL, HUNI))) {
|
||||
rectcBounds(poly->bounds(), min, max);
|
||||
_areas.Insert(min, max, poly);
|
||||
} else
|
||||
|
@ -13,16 +13,19 @@ class MapData
|
||||
public:
|
||||
class Poly {
|
||||
public:
|
||||
Poly(uint type, const Polygon &path, const QVector<QByteArray> ¶ms);
|
||||
Poly(uint type, const Polygon &path, const QString &label,
|
||||
const QVector<QByteArray> ¶ms, uint HUNI);
|
||||
|
||||
RectC bounds() const {return _path.boundingRect();}
|
||||
const Polygon &path() const {return _path;}
|
||||
uint type() const {return _type;}
|
||||
const QString &label() const {return _label;}
|
||||
const QVariant ¶m() const {return _param;}
|
||||
|
||||
private:
|
||||
uint _type;
|
||||
Polygon _path;
|
||||
QString _label;
|
||||
QVariant _param;
|
||||
};
|
||||
|
||||
@ -121,11 +124,11 @@ private:
|
||||
static Line *lineObject(const ISO8211::Record &r, const RecordMap &vc,
|
||||
const RecordMap &ve, uint COMF, uint OBJL);
|
||||
static Poly *polyObject(const ISO8211::Record &r, const RecordMap &vc,
|
||||
const RecordMap &ve, uint COMF,uint OBJL);
|
||||
const RecordMap &ve, uint COMF, uint OBJL, uint HUNI);
|
||||
|
||||
static bool processRecord(const ISO8211::Record &record,
|
||||
QVector<ISO8211::Record> &fe, RecordMap &vi, RecordMap &vc, RecordMap &ve,
|
||||
RecordMap &vf, uint &COMF, uint &SOMF);
|
||||
RecordMap &vf, uint &COMF, uint &SOMF, uint &HUNI);
|
||||
|
||||
PolygonTree _areas;
|
||||
LineTree _lines;
|
||||
|
@ -78,6 +78,7 @@
|
||||
#define RESARE 112
|
||||
#define RIVERS 114
|
||||
#define ROADWY 116
|
||||
#define SEAARE 119
|
||||
#define SLCONS 122
|
||||
#define SISTAT 123
|
||||
#define SILTNK 125
|
||||
|
@ -12,7 +12,7 @@
|
||||
using namespace ENC;
|
||||
|
||||
#define TEXT_EXTENT 160
|
||||
#define TSSLPT_SIZE 0.005 /* ll */
|
||||
#define TSSLPT_SIZE 24
|
||||
|
||||
typedef QSet<Coordinates> PointSet;
|
||||
|
||||
@ -20,40 +20,6 @@ static const float C1 = 0.866025f; /* sqrt(3)/2 */
|
||||
static const QColor tsslptPen = QColor(0xeb, 0x49, 0xeb);
|
||||
static const QColor tsslptBrush = QColor(0xeb, 0x49, 0xeb, 0x80);
|
||||
|
||||
static double area(const QVector<Coordinates> &polygon)
|
||||
{
|
||||
double area = 0;
|
||||
|
||||
for (int i = 0; i < polygon.size() - 1; i++) {
|
||||
const Coordinates &pi = polygon.at(i);
|
||||
const Coordinates &pj = polygon.at(i+1);
|
||||
area += pi.lon() * pj.lat();
|
||||
area -= pi.lat() * pj.lon();
|
||||
}
|
||||
area /= 2.0;
|
||||
|
||||
return area;
|
||||
}
|
||||
|
||||
static Coordinates centroid(const QVector<Coordinates> &polygon)
|
||||
{
|
||||
Q_ASSERT(polygon.size() > 3);
|
||||
Q_ASSERT(polygon.first() == polygon.last());
|
||||
|
||||
double cx = 0, cy = 0;
|
||||
double factor = 1.0 / (6.0 * area(polygon));
|
||||
|
||||
for (int i = 0; i < polygon.size() - 1; i++) {
|
||||
const Coordinates &pi = polygon.at(i);
|
||||
const Coordinates &pj = polygon.at(i+1);
|
||||
double f = (pi.lon() * pj.lat() - pj.lon() * pi.lat());
|
||||
cx += (pi.lon() + pj.lon()) * f;
|
||||
cy += (pi.lat() + pj.lat()) * f;
|
||||
}
|
||||
|
||||
return Coordinates(cx * factor, cy * factor);
|
||||
}
|
||||
|
||||
static double angle(uint type, const QVariant ¶m)
|
||||
{
|
||||
uint bt = type>>16;
|
||||
@ -75,6 +41,31 @@ static bool showLabel(const QImage *img, const Range &range, int zoom, int type)
|
||||
return true;
|
||||
}
|
||||
|
||||
QPointF RasterTile::centroid(const QVector<Coordinates> &polygon) const
|
||||
{
|
||||
Q_ASSERT(polygon.size() > 3);
|
||||
Q_ASSERT(polygon.first() == polygon.last());
|
||||
|
||||
double area = 0;
|
||||
double cx = 0, cy = 0;
|
||||
QPointF pi;
|
||||
QPointF pj(ll2xy(polygon.at(0)));
|
||||
|
||||
for (int i = 0; i < polygon.size() - 1; i++) {
|
||||
pi = pj;
|
||||
pj = ll2xy(polygon.at(i + 1));
|
||||
|
||||
double f = pi.x() * pj.y() - pj.x() * pi.y();
|
||||
area += f;
|
||||
cx += (pi.x() + pj.x()) * f;
|
||||
cy += (pi.y() + pj.y()) * f;
|
||||
}
|
||||
|
||||
double factor = 1.0 / (3.0 * area);
|
||||
|
||||
return QPointF(cx * factor, cy * factor);
|
||||
}
|
||||
|
||||
QPainterPath RasterTile::painterPath(const Polygon &polygon) const
|
||||
{
|
||||
QPainterPath path;
|
||||
@ -136,27 +127,26 @@ QVector<QPolygonF> RasterTile::polylineM(const QVector<Coordinates> &path) const
|
||||
return polys;
|
||||
}
|
||||
|
||||
QPolygonF RasterTile::tsslptArrow(const Coordinates &c, qreal angle) const
|
||||
QPolygonF RasterTile::tsslptArrow(const QPointF &p, qreal angle) const
|
||||
{
|
||||
Coordinates t[3], r[4];
|
||||
QPointF t[3], r[4];
|
||||
QPolygonF polygon;
|
||||
|
||||
t[0] = c;
|
||||
t[1] = Coordinates(t[0].lon() - qCos(angle - M_PI/3) * TSSLPT_SIZE,
|
||||
t[0].lat() - qSin(angle - M_PI/3) * TSSLPT_SIZE);
|
||||
t[2] = Coordinates(t[0].lon() - qCos(angle - M_PI + M_PI/3) * TSSLPT_SIZE,
|
||||
t[0].lat() - qSin(angle - M_PI + M_PI/3) * TSSLPT_SIZE);
|
||||
t[0] = p;
|
||||
t[1] = QPointF(t[0].x() - qCos(angle - M_PI/3) * TSSLPT_SIZE,
|
||||
t[0].y() - qSin(angle - M_PI/3) * TSSLPT_SIZE);
|
||||
t[2] = QPointF(t[0].x() - qCos(angle - M_PI + M_PI/3) * TSSLPT_SIZE,
|
||||
t[0].y() - qSin(angle - M_PI + M_PI/3) * TSSLPT_SIZE);
|
||||
|
||||
LineC l(t[1], t[2]);
|
||||
QLineF l(t[1], t[2]);
|
||||
r[0] = l.pointAt(0.25);
|
||||
r[1] = l.pointAt(0.75);
|
||||
r[2] = Coordinates(r[0].lon() - C1 * TSSLPT_SIZE * qCos(angle - M_PI/2),
|
||||
r[0].lat() - C1 * TSSLPT_SIZE * qSin(angle - M_PI/2));
|
||||
r[3] = Coordinates(r[1].lon() - C1 * TSSLPT_SIZE * qCos(angle - M_PI/2),
|
||||
r[1].lat() - C1 * TSSLPT_SIZE * qSin(angle - M_PI/2));
|
||||
r[2] = QPointF(r[0].x() - C1 * TSSLPT_SIZE * qCos(angle - M_PI/2),
|
||||
r[0].y() - C1 * TSSLPT_SIZE * qSin(angle - M_PI/2));
|
||||
r[3] = QPointF(r[1].x() - C1 * TSSLPT_SIZE * qCos(angle - M_PI/2),
|
||||
r[1].y() - C1 * TSSLPT_SIZE * qSin(angle - M_PI/2));
|
||||
|
||||
polygon << ll2xy(t[0]) << ll2xy(t[2]) << ll2xy(r[1]) << ll2xy(r[3])
|
||||
<< ll2xy(r[2]) << ll2xy(r[0]) << ll2xy(t[1]);
|
||||
polygon << t[0] << t[2] << r[1] << r[3] << r[2] << r[0] << t[1];
|
||||
|
||||
return polygon;
|
||||
}
|
||||
@ -169,7 +159,7 @@ void RasterTile::drawArrows(QPainter *painter,
|
||||
|
||||
if (poly.type()>>16 == TSSLPT) {
|
||||
QPolygonF polygon(tsslptArrow(centroid(poly.path().first()),
|
||||
deg2rad(180 - poly.param().toDouble())));
|
||||
deg2rad(poly.param().toDouble())));
|
||||
|
||||
painter->setPen(QPen(tsslptPen, 1));
|
||||
painter->setBrush(QBrush(tsslptBrush));
|
||||
@ -241,19 +231,34 @@ void RasterTile::processPolygons(const QList<MapData::Poly> &polygons,
|
||||
for (int i = 0; i < polygons.size(); i++) {
|
||||
const MapData::Poly &poly = polygons.at(i);
|
||||
uint type = poly.type()>>16;
|
||||
const QImage *img = 0;
|
||||
const QString *label = 0;
|
||||
const QFont *fnt = 0;
|
||||
const QColor *color = 0, *hColor = 0;
|
||||
QPoint offset(0, 0);
|
||||
|
||||
if (!(type == HRBFAC || type == I_TRNBSN
|
||||
|| poly.type() == SUBTYPE(I_BERTHS, 6)))
|
||||
continue;
|
||||
const Style::Point &style = _style->point(poly.type());
|
||||
const QImage *img = style.img().isNull() ? 0 : &style.img();
|
||||
if (!img)
|
||||
if (!poly.label().isEmpty()) {
|
||||
const Style::Point &style = _style->point(poly.type());
|
||||
fnt = _style->font(style.textFontSize());
|
||||
color = &style.textColor();
|
||||
hColor = style.haloColor().isValid() ? &style.haloColor() : 0;
|
||||
label = &poly.label();
|
||||
}
|
||||
if (type == HRBFAC || type == I_TRNBSN
|
||||
|| poly.type() == SUBTYPE(I_BERTHS, 6)) {
|
||||
const Style::Point &style = _style->point(poly.type());
|
||||
img = style.img().isNull() ? 0 : &style.img();
|
||||
offset = style.offset();
|
||||
}
|
||||
|
||||
if ((!label || !fnt) && !img)
|
||||
continue;
|
||||
|
||||
TextPointItem *item = new TextPointItem(
|
||||
ll2xy(centroid(poly.path().first())).toPoint(),
|
||||
0, 0, img, 0, 0, 0, 0);
|
||||
if (item->isValid() && !item->collides(textItems))
|
||||
TextPointItem *item = new TextPointItem(offset +
|
||||
centroid(poly.path().first()).toPoint(), label, fnt, img, color,
|
||||
hColor, 0, 0);
|
||||
if (item->isValid() && _rect.contains(item->boundingRect().toRect())
|
||||
&& !item->collides(textItems))
|
||||
textItems.append(item);
|
||||
else
|
||||
delete item;
|
||||
@ -379,8 +384,8 @@ void RasterTile::render()
|
||||
|
||||
fetchData(polygons, lines, points);
|
||||
|
||||
processPolygons(polygons, textItems);
|
||||
processPoints(points, textItems, lights);
|
||||
processPolygons(polygons, textItems);
|
||||
processLines(lines, textItems);
|
||||
|
||||
QPainter painter(&img);
|
||||
|
@ -41,7 +41,8 @@ private:
|
||||
QPainterPath painterPath(const Polygon &polygon) const;
|
||||
QPolygonF polyline(const QVector<Coordinates> &path) const;
|
||||
QVector<QPolygonF> polylineM(const QVector<Coordinates> &path) const;
|
||||
QPolygonF tsslptArrow(const Coordinates &c, qreal angle) const;
|
||||
QPolygonF tsslptArrow(const QPointF &p, qreal angle) const;
|
||||
QPointF centroid(const QVector<Coordinates> &polygon) const;
|
||||
void processPoints(QList<MapData::Point> &points,
|
||||
QList<TextItem*> &textItems, QList<TextItem *> &lights);
|
||||
void processLines(const QList<MapData::Line> &lines,
|
||||
|
@ -235,6 +235,8 @@ void Style::pointStyle(qreal ratio)
|
||||
_points[SUBTYPE(LNDMRK, 7)] = Point(QImage(":/marine/pylon.png"), Small);
|
||||
_points[SUBTYPE(LNDMRK, 9)] = Point(QImage(":/marine/monument.png"), Small,
|
||||
QPoint(0, -7));
|
||||
_points[SUBTYPE(LNDMRK, 15)] = Point(QImage(":/marine/dome.png"), Small,
|
||||
QPoint(0, -5));
|
||||
_points[SUBTYPE(LNDMRK, 17)] = Point(QImage(":/marine/tower.png"), Small,
|
||||
QPoint(0, -11));
|
||||
_points[SUBTYPE(LNDMRK, 18)] = Point(QImage(":/marine/windmill.png"), Small);
|
||||
@ -332,6 +334,7 @@ void Style::pointStyle(qreal ratio)
|
||||
_points[TYPE(CURENT)] = Point(QImage(":/marine/current.png"));
|
||||
_points[SUBTYPE(WEDKLP, 0)] = Point(QImage(":/marine/kelp.png"));
|
||||
_points[SUBTYPE(WEDKLP, 1)] = Point(QImage(":/marine/kelp.png"));
|
||||
_points[TYPE(SEAARE)].setHaloColor(QColor());
|
||||
|
||||
_points[SUBTYPE(SMCFAC, 7)] = Point(svg2img(":/POI/restaurant-11.svg",
|
||||
ratio), Small);
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef DEMFILE_H
|
||||
#define DEMFILE_H
|
||||
#ifndef IMG_DEMFILE_H
|
||||
#define IMG_DEMFILE_H
|
||||
|
||||
#include "common/rtree.h"
|
||||
#include "subfile.h"
|
||||
@ -55,4 +55,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // DEMFILE_H
|
||||
#endif // IMG_DEMFILE_H
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef DEMTILE_H
|
||||
#define DEMTILE_H
|
||||
#ifndef IMG_DEMTILE_H
|
||||
#define IMG_DEMTILE_H
|
||||
|
||||
#include "common/rectc.h"
|
||||
|
||||
@ -33,4 +33,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // DEMTILE_H
|
||||
#endif // IMG_DEMTILE_H
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include <QFont>
|
||||
#include <QPainter>
|
||||
#include <QCache>
|
||||
#include "common/dem.h"
|
||||
#include "map/dem.h"
|
||||
#include "map/textpathitem.h"
|
||||
#include "map/textpointitem.h"
|
||||
#include "map/bitmapline.h"
|
||||
@ -70,33 +70,22 @@ static int minShieldZoom(Shield::Type type)
|
||||
}
|
||||
}
|
||||
|
||||
static qreal area(const QVector<QPointF> &polygon)
|
||||
{
|
||||
qreal area = 0;
|
||||
|
||||
for (int i = 0; i < polygon.size(); i++) {
|
||||
int j = (i + 1) % polygon.size();
|
||||
area += polygon.at(i).x() * polygon.at(j).y();
|
||||
area -= polygon.at(i).y() * polygon.at(j).x();
|
||||
}
|
||||
area /= 2.0;
|
||||
|
||||
return area;
|
||||
}
|
||||
|
||||
static QPointF centroid(const QVector<QPointF> &polygon)
|
||||
{
|
||||
qreal area = 0;
|
||||
qreal cx = 0, cy = 0;
|
||||
qreal factor = 1.0 / (6.0 * area(polygon));
|
||||
|
||||
for (int i = 0; i < polygon.size(); i++) {
|
||||
int j = (i + 1) % polygon.size();
|
||||
int j = (i == polygon.size() - 1) ? 0 : i + 1;
|
||||
qreal f = (polygon.at(i).x() * polygon.at(j).y() - polygon.at(j).x()
|
||||
* polygon.at(i).y());
|
||||
area += f;
|
||||
cx += (polygon.at(i).x() + polygon.at(j).x()) * f;
|
||||
cy += (polygon.at(i).y() + polygon.at(j).y()) * f;
|
||||
}
|
||||
|
||||
qreal factor = 1.0 / (3.0 * area);
|
||||
|
||||
return QPointF(cx * factor, cy * factor);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <QRegularExpression>
|
||||
#include <QLocale>
|
||||
#include <private/qzipreader_p.h>
|
||||
#include "rectc.h"
|
||||
#include "common/rectc.h"
|
||||
#include "dem.h"
|
||||
|
||||
|
@ -197,6 +197,7 @@ bool Downloader::doDownload(const Download &dl, const QList<HTTPHeader> &headers
|
||||
if (!file->open(QIODevice::WriteOnly)) {
|
||||
qWarning("%s: %s", qPrintable(file->fileName()),
|
||||
qPrintable(file->errorString()));
|
||||
delete file;
|
||||
_errorDownloads.insert(url, RETRIES);
|
||||
return false;
|
||||
}
|
@ -7,12 +7,16 @@ class GCS::Entry {
|
||||
public:
|
||||
Entry(int id, int gd, const QString &name, const GCS &gcs)
|
||||
: _id(id), _gd(gd), _name(name), _gcs(gcs) {}
|
||||
Entry(int id) : _id(id) {}
|
||||
|
||||
int id() const {return _id;}
|
||||
int gd() const {return _gd;}
|
||||
const QString &name() const {return _name;}
|
||||
const GCS &gcs() const {return _gcs;}
|
||||
|
||||
bool operator<(const Entry &other) const
|
||||
{return _id < other._id;}
|
||||
|
||||
private:
|
||||
int _id, _gd;
|
||||
QString _name;
|
||||
@ -59,11 +63,14 @@ QList<GCS::Entry> GCS::defaults()
|
||||
|
||||
GCS GCS::gcs(int id)
|
||||
{
|
||||
for (int i = 0; i < _gcss.size(); i++)
|
||||
if (_gcss.at(i).id() == id)
|
||||
return _gcss.at(i).gcs();
|
||||
// There are GCSs without EPSG code (id = 0) in the list!
|
||||
if (!id)
|
||||
return GCS();
|
||||
|
||||
return GCS();
|
||||
QList<GCS::Entry>::iterator it = std::lower_bound(
|
||||
_gcss.begin(), _gcss.end(), id);
|
||||
|
||||
return (it == _gcss.end() || id != it->id()) ? GCS() : it->gcs();
|
||||
}
|
||||
|
||||
GCS GCS::gcs(int geodeticDatum, int primeMeridian, int angularUnits)
|
||||
@ -220,6 +227,8 @@ bool GCS::loadList(const QString &path)
|
||||
qPrintable(path), csv.line() - 1);
|
||||
}
|
||||
|
||||
std::sort(_gcss.begin(), _gcss.end());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -229,7 +238,7 @@ QList<KV<int, QString> > GCS::list()
|
||||
|
||||
for (int i = 0; i < _gcss.size(); i++) {
|
||||
const Entry &e = _gcss.at(i);
|
||||
if (!e.id() || (i && e.id() == list.last().key()))
|
||||
if (!e.id() || (!list.isEmpty() && e.id() == list.last().key()))
|
||||
continue;
|
||||
|
||||
list.append(KV<int, QString>(e.id(), e.name() + " / Geographic 2D"));
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <cmath>
|
||||
#include <QLineF>
|
||||
#include "common/dem.h"
|
||||
#include "dem.h"
|
||||
#include "map.h"
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include <cmath>
|
||||
#include <QPainter>
|
||||
#include <QCache>
|
||||
#include "common/dem.h"
|
||||
#include "map/dem.h"
|
||||
#include "map/rectd.h"
|
||||
#include "map/hillshading.h"
|
||||
#include "map/filter.h"
|
||||
@ -15,33 +15,22 @@ using namespace Mapsforge;
|
||||
|
||||
static double LIMIT = cos(deg2rad(170));
|
||||
|
||||
static qreal area(const QPainterPath &polygon)
|
||||
{
|
||||
qreal area = 0;
|
||||
|
||||
for (int i = 0; i < polygon.elementCount(); i++) {
|
||||
int j = (i + 1) % polygon.elementCount();
|
||||
area += polygon.elementAt(i).x * polygon.elementAt(j).y;
|
||||
area -= polygon.elementAt(i).y * polygon.elementAt(j).x;
|
||||
}
|
||||
area /= 2.0;
|
||||
|
||||
return area;
|
||||
}
|
||||
|
||||
static QPointF centroid(const QPainterPath &polygon)
|
||||
{
|
||||
qreal area = 0;
|
||||
qreal cx = 0, cy = 0;
|
||||
qreal factor = 1.0 / (6.0 * area(polygon));
|
||||
|
||||
for (int i = 0; i < polygon.elementCount(); i++) {
|
||||
int j = (i + 1) % polygon.elementCount();
|
||||
int j = (i == polygon.elementCount() - 1) ? 0 : i + 1;
|
||||
qreal f = (polygon.elementAt(i).x * polygon.elementAt(j).y
|
||||
- polygon.elementAt(j).x * polygon.elementAt(i).y);
|
||||
area += f;
|
||||
cx += (polygon.elementAt(i).x + polygon.elementAt(j).x) * f;
|
||||
cy += (polygon.elementAt(i).y + polygon.elementAt(j).y) * f;
|
||||
}
|
||||
|
||||
qreal factor = 1.0 / (3.0 * area);
|
||||
|
||||
return QPointF(cx * factor, cy * factor);
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "common/range.h"
|
||||
#include "common/rectc.h"
|
||||
#include "common/kv.h"
|
||||
#include "common/downloader.h"
|
||||
#include "downloader.h"
|
||||
#include "coordinatesystem.h"
|
||||
|
||||
class Map;
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <QPixmapCache>
|
||||
#include "common/rectc.h"
|
||||
#include "common/programpaths.h"
|
||||
#include "common/downloader.h"
|
||||
#include "downloader.h"
|
||||
#include "osm.h"
|
||||
#include "onlinemap.h"
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include "common/downloader.h"
|
||||
#include "downloader.h"
|
||||
#include "rectd.h"
|
||||
|
||||
class TileLoader : public QObject
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "common/range.h"
|
||||
#include "common/rectc.h"
|
||||
#include "common/kv.h"
|
||||
#include "common/downloader.h"
|
||||
#include "downloader.h"
|
||||
#include "projection.h"
|
||||
#include "coordinatesystem.h"
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "common/hash.h"
|
||||
#include "common/rectc.h"
|
||||
#include "common/kv.h"
|
||||
#include "common/downloader.h"
|
||||
#include "downloader.h"
|
||||
#include "projection.h"
|
||||
#include "coordinatesystem.h"
|
||||
|
||||
|
Reference in New Issue
Block a user