Compare commits
155 Commits
Author | SHA1 | Date | |
---|---|---|---|
bb10f7c0e1 | |||
8ff21b5b37 | |||
32f41e5287 | |||
c50e41dea1 | |||
e34800b8d1 | |||
6642a2f810 | |||
55458b04a6 | |||
9e36451001 | |||
b26a10a5b3 | |||
4530ec1354 | |||
f2b72ec1b5 | |||
4b776c8cc1 | |||
d31bf80885 | |||
f77497c93e | |||
c6ddee8682 | |||
0d6bc05818 | |||
fdecbc6cee | |||
cad17fb5d3 | |||
ced1244cbd | |||
3dd22eb2ba | |||
b12e83043d | |||
6416c81232 | |||
e5db00a4f4 | |||
6266d71463 | |||
daf0cf6f9d | |||
d6b810b6ef | |||
8f20080a36 | |||
e112363424 | |||
a277d0ad4f | |||
d4cd542a20 | |||
5eaf0455aa | |||
3f71775101 | |||
f8009b0151 | |||
f64e88290d | |||
b4cf614f77 | |||
ca710b6a22 | |||
c894e75c17 | |||
259a15332e | |||
c4915891e7 | |||
c5256b25e9 | |||
81b3a517f8 | |||
3aa1ab4b4c | |||
d4fb8ed9c9 | |||
fb16c3f2db | |||
4096d87a6a | |||
68eac5b8cc | |||
88d6904ded | |||
021558b114 | |||
b8815ca9f5 | |||
e845e216bd | |||
60cc869ade | |||
e3e8fdbacf | |||
16f2d7ad34 | |||
aecda0e517 | |||
bf3589812a | |||
8821536419 | |||
bda24d9091 | |||
820e614921 | |||
35703e3363 | |||
a54821863f | |||
5bc3b2ad05 | |||
992fd2c5cd | |||
4b4a1902ef | |||
7d3bc2112a | |||
4ea2f0752a | |||
0bb3b3812c | |||
b23639bef2 | |||
2d8bf2dbb9 | |||
29efa84075 | |||
3d06fe8831 | |||
fe1f6c80b4 | |||
35d1e69d7f | |||
3043128565 | |||
e56a9e33f3 | |||
07aca435d8 | |||
4e4a3d042a | |||
bf5ae22f0d | |||
309fdb675c | |||
e0daf367fb | |||
32d8672698 | |||
0ef89e200d | |||
6d6c232dba | |||
8132ff722d | |||
49792064d7 | |||
7aef81d823 | |||
1d3d1aa5b7 | |||
bcd14726f3 | |||
fd15799114 | |||
a8bc2ae4c4 | |||
67aba4703b | |||
a64e5e13c3 | |||
60fcff7658 | |||
bc881836ac | |||
de05f5e64b | |||
16476dbf74 | |||
a21464d98d | |||
d6746bc444 | |||
e4d8af2040 | |||
b40e0d3bbf | |||
9300d671a1 | |||
b9ed0c3933 | |||
46cefada94 | |||
e1e49b32e6 | |||
fa99d01a77 | |||
688e309ef7 | |||
ae4723acb1 | |||
8c6f70d837 | |||
d1b0e2ef73 | |||
962310df7d | |||
f8c031e931 | |||
8022a9efbe | |||
fbab4b0097 | |||
5e5ff6d96f | |||
55e967673c | |||
757ba6a566 | |||
ee80260e46 | |||
fa3e6d8550 | |||
6e95d484cd | |||
376587202b | |||
d11ffc9ea4 | |||
bf6ebdc088 | |||
619df591e2 | |||
10aa7d3945 | |||
12319fd8fd | |||
ccb7336e3f | |||
a7fea3878c | |||
a6cf88aa92 | |||
b054cf9046 | |||
9c5153f89a | |||
2ebcdeeeff | |||
1bc4833a81 | |||
3202fc4c15 | |||
5852a9dc09 | |||
c587d8cd9a | |||
586f30a337 | |||
da06c032bc | |||
3def9f95b0 | |||
dc25290637 | |||
9fd5b1b80a | |||
94ee5b6e67 | |||
9556476f1b | |||
b6e798f5c3 | |||
e82f2a02c2 | |||
361ffacc35 | |||
18fc6cc3e2 | |||
9815f0bff2 | |||
805cbe921c | |||
d529055ea3 | |||
5d590b7c86 | |||
1003c7b56f | |||
820f967bd6 | |||
27632bf07e | |||
ee5b8fa333 | |||
7e42b57d73 | |||
292fc9b433 |
@ -1,4 +1,4 @@
|
||||
version: 5.0.{build}
|
||||
version: 5.8.{build}
|
||||
configuration: Release
|
||||
platform: Any CPU
|
||||
environment:
|
||||
|
@ -1,17 +1,17 @@
|
||||
# GPXSee
|
||||
GPXSee is a Qt-based GPS log file viewer and analyzer that supports GPX, TCX,
|
||||
KML, FIT, IGC and NMEA files.
|
||||
KML, FIT, IGC, NMEA and OziExplorer files.
|
||||
|
||||
## Features
|
||||
* User-definable online maps.
|
||||
* Offline maps (OziExplorer maps and TrekBuddy maps/atlases).
|
||||
* User-definable online maps (OSM/Google tiles, WMTS, WMS).
|
||||
* Offline maps (OziExplorer maps, TrekBuddy maps/atlases, GeoTIFF images).
|
||||
* Elevation, speed, heart rate, cadence, power and temperature graphs.
|
||||
* Support for multiple tracks in one view.
|
||||
* Support for POI files.
|
||||
* Print/export to PDF.
|
||||
* Full-screen mode.
|
||||
* Native GUI for Windows, Mac OS X and Linux.
|
||||
* Opens GPX, TCX, FIT, KML, IGC, NMEA and Garmin CSV files.
|
||||
* Opens GPX, TCX, FIT, KML, IGC, NMEA, OziExplorer (PLT, RTE, WPT) and Garmin CSV files.
|
||||
|
||||

|
||||
|
||||
|
62
gpxsee.pro
@ -1,5 +1,5 @@
|
||||
TARGET = GPXSee
|
||||
VERSION = 5.0
|
||||
VERSION = 5.8
|
||||
QT += core \
|
||||
gui \
|
||||
network
|
||||
@ -92,6 +92,20 @@ HEADERS += src/config.h \
|
||||
src/map/transform.h \
|
||||
src/map/mapfile.h \
|
||||
src/map/tifffile.h \
|
||||
src/map/gcs.h \
|
||||
src/map/angularunits.h \
|
||||
src/map/primemeridian.h \
|
||||
src/map/linearunits.h \
|
||||
src/map/ct.h \
|
||||
src/map/mapsource.h \
|
||||
src/map/tileloader.h \
|
||||
src/map/wmtsmap.h \
|
||||
src/map/wmts.h \
|
||||
src/map/wmsmap.h \
|
||||
src/map/wms.h \
|
||||
src/map/crs.h \
|
||||
src/map/coordinatesystem.h \
|
||||
src/map/pointd.h \
|
||||
src/data/graph.h \
|
||||
src/data/poi.h \
|
||||
src/data/waypoint.h \
|
||||
@ -111,12 +125,7 @@ HEADERS += src/config.h \
|
||||
src/data/fitparser.h \
|
||||
src/data/igcparser.h \
|
||||
src/data/nmeaparser.h \
|
||||
src/map/gcs.h \
|
||||
src/map/angularunits.h \
|
||||
src/map/primemeridian.h \
|
||||
src/map/linearunits.h \
|
||||
src/map/ct.h \
|
||||
src/map/mapsource.h
|
||||
src/data/oziparsers.h
|
||||
SOURCES += src/main.cpp \
|
||||
src/common/coordinates.cpp \
|
||||
src/common/rectc.cpp \
|
||||
@ -185,6 +194,19 @@ SOURCES += src/main.cpp \
|
||||
src/map/transform.cpp \
|
||||
src/map/mapfile.cpp \
|
||||
src/map/tifffile.cpp \
|
||||
src/map/projection.cpp \
|
||||
src/map/gcs.cpp \
|
||||
src/map/angularunits.cpp \
|
||||
src/map/primemeridian.cpp \
|
||||
src/map/linearunits.cpp \
|
||||
src/map/mapsource.cpp \
|
||||
src/map/tileloader.cpp \
|
||||
src/map/wmtsmap.cpp \
|
||||
src/map/wmts.cpp \
|
||||
src/map/wmsmap.cpp \
|
||||
src/map/wms.cpp \
|
||||
src/map/crs.cpp \
|
||||
src/map/coordinatesystem.cpp \
|
||||
src/data/data.cpp \
|
||||
src/data/poi.cpp \
|
||||
src/data/track.cpp \
|
||||
@ -197,19 +219,15 @@ SOURCES += src/main.cpp \
|
||||
src/data/fitparser.cpp \
|
||||
src/data/igcparser.cpp \
|
||||
src/data/nmeaparser.cpp \
|
||||
src/map/projection.cpp \
|
||||
src/map/gcs.cpp \
|
||||
src/map/angularunits.cpp \
|
||||
src/map/primemeridian.cpp \
|
||||
src/map/linearunits.cpp \
|
||||
src/map/mapsource.cpp
|
||||
src/data/oziparsers.cpp
|
||||
RESOURCES += gpxsee.qrc
|
||||
TRANSLATIONS = lang/gpxsee_cs.ts \
|
||||
lang/gpxsee_sv.ts \
|
||||
lang/gpxsee_de.ts \
|
||||
lang/gpxsee_ru.ts \
|
||||
lang/gpxsee_fi.ts \
|
||||
lang/gpxsee_fr.ts
|
||||
lang/gpxsee_fr.ts \
|
||||
lang/gpxsee_pl.ts
|
||||
macx {
|
||||
ICON = icons/gpxsee.icns
|
||||
QMAKE_INFO_PLIST = pkg/Info.plist
|
||||
@ -219,17 +237,22 @@ macx {
|
||||
lang/gpxsee_fi.qm \
|
||||
lang/gpxsee_fr.qm \
|
||||
lang/gpxsee_ru.qm \
|
||||
lang/gpxsee_sv.qm
|
||||
lang/gpxsee_sv.qm \
|
||||
lang/gpxsee_pl.qm
|
||||
CSV.path = Contents/Resources
|
||||
CSV.files = pkg/csv
|
||||
MAPS.path = Contents/Resources
|
||||
MAPS.files = pkg/maps
|
||||
ICONS.path = Contents/Resources/icons
|
||||
ICONS.files = icons/tcx.icns \
|
||||
ICONS.files = icons/gpx.icns \
|
||||
icons/tcx.icns \
|
||||
icons/kml.icns \
|
||||
icons/fit.icns \
|
||||
icons/igc.icns \
|
||||
icons/nmea.icns
|
||||
icons/nmea.icns \
|
||||
icons/plt.icns \
|
||||
icons/rte.icns \
|
||||
icons/wpt.icns
|
||||
QMAKE_BUNDLE_DATA += LOCALE MAPS ICONS CSV
|
||||
}
|
||||
win32 {
|
||||
@ -239,6 +262,9 @@ win32 {
|
||||
icons/kml.ico \
|
||||
icons/fit.ico \
|
||||
icons/igc.ico \
|
||||
icons/nmea.ico
|
||||
icons/nmea.ico \
|
||||
icons/plt.ico \
|
||||
icons/rte.ico \
|
||||
icons/wpt.ico
|
||||
}
|
||||
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
|
||||
|
BIN
icons/fit.icns
BIN
icons/fit.ico
Before Width: | Height: | Size: 361 KiB After Width: | Height: | Size: 302 KiB |
171
icons/fit.svg
@ -1,171 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
id="svg3390"
|
||||
height="185"
|
||||
width="185"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="fit.svg">
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1440"
|
||||
inkscape:window-height="815"
|
||||
id="namedview3427"
|
||||
showgrid="false"
|
||||
inkscape:zoom="3.1351351"
|
||||
inkscape:cx="92.5"
|
||||
inkscape:cy="92.5"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg3390" />
|
||||
<metadata
|
||||
id="metadata3404">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs3402" />
|
||||
<path
|
||||
style="fill:#ffffff;stroke:#999999;stroke-width:2.18774867"
|
||||
id="path3392"
|
||||
d="m 128.23996,2.2548915 -95.377018,0 0,181.0580085 134.394868,0 0,-141.313567 z m 0,0 0,39.7444415 39.01785,0" />
|
||||
<rect
|
||||
y="124.9782"
|
||||
x="16.573463"
|
||||
height="49.84631"
|
||||
width="120.3215"
|
||||
id="rect3426"
|
||||
style="fill:#006600;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<g
|
||||
id="g3828"
|
||||
transform="matrix(0.89093793,0,0,0.84489692,3.5017807,-51.565424)">
|
||||
<g
|
||||
id="g3715">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="113"
|
||||
cy="90.875"
|
||||
id="ellipse3717"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2;stroke-linejoin:round"
|
||||
cx="113"
|
||||
cy="90.875"
|
||||
id="ellipse3719"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<polyline
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:4"
|
||||
points="62.3563,178.566 73.5,125.854 96,151.875 113,90.875 136.5,172.375 148.831,160.03 "
|
||||
id="polyline3721" />
|
||||
<g
|
||||
id="g3723">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="73.5"
|
||||
cy="125.854"
|
||||
id="ellipse3725"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="73.5"
|
||||
cy="125.854"
|
||||
id="ellipse3727"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<g
|
||||
id="g3729">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="136.5"
|
||||
cy="172.375"
|
||||
id="ellipse3731"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="136.5"
|
||||
cy="172.375"
|
||||
id="ellipse3733"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<g
|
||||
id="g3735">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="60.700001"
|
||||
cy="186.39999"
|
||||
id="ellipse3737"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="60.700001"
|
||||
cy="186.39999"
|
||||
id="ellipse3739"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<g
|
||||
id="g3741">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="154.5"
|
||||
cy="154.354"
|
||||
id="ellipse3743"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="154.5"
|
||||
cy="154.354"
|
||||
id="ellipse3745"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<g
|
||||
id="g3747">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="96"
|
||||
cy="151.875"
|
||||
id="ellipse3749"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="96"
|
||||
cy="151.875"
|
||||
id="ellipse3751"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
</g>
|
||||
<text
|
||||
transform="scale(0.9437456,1.0596076)"
|
||||
id="text3921"
|
||||
y="155.86783"
|
||||
x="44.388157"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:40px;line-height:100%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
xml:space="preserve"
|
||||
sodipodi:linespacing="100%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3429"
|
||||
x="44.388157"
|
||||
y="155.86783">FIT</tspan></text>
|
||||
</svg>
|
Before Width: | Height: | Size: 4.9 KiB |
BIN
icons/gpx.icns
BIN
icons/gpx.ico
Before Width: | Height: | Size: 361 KiB After Width: | Height: | Size: 305 KiB |
146
icons/gpx.svg
@ -1,146 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
version="1.1"
|
||||
id="svg3390"
|
||||
height="185"
|
||||
width="185">
|
||||
<metadata
|
||||
id="metadata3404">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs3402" />
|
||||
<path
|
||||
style="fill:#ffffff;stroke:#999999;stroke-width:2.18774867"
|
||||
id="path3392"
|
||||
d="m 128.23996,2.2548915 -95.377018,0 0,181.0580085 134.394868,0 0,-141.313567 z m 0,0 0,39.7444415 39.01785,0" />
|
||||
<rect
|
||||
y="124.9782"
|
||||
x="16.573463"
|
||||
height="49.84631"
|
||||
width="120.3215"
|
||||
id="rect3426"
|
||||
style="fill:#003399;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<g
|
||||
id="g3828"
|
||||
transform="matrix(0.89093793,0,0,0.84489692,3.5017807,-51.565424)">
|
||||
<g
|
||||
id="g3715">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="113"
|
||||
cy="90.875"
|
||||
id="ellipse3717"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2;stroke-linejoin:round"
|
||||
cx="113"
|
||||
cy="90.875"
|
||||
id="ellipse3719"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<polyline
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:4"
|
||||
points="62.3563,178.566 73.5,125.854 96,151.875 113,90.875 136.5,172.375 148.831,160.03 "
|
||||
id="polyline3721" />
|
||||
<g
|
||||
id="g3723">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="73.5"
|
||||
cy="125.854"
|
||||
id="ellipse3725"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="73.5"
|
||||
cy="125.854"
|
||||
id="ellipse3727"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<g
|
||||
id="g3729">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="136.5"
|
||||
cy="172.375"
|
||||
id="ellipse3731"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="136.5"
|
||||
cy="172.375"
|
||||
id="ellipse3733"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<g
|
||||
id="g3735">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="60.700001"
|
||||
cy="186.39999"
|
||||
id="ellipse3737"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="60.700001"
|
||||
cy="186.39999"
|
||||
id="ellipse3739"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<g
|
||||
id="g3741">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="154.5"
|
||||
cy="154.354"
|
||||
id="ellipse3743"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="154.5"
|
||||
cy="154.354"
|
||||
id="ellipse3745"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<g
|
||||
id="g3747">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="96"
|
||||
cy="151.875"
|
||||
id="ellipse3749"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="96"
|
||||
cy="151.875"
|
||||
id="ellipse3751"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
</g>
|
||||
<text
|
||||
transform="scale(0.9437456,1.0596076)"
|
||||
id="text3921"
|
||||
y="155.86783"
|
||||
x="31.672857"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:40px;line-height:100%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
xml:space="preserve"><tspan
|
||||
y="155.86783"
|
||||
x="31.672857"
|
||||
id="tspan3923"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:40px;line-height:100%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;writing-mode:lr-tb;text-anchor:start">GPX</tspan></text>
|
||||
</svg>
|
Before Width: | Height: | Size: 4.4 KiB |
BIN
icons/igc.icns
BIN
icons/igc.ico
Before Width: | Height: | Size: 361 KiB After Width: | Height: | Size: 304 KiB |
145
icons/igc.svg
@ -1,145 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="185"
|
||||
height="185"
|
||||
id="svg3390"
|
||||
version="1.1">
|
||||
<metadata
|
||||
id="metadata3404">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs3402" />
|
||||
<path
|
||||
d="m 128.23996,2.2548915 -95.377018,0 0,181.0580085 134.394868,0 0,-141.313567 z m 0,0 0,39.7444415 39.01785,0"
|
||||
id="path3392"
|
||||
style="fill:#ffffff;stroke:#999999;stroke-width:2.18774867" />
|
||||
<rect
|
||||
style="fill:#ff3300;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect3426"
|
||||
width="120.3215"
|
||||
height="49.84631"
|
||||
x="16.573463"
|
||||
y="124.9782" />
|
||||
<g
|
||||
transform="matrix(0.89093793,0,0,0.84489692,3.5017807,-51.565424)"
|
||||
id="g3828">
|
||||
<g
|
||||
id="g3715">
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3717"
|
||||
cy="90.875"
|
||||
cx="113"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3719"
|
||||
cy="90.875"
|
||||
cx="113"
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2;stroke-linejoin:round" />
|
||||
</g>
|
||||
<polyline
|
||||
id="polyline3721"
|
||||
points="62.3563,178.566 73.5,125.854 96,151.875 113,90.875 136.5,172.375 148.831,160.03 "
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:4" />
|
||||
<g
|
||||
id="g3723">
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3725"
|
||||
cy="125.854"
|
||||
cx="73.5"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3727"
|
||||
cy="125.854"
|
||||
cx="73.5"
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2" />
|
||||
</g>
|
||||
<g
|
||||
id="g3729">
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3731"
|
||||
cy="172.375"
|
||||
cx="136.5"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3733"
|
||||
cy="172.375"
|
||||
cx="136.5"
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2" />
|
||||
</g>
|
||||
<g
|
||||
id="g3735">
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3737"
|
||||
cy="186.39999"
|
||||
cx="60.700001"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3739"
|
||||
cy="186.39999"
|
||||
cx="60.700001"
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2" />
|
||||
</g>
|
||||
<g
|
||||
id="g3741">
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3743"
|
||||
cy="154.354"
|
||||
cx="154.5"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3745"
|
||||
cy="154.354"
|
||||
cx="154.5"
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2" />
|
||||
</g>
|
||||
<g
|
||||
id="g3747">
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3749"
|
||||
cy="151.875"
|
||||
cx="96"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3751"
|
||||
cy="151.875"
|
||||
cx="96"
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2" />
|
||||
</g>
|
||||
</g>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:40px;line-height:100%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="40.149723"
|
||||
y="155.86783"
|
||||
id="text3921"
|
||||
transform="scale(0.9437456,1.0596076)"><tspan
|
||||
y="155.86783"
|
||||
x="40.149723"
|
||||
id="tspan3448">IGC</tspan></text>
|
||||
</svg>
|
Before Width: | Height: | Size: 4.1 KiB |
BIN
icons/kml.icns
BIN
icons/kml.ico
Before Width: | Height: | Size: 361 KiB After Width: | Height: | Size: 304 KiB |
143
icons/kml.svg
@ -1,143 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="185"
|
||||
height="185"
|
||||
id="svg3390"
|
||||
version="1.1">
|
||||
<metadata
|
||||
id="metadata3404">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs3402" />
|
||||
<path
|
||||
d="m 128.23996,2.2548915 -95.377018,0 0,181.0580085 134.394868,0 0,-141.313567 z m 0,0 0,39.7444415 39.01785,0"
|
||||
id="path3392"
|
||||
style="fill:#ffffff;stroke:#999999;stroke-width:2.18774867" />
|
||||
<rect
|
||||
style="fill:#990000;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect3426"
|
||||
width="120.3215"
|
||||
height="49.84631"
|
||||
x="16.573463"
|
||||
y="124.9782" />
|
||||
<g
|
||||
transform="matrix(0.89093793,0,0,0.84489692,3.5017807,-51.565424)"
|
||||
id="g3828">
|
||||
<g
|
||||
id="g3715">
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3717"
|
||||
cy="90.875"
|
||||
cx="113"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3719"
|
||||
cy="90.875"
|
||||
cx="113"
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2;stroke-linejoin:round" />
|
||||
</g>
|
||||
<polyline
|
||||
id="polyline3721"
|
||||
points="62.3563,178.566 73.5,125.854 96,151.875 113,90.875 136.5,172.375 148.831,160.03 "
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:4" />
|
||||
<g
|
||||
id="g3723">
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3725"
|
||||
cy="125.854"
|
||||
cx="73.5"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3727"
|
||||
cy="125.854"
|
||||
cx="73.5"
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2" />
|
||||
</g>
|
||||
<g
|
||||
id="g3729">
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3731"
|
||||
cy="172.375"
|
||||
cx="136.5"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3733"
|
||||
cy="172.375"
|
||||
cx="136.5"
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2" />
|
||||
</g>
|
||||
<g
|
||||
id="g3735">
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3737"
|
||||
cy="186.39999"
|
||||
cx="60.700001"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3739"
|
||||
cy="186.39999"
|
||||
cx="60.700001"
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2" />
|
||||
</g>
|
||||
<g
|
||||
id="g3741">
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3743"
|
||||
cy="154.354"
|
||||
cx="154.5"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3745"
|
||||
cy="154.354"
|
||||
cx="154.5"
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2" />
|
||||
</g>
|
||||
<g
|
||||
id="g3747">
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3749"
|
||||
cy="151.875"
|
||||
cx="96"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3751"
|
||||
cy="151.875"
|
||||
cx="96"
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2" />
|
||||
</g>
|
||||
</g>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:40px;line-height:100%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;"
|
||||
x="31.672857"
|
||||
y="155.86783"
|
||||
id="text3921"
|
||||
transform="scale(0.9437456,1.0596076)"><tspan
|
||||
id="tspan3429">KML</tspan></text>
|
||||
</svg>
|
Before Width: | Height: | Size: 4.1 KiB |
BIN
icons/nmea.icns
BIN
icons/nmea.ico
Before Width: | Height: | Size: 361 KiB After Width: | Height: | Size: 304 KiB |
145
icons/nmea.svg
@ -1,145 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
version="1.1"
|
||||
id="svg3390"
|
||||
height="185"
|
||||
width="185">
|
||||
<metadata
|
||||
id="metadata3404">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs3402" />
|
||||
<path
|
||||
style="fill:#ffffff;stroke:#999999;stroke-width:2.18774867"
|
||||
id="path3392"
|
||||
d="m 128.23996,2.2548915 -95.377018,0 0,181.0580085 134.394868,0 0,-141.313567 z m 0,0 0,39.7444415 39.01785,0" />
|
||||
<rect
|
||||
y="124.9782"
|
||||
x="16.573463"
|
||||
height="49.84631"
|
||||
width="131.6837"
|
||||
id="rect3426"
|
||||
style="fill:#0083d7;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<g
|
||||
id="g3828"
|
||||
transform="matrix(0.89093793,0,0,0.84489692,3.5017807,-51.565424)">
|
||||
<g
|
||||
id="g3715">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="113"
|
||||
cy="90.875"
|
||||
id="ellipse3717"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2;stroke-linejoin:round"
|
||||
cx="113"
|
||||
cy="90.875"
|
||||
id="ellipse3719"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<polyline
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:4"
|
||||
points="62.3563,178.566 73.5,125.854 96,151.875 113,90.875 136.5,172.375 148.831,160.03 "
|
||||
id="polyline3721" />
|
||||
<g
|
||||
id="g3723">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="73.5"
|
||||
cy="125.854"
|
||||
id="ellipse3725"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="73.5"
|
||||
cy="125.854"
|
||||
id="ellipse3727"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<g
|
||||
id="g3729">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="136.5"
|
||||
cy="172.375"
|
||||
id="ellipse3731"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="136.5"
|
||||
cy="172.375"
|
||||
id="ellipse3733"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<g
|
||||
id="g3735">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="60.700001"
|
||||
cy="186.39999"
|
||||
id="ellipse3737"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="60.700001"
|
||||
cy="186.39999"
|
||||
id="ellipse3739"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<g
|
||||
id="g3741">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="154.5"
|
||||
cy="154.354"
|
||||
id="ellipse3743"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="154.5"
|
||||
cy="154.354"
|
||||
id="ellipse3745"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<g
|
||||
id="g3747">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="96"
|
||||
cy="151.875"
|
||||
id="ellipse3749"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="96"
|
||||
cy="151.875"
|
||||
id="ellipse3751"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
</g>
|
||||
<text
|
||||
transform="scale(0.9437456,1.0596076)"
|
||||
id="text3921"
|
||||
y="155.86783"
|
||||
x="21.076782"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:40px;line-height:100%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
xml:space="preserve"><tspan
|
||||
y="155.86783"
|
||||
x="21.076782"
|
||||
id="tspan3429">NMEA</tspan></text>
|
||||
</svg>
|
Before Width: | Height: | Size: 4.1 KiB |
BIN
icons/plt.icns
Normal file
BIN
icons/plt.ico
Normal file
After Width: | Height: | Size: 302 KiB |
BIN
icons/rte.icns
Normal file
BIN
icons/rte.ico
Normal file
After Width: | Height: | Size: 303 KiB |
28
icons/scripts/icns.sh
Executable file
@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
EXTENSIONS="fit:#006600 gpx:#003399 igc:#ff3300 kml:#990000 nmea:#0083d7 \
|
||||
plt:#66ff00 rte:#66ff00 tcx:#ffcc00 wpt:#66ff00"
|
||||
|
||||
for e in $EXTENSIONS; do
|
||||
IFS=":"; set $e
|
||||
|
||||
EXT=`echo $1 | tr /a-z/ /A-Z/`
|
||||
sed -e "s/\$EXTENSION/$EXT/" -e "s/\$COLOR/$2/" icon-template.svg > $1.svg
|
||||
|
||||
ICONSET=$1.iconset
|
||||
mkdir $ICONSET
|
||||
|
||||
convert -density 400 -background none -resize '16x16' "$1.svg" "$ICONSET/icon_16x16.png"
|
||||
convert -density 400 -background none -resize '32x32' "$1.svg" "$ICONSET/icon_16x16@2x.png"
|
||||
cp "$ICONSET/icon_16x16@2x.png" "$ICONSET/icon_32x32.png"
|
||||
convert -density 400 -background none -resize '64x64' "$1.svg" "$ICONSET/icon_32x32@2x.png"
|
||||
convert -density 400 -background none -resize '128x128' "$1.svg" "$ICONSET/icon_128x128.png"
|
||||
convert -density 400 -background none -resize '256x256' "$1.svg" "$ICONSET/icon_128x128@2x.png"
|
||||
cp "$ICONSET/icon_128x128@2x.png" "$ICONSET/icon_256x256.png"
|
||||
convert -density 400 -background none -resize '512x512' "$1.svg" "$ICONSET/icon_256x256@2x.png"
|
||||
cp "$ICONSET/icon_256x256@2x.png" "$ICONSET/icon_512x512.png"
|
||||
convert -density 400 -background none -resize '1024x1024' "$1.svg" "$ICONSET/icon_512x512@2x.png"
|
||||
|
||||
iconutil -c icns -o $1.icns "$ICONSET"
|
||||
rm -R "$ICONSET" $1.svg
|
||||
done
|
13
icons/scripts/ico.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
EXTENSIONS="fit:#006600 gpx:#003399 igc:#ff3300 kml:#990000 nmea:#0083d7 \
|
||||
plt:#66ff00 rte:#66ff00 tcx:#ffcc00 wpt:#66ff00"
|
||||
|
||||
for e in $EXTENSIONS; do
|
||||
IFS=":"; set $e
|
||||
|
||||
EXT=`echo $1 | tr /a-z/ /A-Z/`
|
||||
sed -e "s/\$EXTENSION/$EXT/" -e "s/\$COLOR/$2/" icon-template.svg > $1.svg
|
||||
convert -density 400 $1.svg -define icon:auto-resize $1.ico
|
||||
rm $1.svg
|
||||
done
|
17
icons/scripts/icon-template.svg
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" height="185" width="185">
|
||||
<path id="envelope" style="fill:#ffffff;stroke:#999999;stroke-width:2.18774867" d="m 128.23996,2.2548915 -95.377018,0 0,181.0580085 134.394868,0 0,-141.313567 z m 0,0 0,39.7444415 39.01785,0" />
|
||||
<g id="logo" transform="matrix(0.89093793,0,0,0.84489692,3.5017807,-51.565424)">
|
||||
<polyline style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:4" points="62.3563,178.566 73.5,125.854 96,151.875 113,90.875 136.5,172.375 148.831,160.03 "/>
|
||||
<circle style="fill:#000000" cx="113" cy="90.875" r="8"/>
|
||||
<circle style="fill:#000000" cx="73.5" cy="125.854" r="8"/>
|
||||
<circle style="fill:#000000" cx="136.5" cy="172.375" r="8"/>
|
||||
<circle style="fill:#000000" cx="60.700001" cy="186.39999" r="8"/>
|
||||
<circle style="fill:#000000" cx="154.5" cy="154.354" r="8"/>
|
||||
<circle style="fill:#000000" cx="96" cy="151.875" r="8"/>
|
||||
</g>
|
||||
<g transform="translate(16.573463,124.9782)">
|
||||
<rect y="0" x="0" id="textrect" height="50" width="120" style="fill:$COLOR;fill-opacity:1;stroke:none;"/>
|
||||
<text y="28" x="60" dominant-baseline="central" text-anchor="middle" style="fill:#FFFFFF;font-size:39px;font-family:sans-serif;font-weight:bold;">$EXTENSION</text>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.3 KiB |
BIN
icons/tcx.icns
BIN
icons/tcx.ico
Before Width: | Height: | Size: 361 KiB After Width: | Height: | Size: 304 KiB |
145
icons/tcx.svg
@ -1,145 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="185"
|
||||
height="185"
|
||||
id="svg3390"
|
||||
version="1.1">
|
||||
<metadata
|
||||
id="metadata3404">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs3402" />
|
||||
<path
|
||||
d="m 128.23996,2.2548915 -95.377018,0 0,181.0580085 134.394868,0 0,-141.313567 z m 0,0 0,39.7444415 39.01785,0"
|
||||
id="path3392"
|
||||
style="fill:#ffffff;stroke:#999999;stroke-width:2.18774867" />
|
||||
<rect
|
||||
style="fill:#ffcc00;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect3426"
|
||||
width="120.3215"
|
||||
height="49.84631"
|
||||
x="16.573463"
|
||||
y="124.9782" />
|
||||
<g
|
||||
transform="matrix(0.89093793,0,0,0.84489692,3.5017807,-51.565424)"
|
||||
id="g3828">
|
||||
<g
|
||||
id="g3715">
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3717"
|
||||
cy="90.875"
|
||||
cx="113"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3719"
|
||||
cy="90.875"
|
||||
cx="113"
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2;stroke-linejoin:round" />
|
||||
</g>
|
||||
<polyline
|
||||
id="polyline3721"
|
||||
points="62.3563,178.566 73.5,125.854 96,151.875 113,90.875 136.5,172.375 148.831,160.03 "
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:4" />
|
||||
<g
|
||||
id="g3723">
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3725"
|
||||
cy="125.854"
|
||||
cx="73.5"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3727"
|
||||
cy="125.854"
|
||||
cx="73.5"
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2" />
|
||||
</g>
|
||||
<g
|
||||
id="g3729">
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3731"
|
||||
cy="172.375"
|
||||
cx="136.5"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3733"
|
||||
cy="172.375"
|
||||
cx="136.5"
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2" />
|
||||
</g>
|
||||
<g
|
||||
id="g3735">
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3737"
|
||||
cy="186.39999"
|
||||
cx="60.700001"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3739"
|
||||
cy="186.39999"
|
||||
cx="60.700001"
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2" />
|
||||
</g>
|
||||
<g
|
||||
id="g3741">
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3743"
|
||||
cy="154.354"
|
||||
cx="154.5"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3745"
|
||||
cy="154.354"
|
||||
cx="154.5"
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2" />
|
||||
</g>
|
||||
<g
|
||||
id="g3747">
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3749"
|
||||
cy="151.875"
|
||||
cx="96"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
r="7.0209999"
|
||||
id="ellipse3751"
|
||||
cy="151.875"
|
||||
cx="96"
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2" />
|
||||
</g>
|
||||
</g>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:40px;line-height:100%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="35.911289"
|
||||
y="155.86783"
|
||||
id="text3921"
|
||||
transform="scale(0.9437456,1.0596076)"><tspan
|
||||
y="155.86783"
|
||||
x="35.911289"
|
||||
id="tspan3429">TCX</tspan></text>
|
||||
</svg>
|
Before Width: | Height: | Size: 4.1 KiB |
BIN
icons/wpt.icns
Normal file
BIN
icons/wpt.ico
Normal file
After Width: | Height: | Size: 304 KiB |
1614
lang/gpxsee_pl.ts
Normal file
111
pkg/Info.plist
@ -115,6 +115,54 @@
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>plt</string>
|
||||
</array>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array>
|
||||
<string>application/vnd.oziexplorer.plt</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>icons/plt.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>OziExplorer Track Point File</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>rte</string>
|
||||
</array>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array>
|
||||
<string>application/vnd.oziexplorer.rte</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>icons/rte.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>OziExplorer Route File</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>wpt</string>
|
||||
</array>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array>
|
||||
<string>application/vnd.oziexplorer.wpt</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>icons/wpt.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>OziExplorer Waypoint File</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
</dict>
|
||||
</array>
|
||||
|
||||
<key>UTImportedTypeDeclarations</key>
|
||||
@ -245,6 +293,69 @@
|
||||
<string>application/vnd.nmea.nmea</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.oziexplorer3.plt</string>
|
||||
<key>UTTypeReferenceURL</key>
|
||||
<string>http://www.oziexplorer3.com/eng/help/fileformats.html</string>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>OziExplorer Track Point File</string>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
</array>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>plt</string>
|
||||
</array>
|
||||
<key>public.mime-type</key>
|
||||
<string>application/vnd.oziexplorer.plt</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.oziexplorer3.plt</string>
|
||||
<key>UTTypeReferenceURL</key>
|
||||
<string>http://www.oziexplorer3.com/eng/help/fileformats.html</string>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>OziExplorer Route File</string>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
</array>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>rte</string>
|
||||
</array>
|
||||
<key>public.mime-type</key>
|
||||
<string>application/vnd.oziexplorer.rte</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.oziexplorer3.plt</string>
|
||||
<key>UTTypeReferenceURL</key>
|
||||
<string>http://www.oziexplorer3.com/eng/help/fileformats.html</string>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>OziExplorer Waypoint File</string>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
</array>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>wpt</string>
|
||||
</array>
|
||||
<key>public.mime-type</key>
|
||||
<string>application/vnd.oziexplorer.wpt</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
|
||||
</dict>
|
||||
|
62
pkg/appdata.xml
Normal file
@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop">
|
||||
<id>gpxsee.desktop</id>
|
||||
<metadata_license>MIT</metadata_license>
|
||||
<project_license>GPL-3.0</project_license>
|
||||
|
||||
<name>GPXSee</name>
|
||||
<summary>GPS log file viewer and analyzer</summary>
|
||||
<description>
|
||||
<p>GPXSee is a GPS log file viewer and analyzer that supports GPX, TCX,
|
||||
KML, FIT, IGC, NMEA and OziExplorer files.</p>
|
||||
|
||||
<p>Features:</p>
|
||||
<ul>
|
||||
<li>User-definable online maps (OSM/Google tiles, WMTS, WMS).</li>
|
||||
<li>Offline maps (OziExplorer maps, TrekBuddy maps/atlases, GeoTIFF
|
||||
images).</li>
|
||||
<li>Elevation, speed, heart rate, cadence, power and temperature
|
||||
graphs.</li>
|
||||
<li>Support for multiple tracks in one view.</li>
|
||||
<li>Support for POI files.</li>
|
||||
<li>Print/export to PDF.</li>
|
||||
<li>Full-screen mode.</li>
|
||||
<li>Opens GPX, TCX, FIT, KML, IGC, NMEA, OziExplorer (PLT, WPT, RTE)
|
||||
and Garmin CSV files.</li>
|
||||
</ul>
|
||||
</description>
|
||||
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>http://www.gpxsee.org/gallery/lin1.png</image>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>http://www.gpxsee.org/gallery/lin2.png</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
|
||||
<categories>
|
||||
<category>Graphics</category>
|
||||
<category>Viewer</category>
|
||||
</categories>
|
||||
|
||||
<url type="homepage">http://www.gpxsee.org</url>
|
||||
|
||||
<launchable type="desktop-id">gpxsee.desktop</launchable>
|
||||
|
||||
<provides>
|
||||
<binary>gpxsee</binary>
|
||||
</provides>
|
||||
|
||||
<mimetypes>
|
||||
<mimetype>application/gpx+xml</mimetype>
|
||||
<mimetype>application/tcx+xml</mimetype>
|
||||
<mimetype>application/vnd.ant.fit</mimetype>
|
||||
<mimetype>application/vnd.google-earth.kml+xml</mimetype>
|
||||
<mimetype>application/vnd.fai.igc</mimetype>
|
||||
<mimetype>application/vnd.nmea.nmea</mimetype>
|
||||
<mimetype>application/vnd.oziexplorer.plt</mimetype>
|
||||
<mimetype>application/vnd.oziexplorer.rte</mimetype>
|
||||
<mimetype>application/vnd.oziexplorer.wpt</mimetype>
|
||||
</mimetypes>
|
||||
</component>
|
@ -21,7 +21,7 @@ Canton Astro 1966,4716,6716,9122,7022,8901,9603,298,-304,-375
|
||||
Cape,4222,6222,9122,7012,8901,9603,-136,-108,-292
|
||||
Cape Canaveral,4717,6717,9122,7008,8901,9603,-2,150,181
|
||||
Carthage,4223,6223,9122,7012,8901,9603,-263,6,431
|
||||
CH-1903,4149,6149,9122,7004,8901,9603,674,15,405
|
||||
CH-1903,4149,6149,9122,7004,8901,9603,674.374,15.056,405.343
|
||||
Chatham 1971,4672,6672,9122,7022,8901,9603,175,-38,113
|
||||
Chua Astro,4224,6224,9122,7022,8901,9603,-134,229,-29
|
||||
Corrego Alegre,4225,6225,9122,7022,8901,9603,-206,172,-6
|
||||
@ -29,6 +29,7 @@ Djakarta (Batavia),4211,6211,9122,7004,8901,9603,-377,681,-50
|
||||
DOS 1968,,,9122,7022,8901,9603,230,-199,-752
|
||||
Easter Island 1967,4719,6719,9122,7022,8901,9603,211,147,111
|
||||
Egypt,4199,6199,9122,7022,8901,9603,-130,-117,-151
|
||||
ETRS 89,4258,6258,9122,7019,8901,9603,0,0,0
|
||||
European 1950,4230,6230,9122,7022,8901,9603,-87,-98,-121
|
||||
European 1950 (Mean France),,,9122,7022,8901,9603,-87,-96,-120
|
||||
European 1950 (Spain and Portugal),,,9122,7022,8901,9603,-84,-107,-120
|
||||
@ -104,6 +105,7 @@ Rijksdriehoeksmeting,4289,6289,9122,7004,8901,9603,593,26,478
|
||||
Rome 1940,4806,6806,9122,7022,8906,9603,-225,-65,9
|
||||
RT 90,4124,6124,9122,7004,8901,9603,498,-36,568
|
||||
S42,4179,6179,9122,7024,8901,9603,28,-121,-77
|
||||
S42 (83),4178,6178,9122,7024,8901,9603,26,-121,-78
|
||||
Santo (DOS),4730,6730,9122,7022,8901,9603,170,42,84
|
||||
Sao Braz,4184,6184,9122,7022,8901,9603,-203,141,53
|
||||
Sapper Hill 1943,4292,6292,9122,7022,8901,9603,-355,16,74
|
||||
|
|
3416
pkg/csv/pcs.csv
@ -4,9 +4,10 @@ Comment=GPS log file viewer and analyzer
|
||||
Comment[cz]=Prohlížeč a analyzátor GPS logů
|
||||
Comment[fi]=Ohjelma GPS-lokien katseluun ja analysointiin
|
||||
Comment[ru]=Программа для просмотра и анализа GPS логов
|
||||
Comment[sv]=GPS-loggfilsläsare och analysator
|
||||
Exec=gpxsee %F
|
||||
Icon=gpxsee
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Graphics;Viewer;Maps;Qt;
|
||||
MimeType=application/gpx+xml;application/tcx+xml;application/vnd.ant.fit;application/vnd.google-earth.kml+xml;application/vnd.fai.igc;application/vnd.nmea.nmea;
|
||||
MimeType=application/gpx+xml;application/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;
|
||||
|
@ -5,7 +5,7 @@
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "5.0"
|
||||
!define VERSION "5.8"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}.exe"
|
||||
@ -39,6 +39,9 @@ InstallDirRegKey HKLM "Software\GPXSee" "Install_Dir"
|
||||
!define REGFIT "GPXSee.fit"
|
||||
!define REGIGC "GPXSee.igc"
|
||||
!define REGNMEA "GPXSee.nmea"
|
||||
!define REGPLT "GPXSee.plt"
|
||||
!define REGRTE "GPXSee.rte"
|
||||
!define REGWPT "GPXSee.wpt"
|
||||
|
||||
; Start menu page configuration
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
|
||||
@ -78,7 +81,7 @@ Section "GPXSee" SEC_APP
|
||||
|
||||
SectionIn RO
|
||||
|
||||
; Set output path to the installation directory.
|
||||
; Set output path to the installation directory
|
||||
SetOutPath $INSTDIR
|
||||
|
||||
; Put the files there
|
||||
@ -113,28 +116,40 @@ Section "GPXSee" SEC_APP
|
||||
DetailPrint "Associating file types..."
|
||||
WriteRegStr HKCR ".gpx" "" "${REGGPX}"
|
||||
WriteRegStr HKCR "${REGGPX}" "" "GPS Exchange Format"
|
||||
WriteRegStr HKCR "${REGGPX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,1"
|
||||
WriteRegStr HKCR "${REGGPX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,2"
|
||||
WriteRegStr HKCR "${REGGPX}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".tcx" "" "${REGTCX}"
|
||||
WriteRegStr HKCR "${REGTCX}" "" "Training Center XML"
|
||||
WriteRegStr HKCR "${REGTCX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,2"
|
||||
WriteRegStr HKCR "${REGTCX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,3"
|
||||
WriteRegStr HKCR "${REGTCX}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".kml" "" "${REGKML}"
|
||||
WriteRegStr HKCR "${REGKML}" "" "Keyhole Markup Language"
|
||||
WriteRegStr HKCR "${REGKML}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,3"
|
||||
WriteRegStr HKCR "${REGKML}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,4"
|
||||
WriteRegStr HKCR "${REGKML}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".fit" "" "${REGFIT}"
|
||||
WriteRegStr HKCR "${REGFIT}" "" "Flexible and Interoperable Data Transfer"
|
||||
WriteRegStr HKCR "${REGFIT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,4"
|
||||
WriteRegStr HKCR "${REGFIT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,5"
|
||||
WriteRegStr HKCR "${REGFIT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".igc" "" "${REGIGC}"
|
||||
WriteRegStr HKCR "${REGIGC}" "" "Flight Recorder Data Format"
|
||||
WriteRegStr HKCR "${REGIGC}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,5"
|
||||
WriteRegStr HKCR "${REGIGC}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,6"
|
||||
WriteRegStr HKCR "${REGIGC}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".nmea" "" "${REGNMEA}"
|
||||
WriteRegStr HKCR "${REGNMEA}" "" "NMEA 0183 data"
|
||||
WriteRegStr HKCR "${REGNMEA}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,6"
|
||||
WriteRegStr HKCR "${REGNMEA}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,7"
|
||||
WriteRegStr HKCR "${REGNMEA}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".plt" "" "${REGPLT}"
|
||||
WriteRegStr HKCR "${REGPLT}" "" "OziExplorer Track Point File"
|
||||
WriteRegStr HKCR "${REGPLT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,8"
|
||||
WriteRegStr HKCR "${REGPLT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".rte" "" "${REGRTE}"
|
||||
WriteRegStr HKCR "${REGRTE}" "" "OziExplorer Route File"
|
||||
WriteRegStr HKCR "${REGRTE}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,9"
|
||||
WriteRegStr HKCR "${REGRTE}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".wpt" "" "${REGWPT}"
|
||||
WriteRegStr HKCR "${REGWPT}" "" "OziExplorer Waypoint File"
|
||||
WriteRegStr HKCR "${REGWPT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,1"
|
||||
WriteRegStr HKCR "${REGWPT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
|
||||
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
|
||||
|
||||
@ -215,6 +230,11 @@ SectionGroup "Localization" SEC_LOCALIZATION
|
||||
File /oname=translations\gpxsee_de.qm translations\gpxsee_de.qm
|
||||
File /oname=translations\qt_de.qm translations\qt_de.qm
|
||||
SectionEnd
|
||||
Section "Polish"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_pl.qm translations\gpxsee_pl.qm
|
||||
File /oname=translations\qt_pl.qm translations\qt_pl.qm
|
||||
SectionEnd
|
||||
Section "Russian"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_ru.qm translations\gpxsee_ru.qm
|
||||
@ -258,6 +278,12 @@ Section "Uninstall"
|
||||
DeleteRegKey HKCR ".igc"
|
||||
DeleteRegKey HKCR "${REGNMEA}"
|
||||
DeleteRegKey HKCR ".nmea"
|
||||
DeleteRegKey HKCR "${REGPLT}"
|
||||
DeleteRegKey HKCR ".plt"
|
||||
DeleteRegKey HKCR "${REGRTE}"
|
||||
DeleteRegKey HKCR ".rte"
|
||||
DeleteRegKey HKCR "${REGWPT}"
|
||||
DeleteRegKey HKCR ".wpt"
|
||||
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
|
||||
|
||||
SectionEnd
|
||||
|
@ -43,4 +43,24 @@
|
||||
<glob pattern="*.nmea"/>
|
||||
</mime-type>
|
||||
|
||||
<mime-type type="application/vnd.oziexplorer.plt">
|
||||
<comment>OziExplorer Track Point File</comment>
|
||||
<sub-class-of type="text/plain"/>
|
||||
<generic-icon name="text-plain"/>
|
||||
<glob pattern="*.plt"/>
|
||||
</mime-type>
|
||||
|
||||
<mime-type type="application/vnd.oziexplorer.rte">
|
||||
<comment>OziExplorer Route File</comment>
|
||||
<sub-class-of type="text/plain"/>
|
||||
<generic-icon name="text-plain"/>
|
||||
<glob pattern="*.rte"/>
|
||||
</mime-type>
|
||||
|
||||
<mime-type type="application/vnd.oziexplorer.wpt">
|
||||
<comment>OziExplorer Waypoint File</comment>
|
||||
<sub-class-of type="text/plain"/>
|
||||
<generic-icon name="text-plain"/>
|
||||
<glob pattern="*.wpt"/>
|
||||
</mime-type>
|
||||
</mime-info>
|
||||
|
@ -5,7 +5,7 @@
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "5.0"
|
||||
!define VERSION "5.8"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||
@ -39,6 +39,9 @@ InstallDirRegKey HKLM "Software\GPXSee" "Install_Dir"
|
||||
!define REGFIT "GPXSee.fit"
|
||||
!define REGIGC "GPXSee.igc"
|
||||
!define REGNMEA "GPXSee.nmea"
|
||||
!define REGPLT "GPXSee.plt"
|
||||
!define REGRTE "GPXSee.rte"
|
||||
!define REGWPT "GPXSee.wpt"
|
||||
|
||||
; Start menu page configuration
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
|
||||
@ -85,7 +88,7 @@ Section "GPXSee" SEC_APP
|
||||
|
||||
SectionIn RO
|
||||
|
||||
; Set output path to the installation directory.
|
||||
; Set output path to the installation directory
|
||||
SetOutPath $INSTDIR
|
||||
|
||||
; Put the files there
|
||||
@ -120,28 +123,40 @@ Section "GPXSee" SEC_APP
|
||||
DetailPrint "Associating file types..."
|
||||
WriteRegStr HKCR ".gpx" "" "${REGGPX}"
|
||||
WriteRegStr HKCR "${REGGPX}" "" "GPS Exchange Format"
|
||||
WriteRegStr HKCR "${REGGPX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,1"
|
||||
WriteRegStr HKCR "${REGGPX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,2"
|
||||
WriteRegStr HKCR "${REGGPX}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".tcx" "" "${REGTCX}"
|
||||
WriteRegStr HKCR "${REGTCX}" "" "Training Center XML"
|
||||
WriteRegStr HKCR "${REGTCX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,2"
|
||||
WriteRegStr HKCR "${REGTCX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,3"
|
||||
WriteRegStr HKCR "${REGTCX}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".kml" "" "${REGKML}"
|
||||
WriteRegStr HKCR "${REGKML}" "" "Keyhole Markup Language"
|
||||
WriteRegStr HKCR "${REGKML}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,3"
|
||||
WriteRegStr HKCR "${REGKML}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,4"
|
||||
WriteRegStr HKCR "${REGKML}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".fit" "" "${REGFIT}"
|
||||
WriteRegStr HKCR "${REGFIT}" "" "Flexible and Interoperable Data Transfer"
|
||||
WriteRegStr HKCR "${REGFIT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,4"
|
||||
WriteRegStr HKCR "${REGFIT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,5"
|
||||
WriteRegStr HKCR "${REGFIT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".igc" "" "${REGIGC}"
|
||||
WriteRegStr HKCR "${REGIGC}" "" "Flight Recorder Data Format"
|
||||
WriteRegStr HKCR "${REGIGC}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,5"
|
||||
WriteRegStr HKCR "${REGIGC}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,6"
|
||||
WriteRegStr HKCR "${REGIGC}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".nmea" "" "${REGNMEA}"
|
||||
WriteRegStr HKCR "${REGNMEA}" "" "NMEA 0183 data"
|
||||
WriteRegStr HKCR "${REGNMEA}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,6"
|
||||
WriteRegStr HKCR "${REGNMEA}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,7"
|
||||
WriteRegStr HKCR "${REGNMEA}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".plt" "" "${REGPLT}"
|
||||
WriteRegStr HKCR "${REGPLT}" "" "OziExplorer Track Point File"
|
||||
WriteRegStr HKCR "${REGPLT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,8"
|
||||
WriteRegStr HKCR "${REGPLT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".rte" "" "${REGRTE}"
|
||||
WriteRegStr HKCR "${REGRTE}" "" "OziExplorer Route File"
|
||||
WriteRegStr HKCR "${REGRTE}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,9"
|
||||
WriteRegStr HKCR "${REGRTE}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".wpt" "" "${REGWPT}"
|
||||
WriteRegStr HKCR "${REGWPT}" "" "OziExplorer Waypoint File"
|
||||
WriteRegStr HKCR "${REGWPT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,1"
|
||||
WriteRegStr HKCR "${REGWPT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
|
||||
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
|
||||
|
||||
@ -217,6 +232,11 @@ SectionGroup "Localization" SEC_LOCALIZATION
|
||||
File /oname=translations\gpxsee_de.qm translations\gpxsee_de.qm
|
||||
File /oname=translations\qt_de.qm translations\qt_de.qm
|
||||
SectionEnd
|
||||
Section "Polish"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_pl.qm translations\gpxsee_pl.qm
|
||||
File /oname=translations\qt_pl.qm translations\qt_pl.qm
|
||||
SectionEnd
|
||||
Section "Russian"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_ru.qm translations\gpxsee_ru.qm
|
||||
@ -261,6 +281,12 @@ Section "Uninstall"
|
||||
DeleteRegKey HKCR ".igc"
|
||||
DeleteRegKey HKCR "${REGNMEA}"
|
||||
DeleteRegKey HKCR ".nmea"
|
||||
DeleteRegKey HKCR "${REGPLT}"
|
||||
DeleteRegKey HKCR ".plt"
|
||||
DeleteRegKey HKCR "${REGRTE}"
|
||||
DeleteRegKey HKCR ".rte"
|
||||
DeleteRegKey HKCR "${REGWPT}"
|
||||
DeleteRegKey HKCR ".wpt"
|
||||
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
|
||||
|
||||
SectionEnd
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map>
|
||||
<map xmlns="http://www.gpxsee.org/map/1">
|
||||
<name>4UMaps</name>
|
||||
<url>http://4umaps.eu/$z/$x/$y.png</url>
|
||||
<copyright>Map data: © OpenStreetMap contributors (ODbL) | Rendering: © 4UMaps.eu</copyright>
|
||||
<zoom min="2" max="15"/>
|
||||
<bounds bottom="-65"/>
|
||||
</map>
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map>
|
||||
<map xmlns="http://www.gpxsee.org/map/1">
|
||||
<name>Open Street Map</name>
|
||||
<url>http://tile.openstreetmap.org/$z/$x/$y.png</url>
|
||||
<copyright>Map data: © OpenStreetMap contributors (ODbL) | Rendering: © OpenStreetMap (CC-BY-SA)</copyright>
|
||||
</map>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map>
|
||||
<map xmlns="http://www.gpxsee.org/map/1">
|
||||
<name>Open Topo Map</name>
|
||||
<url>https://a.tile.opentopomap.org/$z/$x/$y.png</url>
|
||||
<copyright>Map data: © OpenStreetMap contributors (ODbL), SRTM | Rendering: © OpenTopoMap (CC-BY-SA)</copyright>
|
||||
<zoom max="17"/>
|
||||
</map>
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map>
|
||||
<map xmlns="http://www.gpxsee.org/map/1">
|
||||
<name>USGS Imagery</name>
|
||||
<url>https://navigator.er.usgs.gov/tiles/aerial_Imagery.cgi/$z/$x/$y</url>
|
||||
<url>https://basemap.nationalmap.gov/ArcGIS/rest/services/USGSImageryOnly/MapServer/tile/$z/$y/$x</url>
|
||||
<copyright>Map services and data available from U.S. Geological Survey, National Geospatial Program.</copyright>
|
||||
<zoom min="2" max="15"/>
|
||||
<bounds bottom="0" top="74"/>
|
||||
</map>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map>
|
||||
<map xmlns="http://www.gpxsee.org/map/1">
|
||||
<name>USGS Topo</name>
|
||||
<url>https://navigator.er.usgs.gov/tiles/tcr.cgi/$z/$x/$y.png</url>
|
||||
<url>https://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/$z/$y/$x</url>
|
||||
<copyright>Map services and data available from U.S. Geological Survey, National Geospatial Program.</copyright>
|
||||
<zoom min="2" max="15"/>
|
||||
</map>
|
||||
|
@ -4,7 +4,9 @@
|
||||
#include <QFileOpenEvent>
|
||||
#include <QNetworkProxyFactory>
|
||||
#include <QLibraryInfo>
|
||||
#include "map/onlinemap.h"
|
||||
#include "map/wmts.h"
|
||||
#include "map/wms.h"
|
||||
#include "map/tileloader.h"
|
||||
#include "map/downloader.h"
|
||||
#include "map/ellipsoid.h"
|
||||
#include "map/gcs.h"
|
||||
@ -23,12 +25,12 @@ App::App(int &argc, char **argv) : QApplication(argc, argv),
|
||||
installTranslator(gpxsee);
|
||||
|
||||
QTranslator *qt = new QTranslator(this);
|
||||
#if defined(Q_OS_WINDOWS) || defined(Q_OS_MAC)
|
||||
#if defined(Q_OS_WIN32) || defined(Q_OS_MAC)
|
||||
qt->load(QLocale::system(), "qt", "_", TRANSLATIONS_DIR);
|
||||
#else // Q_OS_WINDOWS || Q_OS_MAC
|
||||
#else // Q_OS_WIN32 || Q_OS_MAC
|
||||
qt->load(QLocale::system(), "qt", "_", QLibraryInfo::location(
|
||||
QLibraryInfo::TranslationsPath));
|
||||
#endif // Q_OS_WINDOWS || Q_OS_MAC
|
||||
#endif // Q_OS_WIN32 || Q_OS_MAC
|
||||
installTranslator(qt);
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
@ -36,7 +38,10 @@ App::App(int &argc, char **argv) : QApplication(argc, argv),
|
||||
#endif // Q_OS_MAC
|
||||
|
||||
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
||||
OnlineMap::setDownloader(new Downloader(this));
|
||||
Downloader *dl = new Downloader(this);
|
||||
TileLoader::setDownloader(dl);
|
||||
WMTS::setDownloader(dl);
|
||||
WMS::setDownloader(dl);
|
||||
OPENGL_SET_SAMPLES(4);
|
||||
loadDatums();
|
||||
loadPCSs();
|
||||
|
@ -62,12 +62,17 @@ ExportDialog::ExportDialog(Export *exp, QWidget *parent)
|
||||
_bottomMargin = new QDoubleSpinBox();
|
||||
_leftMargin = new QDoubleSpinBox();
|
||||
_rightMargin = new QDoubleSpinBox();
|
||||
QString us = (_export->units == Imperial) ? tr("in") : tr("mm");
|
||||
QString us = (_export->units == Metric) ? tr("mm") : tr("in");
|
||||
_topMargin->setSuffix(UNIT_SPACE + us);
|
||||
_bottomMargin->setSuffix(UNIT_SPACE + us);
|
||||
_leftMargin->setSuffix(UNIT_SPACE + us);
|
||||
_rightMargin->setSuffix(UNIT_SPACE + us);
|
||||
if (_export->units == Imperial) {
|
||||
if (_export->units == Metric) {
|
||||
_topMargin->setValue(_export->margins.top());
|
||||
_bottomMargin->setValue(_export->margins.bottom());
|
||||
_leftMargin->setValue(_export->margins.left());
|
||||
_rightMargin->setValue(_export->margins.right());
|
||||
} else {
|
||||
_topMargin->setValue(_export->margins.top() * MM2IN);
|
||||
_bottomMargin->setValue(_export->margins.bottom() * MM2IN);
|
||||
_leftMargin->setValue(_export->margins.left() * MM2IN);
|
||||
@ -76,11 +81,6 @@ ExportDialog::ExportDialog(Export *exp, QWidget *parent)
|
||||
_bottomMargin->setSingleStep(0.1);
|
||||
_leftMargin->setSingleStep(0.1);
|
||||
_rightMargin->setSingleStep(0.1);
|
||||
} else {
|
||||
_topMargin->setValue(_export->margins.top());
|
||||
_bottomMargin->setValue(_export->margins.bottom());
|
||||
_leftMargin->setValue(_export->margins.left());
|
||||
_rightMargin->setValue(_export->margins.right());
|
||||
}
|
||||
|
||||
QGridLayout *marginsLayout = new QGridLayout();
|
||||
|
@ -2,6 +2,32 @@
|
||||
#include "common/coordinates.h"
|
||||
#include "format.h"
|
||||
|
||||
|
||||
static QString deg2DMS(double val)
|
||||
{
|
||||
int deg = val;
|
||||
double r1 = val - deg;
|
||||
|
||||
int min = r1 * 60.0;
|
||||
double r2 = r1 - (min / 60.0);
|
||||
|
||||
double sec = r2 * 3600.0;
|
||||
|
||||
return QString("%1°%2'%3\"").arg(deg).arg(min, 2, 10, QChar('0'))
|
||||
.arg(sec, 4, 'f', 1, QChar('0'));
|
||||
}
|
||||
|
||||
static QString deg2DMM(double val)
|
||||
{
|
||||
int deg = val;
|
||||
double r1 = val - deg;
|
||||
|
||||
double min = r1 * 60.0;
|
||||
|
||||
return QString("%1°%2'").arg(deg).arg(min, 6, 'f', 3, QChar('0'));
|
||||
}
|
||||
|
||||
|
||||
QString Format::timeSpan(qreal time, bool full)
|
||||
{
|
||||
unsigned h, m, s;
|
||||
@ -27,6 +53,13 @@ QString Format::distance(qreal value, Units units)
|
||||
else
|
||||
return QString::number(value * M2MI, 'f', 1) + UNIT_SPACE
|
||||
+ qApp->translate("Format", "mi");
|
||||
} else if (units == Nautical) {
|
||||
if (value < NMIINM)
|
||||
return QString::number(value * M2FT, 'f', 0) + UNIT_SPACE
|
||||
+ qApp->translate("Format", "ft");
|
||||
else
|
||||
return QString::number(value * M2NMI, 'f', 1) + UNIT_SPACE
|
||||
+ qApp->translate("Format", "nmi");
|
||||
} else {
|
||||
if (value < KMINM)
|
||||
return QString::number(value, 'f', 0) + UNIT_SPACE
|
||||
@ -40,18 +73,29 @@ QString Format::distance(qreal value, Units units)
|
||||
QString Format::elevation(qreal value, Units units)
|
||||
{
|
||||
if (units == Metric)
|
||||
return QString::number(value, 'f', 0) + UNIT_SPACE
|
||||
return QString::number(qRound(value)) + UNIT_SPACE
|
||||
+ qApp->translate("Format", "m");
|
||||
else
|
||||
return QString::number(value * M2FT, 'f', 0) + UNIT_SPACE
|
||||
return QString::number(qRound(value * M2FT)) + UNIT_SPACE
|
||||
+ qApp->translate("Format", "ft");
|
||||
}
|
||||
|
||||
QString Format::coordinates(const Coordinates &value)
|
||||
QString Format::coordinates(const Coordinates &value, CoordinatesFormat type)
|
||||
{
|
||||
QChar yH = (value.lat() < 0) ? 'S' : 'N';
|
||||
QChar xH = (value.lon() < 0) ? 'W' : 'E';
|
||||
|
||||
return QString::number(qAbs(value.lat()), 'f', 5) + yH + "," + QChar(0x00A0)
|
||||
+ QString::number(qAbs(value.lon()), 'f', 5) + xH;
|
||||
switch (type) {
|
||||
case DegreesMinutes:
|
||||
return deg2DMM(qAbs(value.lat())) + yH + "," + QChar(0x00A0)
|
||||
+ deg2DMM(qAbs(value.lon())) + xH;
|
||||
break;
|
||||
case DMS:
|
||||
return deg2DMS(qAbs(value.lat())) + yH + "," + QChar(0x00A0)
|
||||
+ deg2DMS(qAbs(value.lon())) + xH;
|
||||
break;
|
||||
default:
|
||||
return QString::number(qAbs(value.lat()), 'f', 5) + yH + ","
|
||||
+ QChar(0x00A0) + QString::number(qAbs(value.lon()), 'f', 5) + xH;
|
||||
}
|
||||
}
|
||||
|
@ -6,12 +6,18 @@
|
||||
|
||||
class Coordinates;
|
||||
|
||||
enum CoordinatesFormat {
|
||||
DecimalDegrees,
|
||||
DegreesMinutes,
|
||||
DMS
|
||||
};
|
||||
|
||||
namespace Format
|
||||
{
|
||||
QString timeSpan(qreal time, bool full = true);
|
||||
QString distance(qreal value, Units units);
|
||||
QString elevation(qreal value, Units units);
|
||||
QString coordinates(const Coordinates &value);
|
||||
QString coordinates(const Coordinates &value, CoordinatesFormat type);
|
||||
}
|
||||
|
||||
#endif // FORMAT_H
|
||||
|
@ -12,6 +12,7 @@ class GraphItem : public QGraphicsObject
|
||||
|
||||
public:
|
||||
GraphItem(const Graph &graph, GraphType type, QGraphicsItem *parent = 0);
|
||||
virtual ~GraphItem() {}
|
||||
|
||||
QPainterPath shape() const {return _shape;}
|
||||
QRectF boundingRect() const {return _shape.boundingRect();}
|
||||
|
@ -16,6 +16,7 @@ class GraphTab : public GraphView
|
||||
public:
|
||||
GraphTab(QWidget *parent = 0) : GraphView(parent)
|
||||
{setFrameShape(QFrame::NoFrame);}
|
||||
virtual ~GraphTab() {}
|
||||
|
||||
virtual QString label() const = 0;
|
||||
virtual void loadData(const Data &data, const QList<PathItem *> &paths) = 0;
|
||||
|
@ -81,12 +81,12 @@ GraphView::~GraphView()
|
||||
|
||||
void GraphView::createXLabel()
|
||||
{
|
||||
_xAxis->setLabel(QString("%1 [%2]").arg(_xLabel).arg(_xUnits));
|
||||
_xAxis->setLabel(QString("%1 [%2]").arg(_xLabel, _xUnits));
|
||||
}
|
||||
|
||||
void GraphView::createYLabel()
|
||||
{
|
||||
_yAxis->setLabel(QString("%1 [%2]").arg(_yLabel).arg(_yUnits));
|
||||
_yAxis->setLabel(QString("%1 [%2]").arg(_yLabel, _yUnits));
|
||||
}
|
||||
|
||||
void GraphView::setYLabel(const QString &label)
|
||||
@ -104,15 +104,7 @@ void GraphView::setYUnits(const QString &units)
|
||||
void GraphView::setXUnits()
|
||||
{
|
||||
if (_graphType == Distance) {
|
||||
if (_units == Metric) {
|
||||
if (bounds().width() < KMINM) {
|
||||
_xUnits = tr("m");
|
||||
_xScale = 1;
|
||||
} else {
|
||||
_xUnits = tr("km");
|
||||
_xScale = M2KM;
|
||||
}
|
||||
} else {
|
||||
if (_units == Imperial) {
|
||||
if (bounds().width() < MIINM) {
|
||||
_xUnits = tr("ft");
|
||||
_xScale = M2FT;
|
||||
@ -120,6 +112,22 @@ void GraphView::setXUnits()
|
||||
_xUnits = tr("mi");
|
||||
_xScale = M2MI;
|
||||
}
|
||||
} else if (_units == Nautical) {
|
||||
if (bounds().width() < NMIINM) {
|
||||
_xUnits = tr("ft");
|
||||
_xScale = M2FT;
|
||||
} else {
|
||||
_xUnits = tr("nmi");
|
||||
_xScale = M2NMI;
|
||||
}
|
||||
} else {
|
||||
if (bounds().width() < KMINM) {
|
||||
_xUnits = tr("m");
|
||||
_xScale = 1;
|
||||
} else {
|
||||
_xUnits = tr("km");
|
||||
_xScale = M2KM;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (bounds().width() < MININS) {
|
||||
|
126
src/GUI/gui.cpp
@ -40,7 +40,6 @@
|
||||
#include "filebrowser.h"
|
||||
#include "cpuarch.h"
|
||||
#include "graphtab.h"
|
||||
#include "format.h"
|
||||
#include "gui.h"
|
||||
|
||||
|
||||
@ -83,6 +82,10 @@ GUI::GUI()
|
||||
|
||||
_sliderPos = 0;
|
||||
|
||||
_dataDir = QDir::homePath();
|
||||
_mapDir = QDir::homePath();
|
||||
_poiDir = QDir::homePath();
|
||||
|
||||
readSettings();
|
||||
|
||||
updateGraphTabs();
|
||||
@ -373,6 +376,28 @@ void GUI::createActions()
|
||||
_imperialUnitsAction->setActionGroup(ag);
|
||||
connect(_imperialUnitsAction, SIGNAL(triggered()), this,
|
||||
SLOT(setImperialUnits()));
|
||||
_nauticalUnitsAction = new QAction(tr("Nautical"), this);
|
||||
_nauticalUnitsAction->setCheckable(true);
|
||||
_nauticalUnitsAction->setActionGroup(ag);
|
||||
connect(_nauticalUnitsAction, SIGNAL(triggered()), this,
|
||||
SLOT(setNauticalUnits()));
|
||||
ag = new QActionGroup(this);
|
||||
ag->setExclusive(true);
|
||||
_decimalDegreesAction = new QAction(tr("Decimal degrees (DD)"), this);
|
||||
_decimalDegreesAction->setCheckable(true);
|
||||
_decimalDegreesAction->setActionGroup(ag);
|
||||
connect(_decimalDegreesAction, SIGNAL(triggered()), this,
|
||||
SLOT(setDecimalDegrees()));
|
||||
_degreesMinutesAction = new QAction(tr("Degrees and decimal minutes (DMM)"),
|
||||
this);
|
||||
_degreesMinutesAction->setCheckable(true);
|
||||
_degreesMinutesAction->setActionGroup(ag);
|
||||
connect(_degreesMinutesAction, SIGNAL(triggered()), this,
|
||||
SLOT(setDegreesMinutes()));
|
||||
_DMSAction = new QAction(tr("Degrees, minutes, seconds (DMS)"), this);
|
||||
_DMSAction->setCheckable(true);
|
||||
_DMSAction->setActionGroup(ag);
|
||||
connect(_DMSAction, SIGNAL(triggered()), this, SLOT(setDMS()));
|
||||
_fullscreenAction = new QAction(QIcon(QPixmap(FULLSCREEN_ICON)),
|
||||
tr("Fullscreen mode"), this);
|
||||
_fullscreenAction->setCheckable(true);
|
||||
@ -404,7 +429,7 @@ void GUI::createActions()
|
||||
|
||||
void GUI::createMenus()
|
||||
{
|
||||
QMenu *fileMenu = menuBar()->addMenu(tr("File"));
|
||||
QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
|
||||
fileMenu->addAction(_openFileAction);
|
||||
fileMenu->addSeparator();
|
||||
fileMenu->addAction(_printFileAction);
|
||||
@ -418,7 +443,7 @@ void GUI::createMenus()
|
||||
fileMenu->addAction(_exitAction);
|
||||
#endif // Q_OS_MAC
|
||||
|
||||
_mapMenu = menuBar()->addMenu(tr("Map"));
|
||||
_mapMenu = menuBar()->addMenu(tr("&Map"));
|
||||
_mapMenu->addActions(_mapActions);
|
||||
_mapsEnd = _mapMenu->addSeparator();
|
||||
_mapMenu->addAction(_loadMapAction);
|
||||
@ -426,7 +451,7 @@ void GUI::createMenus()
|
||||
_mapMenu->addSeparator();
|
||||
_mapMenu->addAction(_showMapAction);
|
||||
|
||||
QMenu *graphMenu = menuBar()->addMenu(tr("Graph"));
|
||||
QMenu *graphMenu = menuBar()->addMenu(tr("&Graph"));
|
||||
graphMenu->addAction(_distanceGraphAction);
|
||||
graphMenu->addAction(_timeGraphAction);
|
||||
graphMenu->addSeparator();
|
||||
@ -435,7 +460,7 @@ void GUI::createMenus()
|
||||
graphMenu->addSeparator();
|
||||
graphMenu->addAction(_showGraphsAction);
|
||||
|
||||
QMenu *poiMenu = menuBar()->addMenu(tr("POI"));
|
||||
QMenu *poiMenu = menuBar()->addMenu(tr("&POI"));
|
||||
_poiFilesMenu = poiMenu->addMenu(tr("POI files"));
|
||||
_poiFilesMenu->addActions(_poiFilesActions);
|
||||
poiMenu->addSeparator();
|
||||
@ -447,7 +472,7 @@ void GUI::createMenus()
|
||||
poiMenu->addSeparator();
|
||||
poiMenu->addAction(_showPOIAction);
|
||||
|
||||
QMenu *dataMenu = menuBar()->addMenu(tr("Data"));
|
||||
QMenu *dataMenu = menuBar()->addMenu(tr("&Data"));
|
||||
QMenu *displayMenu = dataMenu->addMenu(tr("Display"));
|
||||
displayMenu->addAction(_showWaypointLabelsAction);
|
||||
displayMenu->addAction(_showRouteWaypointsAction);
|
||||
@ -456,20 +481,25 @@ void GUI::createMenus()
|
||||
dataMenu->addAction(_showRoutesAction);
|
||||
dataMenu->addAction(_showWaypointsAction);
|
||||
|
||||
QMenu *settingsMenu = menuBar()->addMenu(tr("Settings"));
|
||||
QMenu *settingsMenu = menuBar()->addMenu(tr("&Settings"));
|
||||
QMenu *timeMenu = settingsMenu->addMenu(tr("Time"));
|
||||
timeMenu->addAction(_totalTimeAction);
|
||||
timeMenu->addAction(_movingTimeAction);
|
||||
QMenu *unitsMenu = settingsMenu->addMenu(tr("Units"));
|
||||
unitsMenu->addAction(_metricUnitsAction);
|
||||
unitsMenu->addAction(_imperialUnitsAction);
|
||||
unitsMenu->addAction(_nauticalUnitsAction);
|
||||
QMenu *coordinatesMenu = settingsMenu->addMenu(tr("Coordinates format"));
|
||||
coordinatesMenu->addAction(_decimalDegreesAction);
|
||||
coordinatesMenu->addAction(_degreesMinutesAction);
|
||||
coordinatesMenu->addAction(_DMSAction);
|
||||
settingsMenu->addSeparator();
|
||||
settingsMenu->addAction(_showToolbarsAction);
|
||||
settingsMenu->addAction(_fullscreenAction);
|
||||
settingsMenu->addSeparator();
|
||||
settingsMenu->addAction(_openOptionsAction);
|
||||
|
||||
QMenu *helpMenu = menuBar()->addMenu(tr("Help"));
|
||||
QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
|
||||
helpMenu->addAction(_pathsAction);
|
||||
helpMenu->addAction(_keysAction);
|
||||
helpMenu->addSeparator();
|
||||
@ -634,11 +664,13 @@ void GUI::paths()
|
||||
void GUI::openFile()
|
||||
{
|
||||
QStringList files = QFileDialog::getOpenFileNames(this, tr("Open file"),
|
||||
QString(), Data::formats());
|
||||
_dataDir, Data::formats());
|
||||
QStringList list = files;
|
||||
|
||||
for (QStringList::Iterator it = list.begin(); it != list.end(); it++)
|
||||
openFile(*it);
|
||||
if (!list.isEmpty())
|
||||
_dataDir = QFileInfo(list.first()).path();
|
||||
}
|
||||
|
||||
bool GUI::openFile(const QString &fileName)
|
||||
@ -723,11 +755,13 @@ bool GUI::loadFile(const QString &fileName)
|
||||
void GUI::openPOIFile()
|
||||
{
|
||||
QStringList files = QFileDialog::getOpenFileNames(this, tr("Open POI file"),
|
||||
QString(), Data::formats());
|
||||
_poiDir, Data::formats());
|
||||
QStringList list = files;
|
||||
|
||||
for (QStringList::Iterator it = list.begin(); it != list.end(); it++)
|
||||
openPOIFile(*it);
|
||||
if (!list.isEmpty())
|
||||
_poiDir = QFileInfo(list.first()).path();
|
||||
}
|
||||
|
||||
bool GUI::openPOIFile(const QString &fileName)
|
||||
@ -1099,11 +1133,13 @@ void GUI::showGraphSliderInfo(bool show)
|
||||
void GUI::loadMap()
|
||||
{
|
||||
QStringList files = QFileDialog::getOpenFileNames(this, tr("Open map file"),
|
||||
QString(), MapList::formats());
|
||||
_mapDir, MapList::formats());
|
||||
QStringList list = files;
|
||||
|
||||
for (QStringList::Iterator it = list.begin(); it != list.end(); it++)
|
||||
loadMap(*it);
|
||||
if (!list.isEmpty())
|
||||
_mapDir = QFileInfo(list.first()).path();
|
||||
}
|
||||
|
||||
bool GUI::loadMap(const QString &fileName)
|
||||
@ -1121,7 +1157,7 @@ bool GUI::loadMap(const QString &fileName)
|
||||
_mapMenu->insertAction(_mapsEnd, a);
|
||||
_showMapAction->setEnabled(true);
|
||||
_clearMapCacheAction->setEnabled(true);
|
||||
_mapActions.last()->activate(QAction::Trigger);
|
||||
_mapActions.last()->trigger();
|
||||
|
||||
return true;
|
||||
} else {
|
||||
@ -1293,6 +1329,11 @@ void GUI::setUnits(Units units)
|
||||
updateStatusBarInfo();
|
||||
}
|
||||
|
||||
void GUI::setCoordinatesFormat(CoordinatesFormat format)
|
||||
{
|
||||
_mapView->setCoordinatesFormat(format);
|
||||
}
|
||||
|
||||
void GUI::setGraphType(GraphType type)
|
||||
{
|
||||
_sliderPos = 0;
|
||||
@ -1363,15 +1404,15 @@ void GUI::keyPressEvent(QKeyEvent *event)
|
||||
|
||||
case TOGGLE_GRAPH_TYPE_KEY:
|
||||
if (_timeGraphAction->isChecked())
|
||||
_distanceGraphAction->activate(QAction::Trigger);
|
||||
_distanceGraphAction->trigger();
|
||||
else
|
||||
_timeGraphAction->activate(QAction::Trigger);
|
||||
_timeGraphAction->trigger();
|
||||
break;
|
||||
case TOGGLE_TIME_TYPE_KEY:
|
||||
if (_movingTimeAction->isChecked())
|
||||
_totalTimeAction->activate(QAction::Trigger);
|
||||
_totalTimeAction->trigger();
|
||||
else
|
||||
_movingTimeAction->activate(QAction::Trigger);
|
||||
_movingTimeAction->trigger();
|
||||
break;
|
||||
|
||||
case Qt::Key_Escape:
|
||||
@ -1438,10 +1479,14 @@ void GUI::writeSettings()
|
||||
TIME_TYPE_DEFAULT)
|
||||
settings.setValue(TIME_TYPE_SETTING, _movingTimeAction->isChecked()
|
||||
? Moving : Total);
|
||||
if ((_imperialUnitsAction->isChecked() ? Imperial : Metric) !=
|
||||
UNITS_DEFAULT)
|
||||
settings.setValue(UNITS_SETTING, _imperialUnitsAction->isChecked()
|
||||
? Imperial : Metric);
|
||||
Units units = _imperialUnitsAction->isChecked() ? Imperial
|
||||
: _nauticalUnitsAction->isChecked() ? Nautical : Metric;
|
||||
if (units != UNITS_DEFAULT)
|
||||
settings.setValue(UNITS_SETTING, units);
|
||||
CoordinatesFormat format = _DMSAction->isChecked() ? DMS
|
||||
: _degreesMinutesAction->isChecked() ? DegreesMinutes : DecimalDegrees;
|
||||
if (format != COORDINATES_DEFAULT)
|
||||
settings.setValue(COORDINATES_SETTING, format);
|
||||
if (_showToolbarsAction->isChecked() != SHOW_TOOLBARS_DEFAULT)
|
||||
settings.setValue(SHOW_TOOLBARS_SETTING,
|
||||
_showToolbarsAction->isChecked());
|
||||
@ -1601,6 +1646,7 @@ void GUI::writeSettings()
|
||||
|
||||
void GUI::readSettings()
|
||||
{
|
||||
int value;
|
||||
QSettings settings(APP_NAME, APP_NAME);
|
||||
|
||||
settings.beginGroup(WINDOW_SETTINGS_GROUP);
|
||||
@ -1610,20 +1656,27 @@ void GUI::readSettings()
|
||||
|
||||
settings.beginGroup(SETTINGS_SETTINGS_GROUP);
|
||||
if (settings.value(TIME_TYPE_SETTING, TIME_TYPE_DEFAULT).toInt()
|
||||
== Moving) {
|
||||
setTimeType(Moving);
|
||||
_movingTimeAction->setChecked(true);
|
||||
} else {
|
||||
setTimeType(Total);
|
||||
_totalTimeAction->setChecked(true);
|
||||
}
|
||||
if (settings.value(UNITS_SETTING, UNITS_DEFAULT).toInt() == Imperial) {
|
||||
setUnits(Imperial);
|
||||
_imperialUnitsAction->setChecked(true);
|
||||
} else {
|
||||
setUnits(Metric);
|
||||
_metricUnitsAction->setChecked(true);
|
||||
}
|
||||
== Moving)
|
||||
_movingTimeAction->trigger();
|
||||
else
|
||||
_totalTimeAction->trigger();
|
||||
|
||||
value = settings.value(UNITS_SETTING, UNITS_DEFAULT).toInt();
|
||||
if (value == Imperial)
|
||||
_imperialUnitsAction->trigger();
|
||||
else if (value == Nautical)
|
||||
_nauticalUnitsAction->trigger();
|
||||
else
|
||||
_metricUnitsAction->trigger();
|
||||
|
||||
value = settings.value(COORDINATES_SETTING, COORDINATES_DEFAULT).toInt();
|
||||
if (value == DMS)
|
||||
_DMSAction->trigger();
|
||||
else if (value == DegreesMinutes)
|
||||
_degreesMinutesAction->trigger();
|
||||
else
|
||||
_decimalDegreesAction->trigger();
|
||||
|
||||
if (!settings.value(SHOW_TOOLBARS_SETTING, SHOW_TOOLBARS_DEFAULT).toBool())
|
||||
showToolbars(false);
|
||||
else
|
||||
@ -1633,6 +1686,8 @@ void GUI::readSettings()
|
||||
settings.beginGroup(MAP_SETTINGS_GROUP);
|
||||
if (settings.value(SHOW_MAP_SETTING, SHOW_MAP_DEFAULT).toBool())
|
||||
_showMapAction->setChecked(true);
|
||||
else
|
||||
_mapView->showMap(false);
|
||||
if (_ml->maps().count()) {
|
||||
int index = mapIndex(settings.value(CURRENT_MAP_SETTING).toString());
|
||||
_mapActions.at(index)->trigger();
|
||||
@ -1867,7 +1922,8 @@ int GUI::mapIndex(const QString &name)
|
||||
|
||||
Units GUI::units() const
|
||||
{
|
||||
return _imperialUnitsAction->isChecked() ? Imperial : Metric;
|
||||
return _imperialUnitsAction->isChecked() ? Imperial
|
||||
: _nauticalUnitsAction->isChecked() ? Nautical : Metric;
|
||||
}
|
||||
|
||||
qreal GUI::distance() const
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "data/poi.h"
|
||||
#include "units.h"
|
||||
#include "timetype.h"
|
||||
#include "format.h"
|
||||
#include "exportdialog.h"
|
||||
#include "optionsdialog.h"
|
||||
|
||||
@ -73,8 +74,12 @@ private slots:
|
||||
void setMovingTime() {setTimeType(Moving);}
|
||||
void setMetricUnits() {setUnits(Metric);}
|
||||
void setImperialUnits() {setUnits(Imperial);}
|
||||
void setNauticalUnits() {setUnits(Nautical);}
|
||||
void setDistanceGraph() {setGraphType(Distance);}
|
||||
void setTimeGraph() {setGraphType(Time);}
|
||||
void setDecimalDegrees() {setCoordinatesFormat(DecimalDegrees);}
|
||||
void setDegreesMinutes() {setCoordinatesFormat(DegreesMinutes);}
|
||||
void setDMS() {setCoordinatesFormat(DMS);}
|
||||
|
||||
void sliderPositionChanged(qreal pos);
|
||||
|
||||
@ -111,6 +116,7 @@ private:
|
||||
Units units() const;
|
||||
void setTimeType(TimeType type);
|
||||
void setUnits(Units units);
|
||||
void setCoordinatesFormat(CoordinatesFormat format);
|
||||
void setGraphType(GraphType type);
|
||||
|
||||
qreal distance() const;
|
||||
@ -165,6 +171,10 @@ private:
|
||||
QAction *_firstAction;
|
||||
QAction *_metricUnitsAction;
|
||||
QAction *_imperialUnitsAction;
|
||||
QAction *_nauticalUnitsAction;
|
||||
QAction *_decimalDegreesAction;
|
||||
QAction *_degreesMinutesAction;
|
||||
QAction *_DMSAction;
|
||||
QAction *_totalTimeAction;
|
||||
QAction *_movingTimeAction;
|
||||
QAction *_nextMapAction;
|
||||
@ -214,6 +224,8 @@ private:
|
||||
|
||||
Export _export;
|
||||
Options _options;
|
||||
|
||||
QString _dataDir, _mapDir, _poiDir;
|
||||
};
|
||||
|
||||
#endif // GUI_H
|
||||
|
@ -23,7 +23,7 @@ void InfoItem::updateBoundingRect()
|
||||
|
||||
for (i = _list.constBegin(); i != _list.constEnd(); i++) {
|
||||
width += fm.width(i->key + ": ");
|
||||
width += fm.width(i->value) + ((i == _list.end() - 1) ? 0 : PADDING);
|
||||
width += fm.width(i->value) + ((i == _list.constEnd() - 1) ? 0 : PADDING);
|
||||
}
|
||||
|
||||
_boundingRect = QRectF(0, 0, width, _list.isEmpty() ? 0 : fm.height());
|
||||
@ -49,8 +49,8 @@ void InfoItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||
painter->drawText(width, fm.height() - fm.descent(), i->key + ": ");
|
||||
width += fm.width(i->key + ": ");
|
||||
painter->drawText(width, fm.height() - fm.descent(), i->value);
|
||||
width += fm.width(i->value) + ((i == _list.end() - 1) ? 0 : PADDING);
|
||||
if (i != _list.end() - 1) {
|
||||
width += fm.width(i->value) + ((i == _list.constEnd() - 1) ? 0 : PADDING);
|
||||
if (i != _list.constEnd() - 1) {
|
||||
painter->save();
|
||||
painter->setPen(Qt::gray);
|
||||
painter->drawLine(width - PADDING/2, fm.descent(),
|
||||
|
@ -49,6 +49,7 @@ MapView::MapView(Map *map, POI *poi, QWidget *parent)
|
||||
connect(_poi, SIGNAL(pointsChanged()), this, SLOT(updatePOI()));
|
||||
|
||||
_units = Metric;
|
||||
_coordinatesFormat = DecimalDegrees;
|
||||
_opacity = 1.0;
|
||||
_backgroundColor = Qt::white;
|
||||
_markerColor = Qt::red;
|
||||
@ -75,6 +76,7 @@ MapView::MapView(Map *map, POI *poi, QWidget *parent)
|
||||
_digitalZoom = 0;
|
||||
|
||||
_map->setBackgroundColor(_backgroundColor);
|
||||
_res = _map->resolution(_map->bounds());
|
||||
_scene->setSceneRect(_map->bounds());
|
||||
|
||||
centerOn(_scene->sceneRect().center());
|
||||
@ -83,18 +85,8 @@ MapView::MapView(Map *map, POI *poi, QWidget *parent)
|
||||
void MapView::centerOn(const QPointF &pos)
|
||||
{
|
||||
QGraphicsView::centerOn(pos);
|
||||
|
||||
/* Fix the offset caused by QGraphicsView::centerOn() approximation */
|
||||
QPointF center = mapToScene(viewport()->rect().center());
|
||||
QPoint offset((int)(pos.x() - center.x()), (int)(pos.y() - center.y()));
|
||||
if (qAbs(offset.x()) == 1)
|
||||
horizontalScrollBar()->setValue(horizontalScrollBar()->value()
|
||||
+ offset.x());
|
||||
if (qAbs(offset.y()) == 1)
|
||||
verticalScrollBar()->setValue(verticalScrollBar()->value()
|
||||
+ offset.y());
|
||||
|
||||
_res = _map->resolution(pos);
|
||||
QRectF vr(mapToScene(viewport()->rect()).boundingRect());
|
||||
_res = _map->resolution(vr);
|
||||
_mapScale->setResolution(_res);
|
||||
}
|
||||
|
||||
@ -137,6 +129,7 @@ PathItem *MapView::addRoute(const Route &route)
|
||||
ri->setWidth(_routeWidth);
|
||||
ri->setStyle(_routeStyle);
|
||||
ri->setUnits(_units);
|
||||
ri->setCoordinatesFormat(_coordinatesFormat);
|
||||
ri->setVisible(_showRoutes);
|
||||
ri->showWaypoints(_showRouteWaypoints);
|
||||
ri->showWaypointLabels(_showWaypointLabels);
|
||||
@ -157,12 +150,12 @@ void MapView::addWaypoints(const QList<Waypoint> &waypoints)
|
||||
|
||||
WaypointItem *wi = new WaypointItem(w, _map);
|
||||
_waypoints.append(wi);
|
||||
_wr.unite(wi->waypoint().coordinates());
|
||||
_wr = _wr.united(wi->waypoint().coordinates());
|
||||
wi->setZValue(1);
|
||||
wi->setSize(_waypointSize);
|
||||
wi->setColor(_waypointColor);
|
||||
wi->showLabel(_showWaypointLabels);
|
||||
wi->setUnits(_units);
|
||||
wi->setToolTipFormat(_units, _coordinatesFormat);
|
||||
wi->setVisible(_showWaypoints);
|
||||
wi->setDigitalZoom(_digitalZoom);
|
||||
_scene->addItem(wi);
|
||||
@ -175,7 +168,7 @@ void MapView::addWaypoints(const QList<Waypoint> &waypoints)
|
||||
QList<PathItem *> MapView::loadData(const Data &data)
|
||||
{
|
||||
QList<PathItem *> paths;
|
||||
qreal zoom = _map->zoom();
|
||||
int zoom = _map->zoom();
|
||||
|
||||
for (int i = 0; i < data.tracks().count(); i++)
|
||||
paths.append(addTrack(*(data.tracks().at(i))));
|
||||
@ -186,7 +179,7 @@ QList<PathItem *> MapView::loadData(const Data &data)
|
||||
if (_tracks.empty() && _routes.empty() && _waypoints.empty())
|
||||
return paths;
|
||||
|
||||
if (mapZoom() != zoom)
|
||||
if (fitMapZoom() != zoom)
|
||||
rescale();
|
||||
else
|
||||
updatePOIVisibility();
|
||||
@ -196,13 +189,13 @@ QList<PathItem *> MapView::loadData(const Data &data)
|
||||
return paths;
|
||||
}
|
||||
|
||||
qreal MapView::mapZoom() const
|
||||
int MapView::fitMapZoom() const
|
||||
{
|
||||
RectC br = _tr | _rr | _wr;
|
||||
|
||||
return _map->zoomFit(viewport()->size() - QSize(2*MARGIN, 2*MARGIN),
|
||||
br.isNull() ? RectC(_map->xy2ll(sceneRect().topLeft()),
|
||||
_map->xy2ll(sceneRect().bottomRight())) : br);
|
||||
br.isNull() ? RectC(_map->xy2ll(_map->bounds().topLeft()),
|
||||
_map->xy2ll(_map->bounds().bottomRight())) : br);
|
||||
}
|
||||
|
||||
QPointF MapView::contentCenter() const
|
||||
@ -265,9 +258,9 @@ void MapView::setPalette(const Palette &palette)
|
||||
|
||||
void MapView::setMap(Map *map)
|
||||
{
|
||||
QPointF pos = mapToScene(viewport()->rect().center());
|
||||
Coordinates center = _map->xy2ll(pos);
|
||||
qreal resolution = _map->resolution(pos);
|
||||
QRectF vr(mapToScene(viewport()->rect()).boundingRect()
|
||||
.intersected(_map->bounds()));
|
||||
RectC cr(_map->xy2ll(vr.topLeft()), _map->xy2ll(vr.bottomRight()));
|
||||
|
||||
_map->unload();
|
||||
disconnect(_map, SIGNAL(loaded()), this, SLOT(reloadMap()));
|
||||
@ -279,7 +272,7 @@ void MapView::setMap(Map *map)
|
||||
|
||||
digitalZoom(0);
|
||||
|
||||
_map->zoomFit(resolution, center);
|
||||
_map->zoomFit(viewport()->rect().size(), cr);
|
||||
_scene->setSceneRect(_map->bounds());
|
||||
|
||||
for (int i = 0; i < _tracks.size(); i++)
|
||||
@ -294,7 +287,10 @@ void MapView::setMap(Map *map)
|
||||
it.value()->setMap(_map);
|
||||
updatePOIVisibility();
|
||||
|
||||
centerOn(_map->ll2xy(center));
|
||||
QPointF oc = vr.center();
|
||||
QPointF nc = _map->ll2xy(cr.center());
|
||||
if (qAbs(oc.x() - nc.x()) >= 1.0 || qAbs(oc.y() - nc.y()) >= 1.0)
|
||||
centerOn(nc);
|
||||
|
||||
resetCachedContent();
|
||||
QPixmapCache::clear();
|
||||
@ -348,34 +344,58 @@ void MapView::addPOI(const QList<Waypoint> &waypoints)
|
||||
pi->showLabel(_showPOILabels);
|
||||
pi->setVisible(_showPOI);
|
||||
pi->setDigitalZoom(_digitalZoom);
|
||||
pi->setToolTipFormat(_units, _coordinatesFormat);
|
||||
_scene->addItem(pi);
|
||||
|
||||
_pois.insert(SearchPointer<Waypoint>(&(pi->waypoint())), pi);
|
||||
}
|
||||
}
|
||||
|
||||
void MapView::setUnits(enum Units units)
|
||||
void MapView::setUnits(Units units)
|
||||
{
|
||||
if (_units == units)
|
||||
return;
|
||||
|
||||
_units = units;
|
||||
|
||||
_mapScale->setUnits(units);
|
||||
_mapScale->setUnits(_units);
|
||||
|
||||
for (int i = 0; i < _tracks.count(); i++)
|
||||
_tracks[i]->setUnits(units);
|
||||
_tracks[i]->setUnits(_units);
|
||||
for (int i = 0; i < _routes.count(); i++)
|
||||
_routes[i]->setUnits(units);
|
||||
_routes[i]->setUnits(_units);
|
||||
for (int i = 0; i < _waypoints.size(); i++)
|
||||
_waypoints.at(i)->setUnits(units);
|
||||
_waypoints.at(i)->setToolTipFormat(_units, _coordinatesFormat);
|
||||
|
||||
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||
it.value()->setUnits(units);
|
||||
it.value()->setToolTipFormat(_units, _coordinatesFormat);
|
||||
}
|
||||
|
||||
void MapView::setCoordinatesFormat(CoordinatesFormat format)
|
||||
{
|
||||
if (_coordinatesFormat == format)
|
||||
return;
|
||||
|
||||
_coordinatesFormat = format;
|
||||
|
||||
for (int i = 0; i < _waypoints.count(); i++)
|
||||
_waypoints.at(i)->setToolTipFormat(_units, _coordinatesFormat);
|
||||
for (int i = 0; i < _routes.count(); i++)
|
||||
_routes[i]->setCoordinatesFormat(_coordinatesFormat);
|
||||
|
||||
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||
it.value()->setToolTipFormat(_units, _coordinatesFormat);
|
||||
}
|
||||
|
||||
void MapView::clearMapCache()
|
||||
{
|
||||
_map->clearCache();
|
||||
resetCachedContent();
|
||||
|
||||
fitMapZoom();
|
||||
rescale();
|
||||
centerOn(contentCenter());
|
||||
}
|
||||
|
||||
void MapView::digitalZoom(int zoom)
|
||||
@ -476,9 +496,9 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
|
||||
bool hires)
|
||||
{
|
||||
QRect orig, adj;
|
||||
qreal ratio, diff, origRes, q;
|
||||
qreal ratio, diff, q;
|
||||
QPointF origScene, origPos;
|
||||
Coordinates origLL;
|
||||
RectC origC;
|
||||
|
||||
|
||||
// Enter plot mode
|
||||
@ -503,9 +523,9 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
|
||||
|
||||
// Adjust the view for printing
|
||||
if (hires) {
|
||||
origScene = mapToScene(orig.center());
|
||||
origLL = _map->xy2ll(origScene);
|
||||
origRes = _map->resolution(origScene);
|
||||
QRectF vr(mapToScene(orig).boundingRect());
|
||||
origC = RectC(_map->xy2ll(vr.topLeft()), _map->xy2ll(vr.bottomRight()));
|
||||
origScene = vr.center();
|
||||
|
||||
QPointF s(painter->device()->logicalDpiX()
|
||||
/ (qreal)metric(QPaintDevice::PdmDpiX),
|
||||
@ -535,7 +555,7 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
|
||||
|
||||
// Revert view changes to display mode
|
||||
if (hires) {
|
||||
_map->zoomFit(origRes, origLL);
|
||||
_map->zoomFit(orig.size(), origC);
|
||||
rescale();
|
||||
centerOn(origScene);
|
||||
}
|
||||
@ -738,25 +758,22 @@ void MapView::setBackgroundColor(const QColor &color)
|
||||
|
||||
void MapView::drawBackground(QPainter *painter, const QRectF &rect)
|
||||
{
|
||||
painter->fillRect(rect, _backgroundColor);
|
||||
|
||||
if (_showMap) {
|
||||
QRectF ir = rect.intersected(_map->bounds());
|
||||
|
||||
if (_opacity < 1.0 || ir != rect)
|
||||
painter->fillRect(rect, _backgroundColor);
|
||||
if (_opacity < 1.0)
|
||||
painter->setOpacity(_opacity);
|
||||
|
||||
_map->draw(painter, ir);
|
||||
} else
|
||||
painter->fillRect(rect, _backgroundColor);
|
||||
}
|
||||
}
|
||||
|
||||
void MapView::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QGraphicsView::resizeEvent(event);
|
||||
|
||||
qreal zoom = _map->zoom();
|
||||
if (mapZoom() != zoom)
|
||||
int zoom = _map->zoom();
|
||||
if (fitMapZoom() != zoom)
|
||||
rescale();
|
||||
|
||||
centerOn(contentCenter());
|
||||
@ -777,8 +794,8 @@ void MapView::scrollContentsBy(int dx, int dy)
|
||||
{
|
||||
QGraphicsView::scrollContentsBy(dx, dy);
|
||||
|
||||
QPointF center = mapToScene(viewport()->rect().center());
|
||||
qreal res = _map->resolution(center);
|
||||
QRectF sr(mapToScene(viewport()->rect()).boundingRect());
|
||||
qreal res = _map->resolution(sr);
|
||||
|
||||
if (qMax(res, _res) / qMin(res, _res) > 1.1) {
|
||||
_mapScale->setResolution(res);
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "data/waypoint.h"
|
||||
#include "searchpointer.h"
|
||||
#include "units.h"
|
||||
#include "format.h"
|
||||
#include "palette.h"
|
||||
|
||||
class Data;
|
||||
@ -34,12 +35,13 @@ public:
|
||||
void setPalette(const Palette &palette);
|
||||
void setPOI(POI *poi);
|
||||
void setMap(Map *map);
|
||||
void setUnits(enum Units units);
|
||||
|
||||
void plot(QPainter *painter, const QRectF &target, qreal scale, bool hires);
|
||||
|
||||
void clear();
|
||||
|
||||
void setUnits(Units units);
|
||||
void setMarkerColor(const QColor &color);
|
||||
void setTrackWidth(int width);
|
||||
void setRouteWidth(int width);
|
||||
void setTrackStyle(Qt::PenStyle style);
|
||||
@ -52,7 +54,6 @@ public:
|
||||
void setBackgroundColor(const QColor &color);
|
||||
void useOpenGL(bool use);
|
||||
void useAntiAliasing(bool use);
|
||||
void setMarkerColor(const QColor &color);
|
||||
|
||||
public slots:
|
||||
void showMap(bool show);
|
||||
@ -65,6 +66,7 @@ public slots:
|
||||
void showWaypoints(bool show);
|
||||
void showRouteWaypoints(bool show);
|
||||
void clearMapCache();
|
||||
void setCoordinatesFormat(CoordinatesFormat format);
|
||||
|
||||
private slots:
|
||||
void updatePOI();
|
||||
@ -78,7 +80,7 @@ private:
|
||||
void loadPOI();
|
||||
void clearPOI();
|
||||
|
||||
qreal mapZoom() const;
|
||||
int fitMapZoom() const;
|
||||
QPointF contentCenter() const;
|
||||
void rescale();
|
||||
void centerOn(const QPointF &pos);
|
||||
@ -108,6 +110,7 @@ private:
|
||||
POI *_poi;
|
||||
Palette _palette;
|
||||
Units _units;
|
||||
CoordinatesFormat _coordinatesFormat;
|
||||
|
||||
qreal _opacity;
|
||||
QColor _backgroundColor;
|
||||
|
@ -25,11 +25,13 @@ private:
|
||||
qreal _left, _top, _right, _bottom;
|
||||
};
|
||||
|
||||
#ifndef QT_NO_DEBUG
|
||||
inline QDebug operator<<(QDebug dbg, const MarginsF &margins)
|
||||
{
|
||||
dbg.nospace() << "MarginsF(" << margins.left() << ", " << margins.top()
|
||||
<< ", " << margins.right() << margins.bottom() << ")";
|
||||
return dbg.space();
|
||||
}
|
||||
#endif // QT_NO_DEBUG
|
||||
|
||||
#endif // MARGINS_H
|
||||
|
@ -291,6 +291,9 @@ QWidget *OptionsDialog::createDataPage()
|
||||
if (_options->units == Imperial) {
|
||||
_pauseSpeed->setValue(_options->pauseSpeed * MS2MIH);
|
||||
_pauseSpeed->setSuffix(UNIT_SPACE + tr("mi/h"));
|
||||
} else if (_options->units == Nautical) {
|
||||
_pauseSpeed->setValue(_options->pauseSpeed * MS2KN);
|
||||
_pauseSpeed->setSuffix(UNIT_SPACE + tr("kn"));
|
||||
} else {
|
||||
_pauseSpeed->setValue(_options->pauseSpeed * MS2KMH);
|
||||
_pauseSpeed->setSuffix(UNIT_SPACE + tr("km/h"));
|
||||
@ -323,6 +326,9 @@ QWidget *OptionsDialog::createPOIPage()
|
||||
if (_options->units == Imperial) {
|
||||
_poiRadius->setValue(_options->poiRadius / MIINM);
|
||||
_poiRadius->setSuffix(UNIT_SPACE + tr("mi"));
|
||||
} else if (_options->units == Nautical) {
|
||||
_poiRadius->setValue(_options->poiRadius / NMIINM);
|
||||
_poiRadius->setSuffix(UNIT_SPACE + tr("nmi"));
|
||||
} else {
|
||||
_poiRadius->setValue(_options->poiRadius / KMINM);
|
||||
_poiRadius->setSuffix(UNIT_SPACE + tr("km"));
|
||||
@ -525,13 +531,15 @@ void OptionsDialog::accept()
|
||||
_options->powerFilter = _powerFilter->value();
|
||||
_options->outlierEliminate = _outlierEliminate->isChecked();
|
||||
qreal pauseSpeed = (_options->units == Imperial)
|
||||
? _pauseSpeed->value() / MS2MIH : _pauseSpeed->value() / MS2KMH;
|
||||
? _pauseSpeed->value() / MS2MIH : (_options->units == Nautical)
|
||||
? _pauseSpeed->value() / MS2KN : _pauseSpeed->value() / MS2KMH;
|
||||
if (qAbs(pauseSpeed - _options->pauseSpeed) > 0.01)
|
||||
_options->pauseSpeed = pauseSpeed;
|
||||
_options->pauseInterval = _pauseInterval->value();
|
||||
|
||||
qreal poiRadius = (_options->units == Imperial)
|
||||
? _poiRadius->value() * MIINM : _poiRadius->value() * KMINM;
|
||||
? _poiRadius->value() * MIINM : (_options->units == Nautical)
|
||||
? _poiRadius->value() * NMIINM : _poiRadius->value() * KMINM;
|
||||
if (qAbs(poiRadius - _options->poiRadius) > 0.01)
|
||||
_options->poiRadius = poiRadius;
|
||||
|
||||
|
@ -37,9 +37,11 @@ void Palette::reset()
|
||||
_state = _h;
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG
|
||||
QDebug operator<<(QDebug dbg, const Palette &palette)
|
||||
{
|
||||
dbg.nospace() << "Palette(" << palette.color() << ", " << palette.shift()
|
||||
<< ")";
|
||||
return dbg.space();
|
||||
}
|
||||
#endif // QT_NO_DEBUG
|
||||
|
@ -28,6 +28,8 @@ private:
|
||||
qreal _state;
|
||||
};
|
||||
|
||||
#ifndef QT_NO_DEBUG
|
||||
QDebug operator<<(QDebug dbg, const Palette &palette);
|
||||
#endif // QT_NO_DEBUG
|
||||
|
||||
#endif // PALLETE_H
|
||||
|
@ -30,6 +30,8 @@ RouteItem::RouteItem(const Route &route, Map *map, QGraphicsItem *parent)
|
||||
|
||||
_name = route.name();
|
||||
_desc = route.description();
|
||||
_units = Metric;
|
||||
_coordinatesFormat = DecimalDegrees;
|
||||
|
||||
setToolTip(toolTip(Metric));
|
||||
}
|
||||
@ -47,9 +49,38 @@ void RouteItem::setMap(Map *map)
|
||||
PathItem::setMap(map);
|
||||
}
|
||||
|
||||
void RouteItem::setUnits(enum Units units)
|
||||
void RouteItem::setUnits(Units units)
|
||||
{
|
||||
setToolTip(toolTip(units));
|
||||
if (_units == units)
|
||||
return;
|
||||
|
||||
_units = units;
|
||||
|
||||
setToolTip(toolTip(_units));
|
||||
|
||||
QList<QGraphicsItem *> childs = childItems();
|
||||
for (int i = 0; i < childs.count(); i++) {
|
||||
if (childs.at(i) != _marker) {
|
||||
WaypointItem *wi = static_cast<WaypointItem*>(childs.at(i));
|
||||
wi->setToolTipFormat(_units, _coordinatesFormat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RouteItem::setCoordinatesFormat(CoordinatesFormat format)
|
||||
{
|
||||
if (_coordinatesFormat == format)
|
||||
return;
|
||||
|
||||
_coordinatesFormat = format;
|
||||
|
||||
QList<QGraphicsItem *> childs = childItems();
|
||||
for (int i = 0; i < childs.count(); i++) {
|
||||
if (childs.at(i) != _marker) {
|
||||
WaypointItem *wi = static_cast<WaypointItem*>(childs.at(i));
|
||||
wi->setToolTipFormat(_units, _coordinatesFormat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RouteItem::showWaypoints(bool show)
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "data/route.h"
|
||||
#include "pathitem.h"
|
||||
#include "units.h"
|
||||
#include "format.h"
|
||||
|
||||
class Map;
|
||||
|
||||
@ -17,6 +18,7 @@ public:
|
||||
void setMap(Map *map);
|
||||
|
||||
void setUnits(Units units);
|
||||
void setCoordinatesFormat(CoordinatesFormat format);
|
||||
void showWaypoints(bool show);
|
||||
void showWaypointLabels(bool show);
|
||||
|
||||
@ -25,6 +27,8 @@ private:
|
||||
|
||||
QString _name;
|
||||
QString _desc;
|
||||
Units _units;
|
||||
CoordinatesFormat _coordinatesFormat;
|
||||
};
|
||||
|
||||
#endif // ROUTEITEM_H
|
||||
|
@ -82,6 +82,9 @@ QString ScaleItem::units() const
|
||||
if (_units == Imperial)
|
||||
return _scale ? qApp->translate("ScaleItem", "mi")
|
||||
: qApp->translate("ScaleItem", "ft");
|
||||
else if (_units == Nautical)
|
||||
return _scale ? qApp->translate("ScaleItem", "nmi")
|
||||
: qApp->translate("ScaleItem", "ft");
|
||||
else
|
||||
return _scale ? qApp->translate("ScaleItem", "km")
|
||||
: qApp->translate("ScaleItem", "m");
|
||||
@ -94,8 +97,18 @@ void ScaleItem::computeScale()
|
||||
if (_units == Imperial) {
|
||||
_length = niceNum((res * M2FT * SCALE_WIDTH) / SEGMENTS, 1);
|
||||
if (_length >= MIINFT) {
|
||||
_length = niceNum((res * M2FT * FT2MI * SCALE_WIDTH) / SEGMENTS, 1);
|
||||
_width = (_length / (res * M2FT * FT2MI));
|
||||
_length = niceNum((res * M2MI * SCALE_WIDTH) / SEGMENTS, 1);
|
||||
_width = (_length / (res * M2MI));
|
||||
_scale = true;
|
||||
} else {
|
||||
_width = (_length / (res * M2FT));
|
||||
_scale = false;
|
||||
}
|
||||
} else if (_units == Nautical) {
|
||||
_length = niceNum((res * M2FT * SCALE_WIDTH) / SEGMENTS, 1);
|
||||
if (_length >= NMIINFT) {
|
||||
_length = niceNum((res * M2NMI * SCALE_WIDTH) / SEGMENTS, 1);
|
||||
_width = (_length / (res * M2NMI));
|
||||
_scale = true;
|
||||
} else {
|
||||
_width = (_length / (res * M2FT));
|
||||
|
@ -15,6 +15,8 @@
|
||||
#define TIME_TYPE_DEFAULT Total
|
||||
#define UNITS_SETTING "units"
|
||||
#define UNITS_DEFAULT (IMPERIAL_UNITS() ? Imperial : Metric)
|
||||
#define COORDINATES_SETTING "coordinates"
|
||||
#define COORDINATES_DEFAULT DecimalDegrees
|
||||
#define SHOW_TOOLBARS_SETTING "toolbar"
|
||||
#define SHOW_TOOLBARS_DEFAULT true
|
||||
|
||||
|
@ -1,16 +1,18 @@
|
||||
#include "data/data.h"
|
||||
#include "config.h"
|
||||
#include "tooltip.h"
|
||||
#include "format.h"
|
||||
#include "speedgraphitem.h"
|
||||
#include "speedgraph.h"
|
||||
|
||||
|
||||
SpeedGraph::SpeedGraph(QWidget *parent) : GraphTab(parent)
|
||||
{
|
||||
_units = Metric;
|
||||
_timeType = Total;
|
||||
_showTracks = true;
|
||||
|
||||
setYUnits(Metric);
|
||||
setYUnits();
|
||||
setYLabel(tr("Speed"));
|
||||
|
||||
setSliderPrecision(1);
|
||||
@ -19,10 +21,15 @@ SpeedGraph::SpeedGraph(QWidget *parent) : GraphTab(parent)
|
||||
void SpeedGraph::setInfo()
|
||||
{
|
||||
if (_showTracks) {
|
||||
QString pace = Format::timeSpan((3600.0 / (avg() * yScale())), false);
|
||||
QString pu = (_units == Metric) ? tr("min/km") : (_units == Imperial) ?
|
||||
tr("min/mi") : tr("min/nmi");
|
||||
|
||||
GraphView::addInfo(tr("Average"), QString::number(avg() * yScale(), 'f',
|
||||
1) + UNIT_SPACE + yUnits());
|
||||
GraphView::addInfo(tr("Maximum"), QString::number(max() * yScale(), 'f',
|
||||
1) + UNIT_SPACE + yUnits());
|
||||
GraphView::addInfo(tr("Pace"), pace + UNIT_SPACE + pu);
|
||||
} else
|
||||
clearInfo();
|
||||
}
|
||||
@ -77,20 +84,25 @@ void SpeedGraph::clear()
|
||||
GraphView::clear();
|
||||
}
|
||||
|
||||
void SpeedGraph::setYUnits(Units units)
|
||||
void SpeedGraph::setYUnits()
|
||||
{
|
||||
if (units == Metric) {
|
||||
GraphView::setYUnits(tr("km/h"));
|
||||
setYScale(MS2KMH);
|
||||
} else {
|
||||
if (_units == Nautical) {
|
||||
GraphView::setYUnits(tr("kn"));
|
||||
setYScale(MS2KN);
|
||||
} else if (_units == Imperial) {
|
||||
GraphView::setYUnits(tr("mi/h"));
|
||||
setYScale(MS2MIH);
|
||||
} else {
|
||||
GraphView::setYUnits(tr("km/h"));
|
||||
setYScale(MS2KMH);
|
||||
}
|
||||
}
|
||||
|
||||
void SpeedGraph::setUnits(Units units)
|
||||
{
|
||||
setYUnits(units);
|
||||
_units = units;
|
||||
|
||||
setYUnits();
|
||||
setInfo();
|
||||
|
||||
GraphView::setUnits(units);
|
||||
|
@ -21,13 +21,14 @@ public:
|
||||
private:
|
||||
qreal avg() const;
|
||||
qreal max() const {return bounds().bottom();}
|
||||
void setYUnits(Units units);
|
||||
void setYUnits();
|
||||
void setInfo();
|
||||
|
||||
QList<QPointF> _avg;
|
||||
QList<QPointF> _mavg;
|
||||
|
||||
enum TimeType _timeType;
|
||||
Units _units;
|
||||
TimeType _timeType;
|
||||
bool _showTracks;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "tooltip.h"
|
||||
#include "format.h"
|
||||
#include "speedgraphitem.h"
|
||||
|
||||
SpeedGraphItem::SpeedGraphItem(const Graph &graph, GraphType type,
|
||||
@ -16,13 +17,20 @@ SpeedGraphItem::SpeedGraphItem(const Graph &graph, GraphType type,
|
||||
QString SpeedGraphItem::toolTip() const
|
||||
{
|
||||
ToolTip tt;
|
||||
qreal scale = (_units == Metric) ? MS2KMH : MS2MIH;
|
||||
QString su = (_units == Metric) ? tr("km/h") : tr("mi/h");
|
||||
qreal scale = (_units == Imperial) ? MS2MIH : (_units == Nautical)
|
||||
? MS2KN : MS2KMH;
|
||||
QString su = (_units == Imperial) ? tr("mi/h") : (_units == Nautical)
|
||||
? tr("kn") : tr("km/h");
|
||||
QString pace = Format::timeSpan((3600.0 / ((_timeType == Total)
|
||||
? avg() * scale : mavg() * scale)), false);
|
||||
QString pu = (_units == Metric) ? tr("min/km") : (_units == Imperial) ?
|
||||
tr("min/mi") : tr("min/nmi");
|
||||
|
||||
tt.insert(tr("Maximum"), QString::number(max() * scale, 'f', 1)
|
||||
+ UNIT_SPACE + su);
|
||||
tt.insert(tr("Average"), QString::number((_timeType == Total)
|
||||
? avg() * scale : mavg() * scale, 'f', 1) + UNIT_SPACE + su);
|
||||
tt.insert(tr("Pace"), pace + UNIT_SPACE + pu);
|
||||
|
||||
return tt.toString();
|
||||
}
|
||||
|
@ -3,14 +3,17 @@
|
||||
|
||||
enum Units {
|
||||
Metric,
|
||||
Imperial
|
||||
Imperial,
|
||||
Nautical
|
||||
};
|
||||
|
||||
#define M2KM 0.001000000000 // m -> km
|
||||
#define M2MI 0.000621371192 // m -> mi
|
||||
#define M2NMI 0.000539956803 // m -> nmi
|
||||
#define M2FT 3.280839900000 // m -> ft
|
||||
#define MS2KMH 3.600000000000 // m/s -> km/h
|
||||
#define MS2MIH 2.236936290000 // m/s -> mi/h
|
||||
#define MS2KN 1.943844490000 // m/s -> kn
|
||||
#define FT2MI 0.000189393939 // ft -> mi
|
||||
#define MM2IN 0.039370100000 // mm -> in
|
||||
#define H2S 0.000277777778 // h -> s
|
||||
@ -18,7 +21,9 @@ enum Units {
|
||||
|
||||
#define KMINM 1000.0 // 1 km in m
|
||||
#define MIINFT 5280.0 // 1 mi in ft
|
||||
#define NMIINFT 6076.11549 // 1 nm in ft
|
||||
#define MIINM 1609.344 // 1 mi in m
|
||||
#define NMIINM 1852.0 // 1 nmi in m
|
||||
#define MININS 60.0 // 1 min in s
|
||||
#define HINS 3600.0 // 1 hins
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include <QApplication>
|
||||
#include <QPainter>
|
||||
#include "config.h"
|
||||
#include "format.h"
|
||||
#include "tooltip.h"
|
||||
#include "waypointitem.h"
|
||||
|
||||
@ -11,14 +10,14 @@
|
||||
#define FS(size) \
|
||||
((int)((qreal)size * 1.41))
|
||||
|
||||
QString WaypointItem::toolTip(Units units)
|
||||
QString WaypointItem::toolTip(Units units, CoordinatesFormat format)
|
||||
{
|
||||
ToolTip tt;
|
||||
|
||||
if (!_waypoint.name().isEmpty())
|
||||
tt.insert(qApp->translate("WaypointItem", "Name"), _waypoint.name());
|
||||
tt.insert(qApp->translate("WaypointItem", "Coordinates"),
|
||||
Format::coordinates(_waypoint.coordinates()));
|
||||
Format::coordinates(_waypoint.coordinates(), format));
|
||||
if (!std::isnan(_waypoint.elevation()))
|
||||
tt.insert(qApp->translate("WaypointItem", "Elevation"),
|
||||
Format::elevation(_waypoint.elevation(), units));
|
||||
@ -44,7 +43,7 @@ WaypointItem::WaypointItem(const Waypoint &waypoint, Map *map,
|
||||
updateShape();
|
||||
|
||||
setPos(map->ll2xy(waypoint.coordinates()));
|
||||
setToolTip(toolTip(Metric));
|
||||
setToolTip(toolTip(Metric, DecimalDegrees));
|
||||
setCursor(Qt::ArrowCursor);
|
||||
setAcceptHoverEvents(true);
|
||||
}
|
||||
@ -108,6 +107,9 @@ void WaypointItem::paint(QPainter *painter,
|
||||
|
||||
void WaypointItem::setSize(int size)
|
||||
{
|
||||
if (_size == size)
|
||||
return;
|
||||
|
||||
prepareGeometryChange();
|
||||
_size = size;
|
||||
updateShape();
|
||||
@ -115,17 +117,23 @@ void WaypointItem::setSize(int size)
|
||||
|
||||
void WaypointItem::setColor(const QColor &color)
|
||||
{
|
||||
if (_color == color)
|
||||
return;
|
||||
|
||||
_color = color;
|
||||
update();
|
||||
}
|
||||
|
||||
void WaypointItem::setUnits(enum Units units)
|
||||
void WaypointItem::setToolTipFormat(Units units, CoordinatesFormat format)
|
||||
{
|
||||
setToolTip(toolTip(units));
|
||||
setToolTip(toolTip(units, format));
|
||||
}
|
||||
|
||||
void WaypointItem::showLabel(bool show)
|
||||
{
|
||||
if (_showLabel == show)
|
||||
return;
|
||||
|
||||
prepareGeometryChange();
|
||||
_showLabel = show;
|
||||
updateShape();
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "data/waypoint.h"
|
||||
#include "map/map.h"
|
||||
#include "units.h"
|
||||
#include "format.h"
|
||||
|
||||
class WaypointItem : public QGraphicsItem
|
||||
{
|
||||
@ -15,7 +16,7 @@ public:
|
||||
const Waypoint &waypoint() const {return _waypoint;}
|
||||
|
||||
void setMap(Map *map) {setPos(map->ll2xy(_waypoint.coordinates()));}
|
||||
void setUnits(Units units);
|
||||
void setToolTipFormat(Units units, CoordinatesFormat format);
|
||||
void setSize(int size);
|
||||
void setColor(const QColor &color);
|
||||
void showLabel(bool show);
|
||||
@ -31,7 +32,7 @@ private:
|
||||
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
||||
|
||||
void updateShape();
|
||||
QString toolTip(Units units);
|
||||
QString toolTip(Units units, CoordinatesFormat format);
|
||||
|
||||
QPainterPath _shape;
|
||||
Waypoint _waypoint;
|
||||
|
@ -1,52 +1,20 @@
|
||||
#include "wgs84.h"
|
||||
#include "coordinates.h"
|
||||
|
||||
#define MIN_LAT deg2rad(-90.0)
|
||||
#define MAX_LAT deg2rad(90.0)
|
||||
#define MIN_LON deg2rad(-180.0)
|
||||
#define MAX_LON deg2rad(180.0)
|
||||
|
||||
qreal Coordinates::distanceTo(const Coordinates &c) const
|
||||
double Coordinates::distanceTo(const Coordinates &c) const
|
||||
{
|
||||
qreal dLat = deg2rad(c.lat() - _lat);
|
||||
qreal dLon = deg2rad(c.lon() - _lon);
|
||||
qreal a = pow(sin(dLat / 2.0), 2.0)
|
||||
double dLat = deg2rad(c.lat() - _lat);
|
||||
double dLon = deg2rad(c.lon() - _lon);
|
||||
double a = pow(sin(dLat / 2.0), 2.0)
|
||||
+ cos(deg2rad(_lat)) * cos(deg2rad(c.lat())) * pow(sin(dLon / 2.0), 2.0);
|
||||
|
||||
return (WGS84_RADIUS * (2.0 * atan2(sqrt(a), sqrt(1.0 - a))));
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG
|
||||
QDebug operator<<(QDebug dbg, const Coordinates &c)
|
||||
{
|
||||
dbg.nospace() << "Coordinates(" << c.lon() << ", " << c.lat() << ")";
|
||||
return dbg.space();
|
||||
}
|
||||
|
||||
QPair<Coordinates, Coordinates> Coordinates::boundingRect(qreal distance) const
|
||||
{
|
||||
qreal radDist = distance / WGS84_RADIUS;
|
||||
|
||||
qreal minLat = deg2rad(_lat) - radDist;
|
||||
qreal maxLat = deg2rad(_lat) + radDist;
|
||||
|
||||
qreal minLon, maxLon;
|
||||
if (minLat > MIN_LAT && maxLat < MAX_LAT) {
|
||||
qreal deltaLon = asin(sin(radDist) / cos(_lat));
|
||||
minLon = deg2rad(_lon) - deltaLon;
|
||||
if (minLon < MIN_LON)
|
||||
minLon += 2.0 * M_PI;
|
||||
maxLon = deg2rad(_lon) + deltaLon;
|
||||
if (maxLon > MAX_LON)
|
||||
maxLon -= 2.0 * M_PI;
|
||||
} else {
|
||||
// a pole is within the distance
|
||||
minLat = qMax(minLat, MIN_LAT);
|
||||
maxLat = qMin(maxLat, MAX_LAT);
|
||||
minLon = MIN_LON;
|
||||
maxLon = MAX_LON;
|
||||
}
|
||||
|
||||
return QPair<Coordinates, Coordinates>(Coordinates(rad2deg(qMin(minLon,
|
||||
maxLon)), rad2deg(qMin(minLat, maxLat))), Coordinates(rad2deg(qMax(minLon,
|
||||
maxLon)), rad2deg(qMax(minLat, maxLat))));
|
||||
}
|
||||
#endif // QT_NO_DEBUG
|
||||
|
@ -2,7 +2,6 @@
|
||||
#define COORDINATES_H
|
||||
|
||||
#include <cmath>
|
||||
#include <QPair>
|
||||
#include <QDebug>
|
||||
|
||||
#ifndef M_PI
|
||||
@ -15,15 +14,14 @@ class Coordinates
|
||||
{
|
||||
public:
|
||||
Coordinates() {_lon = NAN; _lat = NAN;}
|
||||
Coordinates(const Coordinates &c) {_lon = c._lon; _lat = c._lat;}
|
||||
Coordinates(qreal lon, qreal lat) {_lon = lon; _lat = lat;}
|
||||
Coordinates(double lon, double lat) {_lon = lon; _lat = lat;}
|
||||
|
||||
qreal &rlon() {return _lon;}
|
||||
qreal &rlat() {return _lat;}
|
||||
void setLon(qreal lon) {_lon = lon;}
|
||||
void setLat(qreal lat) {_lat = lat;}
|
||||
qreal lon() const {return _lon;}
|
||||
qreal lat() const {return _lat;}
|
||||
double &rlon() {return _lon;}
|
||||
double &rlat() {return _lat;}
|
||||
void setLon(double lon) {_lon = lon;}
|
||||
void setLat(double lat) {_lat = lat;}
|
||||
double lon() const {return _lon;}
|
||||
double lat() const {return _lat;}
|
||||
|
||||
bool isNull() const
|
||||
{return std::isnan(_lon) && std::isnan(_lat);}
|
||||
@ -31,11 +29,10 @@ public:
|
||||
{return (_lon >= -180.0 && _lon <= 180.0
|
||||
&& _lat >= -90.0 && _lat <= 90.0);}
|
||||
|
||||
qreal distanceTo(const Coordinates &c) const;
|
||||
QPair<Coordinates, Coordinates> boundingRect(qreal distance) const;
|
||||
double distanceTo(const Coordinates &c) const;
|
||||
|
||||
private:
|
||||
qreal _lat, _lon;
|
||||
double _lat, _lon;
|
||||
};
|
||||
|
||||
inline bool operator==(const Coordinates &c1, const Coordinates &c2)
|
||||
@ -43,6 +40,8 @@ inline bool operator==(const Coordinates &c1, const Coordinates &c2)
|
||||
inline bool operator!=(const Coordinates &c1, const Coordinates &c2)
|
||||
{return !(c1 == c2);}
|
||||
|
||||
#ifndef QT_NO_DEBUG
|
||||
QDebug operator<<(QDebug dbg, const Coordinates &c);
|
||||
#endif // QT_NO_DEBUG
|
||||
|
||||
#endif // COORDINATES_H
|
||||
|
@ -8,6 +8,16 @@ void RangeF::resize(qreal size)
|
||||
_max += adj;
|
||||
}
|
||||
|
||||
RangeF RangeF::operator&(const RangeF &r) const
|
||||
{
|
||||
if (isNull() || r.isNull())
|
||||
return RangeF();
|
||||
|
||||
RangeF tmp(qMax(this->_min, r._min), qMin(this->_max, r._max));
|
||||
return tmp.isValid() ? tmp : RangeF();
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG
|
||||
QDebug operator<<(QDebug dbg, const Range &range)
|
||||
{
|
||||
dbg.nospace() << "Range(" << range.min() << ", " << range.max() << ")";
|
||||
@ -19,3 +29,4 @@ QDebug operator<<(QDebug dbg, const RangeF &range)
|
||||
dbg.nospace() << "RangeF(" << range.min() << ", " << range.max() << ")";
|
||||
return dbg.space();
|
||||
}
|
||||
#endif // QT_NO_DEBUG
|
||||
|
@ -14,6 +14,11 @@ public:
|
||||
int max() const {return _max;}
|
||||
int size() const {return (_max - _min);}
|
||||
|
||||
bool isValid() const {return size() >= 0;}
|
||||
|
||||
void setMin(int min) {_min = min;}
|
||||
void setMax(int max) {_max = max;}
|
||||
|
||||
private:
|
||||
int _min, _max;
|
||||
};
|
||||
@ -24,17 +29,28 @@ public:
|
||||
RangeF() {_min = 0; _max = 0;}
|
||||
RangeF(qreal min, qreal max) {_min = min, _max = max;}
|
||||
|
||||
RangeF operator&(const RangeF &r) const;
|
||||
RangeF &operator&=(const RangeF &r) {*this = *this & r; return *this;}
|
||||
|
||||
qreal min() const {return _min;}
|
||||
qreal max() const {return _max;}
|
||||
qreal size() const {return (_max - _min);}
|
||||
|
||||
bool isNull() const {return _min == 0 && _max == 0;}
|
||||
bool isValid() const {return size() >= 0;}
|
||||
|
||||
void setMin(qreal min) {_min = min;}
|
||||
void setMax(qreal max) {_max = max;}
|
||||
|
||||
void resize(qreal size);
|
||||
|
||||
private:
|
||||
qreal _min, _max;
|
||||
};
|
||||
|
||||
#ifndef QT_NO_DEBUG
|
||||
QDebug operator<<(QDebug dbg, const Range &range);
|
||||
QDebug operator<<(QDebug dbg, const RangeF &range);
|
||||
#endif // QT_NO_DEBUG
|
||||
|
||||
#endif // RANGE_H
|
||||
|
@ -1,5 +1,41 @@
|
||||
#include "wgs84.h"
|
||||
#include "rectc.h"
|
||||
|
||||
#define MIN_LAT deg2rad(-90.0)
|
||||
#define MAX_LAT deg2rad(90.0)
|
||||
#define MIN_LON deg2rad(-180.0)
|
||||
#define MAX_LON deg2rad(180.0)
|
||||
|
||||
RectC::RectC(const Coordinates ¢er, double radius)
|
||||
{
|
||||
double radDist = radius / WGS84_RADIUS;
|
||||
double radLon = deg2rad(center.lon());
|
||||
double radlat = deg2rad(center.lat());
|
||||
|
||||
double minLat = radlat - radDist;
|
||||
double maxLat = radlat + radDist;
|
||||
|
||||
double minLon, maxLon;
|
||||
if (minLat > MIN_LAT && maxLat < MAX_LAT) {
|
||||
double deltaLon = asin(sin(radDist) / cos(radlat));
|
||||
minLon = radLon - deltaLon;
|
||||
if (minLon < MIN_LON)
|
||||
minLon += 2.0 * M_PI;
|
||||
maxLon = radLon + deltaLon;
|
||||
if (maxLon > MAX_LON)
|
||||
maxLon -= 2.0 * M_PI;
|
||||
} else {
|
||||
// a pole is within the distance
|
||||
minLat = qMax(minLat, MIN_LAT);
|
||||
maxLat = qMin(maxLat, MAX_LAT);
|
||||
minLon = MIN_LON;
|
||||
maxLon = MAX_LON;
|
||||
}
|
||||
|
||||
_tl = Coordinates(rad2deg(minLon), rad2deg(maxLat));
|
||||
_br = Coordinates(rad2deg(maxLon), rad2deg(minLat));
|
||||
}
|
||||
|
||||
RectC RectC::operator|(const RectC &r) const
|
||||
{
|
||||
if (isNull())
|
||||
@ -7,62 +43,119 @@ RectC RectC::operator|(const RectC &r) const
|
||||
if (r.isNull())
|
||||
return *this;
|
||||
|
||||
qreal l1 = _tl.lon();
|
||||
qreal r1 = _tl.lon();
|
||||
if (_br.lon() - _tl.lon() < 0)
|
||||
double l1 = _tl.lon();
|
||||
double r1 = _tl.lon();
|
||||
if (_br.lon() < _tl.lon())
|
||||
l1 = _br.lon();
|
||||
else
|
||||
r1 = _br.lon();
|
||||
|
||||
qreal l2 = r._tl.lon();
|
||||
qreal r2 = r._tl.lon();
|
||||
if (r._br.lon() - r._tl.lon() < 0)
|
||||
double l2 = r._tl.lon();
|
||||
double r2 = r._tl.lon();
|
||||
if (r._br.lon() < r._tl.lon())
|
||||
l2 = r._br.lon();
|
||||
else
|
||||
r2 = r._br.lon();
|
||||
|
||||
qreal t1 = _tl.lat();
|
||||
qreal b1 = _tl.lat();
|
||||
if (_br.lat() - _tl.lat() < 0)
|
||||
double t1 = _tl.lat();
|
||||
double b1 = _tl.lat();
|
||||
if (_br.lat() > _tl.lat())
|
||||
t1 = _br.lat();
|
||||
else
|
||||
b1 = _br.lat();
|
||||
|
||||
qreal t2 = r._tl.lat();
|
||||
qreal b2 = r._tl.lat();
|
||||
if (r._br.lat() - r._tl.lat() < 0)
|
||||
double t2 = r._tl.lat();
|
||||
double b2 = r._tl.lat();
|
||||
if (r._br.lat() > r._tl.lat())
|
||||
t2 = r._br.lat();
|
||||
else
|
||||
b2 = r._br.lat();
|
||||
|
||||
RectC tmp;
|
||||
tmp._tl.setLon(qMin(l1, l2));
|
||||
tmp._br.setLon(qMax(r1, r2));
|
||||
tmp._tl.setLat(qMin(t1, t2));
|
||||
tmp._br.setLat(qMax(b1, b2));
|
||||
|
||||
return tmp;
|
||||
return RectC(Coordinates(qMin(l1, l2), qMax(t1, t2)),
|
||||
Coordinates(qMax(r1, r2), qMin(b1, b2)));
|
||||
}
|
||||
|
||||
void RectC::unite(const Coordinates &c)
|
||||
RectC RectC::operator&(const RectC &r) const
|
||||
{
|
||||
if (isNull()) {
|
||||
_tl = c;
|
||||
_br = c;
|
||||
} else {
|
||||
if (c.lon() < _tl.lon())
|
||||
_tl.setLon(c.lon());
|
||||
if (c.lon() > _br.lon())
|
||||
_br.setLon(c.lon());
|
||||
if (c.lat() > _br.lat())
|
||||
_br.setLat(c.lat());
|
||||
if (c.lat() < _tl.lat())
|
||||
_tl.setLat(c.lat());
|
||||
}
|
||||
if (isNull() || r.isNull())
|
||||
return RectC();
|
||||
|
||||
double l1 = _tl.lon();
|
||||
double r1 = _tl.lon();
|
||||
if (_br.lon() < _tl.lon())
|
||||
l1 = _br.lon();
|
||||
else
|
||||
r1 = _br.lon();
|
||||
|
||||
double l2 = r._tl.lon();
|
||||
double r2 = r._tl.lon();
|
||||
if (r._br.lon() < r._tl.lon())
|
||||
l2 = r._br.lon();
|
||||
else
|
||||
r2 = r._br.lon();
|
||||
|
||||
if (l1 > r2 || l2 > r1)
|
||||
return RectC();
|
||||
|
||||
double t1 = _tl.lat();
|
||||
double b1 = _tl.lat();
|
||||
if (_br.lat() > _tl.lat())
|
||||
t1 = _br.lat();
|
||||
else
|
||||
b1 = _br.lat();
|
||||
|
||||
double t2 = r._tl.lat();
|
||||
double b2 = r._tl.lat();
|
||||
if (r._br.lat() > r._tl.lat())
|
||||
t2 = r._br.lat();
|
||||
else
|
||||
b2 = r._br.lat();
|
||||
|
||||
if (b1 > t2 || b2 > t1)
|
||||
return RectC();
|
||||
|
||||
return RectC(Coordinates(qMax(l1, l2), qMin(t1, t2)),
|
||||
Coordinates(qMin(r1, r2), qMax(b1, b2)));
|
||||
}
|
||||
|
||||
RectC RectC::united(const Coordinates &c) const
|
||||
{
|
||||
if (c.isNull())
|
||||
return *this;
|
||||
if (isNull())
|
||||
return RectC(c, c);
|
||||
|
||||
double l = _tl.lon();
|
||||
double r = _tl.lon();
|
||||
if (_br.lon() < _tl.lon())
|
||||
l = _br.lon();
|
||||
else
|
||||
r = _br.lon();
|
||||
|
||||
double t = _tl.lat();
|
||||
double b = _tl.lat();
|
||||
if (_br.lat() > _tl.lat())
|
||||
t = _br.lat();
|
||||
else
|
||||
b = _br.lat();
|
||||
|
||||
if (c.lon() < l)
|
||||
l = c.lon();
|
||||
if (c.lon() > r)
|
||||
r = c.lon();
|
||||
if (c.lat() < b)
|
||||
b = c.lat();
|
||||
if (c.lat() > t)
|
||||
t = c.lat();
|
||||
|
||||
return RectC(Coordinates(l, t), Coordinates(r, b));
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG
|
||||
QDebug operator<<(QDebug dbg, const RectC &rect)
|
||||
{
|
||||
dbg.nospace() << "RectC(" << rect.topLeft() << ", " << rect.size() << ")";
|
||||
dbg.nospace() << "RectC(" << rect.topLeft() << ", " << rect.bottomRight()
|
||||
<< ")";
|
||||
return dbg.space();
|
||||
}
|
||||
#endif // QT_NO_DEBUG
|
||||
|
@ -2,7 +2,6 @@
|
||||
#define RECTC_H
|
||||
|
||||
#include <QDebug>
|
||||
#include <QSizeF>
|
||||
#include "coordinates.h"
|
||||
|
||||
class RectC
|
||||
@ -11,6 +10,7 @@ public:
|
||||
RectC() {}
|
||||
RectC(const Coordinates &topLeft, const Coordinates &bottomRight)
|
||||
: _tl(topLeft), _br(bottomRight) {}
|
||||
RectC(const Coordinates ¢er, double radius);
|
||||
|
||||
bool isNull() const
|
||||
{return _tl.isNull() && _br.isNull();}
|
||||
@ -19,24 +19,23 @@ public:
|
||||
|
||||
Coordinates topLeft() const {return _tl;}
|
||||
Coordinates bottomRight() const {return _br;}
|
||||
|
||||
Coordinates center() const
|
||||
{return Coordinates((_tl.lon() + _br.lon()) / 2.0,
|
||||
(_tl.lat() + _br.lat()) / 2.0);}
|
||||
qreal width() const {return _br.lon() - _tl.lon();}
|
||||
qreal height() const {return _br.lat() - _tl.lat();}
|
||||
|
||||
QSizeF size() const {return QSizeF(width(), height());}
|
||||
|
||||
RectC operator|(const RectC &r) const;
|
||||
RectC &operator|=(const RectC &r) {*this = *this | r; return *this;}
|
||||
RectC operator&(const RectC &r) const;
|
||||
RectC &operator&=(const RectC &r) {*this = *this & r; return *this;}
|
||||
|
||||
void unite(const Coordinates &c);
|
||||
RectC united(const Coordinates &c) const;
|
||||
|
||||
private:
|
||||
Coordinates _tl, _br;
|
||||
};
|
||||
|
||||
#ifndef QT_NO_DEBUG
|
||||
QDebug operator<<(QDebug dbg, const RectC &rect);
|
||||
#endif // QT_NO_DEBUG
|
||||
|
||||
#endif // RECTC_H
|
||||
|
@ -1,9 +1,9 @@
|
||||
#include "csvparser.h"
|
||||
|
||||
bool CSVParser::parse(QFile *file, QList<TrackData> &track,
|
||||
bool CSVParser::parse(QFile *file, QList<TrackData> &tracks,
|
||||
QList<RouteData> &routes, QList<Waypoint> &waypoints)
|
||||
{
|
||||
Q_UNUSED(track);
|
||||
Q_UNUSED(tracks);
|
||||
Q_UNUSED(routes);
|
||||
bool res;
|
||||
|
||||
|
@ -8,7 +8,7 @@ class CSVParser : public Parser
|
||||
public:
|
||||
CSVParser() : _errorLine(0) {}
|
||||
|
||||
bool parse(QFile *file, QList<TrackData> &track, QList<RouteData> &routes,
|
||||
bool parse(QFile *file, QList<TrackData> &tracks, QList<RouteData> &routes,
|
||||
QList<Waypoint> &waypoints);
|
||||
QString errorString() const {return _errorString;}
|
||||
int errorLine() const {return _errorLine;}
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "fitparser.h"
|
||||
#include "igcparser.h"
|
||||
#include "nmeaparser.h"
|
||||
#include "oziparsers.h"
|
||||
#include "data.h"
|
||||
|
||||
|
||||
@ -18,6 +19,9 @@ static FITParser fit;
|
||||
static CSVParser csv;
|
||||
static IGCParser igc;
|
||||
static NMEAParser nmea;
|
||||
static PLTParser plt;
|
||||
static WPTParser wpt;
|
||||
static RTEParser rte;
|
||||
|
||||
static QHash<QString, Parser*> parsers()
|
||||
{
|
||||
@ -30,6 +34,9 @@ static QHash<QString, Parser*> parsers()
|
||||
hash.insert("csv", &csv);
|
||||
hash.insert("igc", &igc);
|
||||
hash.insert("nmea", &nmea);
|
||||
hash.insert("plt", &plt);
|
||||
hash.insert("wpt", &wpt);
|
||||
hash.insert("rte", &rte);
|
||||
|
||||
return hash;
|
||||
}
|
||||
@ -100,10 +107,12 @@ bool Data::loadFile(const QString &fileName)
|
||||
QString Data::formats()
|
||||
{
|
||||
return
|
||||
tr("Supported files") + " (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx);;"
|
||||
tr("Supported files")
|
||||
+ " (*.csv *.fit *.gpx *.igc *.kml *.nmea *.plt *.rte *.tcx *.wpt);;"
|
||||
+ tr("CSV files") + " (*.csv);;" + tr("FIT files") + " (*.fit);;"
|
||||
+ tr("GPX files") + " (*.gpx);;" + tr("IGC files") + " (*.igc);;"
|
||||
+ tr("KML files") + " (*.kml);;" + tr("NMEA files") + " (*.nmea);;"
|
||||
+ tr("OziExplorer files") + " (*.plt *.rte *.wpt);;"
|
||||
+ tr("TCX files") + " (*.tcx);;" + tr("All files") + " (*)";
|
||||
}
|
||||
|
||||
|
@ -30,12 +30,14 @@ private:
|
||||
|
||||
Q_DECLARE_TYPEINFO(GraphPoint, Q_PRIMITIVE_TYPE);
|
||||
|
||||
#ifndef QT_NO_DEBUG
|
||||
inline QDebug operator<<(QDebug dbg, const GraphPoint &point)
|
||||
{
|
||||
dbg.nospace() << "GraphPoint(" << point.s() << ", " << point.t() << ", "
|
||||
<< point.y() << ")";
|
||||
return dbg.space();
|
||||
}
|
||||
#endif // QT_NO_DEBUG
|
||||
|
||||
typedef QVector<GraphPoint> Graph;
|
||||
|
||||
|
273
src/data/oziparsers.cpp
Normal file
@ -0,0 +1,273 @@
|
||||
#include "map/gcs.h"
|
||||
#include "oziparsers.h"
|
||||
|
||||
static qint64 delphi2unixMS(double date)
|
||||
{
|
||||
return (qint64)((date - 25569.0) * 86400000);
|
||||
}
|
||||
|
||||
bool PLTParser::parse(QFile *file, QList<TrackData> &tracks,
|
||||
QList<RouteData> &routes, QList<Waypoint> &waypoints)
|
||||
{
|
||||
Q_UNUSED(waypoints);
|
||||
Q_UNUSED(routes);
|
||||
bool res;
|
||||
const GCS *gcs = 0;
|
||||
|
||||
_errorLine = 1;
|
||||
_errorString.clear();
|
||||
|
||||
tracks.append(TrackData());
|
||||
TrackData &track = tracks.last();
|
||||
|
||||
while (!file->atEnd()) {
|
||||
QByteArray line = file->readLine();
|
||||
|
||||
if (_errorLine == 1) {
|
||||
if (!line.trimmed().startsWith("OziExplorer Track Point File")) {
|
||||
_errorString = "Not a PLT file";
|
||||
return false;
|
||||
}
|
||||
} else if (_errorLine == 2) {
|
||||
if (!(gcs = GCS::gcs(QString(line.trimmed())))) {
|
||||
_errorString = "Invalid/unknown datum";
|
||||
return false;
|
||||
}
|
||||
} else if (_errorLine == 5) {
|
||||
QList<QByteArray> list = line.split(',');
|
||||
if (list.size() >= 4)
|
||||
track.setName(list.at(3));
|
||||
} else if (_errorLine > 6) {
|
||||
QList<QByteArray> list = line.split(',');
|
||||
if (list.size() < 2) {
|
||||
_errorString = "Parse error";
|
||||
return false;
|
||||
}
|
||||
|
||||
qreal lat = list.at(0).trimmed().toDouble(&res);
|
||||
if (!res || (lat < -90.0 || lat > 90.0)) {
|
||||
_errorString = "Invalid latitude";
|
||||
return false;
|
||||
}
|
||||
qreal lon = list.at(1).trimmed().toDouble(&res);
|
||||
if (!res || (lon < -180.0 || lon > 180.0)) {
|
||||
_errorString = "Invalid longitude";
|
||||
return false;
|
||||
}
|
||||
|
||||
Trackpoint tp(gcs->toWGS84(Coordinates(lon, lat)));
|
||||
|
||||
if (list.size() >= 4) {
|
||||
QByteArray field(list.at(3).trimmed());
|
||||
if (!field.isEmpty()) {
|
||||
double elevation = field.toDouble(&res);
|
||||
if (!res) {
|
||||
_errorString = "Invalid elevation";
|
||||
return false;
|
||||
}
|
||||
if (elevation != -777)
|
||||
tp.setElevation(elevation * 0.3048);
|
||||
}
|
||||
}
|
||||
if (list.size() >= 5) {
|
||||
QByteArray field(list.at(4).trimmed());
|
||||
if (!field.isEmpty()) {
|
||||
double date = field.toDouble(&res);
|
||||
if (!res) {
|
||||
_errorString = "Invalid date";
|
||||
return false;
|
||||
}
|
||||
tp.setTimestamp(QDateTime::fromMSecsSinceEpoch(
|
||||
delphi2unixMS(date)));
|
||||
}
|
||||
}
|
||||
|
||||
track.append(tp);
|
||||
}
|
||||
|
||||
_errorLine++;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RTEParser::parse(QFile *file, QList<TrackData> &tracks,
|
||||
QList<RouteData> &routes, QList<Waypoint> &waypoints)
|
||||
{
|
||||
Q_UNUSED(waypoints);
|
||||
Q_UNUSED(tracks);
|
||||
bool res, record = false;
|
||||
const GCS *gcs = 0;
|
||||
|
||||
_errorLine = 1;
|
||||
_errorString.clear();
|
||||
|
||||
|
||||
while (!file->atEnd()) {
|
||||
QByteArray line = file->readLine();
|
||||
|
||||
if (_errorLine == 1) {
|
||||
if (!line.trimmed().startsWith("OziExplorer Route File")) {
|
||||
_errorString = "Not a RTE file";
|
||||
return false;
|
||||
}
|
||||
} else if (_errorLine == 2) {
|
||||
if (!(gcs = GCS::gcs(QString(line.trimmed())))) {
|
||||
_errorString = "Invalid/unknown datum";
|
||||
return false;
|
||||
}
|
||||
} else if (_errorLine > 4) {
|
||||
QList<QByteArray> list = line.split(',');
|
||||
if (list.size() < 2) {
|
||||
_errorString = "Parse error";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (list.at(0).trimmed() == "R") {
|
||||
routes.append(RouteData());
|
||||
record = true;
|
||||
|
||||
if (list.size() >= 3)
|
||||
routes.last().setName(list.at(2).trimmed()
|
||||
.replace('\xD1', ','));
|
||||
if (list.size() >= 4)
|
||||
routes.last().setDescription(list.at(3).trimmed()
|
||||
.replace('\xD1', ','));
|
||||
} else if (list.at(0).trimmed() == "W") {
|
||||
if (!record || list.size() < 7) {
|
||||
_errorString = "Parse error";
|
||||
return false;
|
||||
}
|
||||
|
||||
qreal lat = list.at(5).trimmed().toDouble(&res);
|
||||
if (!res || (lat < -90.0 || lat > 90.0)) {
|
||||
_errorString = "Invalid latitude";
|
||||
return false;
|
||||
}
|
||||
qreal lon = list.at(6).trimmed().toDouble(&res);
|
||||
if (!res || (lon < -180.0 || lon > 180.0)) {
|
||||
_errorString = "Invalid longitude";
|
||||
return false;
|
||||
}
|
||||
|
||||
Waypoint wp(gcs->toWGS84(Coordinates(lon, lat)));
|
||||
|
||||
QString name(list.at(4).trimmed().replace('\xD1', ','));
|
||||
if (!name.isEmpty())
|
||||
wp.setName(name);
|
||||
if (list.size() >= 8) {
|
||||
QByteArray field(list.at(7).trimmed());
|
||||
if (!field.isEmpty()) {
|
||||
double date = field.toDouble(&res);
|
||||
if (!res) {
|
||||
_errorString = "Invalid date";
|
||||
return false;
|
||||
}
|
||||
wp.setTimestamp(QDateTime::fromMSecsSinceEpoch(
|
||||
delphi2unixMS(date)));
|
||||
}
|
||||
}
|
||||
if (list.size() >= 14) {
|
||||
QString desc(list.at(13).trimmed().replace('\xD1', ','));
|
||||
if (!desc.isEmpty())
|
||||
wp.setDescription(desc);
|
||||
}
|
||||
|
||||
routes.last().append(wp);
|
||||
} else {
|
||||
_errorString = "Parse error";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
_errorLine++;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WPTParser::parse(QFile *file, QList<TrackData> &tracks,
|
||||
QList<RouteData> &routes, QList<Waypoint> &waypoints)
|
||||
{
|
||||
Q_UNUSED(tracks);
|
||||
Q_UNUSED(routes);
|
||||
bool res;
|
||||
const GCS *gcs = 0;
|
||||
|
||||
_errorLine = 1;
|
||||
_errorString.clear();
|
||||
|
||||
while (!file->atEnd()) {
|
||||
QByteArray line = file->readLine();
|
||||
|
||||
if (_errorLine == 1) {
|
||||
if (!line.trimmed().startsWith("OziExplorer Waypoint File")) {
|
||||
_errorString = "Not a WPT file";
|
||||
return false;
|
||||
}
|
||||
} else if (_errorLine == 2) {
|
||||
if (!(gcs = GCS::gcs(QString(line.trimmed())))) {
|
||||
_errorString = "Invalid/unknown datum";
|
||||
return false;
|
||||
}
|
||||
} else if (_errorLine > 4) {
|
||||
QList<QByteArray> list = line.split(',');
|
||||
if (list.size() < 4) {
|
||||
_errorString = "Parse error";
|
||||
return false;
|
||||
}
|
||||
|
||||
qreal lat = list.at(2).trimmed().toDouble(&res);
|
||||
if (!res || (lat < -90.0 || lat > 90.0)) {
|
||||
_errorString = "Invalid latitude";
|
||||
return false;
|
||||
}
|
||||
qreal lon = list.at(3).trimmed().toDouble(&res);
|
||||
if (!res || (lon < -180.0 || lon > 180.0)) {
|
||||
_errorString = "Invalid longitude";
|
||||
return false;
|
||||
}
|
||||
|
||||
Waypoint wp(gcs->toWGS84(Coordinates(lon, lat)));
|
||||
|
||||
QString name(list.at(1).trimmed().replace('\xD1', ','));
|
||||
if (!name.isEmpty())
|
||||
wp.setName(name);
|
||||
if (list.size() >= 5) {
|
||||
QByteArray field(list.at(4).trimmed());
|
||||
if (!field.isEmpty()) {
|
||||
double date = field.toDouble(&res);
|
||||
if (!res) {
|
||||
_errorString = "Invalid date";
|
||||
return false;
|
||||
}
|
||||
wp.setTimestamp(QDateTime::fromMSecsSinceEpoch(
|
||||
delphi2unixMS(date)));
|
||||
}
|
||||
}
|
||||
if (list.size() >= 11) {
|
||||
QString desc(list.at(10).trimmed().replace('\xD1', ','));
|
||||
if (!desc.isEmpty())
|
||||
wp.setDescription(desc);
|
||||
}
|
||||
if (list.size() >= 15) {
|
||||
QByteArray field(list.at(14).trimmed());
|
||||
if (!field.isEmpty()) {
|
||||
double elevation = list.at(14).trimmed().toDouble(&res);
|
||||
if (!res) {
|
||||
_errorString = "Invalid elevation";
|
||||
return false;
|
||||
}
|
||||
if (elevation != -777)
|
||||
wp.setElevation(elevation * 0.3048);
|
||||
}
|
||||
}
|
||||
|
||||
waypoints.append(wp);
|
||||
}
|
||||
|
||||
_errorLine++;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
51
src/data/oziparsers.h
Normal file
@ -0,0 +1,51 @@
|
||||
#ifndef OZIPARSERS_H
|
||||
#define OZIPARSERS_H
|
||||
|
||||
#include "parser.h"
|
||||
|
||||
class PLTParser : public Parser
|
||||
{
|
||||
public:
|
||||
PLTParser() : _errorLine(0) {}
|
||||
|
||||
bool parse(QFile *file, QList<TrackData> &tracks, QList<RouteData> &routes,
|
||||
QList<Waypoint> &waypoints);
|
||||
QString errorString() const {return _errorString;}
|
||||
int errorLine() const {return _errorLine;}
|
||||
|
||||
private:
|
||||
QString _errorString;
|
||||
int _errorLine;
|
||||
};
|
||||
|
||||
class RTEParser : public Parser
|
||||
{
|
||||
public:
|
||||
RTEParser() : _errorLine(0) {}
|
||||
|
||||
bool parse(QFile *file, QList<TrackData> &tracks, QList<RouteData> &routes,
|
||||
QList<Waypoint> &waypoints);
|
||||
QString errorString() const {return _errorString;}
|
||||
int errorLine() const {return _errorLine;}
|
||||
|
||||
private:
|
||||
QString _errorString;
|
||||
int _errorLine;
|
||||
};
|
||||
|
||||
class WPTParser : public Parser
|
||||
{
|
||||
public:
|
||||
WPTParser() : _errorLine(0) {}
|
||||
|
||||
bool parse(QFile *file, QList<TrackData> &tracks, QList<RouteData> &routes,
|
||||
QList<Waypoint> &waypoints);
|
||||
QString errorString() const {return _errorString;}
|
||||
int errorLine() const {return _errorLine;}
|
||||
|
||||
private:
|
||||
QString _errorString;
|
||||
int _errorLine;
|
||||
};
|
||||
|
||||
#endif // OZIPARSERS_H
|
@ -8,14 +8,16 @@ RectC Path::boundingRect() const
|
||||
return ret;
|
||||
|
||||
for (int i = 0; i < size(); i++)
|
||||
ret.unite(at(i).coordinates());
|
||||
ret = ret.united(at(i).coordinates());
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG
|
||||
QDebug operator<<(QDebug dbg, const PathPoint &point)
|
||||
{
|
||||
dbg.nospace() << "PathPoint(" << point.distance() << ", "
|
||||
<< point.coordinates() << ")";
|
||||
return dbg.space();
|
||||
}
|
||||
#endif // QT_NO_DEBUG
|
||||
|
@ -23,7 +23,9 @@ private:
|
||||
};
|
||||
|
||||
Q_DECLARE_TYPEINFO(PathPoint, Q_PRIMITIVE_TYPE);
|
||||
#ifndef QT_NO_DEBUG
|
||||
QDebug operator<<(QDebug dbg, const PathPoint &point);
|
||||
#endif // QT_NO_DEBUG
|
||||
|
||||
|
||||
class Path : public QVector<PathPoint>
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
#include "common/rectc.h"
|
||||
#include "data.h"
|
||||
#include "poi.h"
|
||||
|
||||
@ -101,12 +102,11 @@ QList<Waypoint> POI::points(const Path &path) const
|
||||
QSet<int>::const_iterator it;
|
||||
|
||||
for (int i = 0; i < path.count(); i++) {
|
||||
const Coordinates &c = path.at(i).coordinates();
|
||||
QPair<Coordinates, Coordinates> br = c.boundingRect(_radius);
|
||||
min[0] = br.first.lon();
|
||||
min[1] = br.first.lat();
|
||||
max[0] = br.second.lon();
|
||||
max[1] = br.second.lat();
|
||||
RectC br(path.at(i).coordinates(), _radius);
|
||||
min[0] = br.topLeft().lon();
|
||||
min[1] = br.bottomRight().lat();
|
||||
max[0] = br.bottomRight().lon();
|
||||
max[1] = br.topLeft().lat();
|
||||
|
||||
_tree.Search(min, max, cb, &set);
|
||||
}
|
||||
@ -124,13 +124,11 @@ QList<Waypoint> POI::points(const Waypoint &point) const
|
||||
qreal min[2], max[2];
|
||||
QSet<int>::const_iterator it;
|
||||
|
||||
const Coordinates &c = point.coordinates();
|
||||
|
||||
QPair<Coordinates, Coordinates> br = c.boundingRect(_radius);
|
||||
min[0] = br.first.lon();
|
||||
min[1] = br.first.lat();
|
||||
max[0] = br.second.lon();
|
||||
max[1] = br.second.lat();
|
||||
RectC br(point.coordinates(), _radius);
|
||||
min[0] = br.topLeft().lon();
|
||||
min[1] = br.bottomRight().lat();
|
||||
max[0] = br.bottomRight().lon();
|
||||
max[1] = br.topLeft().lat();
|
||||
|
||||
_tree.Search(min, max, cb, &set);
|
||||
|
||||
|
@ -49,9 +49,7 @@ static QSet<int> eliminate(const QVector<qreal> &v, int window)
|
||||
|
||||
static Graph filter(const Graph &g, int window)
|
||||
{
|
||||
if (g.size() < window)
|
||||
return Graph();
|
||||
if (window < 2)
|
||||
if (g.size() < window || window < 2)
|
||||
return Graph(g);
|
||||
|
||||
qreal acc = 0;
|
||||
@ -77,27 +75,32 @@ static Graph filter(const Graph &g, int window)
|
||||
Track::Track(const TrackData &data) : _data(data)
|
||||
{
|
||||
qreal dt, ds, total;
|
||||
int last;
|
||||
|
||||
|
||||
_time.append(0);
|
||||
_distance.append(0);
|
||||
_speed.append(0);
|
||||
|
||||
for (int i = 1; i < data.count(); i++) {
|
||||
ds = data.at(i).coordinates().distanceTo(data.at(i-1).coordinates());
|
||||
last = 0;
|
||||
|
||||
for (int i = 1; i < _data.count(); i++) {
|
||||
ds = _data.at(i).coordinates().distanceTo(_data.at(i-1).coordinates());
|
||||
_distance.append(ds);
|
||||
|
||||
if (data.first().hasTimestamp() && data.at(i).hasTimestamp())
|
||||
if (_data.first().hasTimestamp() && _data.at(i).hasTimestamp()
|
||||
&& _data.at(i).timestamp() > _data.at(last).timestamp()) {
|
||||
_time.append(_data.first().timestamp().msecsTo(
|
||||
_data.at(i).timestamp()) / 1000.0);
|
||||
else
|
||||
last = i;
|
||||
} else
|
||||
_time.append(NAN);
|
||||
|
||||
if (std::isnan(_time.at(i)) || std::isnan(_time.at(i-1)))
|
||||
_speed.append(NAN);
|
||||
else {
|
||||
dt = _time.at(i) - _time.at(i-1);
|
||||
if (!dt) {
|
||||
if (dt < 1e-3) {
|
||||
_speed.append(_speed.at(i-1));
|
||||
continue;
|
||||
}
|
||||
@ -106,7 +109,7 @@ Track::Track(const TrackData &data) : _data(data)
|
||||
}
|
||||
|
||||
_pause = 0;
|
||||
for (int i = 1; i < data.count(); i++) {
|
||||
for (int i = 1; i < _data.count(); i++) {
|
||||
if (_time.at(i) > _time.at(i-1) + _pauseInterval
|
||||
&& _speed.at(i) < _pauseSpeed) {
|
||||
_pause += _time.at(i) - _time.at(i-1);
|
||||
|
@ -57,6 +57,7 @@ private:
|
||||
|
||||
Q_DECLARE_TYPEINFO(Trackpoint, Q_MOVABLE_TYPE);
|
||||
|
||||
#ifndef QT_NO_DEBUG
|
||||
inline QDebug operator<<(QDebug dbg, const Trackpoint &trackpoint)
|
||||
{
|
||||
dbg.nospace() << "Trackpoint(" << trackpoint.coordinates() << ", "
|
||||
@ -65,5 +66,6 @@ inline QDebug operator<<(QDebug dbg, const Trackpoint &trackpoint)
|
||||
<< trackpoint.temperature() << ")";
|
||||
return dbg.space();
|
||||
}
|
||||
#endif // QT_NO_DEBUG
|
||||
|
||||
#endif // TRACKPOINT_H
|
||||
|
@ -48,12 +48,14 @@ inline uint qHash(const Waypoint &key)
|
||||
return ::qHash(key.name());
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG
|
||||
inline QDebug operator<<(QDebug dbg, const Waypoint &waypoint)
|
||||
{
|
||||
dbg.nospace() << "Waypoint(" << waypoint.coordinates() << ", "
|
||||
<< waypoint.name() << ", " << waypoint.description() << ")";
|
||||
return dbg.space();
|
||||
}
|
||||
#endif // QT_NO_DEBUG
|
||||
|
||||
Q_DECLARE_TYPEINFO(Waypoint, Q_MOVABLE_TYPE);
|
||||
|
||||
|
@ -41,6 +41,7 @@ Defense.
|
||||
|
||||
*/
|
||||
|
||||
#include "ellipsoid.h"
|
||||
#include "albersequal.h"
|
||||
|
||||
|
||||
@ -69,7 +70,6 @@ AlbersEqual::AlbersEqual(const Ellipsoid *ellipsoid, double standardParallel1,
|
||||
double sp1, sp2;
|
||||
|
||||
|
||||
_e = ellipsoid;
|
||||
_latitudeOrigin = deg2rad(latitudeOrigin);
|
||||
_longitudeOrigin = deg2rad(longitudeOrigin);
|
||||
_falseEasting = falseEasting;
|
||||
@ -78,7 +78,9 @@ AlbersEqual::AlbersEqual(const Ellipsoid *ellipsoid, double standardParallel1,
|
||||
sp1 = deg2rad(standardParallel1);
|
||||
sp2 = deg2rad(standardParallel2);
|
||||
|
||||
_es2 = 2 * _e->flattening() - _e->flattening() * _e->flattening();
|
||||
_a2 = ellipsoid->radius() * ellipsoid->radius();
|
||||
_es2 = 2 * ellipsoid->flattening() - ellipsoid->flattening()
|
||||
* ellipsoid->flattening();
|
||||
_es = sqrt(_es2);
|
||||
_one_minus_es2 = 1 - _es2;
|
||||
_two_es = 2 * _es;
|
||||
@ -108,12 +110,12 @@ AlbersEqual::AlbersEqual(const Ellipsoid *ellipsoid, double standardParallel1,
|
||||
_n = sin_lat1;
|
||||
|
||||
_C = sqr_m1 + _n * q1;
|
||||
_a_over_n = _e->radius() / _n;
|
||||
_a_over_n = ellipsoid->radius() / _n;
|
||||
nq0 = _n * q0;
|
||||
_rho0 = (_C < nq0) ? 0 : _a_over_n * sqrt(_C - nq0);
|
||||
}
|
||||
|
||||
QPointF AlbersEqual::ll2xy(const Coordinates &c) const
|
||||
PointD AlbersEqual::ll2xy(const Coordinates &c) const
|
||||
{
|
||||
double dlam;
|
||||
double sin_lat;
|
||||
@ -137,11 +139,11 @@ QPointF AlbersEqual::ll2xy(const Coordinates &c) const
|
||||
rho = (_C < nq) ? 0 : _a_over_n * sqrt(_C - nq);
|
||||
theta = _n * dlam;
|
||||
|
||||
return QPointF(rho * sin(theta) + _falseEasting,
|
||||
return PointD(rho * sin(theta) + _falseEasting,
|
||||
_rho0 - rho * cos(theta) + _falseNorthing);
|
||||
}
|
||||
|
||||
Coordinates AlbersEqual::xy2ll(const QPointF &p) const
|
||||
Coordinates AlbersEqual::xy2ll(const PointD &p) const
|
||||
{
|
||||
double dy, dx;
|
||||
double rho0_minus_dy;
|
||||
@ -171,7 +173,7 @@ Coordinates AlbersEqual::xy2ll(const QPointF &p) const
|
||||
if (rho != 0.0)
|
||||
theta = atan2(dx, rho0_minus_dy);
|
||||
rho_n = rho * _n;
|
||||
q = (_C - (rho_n * rho_n) / (_e->radius() * _e->radius())) / _n;
|
||||
q = (_C - (rho_n * rho_n) / _a2) / _n;
|
||||
qc = 1 - ((_one_minus_es2) / (_two_es)) * log((1.0 - _es) / (1.0 + _es));
|
||||
if (fabs(fabs(qc) - fabs(q)) > 1.0e-6) {
|
||||
q_over_2 = q / 2.0;
|
||||
|
@ -1,9 +1,10 @@
|
||||
#ifndef ALBERSEQUAL_H
|
||||
#define ALBERSEQUAL_H
|
||||
|
||||
#include "ellipsoid.h"
|
||||
#include "ct.h"
|
||||
|
||||
class Ellipsoid;
|
||||
|
||||
class AlbersEqual : public CT
|
||||
{
|
||||
public:
|
||||
@ -13,17 +14,16 @@ public:
|
||||
|
||||
virtual CT *clone() const {return new AlbersEqual(*this);}
|
||||
|
||||
virtual QPointF ll2xy(const Coordinates &c) const;
|
||||
virtual Coordinates xy2ll(const QPointF &p) const;
|
||||
virtual PointD ll2xy(const Coordinates &c) const;
|
||||
virtual Coordinates xy2ll(const PointD &p) const;
|
||||
|
||||
private:
|
||||
const Ellipsoid *_e;
|
||||
|
||||
double _latitudeOrigin;
|
||||
double _longitudeOrigin;
|
||||
double _falseEasting;
|
||||
double _falseNorthing;
|
||||
|
||||
double _a2;
|
||||
double _rho0;
|
||||
double _C;
|
||||
double _n;
|
||||
|
@ -8,7 +8,8 @@ static double sDMS2deg(double val)
|
||||
const char *decimal;
|
||||
|
||||
QString qstr(QString::number(qAbs(val), 'f', 7));
|
||||
const char *str = qstr.toLatin1().constData();
|
||||
QByteArray ba = qstr.toLatin1();
|
||||
const char *str = ba.constData();
|
||||
decimal = strrchr(str, '.');
|
||||
int deg = str2int(str, decimal - str);
|
||||
int min = str2int(decimal + 1, 2);
|
||||
@ -83,8 +84,10 @@ double AngularUnits::fromDegrees(double val) const
|
||||
return (_code == 9110) ? deg2sDMS(val) : val / _f;
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG
|
||||
QDebug operator<<(QDebug dbg, const AngularUnits &au)
|
||||
{
|
||||
dbg.nospace() << "AngularUnits(" << deg2rad(au._f) << ")";
|
||||
return dbg.space();
|
||||
}
|
||||
#endif // QT_NO_DEBUG
|
||||
|
@ -17,8 +17,9 @@ public:
|
||||
double fromDegrees(double val) const;
|
||||
|
||||
friend bool operator==(const AngularUnits &au1, const AngularUnits &au2);
|
||||
#ifndef QT_NO_DEBUG
|
||||
friend QDebug operator<<(QDebug dbg, const AngularUnits &au);
|
||||
|
||||
#endif // QT_NO_DEBUG
|
||||
private:
|
||||
int _code;
|
||||
double _f;
|
||||
@ -27,6 +28,8 @@ private:
|
||||
inline bool operator==(const AngularUnits &au1, const AngularUnits &au2)
|
||||
{return (au1._f == au2._f);}
|
||||
|
||||
#ifndef QT_NO_DEBUG
|
||||
QDebug operator<<(QDebug dbg, const AngularUnits &au);
|
||||
#endif // QT_NO_DEBUG
|
||||
|
||||
#endif // ANGULARUNITS_H
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include <QtAlgorithms>
|
||||
#include <QPainter>
|
||||
#include "common/rectc.h"
|
||||
#include "offlinemap.h"
|
||||
#include "tar.h"
|
||||
#include "atlas.h"
|
||||
|
||||
@ -15,8 +16,8 @@ static bool resCmp(const OfflineMap *m1, const OfflineMap *m2)
|
||||
{
|
||||
qreal r1, r2;
|
||||
|
||||
r1 = m1->resolution(m1->bounds().center());
|
||||
r2 = m2->resolution(m2->bounds().center());
|
||||
r1 = m1->resolution(m1->bounds());
|
||||
r2 = m2->resolution(m2->bounds());
|
||||
|
||||
return r1 > r2;
|
||||
}
|
||||
@ -37,8 +38,8 @@ void Atlas::computeZooms()
|
||||
|
||||
_zooms.append(QPair<int, int>(0, _maps.count() - 1));
|
||||
for (int i = 1; i < _maps.count(); i++) {
|
||||
qreal last = _maps.at(i-1)->resolution(_maps.at(i)->bounds().center());
|
||||
qreal cur = _maps.at(i)->resolution(_maps.at(i)->bounds().center());
|
||||
qreal last = _maps.at(i-1)->resolution(_maps.at(i)->bounds());
|
||||
qreal cur = _maps.at(i)->resolution(_maps.at(i)->bounds());
|
||||
if (cur < last * ZOOM_THRESHOLD) {
|
||||
_zooms.last().second = i-1;
|
||||
_zooms.append(QPair<int, int>(i, _maps.count() - 1));
|
||||
@ -74,25 +75,24 @@ void Atlas::computeBounds()
|
||||
}
|
||||
|
||||
for (int i = 0; i < _maps.count(); i++)
|
||||
_bounds.append(QPair<QRectF, QRectF>(QRectF(TL(_maps.at(i)),
|
||||
BR(_maps.at(i))), QRectF(offsets.at(i), _maps.at(i)->bounds().size())));
|
||||
_bounds.append(QPair<QRectF, QRectF>(QRectF(TL(_maps.at(i)).toPointF(),
|
||||
BR(_maps.at(i)).toPointF()), QRectF(offsets.at(i),
|
||||
_maps.at(i)->bounds().size())));
|
||||
}
|
||||
|
||||
Atlas::Atlas(const QString &fileName, QObject *parent) : Map(parent)
|
||||
Atlas::Atlas(const QString &fileName, QObject *parent)
|
||||
: Map(parent), _zoom(0), _mapIndex(-1), _valid(false)
|
||||
{
|
||||
QFileInfo fi(fileName);
|
||||
QByteArray ba;
|
||||
QString suffix = fi.suffix().toLower();
|
||||
Tar tar;
|
||||
Tar tar(fileName);
|
||||
|
||||
|
||||
_valid = false;
|
||||
_zoom = 0;
|
||||
_name = fi.dir().dirName();
|
||||
_ci = -1; _cz = -1;
|
||||
|
||||
|
||||
if (suffix == "tar") {
|
||||
if (!tar.load(fileName)) {
|
||||
if (!tar.open()) {
|
||||
_errorString = "Error reading tar file";
|
||||
return;
|
||||
}
|
||||
@ -112,7 +112,6 @@ Atlas::Atlas(const QString &fileName, QObject *parent) : Map(parent)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
QDir dir(fi.absolutePath());
|
||||
QFileInfoList layers = dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
|
||||
for (int n = 0; n < layers.count(); n++) {
|
||||
@ -149,12 +148,6 @@ Atlas::Atlas(const QString &fileName, QObject *parent) : Map(parent)
|
||||
_valid = true;
|
||||
}
|
||||
|
||||
Atlas::~Atlas()
|
||||
{
|
||||
for (int i = 0; i < _maps.size(); i++)
|
||||
delete _maps.at(i);
|
||||
}
|
||||
|
||||
QRectF Atlas::bounds() const
|
||||
{
|
||||
QSizeF s(0, 0);
|
||||
@ -169,28 +162,25 @@ QRectF Atlas::bounds() const
|
||||
return QRectF(QPointF(0, 0), s);
|
||||
}
|
||||
|
||||
qreal Atlas::resolution(const QPointF &p) const
|
||||
qreal Atlas::resolution(const QRectF &rect) const
|
||||
{
|
||||
int idx = _zooms.at(_zoom).first;
|
||||
|
||||
for (int i = _zooms.at(_zoom).first; i <= _zooms.at(_zoom).second; i++) {
|
||||
if (_bounds.at(i).second.contains(_maps.at(i)->xy2pp(p))) {
|
||||
if (_bounds.at(i).second.contains(_maps.at(i)->xy2pp(rect.center())
|
||||
.toPointF())) {
|
||||
idx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return _maps.at(idx)->resolution(p);
|
||||
return _maps.at(idx)->resolution(rect);
|
||||
}
|
||||
|
||||
qreal Atlas::zoom() const
|
||||
{
|
||||
return _zoom;
|
||||
}
|
||||
|
||||
qreal Atlas::zoomFit(const QSize &size, const RectC &br)
|
||||
int Atlas::zoomFit(const QSize &size, const RectC &br)
|
||||
{
|
||||
_zoom = 0;
|
||||
_mapIndex = -1;
|
||||
|
||||
if (!br.isValid()) {
|
||||
_zoom = _zooms.size() - 1;
|
||||
@ -199,7 +189,8 @@ qreal Atlas::zoomFit(const QSize &size, const RectC &br)
|
||||
|
||||
for (int z = 0; z < _zooms.count(); z++) {
|
||||
for (int i = _zooms.at(z).first; i <= _zooms.at(z).second; i++) {
|
||||
if (!_bounds.at(i).first.contains(_maps.at(i)->ll2pp(br.center())))
|
||||
if (!_bounds.at(i).first.contains(_maps.at(i)->ll2pp(br.center())
|
||||
.toPointF()))
|
||||
continue;
|
||||
|
||||
QRect sbr = QRectF(_maps.at(i)->ll2xy(br.topLeft()),
|
||||
@ -217,35 +208,19 @@ qreal Atlas::zoomFit(const QSize &size, const RectC &br)
|
||||
return _zoom;
|
||||
}
|
||||
|
||||
qreal Atlas::zoomFit(qreal resolution, const Coordinates &c)
|
||||
{
|
||||
_zoom = 0;
|
||||
|
||||
for (int z = 0; z < _zooms.count(); z++) {
|
||||
for (int i = _zooms.at(z).first; i <= _zooms.at(z).second; i++) {
|
||||
if (!_bounds.at(i).first.contains(_maps.at(i)->ll2pp(c)))
|
||||
continue;
|
||||
|
||||
if (_maps.at(i)->resolution(_maps.at(i)->ll2xy(c)) < resolution)
|
||||
return _zoom;
|
||||
|
||||
_zoom = z;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return _zoom;
|
||||
}
|
||||
|
||||
qreal Atlas::zoomIn()
|
||||
int Atlas::zoomIn()
|
||||
{
|
||||
_zoom = qMin(_zoom + 1, _zooms.size() - 1);
|
||||
_mapIndex = -1;
|
||||
|
||||
return _zoom;
|
||||
}
|
||||
|
||||
qreal Atlas::zoomOut()
|
||||
int Atlas::zoomOut()
|
||||
{
|
||||
_zoom = qMax(_zoom - 1, 0);
|
||||
_mapIndex = -1;
|
||||
|
||||
return _zoom;
|
||||
}
|
||||
|
||||
@ -253,26 +228,21 @@ QPointF Atlas::ll2xy(const Coordinates &c)
|
||||
{
|
||||
QPointF pp;
|
||||
|
||||
if (_cz != _zoom) {
|
||||
_ci = -1;
|
||||
_cz = _zoom;
|
||||
}
|
||||
|
||||
if (_ci >= 0)
|
||||
pp = _maps.at(_ci)->ll2pp(c);
|
||||
if (_ci < 0 || !_bounds.at(_ci).first.contains(pp)) {
|
||||
_ci = _zooms.at(_zoom).first;
|
||||
if (_mapIndex >= 0)
|
||||
pp = _maps.at(_mapIndex)->ll2pp(c).toPointF();
|
||||
if (_mapIndex < 0 || !_bounds.at(_mapIndex).first.contains(pp)) {
|
||||
_mapIndex = _zooms.at(_zoom).first;
|
||||
for (int i = _zooms.at(_zoom).first; i <= _zooms.at(_zoom).second; i++) {
|
||||
pp = _maps.at(i)->ll2pp(c);
|
||||
pp = _maps.at(i)->ll2pp(c).toPointF();
|
||||
if (_bounds.at(i).first.contains(pp)) {
|
||||
_ci = i;
|
||||
_mapIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QPointF p = _maps.at(_ci)->pp2xy(pp);
|
||||
return p + _bounds.at(_ci).second.topLeft();
|
||||
QPointF p = _maps.at(_mapIndex)->pp2xy(pp);
|
||||
return p + _bounds.at(_mapIndex).second.topLeft();
|
||||
}
|
||||
|
||||
Coordinates Atlas::xy2ll(const QPointF &p)
|
||||
@ -280,7 +250,7 @@ Coordinates Atlas::xy2ll(const QPointF &p)
|
||||
int idx = _zooms.at(_zoom).first;
|
||||
|
||||
for (int i = _zooms.at(_zoom).first; i <= _zooms.at(_zoom).second; i++) {
|
||||
if (_bounds.at(i).second.contains(_maps.at(i)->xy2pp(p))) {
|
||||
if (_bounds.at(i).second.contains(_maps.at(i)->xy2pp(p).toPointF())) {
|
||||
idx = i;
|
||||
break;
|
||||
}
|
||||
@ -332,10 +302,10 @@ bool Atlas::isAtlas(const QString &path)
|
||||
{
|
||||
QFileInfo fi(path);
|
||||
QString suffix = fi.suffix().toLower();
|
||||
Tar tar;
|
||||
Tar tar(path);
|
||||
|
||||
if (suffix == "tar") {
|
||||
if (!tar.load(path))
|
||||
if (!tar.open())
|
||||
return false;
|
||||
QString tbaFileName = fi.completeBaseName() + ".tba";
|
||||
return tar.contains(tbaFileName);
|
||||
|
@ -1,10 +1,9 @@
|
||||
#ifndef ATLAS_H
|
||||
#define ATLAS_H
|
||||
|
||||
#include <QFileInfoList>
|
||||
#include "map.h"
|
||||
#include "offlinemap.h"
|
||||
|
||||
class OfflineMap;
|
||||
|
||||
class Atlas : public Map
|
||||
{
|
||||
@ -12,18 +11,16 @@ class Atlas : public Map
|
||||
|
||||
public:
|
||||
Atlas(const QString &fileName, QObject *parent = 0);
|
||||
~Atlas();
|
||||
|
||||
const QString &name() const {return _name;}
|
||||
|
||||
QRectF bounds() const;
|
||||
qreal resolution(const QPointF &p) const;
|
||||
qreal resolution(const QRectF &rect) const;
|
||||
|
||||
qreal zoom() const;
|
||||
qreal zoomFit(const QSize &size, const RectC &br);
|
||||
qreal zoomFit(qreal resolution, const Coordinates &c);
|
||||
qreal zoomIn();
|
||||
qreal zoomOut();
|
||||
int zoom() const {return _zoom;}
|
||||
int zoomFit(const QSize &size, const RectC &br);
|
||||
int zoomIn();
|
||||
int zoomOut();
|
||||
|
||||
QPointF ll2xy(const Coordinates &c);
|
||||
Coordinates xy2ll(const QPointF &p);
|
||||
@ -33,7 +30,7 @@ public:
|
||||
void unload();
|
||||
|
||||
bool isValid() const {return _valid;}
|
||||
const QString &errorString() const {return _errorString;}
|
||||
QString errorString() const {return _errorString;}
|
||||
|
||||
static bool isAtlas(const QString &path);
|
||||
|
||||
@ -43,15 +40,15 @@ private:
|
||||
void computeBounds();
|
||||
|
||||
QString _name;
|
||||
bool _valid;
|
||||
QString _errorString;
|
||||
|
||||
QList<OfflineMap*> _maps;
|
||||
QVector<QPair<int, int> > _zooms;
|
||||
QVector<QPair<QRectF, QRectF> > _bounds;
|
||||
int _zoom;
|
||||
int _mapIndex;
|
||||
|
||||
int _ci, _cz;
|
||||
bool _valid;
|
||||
QString _errorString;
|
||||
};
|
||||
|
||||
#endif // ATLAS_H
|
||||
|