1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-02 22:09:16 +02:00

Compare commits

...

138 Commits
13.31 ... 13.36

Author SHA1 Message Date
71a757983f Some more obsolete stuff cleanup 2025-02-20 08:57:50 +01:00
cc7209ad70 Removed obsolete stuff 2025-02-20 08:53:04 +01:00
ba49497608 Code cleanup 2025-02-20 08:50:17 +01:00
48404ea43b Limit the sector lights ranges 2025-02-20 07:34:47 +01:00
b9fb9eece3 Use 10NM as the major/minor light threshold 2025-02-19 23:00:39 +01:00
0cac0369aa Distinguish major/minor lights 2025-02-19 22:49:19 +01:00
cdf198ec1d Fixed clazy warning 2025-02-19 22:48:12 +01:00
0896b54831 Improved marine lights presentation 2025-02-19 19:26:14 +01:00
9f1808274f Use Qt 6.8.2 for the OS X builds 2025-02-19 00:49:40 +01:00
5d2465cffc Remove all Qt5 < 5.15 workarounds.
Qt 5.15 is now the minimal required Qt version.
2025-02-19 00:20:18 +01:00
2ab7bff3f8 Cosmetics 2025-02-18 23:11:13 +01:00
060cfb574d Build both release and debug configurations on Linux 2025-02-18 22:44:55 +01:00
5c178b4088 Fixed debug builds 2025-02-18 22:24:43 +01:00
2f4a7f8053 Improved IMG marine style 2025-02-18 22:09:59 +01:00
5f1838ea30 Code cleanup 2025-02-18 22:09:16 +01:00
bdf75169c5 Read the marine lights info from the local navaid data if present 2025-02-17 22:45:24 +01:00
9295f8f4a9 Merge branch 'origin/master' into Weblate. 2025-02-12 23:59:23 +01:00
3fc8e69ebb Removed unused metadata 2025-02-12 23:58:57 +01:00
4438bc8d52 Version++ 2025-02-12 23:46:36 +01:00
f9e99fcc73 Merge branch 'origin/master' into Weblate. 2025-02-12 20:01:32 +01:00
8041aa454c Fixed restricted areas labels colors 2025-02-12 20:01:06 +01:00
f494543e54 Merge branch 'origin/master' into Weblate. 2025-02-12 19:45:34 +01:00
1ee60b4f96 Do not show area labels when the area is not shown 2025-02-12 19:45:11 +01:00
70936cafe3 Merge branch 'origin/master' into Weblate. 2025-02-12 19:14:09 +01:00
ca17ec9e5f Fixed color artefacts 2025-02-12 19:13:32 +01:00
74781d6462 Merge branch 'origin/master' into Weblate. 2025-02-12 19:06:11 +01:00
d3781e7f0b Improved restricted areas rendering 2025-02-12 19:05:47 +01:00
466e8f2909 Merge branch 'origin/master' into Weblate. 2025-02-12 09:05:22 +01:00
c4e44c8796 Alwas show the area pictograms 2025-02-12 09:04:46 +01:00
1c9dd610d5 Merge branch 'origin/master' into Weblate. 2025-02-12 01:55:34 +01:00
59be4aaf1a Unify the lights display logic between ENC ad IMG 2025-02-12 01:55:02 +01:00
538ec4f71b Merge branch 'origin/master' into Weblate. 2025-02-11 08:13:28 +00:00
398ef2c4f5 Code cleanup 2025-02-11 09:13:09 +01:00
9bb56032b0 Merge branch 'origin/master' into Weblate. 2025-02-11 08:25:54 +01:00
5df43d3fb5 Removed forgotten debug stuff 2025-02-11 08:25:25 +01:00
c3e76e1d3d Merge branch 'origin/master' into Weblate. 2025-02-10 23:36:45 +01:00
ac41483530 Handle multi key attributes 2025-02-10 23:36:03 +01:00
766000458d Merge branch 'origin/master' into Weblate. 2025-02-10 19:26:27 +00:00
e0000d7299 Sector lights rendering polishing 2025-02-10 20:25:53 +01:00
9059e6d30d Use a standard color for the pipelines 2025-02-10 20:25:02 +01:00
0d029636be Merge branch 'origin/master' into Weblate. 2025-02-10 09:30:14 +01:00
819a67158a IMG marine lights 2025-02-10 09:29:46 +01:00
89b4bc56e4 Merge branch 'origin/master' into Weblate. 2025-02-09 23:01:10 +01:00
610dd0a009 Fixed function definitions 2025-02-09 23:00:45 +01:00
08d09d038e Merge branch 'origin/master' into Weblate. 2025-02-06 01:25:12 +01:00
41e8b7094a Outline sector lights 2025-02-06 01:24:48 +01:00
02c236a49e Merge branch 'origin/master' into Weblate. 2025-02-06 01:11:17 +01:00
0ee28d7f45 Colored lights + sector lights in ENC maps 2025-02-06 01:10:44 +01:00
98acd3f75a Marine icons polishing 2025-02-06 01:08:53 +01:00
f67c262292 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (488 of 488 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/zh_Hans/
2025-01-27 08:01:49 +01:00
7cfd62ca97 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.7% (487 of 488 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/zh_Hans/
2025-01-26 07:10:38 +01:00
a3459e34e0 Added geo URI support info 2025-01-25 16:19:00 +01:00
d43f58deb9 Added Android geo URI scheme desktop integration 2025-01-25 11:55:15 +01:00
73e7a1dbf4 Added geo URI support info to appdata.xml 2025-01-23 00:55:34 +01:00
319cdbf838 Added support for file scheme URIs 2025-01-23 00:54:23 +01:00
213ab73ceb Properly handle axis order in geo URIs 2025-01-21 21:45:49 +01:00
db2d81042b Use the common URL:$protocol naming scheme 2025-01-21 06:20:37 +01:00
e27bc437fa geo URI Windows desktop integration 2025-01-21 05:34:26 +01:00
3dd21ade19 geo URI MacOS desktop integration 2025-01-20 23:45:36 +01:00
46ea3dd257 geo URI linux desktop integration 2025-01-20 23:45:11 +01:00
0ed630dd20 Added support for geo URIs (RFC 5870) 2025-01-20 23:27:44 +01:00
9cd82319e9 Cosmetics 2025-01-20 23:26:58 +01:00
335df85fae Code cleanup 2025-01-17 07:38:31 +01:00
f1b52c7005 Version++ 2025-01-17 07:37:49 +01:00
b3fd46a225 Only do the units conversion on specific point types 2025-01-04 17:40:15 +01:00
c678866c22 Do the special number transformation only when the label ends with a number 2025-01-04 16:43:20 +01:00
e2764b6232 Use a smaller block size for filesystem reads 2025-01-04 12:00:57 +01:00
ad13a5b0cf qPrintable() -> qUtf8Printable() 2025-01-04 00:18:27 +01:00
2b967ce05e Use Qt 6.8.1 for the OS X builds 2025-01-03 19:46:19 +01:00
5ff99b13a2 Copyright year++ 2025-01-03 19:21:51 +01:00
7a161fa364 Improved error handling 2025-01-03 19:17:30 +01:00
7ee681313f Fixed YAML/CMD syntax 2025-01-03 10:02:01 +01:00
871cb8433c Fixed syntax 2025-01-03 09:39:45 +01:00
2a925b0c84 Do not include the unused OpenSSL libs on Qt6 2025-01-03 09:19:33 +01:00
1219801910 Try msvc2022_64 path 2025-01-03 07:18:56 +01:00
25fb9e5f9b Revert "AppVeyor Qt6 build fix"
This reverts commit 699e086618.
2025-01-03 00:43:11 +01:00
701f392a29 Improved error reporting 2025-01-02 18:55:15 +01:00
699e086618 AppVeyor Qt6 build fix 2025-01-02 08:08:33 +01:00
eeee16ff9b Special anchorage areas 2024-12-20 16:14:36 +01:00
001fa34cdd Copy only explicitly defined polygon center points 2024-12-20 14:41:23 +01:00
a97dc3b6c2 Do not duplicate PYLONS points/areas 2024-12-20 09:53:58 +01:00
f2ae75d7f5 Do not duplicate BUISGL areas with points 2024-12-19 15:01:45 +01:00
816681f267 Pillar LNDMRKs 2024-12-19 11:35:43 +01:00
d738555a68 Extended ACHARE areas 2024-12-19 11:18:53 +01:00
4e466d16a1 Merged ENC point and areas labels 2024-12-19 09:50:39 +01:00
b7bb3b649a BUAARE area labels 2024-12-18 18:48:50 +01:00
e0e9fa660a BERTHS polygons + NAVLNE restyling 2024-12-18 17:45:25 +01:00
67b91f62a0 Radar reflectors (RADRFL) 2024-12-18 13:58:49 +01:00
0ab6e02e6c RCTLPT areas and TSSLPT/RCTLPT points 2024-12-18 12:41:05 +01:00
7f20e2e307 Cosmetics 2024-12-17 11:28:23 +01:00
68f1f1fc3f Code cleanup 2024-12-17 10:55:01 +01:00
a4449897a7 Version++ 2024-12-16 15:03:02 +01:00
80a8ac260d const correctness 2024-12-10 19:13:00 +01:00
6673281e1c Removed obsolete comment 2024-12-10 09:23:25 +01:00
30157f8e4a Use Qt 6.8 in the Windows CI builds 2024-12-10 07:55:49 +01:00
12e3bbc988 Never use (semi)transparent areas 2024-12-05 18:13:37 +01:00
9d5ac81f2f Slipways 2024-12-04 00:24:17 +01:00
c0f97ddbd4 Distinguish parking types 2024-12-04 00:12:49 +01:00
d7d193871a Fixed broken placeholder 2024-12-03 23:35:21 +01:00
4b9bb04cec Translated using Weblate (Finnish)
Currently translated at 96.9% (473 of 488 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/fi/
2024-12-03 23:25:37 +01:00
d3889b6dfe Use the same locking algorithm like in IMG/Mapsforge maps 2024-12-03 20:25:38 +01:00
240ddaf39c Use the same locking algorithm like in IMG/Mapsforge maps 2024-12-03 20:20:40 +01:00
53685253d7 Quarry names 2024-12-03 09:21:52 +01:00
38486e594b Fountains + minor fixes 2024-12-03 07:14:28 +01:00
47dd212f47 Wayside crosses 2024-12-03 06:46:35 +01:00
a11ba0487c Improved tile loading parallelism 2024-12-01 12:34:26 +01:00
c014526bd9 Improved tile loading parallelism 2024-12-01 10:25:10 +01:00
f620bbc383 Reduce the number of file opens for IMG files 2024-11-30 00:13:35 +01:00
9ac10e2909 Cricket 2024-11-29 08:51:00 +01:00
5f623975f9 Volleyball 2024-11-29 08:42:18 +01:00
bd266ea73c Some more sports 2024-11-29 08:34:38 +01:00
6774e29d3f SVG code cleanup 2024-11-28 18:47:57 +01:00
a02f157bd8 Emergency stuff 2024-11-28 09:33:16 +01:00
4bad7c9b46 Power plants 2024-11-28 05:37:52 +01:00
93402dd4cd Neighbourhoods 2024-11-28 04:59:25 +01:00
f6dcf43c1a Track lines 2024-11-27 23:08:16 +01:00
7452650999 Missing railway areas 2024-11-27 07:37:13 +01:00
863f6ac58f Improved tracks rendering 2024-11-26 19:58:22 +01:00
a57b50e07c Distinguish peaks 2024-11-26 07:42:00 +01:00
450b8aad59 Version++ 2024-11-26 07:40:45 +01:00
2fcee5aae0 Translated using Weblate (Danish)
Currently translated at 100.0% (488 of 488 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/da/
2024-11-24 14:33:57 +01:00
2fefd3ec55 Water bodies labels adjustments 2024-11-24 12:52:02 +01:00
8a3808248a Code cleanup 2024-11-24 09:09:45 +01:00
7d2bbfe12a Added missing rails 2024-11-24 02:54:19 +01:00
929035eee9 Fixed city labels fetching 2024-11-23 23:09:00 +01:00
cccda7395e Allow more labels for same symbol-id 2024-11-23 18:31:56 +01:00
93775a5adf Do not show the glaciers later than the other terain 2024-11-23 15:22:16 +01:00
f5b0c3f041 Quarters 2024-11-23 10:37:20 +01:00
c1eca4eacf Show the suburbs on lower zooms 2024-11-23 09:43:53 +01:00
6b0a08ae91 Bunkers 2024-11-23 07:15:17 +01:00
81751a2564 SVG code cleanup 2024-11-23 07:14:13 +01:00
4281e809be Redesigned City/town/village label sizes + suburbs 2024-11-22 22:37:07 +01:00
67820d7c4d Do not try to draw labels outside the tile rect 2024-11-22 21:52:32 +01:00
2a16a1f34c Fixed typo 2024-11-22 21:52:22 +01:00
a086c13648 Increase the vector tile caches size 2024-11-22 21:18:34 +01:00
85fd574b38 Do not try to draw labels outside the tile rect 2024-11-22 20:45:43 +01:00
62ae50ecda Always show the rails when the railway stations are shown 2024-11-22 19:11:27 +01:00
b969eef432 Version++ 2024-11-22 19:10:54 +01:00
147 changed files with 2321 additions and 1190 deletions

View File

@ -1,4 +1,4 @@
version: 13.31.{build}
version: 13.36.{build}
configuration:
- Release
@ -12,9 +12,8 @@ environment:
- QTDIR: C:\Qt\5.15\msvc2019_64
OPENSSLDIR: C:\OpenSSL-v111-Win64\bin
NSISDEF: /DOPENSSL /DANGLE
- QTDIR: C:\Qt\6.7\msvc2019_64
OPENSSLDIR: C:\OpenSSL-v33-Win64\bin
NSISDEF: /DQT6 /DOPENSSL
- QTDIR: C:\Qt\6.8\msvc2022_64
NSISDEF: /DQT6
install:
- cmd: |-
@ -36,8 +35,8 @@ build_script:
xcopy lang\*.qm installer\translations\ /sy
xcopy icons\symbols installer\symbols /i
copy licence.txt installer
copy %OPENSSLDIR%\libcrypto-*-x64.dll installer
copy %OPENSSLDIR%\libssl-*-x64.dll installer
IF DEFINED OPENSSLDIR (copy %OPENSSLDIR%\libcrypto-*-x64.dll installer)
IF DEFINED OPENSSLDIR (copy %OPENSSLDIR%\libssl-*-x64.dll installer)
makensis.exe %NSISDEF% installer\gpxsee64.nsi

View File

@ -8,7 +8,10 @@ on:
jobs:
build:
name: GPXSee
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
config: ['release', 'debug']
steps:
- name: Checkout
uses: actions/checkout@v4
@ -19,6 +22,6 @@ jobs:
- name: Create localization
run: lrelease gpxsee.pro
- name: Configure build
run: qmake gpxsee.pro
run: qmake CONFIG+=${{ matrix.config }} gpxsee.pro
- name: Build project
run: make -j2

View File

@ -15,7 +15,7 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.8.0'
version: '6.8.2'
modules: qtpositioning qtserialport qtimageformats
- name: Create localization
run: lrelease gpxsee.pro

View File

@ -6,6 +6,7 @@ GPS log file formats.
* Opens GPX, TCX, FIT, KML, NMEA, IGC, CUP, SIGMA SLF, Suunto SML, LOC, GeoJSON,
OziExplorer (PLT, RTE, WPT), Garmin GPI&CSV, TomTom OV2&ITN, ONmove OMD/GHP,
TwoNav (TRK, RTE, WPT), GPSDump WPT and geotagged JPEG files.
* Opens geo URIs (RFC 5870).
* User-definable online maps (OpenStreetMap/Google tiles, WMTS, WMS, TMS,
QuadTiles).
* Offline maps (MBTiles, OziExplorer maps, TrekBuddy maps/atlases,
@ -28,8 +29,8 @@ GPS log file formats.
## Build
Build requirements:
* Qt5 >= 5.11 or Qt6 >= 6.2 (Android builds require Qt6)
* C++11 or newer compiler (tested: msvc2019, gcc 7.5.0, clang/Apple LLVM version
* Qt5 >= 5.15 or Qt6 >= 6.2 (Android builds require Qt6)
* C++11 or newer compiler (tested: msvc2022, gcc 11, clang/Apple LLVM version
10.0.0)
Build steps:

View File

@ -21,9 +21,9 @@
</rule>
<rule e="way" closed="yes" k="natural" v="rock|stone|bare_rock|bedrock" zoom-min="14">
<area fill="#60000000"/>
<area fill="#96968f"/>
</rule>
<rule e="way" closed="yes" k="natural" v="glacier" zoom-min="12">
<rule e="way" closed="yes" k="natural" v="glacier" zoom-min="10">
<area fill="#ddf1fd"/>
</rule>
@ -32,7 +32,7 @@
<area fill="#e4efcf"/>
</rule>
<rule e="way" closed="yes" k="landuse" v="construction|quarry|landfill|industrial|farm|farmyard" zoom-min="10">
<rule e="way" closed="yes" k="landuse" v="construction|quarry|landfill|industrial|farm|farmyard|railway" zoom-min="10">
<area fill="#d6d4ce"/>
</rule>
<rule e="way" closed="yes" k="landuse" v="allotments" zoom-min="10">
@ -82,7 +82,13 @@
<!-- Water -->
<rule e="way" closed="yes" k="natural" v="water">
<area fill="#9fc4e1"/>
<rule e="way" k="*" v="*" zoom-min="14">
<rule e="way" k="bBoxWeight" v="~|mid|large|xlarge|xxlarge|xxxlarge" zoom-min="14" zoom-max="15">
<caption fill="#ffffff" font-size="12" font-family="serif" font-style="italic" k="name" stroke="#9fc4e1" stroke-width="2"/>
</rule>
<rule e="way" k="bBoxWeight" v="~|xsmall|small|mid|large|xlarge|xxlarge|xxxlarge" zoom-min="16" zoom-max="16">
<caption fill="#ffffff" font-size="12" font-family="serif" font-style="italic" k="name" stroke="#9fc4e1" stroke-width="2"/>
</rule>
<rule e="way" k="*" v="*" zoom-min="17">
<caption fill="#ffffff" font-size="12" font-family="serif" font-style="italic" k="name" stroke="#9fc4e1" stroke-width="2"/>
</rule>
</rule>
@ -167,21 +173,28 @@
</rule>
<rule e="way" closed="yes" k="amenity" v="parking" zoom-min="10">
<area fill="#ffffff" stroke="#d5cdc0" stroke-width="0.1"/>
<rule e="way" k="*" v="*" zoom-min="17">
<rule e="way" k="parking" v="~|surface|street_side|lane" zoom-min="17">
<symbol id="parking" src=":/POI/parking-11.svg" symbol-width="11"/>
</rule>
<rule e="way" k="parking" v="underground|multi-storey" zoom-min="17">
<symbol id="garage" src=":/POI/parking-garage-11.svg" symbol-width="11"/>
</rule>
</rule>
<rule e="way" closed="yes" k="highway" v="pedestrian" zoom-min="10">
<area fill="#ffffff"/>
</rule>
<rule e="way" closed="yes" k="leisure" v="pitch|playground|track" zoom-min="10">
<rule e="way" closed="yes" k="leisure" v="pitch|playground|track|ls_track" zoom-min="10">
<area fill="#e3edc6" stroke="#c9d3a5" stroke-width="1" scale="none"/>
</rule>
<rule e="way" closed="yes" k="leisure" v="swimming_pool" zoom-min="10">
<rule e="way" closed="no" k="leisure" v="track|ls_track" zoom-min="10">
<line stroke="#c9d3a5" stroke-width="0.3"/>
<line stroke="#e3edc6" stroke-width="0.2"/>
</rule>
<rule e="way" closed="yes" k="leisure" v="swimming_pool" zoom-min="12">
<area fill="#9fc4e1" stroke="#4398d9" stroke-width="1" scale="none"/>
</rule>
<rule e="way" k="leisure" v="track" zoom-min="10">
<line stroke="#e3edc6" stroke-width="1"/>
<rule e="way" closed="yes" k="amenity" v="fountain" zoom-min="12">
<area fill="#9fc4e1"/>
</rule>
<!-- Area overlays -->
@ -449,7 +462,7 @@
<!-- Railways -->
<rule e="way" k="tunnel" v="~|false|no">
<rule e="way" k="railway" v="rail">
<rule e="way" k="railway" v="rail|preserved|disused">
<rule e="way" k="*" v="*" zoom-min="10" zoom-max="12">
<line stroke="#717171" stroke-width="1" stroke-linecap="butt"/>
</rule>
@ -466,7 +479,7 @@
<line stroke="#ffffff" stroke-width="0.4608" stroke-dasharray="2,2" stroke-linecap="butt" scale="all"/>
</rule>
</rule>
<rule e="way" k="railway" v="narrow_gauge|light_rail|funicular" zoom-min="15">
<rule e="way" k="railway" v="narrow_gauge|light_rail|funicular" zoom-min="14">
<line stroke="#414141" stroke-width="0.2" stroke-linecap="butt"/>
</rule>
<rule e="way" k="railway" v="tram" zoom-min="15">
@ -474,7 +487,7 @@
</rule>
</rule>
<rule e="way" k="tunnel" v="yes|true">
<rule e="way" k="railway" v="rail">
<rule e="way" k="railway" v="rail|preserved|disused">
<rule e="way" k="*" v="*" zoom-min="10" zoom-max="12">
<line stroke="#717171" stroke-width="1" stroke-linecap="butt" stroke-dasharray="10,8"/>
</rule>
@ -488,7 +501,7 @@
<line stroke="#878787" stroke-width="0.4144" stroke-linecap="butt" stroke-dasharray="2,1" scale="all"/>
</rule>
</rule>
<rule e="way" k="railway" v="narrow_gauge|light_rail|funicular" zoom-min="15">
<rule e="way" k="railway" v="narrow_gauge|light_rail|funicular" zoom-min="14">
<line stroke="#414141" stroke-width="0.2" stroke-linecap="butt" stroke-dasharray="12,4"/>
</rule>
<rule e="way" k="railway" v="tram" zoom-min="15">
@ -533,45 +546,91 @@
</rule>
</rule>
<!-- Town & vilage names -->
<!-- Town & village names -->
<rule e="node" k="place" v="locality|isolated_dwelling|farm" zoom-min="14">
<caption fill="#000000" font-size="10" k="name" priority="10" stroke="#FFFFFF" stroke-width="2"/>
</rule>
<rule e="node" k="place" v="hamlet" zoom-min="12">
<caption fill="#000000" font-size="12" k="name" priority="20" stroke="#FFFFFF" stroke-width="2"/>
<caption fill="#000000" font-size="14" k="name" priority="20" stroke="#FFFFFF" stroke-width="2"/>
</rule>
<rule e="node" k="place" v="village" zoom-min="11">
<caption fill="#000000" font-size="12" k="name" priority="20" stroke="#FFFFFF" stroke-width="2"/>
<caption fill="#000000" font-size="14" k="name" priority="20" stroke="#FFFFFF" stroke-width="2"/>
</rule>
<rule e="node" k="place" v="town" zoom-min="9">
<caption fill="#000000" font-size="14" k="name" priority="30" stroke="#FFFFFF" stroke-width="2"/>
<rule e="node" k="place" v="town" zoom-min="9" zoom-max="14">
<rule e="node" k="*" v="*" zoom-max="10">
<caption fill="#000000" font-size="14" k="name" priority="30" stroke="#FFFFFF" stroke-width="2"/>
</rule>
<rule e="node" k="*" v="*" zoom-min="11">
<caption fill="#000000" font-size="16" k="name" font-style="bold" priority="30" stroke="#FFFFFF" stroke-width="2"/>
</rule>
</rule>
<rule e="node" k="place" v="city">
<rule e="node" k="capital" v="yes|1|2">
<caption fill="#000000" font-size="16" font-style="bold" k="name" priority="40" stroke="#FFFFFF" stroke-width="2" text-transform="uppercase"/>
<rule e="node" k="*" v="*" zoom-max="10">
<rule e="node" k="capital" v="2">
<caption fill="#000000" font-size="18" font-style="bold" k="name" priority="40" stroke="#FFFFFF" stroke-width="2" text-transform="uppercase"/>
</rule>
<rule e="node" k="capital" v="4|~">
<caption fill="#000000" font-size="18" font-style="bold" k="name" priority="35" stroke="#FFFFFF" stroke-width="2"/>
</rule>
</rule>
<rule e="node" k="capital" v="no|~">
<caption fill="#000000" font-size="16" font-style="bold" k="name" priority="35" stroke="#FFFFFF" stroke-width="2"/>
<rule e="node" k="*" v="*" zoom-min="11" zoom-max="14">
<rule e="node" k="capital" v="2">
<caption fill="#000000" font-size="22" font-style="bold" k="name" priority="40" stroke="#FFFFFF" stroke-width="2" text-transform="uppercase"/>
</rule>
<rule e="node" k="capital" v="4|~">
<caption fill="#000000" font-size="22" font-style="bold" k="name" priority="35" stroke="#FFFFFF" stroke-width="2"/>
</rule>
</rule>
</rule>
<rule e="node" k="place" v="suburb">
<rule e="node" k="*" v="*" zoom-min="12" zoom-max="13">
<caption fill="#000000" font-size="14" k="name" priority="25" stroke="#FFFFFF" stroke-width="2"/>
</rule>
<rule e="node" k="*" v="*" zoom-min="14" zoom-max="17">
<caption fill="#000000" font-size="16" k="name" priority="25" stroke="#FFFFFF" stroke-width="2"/>
</rule>
</rule>
<rule e="node" k="place" v="quarter" zoom-min="14" zoom-max="17">
<caption fill="#000000" font-size="14" k="name" priority="20" stroke="#FFFFFF" stroke-width="2"/>
</rule>
<rule e="node" k="place" v="neighbourhood" zoom-min="15" zoom-max="17">
<caption fill="#000000" font-size="12" k="name" priority="15" stroke="#FFFFFF" stroke-width="2"/>
</rule>
<!-- Nature POIs -->
<rule e="node" k="natural" v="peak" zoom-min="13">
<rule e="node" k="name" v="*">
<symbol id="peak" src=":/POI/mountain-11.svg" symbol-width="11" priority="10"/>
<caption fill="#000000" font-size="10" font-family="serif" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="peak"/>
<rule e="node" k="ele" v="*">
<rule e="node" k="name" v="*">
<symbol id="peak" src=":/POI/triangle-11.svg" symbol-width="11" priority="10"/>
<caption fill="#000000" font-size="10" font-family="serif" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="peak"/>
<rule e="node" k="*" v="*" zoom-min="14">
<caption fill="#000000" font-size="10" font-family="serif" font-style="italic" k="ele" stroke="#FFFFFF" stroke-width="2" symbol-id="peak" priority="-1"/>
</rule>
</rule>
</rule>
<rule e="node" k="ele" v="~" zoom-min="15">
<rule e="node" k="name" v="*">
<symbol id="peak-minor" src=":/POI/triangle-stroked-11.svg" symbol-width="11" priority="5"/>
<caption fill="#000000" font-size="10" font-family="serif" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="peak-minor"/>
</rule>
</rule>
</rule>
<rule e="node" k="natural" v="saddle" zoom-min="13">
<rule e="node" k="name" v="*">
<symbol id="saddle" src=":/symbols/saddle.svg" symbol-width="9" symbol-height="11" priority="9"/>
<caption fill="#000000" font-size="10" font-family="serif" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="saddle"/>
<rule e="node" k="*" v="*" zoom-min="14">
<caption fill="#000000" font-size="10" font-family="serif" font-style="italic" k="ele" stroke="#FFFFFF" stroke-width="2" symbol-id="saddle" priority="-1"/>
</rule>
</rule>
</rule>
<rule e="node" k="natural" v="volcano" zoom-min="13">
<rule e="node" k="name" v="*">
<symbol id="volcano" src=":/POI/volcano-11.svg" symbol-width="11" priority="10"/>
<caption fill="#000000" font-size="10" font-family="serif" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="volcano"/>
<rule e="node" k="*" v="*" zoom-min="14">
<caption fill="#000000" font-size="10" font-family="serif" font-style="italic" k="ele" stroke="#FFFFFF" stroke-width="2" symbol-id="volcano" priority="-1"/>
</rule>
</rule>
</rule>
<rule e="node" k="waterway" v="waterfall" zoom-min="15">
@ -788,7 +847,7 @@
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="post"/>
</rule>
</rule>
<rule e="any" k="historic" v="memorial" zoom-min="17">
<rule e="any" k="historic" v="memorial|monument" zoom-min="17">
<symbol id="memorial" src=":/POI/monument-11.svg" symbol-width="11"/>
<rule e="any" k="*" v="*" zoom-min="18">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="memorial"/>
@ -821,7 +880,7 @@
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="townhall"/>
</rule>
</rule>
<rule e="any" k="amenity" v="university" zoom-min="16">
<rule e="any" k="amenity" v="university|college" zoom-min="16">
<symbol id="university" src=":/POI/college-11.svg" symbol-width="11"/>
<rule e="any" k="*" v="*" zoom-min="17">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="university"/>
@ -896,6 +955,36 @@
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="skateboard"/>
</rule>
</rule>
<rule e="any" k="sport" v="baseball" zoom-min="17">
<symbol id="baseball" src=":/POI/baseball-11.svg" symbol-width="11"/>
<rule e="any" k="*" v="*" zoom-min="18">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="baseball"/>
</rule>
</rule>
<rule e="any" k="sport" v="basketball" zoom-min="17">
<symbol id="basketball" src=":/POI/basketball-11.svg" symbol-width="11"/>
<rule e="any" k="*" v="*" zoom-min="18">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="basketball"/>
</rule>
</rule>
<rule e="any" k="sport" v="volleyball" zoom-min="17">
<symbol id="volleyball" src=":/POI/volleyball-11.svg" symbol-width="11"/>
<rule e="any" k="*" v="*" zoom-min="18">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="volleyball"/>
</rule>
</rule>
<rule e="any" k="sport" v="equestrian" zoom-min="17">
<symbol id="equestrian" src=":/POI/horse-riding-11.svg" symbol-width="11"/>
<rule e="any" k="*" v="*" zoom-min="18">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="equestrian"/>
</rule>
</rule>
<rule e="any" k="sport" v="cricket" zoom-min="17">
<symbol id="cricket" src=":/POI/cricket-11.svg" symbol-width="11"/>
<rule e="any" k="*" v="*" zoom-min="18">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="cricket"/>
</rule>
</rule>
<rule e="any" k="amenity" v="restaurant" zoom-min="17">
<symbol id="restaurant" src=":/POI/restaurant-11.svg" symbol-width="11" priority="-5"/>
@ -1005,4 +1094,37 @@
</rule>
</rule>
<rule e="any" k="military" v="bunker|bunker_disused" zoom-min="17">
<symbol id="bunker" src=":/symbols/bunker.svg" symbol-width="11" symbol-height="9"/>
<rule e="any" k="*" v="*" zoom-min="18">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="bunker"/>
</rule>
</rule>
<rule e="any" k="historic" v="wayside_cross|wayside_shrine" zoom-min="17">
<symbol id="wayside-cross" src=":/symbols/cross.svg" symbol-width="6" symbol-height="8"/>
<rule e="any" k="*" v="*" zoom-min="18">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="wayside-cross"/>
</rule>
</rule>
<rule e="any" k="leisure" v="slipway" zoom-min="16">
<symbol id="slipway" src=":/POI/slipway-11.svg" symbol-width="11"/>
<rule e="any" k="*" v="*" zoom-min="17">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="slipway"/>
</rule>
</rule>
<rule e="any" k="power" v="plant" zoom-min="15">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" priority="1"/>
</rule>
<rule e="any" k="landuse" v="quarry" zoom-min="14">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2"/>
</rule>
<rule e="any" k="emergency" v="phone" zoom-min="16">
<symbol id="phone" src=":/POI/telephone-11.svg" symbol-width="11"/>
</rule>
<rule e="any" k="emergency" v="defibrillator" zoom-min="16">
<symbol id="defibrillator" src=":/POI/defibrillator-11.svg" symbol-width="11"/>
</rule>
</rendertheme>

View File

@ -3,8 +3,7 @@ unix:!macx:!android {
} else {
TARGET = GPXSee
}
VERSION = 13.31
VERSION = 13.36
QT += core \
gui \
@ -118,6 +117,7 @@ HEADERS += src/common/config.h \
src/data/gpsdumpparser.h \
src/data/style.h \
src/data/twonavparser.h \
src/map/IMG/light.h \
src/map/downloader.h \
src/map/demloader.h \
src/map/ENC/attributes.h \
@ -523,7 +523,7 @@ win32 {
RESOURCES += theme-color.qrc
QMAKE_TARGET_DESCRIPTION = GPXSee
QMAKE_TARGET_COPYRIGHT = Copyright (c) 2015-2024 Martin Tuma
QMAKE_TARGET_COPYRIGHT = Copyright (c) 2015-2025 Martin Tuma
RC_ICONS = icons/app/gpxsee.ico \
icons/formats/gpx.ico \
icons/formats/tcx.ico \

View File

@ -6,7 +6,9 @@
<!-- Common map stuff -->
<qresource prefix="/symbols">
<file alias="bunker.svg">icons/map/symbols/bunker.svg</file>
<file alias="cliff.svg">icons/map/symbols/cliff.svg</file>
<file alias="cross.svg">icons/map/symbols/cross.svg</file>
<file alias="exit.svg">icons/map/symbols/exit.svg</file>
<file alias="flow.svg">icons/map/symbols/flow.svg</file>
<file alias="oneway.svg">icons/map/symbols/oneway.svg</file>
@ -23,6 +25,8 @@
<file alias="bank-11.svg">icons/map/POI/bank-11.svg</file>
<file alias="bar-11.svg">icons/map/POI/bar-11.svg</file>
<file alias="barrier-11.svg">icons/map/POI/barrier-11.svg</file>
<file alias="baseball-11.svg">icons/map/POI/baseball-11.svg</file>
<file alias="basketball-11.svg">icons/map/POI/basketball-11.svg</file>
<file alias="bbq-11.svg">icons/map/POI/bbq-11.svg</file>
<file alias="beach-11.svg">icons/map/POI/beach-11.svg</file>
<file alias="beer-11.svg">icons/map/POI/beer-11.svg</file>
@ -44,9 +48,11 @@
<file alias="college-11.svg">icons/map/POI/college-11.svg</file>
<file alias="communications-tower-11.svg">icons/map/POI/communications-tower-11.svg</file>
<file alias="convenience-11.svg">icons/map/POI/convenience-11.svg</file>
<file alias="cricket-11.svg">icons/map/POI/cricket-11.svg</file>
<file alias="cross-11.svg">icons/map/POI/cross-11.svg</file>
<file alias="dam-11.svg">icons/map/POI/dam-11.svg</file>
<file alias="danger-11.svg">icons/map/POI/danger-11.svg</file>
<file alias="defibrillator-11.svg">icons/map/POI/defibrillator-11.svg</file>
<file alias="doctor-11.svg">icons/map/POI/doctor-11.svg</file>
<file alias="drinking-water-11.svg">icons/map/POI/drinking-water-11.svg</file>
<file alias="fast-food-11.svg">icons/map/POI/fast-food-11.svg</file>
@ -66,6 +72,7 @@
<file alias="hardware-11.svg">icons/map/POI/hardware-11.svg</file>
<file alias="heliport-11.svg">icons/map/POI/heliport-11.svg</file>
<file alias="home-11.svg">icons/map/POI/home-11.svg</file>
<file alias="horse-riding-11.svg">icons/map/POI/horse-riding-11.svg</file>
<file alias="hospital-11.svg">icons/map/POI/hospital-11.svg</file>
<file alias="hot-spring.svg">icons/map/POI/hot-spring.svg</file>
<file alias="ice-cream-11.svg">icons/map/POI/ice-cream-11.svg</file>
@ -81,6 +88,7 @@
<file alias="observation-tower.svg">icons/map/POI/observation-tower.svg</file>
<file alias="park-11.svg">icons/map/POI/park-11.svg</file>
<file alias="parking-11.svg">icons/map/POI/parking-11.svg</file>
<file alias="parking-garage-11.svg">icons/map/POI/parking-garage-11.svg</file>
<file alias="pharmacy-11.svg">icons/map/POI/pharmacy-11.svg</file>
<file alias="picnic-site-11.svg">icons/map/POI/picnic-site-11.svg</file>
<file alias="place-of-worship-11.svg">icons/map/POI/place-of-worship-11.svg</file>
@ -103,6 +111,7 @@
<file alias="skateboard-11.svg">icons/map/POI/skateboard-11.svg</file>
<file alias="skiing-11.svg">icons/map/POI/skiing-11.svg</file>
<file alias="slaughterhouse-11.svg">icons/map/POI/slaughterhouse-11.svg</file>
<file alias="slipway-11.svg">icons/map/POI/slipway-11.svg</file>
<file alias="soccer-11.svg">icons/map/POI/soccer-11.svg</file>
<file alias="stadium-11.svg">icons/map/POI/stadium-11.svg</file>
<file alias="swimming-11.svg">icons/map/POI/swimming-11.svg</file>
@ -111,9 +120,12 @@
<file alias="theatre-11.svg">icons/map/POI/theatre-11.svg</file>
<file alias="toilet-11.svg">icons/map/POI/toilet-11.svg</file>
<file alias="town-hall-11.svg">icons/map/POI/town-hall-11.svg</file>
<file alias="triangle-11.svg">icons/map/POI/triangle-11.svg</file>
<file alias="triangle-stroked-11.svg">icons/map/POI/triangle-stroked-11.svg</file>
<file alias="viewpoint-11.svg">icons/map/POI/viewpoint-11.svg</file>
<file alias="village-11.svg">icons/map/POI/village-11.svg</file>
<file alias="volcano-11.svg">icons/map/POI/volcano-11.svg</file>
<file alias="volleyball-11.svg">icons/map/POI/volleyball-11.svg</file>
<file alias="water-11.svg">icons/map/POI/water-11.svg</file>
<file alias="waterfall-11.svg">icons/map/POI/waterfall-11.svg</file>
<file alias="watermill-11.svg">icons/map/POI/watermill-11.svg</file>
@ -181,6 +193,10 @@
<file alias="overfalls.png">icons/map/marine/overfalls.png</file>
<file alias="boarding-place.png">icons/map/marine/boarding-place.png</file>
<file alias="light.png">icons/map/marine/light.png</file>
<file alias="light-red.png">icons/map/marine/light-red.png</file>
<file alias="light-green.png">icons/map/marine/light-green.png</file>
<file alias="light-yellow.png">icons/map/marine/light-yellow.png</file>
<file alias="light-white.png">icons/map/marine/light-white.png</file>
<file alias="building.png">icons/map/marine/building.png</file>
<file alias="fog-signal.png">icons/map/marine/fog-signal.png</file>
<file alias="construction.png">icons/map/marine/construction.png</file>
@ -194,6 +210,12 @@
<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>
<file alias="radar-reflector.png">icons/map/marine/radar-reflector.png</file>
<file alias="24h-anchorage.png">icons/map/marine/24h-anchorage.png</file>
<file alias="dw-anchorage.png">icons/map/marine/dw-anchorage.png</file>
<file alias="tanker-anchorage.png">icons/map/marine/tanker-anchorage.png</file>
<file alias="nature-reserve-line.png">icons/map/marine/nature-reserve-line.png</file>
<file alias="sanctuary-line.png">icons/map/marine/sanctuary-line.png</file>
</qresource>
<!-- Patterns (Mapsforge) -->

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" id="baseball-11" xmlns="http://www.w3.org/2000/svg" width="11px" height="11px" viewBox="0 0 11 11">
<path d="M7,3c0,0.5523-0.4477,1-1,1S5,3.5523,5,3s0.4477-1,1-1S7,2.4477,7,3z M9.85,10.24L9.85,10.24l-3-4.85&#xA;&#x9;C6.7391,5.2011,6.5603,5.0616,6.35,5H2.5C2.2239,5,2,5.2239,2,5.5S2.2239,6,2.5,6H5l0.92,1.09l-2.73,3l0,0&#xA;&#x9;C3.0637,10.1876,2.9928,10.3405,3,10.5C3,10.7761,3.2239,11,3.5,11c0.1224-0.0006,0.2401-0.047,0.33-0.13l0,0l3-2.71L9,10.81l0,0&#xA;&#x9;c0.0912,0.1178,0.231,0.1877,0.38,0.19c0.2761,0,0.5-0.2239,0.5-0.5C9.8938,10.4122,9.8834,10.3223,9.85,10.24z M4,0.28&#xA;&#x9;C4,0.1254,3.8746,0,3.72,0C3.6221,0.0262,3.5348,0.0821,3.47,0.16L2,4.59C1.9941,4.6331,1.9941,4.6769,2,4.72&#xA;&#x9;C2,4.8746,2.1254,5,2.28,5c0.1015-0.0243,0.1926-0.0803,0.26-0.16L4,0.41C4.006,0.3669,4.006,0.3231,4,0.28z"/>
</svg>

After

Width:  |  Height:  |  Size: 876 B

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="basketball-11" xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 11 11">
<path id="icon_concepts:_sports_leisure" d="M2.63,3.51a5.1555,5.1555,0,0,1,.34,1.48H2.04A3.2586,3.2586,0,0,1,2.63,3.51Zm.55-.63a6.2022,6.2022,0,0,1,.55,2.11H5.12V2.01A3.4256,3.4256,0,0,0,3.18,2.88Zm2.7-.87V4.99H7.27a6.2022,6.2022,0,0,1,.55-2.11A3.4256,3.4256,0,0,0,5.88,2.01Zm2.49,1.5a5.1555,5.1555,0,0,0-.34,1.48h.93A3.2586,3.2586,0,0,0,8.37,3.51ZM9.9,6.5a.4952.4952,0,0,1-.49.5H8.44L7.91,8.05v1.7a.2176.2176,0,0,1-.14.2.236.236,0,0,1-.08.02.1987.1987,0,0,1-.16-.07l-.75-.74-1.16.77a.2107.2107,0,0,1-.24,0L4.22,9.16l-.75.74a.2222.2222,0,0,1-.38-.15V8.05L2.57,7H1.6a.5.5,0,1,1,0-1H9.4a.4951.4951,0,0,1,.5.49ZM3.53,8V9.22l.5-.5c.01,0,.01-.01.02-.01L5.1,7H3.06l.45.9A.3561.3561,0,0,1,3.53,8Zm2.97.82-1-1.63-1,1.63,1,.67ZM7.94,7H5.9L6.95,8.71c.01,0,.01.01.02.01l.5.5V8a.3561.3561,0,0,1,.02-.1Z"/>
</svg>

After

Width:  |  Height:  |  Size: 944 B

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" id="cricket-11" xmlns="http://www.w3.org/2000/svg" width="11px" height="11px" viewBox="0 0 11 11">
<path d="M6,1c0,0.5523-0.4477,1-1,1S4,1.5523,4,1s0.4477-1,1-1S6,0.4477,6,1z M8.88,5.18l-1-2l0,0l0,0&#xA;&#x9;C7.7859,3.0671,7.647,3.0012,7.5,3H2.77C2.3827,2.9815,2.0467,3.2651,2,3.65l0,0l-1,6.71l0,0c-0.0068,0.0464-0.0068,0.0936,0,0.14&#xA;&#x9;C1,10.7761,1.2239,11,1.5,11c0.2307,0.0129,0.4391-0.1371,0.5-0.36l0,0l1.22-3.89l0,0l0.21-0.83l0.4,0.44l0,0L5,7.6v2.9&#xA;&#x9;C5,10.7761,5.2239,11,5.5,11S6,10.7761,6,10.5v-3l0,0l0,0C5.9971,7.3984,5.9621,7.3004,5.9,7.22l0,0L4.45,5.5L5.5,4h1.71l0.92,1.84&#xA;&#x9;l0,0C8.2247,5.9439,8.3594,6.0022,8.5,6C8.7723,6.0001,8.9946,5.7822,9,5.51C8.9826,5.3931,8.9418,5.2808,8.88,5.18z M10.5,8&#xA;&#x9;C10.2239,8,10,8.2239,10,8.5S10.2239,9,10.5,9S11,8.7761,11,8.5S10.7761,8,10.5,8z M8.69,8V7.25C8.69,7.1119,8.5781,7,8.44,7&#xA;&#x9;S8.19,7.1119,8.19,7.25V8C8.0378,8.0855,7.9426,8.2455,7.94,8.42v2.08c0,0.2761,0.2239,0.5,0.5,0.5s0.5-0.2239,0.5-0.5V8.41&#xA;&#x9;C8.9339,8.2391,8.8392,8.0837,8.69,8z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 11 11" id="defibrillator-11">
<path d="M1.42,4.7955C-0.2131,1.5291,3.9327-.6514,5.512,2.6149,7.0914-.6514,11.2371,1.5291,9.6039,4.7955c-0.0225.0377-.0483,0.0732-0.071,0.1108H8.3867L7.5586,3.252a0.65,0.65,0,0,0-1.1172,0L5,6.1338,4.5586,5.252A0.6243,0.6243,0,0,0,4,4.9063H1.4913C1.4685,4.8687,1.4427,4.8332,1.42,4.7955ZM8,6.1563a0.6243,0.6243,0,0,1-.5586-0.3457L7,4.9287,5.5586,7.8105a0.6241,0.6241,0,0,1-1.1172,0L3.6133,6.1563H2.3006a24.2269,24.2269,0,0,0,2.8973,3.449L5.2134,9.6208A0.44,0.44,0,0,0,5.835,9.6053a24.2289,24.2289,0,0,0,2.8905-3.449H8Z"/>
</svg>

After

Width:  |  Height:  |  Size: 675 B

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="horse-riding-11" xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 11 11">
<path d="M4,1A1,1,0,1,1,5,2,1,1,0,0,1,4,1Zm6.88,3.5L9,3V2.5L7,5H6L7,6V7.014a.5.5,0,1,1-1,0V6.5L4,5H3a1,1,0,0,0-.8.446A1.189,1.189,0,0,0,1.247,5,1.076,1.076,0,0,0,0,5.988C0,7.3.635,7.471.635,7.471a.33.33,0,0,0,.115.023A.253.253,0,0,0,1,7.25V6a.49.49,0,0,1,.48-.5H1.5A.5.5,0,0,1,2,6V8.014l-.3.6a1.609,1.609,0,0,0-.2.6v1.542A.244.244,0,0,0,1.744,11,.255.255,0,0,0,2,10.756V9.514a.367.367,0,0,1,.1-.3l.9-1.2V9l.467,1.816A.256.256,0,0,0,3.709,11a.25.25,0,0,0,.25-.25v-.016l-.242-1.61a.6.6,0,0,1,.025-.236L3.8,8.714,4,8H6V9l.466,1.816A.256.256,0,0,0,6.709,11a.25.25,0,0,0,.25-.25L6.718,9.124a.6.6,0,0,1,.025-.236L7,8a.877.877,0,0,0,.934-.661L8.5,4.5a.6.6,0,0,0,.71.454.562.562,0,0,0,.143-.07l.9.116a.721.721,0,0,0,.392.1A.331.331,0,0,0,11,4.784.406.406,0,0,0,10.88,4.5ZM6,3.5A.51.51,0,0,0,5.5,3h-1a.482.482,0,0,0-.5.5V5H6Z"/>
</svg>

After

Width:  |  Height:  |  Size: 972 B

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" id="parking-garage-11" xmlns="http://www.w3.org/2000/svg" width="11px" height="11px" viewBox="0 0 11 11">
<path d="M7.25,7.44C6.8067,7.7602,6.2657,7.9158,5.72,7.88H4.45V10H3.19V4H5.8c0.5201-0.0279,1.0324,0.1358,1.44,0.46&#xA;&#x9;c0.3847,0.372,0.5828,0.8966,0.54,1.43C7.8557,6.4611,7.6596,7.0348,7.25,7.44z M6.25,5.28c-0.1946-0.1475-0.4365-0.2186-0.68-0.2&#xA;&#x9;H4.45v1.76H5.6c0.246,0.0129,0.4882-0.0654,0.68-0.22c0.1746-0.1813,0.2621-0.4293,0.24-0.68c0.023-0.2449-0.0651-0.4871-0.24-0.66&#xA;&#x9;L6.25,5.28z M10.41,3.28c0.1349-0.2403,0.0499-0.5444-0.19-0.68l-4.5-2.5c-0.1521-0.0855-0.3379-0.0855-0.49,0l-4.5,2.5&#xA;&#x9;C0.4972,2.7485,0.4288,3.0576,0.5773,3.2904C0.7144,3.5054,0.9913,3.5828,1.22,3.47l4.28-2.4l4.26,2.37&#xA;&#x9;c0.2421,0.1328,0.546,0.0442,0.6789-0.1979C10.4392,3.2414,10.4396,3.2407,10.44,3.24L10.41,3.28z"/>
</svg>

After

Width:  |  Height:  |  Size: 899 B

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="slipway-11" xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 11 11">
<g id="slipway-final">
<path d="M1.0417,8l8,1.3794V10h-8Zm8-4-1,1v.625L3.7345,4.01l.0777-.2852.86-.8447H5.5a.35.35,0,0,0,0-.6992H4.529a.3478.3478,0,0,0-.2451.1L3.2546,3.291a.3566.3566,0,0,0-.0928.1582l-.0856.3137L1.0417,3C1.0948,4,1,5.5094,3,5.8844,3.9829,6.0687,8.0948,7,8.0948,7l1.9469-2Z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 452 B

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" id="triangle-11" xmlns="http://www.w3.org/2000/svg" width="11px" height="11px" viewBox="0 0 11 11">
<path id="rect3338" d="M5.5174,1.2315&#xA;&#x9;C5.3163,1.2253,5.1276,1.328,5.024,1.5l-4,6.6598C0.8013,8.5293,1.0679,8.9999,1.5,9h8c0.4321-0.0001,0.6987-0.4707,0.476-0.8402&#xA;&#x9;l-4-6.6598C5.8787,1.3386,5.706,1.2375,5.5174,1.2315z"/>
</svg>

After

Width:  |  Height:  |  Size: 403 B

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" id="triangle-stroked-11" xmlns="http://www.w3.org/2000/svg" width="11px" height="11px" viewBox="0 0 11 11">
<path id="rect3338" d="M5.5174,1.2315&#xA;&#x9;C5.3163,1.2253,5.1276,1.328,5.024,1.5l-4,6.6598C0.8013,8.5293,1.0679,8.9999,1.5,9h8c0.4321-0.0001,0.6987-0.4707,0.476-0.8402&#xA;&#x9;l-4-6.6598C5.8787,1.3386,5.706,1.2375,5.5174,1.2315z M5.5,2.8627l3.0191,5.0286H2.4809L5.5,2.8627z"/>
</svg>

After

Width:  |  Height:  |  Size: 456 B

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="volleyball-11" xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 11 11">
<path d="M9.99,5.73a3.6572,3.6572,0,0,1-.1.74A6.3224,6.3224,0,0,0,7.44,5.05a5.9537,5.9537,0,0,0-1.32-.27c-.03,0-.07-.01-.11-.01A4.6052,4.6052,0,0,1,5.5,3.64a1.0563,1.0563,0,0,1-.06-.24h.12a4.8784,4.8784,0,0,1,1.01.11,5.0388,5.0388,0,0,1,1.14.36,4.8341,4.8341,0,0,1,.94.53A5.1356,5.1356,0,0,1,9.99,5.73ZM9.33,7.31a5.1964,5.1964,0,0,0-1.36-.97c-.05.1-.11.19-.17.29a5.8645,5.8645,0,0,1-.59.82,7.1807,7.1807,0,0,1-.78.78,6.72,6.72,0,0,1-.93.65,6.3643,6.3643,0,0,1-1.86.72,4.524,4.524,0,0,0,3.72,0,4.1584,4.1584,0,0,0,1.25-.86,3.1983,3.1983,0,0,0,.43-.47,3.7473,3.7473,0,0,0,.48-.76A1.1915,1.1915,0,0,0,9.33,7.31ZM8.68,2.32a4.5077,4.5077,0,0,0-1.24-.88,3.979,3.979,0,0,0-.75-.28,4.3423,4.3423,0,0,0-1.03-.15,1.2787,1.2787,0,0,0-.32,0A5.3628,5.3628,0,0,0,5.25,2c0,.14.01.28.02.41a1.6165,1.6165,0,0,1,.22-.01,1.9237,1.9237,0,0,1,.24.01,6.6508,6.6508,0,0,1,1,.11,5.6947,5.6947,0,0,1,1,.28,6.7814,6.7814,0,0,1,1.02.47,6.6645,6.6645,0,0,1,.98.69A4.5655,4.5655,0,0,0,8.68,2.32ZM3.03,6.34a5.808,5.808,0,0,1-.4-.92,5.7849,5.7849,0,0,1-.28-1.03,6.86,6.86,0,0,1-.1-1.12V3.25a5.656,5.656,0,0,1,.07-.93A4.3939,4.3939,0,0,0,1.27,3.97,4.3206,4.3206,0,0,0,1,5.5a1.7671,1.7671,0,0,0,.01.23,4.4161,4.4161,0,0,0,.09.73,4.0749,4.0749,0,0,0,.31.91,1.0685,1.0685,0,0,0,.27-.07A5.0679,5.0679,0,0,0,3.2,6.63C3.14,6.53,3.08,6.44,3.03,6.34Zm3.88-.4a5.4992,5.4992,0,0,0-1.35-.19c-.02.03-.04.05-.06.08a6.2466,6.2466,0,0,1-.91,1.01,5.8334,5.8334,0,0,1-.8.61,6.5727,6.5727,0,0,1-1.83.82,3.1983,3.1983,0,0,0,.43.47,5.1724,5.1724,0,0,0,2.18-.51,5.4146,5.4146,0,0,0,.93-.55,5.5958,5.5958,0,0,0,.91-.84A4.8049,4.8049,0,0,0,7,6.01a.0517.0517,0,0,0,.02-.04A.2283.2283,0,0,0,6.91,5.94ZM4.88,4.78a5.6391,5.6391,0,0,1-.45-1.27,6.3861,6.3861,0,0,1-.16-.99c-.01-.17-.02-.35-.02-.52a5.83,5.83,0,0,1,.06-.84,3.9815,3.9815,0,0,0-.75.28A5.5806,5.5806,0,0,0,3.27,2.8c-.01.15-.02.3-.02.45a4.2153,4.2153,0,0,0,.04.62,4.7107,4.7107,0,0,0,.27,1.18,5.0984,5.0984,0,0,0,.42.92A.0517.0517,0,0,0,4,6.01a.1778.1778,0,0,0,.08-.07h.01a5.6817,5.6817,0,0,0,.84-1.06A.3131.3131,0,0,1,4.88,4.78Z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 B

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 266 B

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="0 0 11 9" height="9" width="11" version="1.1">
<g stroke-width="1.5" stroke="#000000" fill="none">
<rect x="2" y="2" width="7" height="5"/>
<line x1="0" y1="0" x2="2" y2="2"/>
<line x1="11" y1="0" x2="9" y2="2"/>
<line x1="0" y1="9" x2="2" y2="7"/>
<line x1="11" y1="9" x2="9" y2="7"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 363 B

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="0 0 4 5" height="5" width="4" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<g>
<path d="M 0.5,0 V 5" stroke-width="1.0" stroke="#666666"/>
<path d="M 0,0.5 H 4" stroke-width="1.0" stroke="#666666"/>
</g>
<svg viewBox="0 0 4 5" height="5" width="4" version="1.1">
<g stroke-width="1.0" stroke="#666666">
<path d="M 0.5,0 V 5"/>
<path d="M 0,0.5 H 4"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 204 B

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="6" height="8" version="1.1" viewBox="0 0 6 8">
<path d="M 0.5,3 L 5.5,3 M 3,0.5 L 3,7.5" stroke="#000000" stroke-width="1"/>
</svg>

After

Width:  |  Height:  |  Size: 184 B

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="15" height="11" viewBox="0 0 15 11" version="1.1">
<g>
<path style="stroke:none;fill-rule:nonzero;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 15.007812 0.132812 C 15.007812 0.230469 15.007812 0.324219 15.007812 0.421875 C 14.570312 1.402344 14.0625 2.710938 13.589844 3.875 C 13.480469 4.140625 13.316406 4.886719 12.96875 4.859375 C 12.683594 4.835938 12.535156 4.089844 12.445312 3.8125 C 12.292969 3.339844 12.210938 3.003906 12.074219 2.605469 C 10.507812 3.261719 9.367188 4.308594 9.421875 6.476562 C 9.460938 8.195312 10.074219 9.632812 10.441406 11.007812 C 8.917969 11.007812 7.394531 11.007812 5.871094 11.007812 C 5.730469 7.347656 5.59375 3.683594 5.46875 0.0078125 C 5.996094 0.0078125 6.519531 0.0078125 7.042969 0.0078125 C 7.40625 1.230469 7.800781 2.421875 8.15625 3.652344 C 8.941406 2.871094 10.023438 2.042969 11.335938 1.65625 C 11.128906 1.378906 10.828125 1.179688 10.5625 0.957031 C 10.320312 0.757812 9.9375 0.570312 9.945312 0.132812 C 10.007812 0.113281 10.015625 0.0390625 10.070312 0.0078125 C 11.675781 0.0078125 13.28125 0.0078125 14.882812 0.0078125 C 14.898438 0.046875 14.921875 0.0742188 14.976562 0.0703125 C 14.972656 0.109375 14.984375 0.128906 15.007812 0.132812 Z M 15.007812 0.132812 "/>
<path style="stroke:none;fill-rule:nonzero;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 3.433594 0.0078125 C 3.957031 0.0078125 4.484375 0.0078125 5.007812 0.0078125 C 4.867188 3.667969 4.730469 7.332031 4.605469 11.007812 C 3.074219 11.007812 1.539062 11.007812 0.0078125 11.007812 C 0.0078125 10.976562 0.0078125 10.945312 0.0078125 10.914062 C 1.171875 7.300781 2.277344 3.628906 3.433594 0.0078125 Z M 3.433594 0.0078125 "/>
</g>
<svg width="15" height="11" viewBox="0 0 15 11" version="1.1">
<g stroke="none" fill="#000000">
<path d="M 15.007812 0.132812 C 15.007812 0.230469 15.007812 0.324219 15.007812 0.421875 C 14.570312 1.402344 14.0625 2.710938 13.589844 3.875 C 13.480469 4.140625 13.316406 4.886719 12.96875 4.859375 C 12.683594 4.835938 12.535156 4.089844 12.445312 3.8125 C 12.292969 3.339844 12.210938 3.003906 12.074219 2.605469 C 10.507812 3.261719 9.367188 4.308594 9.421875 6.476562 C 9.460938 8.195312 10.074219 9.632812 10.441406 11.007812 C 8.917969 11.007812 7.394531 11.007812 5.871094 11.007812 C 5.730469 7.347656 5.59375 3.683594 5.46875 0.0078125 C 5.996094 0.0078125 6.519531 0.0078125 7.042969 0.0078125 C 7.40625 1.230469 7.800781 2.421875 8.15625 3.652344 C 8.941406 2.871094 10.023438 2.042969 11.335938 1.65625 C 11.128906 1.378906 10.828125 1.179688 10.5625 0.957031 C 10.320312 0.757812 9.9375 0.570312 9.945312 0.132812 C 10.007812 0.113281 10.015625 0.0390625 10.070312 0.0078125 C 11.675781 0.0078125 13.28125 0.0078125 14.882812 0.0078125 C 14.898438 0.046875 14.921875 0.0742188 14.976562 0.0703125 C 14.972656 0.109375 14.984375 0.128906 15.007812 0.132812 Z M 15.007812 0.132812"/>
<path d="M 3.433594 0.0078125 C 3.957031 0.0078125 4.484375 0.0078125 5.007812 0.0078125 C 4.867188 3.667969 4.730469 7.332031 4.605469 11.007812 C 3.074219 11.007812 1.539062 11.007812 0.0078125 11.007812 C 0.0078125 10.976562 0.0078125 10.945312 0.0078125 10.914062 C 1.171875 7.300781 2.277344 3.628906 3.433594 0.0078125 Z M 3.433594 0.0078125"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="0 0 9 11" height="11" width="9" version="1.1">
<g>
<path d="M 1.5,1.5 L3,3 L 3,8 L 1.5,9.5" stroke-width="1" stroke="#000000" fill="none"/>
<path d="M 7.5,1.5 L6,3 L 6,8 L 7.5,9.5" stroke-width="1" stroke="#000000" fill="none"/>
<g stroke-width="1" stroke="#000000" fill="none">
<path d="M 1.5,1.5 L3,3 L 3,8 L 1.5,9.5"/>
<path d="M 7.5,1.5 L6,3 L 6,8 L 7.5,9.5"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 300 B

After

Width:  |  Height:  |  Size: 254 B

View File

@ -172,7 +172,7 @@
<message>
<location filename="../src/data/data.cpp" line="180"/>
<source>GPSDump files</source>
<translation type="unfinished"></translation>
<translation>GPSDump-filer</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>Ryd liste</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="288"/>
@ -486,17 +486,17 @@
<message>
<location filename="../src/GUI/gui.cpp" line="370"/>
<source>All</source>
<translation type="unfinished"></translation>
<translation>Alle</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="374"/>
<source>Raster only</source>
<translation type="unfinished"></translation>
<translation>Kun raster</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="378"/>
<source>Vector only</source>
<translation type="unfinished"></translation>
<translation>Kun vektor</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="385"/>
@ -591,7 +591,7 @@
<message>
<location filename="../src/GUI/gui.cpp" line="490"/>
<source>Show hillshading</source>
<translation type="unfinished"></translation>
<translation>Vis terrænskygge</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="498"/>
@ -713,7 +713,7 @@
<message>
<location filename="../src/GUI/gui.cpp" line="664"/>
<source>Open recent</source>
<translation type="unfinished"></translation>
<translation>Åbn seneste</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="689"/>
@ -723,7 +723,7 @@
<message>
<location filename="../src/GUI/gui.cpp" line="695"/>
<source>Layers</source>
<translation type="unfinished"></translation>
<translation>Lag</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="704"/>
@ -772,9 +772,9 @@
<message numerus="yes">
<location filename="../src/GUI/gui.cpp" line="2001"/>
<source>Download %n DEM tiles?</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
<translation>
<numerusform>Download %n DEM-flise?</numerusform>
<numerusform>Download %n DEM-fliser?</numerusform>
</translation>
</message>
<message>
@ -785,12 +785,12 @@
<message>
<location filename="../src/GUI/gui.cpp" line="476"/>
<source>Download data DEM</source>
<translation type="unfinished"></translation>
<translation>Download data-DEM</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="482"/>
<source>Download map DEM</source>
<translation type="unfinished"></translation>
<translation>Download kort-DEM</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="721"/>
@ -1053,7 +1053,7 @@
<message>
<location filename="../src/GUI/gui.cpp" line="1998"/>
<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>Downloadgrænsen for DEM-fliser er overskredet. Hvis du virkelig har brug for data for stort et område, skal du downloade filerne manuelt.</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="2014"/>
@ -1790,7 +1790,7 @@
<location filename="../src/GUI/optionsdialog.cpp" line="273"/>
<location filename="../src/GUI/optionsdialog.cpp" line="639"/>
<source>px</source>
<translation type="unfinished">px</translation>
<translation>px</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="309"/>
@ -1810,7 +1810,7 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="388"/>
<source>Detect pauses</source>
<translation type="unfinished"></translation>
<translation>Registrer pauser</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="392"/>
@ -1821,7 +1821,7 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="537"/>
<source>Detection:</source>
<translation type="unfinished"></translation>
<translation>Registrering:</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="564"/>
@ -1865,27 +1865,27 @@
<location filename="../src/GUI/optionsdialog.cpp" line="314"/>
<location filename="../src/GUI/optionsdialog.cpp" line="655"/>
<source>Opacity:</source>
<translation type="unfinished"></translation>
<translation>Gennemsigtighed:</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="657"/>
<source>Blur radius:</source>
<translation type="unfinished"></translation>
<translation>Sløringsradius:</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="659"/>
<source>Azimuth:</source>
<translation type="unfinished"></translation>
<translation>Azimut:</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="660"/>
<source>Altitude:</source>
<translation type="unfinished"></translation>
<translation>Højde:</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="661"/>
<source>Z Factor:</source>
<translation type="unfinished"></translation>
<translation>Z-faktor:</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="666"/>
@ -1896,7 +1896,7 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="667"/>
<source>Hillshading</source>
<translation type="unfinished"></translation>
<translation>Terrænskygge</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="687"/>
@ -1917,7 +1917,7 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="656"/>
<source>Lightening:</source>
<translation type="unfinished"></translation>
<translation>Belysning:</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="713"/>
@ -2325,7 +2325,7 @@
<message>
<location filename="../src/GUI/routeitem.cpp" line="38"/>
<source>File</source>
<translation type="unfinished">Fil</translation>
<translation>Fil</translation>
</message>
</context>
<context>
@ -2591,7 +2591,7 @@
<message>
<location filename="../src/GUI/trackitem.cpp" line="46"/>
<source>File</source>
<translation type="unfinished">Fil</translation>
<translation>Fil</translation>
</message>
</context>
<context>

View File

@ -587,7 +587,7 @@
<message>
<location filename="../src/GUI/gui.cpp" line="487"/>
<source>Show local DEM tiles</source>
<translation type="unfinished"></translation>
<translation>Näytä paikalliset DEM-laatat</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="490"/>
@ -699,7 +699,7 @@
<message>
<location filename="../src/GUI/gui.cpp" line="695"/>
<source>Layers</source>
<translation type="unfinished"></translation>
<translation>Kerrokset</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="721"/>
@ -850,12 +850,12 @@
<message>
<location filename="../src/GUI/gui.cpp" line="1998"/>
<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-laattojen latausraja ylitetty. Jos todella tarvitset tietoja niin suurelta alueelta, lataa tiedostot manuaalisesti.</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="2014"/>
<source>Could not download all required DEM files.</source>
<translation type="unfinished"></translation>
<translation>Kaikkia vaadittuja DEM-tiedostoja ei voitu ladata.</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="2048"/>
@ -898,12 +898,12 @@
<message>
<location filename="../src/GUI/gui.cpp" line="476"/>
<source>Download data DEM</source>
<translation type="unfinished"></translation>
<translation>Lataa data-DEM</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="482"/>
<source>Download map DEM</source>
<translation type="unfinished"></translation>
<translation>Lataa kartta-DEM</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="762"/>
@ -961,7 +961,7 @@
<message>
<location filename="../src/GUI/gui.cpp" line="1978"/>
<source>Clear &quot;%1&quot; tile cache?</source>
<translation type="unfinished"></translation>
<translation>Tyhjennetäänkö &quot;%1&quot; ruutuvälimuisti?</translation>
</message>
<message numerus="yes">
<location filename="../src/GUI/gui.cpp" line="2001"/>

View File

@ -486,17 +486,17 @@
<message>
<location filename="../src/GUI/gui.cpp" line="370"/>
<source>All</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="374"/>
<source>Raster only</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="378"/>
<source>Vector only</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="385"/>
@ -733,7 +733,7 @@
<message>
<location filename="../src/GUI/gui.cpp" line="695"/>
<source>Layers</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="704"/>
@ -1692,7 +1692,7 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="388"/>
<source>Detect pauses</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="391"/>
@ -1796,7 +1796,7 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="537"/>
<source>Detection:</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="538"/>
@ -1821,7 +1821,7 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="552"/>
<source>Pause detection</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="564"/>
@ -1870,7 +1870,7 @@
<location filename="../src/GUI/optionsdialog.cpp" line="314"/>
<location filename="../src/GUI/optionsdialog.cpp" line="655"/>
<source>Opacity:</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="657"/>
@ -1922,7 +1922,7 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="656"/>
<source>Lightening:</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="713"/>

View File

@ -21,6 +21,12 @@
<data android:scheme="content" android:mimeType="image/jpeg"/>
<data android:scheme="content" android:mimeType="image/tiff"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="geo"/>
</intent-filter>
<meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
<meta-data android:name="android.app.arguments" android:value="-- %%INSERT_APP_ARGUMENTS%% --"/>

View File

@ -17,6 +17,7 @@
Garmin GPI &amp; CSV, TomTom OV2 &amp; ITN, ONmove OMD/GHP,
TwoNav (TRK, RTE, WPT), GPSDump WPT and geotagged JPEG
files.</li>
<li>Opens geo URIs (RFC 5870).</li>
<li>User-definable online maps (OpenStreetMap/Google tiles, WMTS,
WMS, TMS, QuadTiles).</li>
<li>Offline maps (MBTiles, OziExplorer maps, TrekBuddy maps/atlases,
@ -112,5 +113,6 @@
<mimetype>application/vnd.iho.s57-catalogue</mimetype>
<mimetype>application/vnd.gpsdump.wpt</mimetype>
<mimetype>application/vnd.gpstuner.gmi</mimetype>
<mimetype>x-scheme-handler/geo</mimetype>
</mimetypes>
</component>

View File

@ -11,9 +11,9 @@ Comment[ru]=Программа для просмотра и анализа GPS
Comment[sv]=GPS-loggfilsläsare och analysator
Comment[tr]=GPS günlük dosyası görüntüleyici ve analizcisi
Comment[uk]=Переглядач та аналізатор GPS логів
Exec=gpxsee %F
Exec=gpxsee %U
Icon=gpxsee
Terminal=false
Type=Application
Categories=Graphics;Viewer;Education;Geography;Maps;Sports;Qt
MimeType=application/gpx+xml;application/vnd.garmin.tcx+xml;application/vnd.ant.fit;application/vnd.google-earth.kml+xml;application/vnd.fai.igc;application/vnd.nmea.nmea;application/vnd.oziexplorer.plt;application/vnd.oziexplorer.rte;application/vnd.oziexplorer.wpt;application/vnd.groundspeak.loc+xml;application/vnd.sigma.slf+xml;application/geo+json;application/vnd.naviter.seeyou.cup;application/vnd.garmin.gpi;application/vnd.suunto.sml+xml;image/jpeg;text/csv;application/vnd.garmin.img;application/vnd.garmin.jnx;application/vnd.garmin.gmap+xml;image/vnd.maptech.kap;application/vnd.oziexplorer.map;application/vnd.mapbox.mbtiles;application/vnd.twonav.rmap;application/vnd.trekbuddy.tba;application/vnd.gpxsee.map+xml;application/x-tar;image/tiff;application/vnd.google-earth.kmz;application/vnd.alpinequest.aqm;application/vnd.cgtk.gemf;application/vnd.rmaps.sqlite;application/vnd.osmdroid.sqlite;application/vnd.mapsforge.map;application/vnd.tomtom.ov2;application/vnd.tomtom.itn;application/vnd.esri.wld;application/vnd.onmove.omd;application/vnd.onmove.ghp;application/vnd.memory-map.qct;application/vnd.twonav.trk;application/vnd.twonav.rte;application/vnd.twonav.wpt;application/vnd.orux.map+xml;application/vnd.iho.s57-data;application/vnd.iho.s57-catalogue;application/vnd.gpsdump.wpt;application/vnd.gpstuner.gmi
MimeType=x-scheme-handler/geo;application/gpx+xml;application/vnd.garmin.tcx+xml;application/vnd.ant.fit;application/vnd.google-earth.kml+xml;application/vnd.fai.igc;application/vnd.nmea.nmea;application/vnd.oziexplorer.plt;application/vnd.oziexplorer.rte;application/vnd.oziexplorer.wpt;application/vnd.groundspeak.loc+xml;application/vnd.sigma.slf+xml;application/geo+json;application/vnd.naviter.seeyou.cup;application/vnd.garmin.gpi;application/vnd.suunto.sml+xml;image/jpeg;text/csv;application/vnd.garmin.img;application/vnd.garmin.jnx;application/vnd.garmin.gmap+xml;image/vnd.maptech.kap;application/vnd.oziexplorer.map;application/vnd.mapbox.mbtiles;application/vnd.twonav.rmap;application/vnd.trekbuddy.tba;application/vnd.gpxsee.map+xml;application/x-tar;image/tiff;application/vnd.google-earth.kmz;application/vnd.alpinequest.aqm;application/vnd.cgtk.gemf;application/vnd.rmaps.sqlite;application/vnd.osmdroid.sqlite;application/vnd.mapsforge.map;application/vnd.tomtom.ov2;application/vnd.tomtom.itn;application/vnd.esri.wld;application/vnd.onmove.omd;application/vnd.onmove.ghp;application/vnd.memory-map.qct;application/vnd.twonav.trk;application/vnd.twonav.rte;application/vnd.twonav.wpt;application/vnd.orux.map+xml;application/vnd.iho.s57-data;application/vnd.iho.s57-catalogue;application/vnd.gpsdump.wpt;application/vnd.gpstuner.gmi

View File

@ -738,6 +738,20 @@
</dict>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>geo</string>
</array>
<key>CFBundleURLName</key>
<string>org.geouri.geo</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
</array>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>

View File

@ -18,6 +18,18 @@
DeleteRegKey HKCR ".${EXT}"
!macroend
; URI association
!macro URI_ASSOCIATION_ADD PROTO
WriteRegStr HKCR "${PROTO}" "" "URL:${PROTO}"
WriteRegStr HKCR "${PROTO}" "URL Protocol" ""
WriteRegStr HKCR "${PROTO}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,0"
WriteRegStr HKCR "${PROTO}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
!macroend
!macro URI_ASSOCIATION_REMOVE PROTO
DeleteRegKey HKCR "${PROTO}"
!macroend
; Translations
!macro LOCALIZATION LANG CODE
Section "${LANG}"
@ -37,7 +49,7 @@ Unicode true
; The name of the installer
Name "GPXSee"
; Program version
!define VERSION "13.31"
!define VERSION "13.36"
; The file to write
OutFile "GPXSee-${VERSION}_x64.exe"
@ -58,7 +70,7 @@ VIProductVersion "${VERSION}.0.0"
VIAddVersionKey "ProductVersion" ${VERSION}
VIAddVersionKey "FileVersion" "${VERSION}.0.0"
VIAddVersionKey "ProductName" "GPXSee"
VIAddVersionKey "LegalCopyright" "Copyright (c) 2015-2024 Martin Tůma"
VIAddVersionKey "LegalCopyright" "Copyright (c) 2015-2025 Martin Tůma"
VIAddVersionKey "FileDescription" "GPXSee installer (x64)"
; Registry key to check for directory (so if you install again, it will
@ -200,6 +212,8 @@ Section "GPXSee" SEC_APP
!insertmacro FILE_ASSOCIATION_ADD "plt" "OziExplorer Track File" 33
!insertmacro FILE_ASSOCIATION_ADD "rte" "OziExplorer Route File" 34
!insertmacro URI_ASSOCIATION_ADD "geo"
WriteRegStr HKCR "Applications\GPXSee.exe\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".gpx\OpenWithList" "GPXSee.exe" ""
WriteRegStr HKCR ".tcx\OpenWithList" "GPXSee.exe" ""
@ -426,6 +440,8 @@ Section "Uninstall"
!insertmacro FILE_ASSOCIATION_REMOVE "000"
!insertmacro FILE_ASSOCIATION_REMOVE "031"
!insertmacro URI_ASSOCIATION_REMOVE "geo"
DeleteRegValue HKCR ".gpx\OpenWithList" "GPXSee.exe"
DeleteRegValue HKCR ".tcx\OpenWithList" "GPXSee.exe"
DeleteRegValue HKCR ".kml\OpenWithList" "GPXSee.exe"

View File

@ -73,9 +73,7 @@ App::App(int &argc, char **argv) : QApplication(argc, argv)
#if defined(Q_OS_WIN32) || defined(Q_OS_MAC)
QIcon::setThemeName(APP_NAME);
#endif // Q_OS_WIN32 || Q_OS_MAC
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
QIcon::setFallbackThemeName(APP_NAME);
#endif // QT 5.12
_gui = new GUI();

View File

@ -25,15 +25,6 @@
#define IW(item) ((item)->boundingRect().width())
#define IH(item) ((item)->boundingRect().height())
static inline QPoint POS(QWheelEvent *e)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
return e->pos();
#else // QT 5.15
return e->position().toPoint();
#endif // QT 5.15
}
static inline QPoint POS(QMouseEvent *e)
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
@ -393,7 +384,7 @@ void GraphView::wheelEvent(QWheelEvent *e)
return;
_angleDelta = _angleDelta % (15 * 8);
QPointF pos = mapToScene(POS(e));
QPointF pos = mapToScene(e->position().toPoint());
QRectF gr(_grid->boundingRect());
QPointF r(pos.x() / gr.width(), pos.y() / gr.height());
@ -404,7 +395,8 @@ void GraphView::wheelEvent(QWheelEvent *e)
QPointF npos(mapFromScene(QPointF(r.x() * ngr.width(),
r.y() * ngr.height())));
QScrollBar *sb = horizontalScrollBar();
sb->setSliderPosition(sb->sliderPosition() + npos.x() - POS(e).x());
sb->setSliderPosition(sb->sliderPosition() + npos.x()
- e->position().toPoint().x());
QGraphicsView::wheelEvent(e);
}

View File

@ -164,7 +164,8 @@ void GUI::mapInitialized()
_showMapAction->setEnabled(true);
_clearMapCacheAction->setEnabled(true);
} else {
qWarning("%s: %s", qPrintable(map->path()), qPrintable(map->errorString()));
qWarning("%s: %s", qUtf8Printable(map->path()),
qUtf8Printable(map->errorString()));
action->deleteLater();
}
}
@ -1068,18 +1069,33 @@ void GUI::openDir()
bool GUI::openFile(const QString &fileName, bool tryUnknown, int &showError)
{
QFileInfo fi(fileName);
QString canonicalFileName(fi.canonicalFilePath());
QString path;
if (_files.contains(canonicalFileName))
QUrl url(fileName);
if (url.scheme() == "geo") {
if (loadURL(url, showError)) {
_fileActionGroup->setEnabled(true);
_reloadFileAction->setEnabled(false);
return true;
} else if (showError)
return false;
} else if (url.isLocalFile())
path = url.toLocalFile();
else
path = fileName;
QFileInfo fi(path);
QString canonicalPath(fi.canonicalFilePath());
if (_files.contains(canonicalPath))
return true;
if (!loadFile(fileName, tryUnknown, showError))
if (!loadFile(path, tryUnknown, showError))
return false;
_files.append(canonicalFileName);
_files.append(canonicalPath);
#ifndef Q_OS_ANDROID
_browser->setCurrent(fileName);
_browser->setCurrent(path);
#endif // Q_OS_ANDROID
_fileActionGroup->setEnabled(true);
// Explicitly enable the reload action as it may be disabled by loadMapDir()
@ -1092,12 +1108,42 @@ bool GUI::openFile(const QString &fileName, bool tryUnknown, int &showError)
if (_files.count() > 1)
_mapView->showExtendedInfo(true);
#ifndef Q_OS_ANDROID
updateRecentFiles(canonicalFileName);
updateRecentFiles(canonicalPath);
#endif // Q_OS_ANDROID
return true;
}
bool GUI::loadURL(const QUrl &url, int &showError)
{
Data data(url);
if (data.isValid()) {
loadData(data);
return true;
} else {
if (showError) {
QString error = tr("Error loading geo URI:") + "\n" + url.toString()
+ ": " + data.errorString();
if (showError > 1) {
QMessageBox message(QMessageBox::Critical, APP_NAME, error,
QMessageBox::Ok, this);
QCheckBox checkBox(tr("Don't show again"));
message.setCheckBox(&checkBox);
message.exec();
if (checkBox.isChecked())
showError = 0;
} else
QMessageBox::critical(this, APP_NAME, error);
} else
qWarning("%s: %s", qUtf8Printable(url.toString()),
qUtf8Printable(data.errorString()));
return false;
}
}
bool GUI::loadFile(const QString &fileName, bool tryUnknown, int &showError)
{
Data data(fileName, tryUnknown);
@ -1849,7 +1895,13 @@ bool GUI::loadMapNode(const TreeNode<Map*> &node, MapAction *&action,
bool GUI::loadMap(const QString &fileName, MapAction *&action, int &showError)
{
TreeNode<Map*> maps(MapList::loadMaps(fileName, _mapView->inputProjection()));
QString path;
QUrl url(fileName);
path = url.isLocalFile() ? url.toLocalFile() : fileName;
TreeNode<Map*> maps(MapList::loadMaps(path, _mapView->inputProjection()));
QList<QAction*> existingActions(_mapsActionGroup->actions());
return loadMapNode(maps, action, existingActions, showError);
@ -2446,12 +2498,8 @@ QGeoPositionInfoSource *GUI::positionSource(const Options &options)
{
QGeoPositionInfoSource *source;
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
source = QGeoPositionInfoSource::createSource(options.plugin, this);
#else // QT 5.14
source = QGeoPositionInfoSource::createSource(options.plugin,
options.pluginParams.value(options.plugin), this);
#endif // QT 5.14
if (source)
source->setPreferredPositioningMethods(
QGeoPositionInfoSource::SatellitePositioningMethods);

View File

@ -158,6 +158,7 @@ private:
#endif // Q_OS_ANDROID
bool openPOIFile(const QString &fileName);
bool loadFile(const QString &fileName, bool tryUnknown, int &showError);
bool loadURL(const QUrl &url, int &showError);
void loadData(const Data &data);
bool loadMapNode(const TreeNode<Map*> &node, MapAction *&action,
const QList<QAction*> &existingActions, int &showError);

View File

@ -638,11 +638,7 @@ void MapView::wheelEvent(QWheelEvent *event)
return;
_wheelDelta = _wheelDelta % (15 * 8);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
zoom((delta > 0) ? 1 : -1, event->pos(), shift);
#else // QT 5.15
zoom((delta > 0) ? 1 : -1, event->position().toPoint(), shift);
#endif // QT 5.15
/* Do not call QGraphicsView::wheelEvent() here as this would shift the
view ! */
@ -1258,7 +1254,7 @@ void MapView::drawHillShading(bool draw)
setMap(_map);
}
void MapView::selectLayers(Layers layers)
void MapView::selectLayers(MapView::Layers layers)
{
_layers = layers;

View File

@ -136,7 +136,7 @@ public slots:
void showMotionInfo(bool show);
void useStyles(bool use);
void drawHillShading(bool draw);
void selectLayers(Layers layers);
void selectLayers(MapView::Layers layers);
private slots:
void updatePOI();

View File

@ -676,21 +676,17 @@ QWidget *OptionsDialog::createPositionPage()
_positionPlugin = new QComboBox();
_positionPlugin->addItems(plugins);
_positionPlugin->setCurrentIndex(_positionPlugin->findText(_options.plugin));
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
_pluginParameters = new PluginParameters(_positionPlugin->currentText(),
_options.pluginParams);
connect(_positionPlugin, &QComboBox::currentTextChanged, _pluginParameters,
&PluginParameters::setPlugin);
#endif // QT 5.14
QFormLayout *pluginLayout = new QFormLayout();
pluginLayout->addRow(tr("Plugin:"), _positionPlugin);
QVBoxLayout *sourceLayout = new QVBoxLayout();
sourceLayout->addLayout(pluginLayout);
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
sourceLayout->addWidget(_pluginParameters);
#endif // QT 5.14
sourceLayout->addStretch();
QWidget *sourceTab = new QWidget();
@ -1009,9 +1005,7 @@ void OptionsDialog::accept()
_options.hillshadingZFactor = _hillshadingZFactor->value();
_options.plugin = _positionPlugin->currentText();
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
_options.pluginParams = _pluginParameters->parameters();
#endif // QT 5.14
_options.useOpenGL = _useOpenGL->isChecked();
_options.enableHTTP2 = _enableHTTP2->isChecked();

View File

@ -193,9 +193,7 @@ private:
QDoubleSpinBox *_hillshadingZFactor;
// Position
QComboBox *_positionPlugin;
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
PluginParameters *_pluginParameters;
#endif // QT 5.14
// System
QSpinBox *_pixmapCache;
QSpinBox *_demCache;

View File

@ -10,13 +10,6 @@
#include "markeritem.h"
#include "pathitem.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
#define INTERSECTS intersect
#else // QT 5.15
#define INTERSECTS intersects
#endif // QT 5.15
#define GEOGRAPHICAL_MILE 1855.3248
Units PathItem::_units = Metric;
@ -79,14 +72,14 @@ bool PathItem::addSegment(const Coordinates &c1, const Coordinates &c2)
QLineF l(QPointF(c1.lon(), c1.lat()), QPointF(c2.lon() + 360,
c2.lat()));
QLineF dl(QPointF(180, -90), QPointF(180, 90));
l.INTERSECTS(dl, &p);
l.intersects(dl, &p);
_painterPath.lineTo(_map->ll2xy(Coordinates(180, p.y())));
_painterPath.moveTo(_map->ll2xy(Coordinates(-180, p.y())));
} else {
QLineF l(QPointF(c1.lon(), c1.lat()), QPointF(c2.lon() - 360,
c2.lat()));
QLineF dl(QPointF(-180, -90), QPointF(-180, 90));
l.INTERSECTS(dl, &p);
l.intersects(dl, &p);
_painterPath.lineTo(_map->ll2xy(Coordinates(-180, p.y())));
_painterPath.moveTo(_map->ll2xy(Coordinates(180, p.y())));
}

View File

@ -9,9 +9,6 @@
#include <QVBoxLayout>
#include <QFormLayout>
#include <QApplication>
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
#include <QDesktopWidget>
#endif // QT 5.15
#include "tooltip.h"
#include "thumbnail.h"
#include "flowlayout.h"
@ -184,11 +181,7 @@ bool PopupFrame::eventFilter(QObject *o, QEvent *ev)
void PopupFrame::place(const QPoint &pos, QWidget *w)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QRect screen = QApplication::desktop()->screenGeometry(w);
#else // QT 5.15
QRect screen = w->screen()->geometry();
#endif // QT 5.15
QPoint p(pos.x() + 2, pos.y() + 16);
if (p.x() + width() > screen.x() + screen.width())

View File

@ -2,6 +2,7 @@
#include <QFile>
#include <QFileInfo>
#include "common/util.h"
#include "map/crs.h"
#include "gpxparser.h"
#include "tcxparser.h"
#include "csvparser.h"
@ -127,11 +128,11 @@ Data::Data(const QString &fileName, bool tryUnknown)
++it;
}
qWarning("%s:", qPrintable(fileName));
qWarning("%s:", qUtf8Printable(fileName));
for (it = _parsers.find(suffix); it != _parsers.end()
&& it.key() == suffix; it++)
qWarning(" %s: line %d: %s", qPrintable(it.key()),
it.value()->errorLine(), qPrintable(it.value()->errorString()));
qWarning(" %s: line %d: %s", qUtf8Printable(it.key()),
it.value()->errorLine(), qUtf8Printable(it.value()->errorString()));
} else if (tryUnknown) {
for (it = _parsers.begin(); it != _parsers.end(); it++) {
@ -144,16 +145,80 @@ Data::Data(const QString &fileName, bool tryUnknown)
file.reset();
}
qWarning("%s:", qPrintable(fileName));
qWarning("%s:", qUtf8Printable(fileName));
for (it = _parsers.begin(); it != _parsers.end(); it++)
qWarning(" %s: line %d: %s", qPrintable(it.key()),
it.value()->errorLine(), qPrintable(it.value()->errorString()));
qWarning(" %s: line %d: %s", qUtf8Printable(it.key()),
it.value()->errorLine(), qUtf8Printable(it.value()->errorString()));
_errorLine = 0;
_errorString = "Unknown format";
}
}
Data::Data(const QUrl &url)
{
bool caOk, cbOk, ccOk;
Projection proj(GCS::WGS84());
_valid = false;
QStringList parts(url.path().split(';'));
if (parts.size() < 1) {
_errorString = "Syntax error";
return;
}
QStringList coords(parts.at(0).split(','));
if (coords.size() < 2 || coords.size() > 3) {
_errorString = "Syntax error";
return;
}
double ca = coords.at(0).toDouble(&caOk);
double cb = coords.at(1).toDouble(&cbOk);
double cc = NAN;
if (!(caOk && cbOk)) {
_errorString = "Invalid coordinates";
return;
}
if (coords.size() > 2) {
cc = coords.at(2).toDouble(&ccOk);
if (!ccOk) {
_errorString = "Invalid elevation";
return;
}
}
if (parts.size() > 1) {
QStringList crsp(parts.at(1).split('='));
if (crsp.size() != 2) {
_errorString = "Syntax error";
return;
}
if (!crsp.at(0).compare("crs", Qt::CaseInsensitive)) {
if (crsp.at(1).compare("wgs84", Qt::CaseInsensitive)) {
proj = CRS::projection(crsp.at(1));
if (!proj.isValid()) {
_errorString = "Unknown CRS";
return;
}
}
}
}
CoordinateSystem::AxisOrder ao = proj.coordinateSystem().axisOrder();
PointD p(ao == CoordinateSystem::XY ? PointD(ca, cb) : PointD(cb, ca));
Coordinates c(proj.xy2ll(p));
if (!c.isValid()) {
_errorString = "Invalid coordinates";
return;
}
Waypoint w(c);
w.setElevation(cc);
_waypoints.append(w);
_valid = true;
}
QString Data::formats()
{
return

View File

@ -14,6 +14,7 @@ class Data
{
public:
Data(const QString &fileName, bool tryUnknown = true);
Data(const QUrl &url);
bool isValid() const {return _valid;}
const QString &errorString() const {return _errorString;}

View File

@ -245,7 +245,7 @@ bool IGCParser::parse(QFile *file, QList<TrackData> &tracks,
/* The date H header is mandatory, but XCSOAR generates
files without it, so add a dummy date in such case */
qWarning("%s: Missing date header",
qPrintable(file->fileName()));
qUtf8Printable(file->fileName()));
ctx.date = QDate(1970, 1, 1);
}
if (!track) {

View File

@ -28,11 +28,12 @@ bool OMDParser::readHeaderFile(const QString &omdPath, Header &hdr)
char buffer[60];
if (!file.open(QIODevice::ReadOnly)) {
qWarning("%s: %s", qPrintable(path), qPrintable(file.errorString()));
qWarning("%s: %s", qUtf8Printable(path),
qUtf8Printable(file.errorString()));
return false;
}
if (file.read(buffer, sizeof(buffer)) != sizeof(buffer)) {
qWarning("%s: invalid OMH file", qPrintable(path));
qWarning("%s: invalid OMH file", qUtf8Printable(path));
return false;
}
@ -48,7 +49,7 @@ bool OMDParser::readHeaderFile(const QString &omdPath, Header &hdr)
QDateTime date(QDate(Y + 2000, M, D), QTime(h, m), QTimeZone::utc());
if (!date.isValid()) {
qWarning("%s: invalid date", qPrintable(path));
qWarning("%s: invalid date", qUtf8Printable(path));
return false;
}
@ -183,11 +184,12 @@ bool GHPParser::readHeaderFile(const QString &ghpPath, Header &hdr)
char buffer[96];
if (!file.open(QIODevice::ReadOnly)) {
qWarning("%s: %s", qPrintable(path), qPrintable(file.errorString()));
qWarning("%s: %s", qUtf8Printable(path),
qUtf8Printable(file.errorString()));
return false;
}
if (file.read(buffer, sizeof(buffer)) != sizeof(buffer)) {
qWarning("%s: invalid GHT file", qPrintable(path));
qWarning("%s: invalid GHT file", qUtf8Printable(path));
return false;
}
@ -202,7 +204,7 @@ bool GHPParser::readHeaderFile(const QString &ghpPath, Header &hdr)
QDateTime date(QDate(Y + 2000, M, D), QTime(h, m, s), QTimeZone::utc());
if (!date.isValid()) {
qWarning("%s: invalid date", qPrintable(path));
qWarning("%s: invalid date", qUtf8Printable(path));
return false;
}

View File

@ -108,8 +108,8 @@ TreeNode<QString> POI::loadDir(const QString &path)
if (loadFile(fi.absoluteFilePath()))
tree.addItem(fi.absoluteFilePath());
else
qWarning("%s: %s", qPrintable(fi.absoluteFilePath()),
qPrintable(_errorString));
qWarning("%s: %s", qUtf8Printable(fi.absoluteFilePath()),
qUtf8Printable(_errorString));
}
}

View File

@ -3,7 +3,7 @@
void SLFParser::warning(const char *text) const
{
const QFile *file = static_cast<QFile *>(_reader.device());
qWarning("%s:%lld: %s", qPrintable(file->fileName()),
qWarning("%s:%lld: %s", qUtf8Printable(file->fileName()),
_reader.lineNumber(), text);
}

View File

@ -4,7 +4,7 @@
void TCXParser::warning(const char *text) const
{
const QFile *file = static_cast<QFile *>(_reader.device());
qWarning("%s:%lld: %s", qPrintable(file->fileName()),
qWarning("%s:%lld: %s", qUtf8Printable(file->fileName()),
_reader.lineNumber(), text);
}

View File

@ -140,8 +140,7 @@ Track::Track(const TrackData &data) : _pause(0)
bool hasTime = !std::isnan(seg.time.first());
for (int j = 1; j < sd.size(); j++) {
ds = sd.at(j).coordinates().distanceTo(
sd.at(j-1).coordinates());
ds = sd.at(j).coordinates().distanceTo(sd.at(j-1).coordinates());
seg.distance.append(seg.distance.last() + ds);
if (hasTime && sd.at(j).timestamp().isValid()) {
@ -149,16 +148,16 @@ Track::Track(const TrackData &data) : _pause(0)
dt = sd.at(j-1).timestamp().msecsTo(
sd.at(j).timestamp()) / 1000.0;
else {
qWarning("%s: %s: time skew detected", qPrintable(
_data.name()), qPrintable(sd.at(j).timestamp().toString(
Qt::ISODate)));
qWarning("%s: %s: time skew detected",
qUtf8Printable(_data.name()),
qUtf8Printable(sd.at(j).timestamp().toString(Qt::ISODate)));
dt = 0;
}
} else {
dt = NAN;
if (hasTime) {
qWarning("%s: missing timestamp(s), time graphs disabled",
qPrintable(_data.name()));
qUtf8Printable(_data.name()));
hasTime = false;
for (int i = 0; i < seg.time.size(); i++)
seg.time[i] = NAN;

View File

@ -2,13 +2,6 @@
#include "map/gcs.h"
#include "twonavparser.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
#define SKIP_EMPTY QString::SkipEmptyParts
#else // Qt 5.14
#define SKIP_EMPTY Qt::SkipEmptyParts
#endif
static double lon(const QString &str)
{
QStringList l(str.split(QChar(0xBA)));
@ -123,7 +116,8 @@ bool TwoNavParser::parse(QFile *file, QList<TrackData> &tracks,
}}
break;
case 'T':
{QStringList list(codec.toString(line).split(' ', SKIP_EMPTY));
{QStringList list(codec.toString(line).split(' ',
Qt::SkipEmptyParts));
if (list.size() < 4) {
_errorString = "Parse error";
return false;
@ -159,7 +153,8 @@ bool TwoNavParser::parse(QFile *file, QList<TrackData> &tracks,
tracks.last().last().append(t);}
break;
case 'W':
{QStringList list(codec.toString(line).split(' ', SKIP_EMPTY));
{QStringList list(codec.toString(line).split(' ',
Qt::SkipEmptyParts));
if (list.size() < 5) {
_errorString = "Parse error";
return false;

View File

@ -37,7 +37,7 @@ void Waypoint::loadSymbolIcons(const QString &dir)
QPixmap pm(files.at(i).absoluteFilePath());
if (pm.isNull())
qWarning("%s: error loading image",
qPrintable(files.at(i).absoluteFilePath()));
qUtf8Printable(files.at(i).absoluteFilePath()));
else
_symbolIcons.insert(files.at(i).baseName(), pm);
}

View File

@ -6,31 +6,23 @@ bool AtlasData::pointCb(MapEntry *map, void *context)
{
PointCTX *ctx = (PointCTX*)context;
start:
map->lock.lock();
ctx->cacheLock.lock();
MapData *cached = ctx->cache.object(map->path);
if (!cached) {
ctx->cacheLock.unlock();
if (map->lock.tryLock()) {
MapData *data = new MapData(map->path);
data->points(ctx->rect, ctx->points);
MapData *data = new MapData(map->path);
data->points(ctx->rect, ctx->points);
ctx->cacheLock.lock();
ctx->cache.insert(map->path, data);
map->lock.unlock();
} else {
map->lock.lock();
map->lock.unlock();
goto start;
}
ctx->cacheLock.lock();
ctx->cache.insert(map->path, data);
} else
cached->points(ctx->rect, ctx->points);
ctx->cacheLock.unlock();
map->lock.unlock();
return true;
}
@ -39,34 +31,26 @@ bool AtlasData::polyCb(MapEntry *map, void *context)
{
PolyCTX *ctx = (PolyCTX*)context;
start:
map->lock.lock();
ctx->cacheLock.lock();
MapData *cached = ctx->cache.object(map->path);
if (!cached) {
ctx->cacheLock.unlock();
if (map->lock.tryLock()) {
MapData *data = new MapData(map->path);
data->polygons(ctx->rect, ctx->polygons);
data->lines(ctx->rect, ctx->lines);
MapData *data = new MapData(map->path);
data->polygons(ctx->rect, ctx->polygons);
data->lines(ctx->rect, ctx->lines);
ctx->cacheLock.lock();
ctx->cache.insert(map->path, data);
map->lock.unlock();
} else {
map->lock.lock();
map->lock.unlock();
goto start;
}
ctx->cacheLock.lock();
ctx->cache.insert(map->path, data);
} else {
cached->polygons(ctx->rect, ctx->polygons);
cached->lines(ctx->rect, ctx->lines);
}
ctx->cacheLock.unlock();
map->lock.unlock();
return true;
}

View File

@ -6,6 +6,7 @@
#define CATDIS 21
#define CATHAF 30
#define CATLMK 35
#define CATLIT 37
#define CATMFA 38
#define CATMOR 40
#define CATTRK 54
@ -16,16 +17,21 @@
#define CATWAT 69
#define CATWED 70
#define CATWRK 71
#define COLOUR 75
#define COMCHA 77
#define CURVEL 84
#define DRVAL1 87
#define ELEVAT 90
#define FUNCTN 94
#define LITVIS 108
#define OBJNAM 116
#define ORIENT 117
#define RESTRN 131
#define SECTR1 136
#define SECTR2 137
#define TRAFIC 172
#define VALDCO 174
#define VALNMR 178
#define VERCLR 181
#define WATLEV 187

View File

@ -63,16 +63,17 @@ static QMap<uint,uint> orderMapInit()
map.insert(TYPE(PILPNT), 34);
map.insert(TYPE(ACHBRT), 35);
map.insert(TYPE(I_ACHBRT), 35);
map.insert(TYPE(CRANES), 36);
map.insert(TYPE(I_CRANES), 36);
map.insert(TYPE(I_WTWGAG), 37);
map.insert(TYPE(PYLONS), 38);
map.insert(TYPE(SLCONS), 39);
map.insert(TYPE(LNDMRK), 40);
map.insert(TYPE(SILTNK), 41);
map.insert(TYPE(LNDELV), 42);
map.insert(TYPE(SMCFAC), 43);
map.insert(TYPE(BUISGL), 44);
map.insert(TYPE(RADRFL), 36);
map.insert(TYPE(CRANES), 37);
map.insert(TYPE(I_CRANES), 37);
map.insert(TYPE(I_WTWGAG), 38);
map.insert(TYPE(PYLONS), 39);
map.insert(TYPE(SLCONS), 40);
map.insert(TYPE(LNDMRK), 41);
map.insert(TYPE(SILTNK), 42);
map.insert(TYPE(LNDELV), 43);
map.insert(TYPE(SMCFAC), 44);
map.insert(TYPE(BUISGL), 45);
map.insert(TYPE(I_DISMAR), 0xFFFFFFFE);
map.insert(TYPE(SOUNDG), 0xFFFFFFFF);
@ -169,6 +170,48 @@ static bool polygonCb(const MapData::Poly *polygon, void *context)
return true;
}
static bool polygonPointCb(const MapData::Poly *polygon, void *context)
{
QList<MapData::Point> *points = (QList<MapData::Point>*)context;
uint type = polygon->type();
uint baseType = type>>16;
if (baseType == TSSLPT || baseType == RCTLPT || baseType == I_TRNBSN
|| baseType == BRIDGE || baseType == I_BRIDGE || baseType == BUAARE
|| baseType == LNDARE || baseType == LNDRGN
|| type == SUBTYPE(ACHARE, 2) || type == SUBTYPE(I_ACHARE, 2)
|| type == SUBTYPE(ACHARE, 3) || type == SUBTYPE(I_ACHARE, 3)
|| type == SUBTYPE(ACHARE, 9) || type == SUBTYPE(I_ACHARE, 9)
|| type == SUBTYPE(I_BERTHS, 6)
|| type == SUBTYPE(RESARE, 1) || type == SUBTYPE(I_RESARE, 1)
|| type == SUBTYPE(RESARE, 2) || type == SUBTYPE(I_RESARE, 2)
|| type == SUBTYPE(RESARE, 4) || type == SUBTYPE(I_RESARE, 4)
|| type == SUBTYPE(RESARE, 5) || type == SUBTYPE(I_RESARE, 5)
|| type == SUBTYPE(RESARE, 6) || type == SUBTYPE(I_RESARE, 6)
|| type == SUBTYPE(RESARE, 7) || type == SUBTYPE(I_RESARE, 7)
|| type == SUBTYPE(RESARE, 9) || type == SUBTYPE(I_RESARE, 9)
|| type == SUBTYPE(RESARE, 12) || type == SUBTYPE(I_RESARE, 12)
|| type == SUBTYPE(RESARE, 17) || type == SUBTYPE(I_RESARE, 17)
|| type == SUBTYPE(RESARE, 22) || type == SUBTYPE(I_RESARE, 22)
|| type == SUBTYPE(RESARE, 23) || type == SUBTYPE(I_RESARE, 23))
points->append(MapData::Point(baseType, polygon->bounds().center(),
polygon->attributes(), polygon->HUNI(), true));
return true;
}
static bool linePointCb(const MapData::Line *line, void *context)
{
QList<MapData::Point> *points = (QList<MapData::Point>*)context;
uint baseType = line->type()>>16;
if (baseType == RDOCAL || baseType == I_RDOCAL)
points->append(MapData::Point(baseType, line->bounds().center(),
line->attributes(), 1));
return true;
}
static Coordinates coordinates(int x, int y, uint COMF)
{
return Coordinates(x / (double)COMF, y / (double)COMF);
@ -186,10 +229,8 @@ static Coordinates point(const ISO8211::Record &r, uint COMF)
return coordinates(x, y, COMF);
}
static uint depthLevel(const QByteArray &ba)
static uint depthLevel(double minDepth)
{
double minDepth = ba.isEmpty() ? -1 : ba.toDouble();
if (minDepth < 0)
return 0;
else if (minDepth < 2)
@ -254,64 +295,171 @@ static QString weed(uint type)
}
}
MapData::Point::Point(uint type, const Coordinates &c, const QString &label,
const QVector<QByteArray> &params) : _type(type), _pos(c), _label(label)
static uint restrictionCategory(uint type, const MapData::Attributes &attr)
{
_id = ((quint64)order(type))<<32 | (uint)qHash(c);
uint catrea = attr.value(CATREA).toUInt();
if (type>>16 == I_DISMAR && params.size()) {
_label = hUnits((type>>8)&0xFF) + " " + QString::fromLatin1(params.at(0));
_type = SUBTYPE(I_DISMAR, type & 0xFF);
} else if ((type>>16 == I_RDOCAL || type>>16 == RDOCAL) && params.size() > 1) {
if (!params.at(1).isEmpty())
_label = QString("VHF ") + QString::fromLatin1(params.at(1));
_param = QVariant(params.at(0).toDouble());
} else if (type>>16 == CURENT && params.size() > 1) {
if (!params.at(1).isEmpty())
_label = QString::fromLatin1(params.at(1))
+ QString::fromUtf8("\xE2\x80\x89kt");
_param = QVariant(params.at(0).toDouble());
} else if (type>>16 == I_SISTAT || type>>16 == SISTAT) {
if (_label.isEmpty())
_label = sistat(type & 0xFF);
_type = TYPE(SISTAT);
} else if (type>>16 == WEDKLP) {
if (_label.isEmpty())
_label = weed(type & 0xFF);
} else if (type>>16 == LNDELV && params.size()) {
if (_label.isEmpty())
_label = QString::fromLatin1(params.at(0))
+ QString::fromUtf8("\xE2\x80\x89m");
if (!catrea) {
uint restrn = attr.value(
(type == RESARE) ? RESTRN : I_RESTRN).toUInt();
if (restrn == 1)
return 2;
else if (restrn == 7)
return 17;
else
_label += "\n(" + QString::fromLatin1(params.at(0))
+ "\xE2\x80\x89m)";
}
return 0;
} else
return catrea;
}
MapData::Poly::Poly(uint type, const Polygon &path, const QString &label,
const QVector<QByteArray> &params, uint HUNI) : _type(type), _path(path)
MapData::Point::Point(uint type, const Coordinates &c, const QString &label)
: _type(SUBTYPE(type, 0)), _pos(c), _label(label), _polygon(false)
{
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();
_id = ((quint64)order(_type))<<32 | (uint)qHash(c);
}
MapData::Point::Point(uint type, const Coordinates &c, const Attributes &attr,
uint HUNI, bool polygon) : _pos(c), _attr(attr), _polygon(polygon)
{
uint subtype = 0;
if (type == HRBFAC)
subtype = CATHAF;
else if (type == I_HRBFAC)
subtype = I_CATHAF;
else if (type == LNDMRK)
subtype = CATLMK;
else if (type == WRECKS)
subtype = CATWRK;
else if (type == MORFAC)
subtype = CATMOR;
else if (type == UWTROC)
subtype = WATLEV;
else if (type == BUAARE)
subtype = CATBUA;
else if (type == SMCFAC)
subtype = CATSCF;
else if (type == BUISGL)
subtype = FUNCTN;
else if (type == WATTUR)
subtype = CATWAT;
else if (type == RDOCAL)
subtype = TRAFIC;
else if (type == I_RDOCAL)
subtype = TRAFIC;
else if (type == SILTNK)
subtype = CATSIL;
else if (type == WEDKLP)
subtype = CATWED;
else if (type == LIGHTS)
subtype = CATLIT;
else if (type == I_DISMAR)
subtype = CATDIS;
else if (type == I_BERTHS)
subtype = I_CATBRT;
else if (type == ACHARE)
subtype = CATACH;
else if (type == I_ACHARE)
subtype = I_CATACH;
QList<QByteArray> list(_attr.value(subtype).split(','));
std::sort(list.begin(), list.end());
_type = (type == RESARE || type == I_RESARE)
? SUBTYPE(type, restrictionCategory(type, _attr))
: SUBTYPE(type, list.first().toUInt());
_id = ((quint64)order(_type))<<32 | (uint)qHash(c);
_label = QString::fromLatin1(_attr.value(OBJNAM));
if (type == I_DISMAR) {
if (_attr.contains(I_WTWDIS) && _attr.contains(I_HUNITS))
_label = hUnits(_attr.value(I_HUNITS).toUInt()) + " "
+ QString::fromLatin1(_attr.value(I_WTWDIS));
} else if (type == I_RDOCAL || type == RDOCAL) {
QByteArray cc(_attr.value(COMCHA));
if (!cc.isEmpty())
_label = QString("VHF ") + QString::fromLatin1(cc);
} else if (type == CURENT) {
QByteArray cv(_attr.value(CURVEL));
if (!cv.isEmpty())
_label = QString::fromLatin1(cv) + QString::fromUtf8("\xE2\x80\x89kt");
} else if (type == SISTAT) {
if (_label.isEmpty() && _attr.contains(CATSIT))
_label = sistat(_attr.value(CATSIT).toUInt());
} else if (type == I_SISTAT) {
if (_label.isEmpty() && _attr.contains(I_CATSIT))
_label = sistat(_attr.value(I_CATSIT).toUInt());
} else if (type == WEDKLP) {
if (_label.isEmpty())
_label = weed(_type & 0xFF);
} else if (type == LNDELV) {
if (_label.isEmpty())
_label = QString::fromLatin1(_attr.value(ELEVAT))
+ QString::fromUtf8("\xE2\x80\x89m");
else
_label += "\n(" + QString::fromLatin1(_attr.value(ELEVAT))
+ "\xE2\x80\x89m)";
} else if (type == BRIDGE || type == I_BRIDGE) {
double clr = _attr.value(VERCLR).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::Poly::Poly(uint type, const Polygon &path, const Attributes &attr,
uint HUNI) : _path(path), _attr(attr), _HUNI(HUNI)
{
uint subtype = 0;
if (type == ACHARE)
subtype = CATACH;
else if (type == I_ACHARE)
subtype = I_CATACH;
else if (type == HRBFAC)
subtype = CATHAF;
else if (type == MARKUL)
subtype = CATMFA;
else if (type == I_BERTHS)
subtype = I_CATBRT;
switch (type) {
case DEPARE:
_type = SUBTYPE(type, depthLevel(_attr.value(DRVAL1).toDouble()));
break;
case RESARE:
case I_RESARE:
_type = SUBTYPE(type, restrictionCategory(type, attr));
break;
default:
_type = SUBTYPE(type, _attr.value(subtype).toUInt());
}
}
MapData::Line::Line(uint type, const QVector<Coordinates> &path,
const QString &label, const QVector<QByteArray> &params)
: _type(type), _path(path), _label(label)
const Attributes &attr) : _path(path), _attr(attr)
{
if ((type == TYPE(DEPCNT) || type == TYPE(LNDELV)) && params.size())
_label = QString::fromLatin1(params.at(0));
uint subtype = 0;
if (type == RECTRC)
subtype = CATTRK;
else if (type == RCRTCL)
subtype = CATTRK;
else if (type == RDOCAL)
subtype = TRAFIC;
else if (type == I_RDOCAL)
subtype = TRAFIC;
_type = SUBTYPE(type, _attr.value(subtype).toUInt());
if (type == DEPCNT)
_label = QString::fromLatin1(_attr.value(VALDCO));
else if (type == LNDELV)
_label = QString::fromLatin1(_attr.value(ELEVAT));
else
_label = QString::fromLatin1(_attr.value(OBJNAM));
}
RectC MapData::Line::bounds() const
@ -552,166 +700,46 @@ Polygon MapData::polyGeometry(const ISO8211::Record &r, const RecordMap &vc,
return path;
}
MapData::Attr MapData::pointAttr(const ISO8211::Record &r, uint OBJL)
MapData::Attributes MapData::attributes(const ISO8211::Record &r)
{
QString label;
QVector<QByteArray> params(2);
uint subtype = 0;
Attributes attr;
const ISO8211::Field *ATTF = ISO8211::field(r, "ATTF");
if (!(ATTF && ATTF->data().at(0).size() == 2))
return Attr();
return attr;
for (int i = 0; i < ATTF->data().size(); i++) {
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 == HRBFAC && key == CATHAF)
|| (OBJL == I_HRBFAC && key == I_CATHAF)
|| (OBJL == LNDMRK && key == CATLMK)
|| (OBJL == WRECKS && key == CATWRK)
|| (OBJL == MORFAC && key == CATMOR)
|| (OBJL == UWTROC && key == WATLEV)
|| (OBJL == BUAARE && key == CATBUA)
|| (OBJL == SMCFAC && key == CATSCF)
|| (OBJL == BUISGL && key == FUNCTN)
|| (OBJL == WATTUR && key == CATWAT)
|| (OBJL == SISTAT && key == CATSIT)
|| (OBJL == I_SISTAT && key == I_CATSIT)
|| (OBJL == RDOCAL && key == TRAFIC)
|| (OBJL == I_RDOCAL && key == TRAFIC)
|| (OBJL == SILTNK && key == CATSIL)
|| (OBJL == WEDKLP && key == CATWED))
subtype = av.at(1).toByteArray().toUInt();
else if (OBJL == I_DISMAR && key == CATDIS)
subtype |= av.at(1).toByteArray().toUInt();
else if (OBJL == I_DISMAR && key == I_HUNITS)
subtype |= av.at(1).toByteArray().toUInt() << 8;
if ((OBJL == I_DISMAR && key == I_WTWDIS)
|| (OBJL == RDOCAL && key == ORIENT)
|| (OBJL == I_RDOCAL && key == ORIENT)
|| (OBJL == CURENT && key == ORIENT)
|| (OBJL == LNDELV && key == ELEVAT))
params[0] = av.at(1).toByteArray();
if ((OBJL == I_RDOCAL && key == COMCHA)
|| (OBJL == RDOCAL && key == COMCHA)
|| (OBJL == CURENT && key == CURVEL))
params[1] = av.at(1).toByteArray();
attr.insert(av.at(0).toUInt(), av.at(1).toByteArray());
}
return Attr(subtype, label, params);
}
MapData::Attr MapData::lineAttr(const ISO8211::Record &r, uint OBJL)
{
QString label;
QVector<QByteArray> params(1);
uint subtype = 0;
const ISO8211::Field *ATTF = ISO8211::field(r, "ATTF");
if (!(ATTF && ATTF->data().at(0).size() == 2))
return Attr();
for (int i = 0; i < ATTF->data().size(); i++) {
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 == RECTRC || OBJL == RCRTCL) && key == CATTRK)
subtype = av.at(1).toByteArray().toUInt();
if ((OBJL == DEPCNT && key == VALDCO)
|| (OBJL == LNDELV && key == ELEVAT))
params[0] = av.at(1).toByteArray();
}
return Attr(subtype, label, params);
}
MapData::Attr MapData::polyAttr(const ISO8211::Record &r, uint OBJL)
{
QString label;
QVector<QByteArray> params(1);
uint subtype = 0;
const ISO8211::Field *ATTF = ISO8211::field(r, "ATTF");
if (!(ATTF && ATTF->data().at(0).size() == 2))
return Attr();
for (int i = 0; i < ATTF->data().size(); i++) {
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)
|| (OBJL == I_ACHARE && key == I_CATACH)
|| (OBJL == HRBFAC && key == CATHAF)
|| (OBJL == MARKUL && key == CATMFA)
|| (OBJL == I_BERTHS && key == I_CATBRT))
subtype = av.at(1).toByteArray().toUInt();
else if ((OBJL == RESARE && key == RESTRN)
|| (OBJL == I_RESARE && key == I_RESTRN)) {
if (av.at(1).toByteArray().toUInt() == 1)
subtype = 2;
if (av.at(1).toByteArray().toUInt() == 7)
subtype = 17;
}
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);
return attr;
}
MapData::Point *MapData::pointObject(const Sounding &s)
{
return new Point(TYPE(SOUNDG), s.c, QString::number(s.depth),
QVector<QByteArray>());
return new Point(SOUNDG, s.c, QString::number(s.depth));
}
MapData::Point *MapData::pointObject(const ISO8211::Record &r,
const RecordMap &vi, const RecordMap &vc, uint COMF, uint OBJL)
const RecordMap &vi, const RecordMap &vc, uint COMF, uint OBJL, uint HUNI)
{
Coordinates c(pointGeometry(r, vi, vc, COMF));
Attr attr(pointAttr(r, OBJL));
return (c.isNull() ? 0 : new Point(SUBTYPE(OBJL,attr.subtype()), c,
attr.label(), attr.params()));
return (c.isNull() ? 0 : new Point(OBJL, c, attributes(r), HUNI));
}
MapData::Line *MapData::lineObject(const ISO8211::Record &r,
const RecordMap &vc, const RecordMap &ve, uint COMF, uint OBJL)
{
QVector<Coordinates> path(lineGeometry(r, vc, ve, COMF));
Attr attr(lineAttr(r, OBJL));
return (path.isEmpty() ? 0 : new Line(SUBTYPE(OBJL, attr.subtype()), path,
attr.label(), attr.params()));
return (path.isEmpty() ? 0 : new Line(OBJL, path, attributes(r)));
}
MapData::Poly *MapData::polyObject(const ISO8211::Record &r,
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.label(), attr.params(), HUNI));
return (path.isEmpty() ? 0 : new Poly(OBJL, path, attributes(r), HUNI));
}
bool MapData::processRecord(const ISO8211::Record &record,
@ -796,7 +824,7 @@ MapData::MapData(const QString &path)
_points.Insert(min, max, point);
}
} else {
if ((point = pointObject(r, vi, vc, COMF, OBJL))) {
if ((point = pointObject(r, vi, vc, COMF, OBJL, HUNI))) {
pointBounds(point->pos(), min, max);
_points.Insert(min, max, point);
} else
@ -842,6 +870,8 @@ void MapData::points(const RectC &rect, QList<Point> *points) const
rectcBounds(rect, min, max);
_points.Search(min, max, pointCb, points);
_areas.Search(min, max, polygonPointCb, points);
_lines.Search(min, max, linePointCb, points);
}
void MapData::lines(const RectC &rect, QList<Line> *lines) const

View File

@ -11,49 +11,53 @@ namespace ENC {
class MapData
{
public:
typedef QMap<uint, QByteArray> Attributes;
class Poly {
public:
Poly(uint type, const Polygon &path, const QString &label,
const QVector<QByteArray> &params, uint HUNI);
Poly(uint type, const Polygon &path, const Attributes &attr, 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 &param() const {return _param;}
const Attributes &attributes() const {return _attr;}
uint HUNI() const {return _HUNI;}
private:
uint _type;
Polygon _path;
QString _label;
QVariant _param;
Attributes _attr;
uint _HUNI;
};
class Line {
public:
Line(uint type, const QVector<Coordinates> &path, const QString &label,
const QVector<QByteArray> &params);
Line(uint type, const QVector<Coordinates> &path, const Attributes &attr);
RectC bounds() const;
const QVector<Coordinates> &path() const {return _path;}
uint type() const {return _type;}
const QString &label() const {return _label;}
const Attributes &attributes() const {return _attr;}
private:
uint _type;
QVector<Coordinates> _path;
QString _label;
Attributes _attr;
};
class Point {
public:
Point(uint type, const Coordinates &c, const QString &label,
const QVector<QByteArray> &params);
Point(uint type, const Coordinates &c, const Attributes &attr,
uint HUNI, bool polygon = false);
Point(uint type, const Coordinates &s, const QString &label);
const Coordinates &pos() const {return _pos;}
uint type() const {return _type;}
const QString &label() const {return _label;}
const QVariant &param() const {return _param;}
const Attributes &attributes() const {return _attr;}
bool polygon() const {return _polygon;}
bool operator<(const Point &other) const
{return _id < other._id;}
@ -63,7 +67,8 @@ public:
Coordinates _pos;
QString _label;
quint64 _id;
QVariant _param;
Attributes _attr;
bool _polygon;
};
MapData(const QString &path);
@ -74,23 +79,6 @@ public:
void points(const RectC &rect, QList<Point> *points) const;
private:
class Attr {
public:
Attr() : _subtype(0) {}
Attr(uint subtype, const QString &label,
const QVector<QByteArray> &params)
: _subtype(subtype), _label(label), _params(params) {}
unsigned subtype() const {return _subtype;}
const QString &label() const {return _label;}
const QVector<QByteArray> &params() const {return _params;}
private:
unsigned _subtype;
QString _label;
QVector<QByteArray> _params;
};
struct Sounding {
Sounding() : depth(NAN) {}
Sounding(const Coordinates &c, double depth) : c(c), depth(depth) {}
@ -115,12 +103,10 @@ private:
const RecordMap &vc, const RecordMap &ve, uint COMF);
static Polygon polyGeometry(const ISO8211::Record &r, const RecordMap &vc,
const RecordMap &ve, uint COMF);
static Attr pointAttr(const ISO8211::Record &r, uint OBJL);
static Attr lineAttr(const ISO8211::Record &r, uint OBJL);
static Attr polyAttr(const ISO8211::Record &r, uint OBJL);
static Attributes attributes(const ISO8211::Record &r);
static Point *pointObject(const Sounding &s);
static Point *pointObject(const ISO8211::Record &r, const RecordMap &vi,
const RecordMap &vc, uint COMF, uint OBJL);
const RecordMap &vc, uint COMF, uint OBJL, uint HUNI);
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,

View File

@ -51,6 +51,7 @@
#define LAKARE 69
#define LNDARE 71
#define LNDELV 72
#define LNDRGN 73
#define LNDMRK 74
#define LIGHTS 75
#define LOKBSN 79
@ -67,6 +68,7 @@
#define PONTON 95
#define PRCARE 96
#define PYLONS 98
#define RADRFL 101
#define RADSTA 102
#define RTPBCN 103
#define RDOCAL 104
@ -74,6 +76,7 @@
#define RAILWY 106
#define RCRTCL 108
#define RECTRC 109
#define RCTLPT 110
#define RSCSTA 111
#define RESARE 112
#define RIVERS 114

View File

@ -5,6 +5,7 @@
#include "map/textpointitem.h"
#include "map/rectd.h"
#include "objects.h"
#include "attributes.h"
#include "style.h"
#include "rastertile.h"
@ -12,8 +13,8 @@ using namespace ENC;
#define TEXT_EXTENT 160
#define TSSLPT_SIZE 24
typedef QSet<Coordinates> PointSet;
#define RANGE_FACTOR 4
#define MAJOR_RANGE 10
static const float C1 = 0.866025f; /* sqrt(3)/2 */
static const QColor tsslptPen = QColor(0xeb, 0x49, 0xeb);
@ -40,31 +41,6 @@ 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;
@ -150,25 +126,34 @@ QPolygonF RasterTile::tsslptArrow(const QPointF &p, qreal angle) const
return polygon;
}
void RasterTile::drawArrows(QPainter *painter,
const QList<MapData::Poly> &polygons)
static void drawArrow(QPainter *painter, const QPolygonF &polygon, uint type)
{
for (int i = 0; i < polygons.size(); i++) {
const MapData::Poly &poly = polygons.at(i);
if (type>>16 == RCTLPT) {
painter->setPen(QPen(tsslptPen, 1, Qt::DashLine));
painter->setBrush(Qt::NoBrush);
} else {
painter->setPen(QPen(tsslptPen, 1));
painter->setBrush(QBrush(tsslptBrush));
}
painter->drawPolygon(polygon);
}
if (poly.type()>>16 == TSSLPT) {
QPolygonF polygon(tsslptArrow(centroid(poly.path().first()),
deg2rad(poly.param().toDouble())));
void RasterTile::drawArrows(QPainter *painter,
const QList<MapData::Point> &points) const
{
for (int i = 0; i < points.size(); i++) {
const MapData::Point &point = points.at(i);
painter->setPen(QPen(tsslptPen, 1));
painter->setBrush(QBrush(tsslptBrush));
painter->drawPolygon(polygon);
if (point.type()>>16 == TSSLPT || point.type()>>16 == RCTLPT) {
QPolygonF polygon(tsslptArrow(ll2xy(point.pos()),
deg2rad(point.attributes().value(ORIENT).toDouble())));
drawArrow(painter, polygon, point.type());
}
}
}
void RasterTile::drawPolygons(QPainter *painter,
const QList<MapData::Poly> &polygons)
const QList<MapData::Poly> &polygons) const
{
for (int n = 0; n < _style->drawOrder().size(); n++) {
for (int i = 0; i < polygons.size(); i++) {
@ -200,7 +185,7 @@ void RasterTile::drawPolygons(QPainter *painter,
}
}
void RasterTile::drawLines(QPainter *painter, const QList<MapData::Line> &lines)
void RasterTile::drawLines(QPainter *painter, const QList<MapData::Line> &lines) const
{
painter->setBrush(Qt::NoBrush);
@ -218,56 +203,67 @@ void RasterTile::drawLines(QPainter *painter, const QList<MapData::Line> &lines)
}
void RasterTile::drawTextItems(QPainter *painter,
const QList<TextItem*> &textItems)
const QList<TextItem*> &textItems) const
{
for (int i = 0; i < textItems.size(); i++)
textItems.at(i)->paint(painter);
QRectF rect(_rect);
for (int i = 0; i < textItems.size(); i++) {
const TextItem *ti = textItems.at(i);
if (rect.intersects(ti->boundingRect()))
ti->paint(painter);
}
}
void RasterTile::processPolygons(const QList<MapData::Poly> &polygons,
QList<TextItem*> &textItems)
static QRectF lightRect(const QPointF &pos, double range)
{
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);
double r = qMin(range * RANGE_FACTOR, (double)TEXT_EXTENT);
return QRect(pos.x() - r, pos.y() - r, 2 * r, 2 * r);
}
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();
void RasterTile::drawSectorLights(QPainter *painter,
const QList<SectorLight> &lights) const
{
for (int i = 0; i < lights.size(); i++) {
const SectorLight &l = lights.at(i);
QPointF pos(ll2xy(l.pos));
QRectF rect(lightRect(pos, (l.range == 0) ? 6 : l.range));
double a1 = -(l.end + 90);
double a2 = -(l.start + 90);
if (a1 > a2)
a2 += 360;
double as = (a2 - a1);
if (as == 0)
as = 360;
if (l.visibility == 3 || l.visibility >= 6)
painter->setPen(QPen(Qt::black, 1, Qt::DashLine));
else {
painter->setPen(QPen(Qt::black, 6, Qt::SolidLine, Qt::FlatCap));
painter->drawArc(rect, a1 * 16, as * 16);
painter->setPen(QPen(Style::color(l.color), 4, Qt::SolidLine,
Qt::FlatCap));
}
if ((!label || !fnt) && !img)
continue;
painter->drawArc(rect, a1 * 16, as * 16);
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;
if (a2 - a1 != 0) {
QLineF ln(pos, QPointF(pos.x() + rect.width(), pos.y()));
ln.setAngle(a1);
painter->setPen(QPen(Qt::black, 1, Qt::DashLine));
painter->drawLine(ln);
ln.setAngle(a2);
painter->drawLine(ln);
}
}
}
void RasterTile::processPoints(QList<MapData::Point> &points,
QList<TextItem*> &textItems, QList<TextItem*> &lights)
QList<TextItem*> &textItems, QList<TextItem*> &lights,
QList<SectorLight> &sectorLights)
{
PointSet lightsSet, signalsSet;
LightMap lightsMap;
SignalSet signalsSet;
QSet<Coordinates> slMap;
int i;
std::sort(points.begin(), points.end());
@ -275,9 +271,21 @@ void RasterTile::processPoints(QList<MapData::Point> &points,
/* Lights & Signals */
for (i = 0; i < points.size(); i++) {
const MapData::Point &point = points.at(i);
if (point.type()>>16 == LIGHTS)
lightsSet.insert(point.pos());
else if (point.type()>>16 == FOGSIG)
if (point.type()>>16 == LIGHTS) {
const MapData::Attributes &attr = point.attributes();
Style::Color color = (Style::Color)(attr.value(COLOUR).toUInt());
double range = attr.value(VALNMR).toDouble();
if (attr.contains(SECTR1)
|| (range >= MAJOR_RANGE && !(point.type() & 0xFFFF))) {
sectorLights.append(SectorLight(point.pos(), color,
attr.value(LITVIS).toUInt(), range,
attr.value(SECTR1).toDouble(), attr.value(SECTR2).toDouble()));
slMap.insert(point.pos());
} else
lightsMap.insert(point.pos(), color);
} else if (point.type()>>16 == FOGSIG)
signalsSet.insert(point.pos());
else
break;
@ -296,7 +304,7 @@ void RasterTile::processPoints(QList<MapData::Point> &points,
const QColor *color = &style.textColor();
const QColor *hColor = style.haloColor().isValid()
? &style.haloColor() : 0;
double rotate = angle(point.type(), point.param());
double rotate = angle(point.type(), point.attributes().value(ORIENT));
if ((!label || !fnt) && !img)
continue;
@ -305,11 +313,12 @@ void RasterTile::processPoints(QList<MapData::Point> &points,
TextPointItem *item = new TextPointItem(pos + offset, label, fnt, img,
color, hColor, 0, 2, rotate);
if (item->isValid() && !item->collides(textItems)) {
if (item->isValid() && (slMap.contains(point.pos())
|| (point.polygon() && img) || !item->collides(textItems))) {
textItems.append(item);
if (lightsSet.contains(point.pos()))
if (lightsMap.contains(point.pos()))
lights.append(new TextPointItem(pos + _style->lightOffset(),
0, 0, _style->light(), 0, 0, 0, 0));
0, 0, _style->light(lightsMap.value(point.pos())), 0, 0, 0, 0));
if (signalsSet.contains(point.pos()))
lights.append(new TextPointItem(pos + _style->signalOffset(),
0, 0, _style->signal(), 0, 0, 0, 0));
@ -377,14 +386,14 @@ void RasterTile::render()
QList<MapData::Poly> polygons;
QList<MapData::Point> points;
QList<TextItem*> textItems, lights;
QList<SectorLight> sectorLights;
img.setDevicePixelRatio(_ratio);
img.fill(Qt::transparent);
fetchData(polygons, lines, points);
processPoints(points, textItems, lights);
processPolygons(polygons, textItems);
processPoints(points, textItems, lights, sectorLights);
processLines(lines, textItems);
QPainter painter(&img);
@ -394,9 +403,11 @@ void RasterTile::render()
drawPolygons(&painter, polygons);
drawLines(&painter, lines);
drawArrows(&painter, polygons);
drawArrows(&painter, points);
drawTextItems(&painter, lights);
drawSectorLights(&painter, sectorLights);
drawTextItems(&painter, textItems);
qDeleteAll(textItems);

View File

@ -34,6 +34,23 @@ public:
void render();
private:
struct SectorLight
{
SectorLight(const Coordinates &pos, Style::Color color, uint visibility,
double range, double start, double end) : pos(pos), color(color),
visibility(visibility), range(range), start(start), end(end) {}
Coordinates pos;
Style::Color color;
uint visibility;
double range;
double start;
double end;
};
typedef QMap<Coordinates, Style::Color> LightMap;
typedef QSet<Coordinates> SignalSet;
void fetchData(QList<MapData::Poly> &polygons, QList<MapData::Line> &lines,
QList<MapData::Point> &points);
QPointF ll2xy(const Coordinates &c) const
@ -44,17 +61,15 @@ private:
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);
QList<TextItem*> &textItems, QList<TextItem *> &lights,
QList<SectorLight> &sectorLights);
void processLines(const QList<MapData::Line> &lines,
QList<TextItem*> &textItems);
void processPolygons(const QList<MapData::Poly> &polygons,
QList<TextItem*> &textItems);
void drawBitmapPath(QPainter *painter, const QImage &img,
const Polygon &polygon);
void drawArrows(QPainter *painter, const QList<MapData::Poly> &polygons);
void drawPolygons(QPainter *painter, const QList<MapData::Poly> &polygons);
void drawLines(QPainter *painter, const QList<MapData::Line> &lines);
void drawTextItems(QPainter *painter, const QList<TextItem*> &textItems);
void drawArrows(QPainter *painter, const QList<MapData::Point> &points) const;
void drawPolygons(QPainter *painter, const QList<MapData::Poly> &polygons) const;
void drawLines(QPainter *painter, const QList<MapData::Line> &lines) const;
void drawTextItems(QPainter *painter, const QList<TextItem*> &textItems) const;
void drawSectorLights(QPainter *painter, const QList<SectorLight> &lights) const;
static bool polyCb(MapData *data, void *context);
static bool pointCb(MapData *data, void *context);

View File

@ -70,19 +70,48 @@ void Style::polygonStyle()
_polygons[TYPE(DRGARE)] = Polygon(QBrush(QColor(0xa0, 0xa0, 0xff),
Qt::Dense4Pattern));
_polygons[TYPE(UNSARE)] = Polygon(QBrush(QColor(0x99, 0x99, 0x99)));
_polygons[SUBTYPE(RESARE, 1)] = Polygon(QImage(":/marine/safety-zone-line.png"));
_polygons[SUBTYPE(RESARE, 2)] = Polygon(QImage(":/marine/noanchor-line.png"));
_polygons[SUBTYPE(RESARE, 4)] = Polygon(QImage(":/marine/nature-reserve-line.png"));
_polygons[SUBTYPE(RESARE, 5)] = Polygon(QImage(":/marine/sanctuary-line.png"));
_polygons[SUBTYPE(RESARE, 6)] = Polygon(QImage(":/marine/sanctuary-line.png"));
_polygons[SUBTYPE(RESARE, 7)] = Polygon(QImage(":/marine/sanctuary-line.png"));
_polygons[SUBTYPE(RESARE, 9)] = Polygon(QBrush(QColor(0xff, 0x00, 0x00),
Qt::BDiagPattern));
_polygons[SUBTYPE(RESARE, 2)] = Polygon(QImage(":/marine/noanchor-line.png"));
_polygons[SUBTYPE(I_RESARE, 2)] = Polygon(QImage(":/marine/noanchor-line.png"));
_polygons[SUBTYPE(RESARE, 17)] = Polygon(
QImage(":/marine/entry-prohibited-line.png"));
_polygons[SUBTYPE(I_RESARE, 17)] = Polygon(
QImage(":/marine/entry-prohibited-line.png"));
_polygons[SUBTYPE(RESARE, 12)] = Polygon(QImage(":/marine/safety-zone-line.png"));
_polygons[SUBTYPE(I_RESARE, 12)] = Polygon(QImage(":/marine/safety-zone-line.png"));
_polygons[SUBTYPE(RESARE, 1)] = Polygon(QImage(":/marine/safety-zone-line.png"));
_polygons[SUBTYPE(RESARE, 17)] = Polygon(QImage(":/marine/entry-prohibited-line.png"));
_polygons[SUBTYPE(RESARE, 22)] = Polygon(QImage(":/marine/sanctuary-line.png"));
_polygons[SUBTYPE(RESARE, 23)] = Polygon(QImage(":/marine/nature-reserve-line.png"));
_polygons[SUBTYPE(I_RESARE, 1)] = _polygons[SUBTYPE(RESARE, 1)];
_polygons[SUBTYPE(I_RESARE, 2)] = _polygons[SUBTYPE(RESARE, 2)];
_polygons[SUBTYPE(I_RESARE, 4)] = _polygons[SUBTYPE(RESARE, 4)];
_polygons[SUBTYPE(I_RESARE, 9)] = _polygons[SUBTYPE(RESARE, 9)];
_polygons[SUBTYPE(I_RESARE, 12)] = _polygons[SUBTYPE(RESARE, 12)];
_polygons[SUBTYPE(I_RESARE, 17)] = _polygons[SUBTYPE(RESARE, 17)];
_polygons[SUBTYPE(I_RESARE, 22)] = _polygons[SUBTYPE(RESARE, 22)];
_polygons[SUBTYPE(I_RESARE, 23)] = _polygons[SUBTYPE(RESARE, 23)];
_polygons[SUBTYPE(ACHARE, 1)] = Polygon(QImage(":/marine/anchor-line.png"));
_polygons[SUBTYPE(I_ACHARE, 1)] = Polygon(QImage(":/marine/anchor-line.png"));
_polygons[SUBTYPE(ACHARE, 2)] = _polygons[SUBTYPE(ACHARE, 1)];
_polygons[SUBTYPE(ACHARE, 3)] = _polygons[SUBTYPE(ACHARE, 1)];
_polygons[SUBTYPE(ACHARE, 4)] = _polygons[SUBTYPE(ACHARE, 1)];
_polygons[SUBTYPE(ACHARE, 5)] = _polygons[SUBTYPE(ACHARE, 1)];
_polygons[SUBTYPE(ACHARE, 6)] = _polygons[SUBTYPE(ACHARE, 1)];
_polygons[SUBTYPE(ACHARE, 7)] = _polygons[SUBTYPE(ACHARE, 1)];
_polygons[SUBTYPE(ACHARE, 8)] = Polygon(Qt::NoBrush,
QPen(QColor(0xeb, 0x49, 0xeb), 1, Qt::DashLine));
_polygons[SUBTYPE(ACHARE, 9)] = _polygons[SUBTYPE(ACHARE, 1)];
_polygons[SUBTYPE(I_ACHARE, 1)] = _polygons[SUBTYPE(ACHARE, 1)];
_polygons[SUBTYPE(I_ACHARE, 2)] = _polygons[SUBTYPE(ACHARE, 2)];
_polygons[SUBTYPE(I_ACHARE, 3)] = _polygons[SUBTYPE(ACHARE, 3)];
_polygons[SUBTYPE(I_ACHARE, 4)] = _polygons[SUBTYPE(ACHARE, 4)];
_polygons[SUBTYPE(I_ACHARE, 5)] = _polygons[SUBTYPE(ACHARE, 5)];
_polygons[SUBTYPE(I_ACHARE, 6)] = _polygons[SUBTYPE(ACHARE, 6)];
_polygons[SUBTYPE(I_ACHARE, 7)] = _polygons[SUBTYPE(ACHARE, 7)];
_polygons[SUBTYPE(I_ACHARE, 8)] = _polygons[SUBTYPE(ACHARE, 8)];
_polygons[SUBTYPE(I_ACHARE, 9)] = _polygons[SUBTYPE(ACHARE, 9)];
_polygons[SUBTYPE(I_ACHARE, 10)] = _polygons[SUBTYPE(I_ACHARE, 1)];
_polygons[SUBTYPE(I_ACHARE, 11)] = _polygons[SUBTYPE(I_ACHARE, 1)];
_polygons[SUBTYPE(I_ACHARE, 12)] = _polygons[SUBTYPE(I_ACHARE, 1)];
_polygons[TYPE(PRCARE)] = Polygon(QBrush(QColor(0xeb, 0x49, 0xeb),
Qt::BDiagPattern));
_polygons[TYPE(DAMCON)] = Polygon(QBrush(QColor(0xd9, 0x8b, 0x21)),
@ -113,8 +142,12 @@ void Style::polygonStyle()
_polygons[TYPE(CBLARE)] = Polygon(QImage(":/marine/cable-area-line.png"));
_polygons[TYPE(PIPARE)] = Polygon(QImage(":/marine/pipeline-area-line.png"));
_polygons[SUBTYPE(MARKUL, 3)] = Polygon(QImage(":/marine/fishing-farm-line.png"));
_polygons[SUBTYPE(I_BERTHS, 6)] = Polygon(Qt::NoBrush,
QPen(QColor(0xeb, 0x49, 0xeb), 1, Qt::DashLine));
_polygons[TYPE(BERTHS)] = Polygon(Qt::NoBrush, QPen(QColor(0xeb, 0x49, 0xeb),
1, Qt::DashLine));
_polygons[TYPE(I_BERTHS)] = _polygons[TYPE(BERTHS)];
_polygons[SUBTYPE(I_BERTHS, 6)] = _polygons[TYPE(BERTHS)];
_polygons[TYPE(I_TRNBSN)] = Polygon(Qt::NoBrush, QPen(QColor(0xeb, 0x49, 0xeb),
1, Qt::DashLine));
_polygons[TYPE(CONZNE)] = Polygon(Qt::NoBrush, QPen(QColor(0xeb, 0x49, 0xeb),
1, Qt::DashDotLine));
@ -129,13 +162,25 @@ void Style::polygonStyle()
<< TYPE(I_TERMNL) << TYPE(SLCONS) << TYPE(I_SLCONS) << TYPE(PONTON)
<< TYPE(I_PONTON) << TYPE(HULKES) << TYPE(I_HULKES) << TYPE(FLODOC)
<< TYPE(I_FLODOC) << TYPE(DRYDOC) << TYPE(DAMCON) << TYPE(PYLONS)
<< TYPE(MORFAC) << TYPE(GATCON) << TYPE(I_GATCON) << SUBTYPE(I_BERTHS, 6)
<< TYPE(DMPGRD) << TYPE(TSEZNE) << TYPE(OBSTRN) << TYPE(UWTROC)
<< TYPE(DWRTPT) << SUBTYPE(ACHARE, 1) << SUBTYPE(I_ACHARE, 1)
<< SUBTYPE(RESARE, 9) << SUBTYPE(RESARE, 2) << SUBTYPE(I_RESARE, 2)
<< SUBTYPE(RESARE, 17) << SUBTYPE(I_RESARE, 17) << SUBTYPE(RESARE, 12)
<< SUBTYPE(I_RESARE, 12) << SUBTYPE(RESARE, 1) << TYPE(CBLARE)
<< TYPE(PIPARE) << TYPE(PRCARE) << SUBTYPE(MARKUL, 3) << TYPE(CONZNE);
<< TYPE(MORFAC) << TYPE(GATCON) << TYPE(I_GATCON) << TYPE(BERTHS)
<< TYPE(I_BERTHS) << SUBTYPE(I_BERTHS, 6) << TYPE(DMPGRD) << TYPE(TSEZNE)
<< TYPE(OBSTRN) << TYPE(UWTROC) << TYPE(DWRTPT) << SUBTYPE(ACHARE, 1)
<< SUBTYPE(ACHARE, 2) << SUBTYPE(ACHARE, 3) << SUBTYPE(ACHARE, 4)
<< SUBTYPE(ACHARE, 5) << SUBTYPE(ACHARE, 6) << SUBTYPE(ACHARE, 7)
<< SUBTYPE(ACHARE, 8) << SUBTYPE(ACHARE, 9) << SUBTYPE(I_ACHARE, 1)
<< SUBTYPE(I_ACHARE, 2) << SUBTYPE(I_ACHARE, 3) << SUBTYPE(I_ACHARE, 4)
<< SUBTYPE(I_ACHARE, 5) << SUBTYPE(I_ACHARE, 6) << SUBTYPE(I_ACHARE, 7)
<< SUBTYPE(I_ACHARE, 8) << SUBTYPE(I_ACHARE, 9) << SUBTYPE(I_ACHARE, 10)
<< SUBTYPE(I_ACHARE, 11) << SUBTYPE(I_ACHARE, 12) << SUBTYPE(RESARE, 1)
<< SUBTYPE(I_RESARE, 1) << SUBTYPE(RESARE, 2) << SUBTYPE(I_RESARE, 2)
<< SUBTYPE(RESARE, 4) << SUBTYPE(I_RESARE, 4) << SUBTYPE(RESARE, 5)
<< SUBTYPE(I_RESARE, 5) << SUBTYPE(RESARE, 6) << SUBTYPE(I_RESARE, 6)
<< SUBTYPE(RESARE, 7) << SUBTYPE(I_RESARE, 7) << SUBTYPE(RESARE, 9)
<< SUBTYPE(I_RESARE, 9) << SUBTYPE(RESARE, 12) << SUBTYPE(I_RESARE, 12)
<< SUBTYPE(RESARE, 17) << SUBTYPE(I_RESARE, 17) << SUBTYPE(RESARE, 22)
<< SUBTYPE(I_RESARE, 22) << SUBTYPE(RESARE, 23) << SUBTYPE(I_RESARE, 23)
<< SUBTYPE(RESARE, 1) << TYPE(CBLARE) << TYPE(PIPARE) << TYPE(PRCARE)
<< TYPE(I_TRNBSN) << SUBTYPE(MARKUL, 3) << TYPE(CONZNE);
}
void Style::lineStyle(qreal ratio)
@ -152,7 +197,7 @@ void Style::lineStyle(qreal ratio)
_lines[TYPE(CBLSUB)].setTextFontSize(Small);
_lines[TYPE(PIPSOL)] = Line(QImage(":/marine/pipeline.png"));
_lines[TYPE(PIPSOL)].setTextFontSize(Small);
_lines[TYPE(NAVLNE)] = Line(QPen(QColor(0xeb, 0x49, 0xeb), 1, Qt::DashLine));
_lines[TYPE(NAVLNE)] = Line(QPen(QColor(0, 0, 0), 1, Qt::DashLine));
_lines[TYPE(COALNE)] = Line(QPen(QColor(0, 0, 0), 1, Qt::SolidLine));
_lines[TYPE(SLCONS)] = Line(QPen(QColor(0, 0, 0), 2, Qt::SolidLine));
_lines[TYPE(I_SLCONS)] = Line(QPen(QColor(0, 0, 0), 2, Qt::SolidLine));
@ -191,6 +236,14 @@ void Style::lineStyle(qreal ratio)
_lines[TYPE(PIPOHD)] = Line(QImage(":/marine/pipeline-overhead.png"));
_lines[TYPE(I_PIPOHD)] = Line(QImage(":/marine/pipeline-overhead.png"));
_lines[TYPE(CANALS)] = Line(QPen(QColor(0x9f, 0xc4, 0xe1), 2));
_lines[SUBTYPE(RDOCAL, 1)] = Line(QPen(QColor(0xeb, 0x49, 0xeb), 1,
Qt::DashLine));
_lines[SUBTYPE(RDOCAL, 2)] = Line(QPen(QColor(0xeb, 0x49, 0xeb), 1,
Qt::DashLine));
_lines[SUBTYPE(RDOCAL, 3)] = Line(QPen(QColor(0xeb, 0x49, 0xeb), 1,
Qt::DashLine));
_lines[SUBTYPE(RDOCAL, 4)] = Line(QPen(QColor(0xeb, 0x49, 0xeb), 1,
Qt::DashLine));
}
void Style::pointStyle(qreal ratio)
@ -235,6 +288,7 @@ 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, 10)] = Point(QImage(":/marine/pylon.png"), Small);
_points[SUBTYPE(LNDMRK, 15)] = Point(QImage(":/marine/dome.png"), Small,
QPoint(0, -5));
_points[SUBTYPE(LNDMRK, 17)] = Point(QImage(":/marine/tower.png"), Small,
@ -270,7 +324,9 @@ void Style::pointStyle(qreal ratio)
_points[SUBTYPE(I_HRBFAC, 5)] = Point(QImage(":/marine/yacht-harbor.png"));
_points[SUBTYPE(I_HRBFAC, 9)] = Point(QImage(":/marine/shipyard.png"));
_points[TYPE(ACHBRT)] = Point(QImage(":/marine/anchorage.png"));
_points[TYPE(I_ACHBRT)] = Point(QImage(":/marine/anchorage.png"));
_points[TYPE(ACHBRT)].setTextColor(QColor(0xeb, 0x49, 0xeb));
_points[TYPE(ACHBRT)].setHaloColor(QColor());
_points[TYPE(I_ACHBRT)] = _points[TYPE(ACHBRT)];
_points[TYPE(OFSPLF)] = Point(QImage(":/marine/platform.png"));
_points[TYPE(PILPNT)] = Point(QImage(":/marine/pile.png"), Small);
_points[SUBTYPE(MORFAC, 1)] = Point(QImage(":/marine/pile.png"), Small);
@ -323,7 +379,6 @@ void Style::pointStyle(qreal ratio)
_points[SUBTYPE(I_RDOCAL, 3)].setTextColor(QColor(0xeb, 0x49, 0xeb));
_points[SUBTYPE(I_RDOCAL, 4)].setTextColor(QColor(0xeb, 0x49, 0xeb));
_points[TYPE(PYLONS)] = Point(QImage(":/marine/pylon.png"));
_points[SUBTYPE(I_BERTHS, 6)] = Point(QImage(":/marine/fleeting-area.png"));
_points[SUBTYPE(WATTUR, 1)] = Point(QImage(":/marine/breakers.png"));
_points[SUBTYPE(WATTUR, 2)] = Point(QImage(":/marine/eddies.png"));
_points[SUBTYPE(WATTUR, 3)] = Point(QImage(":/marine/overfalls.png"));
@ -335,6 +390,47 @@ void Style::pointStyle(qreal ratio)
_points[SUBTYPE(WEDKLP, 0)] = Point(QImage(":/marine/kelp.png"));
_points[SUBTYPE(WEDKLP, 1)] = Point(QImage(":/marine/kelp.png"));
_points[TYPE(SEAARE)].setHaloColor(QColor());
_points[TYPE(LNDARE)].setHaloColor(QColor());
_points[TYPE(LNDRGN)].setHaloColor(QColor());
_points[TYPE(RADRFL)] = Point(QImage(":/marine/radar-reflector.png"));
_points[SUBTYPE(I_BERTHS, 6)] = Point(QImage(":/marine/fleeting-area.png"),
Small);
_points[SUBTYPE(I_BERTHS, 6)].setTextColor(QColor(0xeb, 0x49, 0xeb));
_points[SUBTYPE(I_BERTHS, 6)].setHaloColor(QColor());
_points[SUBTYPE(ACHARE, 2)] = Point(QImage(":/marine/dw-anchorage.png"),
Small);
_points[SUBTYPE(ACHARE, 3)] = Point(QImage(":/marine/tanker-anchorage.png"),
Small);
_points[SUBTYPE(ACHARE, 9)] = Point(QImage(":/marine/24h-anchorage.png"),
Small);
_points[SUBTYPE(I_ACHARE, 2)] = _points[SUBTYPE(ACHARE, 2)];
_points[SUBTYPE(I_ACHARE, 3)] = _points[SUBTYPE(ACHARE, 3)];
_points[SUBTYPE(I_ACHARE, 9)] = _points[SUBTYPE(ACHARE, 9)];
_points[SUBTYPE(RESARE, 1)].setTextColor(QColor(0xeb, 0x49, 0xeb));
_points[SUBTYPE(RESARE, 1)].setHaloColor(QColor());
_points[SUBTYPE(RESARE, 2)] = _points[SUBTYPE(RESARE, 1)];
_points[SUBTYPE(RESARE, 4)].setTextColor(QColor(0x30, 0xa0, 0x1b));
_points[SUBTYPE(RESARE, 4)].setHaloColor(QColor());
_points[SUBTYPE(RESARE, 5)] = _points[SUBTYPE(RESARE, 4)];
_points[SUBTYPE(RESARE, 6)] = _points[SUBTYPE(RESARE, 4)];
_points[SUBTYPE(RESARE, 7)] = _points[SUBTYPE(RESARE, 4)];
_points[SUBTYPE(RESARE, 9)] = _points[SUBTYPE(RESARE, 1)];
_points[SUBTYPE(RESARE, 12)] = _points[SUBTYPE(RESARE, 1)];
_points[SUBTYPE(RESARE, 17)] = _points[SUBTYPE(RESARE, 1)];
_points[SUBTYPE(RESARE, 22)] = _points[SUBTYPE(RESARE, 4)];
_points[SUBTYPE(RESARE, 23)] = _points[SUBTYPE(RESARE, 4)];
_points[SUBTYPE(I_RESARE, 1)] = _points[SUBTYPE(RESARE, 1)];
_points[SUBTYPE(I_RESARE, 2)] = _points[SUBTYPE(RESARE, 2)];
_points[SUBTYPE(I_RESARE, 4)] = _points[SUBTYPE(RESARE, 4)];
_points[SUBTYPE(I_RESARE, 5)] = _points[SUBTYPE(RESARE, 5)];
_points[SUBTYPE(I_RESARE, 6)] = _points[SUBTYPE(RESARE, 6)];
_points[SUBTYPE(I_RESARE, 7)] = _points[SUBTYPE(RESARE, 7)];
_points[SUBTYPE(I_RESARE, 9)] = _points[SUBTYPE(RESARE, 9)];
_points[SUBTYPE(I_RESARE, 12)] = _points[SUBTYPE(RESARE, 12)];
_points[SUBTYPE(I_RESARE, 17)] = _points[SUBTYPE(RESARE, 17)];
_points[SUBTYPE(I_RESARE, 22)] = _points[SUBTYPE(RESARE, 22)];
_points[SUBTYPE(I_RESARE, 23)] = _points[SUBTYPE(RESARE, 23)];
_points[SUBTYPE(SMCFAC, 7)] = Point(svg2img(":/POI/restaurant-11.svg",
ratio), Small);
@ -383,6 +479,9 @@ void Style::pointStyle(qreal ratio)
Style::Style(qreal ratio)
{
_light = QImage(":/marine/light.png");
_lightRed = QImage(":/marine/light-red.png");
_lightGreen = QImage(":/marine/light-green.png");
_lightYellow = QImage(":/marine/light-yellow.png");
_lightOffset = QPoint(11, 11);
_signal = QImage(":/marine/fog-signal.png");
_signalOffset = QPoint(-9, 9);
@ -433,3 +532,37 @@ const QFont *Style::font(Style::FontSize size) const
return &_normal;
}
}
const QImage *Style::light(Color color) const
{
switch (color) {
case Red:
return &_lightRed;
case Green:
return &_lightGreen;
case White:
case Yellow:
case Amber:
case Orange:
return &_lightYellow;
default:
return &_light;
}
}
QColor Style::color(Style::Color c)
{
switch (c) {
case Red:
return Qt::red;
case Green:
return Qt::green;
case White:
case Yellow:
case Amber:
case Orange:
return Qt::yellow;
default:
return Qt::magenta;
}
}

View File

@ -89,6 +89,11 @@ public:
QPoint _offset;
};
enum Color {
Unknown, White, Black, Red, Green, Blue, Yellow, Gray,
Brown, Amber, Violet, Orange, Magenta, Pink
};
Style(qreal ratio);
const Line &line(uint type) const;
@ -97,11 +102,13 @@ public:
const QVector<uint> &drawOrder() const {return _drawOrder;}
const QFont *font(Style::FontSize size) const;
const QImage *light() const {return &_light;}
const QImage *light(Color color) const;
const QImage *signal() const {return &_signal;}
const QPoint &lightOffset() const {return _lightOffset;}
const QPoint &signalOffset() const {return _signalOffset;}
static QColor color(Color c);
private:
void polygonStyle();
void lineStyle(qreal ratio);
@ -114,7 +121,7 @@ private:
/* Fonts and images must be initialized after QGuiApplication! */
QFont _small, _normal, _large;
QImage _light, _signal;
QImage _light, _lightRed, _lightGreen, _lightYellow, _signal;
QPoint _lightOffset, _signalOffset;
};

View File

@ -146,7 +146,7 @@ int DEMFile::level(const Zoom &zoom) const
}
MapData::Elevation *DEMFile::elevations(Handle &hdl, int level,
const DEMTile *tile)
const DEMTile *tile) const
{
const Level &l = _levels.at(level);
MapData::Elevation *ele = new MapData::Elevation();

View File

@ -11,12 +11,13 @@ class DEMFile : public SubFile
{
public:
DEMFile(const IMGData *img) : SubFile(img) {}
DEMFile(const QString *path) : SubFile(path) {}
DEMFile(const QString &path) : SubFile(path) {}
DEMFile(const SubFile *gmp, quint32 offset) : SubFile(gmp, offset) {}
bool load(Handle &hdl);
void clear();
MapData::Elevation *elevations(Handle &hdl, int level, const DEMTile *tile);
MapData::Elevation *elevations(Handle &hdl, int level,
const DEMTile *tile) const;
int level(const Zoom &zoom) const;
QList<const DEMTile *> tiles(const RectC &rect, int level) const;
@ -44,7 +45,7 @@ private:
QList<DEMTile> tiles;
};
qint16 meters(qint16 val)
qint16 meters(qint16 val) const
{
return (_flags & 1) ? (qint16)qRound(val * 0.3048) : val;
}

View File

@ -111,3 +111,13 @@ double DEMTree::elevation(const Coordinates &c) const
return ele;
}
MatrixD DEMTree::elevation(const MatrixC &m) const
{
MatrixD ret(m.h(), m.w());
for (int i = 0; i < m.size(); i++)
ret.at(i) = elevation(m.at(i));
return ret;
}

View File

@ -2,6 +2,7 @@
#define IMG_DEMTREE_H
#include "common/rtree.h"
#include "map/matrix.h"
#include "mapdata.h"
namespace IMG {
@ -11,6 +12,7 @@ public:
DEMTree(const QList<MapData::Elevation> &tiles);
double elevation(const Coordinates &c) const;
MatrixD elevation(const MatrixC &m) const;
private:
typedef RTree<const MapData::Elevation*, double, 2> Tree;

View File

@ -87,13 +87,17 @@ bool GMAPData::loadTile(const QDir &dir)
const QFileInfo &fi = ml.at(i);
SubFile::Type tt = tileType(fi.suffix());
if (VectorTile::isTileFile(tt)) {
_files.append(new QString(fi.absoluteFilePath()));
tile->addFile(_files.last(), tt);
if (!tile->addFile(fi.absoluteFilePath(), tt)) {
qWarning("%s: Invalid map tile structure",
qUtf8Printable(dir.path()));
delete tile;
return false;
}
}
}
if (!tile->init()) {
qWarning("%s: Invalid map tile", qPrintable(dir.path()));
qWarning("%s: Invalid map tile", qUtf8Printable(dir.path()));
delete tile;
return false;
}
@ -131,10 +135,8 @@ GMAPData::GMAPData(const QString &fileName) : MapData(fileName)
loadTile(QDir(fi.absoluteFilePath()));
}
if (baseDir.exists(typFilePath)) {
_files.append(new QString(baseDir.filePath(typFilePath)));
_typ = new SubFile(_files.last());
}
if (baseDir.exists(typFilePath))
_typ = new SubFile(baseDir.filePath(typFilePath));
if (!_tileTree.Count())
_errorString = "No usable map tile found";
@ -143,8 +145,3 @@ GMAPData::GMAPData(const QString &fileName) : MapData(fileName)
computeZooms();
}
GMAPData::~GMAPData()
{
qDeleteAll(_files);
}

View File

@ -12,15 +12,13 @@ class GMAPData : public MapData
{
public:
GMAPData(const QString &fileName);
~GMAPData();
private:
bool readXML(const QString &path, QString &dataDir, QString &typFile);
void mapProduct(QXmlStreamReader &reader, QString &dataDir, QString &typFile);
void mapProduct(QXmlStreamReader &reader, QString &dataDir,
QString &typFile);
void subProduct(QXmlStreamReader &reader, QString &dataDir);
bool loadTile(const QDir &dir);
QList<const QString*> _files;
};
}

View File

@ -29,11 +29,11 @@ static SubFile::Type tileType(const char str[3])
return SubFile::Unknown;
}
bool IMGData::readSubFileBlocks(QFile &file, quint64 offset, SubFile *subFile)
bool IMGData::readSubFileBlocks(QFile *file, quint64 offset, SubFile *subFile)
{
quint16 block;
if (!file.seek(offset + 0x20))
if (!file->seek(offset + 0x20))
return false;
for (int i = 0; i < 240; i++) {
if (!readValue(file, block))
@ -46,11 +46,11 @@ bool IMGData::readSubFileBlocks(QFile &file, quint64 offset, SubFile *subFile)
return true;
}
bool IMGData::readIMGHeader(QFile &file)
bool IMGData::readIMGHeader(QFile *file)
{
char signature[7], identifier[7];
if (!(file.read((char*)&_key, 1) && file.seek(0x10)
&& read(file, signature, sizeof(signature)) && file.seek(0x41)
if (!(file->read((char*)&_key, 1) && file->seek(0x10)
&& read(file, signature, sizeof(signature)) && file->seek(0x41)
&& read(file, identifier, sizeof(identifier)))
|| memcmp(signature, "DSKIMG", sizeof(signature))
|| memcmp(identifier, "GARMIN", sizeof(identifier))) {
@ -60,8 +60,8 @@ bool IMGData::readIMGHeader(QFile &file)
char d1[20], d2[31];
quint8 e1, e2;
if (!(file.seek(0x49) && read(file, d1, sizeof(d1)) && file.seek(0x61)
&& readValue(file, e1) && readValue(file, e2) && file.seek(0x65)
if (!(file->seek(0x49) && read(file, d1, sizeof(d1)) && file->seek(0x61)
&& readValue(file, e1) && readValue(file, e2) && file->seek(0x65)
&& read(file, d2, sizeof(d2)))) {
_errorString = "Error reading IMG header";
return false;
@ -74,7 +74,7 @@ bool IMGData::readIMGHeader(QFile &file)
return true;
}
bool IMGData::readFAT(QFile &file, TileMap &tileMap)
bool IMGData::readFAT(QFile *file, TileMap &tileMap)
{
QByteArray typFile;
quint8 flag;
@ -82,7 +82,7 @@ bool IMGData::readFAT(QFile &file, TileMap &tileMap)
// Skip unused FAT blocks if any
while (true) {
if (!(file.seek(offset) && readValue(file, flag)))
if (!(file->seek(offset) && readValue(file, flag)))
return false;
if (flag)
break;
@ -93,14 +93,14 @@ bool IMGData::readFAT(QFile &file, TileMap &tileMap)
char name[8], type[3];
quint32 size;
quint16 part;
if (!(file.seek(offset + 12) && readValue(file, size)))
if (!(file->seek(offset + 12) && readValue(file, size)))
return false;
offset += 512;
int cnt = (size - offset) / 512;
// Read FAT blocks describing the IMG sub-files
for (int i = 0; i < cnt; i++) {
if (!(file.seek(offset) && readValue(file, flag)
if (!(file->seek(offset) && readValue(file, flag)
&& read(file, name, sizeof(name))
&& read(file, type, sizeof(type)) && readValue(file, size)
&& readValue(file, part)))
@ -117,8 +117,7 @@ bool IMGData::readFAT(QFile &file, TileMap &tileMap)
} else
tile = *it;
SubFile *subFile = part ? tile->file(tt)
: tile->addFile(this, tt);
SubFile *subFile = part ? tile->file(tt) : tile->addFile(this, tt);
if (!(subFile && readSubFileBlocks(file, offset, subFile)))
return false;
} else if (tt == SubFile::TYP) {
@ -140,15 +139,15 @@ bool IMGData::readFAT(QFile &file, TileMap &tileMap)
return true;
}
bool IMGData::createTileTree(const TileMap &tileMap)
bool IMGData::createTileTree(QFile *file, const TileMap &tileMap)
{
for (TileMap::const_iterator it = tileMap.constBegin();
it != tileMap.constEnd(); ++it) {
VectorTile *tile = it.value();
if (!tile->init()) {
qWarning("%s: %s: Invalid map tile", qPrintable(_fileName),
qPrintable(it.key()));
if (!tile->init(file)) {
qWarning("%s: %s: Invalid map tile", qUtf8Printable(_fileName),
qUtf8Printable(it.key()));
delete tile;
continue;
}
@ -177,14 +176,14 @@ IMGData::IMGData(const QString &fileName) : MapData(fileName)
return;
}
if (!readIMGHeader(file))
if (!readIMGHeader(&file))
return;
if (!readFAT(file, tileMap)) {
if (!readFAT(&file, tileMap)) {
_errorString = "Error reading FAT data";
qDeleteAll(tileMap);
return;
}
if (!createTileTree(tileMap)) {
if (!createTileTree(&file, tileMap)) {
_errorString = "No usable map tile found";
return;
}
@ -194,16 +193,16 @@ IMGData::IMGData(const QString &fileName) : MapData(fileName)
_valid = true;
}
qint64 IMGData::read(QFile &file, char *data, qint64 maxSize) const
qint64 IMGData::read(QFile *file, char *data, qint64 maxSize) const
{
qint64 ret = file.read(data, maxSize);
qint64 ret = file->read(data, maxSize);
if (_key)
for (int i = 0; i < ret; i++)
data[i] ^= _key;
return ret;
}
template<class T> bool IMGData::readValue(QFile &file, T &val) const
template<class T> bool IMGData::readValue(QFile *file, T &val) const
{
T data;
@ -215,9 +214,9 @@ template<class T> bool IMGData::readValue(QFile &file, T &val) const
return true;
}
bool IMGData::readBlock(QFile &file, int blockNum, char *data) const
bool IMGData::readBlock(QFile *file, int blockNum, char *data) const
{
if (!file.seek((quint64)blockNum << _blockBits))
if (!file->seek((quint64)blockNum << _blockBits))
return false;
if (read(file, data, 1ULL<<_blockBits) < (qint64)(1ULL<<_blockBits))
return false;

View File

@ -13,17 +13,17 @@ public:
IMGData(const QString &fileName);
unsigned blockBits() const {return _blockBits;}
bool readBlock(QFile &file, int blockNum, char *data) const;
bool readBlock(QFile *file, int blockNum, char *data) const;
private:
typedef QMap<QByteArray, VectorTile*> TileMap;
qint64 read(QFile &file, char *data, qint64 maxSize) const;
template<class T> bool readValue(QFile &file, T &val) const;
bool readSubFileBlocks(QFile &file, quint64 offset, SubFile *subFile);
bool readFAT(QFile &file, TileMap &tileMap);
bool readIMGHeader(QFile &file);
bool createTileTree(const TileMap &tileMap);
qint64 read(QFile *file, char *data, qint64 maxSize) const;
template<class T> bool readValue(QFile *file, T &val) const;
bool readSubFileBlocks(QFile *file, quint64 offset, SubFile *subFile);
bool readFAT(QFile *file, TileMap &tileMap);
bool readIMGHeader(QFile *file);
bool createTileTree(QFile *file, const TileMap &tileMap);
quint8 _key;
unsigned _blockBits;

View File

@ -32,7 +32,8 @@ JLS::JLS(quint16 maxval, quint16 near)
_limit = LIMIT - _qbpp - 1;
}
bool JLS::processRunMode(BitStream &bs, quint16 col, quint16 &samples)
bool JLS::processRunMode(BitStream &bs, Context &ctx, quint16 col,
quint16 &samples) const
{
quint8 z;
quint16 cnt = 0;
@ -42,12 +43,12 @@ bool JLS::processRunMode(BitStream &bs, quint16 col, quint16 &samples)
z = Z[(bs.value() >> 0x18) ^ 0xff];
for (quint8 i = 0; i < z; i++) {
cnt = cnt + _rg;
cnt = cnt + ctx.rg;
if (cnt <= col && _runIndex < 31) {
_runIndex++;
_rk = J[_runIndex];
_rg = 1U << _rk;
if (cnt <= col && ctx.runIndex < 31) {
ctx.runIndex++;
ctx.rk = J[ctx.runIndex];
ctx.rg = 1U << ctx.rk;
}
if (cnt >= col) {
@ -65,18 +66,18 @@ bool JLS::processRunMode(BitStream &bs, quint16 col, quint16 &samples)
if (!bs.read(z + 1))
return false;
if (_rk) {
samples = (bs.value() >> (32 - _rk)) + cnt;
if (!bs.read(_rk))
if (ctx.rk) {
samples = (bs.value() >> (32 - ctx.rk)) + cnt;
if (!bs.read(ctx.rk))
return false;
} else
samples = cnt;
_lrk = _rk + 1;
if (_runIndex != 0) {
_runIndex--;
_rk = J[_runIndex];
_rg = 1U << _rk;
ctx.lrk = ctx.rk + 1;
if (ctx.runIndex != 0) {
ctx.runIndex--;
ctx.rk = J[ctx.runIndex];
ctx.rg = 1U << ctx.rk;
}
return true;
@ -87,7 +88,8 @@ bool JLS::processRunMode(BitStream &bs, quint16 col, quint16 &samples)
}
}
bool JLS::decodeError(BitStream &bs, quint8 limit, quint8 k, uint &MErrval)
bool JLS::decodeError(BitStream &bs, quint8 limit, quint8 k,
uint &MErrval) const
{
quint8 cnt = 0;
MErrval = 0;
@ -122,19 +124,19 @@ bool JLS::decodeError(BitStream &bs, quint8 limit, quint8 k, uint &MErrval)
return true;
}
bool JLS::readLine(BitStream &bs)
bool JLS::readLine(BitStream &bs, Context &ctx) const
{
quint8 ictx, rctx;
quint8 k;
uint MErrval;
int Errval;
int Rx;
int Ra = _last[1];
int Rb = _last[1];
int Rc = _last[0];
int Ra = ctx.last[1];
int Rb = ctx.last[1];
int Rc = ctx.last[0];
uint col = 1;
*_current = _last[1];
*ctx.current = ctx.last[1];
do {
if (abs(Rb - Ra) > _near) {
@ -144,7 +146,7 @@ bool JLS::readLine(BitStream &bs)
else if (Px > _maxval)
Px = _maxval;
for (k = 0; _n[1] << k < _a[1]; k++)
for (k = 0; ctx.n[1] << k < ctx.a[1]; k++)
;
if (!decodeError(bs, _limit, k, MErrval))
@ -158,7 +160,7 @@ bool JLS::readLine(BitStream &bs)
meh = MErrval >> 1;
mes = meh;
}
if ((_near == 0) && (k == 0) && (_b[1] * 2 <= -_n[1])) {
if ((_near == 0) && (k == 0) && (ctx.b[1] * 2 <= -ctx.n[1])) {
meh = mes + 1;
mes = -mes - 1;
if (MErrval & 1)
@ -179,67 +181,67 @@ bool JLS::readLine(BitStream &bs)
if (Rx > _maxval)
Rx = _maxval;
_a[1] = _a[1] + meh;
_b[1] = _b[1] + mes;
if (_n[1] == 0x40) {
_a[1] = _a[1] >> 1;
if (_b[1] >= 0)
_b[1] = _b[1] >> 1;
ctx.a[1] = ctx.a[1] + meh;
ctx.b[1] = ctx.b[1] + mes;
if (ctx.n[1] == 0x40) {
ctx.a[1] = ctx.a[1] >> 1;
if (ctx.b[1] >= 0)
ctx.b[1] = ctx.b[1] >> 1;
else
_b[1] = -((1 - _b[1]) >> 1);
_n[1] = 0x21;
ctx.b[1] = -((1 - ctx.b[1]) >> 1);
ctx.n[1] = 0x21;
} else
_n[1] = _n[1] + 1;
ctx.n[1] = ctx.n[1] + 1;
if (_b[1] <= -_n[1]) {
_b[1] = _b[1] + _n[1];
if (_b[1] <= -_n[1])
_b[1] = 1 - _n[1];
} else if (_b[1] > 0) {
_b[1] = _b[1] - _n[1];
if (_b[1] > 0)
_b[1] = 0;
if (ctx.b[1] <= -ctx.n[1]) {
ctx.b[1] = ctx.b[1] + ctx.n[1];
if (ctx.b[1] <= -ctx.n[1])
ctx.b[1] = 1 - ctx.n[1];
} else if (ctx.b[1] > 0) {
ctx.b[1] = ctx.b[1] - ctx.n[1];
if (ctx.b[1] > 0)
ctx.b[1] = 0;
}
Rc = Rb;
Rb = _last[col + 1];
Rb = ctx.last[col + 1];
} else {
quint16 samples;
if (!processRunMode(bs, _w - col + 1, samples))
if (!processRunMode(bs, ctx, ctx.w - col + 1, samples))
return false;
if (samples != 0) {
for (int i = 0; i < samples; i++) {
if (col > _w)
if (col > ctx.w)
return false;
_current[col] = Ra;
ctx.current[col] = Ra;
col++;
}
if (col > _w)
if (col > ctx.w)
break;
Rc = _last[col];
Rb = _last[col + 1];
Rc = ctx.last[col];
Rb = ctx.last[col + 1];
} else {
Rc = Rb;
Rb = _last[col + 1];
Rb = ctx.last[col + 1];
}
rctx = (abs(Rc - Ra) <= _near);
quint16 TEMP = _a[rctx + 2];
quint16 TEMP = ctx.a[rctx + 2];
if (rctx)
TEMP += _n[rctx + 2] >> 1;
TEMP += ctx.n[rctx + 2] >> 1;
ictx = rctx | 2;
for (k = 0; _n[rctx + 2] << k < TEMP; k++)
for (k = 0; ctx.n[rctx + 2] << k < TEMP; k++)
;
if (!decodeError(bs, _limit - _lrk, k, MErrval))
if (!decodeError(bs, _limit - ctx.lrk, k, MErrval))
return false;
quint16 s = ((k == 0) && (rctx || MErrval)) ?
(_b[ictx] * 2 < _n[ictx]) : 0;
(ctx.b[ictx] * 2 < ctx.n[ictx]) : 0;
Errval = MErrval + rctx + s;
int evh;
@ -249,7 +251,7 @@ bool JLS::readLine(BitStream &bs)
} else {
Errval = s - ((Errval + 1) >> 1);
evh = -Errval;
_b[ictx] = _b[ictx] + 1;
ctx.b[ictx] = ctx.b[ictx] + 1;
}
Errval *= (_near * 2 + 1);
@ -274,59 +276,45 @@ bool JLS::readLine(BitStream &bs)
if (Rx > _maxval)
Rx = _maxval;
_a[ictx] = _a[ictx] + (evh - rctx);
if (_n[ictx] == 0x40) {
_a[ictx] = _a[ictx] >> 1;
if (_b[ictx] >= 0)
_b[ictx] = _b[ictx] >> 1;
ctx.a[ictx] = ctx.a[ictx] + (evh - rctx);
if (ctx.n[ictx] == 0x40) {
ctx.a[ictx] = ctx.a[ictx] >> 1;
if (ctx.b[ictx] >= 0)
ctx.b[ictx] = ctx.b[ictx] >> 1;
else
_b[ictx] = -((1 - _b[ictx]) >> 1);
_n[ictx] = 0x21;
ctx.b[ictx] = -((1 - ctx.b[ictx]) >> 1);
ctx.n[ictx] = 0x21;
} else
_n[ictx] = _n[ictx] + 1;
ctx.n[ictx] = ctx.n[ictx] + 1;
}
_current[col] = Rx;
ctx.current[col] = Rx;
Ra = Rx;
col = col + 1;
} while (col <= _w);
} while (col <= ctx.w);
return true;
}
bool JLS::decode(const SubFile *file, SubFile::Handle &hdl, Matrix<qint16> &img)
bool JLS::decode(const SubFile *file, SubFile::Handle &hdl,
Matrix<qint16> &img) const
{
Context ctx(img.w(), _range);
BitStream bs(file, hdl);
if (!bs.init())
return false;
_w = img.w();
_data = QVector<quint16>((_w + 3) * 2);
_last = _data.data();
_current = _data.data() + (_w + 3);
_runIndex = 0;
_rk = 0;
_rg = 1;
_lrk = 0;
quint16 A = qMax(2, (_range + 32) / 64);
for (int i = 0; i < 4; i++) {
_a[i] = A;
_b[i] = 0;
_n[i] = 1;
}
for (int i = 0; i < img.h(); i++) {
if (!readLine(bs))
if (!readLine(bs, ctx))
return false;
memcpy(img.row(i), _current + 1, _w * sizeof(quint16));
memcpy(img.row(i), ctx.current + 1, img.w() * sizeof(quint16));
quint16 *tmp = _last;
_last = _current;
_current = tmp;
quint16 *tmp = ctx.last;
ctx.last = ctx.current;
ctx.current = tmp;
}
return true;

View File

@ -12,7 +12,8 @@ class JLS
public:
JLS(quint16 maxval, quint16 near);
bool decode(const SubFile *file, SubFile::Handle &hdl, Matrix<qint16> &img);
bool decode(const SubFile *file, SubFile::Handle &hdl,
Matrix<qint16> &img) const;
private:
class BitStream
@ -56,28 +57,48 @@ private:
qint8 _shift;
};
bool readLine(BitStream &bs);
bool processRunMode(BitStream &bs, quint16 col, quint16 &samples);
bool decodeError(BitStream &bs, quint8 limit, quint8 k, uint &MErrval);
struct Context
{
Context(quint16 width, quint16 range)
: data(QVector<quint16>((width + 3) * 2)), w(width), rg(1),
runIndex(0), rk(0), lrk(0)
{
quint16 A = qMax(2, (range + 32) / 64);
last = data.data();
current = data.data() + (w + 3);
for (int i = 0; i < 4; i++) {
a[i] = A;
b[i] = 0;
n[i] = 1;
}
}
QVector<quint16> data;
quint16 *current;
quint16 *last;
quint16 w;
quint16 rg;
quint16 n[4];
quint16 a[4];
qint16 b[4];
quint8 runIndex;
quint8 rk;
quint8 lrk;
};
bool readLine(BitStream &bs, Context &ctx) const;
bool processRunMode(BitStream &bs, Context &ctx, quint16 col,
quint16 &samples) const;
bool decodeError(BitStream &bs, quint8 limit, quint8 k,
uint &MErrval) const;
quint16 _maxval;
quint16 _near;
quint16 _range;
quint8 _qbpp;
quint8 _limit;
quint8 _runIndex;
quint8 _rk;
quint16 _rg;
quint16 _n[4];
quint16 _a[4];
qint16 _b[4];
quint8 _lrk;
quint16 _w;
QVector<quint16> _data;
quint16 *_current;
quint16 *_last;
};
}

View File

@ -40,11 +40,10 @@ static QString capitalized(const QString &str)
return ret;
}
static QByteArray ft2m(const QByteArray &str)
static QByteArray ft2m(const QByteArray &str, bool *ok)
{
bool ok;
double number = str.toDouble(&ok);
return ok ? QByteArray::number(qRound(number * 0.3048)) : str;
double number = str.toDouble(ok);
return *ok ? QByteArray::number(qRound(number * 0.3048)) : str;
}
@ -123,6 +122,7 @@ Label LBLFile::str2label(const QVector<quint8> &str, bool capitalize,
QByteArray label, shieldLabel;
QByteArray *bap = &label;
int split = -1;
bool ok;
for (int i = 0; i < str.size(); i++) {
const quint8 &c = str.at(i);
@ -137,7 +137,7 @@ Label LBLFile::str2label(const QVector<quint8> &str, bool capitalize,
bap = &label;
else {
if (!bap->isEmpty())
bap->append('\n');
bap->append(' ');
if (c == 0x1f && split < 0)
split = bap->size();
}
@ -150,10 +150,14 @@ Label LBLFile::str2label(const QVector<quint8> &str, bool capitalize,
bap->append(c);
}
if (split >= 0)
label = label.left(split) + ft2m(label.mid(split));
else if (convert)
label = ft2m(label);
if (convert && split >= 0) {
QByteArray num(ft2m(label.mid(split), &ok));
if (ok) {
QByteArray name(label.left(split - 1));
label = name.isEmpty() ? num : name + "\n" + num;
}
} else if (convert)
label = ft2m(label, &ok);
QString text(_codec.toString(label));
return Label(capitalize && isAllUpperCase(text) ? capitalized(text) : text,
Shield(shieldType, _codec.toString(shieldLabel)));
@ -193,6 +197,7 @@ Label LBLFile::label6b(const SubFile *file, Handle &fileHdl, quint32 size,
Charset charset = Normal;
quint8 b1, b2, b3;
int split = -1;
bool ok;
for (quint32 i = 0; i < size; i = i + 3) {
if (!(file->readByte(fileHdl, &b1) && file->readByte(fileHdl, &b2)
@ -203,10 +208,14 @@ Label LBLFile::label6b(const SubFile *file, Handle &fileHdl, quint32 size,
for (int cpt = 0; cpt < 4; cpt++) {
if (c[cpt] > 0x2f || (charset == Normal && c[cpt] == 0x1d)) {
if (split >= 0)
label = label.left(split) + ft2m(label.mid(split));
else if (convert)
label = ft2m(label);
if (convert && split >= 0) {
QByteArray num(ft2m(label.mid(split), &ok));
if (ok) {
QByteArray name(label.left(split - 1));
label = name.isEmpty() ? num : name + "\n" + num;
}
} else if (convert)
label = ft2m(label, &ok);
QString text(QString::fromLatin1(label));
return Label(capitalize && isAllUpperCase(text)
? capitalized(text) : text, Shield(shieldType, shieldLabel));
@ -222,7 +231,7 @@ Label LBLFile::label6b(const SubFile *file, Handle &fileHdl, quint32 size,
bap = &label;
else {
if (!bap->isEmpty())
bap->append('\n');
bap->append(' ');
if (c[cpt] == 0x1f && split < 0)
split = bap->size();
}

View File

@ -18,7 +18,7 @@ public:
LBLFile(const IMGData *img)
: SubFile(img), _huffmanText(0), _imgIdSize(0), _poiShift(0), _shift(0),
_encoding(0) {}
LBLFile(const QString *path)
LBLFile(const QString &path)
: SubFile(path), _huffmanText(0), _imgIdSize(0), _poiShift(0), _shift(0),
_encoding(0) {}
LBLFile(const SubFile *gmp, quint32 offset)

Some files were not shown because too many files have changed in this diff Show More