mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-01 13:29:16 +02:00
Compare commits
268 Commits
Author | SHA1 | Date | |
---|---|---|---|
089d796194 | |||
2677bb77f8 | |||
13dba26d3e | |||
9675e19b94 | |||
8d3fcc7a17 | |||
8dc5cb7aa8 | |||
af99e4e05a | |||
d18c0d1643 | |||
b9a93d30c0 | |||
2b6d3799ec | |||
152828042f | |||
e1683a7560 | |||
444cf344a9 | |||
7ac0bcf6d2 | |||
a1ac306bfc | |||
db4a436ff5 | |||
84a6f6c875 | |||
06f2c883d4 | |||
fc95ebfe2b | |||
4b64ee467c | |||
331cb48e11 | |||
fce0c49504 | |||
f670fb0859 | |||
1e45713aa4 | |||
7265c85b83 | |||
4d156044d0 | |||
17c9416532 | |||
8e9db2354e | |||
544a838821 | |||
44d84bf19e | |||
4ca9c79dc4 | |||
cb77cc37c4 | |||
98dd8c264c | |||
84d860e2a2 | |||
e10f8e9c1b | |||
f433f855a4 | |||
c90a03e22c | |||
fbc0fd86cf | |||
aa07b20aa4 | |||
8a7edcfd8d | |||
04a145a2e7 | |||
66f0f6a202 | |||
5698b4c9b0 | |||
77c4eda385 | |||
d6de3acbd2 | |||
652ed8e919 | |||
58e1980b0d | |||
fda33cc95b | |||
02e724fefb | |||
da220c4b62 | |||
6ffc71fd36 | |||
635e2f1fe3 | |||
23e4e66c1b | |||
1739625896 | |||
e9ef68a81c | |||
06205470fe | |||
c535632eb6 | |||
9f1f06577c | |||
0e45831111 | |||
0c8e864d32 | |||
c9cac70e1f | |||
045cbe81bf | |||
bffd1d9172 | |||
b8102d6bb7 | |||
fc80bd1b7c | |||
2441c4996d | |||
89878fade1 | |||
83b7741ed9 | |||
f44b14473d | |||
699de8b133 | |||
b7dd11fa1f | |||
0a32a9b865 | |||
02ad65461c | |||
5fa52b0166 | |||
99fa39030f | |||
6ebf749bdc | |||
5e74642dc8 | |||
b1d1cae9dd | |||
84f41b5aa9 | |||
de2278ba04 | |||
e90f152432 | |||
8deab1c9ca | |||
51e0f9a9c6 | |||
e330abe180 | |||
53a4b45b7b | |||
53229681d2 | |||
b2df7d207f | |||
1ff2162811 | |||
0f10c7596b | |||
4cc3bc28e2 | |||
3ce1918645 | |||
d70f0cf9e0 | |||
34c5ba4669 | |||
afbb8c3284 | |||
5bdc263cda | |||
179f2f1451 | |||
92e772a02b | |||
cbdfe4c105 | |||
a20a268975 | |||
48e972f920 | |||
c38f50538e | |||
53147b5e6e | |||
6c6e384862 | |||
90b780a444 | |||
56d1ac7ff2 | |||
00acd48009 | |||
e30078a63e | |||
51c0c31838 | |||
bc218c9f65 | |||
56e4c80999 | |||
443b916301 | |||
8675a0e945 | |||
0894fb0ddf | |||
73e15f8f11 | |||
0fe7843e52 | |||
e76439bb6e | |||
b54aeff369 | |||
72968efeef | |||
ec3f529b0f | |||
57a171ee8c | |||
d3193abd0b | |||
6809853a8a | |||
3155e8436b | |||
69f9d05ccb | |||
e24a3cd99a | |||
a94fa9f0ea | |||
c4f2a44410 | |||
da4a51e7fa | |||
bb47a34823 | |||
11196c0e35 | |||
00ef815738 | |||
64f685cf60 | |||
7ab13ec8e5 | |||
d3fbbecb2d | |||
7bc83603ca | |||
2cd35b139e | |||
a74afa54fd | |||
753c4e8db0 | |||
d0b3f48caf | |||
e47cd1be7e | |||
d1ba35f012 | |||
b9489afbfe | |||
a7506cfd82 | |||
c060abe6a7 | |||
b457fc430c | |||
89947851fd | |||
7d40dfddb2 | |||
151ae03b53 | |||
9fd8b84c3b | |||
47683e5447 | |||
84bcf07bd4 | |||
cc694971be | |||
ba856d7eb6 | |||
b14eeb58ab | |||
8e932b966c | |||
35818ce16e | |||
6ef7537dff | |||
abbb823890 | |||
0a4f8a46d4 | |||
fd2823c703 | |||
d16b61051f | |||
e69f17aad5 | |||
33b1e179d3 | |||
5efb9f8a4e | |||
ebf39f11bd | |||
8b7422b70a | |||
ef3da2e156 | |||
6e13c2b704 | |||
f3e4719439 | |||
7b6789e78d | |||
95442461fc | |||
729cbd641c | |||
2e2dad8d04 | |||
4e3b6c2eb2 | |||
6430933a96 | |||
3e14d4afda | |||
ebb30a3fca | |||
bd20d40ba7 | |||
77823fba14 | |||
dcc5cbe9bc | |||
cd3c99b065 | |||
83189a4e65 | |||
797fd7f02b | |||
a45125be9a | |||
a7154988ab | |||
afe9a14d5b | |||
b3f1596918 | |||
cd90407f56 | |||
73f06e61f0 | |||
c708fa35fd | |||
dcedfe1e9f | |||
daa9d296bd | |||
b8a9a4481c | |||
e792bf3b23 | |||
359a9f0a5a | |||
4b0b6513d1 | |||
c7762e26fb | |||
5b8d41afb7 | |||
81e1664a9b | |||
fad3f116f5 | |||
a6e522d758 | |||
ab65deadb6 | |||
7f80e8f7b7 | |||
9a5c5eaf61 | |||
9bc5016141 | |||
a4a46232e4 | |||
d85fbe5b48 | |||
141e0cb404 | |||
2b7d0cd631 | |||
d106f47771 | |||
e48729fc84 | |||
dca53bc622 | |||
65045dfee4 | |||
002b9c35e1 | |||
945528d6b1 | |||
4697ba4ef0 | |||
9bf1447a7e | |||
1a8114af8e | |||
ad154dfd7d | |||
c2004ded31 | |||
3ced367fab | |||
506d1998f8 | |||
afc5e9ca4b | |||
425d0e3013 | |||
3a8b1107fe | |||
ad7a413d50 | |||
8d5f72de64 | |||
9e798e626c | |||
cb70f0dded | |||
400003f684 | |||
69db510b10 | |||
cd9ea0f8a9 | |||
0f6c8eb896 | |||
6b3c0d05ca | |||
b0cc028c4c | |||
1513130435 | |||
ec798451e8 | |||
ffc61552d2 | |||
aff7b1c13f | |||
d54f22d3f0 | |||
dba6291f3e | |||
e96cee2ea8 | |||
1eaaea98a3 | |||
a90073c422 | |||
223a13583c | |||
4386e1f2e1 | |||
5bfe9c2527 | |||
efa2b1c366 | |||
e0ad64a902 | |||
f0a1acb96a | |||
5f3bdb87f8 | |||
90d062e097 | |||
58b4c87d46 | |||
02654ec862 | |||
ff015c8714 | |||
c339116cd1 | |||
d8d70bfd8b | |||
7d8149ace3 | |||
4460b454c4 | |||
211310f377 | |||
1e4bcd0ac1 | |||
1a66ed0a36 | |||
273a127069 | |||
1c0a0fd0b3 | |||
713e331b2a | |||
96f406aad7 | |||
0aedec66c4 | |||
b500031713 |
52
.appveyor.yml
Normal file
52
.appveyor.yml
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
version: 5.0.{build}
|
||||||
|
configuration: Release
|
||||||
|
platform: Any CPU
|
||||||
|
environment:
|
||||||
|
NSISDIR: C:\Program Files (x86)\NSIS
|
||||||
|
matrix:
|
||||||
|
- QTDIR: C:\Qt\5.9\msvc2015
|
||||||
|
PLATFORM: x86
|
||||||
|
NSI: gpxsee.nsi
|
||||||
|
OPENSSLDIR: C:\OpenSSL-Win32\bin
|
||||||
|
- QTDIR: C:\Qt\5.9\msvc2015_64
|
||||||
|
PLATFORM: x86_amd64
|
||||||
|
NSI: gpxsee64.nsi
|
||||||
|
OPENSSLDIR: C:\OpenSSL-Win64\bin
|
||||||
|
install:
|
||||||
|
- cmd: >-
|
||||||
|
set PATH=%QTDIR%\bin;%NSISDIR%;%PATH%
|
||||||
|
|
||||||
|
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %PLATFORM%
|
||||||
|
build_script:
|
||||||
|
- cmd: >-
|
||||||
|
lrelease gpxsee.pro
|
||||||
|
|
||||||
|
qmake gpxsee.pro
|
||||||
|
|
||||||
|
nmake release
|
||||||
|
|
||||||
|
|
||||||
|
md installer
|
||||||
|
|
||||||
|
copy release\GPXSee.exe installer
|
||||||
|
|
||||||
|
windeployqt --no-svg --release installer\GPXSee.exe
|
||||||
|
|
||||||
|
copy pkg\%NSI% installer
|
||||||
|
|
||||||
|
xcopy pkg\csv installer\csv /i
|
||||||
|
|
||||||
|
xcopy pkg\maps installer\maps /i
|
||||||
|
|
||||||
|
xcopy lang\*.qm installer\translations\ /sy
|
||||||
|
|
||||||
|
copy licence.txt installer
|
||||||
|
|
||||||
|
copy %OPENSSLDIR%\libeay32.dll installer
|
||||||
|
|
||||||
|
copy %OPENSSLDIR%\ssleay32.dll installer
|
||||||
|
|
||||||
|
|
||||||
|
makensis.exe installer\%NSI%
|
||||||
|
artifacts:
|
||||||
|
- path: installer\GPXSee-*.exe
|
13
.gitignore
vendored
Normal file
13
.gitignore
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# C++ objects and libs
|
||||||
|
*.o
|
||||||
|
|
||||||
|
# Qt-es
|
||||||
|
/.qmake.stash
|
||||||
|
moc_*.cpp
|
||||||
|
moc_*.h
|
||||||
|
qrc_*.cpp
|
||||||
|
Makefile*
|
||||||
|
*.qm
|
||||||
|
|
||||||
|
# Binary
|
||||||
|
GPXSee
|
18
.travis.yml
Normal file
18
.travis.yml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
language: c++
|
||||||
|
|
||||||
|
os:
|
||||||
|
- linux
|
||||||
|
- osx
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -qq update; fi
|
||||||
|
|
||||||
|
install:
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install qt; fi
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libqt4-dev; fi
|
||||||
|
|
||||||
|
script:
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH=/usr/local/opt/qt/bin/:${PATH}; fi
|
||||||
|
- lrelease gpxsee.pro
|
||||||
|
- qmake gpxsee.pro
|
||||||
|
- make
|
7
CONTRIBUTING.md
Normal file
7
CONTRIBUTING.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
Only localization contributions are accepted at the moment, code pull requests will be rejected.
|
||||||
|
|
||||||
|
The rationale is, that I want leave the possibility to distribute GPXsee builds in the OS X/Windows
|
||||||
|
stores under a non-GPL licence open. In the future, code pull requests under a QT-like contribution
|
||||||
|
agreement [1] will be possible.
|
||||||
|
|
||||||
|
[1] https://d21tv0wm5mksdn.cloudfront.net/wp-content/uploads/2015/03/Qt-ContributionLicenseAgreement_v1_2_FINAL.pdf
|
@ -30,4 +30,4 @@ make
|
|||||||
[Changelog](https://build.opensuse.org/package/view_file/home:tumic:GPXSee/gpxsee/gpxsee.changes)
|
[Changelog](https://build.opensuse.org/package/view_file/home:tumic:GPXSee/gpxsee/gpxsee.changes)
|
||||||
|
|
||||||
## Homepage
|
## Homepage
|
||||||
GPXSee homepage: http://tumic.wz.cz/gpxsee
|
http://www.gpxsee.org
|
||||||
|
BIN
cert/mac/gpxsee.cer
Normal file
BIN
cert/mac/gpxsee.cer
Normal file
Binary file not shown.
376
gpxsee.pro
376
gpxsee.pro
@ -1,5 +1,5 @@
|
|||||||
TARGET = GPXSee
|
TARGET = GPXSee
|
||||||
VERSION = 4.5
|
VERSION = 5.0
|
||||||
QT += core \
|
QT += core \
|
||||||
gui \
|
gui \
|
||||||
network
|
network
|
||||||
@ -7,176 +7,230 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
|||||||
greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport
|
greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport
|
||||||
lessThan(QT_VERSION, 5.4): QT += opengl
|
lessThan(QT_VERSION, 5.4): QT += opengl
|
||||||
macx: QT += opengl
|
macx: QT += opengl
|
||||||
|
INCLUDEPATH += ./src
|
||||||
HEADERS += src/config.h \
|
HEADERS += src/config.h \
|
||||||
src/icons.h \
|
src/common/staticassert.h \
|
||||||
src/gui.h \
|
src/common/coordinates.h \
|
||||||
src/poi.h \
|
src/common/range.h \
|
||||||
src/rtree.h \
|
src/common/rectc.h \
|
||||||
src/axisitem.h \
|
src/common/wgs84.h \
|
||||||
src/keys.h \
|
src/common/str2int.h \
|
||||||
src/slideritem.h \
|
src/GUI/app.h \
|
||||||
src/markeritem.h \
|
src/GUI/icons.h \
|
||||||
src/infoitem.h \
|
src/GUI/gui.h \
|
||||||
src/elevationgraph.h \
|
src/GUI/axisitem.h \
|
||||||
src/speedgraph.h \
|
src/GUI/keys.h \
|
||||||
src/sliderinfoitem.h \
|
src/GUI/slideritem.h \
|
||||||
src/filebrowser.h \
|
src/GUI/markeritem.h \
|
||||||
src/map.h \
|
src/GUI/infoitem.h \
|
||||||
src/onlinemap.h \
|
src/GUI/elevationgraph.h \
|
||||||
src/downloader.h \
|
src/GUI/speedgraph.h \
|
||||||
src/units.h \
|
src/GUI/sliderinfoitem.h \
|
||||||
src/scaleitem.h \
|
src/GUI/filebrowser.h \
|
||||||
src/waypoint.h \
|
src/GUI/units.h \
|
||||||
src/track.h \
|
src/GUI/scaleitem.h \
|
||||||
src/graphview.h \
|
src/GUI/graphview.h \
|
||||||
src/trackpoint.h \
|
src/GUI/waypointitem.h \
|
||||||
src/waypointitem.h \
|
src/GUI/palette.h \
|
||||||
src/palette.h \
|
src/GUI/heartrategraph.h \
|
||||||
src/heartrategraph.h \
|
src/GUI/trackinfo.h \
|
||||||
src/range.h \
|
src/GUI/exportdialog.h \
|
||||||
src/cpuarch.h \
|
src/GUI/fileselectwidget.h \
|
||||||
src/settings.h \
|
src/GUI/margins.h \
|
||||||
src/app.h \
|
src/GUI/temperaturegraph.h \
|
||||||
src/trackinfo.h \
|
src/GUI/graphtab.h \
|
||||||
src/exportdialog.h \
|
src/GUI/trackitem.h \
|
||||||
src/fileselectwidget.h \
|
src/GUI/tooltip.h \
|
||||||
src/margins.h \
|
src/GUI/routeitem.h \
|
||||||
src/temperaturegraph.h \
|
src/GUI/graphitem.h \
|
||||||
src/graphtab.h \
|
src/GUI/pathitem.h \
|
||||||
src/misc.h \
|
src/GUI/griditem.h \
|
||||||
src/trackitem.h \
|
src/GUI/format.h \
|
||||||
src/tooltip.h \
|
src/GUI/cadencegraph.h \
|
||||||
src/route.h \
|
src/GUI/powergraph.h \
|
||||||
src/routeitem.h \
|
src/GUI/optionsdialog.h \
|
||||||
src/graphitem.h \
|
src/GUI/colorbox.h \
|
||||||
src/graph.h \
|
src/GUI/stylecombobox.h \
|
||||||
src/pathitem.h \
|
src/GUI/opengl.h \
|
||||||
src/pathview.h \
|
src/GUI/timetype.h \
|
||||||
src/griditem.h \
|
src/GUI/percentslider.h \
|
||||||
src/data.h \
|
src/GUI/elevationgraphitem.h \
|
||||||
src/gpxparser.h \
|
src/GUI/speedgraphitem.h \
|
||||||
src/tcxparser.h \
|
src/GUI/heartrategraphitem.h \
|
||||||
src/parser.h \
|
src/GUI/temperaturegraphitem.h \
|
||||||
src/csvparser.h \
|
src/GUI/cadencegraphitem.h \
|
||||||
src/coordinates.h \
|
src/GUI/powergraphitem.h \
|
||||||
src/tile.h \
|
src/GUI/oddspinbox.h \
|
||||||
src/rd.h \
|
src/GUI/settings.h \
|
||||||
src/wgs84.h \
|
src/GUI/nicenum.h \
|
||||||
src/kmlparser.h \
|
src/GUI/cpuarch.h \
|
||||||
src/trackdata.h \
|
src/GUI/searchpointer.h \
|
||||||
src/routedata.h \
|
src/GUI/mapview.h \
|
||||||
src/fitparser.h \
|
src/map/projection.h \
|
||||||
src/format.h \
|
src/map/ellipsoid.h \
|
||||||
src/path.h \
|
src/map/datum.h \
|
||||||
src/assert.h \
|
src/map/mercator.h \
|
||||||
src/cadencegraph.h \
|
src/map/transversemercator.h \
|
||||||
src/powergraph.h \
|
src/map/latlon.h \
|
||||||
src/igcparser.h \
|
src/map/utm.h \
|
||||||
src/nmeaparser.h \
|
src/map/lambertconic.h \
|
||||||
src/optionsdialog.h \
|
src/map/lambertazimuthal.h \
|
||||||
src/colorbox.h \
|
src/map/albersequal.h \
|
||||||
src/stylecombobox.h \
|
src/map/map.h \
|
||||||
src/opengl.h \
|
src/map/maplist.h \
|
||||||
src/timetype.h \
|
src/map/onlinemap.h \
|
||||||
src/emptymap.h \
|
src/map/downloader.h \
|
||||||
src/offlinemap.h \
|
src/map/tile.h \
|
||||||
src/matrix.h \
|
src/map/emptymap.h \
|
||||||
src/tar.h \
|
src/map/offlinemap.h \
|
||||||
src/atlas.h \
|
src/map/tar.h \
|
||||||
src/projection.h \
|
src/map/ozf.h \
|
||||||
src/mercator.h \
|
src/map/atlas.h \
|
||||||
src/transversemercator.h \
|
src/map/matrix.h \
|
||||||
src/latlon.h \
|
src/map/geotiff.h \
|
||||||
src/utm.h \
|
src/map/pcs.h \
|
||||||
src/lambertconic.h \
|
src/map/transform.h \
|
||||||
src/ellipsoid.h \
|
src/map/mapfile.h \
|
||||||
src/ozf.h \
|
src/map/tifffile.h \
|
||||||
src/datum.h \
|
src/data/graph.h \
|
||||||
src/maplist.h
|
src/data/poi.h \
|
||||||
|
src/data/waypoint.h \
|
||||||
|
src/data/track.h \
|
||||||
|
src/data/route.h \
|
||||||
|
src/data/trackpoint.h \
|
||||||
|
src/data/data.h \
|
||||||
|
src/data/parser.h \
|
||||||
|
src/data/trackdata.h \
|
||||||
|
src/data/routedata.h \
|
||||||
|
src/data/path.h \
|
||||||
|
src/data/rtree.h \
|
||||||
|
src/data/gpxparser.h \
|
||||||
|
src/data/tcxparser.h \
|
||||||
|
src/data/csvparser.h \
|
||||||
|
src/data/kmlparser.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
|
||||||
SOURCES += src/main.cpp \
|
SOURCES += src/main.cpp \
|
||||||
src/gui.cpp \
|
src/common/coordinates.cpp \
|
||||||
src/poi.cpp \
|
src/common/rectc.cpp \
|
||||||
src/axisitem.cpp \
|
src/common/range.cpp \
|
||||||
src/slideritem.cpp \
|
src/common/str2int.cpp \
|
||||||
src/markeritem.cpp \
|
src/GUI/app.cpp \
|
||||||
src/infoitem.cpp \
|
src/GUI/gui.cpp \
|
||||||
src/elevationgraph.cpp \
|
src/GUI/axisitem.cpp \
|
||||||
src/speedgraph.cpp \
|
src/GUI/slideritem.cpp \
|
||||||
src/sliderinfoitem.cpp \
|
src/GUI/markeritem.cpp \
|
||||||
src/filebrowser.cpp \
|
src/GUI/infoitem.cpp \
|
||||||
src/onlinemap.cpp \
|
src/GUI/elevationgraph.cpp \
|
||||||
src/downloader.cpp \
|
src/GUI/speedgraph.cpp \
|
||||||
src/scaleitem.cpp \
|
src/GUI/sliderinfoitem.cpp \
|
||||||
src/track.cpp \
|
src/GUI/filebrowser.cpp \
|
||||||
src/graphview.cpp \
|
src/GUI/scaleitem.cpp \
|
||||||
src/waypointitem.cpp \
|
src/GUI/graphview.cpp \
|
||||||
src/palette.cpp \
|
src/GUI/waypointitem.cpp \
|
||||||
src/heartrategraph.cpp \
|
src/GUI/palette.cpp \
|
||||||
src/range.cpp \
|
src/GUI/heartrategraph.cpp \
|
||||||
src/app.cpp \
|
src/GUI/trackinfo.cpp \
|
||||||
src/trackinfo.cpp \
|
src/GUI/exportdialog.cpp \
|
||||||
src/exportdialog.cpp \
|
src/GUI/fileselectwidget.cpp \
|
||||||
src/fileselectwidget.cpp \
|
src/GUI/temperaturegraph.cpp \
|
||||||
src/temperaturegraph.cpp \
|
src/GUI/trackitem.cpp \
|
||||||
src/trackpoint.cpp \
|
src/GUI/tooltip.cpp \
|
||||||
src/misc.cpp \
|
src/GUI/routeitem.cpp \
|
||||||
src/waypoint.cpp \
|
src/GUI/graphitem.cpp \
|
||||||
src/trackitem.cpp \
|
src/GUI/pathitem.cpp \
|
||||||
src/tooltip.cpp \
|
src/GUI/griditem.cpp \
|
||||||
src/route.cpp \
|
src/GUI/format.cpp \
|
||||||
src/routeitem.cpp \
|
src/GUI/cadencegraph.cpp \
|
||||||
src/graphitem.cpp \
|
src/GUI/powergraph.cpp \
|
||||||
src/pathitem.cpp \
|
src/GUI/optionsdialog.cpp \
|
||||||
src/pathview.cpp \
|
src/GUI/colorbox.cpp \
|
||||||
src/griditem.cpp \
|
src/GUI/stylecombobox.cpp \
|
||||||
src/data.cpp \
|
src/GUI/oddspinbox.cpp \
|
||||||
src/gpxparser.cpp \
|
src/GUI/percentslider.cpp \
|
||||||
src/tcxparser.cpp \
|
src/GUI/elevationgraphitem.cpp \
|
||||||
src/csvparser.cpp \
|
src/GUI/speedgraphitem.cpp \
|
||||||
src/coordinates.cpp \
|
src/GUI/heartrategraphitem.cpp \
|
||||||
src/kmlparser.cpp \
|
src/GUI/temperaturegraphitem.cpp \
|
||||||
src/fitparser.cpp \
|
src/GUI/cadencegraphitem.cpp \
|
||||||
src/format.cpp \
|
src/GUI/powergraphitem.cpp \
|
||||||
src/graph.cpp \
|
src/GUI/nicenum.cpp \
|
||||||
src/cadencegraph.cpp \
|
src/GUI/mapview.cpp \
|
||||||
src/powergraph.cpp \
|
src/map/maplist.cpp \
|
||||||
src/igcparser.cpp \
|
src/map/onlinemap.cpp \
|
||||||
src/path.cpp \
|
src/map/downloader.cpp \
|
||||||
src/nmeaparser.cpp \
|
src/map/emptymap.cpp \
|
||||||
src/optionsdialog.cpp \
|
src/map/offlinemap.cpp \
|
||||||
src/colorbox.cpp \
|
src/map/tar.cpp \
|
||||||
src/stylecombobox.cpp \
|
src/map/atlas.cpp \
|
||||||
src/emptymap.cpp \
|
src/map/ozf.cpp \
|
||||||
src/offlinemap.cpp \
|
src/map/matrix.cpp \
|
||||||
src/matrix.cpp \
|
src/map/ellipsoid.cpp \
|
||||||
src/tar.cpp \
|
src/map/datum.cpp \
|
||||||
src/atlas.cpp \
|
src/map/mercator.cpp \
|
||||||
src/mercator.cpp \
|
src/map/transversemercator.cpp \
|
||||||
src/transversemercator.cpp \
|
src/map/utm.cpp \
|
||||||
src/utm.cpp \
|
src/map/lambertconic.cpp \
|
||||||
src/lambertconic.cpp \
|
src/map/albersequal.cpp \
|
||||||
src/ellipsoid.cpp \
|
src/map/lambertazimuthal.cpp \
|
||||||
src/ozf.cpp \
|
src/map/geotiff.cpp \
|
||||||
src/datum.cpp \
|
src/map/pcs.cpp \
|
||||||
src/maplist.cpp
|
src/map/transform.cpp \
|
||||||
|
src/map/mapfile.cpp \
|
||||||
|
src/map/tifffile.cpp \
|
||||||
|
src/data/data.cpp \
|
||||||
|
src/data/poi.cpp \
|
||||||
|
src/data/track.cpp \
|
||||||
|
src/data/route.cpp \
|
||||||
|
src/data/path.cpp \
|
||||||
|
src/data/gpxparser.cpp \
|
||||||
|
src/data/tcxparser.cpp \
|
||||||
|
src/data/csvparser.cpp \
|
||||||
|
src/data/kmlparser.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
|
||||||
RESOURCES += gpxsee.qrc
|
RESOURCES += gpxsee.qrc
|
||||||
TRANSLATIONS = lang/gpxsee_cs.ts \
|
TRANSLATIONS = lang/gpxsee_cs.ts \
|
||||||
lang/gpxsee_sv.ts \
|
lang/gpxsee_sv.ts \
|
||||||
lang/gpxsee_de.ts
|
lang/gpxsee_de.ts \
|
||||||
|
lang/gpxsee_ru.ts \
|
||||||
|
lang/gpxsee_fi.ts \
|
||||||
|
lang/gpxsee_fr.ts
|
||||||
macx {
|
macx {
|
||||||
ICON = icons/gpxsee.icns
|
ICON = icons/gpxsee.icns
|
||||||
QMAKE_INFO_PLIST = Info.plist
|
QMAKE_INFO_PLIST = pkg/Info.plist
|
||||||
APP_RESOURCES.files = icons/gpx.icns \
|
LOCALE.path = Contents/Resources/translations
|
||||||
icons/tcx.icns \
|
LOCALE.files = lang/gpxsee_cs.qm \
|
||||||
|
lang/gpxsee_de.qm \
|
||||||
|
lang/gpxsee_fi.qm \
|
||||||
|
lang/gpxsee_fr.qm \
|
||||||
|
lang/gpxsee_ru.qm \
|
||||||
|
lang/gpxsee_sv.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/kml.icns \
|
icons/kml.icns \
|
||||||
icons/fit.icns \
|
icons/fit.icns \
|
||||||
icons/igc.icns \
|
icons/igc.icns \
|
||||||
icons/nmea.icns \
|
icons/nmea.icns
|
||||||
pkg/maps.txt \
|
QMAKE_BUNDLE_DATA += LOCALE MAPS ICONS CSV
|
||||||
pkg/ellipsoids.csv \
|
|
||||||
pkg/datums.csv
|
|
||||||
APP_RESOURCES.path = Contents/Resources
|
|
||||||
QMAKE_BUNDLE_DATA += APP_RESOURCES
|
|
||||||
}
|
}
|
||||||
win32 {
|
win32 {
|
||||||
RC_ICONS = icons/gpxsee.ico \
|
RC_ICONS = icons/gpxsee.ico \
|
||||||
|
@ -14,13 +14,11 @@
|
|||||||
<file>icons/arrow-left-double.png</file>
|
<file>icons/arrow-left-double.png</file>
|
||||||
<file>icons/arrow-right-double.png</file>
|
<file>icons/arrow-right-double.png</file>
|
||||||
<file>icons/view-fullscreen.png</file>
|
<file>icons/view-fullscreen.png</file>
|
||||||
<file>icons/office-chart-line-stacked.png</file>
|
<file>icons/office-chart-line.png</file>
|
||||||
<file>icons/preferences-desktop-display.png</file>
|
<file>icons/preferences-desktop-display.png</file>
|
||||||
<file>icons/flag_48.png</file>
|
<file>icons/flag_48.png</file>
|
||||||
<file>icons/system-run.png</file>
|
<file>icons/system-run.png</file>
|
||||||
<file>icons/document-print-preview.png</file>
|
<file>icons/document-print-preview.png</file>
|
||||||
<file>lang/gpxsee_cs.qm</file>
|
<file>icons/view-filter.png</file>
|
||||||
<file>lang/gpxsee_sv.qm</file>
|
|
||||||
<file>lang/gpxsee_de.qm</file>
|
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 727 B |
BIN
icons/office-chart-line.png
Normal file
BIN
icons/office-chart-line.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 728 B |
BIN
icons/view-filter.png
Normal file
BIN
icons/view-filter.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
1057
lang/gpxsee_cs.ts
1057
lang/gpxsee_cs.ts
File diff suppressed because it is too large
Load Diff
1057
lang/gpxsee_de.ts
1057
lang/gpxsee_de.ts
File diff suppressed because it is too large
Load Diff
1501
lang/gpxsee_fi.ts
Normal file
1501
lang/gpxsee_fi.ts
Normal file
File diff suppressed because it is too large
Load Diff
1501
lang/gpxsee_fr.ts
Normal file
1501
lang/gpxsee_fr.ts
Normal file
File diff suppressed because it is too large
Load Diff
1502
lang/gpxsee_ru.ts
Normal file
1502
lang/gpxsee_ru.ts
Normal file
File diff suppressed because it is too large
Load Diff
1107
lang/gpxsee_sv.ts
1107
lang/gpxsee_sv.ts
File diff suppressed because it is too large
Load Diff
@ -15,7 +15,7 @@
|
|||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>@EXECUTABLE@</string>
|
<string>@EXECUTABLE@</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>cz.wz.tumic.GPXSee</string>
|
<string>org.gpxsee.GPXSee</string>
|
||||||
|
|
||||||
<key>CFBundleDocumentTypes</key>
|
<key>CFBundleDocumentTypes</key>
|
||||||
<array>
|
<array>
|
||||||
@ -29,7 +29,7 @@
|
|||||||
<string>application/gpx+xml</string>
|
<string>application/gpx+xml</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>gpx.icns</string>
|
<string>icons/gpx.icns</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>GPS Exchange Format</string>
|
<string>GPS Exchange Format</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -45,7 +45,7 @@
|
|||||||
<string>application/tcx+xml</string>
|
<string>application/tcx+xml</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>tcx.icns</string>
|
<string>icons/tcx.icns</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>Training Center XML</string>
|
<string>Training Center XML</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -61,7 +61,7 @@
|
|||||||
<string>application/vnd.google-earth.kml+xml</string>
|
<string>application/vnd.google-earth.kml+xml</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>kml.icns</string>
|
<string>icons/kml.icns</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>Keyhole Markup Language</string>
|
<string>Keyhole Markup Language</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -77,7 +77,7 @@
|
|||||||
<string>application/vnd.ant.fit</string>
|
<string>application/vnd.ant.fit</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>fit.icns</string>
|
<string>icons/fit.icns</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>Flexible and Interoperable Data Transfer</string>
|
<string>Flexible and Interoperable Data Transfer</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -93,7 +93,7 @@
|
|||||||
<string>application/vnd.fai.igc</string>
|
<string>application/vnd.fai.igc</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>igc.icns</string>
|
<string>icons/igc.icns</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>Flight Recorder Data Format</string>
|
<string>Flight Recorder Data Format</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -109,7 +109,7 @@
|
|||||||
<string>application/vnd.nmea.nmea</string>
|
<string>application/vnd.nmea.nmea</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>nmea.icns</string>
|
<string>icons/nmea.icns</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>NMEA 0183 data</string>
|
<string>NMEA 0183 data</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
19
pkg/csv/ellipsoids.csv
Normal file
19
pkg/csv/ellipsoids.csv
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
Airy 1830,7001,6377563.396,299.3249646
|
||||||
|
Modified Airy,7002,6377340.189,299.3249646
|
||||||
|
Australian National,7003,6378160.0,298.25
|
||||||
|
Bessel 1841,7004,6377397.155,299.1528128
|
||||||
|
Bessel 1841 (Norway),7005,6377492.0176,299.1528
|
||||||
|
Clarke 1866,7008,6378206.4,294.9786982
|
||||||
|
Clarke 1880 (Palestine),7010,6378300.789,293.466
|
||||||
|
Clarke 1880 (IGN),7011,6378249.2,293.466021
|
||||||
|
Clarke 1880,7012,6378249.145,293.465
|
||||||
|
Everest 1830 (1937 Adjustment),7015,6377276.345,300.8017
|
||||||
|
Everest 1830 Modified,7018,6377304.063,300.8017
|
||||||
|
GRS 80,7019,6378137.0,298.257222101
|
||||||
|
Helmert 1906,7020,6378200.0,298.3
|
||||||
|
International 1924,7022,6378388.0,297.0
|
||||||
|
Krassovsky 1940,7024,6378245.0,298.3
|
||||||
|
South American 1969,7036,6378160.0,298.25
|
||||||
|
WGS 72,7043,6378135.0,298.26
|
||||||
|
Bessel 1841 (Namibia),7046,6377483.865,299.1528128
|
||||||
|
Hough 1960,7053,6378270.0,297.0
|
|
121
pkg/csv/gcs.csv
Normal file
121
pkg/csv/gcs.csv
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
Adindan,4201,6201,9122,7012,8901,9603,-162,-12,206
|
||||||
|
Afgooye,4205,6205,9122,7024,8901,9603,-43,-163,45
|
||||||
|
Ain el Abd 1970,4204,6204,9122,7022,8901,9603,-150,-251,-2
|
||||||
|
Anna 1 Astro 1965,4708,6708,9122,7003,8901,9603,-491,-22,435
|
||||||
|
Arc 1950,4209,6209,9122,7012,8901,9603,-143,-90,-294
|
||||||
|
Arc 1960,4210,6210,9122,7012,8901,9603,-160,-8,-300
|
||||||
|
Ascension Island 1958,4712,6712,9122,7022,8901,9603,-207,107,52
|
||||||
|
Astro B4 Sorol Atoll,4707,6707,9122,7022,8901,9603,114,-116,-333
|
||||||
|
Astro Beacon 1945,4709,6709,9122,7022,8901,9603,145,75,-272
|
||||||
|
Astro DOS 71/4,4710,6710,9122,7022,8901,9603,-320,550,-494
|
||||||
|
Astronomic Stn 1952,4711,6711,9122,7022,8901,9603,124,-234,-25
|
||||||
|
Australian Geodetic 1966,4202,6202,9122,7003,8901,9603,-133,-48,148
|
||||||
|
Australian Geodetic 1984,4203,6203,9122,7003,8901,9603,-134,-48,149
|
||||||
|
Australian Geocentric 1994 (GDA94),4283,6283,9122,7019,8901,9603,0,0,0
|
||||||
|
Austrian,4312,6312,9122,7004,8901,9603,594,84,471
|
||||||
|
Bellevue (IGN),4714,6714,9122,7022,8901,9603,-127,-769,472
|
||||||
|
Bermuda 1957,4216,6216,9122,7008,8901,9603,-73,213,296
|
||||||
|
Bogota Observatory,4218,6218,9122,7022,8901,9603,307,304,-318
|
||||||
|
Campo Inchauspe,4221,6221,9122,7022,8901,9603,-148,136,90
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
European 1979,4668,6668,9122,7022,8901,9603,-86,-98,-119
|
||||||
|
Finland Hayford,4123,6123,9122,7022,8901,9603,-78,-231,-97
|
||||||
|
Gandajika Base,4233,6233,9122,7022,8901,9603,-133,-321,50
|
||||||
|
Geodetic Datum 1949,4272,6272,9122,7022,8901,9603,84,-22,209
|
||||||
|
GGRS 87,4121,6121,9122,7019,8901,9603,-199.87,74.79,246.62
|
||||||
|
Guam 1963,4675,6675,9122,7008,8901,9603,-100,-248,259
|
||||||
|
GUX 1 Astro,4718,6718,9122,7022,8901,9603,252,-209,-751
|
||||||
|
Hartebeeshoek94,4148,6148,9122,7030,8901,9603,0,0,0
|
||||||
|
Hermannskogel,3906,1031,9122,7004,8901,9603,653,-212,449
|
||||||
|
Hjorsey 1955,4658,6658,9122,7022,8901,9603,-73,46,-86
|
||||||
|
Hong Kong 1963,4739,6739,9122,7022,8901,9603,-156,-271,-189
|
||||||
|
Hu-Tzu-Shan,4236,6236,9122,7022,8901,9603,-634,-549,-201
|
||||||
|
Indian Bangladesh,4682,6682,9122,7015,8901,9603,289,734,257
|
||||||
|
Indian Thailand,4240,6240,9122,7015,8901,9603,214,836,303
|
||||||
|
Israeli,4281,6281,9122,7010,8901,9603,-235,-85,264
|
||||||
|
Ireland 1965,4299,6299,9122,7002,8901,9603,506,-122,611
|
||||||
|
ISTS 073 Astro 1969,4724,6724,9122,7022,8901,9603,208,-435,-229
|
||||||
|
Johnston Island,4725,6725,9122,7022,8901,9603,191,-77,-204
|
||||||
|
Kandawala,4244,6244,9122,7015,8901,9603,-97,787,86
|
||||||
|
Kerguelen Island,4698,6698,9122,7022,8901,9603,145,-187,103
|
||||||
|
Kertau 1948,4245,6245,9122,7018,8901,9603,-11,851,5
|
||||||
|
L.C. 5 Astro,4726,6726,9122,7008,8901,9603,42,124,147
|
||||||
|
Liberia 1964,4251,6251,9122,7012,8901,9603,-90,40,88
|
||||||
|
Luzon Mindanao,,,9122,7008,8901,9603,-133,-79,-72
|
||||||
|
Luzon Philippines,4253,6253,9122,7008,8901,9603,-133,-77,-51
|
||||||
|
Mahe 1971,4256,6256,9122,7012,8901,9603,41,-220,-134
|
||||||
|
Marco Astro,4616,6616,9122,7022,8901,9603,-289,-124,60
|
||||||
|
Massawa,4262,6262,9122,7004,8901,9603,639,405,60
|
||||||
|
Merchich,4261,6261,9122,7012,8901,9603,31,146,47
|
||||||
|
Midway Astro 1961,4727,6727,9122,7022,8901,9603,912,-58,1227
|
||||||
|
Minna,4263,6263,9122,7012,8901,9603,-92,-93,122
|
||||||
|
NAD27 Alaska,,,9122,7008,8901,9603,-5,135,172
|
||||||
|
NAD27 Bahamas,,,9122,7008,8901,9603,-4,154,178
|
||||||
|
NAD27 Canada,,,9122,7008,8901,9603,-10,158,187
|
||||||
|
NAD27 Canal Zone,,,9122,7008,8901,9603,0,125,201
|
||||||
|
NAD27 Caribbean,,,9122,7008,8901,9603,-3,142,183
|
||||||
|
NAD27 Central,,,9122,7008,8901,9603,0,125,194
|
||||||
|
NAD27 CONUS,4267,6267,9122,7008,8901,9603,-8,160,176
|
||||||
|
NAD27 Cuba,,,9122,7008,8901,9603,-9,152,178
|
||||||
|
NAD27 Greenland,,,9122,7008,8901,9603,11,114,195
|
||||||
|
NAD27 Mexico,,,9122,7008,8901,9603,-12,130,190
|
||||||
|
NAD27 San Salvador,,,9122,7008,8901,9603,1,140,165
|
||||||
|
NAD83,4269,6269,9122,7019,8901,9603,0,0,0
|
||||||
|
Nahrwn Masirah Ilnd,,,9122,7012,8901,9603,-247,-148,369
|
||||||
|
Nahrwn Saudi Arbia,,,9122,7012,8901,9603,-231,-196,482
|
||||||
|
Nahrwn United Arab,4270,6270,9122,7012,8901,9603,-249,-156,381
|
||||||
|
Naparima BWI,4271,6271,9122,7022,8901,9603,-2,374,172
|
||||||
|
NGO1948,4273,6273,9122,7005,8901,9603,315,-217,528
|
||||||
|
NTF France,4275,6275,9122,7011,8901,9603,-168,-60,320
|
||||||
|
Norsk,4817,6817,9122,7005,8913,9603,278,93,474
|
||||||
|
NZGD1949,4272,6272,9122,7022,8901,9603,84,-22,209
|
||||||
|
NZGD2000,4167,6167,9122,7030,8901,9603,0,0,0
|
||||||
|
Observatorio 1966,4182,6182,9122,7022,8901,9603,-425,-169,81
|
||||||
|
Old Egyptian,4229,6229,9122,7020,8901,9603,-130,110,-13
|
||||||
|
Old Hawaiian,4135,6135,9122,7008,8901,9603,61,-285,-181
|
||||||
|
Oman,4232,6232,9122,7012,8901,9603,-346,-1,224
|
||||||
|
Ord Srvy Grt Britn,4277,6277,9122,7001,8901,9603,375,-111,431
|
||||||
|
Pico De Las Nieves,4728,6728,9122,7022,8901,9603,-307,-92,127
|
||||||
|
Pitcairn Astro 1967,4729,6729,9122,7022,8901,9603,185,165,42
|
||||||
|
Potsdam Rauenberg DHDN,4314,6314,9122,7004,8901,9603,606,23,413
|
||||||
|
Prov So Amrican 1956,4248,6248,9122,7022,8901,9603,-288,175,-376
|
||||||
|
Prov So Chilean 1963,4254,6254,9122,7022,8901,9603,16,196,93
|
||||||
|
Puerto Rico,4139,6139,9122,7008,8901,9603,11,72,-101
|
||||||
|
Pulkovo 1942 (1),4284,6284,9122,7024,8901,9603,28,-130,-95
|
||||||
|
Pulkovo 1942 (2),,,9122,7024,8901,9603,28,-130,-95
|
||||||
|
Qatar National,4285,6285,9122,7022,8901,9603,-128,-283,22
|
||||||
|
Qornoq,4287,6287,9108,7022,8901,9603,164,138,-189
|
||||||
|
Reunion,4626,6626,9122,7022,8901,9603,94,-948,-1262
|
||||||
|
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
|
||||||
|
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
|
||||||
|
Schwarzeck,4293,6293,9122,7046,8901,9603,616,97,-251
|
||||||
|
South American 1969,4291,6291,9108,7036,8901,9603,-57,1,-41
|
||||||
|
Southeast Base,4615,6615,9122,7022,8901,9603,-499,-249,314
|
||||||
|
Southwest Base,4183,6183,9122,7022,8901,9603,-104,167,-38
|
||||||
|
Timbalai 1948,4298,6298,9122,7015,8901,9603,-689,691,-46
|
||||||
|
Tokyo,4301,6301,9122,7004,8901,9603,-128,481,664
|
||||||
|
Tristan Astro 1968,4734,6734,9122,7022,8901,9603,-632,438,-609
|
||||||
|
Viti Levu 1916,4731,6731,9122,7012,8901,9603,51,391,-36
|
||||||
|
Wake-Eniwetok 1960,4732,6732,9122,7053,8901,9603,101,52,-39
|
||||||
|
WGS 72,4322,6322,9122,7043,8901,9603,0,0,5
|
||||||
|
Yacare,4309,6309,9122,7022,8901,9603,-155,171,37
|
||||||
|
Zanderij,4311,6311,9122,7022,8901,9603,-265,120,-358
|
|
1626
pkg/csv/pcs.csv
Normal file
1626
pkg/csv/pcs.csv
Normal file
File diff suppressed because it is too large
Load Diff
123
pkg/datums.csv
123
pkg/datums.csv
@ -1,123 +0,0 @@
|
|||||||
Adindan,4201,5,-162,-12,206
|
|
||||||
Afgooye,4205,15,-43,-163,45
|
|
||||||
Ain el Abd 1970,4204,14,-150,-251,-2
|
|
||||||
Anna 1 Astro 1965,4708,2,-491,-22,435
|
|
||||||
Arc 1950,4209,5,-143,-90,-294
|
|
||||||
Arc 1960,4210,5,-160,-8,-300
|
|
||||||
Ascension Island 1958,4712,14,-207,107,52
|
|
||||||
Astro B4 Sorol Atoll,4707,14,114,-116,-333
|
|
||||||
Astro Beacon 1945,4709,14,145,75,-272
|
|
||||||
Astro DOS 71/4,4710,14,-320,550,-494
|
|
||||||
Astronomic Stn 1952,4711,14,124,-234,-25
|
|
||||||
Australian Geodetic 1966,4202,2,-133,-48,148
|
|
||||||
Australian Geodetic 1984,4203,2,-134,-48,149
|
|
||||||
Australian Geocentric 1994 (GDA94),4283,11,0,0,0
|
|
||||||
Austrian,4312,3,594,84,471
|
|
||||||
Bellevue (IGN),4714,14,-127,-769,472
|
|
||||||
Bermuda 1957,4216,4,-73,213,296
|
|
||||||
Bogota Observatory,4218,14,307,304,-318
|
|
||||||
Campo Inchauspe,4221,14,-148,136,90
|
|
||||||
Canton Astro 1966,4716,14,298,-304,-375
|
|
||||||
Cape,4222,5,-136,-108,-292
|
|
||||||
Cape Canaveral,4717,4,-2,150,181
|
|
||||||
Carthage,4223,5,-263,6,431
|
|
||||||
CH-1903,4149,3,674,15,405
|
|
||||||
Chatham 1971,4672,14,175,-38,113
|
|
||||||
Chua Astro,4224,14,-134,229,-29
|
|
||||||
Corrego Alegre,4225,14,-206,172,-6
|
|
||||||
Djakarta (Batavia),4211,3,-377,681,-50
|
|
||||||
DOS 1968,,14,230,-199,-752
|
|
||||||
Easter Island 1967,4719,14,211,147,111
|
|
||||||
Egypt,,14,-130,-117,-151
|
|
||||||
European 1950,4230,14,-87,-98,-121
|
|
||||||
European 1950 (Mean France),,14,-87,-96,-120
|
|
||||||
European 1950 (Spain and Portugal),,14,-84,-107,-120
|
|
||||||
European 1979,4668,14,-86,-98,-119
|
|
||||||
Finland Hayford,4123,14,-78,-231,-97
|
|
||||||
Gandajika Base,4233,14,-133,-321,50
|
|
||||||
Geodetic Datum 1949,4272,14,84,-22,209
|
|
||||||
GGRS 87,4121,11,-199.87,74.79,246.62
|
|
||||||
Guam 1963,4675,4,-100,-248,259
|
|
||||||
GUX 1 Astro,4718,14,252,-209,-751
|
|
||||||
Hartebeeshoek94,4148,20,0,0,0
|
|
||||||
Hermannskogel,3906,3,653,-212,449
|
|
||||||
Hjorsey 1955,4658,14,-73,46,-86
|
|
||||||
Hong Kong 1963,4739,14,-156,-271,-189
|
|
||||||
Hu-Tzu-Shan,4236,14,-634,-549,-201
|
|
||||||
Indian Bangladesh,4682,6,289,734,257
|
|
||||||
Indian Thailand,4240,6,214,836,303
|
|
||||||
Israeli,4281,23,-235,-85,264
|
|
||||||
Ireland 1965,4299,1,506,-122,611
|
|
||||||
ISTS 073 Astro 1969,4724,14,208,-435,-229
|
|
||||||
Johnston Island,4725,14,191,-77,-204
|
|
||||||
Kandawala,4244,6,-97,787,86
|
|
||||||
Kerguelen Island,4698,14,145,-187,103
|
|
||||||
Kertau 1948,4245,7,-11,851,5
|
|
||||||
L.C. 5 Astro,4726,4,42,124,147
|
|
||||||
Liberia 1964,4251,5,-90,40,88
|
|
||||||
Luzon Mindanao,,4,-133,-79,-72
|
|
||||||
Luzon Philippines,4253,4,-133,-77,-51
|
|
||||||
Mahe 1971,4256,5,41,-220,-134
|
|
||||||
Marco Astro,4616,14,-289,-124,60
|
|
||||||
Massawa,4262,3,639,405,60
|
|
||||||
Merchich,4261,5,31,146,47
|
|
||||||
Midway Astro 1961,4727,14,912,-58,1227
|
|
||||||
Minna,4263,5,-92,-93,122
|
|
||||||
NAD27 Alaska,,4,-5,135,172
|
|
||||||
NAD27 Bahamas,,4,-4,154,178
|
|
||||||
NAD27 Canada,,4,-10,158,187
|
|
||||||
NAD27 Canal Zone,,4,0,125,201
|
|
||||||
NAD27 Caribbean,,4,-7,152,178
|
|
||||||
NAD27 Central,,4,0,125,194
|
|
||||||
NAD27 CONUS,,4,-8,160,176
|
|
||||||
NAD27 Cuba,,4,-9,152,178
|
|
||||||
NAD27 Greenland,,4,11,114,195
|
|
||||||
NAD27 Mexico,,4,-12,130,190
|
|
||||||
NAD27 San Salvador,,4,1,140,165
|
|
||||||
NAD83,4269,11,0,0,0
|
|
||||||
Nahrwn Masirah Ilnd,,5,-247,-148,369
|
|
||||||
Nahrwn Saudi Arbia,,5,-231,-196,482
|
|
||||||
Nahrwn United Arab,,5,-249,-156,381
|
|
||||||
Naparima BWI,4271,14,-2,374,172
|
|
||||||
NGO1948,4273,27,315,-217,528
|
|
||||||
NTF France,4275,24,-168,-60,320
|
|
||||||
Norsk,4817,27,278,93,474
|
|
||||||
NZGD1949,4272,14,84,-22,209
|
|
||||||
NZGD2000,4167,20,0,0,0
|
|
||||||
Observatorio 1966,4182,14,-425,-169,81
|
|
||||||
Old Egyptian,4229,12,-130,110,-13
|
|
||||||
Old Hawaiian,4135,4,61,-285,-181
|
|
||||||
Oman,4232,5,-346,-1,224
|
|
||||||
Ord Srvy Grt Britn,4277,0,375,-111,431
|
|
||||||
Pico De Las Nieves,4728,14,-307,-92,127
|
|
||||||
Pitcairn Astro 1967,4729,14,185,165,42
|
|
||||||
Potsdam Rauenberg DHDN,4314,3,606,23,413
|
|
||||||
Prov So Amrican 1956,4248,14,-288,175,-376
|
|
||||||
Prov So Chilean 1963,4254,14,16,196,93
|
|
||||||
Puerto Rico,4139,4,11,72,-101
|
|
||||||
Pulkovo 1942 (1),4284,15,28,-130,-95
|
|
||||||
Pulkovo 1942 (2),4284,15,28,-130,-95
|
|
||||||
Qatar National,4285,14,-128,-283,22
|
|
||||||
Qornoq,4287,14,164,138,-189
|
|
||||||
Reunion,4626,14,94,-948,-1262
|
|
||||||
Rijksdriehoeksmeting,4289,3,593,26,478
|
|
||||||
Rome 1940,4806,14,-225,-65,9
|
|
||||||
RT 90,4124,3,498,-36,568
|
|
||||||
S42,4179,15,28,-121,-77
|
|
||||||
Santo (DOS),4730,14,170,42,84
|
|
||||||
Sao Braz,4184,14,-203,141,53
|
|
||||||
Sapper Hill 1943,4292,14,-355,16,74
|
|
||||||
Schwarzeck,4293,21,616,97,-251
|
|
||||||
South American 1969,4291,16,-57,1,-41
|
|
||||||
South Asia,,8,7,-10,-26
|
|
||||||
Southeast Base,4615,14,-499,-249,314
|
|
||||||
Southwest Base,4183,14,-104,167,-38
|
|
||||||
Timbalai 1948,4298,6,-689,691,-46
|
|
||||||
Tokyo,4301,3,-128,481,664
|
|
||||||
Tristan Astro 1968,4734,14,-632,438,-609
|
|
||||||
Viti Levu 1916,4731,5,51,391,-36
|
|
||||||
Wake-Eniwetok 1960,4732,13,101,52,-39
|
|
||||||
WGS 72,4322,19,0,0,5
|
|
||||||
WGS 84,4326,20,0,0,0
|
|
||||||
Yacare,4309,14,-155,171,37
|
|
||||||
Zanderij,4311,14,-265,120,-358
|
|
|
@ -1,30 +0,0 @@
|
|||||||
0,Airy 1830,6377563.396,299.3249646
|
|
||||||
1,Modified Airy,6377340.189,299.3249646
|
|
||||||
2,Australian National,6378160.0,298.25
|
|
||||||
3,Bessel 1841,6377397.155,299.1528128
|
|
||||||
4,Clarke 1866,6378206.4,294.9786982
|
|
||||||
5,Clarke 1880,6378249.145,293.465
|
|
||||||
6,Everest (India 1830),6377276.345,300.8017
|
|
||||||
7,Everest (1948),6377304.063,300.8017
|
|
||||||
8,Modified Fischer 1960,6378155.0,298.3
|
|
||||||
9,Everest (Pakistan),6377309.613,300.8017
|
|
||||||
10,Indonesian 1974,6378160.0,298.247
|
|
||||||
11,GRS 80,6378137.0,298.257222101
|
|
||||||
12,Helmert 1906,6378200.0,298.3
|
|
||||||
13,Hough 1960,6378270.0,297.0
|
|
||||||
14,International 1924,6378388.0,297.0
|
|
||||||
15,Krassovsky 1940,6378245.0,298.3
|
|
||||||
16,South American 1969,6378160.0,298.25
|
|
||||||
17,Everest (Malaysia 1969),6377295.664,300.8017
|
|
||||||
18,Everest (Sabah Sarawak),6377298.556,300.8017
|
|
||||||
19,WGS 72,6378135.0,298.26
|
|
||||||
20,WGS 84,6378137.0,298.257223563
|
|
||||||
21,Bessel 1841 (Namibia),6377483.865,299.1528128
|
|
||||||
22,Everest (India 1956),6377301.243,300.8017
|
|
||||||
23,Clarke 1880 Palestine,6378300.789,293.466
|
|
||||||
24,Clarke 1880 IGN,6378249.2,293.466021
|
|
||||||
25,Hayford 1909,6378388.0,296.959263
|
|
||||||
26,Clarke 1858,6378350.87,294.26
|
|
||||||
27,Bessel 1841 (Norway),6377492.0176,299.1528
|
|
||||||
28,Plessis 1817 (France),6376523.0,308.6409971
|
|
||||||
29,Hayford 1924,6378388.0,297.0
|
|
|
12
pkg/gpxsee.desktop
Normal file
12
pkg/gpxsee.desktop
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Name=GPXSee
|
||||||
|
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 логов
|
||||||
|
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;
|
@ -5,10 +5,12 @@
|
|||||||
; The name of the installer
|
; The name of the installer
|
||||||
Name "GPXSee"
|
Name "GPXSee"
|
||||||
; Program version
|
; Program version
|
||||||
!define VERSION "4.5"
|
!define VERSION "5.0"
|
||||||
|
|
||||||
; The file to write
|
; The file to write
|
||||||
OutFile "GPXSee-${VERSION}.exe"
|
OutFile "GPXSee-${VERSION}.exe"
|
||||||
|
; Compression method
|
||||||
|
SetCompressor /SOLID lzma
|
||||||
|
|
||||||
; Required execution level
|
; Required execution level
|
||||||
RequestExecutionLevel admin
|
RequestExecutionLevel admin
|
||||||
@ -81,9 +83,8 @@ Section "GPXSee" SEC_APP
|
|||||||
|
|
||||||
; Put the files there
|
; Put the files there
|
||||||
File "gpxsee.exe"
|
File "gpxsee.exe"
|
||||||
File "maps.txt"
|
File /r "maps"
|
||||||
File "ellipsoids.csv"
|
File /r "csv"
|
||||||
File "datums.csv"
|
|
||||||
|
|
||||||
; Create start menu entry and add links
|
; Create start menu entry and add links
|
||||||
SetShellVarContext all
|
SetShellVarContext all
|
||||||
@ -171,8 +172,8 @@ Section "MSVC runtime" SEC_MSVC
|
|||||||
|
|
||||||
DetailPrint "Installing Visual C++ 2015 Redistributable..."
|
DetailPrint "Installing Visual C++ 2015 Redistributable..."
|
||||||
SetOutPath $TEMP
|
SetOutPath $TEMP
|
||||||
File "VC_redist.x86.exe"
|
File "vcredist_x86.exe"
|
||||||
ExecWait '"$TEMP/VC_redist.x86.exe" /install /quiet /norestart'
|
ExecWait '"$TEMP\vcredist_x86.exe" /install /quiet /norestart'
|
||||||
SetOutPath $INSTDIR
|
SetOutPath $INSTDIR
|
||||||
|
|
||||||
done:
|
done:
|
||||||
@ -193,6 +194,38 @@ Section "ANGLE" SEC_ANGLE
|
|||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
SectionGroup "Localization" SEC_LOCALIZATION
|
||||||
|
Section "Czech"
|
||||||
|
CreateDirectory "$INSTDIR\translations"
|
||||||
|
File /oname=translations\gpxsee_cs.qm translations\gpxsee_cs.qm
|
||||||
|
File /oname=translations\qt_cs.qm translations\qt_cs.qm
|
||||||
|
SectionEnd
|
||||||
|
Section "Finnish"
|
||||||
|
CreateDirectory "$INSTDIR\translations"
|
||||||
|
File /oname=translations\gpxsee_fi.qm translations\gpxsee_fi.qm
|
||||||
|
File /oname=translations\qt_fi.qm translations\qt_fi.qm
|
||||||
|
SectionEnd
|
||||||
|
Section "French"
|
||||||
|
CreateDirectory "$INSTDIR\translations"
|
||||||
|
File /oname=translations\gpxsee_fr.qm translations\gpxsee_fr.qm
|
||||||
|
File /oname=translations\qt_fr.qm translations\qt_fr.qm
|
||||||
|
SectionEnd
|
||||||
|
Section "German"
|
||||||
|
CreateDirectory "$INSTDIR\translations"
|
||||||
|
File /oname=translations\gpxsee_de.qm translations\gpxsee_de.qm
|
||||||
|
File /oname=translations\qt_de.qm translations\qt_de.qm
|
||||||
|
SectionEnd
|
||||||
|
Section "Russian"
|
||||||
|
CreateDirectory "$INSTDIR\translations"
|
||||||
|
File /oname=translations\gpxsee_ru.qm translations\gpxsee_ru.qm
|
||||||
|
File /oname=translations\qt_ru.qm translations\qt_ru.qm
|
||||||
|
SectionEnd
|
||||||
|
Section "Swedish"
|
||||||
|
CreateDirectory "$INSTDIR\translations"
|
||||||
|
File /oname=translations\gpxsee_sv.qm translations\gpxsee_sv.qm
|
||||||
|
SectionEnd
|
||||||
|
SectionGroupEnd
|
||||||
|
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
|
|
||||||
; Uninstaller
|
; Uninstaller
|
||||||
@ -244,6 +277,8 @@ LangString DESC_ANGLE ${LANG_ENGLISH} \
|
|||||||
"ANGLE (OpenGL via Direct3D). Enables OpenGL on systems without native OpenGL drivers."
|
"ANGLE (OpenGL via Direct3D). Enables OpenGL on systems without native OpenGL drivers."
|
||||||
LangString DESC_APP ${LANG_ENGLISH} \
|
LangString DESC_APP ${LANG_ENGLISH} \
|
||||||
"GPXSee application"
|
"GPXSee application"
|
||||||
|
LangString DESC_LOCALIZATION ${LANG_ENGLISH} \
|
||||||
|
"Localization"
|
||||||
|
|
||||||
;Assign language strings to sections
|
;Assign language strings to sections
|
||||||
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
||||||
@ -252,4 +287,5 @@ LangString DESC_APP ${LANG_ENGLISH} \
|
|||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ANGLE} $(DESC_ANGLE)
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ANGLE} $(DESC_ANGLE)
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP)
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP)
|
||||||
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_LOCALIZATION} $(DESC_LOCALIZATION)
|
||||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||||
|
46
pkg/gpxsee.xml
Normal file
46
pkg/gpxsee.xml
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
||||||
|
|
||||||
|
<mime-type type="application/gpx+xml">
|
||||||
|
<comment>GPS Exchange Format</comment>
|
||||||
|
<sub-class-of type="application/xml"/>
|
||||||
|
<generic-icon name="application-xml"/>
|
||||||
|
<glob pattern="*.gpx"/>
|
||||||
|
</mime-type>
|
||||||
|
|
||||||
|
<mime-type type="application/tcx+xml">
|
||||||
|
<comment>Training Center XML</comment>
|
||||||
|
<sub-class-of type="application/xml"/>
|
||||||
|
<generic-icon name="application-xml"/>
|
||||||
|
<glob pattern="*.tcx"/>
|
||||||
|
</mime-type>
|
||||||
|
|
||||||
|
<mime-type type="application/kml+xml">
|
||||||
|
<comment>Keyhole Markup Language</comment>
|
||||||
|
<sub-class-of type="application/xml"/>
|
||||||
|
<generic-icon name="application-xml"/>
|
||||||
|
<glob pattern="*.kml"/>
|
||||||
|
</mime-type>
|
||||||
|
|
||||||
|
<mime-type type="application/vnd.ant.fit">
|
||||||
|
<comment>Flexible and Interoperable Data Transfer</comment>
|
||||||
|
<sub-class-of type="application/octet-stream"/>
|
||||||
|
<generic-icon name="application-octet-stream"/>
|
||||||
|
<glob pattern="*.fit"/>
|
||||||
|
</mime-type>
|
||||||
|
|
||||||
|
<mime-type type="application/vnd.fai.igc">
|
||||||
|
<comment>Flight Recorder Data Format</comment>
|
||||||
|
<sub-class-of type="text/plain"/>
|
||||||
|
<generic-icon name="text-plain"/>
|
||||||
|
<glob pattern="*.igc"/>
|
||||||
|
</mime-type>
|
||||||
|
|
||||||
|
<mime-type type="application/vnd.nmea.nmea">
|
||||||
|
<comment>NMEA 0183 data</comment>
|
||||||
|
<sub-class-of type="text/plain"/>
|
||||||
|
<generic-icon name="text-plain"/>
|
||||||
|
<glob pattern="*.nmea"/>
|
||||||
|
</mime-type>
|
||||||
|
|
||||||
|
</mime-info>
|
@ -5,10 +5,12 @@
|
|||||||
; The name of the installer
|
; The name of the installer
|
||||||
Name "GPXSee"
|
Name "GPXSee"
|
||||||
; Program version
|
; Program version
|
||||||
!define VERSION "4.5"
|
!define VERSION "5.0"
|
||||||
|
|
||||||
; The file to write
|
; The file to write
|
||||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||||
|
; Compression method
|
||||||
|
SetCompressor /SOLID lzma
|
||||||
|
|
||||||
; Required execution level
|
; Required execution level
|
||||||
RequestExecutionLevel admin
|
RequestExecutionLevel admin
|
||||||
@ -88,9 +90,8 @@ Section "GPXSee" SEC_APP
|
|||||||
|
|
||||||
; Put the files there
|
; Put the files there
|
||||||
File "gpxsee.exe"
|
File "gpxsee.exe"
|
||||||
File "maps.txt"
|
File /r "maps"
|
||||||
File "ellipsoids.csv"
|
File /r "csv"
|
||||||
File "datums.csv"
|
|
||||||
|
|
||||||
; Create start menu entry and add links
|
; Create start menu entry and add links
|
||||||
SetShellVarContext all
|
SetShellVarContext all
|
||||||
@ -173,8 +174,8 @@ Section "MSVC runtime" SEC_MSVC
|
|||||||
|
|
||||||
DetailPrint "Installing Visual C++ 2015 Redistributable..."
|
DetailPrint "Installing Visual C++ 2015 Redistributable..."
|
||||||
SetOutPath $TEMP
|
SetOutPath $TEMP
|
||||||
File "VC_redist.x64.exe"
|
File "vcredist_x64.exe"
|
||||||
ExecWait '"$TEMP/VC_redist.x64.exe" /install /quiet /norestart'
|
ExecWait '"$TEMP\vcredist_x64.exe" /install /quiet /norestart'
|
||||||
SetOutPath $INSTDIR
|
SetOutPath $INSTDIR
|
||||||
|
|
||||||
done:
|
done:
|
||||||
@ -195,6 +196,38 @@ Section "ANGLE" SEC_ANGLE
|
|||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
SectionGroup "Localization" SEC_LOCALIZATION
|
||||||
|
Section "Czech"
|
||||||
|
CreateDirectory "$INSTDIR\translations"
|
||||||
|
File /oname=translations\gpxsee_cs.qm translations\gpxsee_cs.qm
|
||||||
|
File /oname=translations\qt_cs.qm translations\qt_cs.qm
|
||||||
|
SectionEnd
|
||||||
|
Section "Finnish"
|
||||||
|
CreateDirectory "$INSTDIR\translations"
|
||||||
|
File /oname=translations\gpxsee_fi.qm translations\gpxsee_fi.qm
|
||||||
|
File /oname=translations\qt_fi.qm translations\qt_fi.qm
|
||||||
|
SectionEnd
|
||||||
|
Section "French"
|
||||||
|
CreateDirectory "$INSTDIR\translations"
|
||||||
|
File /oname=translations\gpxsee_fr.qm translations\gpxsee_fr.qm
|
||||||
|
File /oname=translations\qt_fr.qm translations\qt_fr.qm
|
||||||
|
SectionEnd
|
||||||
|
Section "German"
|
||||||
|
CreateDirectory "$INSTDIR\translations"
|
||||||
|
File /oname=translations\gpxsee_de.qm translations\gpxsee_de.qm
|
||||||
|
File /oname=translations\qt_de.qm translations\qt_de.qm
|
||||||
|
SectionEnd
|
||||||
|
Section "Russian"
|
||||||
|
CreateDirectory "$INSTDIR\translations"
|
||||||
|
File /oname=translations\gpxsee_ru.qm translations\gpxsee_ru.qm
|
||||||
|
File /oname=translations\qt_ru.qm translations\qt_ru.qm
|
||||||
|
SectionEnd
|
||||||
|
Section "Swedish"
|
||||||
|
CreateDirectory "$INSTDIR\translations"
|
||||||
|
File /oname=translations\gpxsee_sv.qm translations\gpxsee_sv.qm
|
||||||
|
SectionEnd
|
||||||
|
SectionGroupEnd
|
||||||
|
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
|
|
||||||
; Uninstaller
|
; Uninstaller
|
||||||
@ -247,6 +280,8 @@ LangString DESC_ANGLE ${LANG_ENGLISH} \
|
|||||||
"ANGLE (OpenGL via Direct3D). Enables OpenGL on systems without native OpenGL drivers."
|
"ANGLE (OpenGL via Direct3D). Enables OpenGL on systems without native OpenGL drivers."
|
||||||
LangString DESC_APP ${LANG_ENGLISH} \
|
LangString DESC_APP ${LANG_ENGLISH} \
|
||||||
"GPXSee application"
|
"GPXSee application"
|
||||||
|
LangString DESC_LOCALIZATION ${LANG_ENGLISH} \
|
||||||
|
"Localization"
|
||||||
|
|
||||||
;Assign language strings to sections
|
;Assign language strings to sections
|
||||||
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
||||||
@ -255,4 +290,5 @@ LangString DESC_APP ${LANG_ENGLISH} \
|
|||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ANGLE} $(DESC_ANGLE)
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ANGLE} $(DESC_ANGLE)
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP)
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP)
|
||||||
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_LOCALIZATION} $(DESC_LOCALIZATION)
|
||||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
Open Topo Map https://a.tile.opentopomap.org/$z/$x/$y.png
|
|
||||||
Thunderforest http://tile.thunderforest.com/outdoors/$z/$x/$y.png
|
|
||||||
Open Street Map http://tile.openstreetmap.org/$z/$x/$y.png
|
|
7
pkg/maps/4UMaps.xml
Normal file
7
pkg/maps/4UMaps.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<map>
|
||||||
|
<name>4UMaps</name>
|
||||||
|
<url>http://4umaps.eu/$z/$x/$y.png</url>
|
||||||
|
<zoom min="2" max="15"/>
|
||||||
|
<bounds bottom="-65"/>
|
||||||
|
</map>
|
5
pkg/maps/OpenStreetMap.xml
Normal file
5
pkg/maps/OpenStreetMap.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<map>
|
||||||
|
<name>Open Street Map</name>
|
||||||
|
<url>http://tile.openstreetmap.org/$z/$x/$y.png</url>
|
||||||
|
</map>
|
6
pkg/maps/OpenTopoMap.xml
Normal file
6
pkg/maps/OpenTopoMap.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<map>
|
||||||
|
<name>Open Topo Map</name>
|
||||||
|
<url>https://a.tile.opentopomap.org/$z/$x/$y.png</url>
|
||||||
|
<zoom max="17"/>
|
||||||
|
</map>
|
7
pkg/maps/USGS-imagery.xml
Normal file
7
pkg/maps/USGS-imagery.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<map>
|
||||||
|
<name>USGS Imagery</name>
|
||||||
|
<url>https://navigator.er.usgs.gov/tiles/aerial_Imagery.cgi/$z/$x/$y</url>
|
||||||
|
<zoom min="2" max="15"/>
|
||||||
|
<bounds bottom="0" top="74"/>
|
||||||
|
</map>
|
6
pkg/maps/USGS-topo.xml
Normal file
6
pkg/maps/USGS-topo.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<map>
|
||||||
|
<name>USGS Topo</name>
|
||||||
|
<url>https://navigator.er.usgs.gov/tiles/tcr.cgi/$z/$x/$y.png</url>
|
||||||
|
<zoom min="2" max="15"/>
|
||||||
|
</map>
|
111
src/GUI/app.cpp
Normal file
111
src/GUI/app.cpp
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
#include <QtGlobal>
|
||||||
|
#include <QTranslator>
|
||||||
|
#include <QLocale>
|
||||||
|
#include <QFileOpenEvent>
|
||||||
|
#include <QNetworkProxyFactory>
|
||||||
|
#include <QLibraryInfo>
|
||||||
|
#include "map/onlinemap.h"
|
||||||
|
#include "map/downloader.h"
|
||||||
|
#include "map/ellipsoid.h"
|
||||||
|
#include "map/gcs.h"
|
||||||
|
#include "map/pcs.h"
|
||||||
|
#include "opengl.h"
|
||||||
|
#include "gui.h"
|
||||||
|
#include "config.h"
|
||||||
|
#include "app.h"
|
||||||
|
|
||||||
|
|
||||||
|
App::App(int &argc, char **argv) : QApplication(argc, argv),
|
||||||
|
_argc(argc), _argv(argv)
|
||||||
|
{
|
||||||
|
QTranslator *gpxsee = new QTranslator(this);
|
||||||
|
gpxsee->load(QLocale::system(), "gpxsee", "_", TRANSLATIONS_DIR);
|
||||||
|
installTranslator(gpxsee);
|
||||||
|
|
||||||
|
QTranslator *qt = new QTranslator(this);
|
||||||
|
#if defined(Q_OS_WINDOWS) || defined(Q_OS_MAC)
|
||||||
|
qt->load(QLocale::system(), "qt", "_", TRANSLATIONS_DIR);
|
||||||
|
#else // Q_OS_WINDOWS || Q_OS_MAC
|
||||||
|
qt->load(QLocale::system(), "qt", "_", QLibraryInfo::location(
|
||||||
|
QLibraryInfo::TranslationsPath));
|
||||||
|
#endif // Q_OS_WINDOWS || Q_OS_MAC
|
||||||
|
installTranslator(qt);
|
||||||
|
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
setAttribute(Qt::AA_DontShowIconsInMenus);
|
||||||
|
#endif // Q_OS_MAC
|
||||||
|
|
||||||
|
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
||||||
|
OnlineMap::setDownloader(new Downloader(this));
|
||||||
|
OPENGL_SET_SAMPLES(4);
|
||||||
|
loadDatums();
|
||||||
|
loadPCSs();
|
||||||
|
|
||||||
|
_gui = new GUI();
|
||||||
|
}
|
||||||
|
|
||||||
|
App::~App()
|
||||||
|
{
|
||||||
|
delete _gui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void App::run()
|
||||||
|
{
|
||||||
|
_gui->show();
|
||||||
|
|
||||||
|
for (int i = 1; i < _argc; i++)
|
||||||
|
_gui->openFile(QString::fromLocal8Bit(_argv[i]));
|
||||||
|
|
||||||
|
exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool App::event(QEvent *event)
|
||||||
|
{
|
||||||
|
if (event->type() == QEvent::FileOpen) {
|
||||||
|
QFileOpenEvent *e = static_cast<QFileOpenEvent *>(event);
|
||||||
|
return _gui->openFile(e->file());
|
||||||
|
}
|
||||||
|
|
||||||
|
return QApplication::event(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void App::loadDatums()
|
||||||
|
{
|
||||||
|
QString ef, df;
|
||||||
|
|
||||||
|
if (QFile::exists(USER_ELLIPSOID_FILE))
|
||||||
|
ef = USER_ELLIPSOID_FILE;
|
||||||
|
else if (QFile::exists(GLOBAL_ELLIPSOID_FILE))
|
||||||
|
ef = GLOBAL_ELLIPSOID_FILE;
|
||||||
|
else
|
||||||
|
qWarning("No ellipsoids file found.");
|
||||||
|
|
||||||
|
if (QFile::exists(USER_GCS_FILE))
|
||||||
|
df = USER_GCS_FILE;
|
||||||
|
else if (QFile::exists(GLOBAL_GCS_FILE))
|
||||||
|
df = GLOBAL_GCS_FILE;
|
||||||
|
else
|
||||||
|
qWarning("No datums file found.");
|
||||||
|
|
||||||
|
if (!ef.isNull() && !df.isNull()) {
|
||||||
|
Ellipsoid::loadList(ef);
|
||||||
|
GCS::loadList(df);
|
||||||
|
} else
|
||||||
|
qWarning("Maps based on a datum different from WGS84 won't work.");
|
||||||
|
}
|
||||||
|
|
||||||
|
void App::loadPCSs()
|
||||||
|
{
|
||||||
|
QString file;
|
||||||
|
|
||||||
|
if (QFile::exists(USER_PCS_FILE))
|
||||||
|
file = USER_PCS_FILE;
|
||||||
|
else if (QFile::exists(GLOBAL_PCS_FILE))
|
||||||
|
file = GLOBAL_PCS_FILE;
|
||||||
|
else {
|
||||||
|
qWarning("No PCS file found.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
PCS::loadList(file);
|
||||||
|
}
|
@ -18,6 +18,9 @@ protected:
|
|||||||
bool event(QEvent *event);
|
bool event(QEvent *event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void loadDatums();
|
||||||
|
void loadPCSs();
|
||||||
|
|
||||||
int &_argc;
|
int &_argc;
|
||||||
char **_argv;
|
char **_argv;
|
||||||
GUI *_gui;
|
GUI *_gui;
|
@ -1,7 +1,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "misc.h"
|
#include "nicenum.h"
|
||||||
#include "axisitem.h"
|
#include "axisitem.h"
|
||||||
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
#define AXISITEM_H
|
#define AXISITEM_H
|
||||||
|
|
||||||
#include <QGraphicsItem>
|
#include <QGraphicsItem>
|
||||||
#include "range.h"
|
#include "common/range.h"
|
||||||
|
|
||||||
class AxisItem : public QGraphicsItem
|
class AxisItem : public QGraphicsItem
|
||||||
{
|
{
|
@ -1,10 +1,10 @@
|
|||||||
#include "data.h"
|
#include "data/data.h"
|
||||||
|
#include "cadencegraphitem.h"
|
||||||
#include "cadencegraph.h"
|
#include "cadencegraph.h"
|
||||||
|
|
||||||
|
|
||||||
CadenceGraph::CadenceGraph(QWidget *parent) : GraphTab(parent)
|
CadenceGraph::CadenceGraph(QWidget *parent) : GraphTab(parent)
|
||||||
{
|
{
|
||||||
_units = Metric;
|
|
||||||
_showTracks = true;
|
_showTracks = true;
|
||||||
|
|
||||||
GraphView::setYUnits(tr("1/min"));
|
GraphView::setYUnits(tr("1/min"));
|
||||||
@ -28,21 +28,16 @@ void CadenceGraph::loadData(const Data &data, const QList<PathItem *> &paths)
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < data.tracks().count(); i++) {
|
for (int i = 0; i < data.tracks().count(); i++) {
|
||||||
const Graph &graph = data.tracks().at(i)->cadence();
|
const Graph &graph = data.tracks().at(i)->cadence();
|
||||||
qreal sum = 0, w = 0;
|
|
||||||
|
|
||||||
if (graph.size() < 2) {
|
if (graph.size() < 2) {
|
||||||
skipColor();
|
skipColor();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int j = 1; j < graph.size(); j++) {
|
CadenceGraphItem *gi = new CadenceGraphItem(graph, _graphType);
|
||||||
qreal ds = graph.at(j).s() - graph.at(j-1).s();
|
GraphView::addGraph(gi, paths.at(i));
|
||||||
sum += graph.at(j).y() * ds;
|
|
||||||
w += ds;
|
|
||||||
}
|
|
||||||
_avg.append(QPointF(data.tracks().at(i)->distance(), sum/w));
|
|
||||||
|
|
||||||
GraphView::loadGraph(graph, paths.at(i));
|
_avg.append(QPointF(data.tracks().at(i)->distance(), gi->avg()));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < data.routes().count(); i++)
|
for (int i = 0; i < data.routes().count(); i++)
|
@ -13,7 +13,6 @@ public:
|
|||||||
QString label() const {return tr("Cadence");}
|
QString label() const {return tr("Cadence");}
|
||||||
void loadData(const Data &data, const QList<PathItem *> &paths);
|
void loadData(const Data &data, const QList<PathItem *> &paths);
|
||||||
void clear();
|
void clear();
|
||||||
void setUnits(enum Units) {}
|
|
||||||
void showTracks(bool show);
|
void showTracks(bool show);
|
||||||
void showRoutes(bool show) {Q_UNUSED(show);}
|
void showRoutes(bool show) {Q_UNUSED(show);}
|
||||||
|
|
||||||
@ -24,7 +23,6 @@ private:
|
|||||||
|
|
||||||
QList<QPointF> _avg;
|
QList<QPointF> _avg;
|
||||||
|
|
||||||
enum Units _units;
|
|
||||||
bool _showTracks;
|
bool _showTracks;
|
||||||
};
|
};
|
||||||
|
|
26
src/GUI/cadencegraphitem.cpp
Normal file
26
src/GUI/cadencegraphitem.cpp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#include "tooltip.h"
|
||||||
|
#include "cadencegraphitem.h"
|
||||||
|
|
||||||
|
CadenceGraphItem::CadenceGraphItem(const Graph &graph, GraphType type,
|
||||||
|
QGraphicsItem *parent) : GraphItem(graph, type, parent)
|
||||||
|
{
|
||||||
|
qreal sum = 0;
|
||||||
|
|
||||||
|
for (int j = 1; j < graph.size(); j++)
|
||||||
|
sum += graph.at(j).y() * (graph.at(j).s() - graph.at(j-1).s());
|
||||||
|
_avg = sum/graph.last().s();
|
||||||
|
|
||||||
|
setToolTip(toolTip());
|
||||||
|
}
|
||||||
|
|
||||||
|
QString CadenceGraphItem::toolTip() const
|
||||||
|
{
|
||||||
|
ToolTip tt;
|
||||||
|
|
||||||
|
tt.insert(tr("Maximum"), QString::number(max(), 'f', 1)
|
||||||
|
+ UNIT_SPACE + tr("1/min"));
|
||||||
|
tt.insert(tr("Average"), QString::number(avg(), 'f', 1)
|
||||||
|
+ UNIT_SPACE + tr("1/min"));
|
||||||
|
|
||||||
|
return tt.toString();
|
||||||
|
}
|
23
src/GUI/cadencegraphitem.h
Normal file
23
src/GUI/cadencegraphitem.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#ifndef CADENCEGRAPHITEM_H
|
||||||
|
#define CADENCEGRAPHITEM_H
|
||||||
|
|
||||||
|
#include "graphitem.h"
|
||||||
|
|
||||||
|
class CadenceGraphItem : public GraphItem
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
CadenceGraphItem(const Graph &graph, GraphType type,
|
||||||
|
QGraphicsItem *parent = 0);
|
||||||
|
|
||||||
|
qreal max() const {return -bounds().top();}
|
||||||
|
qreal avg() const {return _avg;}
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString toolTip() const;
|
||||||
|
|
||||||
|
qreal _avg;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CADENCEGRAPHITEM_H
|
@ -9,6 +9,8 @@
|
|||||||
ColorBox::ColorBox(QWidget *parent) : QWidget(parent)
|
ColorBox::ColorBox(QWidget *parent) : QWidget(parent)
|
||||||
{
|
{
|
||||||
_color = Qt::red;
|
_color = Qt::red;
|
||||||
|
_alpha = true;
|
||||||
|
|
||||||
setSizePolicy(QSizePolicy::QSizePolicy::Minimum, QSizePolicy::Fixed);
|
setSizePolicy(QSizePolicy::QSizePolicy::Minimum, QSizePolicy::Fixed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,9 +53,9 @@ void ColorBox::mousePressEvent(QMouseEvent *event)
|
|||||||
{
|
{
|
||||||
if (event->button() != Qt::LeftButton)
|
if (event->button() != Qt::LeftButton)
|
||||||
return;
|
return;
|
||||||
|
QColorDialog::ColorDialogOptions options = _alpha
|
||||||
QColor color = QColorDialog::getColor(_color, this, QString(),
|
? QColorDialog::ShowAlphaChannel : (QColorDialog::ColorDialogOptions)0;
|
||||||
QColorDialog::ShowAlphaChannel);
|
QColor color = QColorDialog::getColor(_color, this, QString(), options);
|
||||||
if (color.isValid()) {
|
if (color.isValid()) {
|
||||||
_color = color;
|
_color = color;
|
||||||
update();
|
update();
|
@ -12,6 +12,7 @@ public:
|
|||||||
|
|
||||||
const QColor &color() const {return _color;}
|
const QColor &color() const {return _color;}
|
||||||
void setColor(const QColor &color);
|
void setColor(const QColor &color);
|
||||||
|
void enableAlphaChannel(bool enable) {_alpha = enable;}
|
||||||
|
|
||||||
QSize sizeHint() const;
|
QSize sizeHint() const;
|
||||||
|
|
||||||
@ -24,6 +25,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QColor _color;
|
QColor _color;
|
||||||
|
bool _alpha;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // COLORBOX_H
|
#endif // COLORBOX_H
|
@ -1,6 +1,8 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include "data/data.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "data.h"
|
#include "tooltip.h"
|
||||||
|
#include "elevationgraphitem.h"
|
||||||
#include "elevationgraph.h"
|
#include "elevationgraph.h"
|
||||||
|
|
||||||
|
|
||||||
@ -42,11 +44,8 @@ ElevationGraph::ElevationGraph(QWidget *parent) : GraphTab(parent)
|
|||||||
_showRoutes = true;
|
_showRoutes = true;
|
||||||
_showTracks = true;
|
_showTracks = true;
|
||||||
|
|
||||||
_units = Metric;
|
setYUnits(Metric);
|
||||||
|
|
||||||
setYUnits();
|
|
||||||
setYLabel(tr("Elevation"));
|
setYLabel(tr("Elevation"));
|
||||||
|
|
||||||
setMinYRange(50.0);
|
setMinYRange(50.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,43 +67,25 @@ void ElevationGraph::setInfo()
|
|||||||
|
|
||||||
void ElevationGraph::loadGraph(const Graph &graph, Type type, PathItem *path)
|
void ElevationGraph::loadGraph(const Graph &graph, Type type, PathItem *path)
|
||||||
{
|
{
|
||||||
qreal ascent = 0, descent = 0;
|
|
||||||
qreal min, max;
|
|
||||||
|
|
||||||
if (graph.size() < 2) {
|
if (graph.size() < 2) {
|
||||||
skipColor();
|
skipColor();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
max = min = graph.at(0).y();
|
ElevationGraphItem *gi = new ElevationGraphItem(graph, _graphType);
|
||||||
for (int j = 1; j < graph.size(); j++) {
|
GraphView::addGraph(gi, path, type);
|
||||||
qreal cur = graph.at(j).y();
|
|
||||||
qreal prev = graph.at(j-1).y();
|
|
||||||
|
|
||||||
if (cur > prev)
|
|
||||||
ascent += cur - prev;
|
|
||||||
if (cur < prev)
|
|
||||||
descent += prev - cur;
|
|
||||||
|
|
||||||
if (cur < min)
|
|
||||||
min = cur;
|
|
||||||
if (cur > max)
|
|
||||||
max = cur;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (type == Track) {
|
if (type == Track) {
|
||||||
_trackAscent += ascent;
|
_trackAscent += gi->ascent();
|
||||||
_trackDescent += descent;
|
_trackDescent += gi->descent();
|
||||||
_trackMax = nMax(_trackMax, max);
|
_trackMax = nMax(_trackMax, gi->max());
|
||||||
_trackMin = nMin(_trackMin, min);
|
_trackMin = nMin(_trackMin, gi->min());
|
||||||
} else {
|
} else {
|
||||||
_routeAscent += ascent;
|
_routeAscent += gi->ascent();
|
||||||
_routeDescent += descent;
|
_routeDescent += gi->descent();
|
||||||
_routeMax = nMax(_routeMax, max);
|
_routeMax = nMax(_routeMax, gi->max());
|
||||||
_routeMin = nMin(_routeMin, min);
|
_routeMin = nMin(_routeMin, gi->min());
|
||||||
}
|
}
|
||||||
|
|
||||||
GraphView::loadGraph(graph, path, type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ElevationGraph::loadData(const Data &data, const QList<PathItem *> &paths)
|
void ElevationGraph::loadData(const Data &data, const QList<PathItem *> &paths)
|
||||||
@ -135,9 +116,9 @@ void ElevationGraph::clear()
|
|||||||
GraphView::clear();
|
GraphView::clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ElevationGraph::setYUnits()
|
void ElevationGraph::setYUnits(Units units)
|
||||||
{
|
{
|
||||||
if (_units == Metric) {
|
if (units == Metric) {
|
||||||
GraphView::setYUnits(tr("m"));
|
GraphView::setYUnits(tr("m"));
|
||||||
setYScale(1);
|
setYScale(1);
|
||||||
} else {
|
} else {
|
||||||
@ -146,15 +127,12 @@ void ElevationGraph::setYUnits()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ElevationGraph::setUnits(enum Units units)
|
void ElevationGraph::setUnits(Units units)
|
||||||
{
|
{
|
||||||
_units = units;
|
setYUnits(units);
|
||||||
|
|
||||||
setYUnits();
|
|
||||||
setInfo();
|
setInfo();
|
||||||
GraphView::setUnits(units);
|
|
||||||
|
|
||||||
redraw();
|
GraphView::setUnits(units);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ElevationGraph::showTracks(bool show)
|
void ElevationGraph::showTracks(bool show)
|
@ -25,7 +25,7 @@ private:
|
|||||||
qreal ascent() const;
|
qreal ascent() const;
|
||||||
qreal descent() const;
|
qreal descent() const;
|
||||||
|
|
||||||
void setYUnits();
|
void setYUnits(Units units);
|
||||||
void setInfo();
|
void setInfo();
|
||||||
|
|
||||||
void loadGraph(const Graph &graph, Type type, PathItem *path);
|
void loadGraph(const Graph &graph, Type type, PathItem *path);
|
||||||
@ -35,7 +35,6 @@ private:
|
|||||||
qreal _trackMax, _routeMax;
|
qreal _trackMax, _routeMax;
|
||||||
qreal _trackMin, _routeMin;
|
qreal _trackMin, _routeMin;
|
||||||
|
|
||||||
enum Units _units;
|
|
||||||
bool _showTracks, _showRoutes;
|
bool _showTracks, _showRoutes;
|
||||||
};
|
};
|
||||||
|
|
43
src/GUI/elevationgraphitem.cpp
Normal file
43
src/GUI/elevationgraphitem.cpp
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
#include "tooltip.h"
|
||||||
|
#include "elevationgraphitem.h"
|
||||||
|
|
||||||
|
ElevationGraphItem::ElevationGraphItem(const Graph &graph, GraphType type,
|
||||||
|
QGraphicsItem *parent) : GraphItem(graph, type, parent)
|
||||||
|
{
|
||||||
|
_ascent = _descent = 0;
|
||||||
|
|
||||||
|
for (int j = 1; j < graph.size(); j++) {
|
||||||
|
qreal cur = graph.at(j).y();
|
||||||
|
qreal prev = graph.at(j-1).y();
|
||||||
|
|
||||||
|
if (cur > prev)
|
||||||
|
_ascent += cur - prev;
|
||||||
|
if (cur < prev)
|
||||||
|
_descent += prev - cur;
|
||||||
|
}
|
||||||
|
|
||||||
|
setToolTip(toolTip(Metric));
|
||||||
|
}
|
||||||
|
|
||||||
|
QString ElevationGraphItem::toolTip(Units units) const
|
||||||
|
{
|
||||||
|
ToolTip tt;
|
||||||
|
qreal scale = (units == Metric) ? 1.0 : M2FT;
|
||||||
|
QString su = (units == Metric) ? tr("m") : tr("ft");
|
||||||
|
|
||||||
|
tt.insert(tr("Ascent"), QString::number(ascent() * scale, 'f', 0)
|
||||||
|
+ UNIT_SPACE + su);
|
||||||
|
tt.insert(tr("Descent"), QString::number(descent() * scale, 'f', 0)
|
||||||
|
+ UNIT_SPACE + su);
|
||||||
|
tt.insert(tr("Maximum"), QString::number(max() * scale, 'f', 0)
|
||||||
|
+ UNIT_SPACE + su);
|
||||||
|
tt.insert(tr("Minimum"), QString::number(min() * scale, 'f', 0)
|
||||||
|
+ UNIT_SPACE + su);
|
||||||
|
|
||||||
|
return tt.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ElevationGraphItem::setUnits(Units units)
|
||||||
|
{
|
||||||
|
setToolTip(toolTip(units));
|
||||||
|
}
|
27
src/GUI/elevationgraphitem.h
Normal file
27
src/GUI/elevationgraphitem.h
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#ifndef ELEVATIONGRAPHITEM_H
|
||||||
|
#define ELEVATIONGRAPHITEM_H
|
||||||
|
|
||||||
|
#include "graphitem.h"
|
||||||
|
|
||||||
|
class ElevationGraphItem : public GraphItem
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
ElevationGraphItem(const Graph &graph, GraphType type,
|
||||||
|
QGraphicsItem *parent = 0);
|
||||||
|
|
||||||
|
qreal ascent() const {return _ascent;}
|
||||||
|
qreal descent() const {return _descent;}
|
||||||
|
qreal min() const {return -bounds().bottom();}
|
||||||
|
qreal max() const {return -bounds().top();}
|
||||||
|
|
||||||
|
void setUnits(Units units);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString toolTip(Units units) const;
|
||||||
|
|
||||||
|
qreal _ascent, _descent;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ELEVATIONGRAPHITEM_H
|
@ -26,15 +26,28 @@ ExportDialog::ExportDialog(Export *exp, QWidget *parent)
|
|||||||
_fileSelect->setFile(_export->fileName);
|
_fileSelect->setFile(_export->fileName);
|
||||||
|
|
||||||
_paperSize = new QComboBox();
|
_paperSize = new QComboBox();
|
||||||
|
_paperSize->addItem("A2", QPrinter::A2);
|
||||||
_paperSize->addItem("A3", QPrinter::A3);
|
_paperSize->addItem("A3", QPrinter::A3);
|
||||||
_paperSize->addItem("A4", QPrinter::A4);
|
_paperSize->addItem("A4", QPrinter::A4);
|
||||||
_paperSize->addItem("A5", QPrinter::A5);
|
_paperSize->addItem("A5", QPrinter::A5);
|
||||||
|
_paperSize->addItem("A6", QPrinter::A6);
|
||||||
|
_paperSize->addItem("B3", QPrinter::B3);
|
||||||
|
_paperSize->addItem("B4", QPrinter::B4);
|
||||||
|
_paperSize->addItem("B5", QPrinter::B5);
|
||||||
|
_paperSize->addItem("B6", QPrinter::B6);
|
||||||
_paperSize->addItem("Tabloid", QPrinter::Tabloid);
|
_paperSize->addItem("Tabloid", QPrinter::Tabloid);
|
||||||
_paperSize->addItem("Legal", QPrinter::Legal);
|
_paperSize->addItem("Legal", QPrinter::Legal);
|
||||||
_paperSize->addItem("Letter", QPrinter::Letter);
|
_paperSize->addItem("Letter", QPrinter::Letter);
|
||||||
if ((index = _paperSize->findData(_export->paperSize)) >= 0)
|
if ((index = _paperSize->findData(_export->paperSize)) >= 0)
|
||||||
_paperSize->setCurrentIndex(index);
|
_paperSize->setCurrentIndex(index);
|
||||||
|
|
||||||
|
_resolution = new QComboBox();
|
||||||
|
_resolution->addItem("300 DPI", 300);
|
||||||
|
_resolution->addItem("600 DPI", 600);
|
||||||
|
_resolution->addItem("1200 DPI", 1200);
|
||||||
|
if ((index = _resolution->findData(_export->resolution)) >= 0)
|
||||||
|
_resolution->setCurrentIndex(index);
|
||||||
|
|
||||||
_portrait = new QRadioButton(tr("Portrait"));
|
_portrait = new QRadioButton(tr("Portrait"));
|
||||||
_landscape = new QRadioButton(tr("Landscape"));
|
_landscape = new QRadioButton(tr("Landscape"));
|
||||||
QHBoxLayout *orientationLayout = new QHBoxLayout();
|
QHBoxLayout *orientationLayout = new QHBoxLayout();
|
||||||
@ -81,6 +94,7 @@ ExportDialog::ExportDialog(Export *exp, QWidget *parent)
|
|||||||
#endif // Q_OS_MAC
|
#endif // Q_OS_MAC
|
||||||
QFormLayout *pageSetupLayout = new QFormLayout;
|
QFormLayout *pageSetupLayout = new QFormLayout;
|
||||||
pageSetupLayout->addRow(tr("Page size:"), _paperSize);
|
pageSetupLayout->addRow(tr("Page size:"), _paperSize);
|
||||||
|
pageSetupLayout->addRow(tr("Resolution:"), _resolution);
|
||||||
pageSetupLayout->addRow(tr("Orientation:"), orientationLayout);
|
pageSetupLayout->addRow(tr("Orientation:"), orientationLayout);
|
||||||
pageSetupLayout->addRow(tr("Margins:"), marginsLayout);
|
pageSetupLayout->addRow(tr("Margins:"), marginsLayout);
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
@ -161,9 +175,11 @@ void ExportDialog::accept()
|
|||||||
? QPrinter::Portrait : QPrinter::Landscape;
|
? QPrinter::Portrait : QPrinter::Landscape;
|
||||||
QPrinter::PaperSize paperSize = static_cast<QPrinter::PaperSize>
|
QPrinter::PaperSize paperSize = static_cast<QPrinter::PaperSize>
|
||||||
(_paperSize->itemData(_paperSize->currentIndex()).toInt());
|
(_paperSize->itemData(_paperSize->currentIndex()).toInt());
|
||||||
|
int resolution = _resolution->itemData(_resolution->currentIndex()).toInt();
|
||||||
|
|
||||||
_export->fileName = _fileSelect->file();
|
_export->fileName = _fileSelect->file();
|
||||||
_export->paperSize = paperSize;
|
_export->paperSize = paperSize;
|
||||||
|
_export->resolution = resolution;
|
||||||
_export->orientation = orientation;
|
_export->orientation = orientation;
|
||||||
if (_export->units == Imperial)
|
if (_export->units == Imperial)
|
||||||
_export->margins = MarginsF(_leftMargin->value() / MM2IN,
|
_export->margins = MarginsF(_leftMargin->value() / MM2IN,
|
@ -16,6 +16,7 @@ struct Export {
|
|||||||
QPrinter::PaperSize paperSize;
|
QPrinter::PaperSize paperSize;
|
||||||
QPrinter::Orientation orientation;
|
QPrinter::Orientation orientation;
|
||||||
MarginsF margins;
|
MarginsF margins;
|
||||||
|
int resolution;
|
||||||
|
|
||||||
Units units;
|
Units units;
|
||||||
};
|
};
|
||||||
@ -37,6 +38,7 @@ private:
|
|||||||
|
|
||||||
FileSelectWidget *_fileSelect;
|
FileSelectWidget *_fileSelect;
|
||||||
QComboBox *_paperSize;
|
QComboBox *_paperSize;
|
||||||
|
QComboBox *_resolution;
|
||||||
QRadioButton *_portrait;
|
QRadioButton *_portrait;
|
||||||
QRadioButton *_landscape;
|
QRadioButton *_landscape;
|
||||||
QDoubleSpinBox *_topMargin;
|
QDoubleSpinBox *_topMargin;
|
@ -1,8 +1,8 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include "coordinates.h"
|
#include "common/coordinates.h"
|
||||||
#include "format.h"
|
#include "format.h"
|
||||||
|
|
||||||
QString Format::timeSpan(qreal time)
|
QString Format::timeSpan(qreal time, bool full)
|
||||||
{
|
{
|
||||||
unsigned h, m, s;
|
unsigned h, m, s;
|
||||||
|
|
||||||
@ -10,8 +10,12 @@ QString Format::timeSpan(qreal time)
|
|||||||
m = (time - (h * 3600)) / 60;
|
m = (time - (h * 3600)) / 60;
|
||||||
s = time - (h * 3600) - (m * 60);
|
s = time - (h * 3600) - (m * 60);
|
||||||
|
|
||||||
return QString("%1:%2:%3").arg(h).arg(m, 2, 10, QChar('0'))
|
if (full || h)
|
||||||
.arg(s, 2, 10, QChar('0'));
|
return QString("%1:%2:%3").arg(h, 2, 10, QChar('0'))
|
||||||
|
.arg(m, 2, 10, QChar('0')).arg(s, 2, 10, QChar('0'));
|
||||||
|
else
|
||||||
|
return QString("%1:%2").arg(m, 2, 10, QChar('0'))
|
||||||
|
.arg(s, 2, 10, QChar('0'));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Format::distance(qreal value, Units units)
|
QString Format::distance(qreal value, Units units)
|
@ -8,7 +8,7 @@ class Coordinates;
|
|||||||
|
|
||||||
namespace Format
|
namespace Format
|
||||||
{
|
{
|
||||||
QString timeSpan(qreal time);
|
QString timeSpan(qreal time, bool full = true);
|
||||||
QString distance(qreal value, Units units);
|
QString distance(qreal value, Units units);
|
||||||
QString elevation(qreal value, Units units);
|
QString elevation(qreal value, Units units);
|
||||||
QString coordinates(const Coordinates &value);
|
QString coordinates(const Coordinates &value);
|
@ -2,7 +2,7 @@
|
|||||||
#include "graphitem.h"
|
#include "graphitem.h"
|
||||||
|
|
||||||
|
|
||||||
GraphItem::GraphItem(const Graph &graph, QGraphicsItem *parent)
|
GraphItem::GraphItem(const Graph &graph, GraphType type, QGraphicsItem *parent)
|
||||||
: QGraphicsObject(parent)
|
: QGraphicsObject(parent)
|
||||||
{
|
{
|
||||||
_id = 0;
|
_id = 0;
|
||||||
@ -10,14 +10,32 @@ GraphItem::GraphItem(const Graph &graph, QGraphicsItem *parent)
|
|||||||
|
|
||||||
_pen = QPen(Qt::black, _width);
|
_pen = QPen(Qt::black, _width);
|
||||||
|
|
||||||
_type = Distance;
|
_type = type;
|
||||||
_graph = graph;
|
_graph = graph;
|
||||||
_sx = 1.0; _sy = 1.0;
|
_sx = 1.0; _sy = 1.0;
|
||||||
|
|
||||||
|
_time = true;
|
||||||
|
for (int i = 0; i < _graph.size(); i++) {
|
||||||
|
if (std::isnan(_graph.at(i).t())) {
|
||||||
|
_time = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setZValue(1.0);
|
setZValue(1.0);
|
||||||
|
|
||||||
updatePath();
|
updatePath();
|
||||||
|
updateShape();
|
||||||
updateBounds();
|
updateBounds();
|
||||||
|
|
||||||
|
setAcceptHoverEvents(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphItem::updateShape()
|
||||||
|
{
|
||||||
|
QPainterPathStroker s;
|
||||||
|
s.setWidth(_width + 1);
|
||||||
|
_shape = s.createStroke(_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
void GraphItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
@ -38,25 +56,37 @@ void GraphItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|||||||
|
|
||||||
void GraphItem::setGraphType(GraphType type)
|
void GraphItem::setGraphType(GraphType type)
|
||||||
{
|
{
|
||||||
|
if (type == _type)
|
||||||
|
return;
|
||||||
|
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
|
|
||||||
_type = type;
|
_type = type;
|
||||||
updatePath();
|
updatePath();
|
||||||
|
updateShape();
|
||||||
updateBounds();
|
updateBounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphItem::setColor(const QColor &color)
|
void GraphItem::setColor(const QColor &color)
|
||||||
{
|
{
|
||||||
|
if (_pen.color() == color)
|
||||||
|
return;
|
||||||
|
|
||||||
_pen.setColor(color);
|
_pen.setColor(color);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphItem::setWidth(int width)
|
void GraphItem::setWidth(int width)
|
||||||
{
|
{
|
||||||
|
if (width == _width)
|
||||||
|
return;
|
||||||
|
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
|
|
||||||
_width = width;
|
_width = width;
|
||||||
_pen.setWidth(width);
|
_pen.setWidth(width);
|
||||||
|
|
||||||
|
updateShape();
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal GraphItem::yAtX(qreal x)
|
qreal GraphItem::yAtX(qreal x)
|
||||||
@ -124,7 +154,7 @@ qreal GraphItem::distanceAtTime(qreal time)
|
|||||||
void GraphItem::emitSliderPositionChanged(qreal pos)
|
void GraphItem::emitSliderPositionChanged(qreal pos)
|
||||||
{
|
{
|
||||||
if (_type == Time) {
|
if (_type == Time) {
|
||||||
if (_graph.hasTime()) {
|
if (_time) {
|
||||||
if (pos >= _graph.first().t() && pos <= _graph.last().t())
|
if (pos >= _graph.first().t() && pos <= _graph.last().t())
|
||||||
emit sliderPositionChanged(distanceAtTime(pos));
|
emit sliderPositionChanged(distanceAtTime(pos));
|
||||||
else
|
else
|
||||||
@ -135,9 +165,9 @@ void GraphItem::emitSliderPositionChanged(qreal pos)
|
|||||||
emit sliderPositionChanged(pos);
|
emit sliderPositionChanged(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphItem::selected(bool selected)
|
void GraphItem::hover(bool hover)
|
||||||
{
|
{
|
||||||
if (selected) {
|
if (hover) {
|
||||||
_pen.setWidth(_width + 1);
|
_pen.setWidth(_width + 1);
|
||||||
setZValue(zValue() + 1.0);
|
setZValue(zValue() + 1.0);
|
||||||
} else {
|
} else {
|
||||||
@ -157,13 +187,14 @@ void GraphItem::setScale(qreal sx, qreal sy)
|
|||||||
|
|
||||||
_sx = sx; _sy = sy;
|
_sx = sx; _sy = sy;
|
||||||
updatePath();
|
updatePath();
|
||||||
|
updateShape();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphItem::updatePath()
|
void GraphItem::updatePath()
|
||||||
{
|
{
|
||||||
_path = QPainterPath();
|
_path = QPainterPath();
|
||||||
|
|
||||||
if (_type == Time && !_graph.hasTime())
|
if (_type == Time && !_time)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_path.moveTo(_graph.first().x(_type) * _sx, -_graph.first().y() * _sy);
|
_path.moveTo(_graph.first().x(_type) * _sx, -_graph.first().y() * _sy);
|
||||||
@ -173,7 +204,7 @@ void GraphItem::updatePath()
|
|||||||
|
|
||||||
void GraphItem::updateBounds()
|
void GraphItem::updateBounds()
|
||||||
{
|
{
|
||||||
if (_type == Time && !_graph.hasTime()) {
|
if (_type == Time && !_time) {
|
||||||
_bounds = QRectF();
|
_bounds = QRectF();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -191,3 +222,25 @@ void GraphItem::updateBounds()
|
|||||||
|
|
||||||
_bounds = QRectF(QPointF(left, top), QPointF(right, bottom));
|
_bounds = QRectF(QPointF(left, top), QPointF(right, bottom));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GraphItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||||
|
{
|
||||||
|
Q_UNUSED(event);
|
||||||
|
|
||||||
|
_pen.setWidthF(_width + 1);
|
||||||
|
setZValue(zValue() + 1.0);
|
||||||
|
update();
|
||||||
|
|
||||||
|
emit selected(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||||
|
{
|
||||||
|
Q_UNUSED(event);
|
||||||
|
|
||||||
|
_pen.setWidthF(_width);
|
||||||
|
setZValue(zValue() - 1.0);
|
||||||
|
update();
|
||||||
|
|
||||||
|
emit selected(false);
|
||||||
|
}
|
@ -3,41 +3,50 @@
|
|||||||
|
|
||||||
#include <QGraphicsObject>
|
#include <QGraphicsObject>
|
||||||
#include <QPen>
|
#include <QPen>
|
||||||
#include "graph.h"
|
#include "data/graph.h"
|
||||||
|
#include "units.h"
|
||||||
|
|
||||||
class GraphItem : public QGraphicsObject
|
class GraphItem : public QGraphicsObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GraphItem(const Graph &graph, QGraphicsItem *parent = 0);
|
GraphItem(const Graph &graph, GraphType type, QGraphicsItem *parent = 0);
|
||||||
|
|
||||||
QRectF boundingRect() const
|
QPainterPath shape() const {return _shape;}
|
||||||
{return _path.boundingRect();}
|
QRectF boundingRect() const {return _shape.boundingRect();}
|
||||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget);
|
QWidget *widget);
|
||||||
|
|
||||||
const QRectF &bounds() const {return _bounds;}
|
const QRectF &bounds() const {return _bounds;}
|
||||||
void setScale(qreal sx, qreal sy);
|
|
||||||
|
|
||||||
|
void setScale(qreal sx, qreal sy);
|
||||||
void setGraphType(GraphType type);
|
void setGraphType(GraphType type);
|
||||||
int id() const {return _id;}
|
int id() const {return _id;}
|
||||||
void setId(int id) {_id = id;}
|
void setId(int id) {_id = id;}
|
||||||
void setColor(const QColor &color);
|
void setColor(const QColor &color);
|
||||||
void setWidth(int width);
|
void setWidth(int width);
|
||||||
|
virtual void setUnits(Units units) {Q_UNUSED(units);}
|
||||||
|
|
||||||
qreal yAtX(qreal x);
|
qreal yAtX(qreal x);
|
||||||
qreal distanceAtTime(qreal time);
|
qreal distanceAtTime(qreal time);
|
||||||
|
|
||||||
|
void redraw();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void sliderPositionChanged(qreal);
|
void sliderPositionChanged(qreal);
|
||||||
|
void selected(bool);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void emitSliderPositionChanged(qreal);
|
void emitSliderPositionChanged(qreal);
|
||||||
void selected(bool selected);
|
void hover(bool hover);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
||||||
|
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
||||||
|
|
||||||
void updatePath();
|
void updatePath();
|
||||||
|
void updateShape();
|
||||||
void updateBounds();
|
void updateBounds();
|
||||||
|
|
||||||
int _id;
|
int _id;
|
||||||
@ -48,8 +57,11 @@ private:
|
|||||||
GraphType _type;
|
GraphType _type;
|
||||||
|
|
||||||
QPainterPath _path;
|
QPainterPath _path;
|
||||||
|
QPainterPath _shape;
|
||||||
QRectF _bounds;
|
QRectF _bounds;
|
||||||
qreal _sx, _sy;
|
qreal _sx, _sy;
|
||||||
|
|
||||||
|
bool _time;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // GRAPHITEM_H
|
#endif // GRAPHITEM_H
|
@ -19,8 +19,9 @@ public:
|
|||||||
|
|
||||||
virtual QString label() const = 0;
|
virtual QString label() const = 0;
|
||||||
virtual void loadData(const Data &data, const QList<PathItem *> &paths) = 0;
|
virtual void loadData(const Data &data, const QList<PathItem *> &paths) = 0;
|
||||||
virtual void clear() {}
|
virtual void clear() {GraphView::clear();}
|
||||||
virtual void setUnits(enum Units units) {Q_UNUSED(units)}
|
virtual void setUnits(enum Units units) {GraphView::setUnits(units);}
|
||||||
|
virtual void setGraphType(GraphType type) {GraphView::setGraphType(type);}
|
||||||
virtual void setTimeType(enum TimeType type) {Q_UNUSED(type)}
|
virtual void setTimeType(enum TimeType type) {Q_UNUSED(type)}
|
||||||
virtual void showTracks(bool show) {Q_UNUSED(show)}
|
virtual void showTracks(bool show) {Q_UNUSED(show)}
|
||||||
virtual void showRoutes(bool show) {Q_UNUSED(show)}
|
virtual void showRoutes(bool show) {Q_UNUSED(show)}
|
@ -3,6 +3,7 @@
|
|||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QPaintEngine>
|
#include <QPaintEngine>
|
||||||
#include <QPaintDevice>
|
#include <QPaintDevice>
|
||||||
|
#include "data/graph.h"
|
||||||
#include "opengl.h"
|
#include "opengl.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "axisitem.h"
|
#include "axisitem.h"
|
||||||
@ -10,9 +11,9 @@
|
|||||||
#include "sliderinfoitem.h"
|
#include "sliderinfoitem.h"
|
||||||
#include "infoitem.h"
|
#include "infoitem.h"
|
||||||
#include "griditem.h"
|
#include "griditem.h"
|
||||||
#include "graph.h"
|
|
||||||
#include "graphitem.h"
|
#include "graphitem.h"
|
||||||
#include "pathitem.h"
|
#include "pathitem.h"
|
||||||
|
#include "format.h"
|
||||||
#include "graphview.h"
|
#include "graphview.h"
|
||||||
|
|
||||||
|
|
||||||
@ -139,7 +140,13 @@ void GraphView::setXUnits()
|
|||||||
void GraphView::setUnits(Units units)
|
void GraphView::setUnits(Units units)
|
||||||
{
|
{
|
||||||
_units = units;
|
_units = units;
|
||||||
|
|
||||||
|
for (int i = 0; i < _graphs.count(); i++)
|
||||||
|
_graphs.at(i)->setUnits(units);
|
||||||
|
|
||||||
setXUnits();
|
setXUnits();
|
||||||
|
|
||||||
|
redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphView::setGraphType(GraphType type)
|
void GraphView::setGraphType(GraphType type)
|
||||||
@ -167,29 +174,34 @@ void GraphView::showGrid(bool show)
|
|||||||
_grid->setVisible(show);
|
_grid->setVisible(show);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphView::loadGraph(const Graph &graph, PathItem *path, int id)
|
void GraphView::showSliderInfo(bool show)
|
||||||
{
|
{
|
||||||
if (graph.size() < 2)
|
_sliderInfo->setVisible(show);
|
||||||
return;
|
}
|
||||||
|
|
||||||
GraphItem *gi = new GraphItem(graph);
|
void GraphView::addGraph(GraphItem *graph, PathItem *path, int id)
|
||||||
gi->setGraphType(_graphType);
|
{
|
||||||
gi->setId(id);
|
QColor color(_palette.nextColor());
|
||||||
gi->setColor(_palette.nextColor());
|
color.setAlpha(255);
|
||||||
gi->setWidth(_width);
|
|
||||||
|
|
||||||
connect(this, SIGNAL(sliderPositionChanged(qreal)), gi,
|
graph->setUnits(_units);
|
||||||
|
graph->setId(id);
|
||||||
|
graph->setColor(color);
|
||||||
|
graph->setWidth(_width);
|
||||||
|
|
||||||
|
connect(this, SIGNAL(sliderPositionChanged(qreal)), graph,
|
||||||
SLOT(emitSliderPositionChanged(qreal)));
|
SLOT(emitSliderPositionChanged(qreal)));
|
||||||
connect(gi, SIGNAL(sliderPositionChanged(qreal)), path,
|
connect(graph, SIGNAL(sliderPositionChanged(qreal)), path,
|
||||||
SLOT(moveMarker(qreal)));
|
SLOT(moveMarker(qreal)));
|
||||||
connect(path, SIGNAL(selected(bool)), gi, SLOT(selected(bool)));
|
connect(path, SIGNAL(selected(bool)), graph, SLOT(hover(bool)));
|
||||||
|
connect(graph, SIGNAL(selected(bool)), path, SLOT(hover(bool)));
|
||||||
|
|
||||||
_graphs.append(gi);
|
_graphs.append(graph);
|
||||||
|
|
||||||
if (!_hide.contains(id)) {
|
if (!_hide.contains(id)) {
|
||||||
_visible.append(gi);
|
_visible.append(graph);
|
||||||
_scene->addItem(gi);
|
_scene->addItem(graph);
|
||||||
_bounds |= gi->bounds();
|
_bounds |= graph->bounds();
|
||||||
setXUnits();
|
setXUnits();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -227,11 +239,6 @@ void GraphView::showGraph(bool show, int id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphView::redraw()
|
|
||||||
{
|
|
||||||
redraw(viewport()->size() - QSizeF(MARGIN, MARGIN));
|
|
||||||
}
|
|
||||||
|
|
||||||
QRectF GraphView::bounds() const
|
QRectF GraphView::bounds() const
|
||||||
{
|
{
|
||||||
QRectF br(_bounds);
|
QRectF br(_bounds);
|
||||||
@ -239,6 +246,11 @@ QRectF GraphView::bounds() const
|
|||||||
return br;
|
return br;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GraphView::redraw()
|
||||||
|
{
|
||||||
|
redraw(viewport()->size() - QSizeF(MARGIN, MARGIN));
|
||||||
|
}
|
||||||
|
|
||||||
void GraphView::redraw(const QSizeF &size)
|
void GraphView::redraw(const QSizeF &size)
|
||||||
{
|
{
|
||||||
QRectF r;
|
QRectF r;
|
||||||
@ -326,11 +338,9 @@ void GraphView::mousePressEvent(QMouseEvent *e)
|
|||||||
QGraphicsView::mousePressEvent(e);
|
QGraphicsView::mousePressEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphView::plot(QPainter *painter, const QRectF &target)
|
void GraphView::plot(QPainter *painter, const QRectF &target, qreal scale)
|
||||||
{
|
{
|
||||||
qreal ratio = painter->paintEngine()->paintDevice()->logicalDpiX()
|
QSizeF canvas = QSizeF(target.width() / scale, target.height() / scale);
|
||||||
/ SCREEN_DPI;
|
|
||||||
QSizeF canvas = QSizeF(target.width() / ratio, target.height() / ratio);
|
|
||||||
|
|
||||||
setUpdatesEnabled(false);
|
setUpdatesEnabled(false);
|
||||||
redraw(canvas);
|
redraw(canvas);
|
||||||
@ -374,22 +384,26 @@ void GraphView::updateSliderPosition()
|
|||||||
_slider->setVisible(false);
|
_slider->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateSliderInfo();
|
if (_slider->isVisible())
|
||||||
|
updateSliderInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphView::updateSliderInfo()
|
void GraphView::updateSliderInfo()
|
||||||
{
|
{
|
||||||
_sliderInfo->setVisible(_visible.count() == 1);
|
qreal r, y;
|
||||||
if (!_sliderInfo->isVisible())
|
|
||||||
return;
|
|
||||||
|
|
||||||
QRectF br(_visible.first()->bounds());
|
if (_visible.count() > 1) {
|
||||||
if (br.height() < _minYRange)
|
r = 0;
|
||||||
br.adjust(0, -(_minYRange/2 - br.height()/2), 0,
|
y = 0;
|
||||||
_minYRange/2 - br.height()/2);
|
} else {
|
||||||
|
QRectF br(_visible.first()->bounds());
|
||||||
|
if (br.height() < _minYRange)
|
||||||
|
br.adjust(0, -(_minYRange/2 - br.height()/2), 0,
|
||||||
|
_minYRange/2 - br.height()/2);
|
||||||
|
|
||||||
qreal y = _visible.first()->yAtX(_sliderPos);
|
y = _visible.first()->yAtX(_sliderPos);
|
||||||
qreal r = (y - br.bottom()) / br.height();
|
r = (y - br.bottom()) / br.height();
|
||||||
|
}
|
||||||
|
|
||||||
qreal pos = (_sliderPos / bounds().width()) * _slider->area().width();
|
qreal pos = (_sliderPos / bounds().width()) * _slider->area().width();
|
||||||
SliderInfoItem::Side s = (pos + _sliderInfo->boundingRect().width()
|
SliderInfoItem::Side s = (pos + _sliderInfo->boundingRect().width()
|
||||||
@ -397,8 +411,11 @@ void GraphView::updateSliderInfo()
|
|||||||
|
|
||||||
_sliderInfo->setSide(s);
|
_sliderInfo->setSide(s);
|
||||||
_sliderInfo->setPos(QPointF(0, _slider->boundingRect().height() * r));
|
_sliderInfo->setPos(QPointF(0, _slider->boundingRect().height() * r));
|
||||||
_sliderInfo->setText(QString::number(-y * _yScale + _yOffset, 'f',
|
_sliderInfo->setText(_graphType == Time ? Format::timeSpan(_sliderPos,
|
||||||
_precision));
|
bounds().width() > 3600) : QString::number(_sliderPos * _xScale, 'f', 1)
|
||||||
|
+ UNIT_SPACE + _xUnits, (_visible.count() > 1) ? QString()
|
||||||
|
: QString::number(-y * _yScale + _yOffset, 'f', _precision) + UNIT_SPACE
|
||||||
|
+ _yUnits);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphView::emitSliderPositionChanged(const QPointF &pos)
|
void GraphView::emitSliderPositionChanged(const QPointF &pos)
|
||||||
@ -444,8 +461,11 @@ void GraphView::setPalette(const Palette &palette)
|
|||||||
_palette = palette;
|
_palette = palette;
|
||||||
_palette.reset();
|
_palette.reset();
|
||||||
|
|
||||||
for (int i = 0; i < _graphs.count(); i++)
|
for (int i = 0; i < _graphs.count(); i++) {
|
||||||
_graphs.at(i)->setColor(_palette.nextColor());
|
QColor color(_palette.nextColor());
|
||||||
|
color.setAlpha(255);
|
||||||
|
_graphs.at(i)->setColor(color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphView::setGraphWidth(int width)
|
void GraphView::setGraphWidth(int width)
|
||||||
@ -454,6 +474,8 @@ void GraphView::setGraphWidth(int width)
|
|||||||
|
|
||||||
for (int i = 0; i < _graphs.count(); i++)
|
for (int i = 0; i < _graphs.count(); i++)
|
||||||
_graphs.at(i)->setWidth(width);
|
_graphs.at(i)->setWidth(width);
|
||||||
|
|
||||||
|
redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphView::useOpenGL(bool use)
|
void GraphView::useOpenGL(bool use)
|
||||||
@ -463,3 +485,14 @@ void GraphView::useOpenGL(bool use)
|
|||||||
else
|
else
|
||||||
setViewport(new QWidget);
|
setViewport(new QWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GraphView::useAntiAliasing(bool use)
|
||||||
|
{
|
||||||
|
setRenderHint(QPainter::Antialiasing, use);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphView::setSliderColor(const QColor &color)
|
||||||
|
{
|
||||||
|
_slider->setColor(color);
|
||||||
|
_sliderInfo->setColor(color);
|
||||||
|
}
|
@ -4,9 +4,9 @@
|
|||||||
#include <QGraphicsView>
|
#include <QGraphicsView>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
|
#include "data/graph.h"
|
||||||
#include "palette.h"
|
#include "palette.h"
|
||||||
#include "units.h"
|
#include "units.h"
|
||||||
#include "graph.h"
|
|
||||||
|
|
||||||
|
|
||||||
class AxisItem;
|
class AxisItem;
|
||||||
@ -25,18 +25,30 @@ public:
|
|||||||
GraphView(QWidget *parent = 0);
|
GraphView(QWidget *parent = 0);
|
||||||
~GraphView();
|
~GraphView();
|
||||||
|
|
||||||
void loadGraph(const Graph &graph, PathItem *path, int id = 0);
|
bool isEmpty() const {return _graphs.isEmpty();}
|
||||||
int count() const {return _graphs.count();}
|
|
||||||
void redraw();
|
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
|
void plot(QPainter *painter, const QRectF &target, qreal scale);
|
||||||
|
|
||||||
|
void setPalette(const Palette &palette);
|
||||||
|
void setGraphWidth(int width);
|
||||||
|
void showGrid(bool show);
|
||||||
|
void showSliderInfo(bool show);
|
||||||
|
void useOpenGL(bool use);
|
||||||
|
void useAntiAliasing(bool use);
|
||||||
|
|
||||||
|
void setSliderPosition(qreal pos);
|
||||||
|
void setSliderColor(const QColor &color);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void sliderPositionChanged(qreal);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void addGraph(GraphItem *graph, PathItem *path, int id = 0);
|
||||||
|
|
||||||
void showGraph(bool show, int id = 0);
|
void showGraph(bool show, int id = 0);
|
||||||
void setGraphType(GraphType type);
|
void setGraphType(GraphType type);
|
||||||
void setUnits(Units units);
|
void setUnits(Units units);
|
||||||
void showGrid(bool show);
|
|
||||||
|
|
||||||
void setPalette(const Palette &palette);
|
|
||||||
void setGraphWidth(int width);
|
|
||||||
|
|
||||||
const QString &yLabel() const {return _yLabel;}
|
const QString &yLabel() const {return _yLabel;}
|
||||||
const QString &yUnits() const {return _yUnits;}
|
const QString &yUnits() const {return _yUnits;}
|
||||||
@ -50,23 +62,16 @@ public:
|
|||||||
void setSliderPrecision(int precision) {_precision = precision;}
|
void setSliderPrecision(int precision) {_precision = precision;}
|
||||||
void setMinYRange(qreal range) {_minYRange = range;}
|
void setMinYRange(qreal range) {_minYRange = range;}
|
||||||
|
|
||||||
qreal sliderPosition() const {return _sliderPos;}
|
|
||||||
void setSliderPosition(qreal pos);
|
|
||||||
|
|
||||||
void plot(QPainter *painter, const QRectF &target);
|
|
||||||
|
|
||||||
void useOpenGL(bool use);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void sliderPositionChanged(qreal);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
QRectF bounds() const;
|
QRectF bounds() const;
|
||||||
|
void redraw();
|
||||||
void redraw(const QSizeF &size);
|
void redraw(const QSizeF &size);
|
||||||
void addInfo(const QString &key, const QString &value);
|
void addInfo(const QString &key, const QString &value);
|
||||||
void clearInfo();
|
void clearInfo();
|
||||||
void skipColor() {_palette.nextColor();}
|
void skipColor() {_palette.nextColor();}
|
||||||
|
|
||||||
|
QList<GraphItem*> _graphs;
|
||||||
|
GraphType _graphType;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void emitSliderPositionChanged(const QPointF &pos);
|
void emitSliderPositionChanged(const QPointF &pos);
|
||||||
void newSliderPosition(const QPointF &pos);
|
void newSliderPosition(const QPointF &pos);
|
||||||
@ -83,6 +88,7 @@ private:
|
|||||||
void resizeEvent(QResizeEvent *);
|
void resizeEvent(QResizeEvent *);
|
||||||
void mousePressEvent(QMouseEvent *);
|
void mousePressEvent(QMouseEvent *);
|
||||||
|
|
||||||
|
Units _units;
|
||||||
qreal _xScale, _yScale;
|
qreal _xScale, _yScale;
|
||||||
qreal _yOffset;
|
qreal _yOffset;
|
||||||
QString _xUnits, _yUnits;
|
QString _xUnits, _yUnits;
|
||||||
@ -99,15 +105,11 @@ private:
|
|||||||
InfoItem *_info;
|
InfoItem *_info;
|
||||||
GridItem *_grid;
|
GridItem *_grid;
|
||||||
|
|
||||||
QList<GraphItem*> _graphs;
|
|
||||||
QList<GraphItem*> _visible;
|
QList<GraphItem*> _visible;
|
||||||
QSet<int> _hide;
|
QSet<int> _hide;
|
||||||
QRectF _bounds;
|
QRectF _bounds;
|
||||||
Palette _palette;
|
Palette _palette;
|
||||||
int _width;
|
int _width;
|
||||||
|
|
||||||
Units _units;
|
|
||||||
GraphType _graphType;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // GRAPHVIEW_H
|
#endif // GRAPHVIEW_H
|
File diff suppressed because it is too large
Load Diff
@ -6,14 +6,13 @@
|
|||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
#include <QPrinter>
|
#include <QPrinter>
|
||||||
|
#include "data/graph.h"
|
||||||
|
#include "data/poi.h"
|
||||||
#include "units.h"
|
#include "units.h"
|
||||||
#include "timetype.h"
|
#include "timetype.h"
|
||||||
#include "graph.h"
|
|
||||||
#include "poi.h"
|
|
||||||
#include "exportdialog.h"
|
#include "exportdialog.h"
|
||||||
#include "optionsdialog.h"
|
#include "optionsdialog.h"
|
||||||
|
|
||||||
|
|
||||||
class QMenu;
|
class QMenu;
|
||||||
class QToolBar;
|
class QToolBar;
|
||||||
class QTabWidget;
|
class QTabWidget;
|
||||||
@ -24,7 +23,7 @@ class QSignalMapper;
|
|||||||
class QPrinter;
|
class QPrinter;
|
||||||
class FileBrowser;
|
class FileBrowser;
|
||||||
class GraphTab;
|
class GraphTab;
|
||||||
class PathView;
|
class MapView;
|
||||||
class Map;
|
class Map;
|
||||||
class MapList;
|
class MapList;
|
||||||
|
|
||||||
@ -41,7 +40,7 @@ public:
|
|||||||
private slots:
|
private slots:
|
||||||
void about();
|
void about();
|
||||||
void keys();
|
void keys();
|
||||||
void dataSources();
|
void paths();
|
||||||
void printFile();
|
void printFile();
|
||||||
void exportFile();
|
void exportFile();
|
||||||
void openFile();
|
void openFile();
|
||||||
@ -51,12 +50,12 @@ private slots:
|
|||||||
void closePOIFiles();
|
void closePOIFiles();
|
||||||
void showGraphs(bool show);
|
void showGraphs(bool show);
|
||||||
void showGraphGrids(bool show);
|
void showGraphGrids(bool show);
|
||||||
|
void showGraphSliderInfo(bool show);
|
||||||
void showToolbars(bool show);
|
void showToolbars(bool show);
|
||||||
void showFullscreen(bool show);
|
void showFullscreen(bool show);
|
||||||
void showTracks(bool show);
|
void showTracks(bool show);
|
||||||
void showRoutes(bool show);
|
void showRoutes(bool show);
|
||||||
void loadMap();
|
void loadMap();
|
||||||
void clearMapCache();
|
|
||||||
void nextMap();
|
void nextMap();
|
||||||
void prevMap();
|
void prevMap();
|
||||||
void openOptions();
|
void openOptions();
|
||||||
@ -82,7 +81,6 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
typedef QPair<QDate, QDate> DateRange;
|
typedef QPair<QDate, QDate> DateRange;
|
||||||
|
|
||||||
void loadDatums();
|
|
||||||
void loadMaps();
|
void loadMaps();
|
||||||
void loadPOIs();
|
void loadPOIs();
|
||||||
void closeFiles();
|
void closeFiles();
|
||||||
@ -95,18 +93,19 @@ private:
|
|||||||
void createMenus();
|
void createMenus();
|
||||||
void createToolBars();
|
void createToolBars();
|
||||||
void createStatusBar();
|
void createStatusBar();
|
||||||
void createPathView();
|
void createMapView();
|
||||||
void createGraphTabs();
|
void createGraphTabs();
|
||||||
void createBrowser();
|
void createBrowser();
|
||||||
|
|
||||||
bool openPOIFile(const QString &fileName);
|
bool openPOIFile(const QString &fileName);
|
||||||
bool loadFile(const QString &fileName);
|
bool loadFile(const QString &fileName);
|
||||||
|
bool loadMap(const QString &fileName);
|
||||||
void exportFile(const QString &fileName);
|
void exportFile(const QString &fileName);
|
||||||
void updateStatusBarInfo();
|
void updateStatusBarInfo();
|
||||||
void updateWindowTitle();
|
void updateWindowTitle();
|
||||||
void updateNavigationActions();
|
void updateNavigationActions();
|
||||||
void updateGraphTabs();
|
void updateGraphTabs();
|
||||||
void updatePathView();
|
void updateMapView();
|
||||||
|
|
||||||
TimeType timeType() const;
|
TimeType timeType() const;
|
||||||
Units units() const;
|
Units units() const;
|
||||||
@ -121,8 +120,6 @@ private:
|
|||||||
void readSettings();
|
void readSettings();
|
||||||
void writeSettings();
|
void writeSettings();
|
||||||
|
|
||||||
const QString fileFormats() const;
|
|
||||||
|
|
||||||
void keyPressEvent(QKeyEvent *event);
|
void keyPressEvent(QKeyEvent *event);
|
||||||
void closeEvent(QCloseEvent *event);
|
void closeEvent(QCloseEvent *event);
|
||||||
void dragEnterEvent(QDragEnterEvent *event);
|
void dragEnterEvent(QDragEnterEvent *event);
|
||||||
@ -139,7 +136,7 @@ private:
|
|||||||
QActionGroup *_mapsActionGroup;
|
QActionGroup *_mapsActionGroup;
|
||||||
QAction *_exitAction;
|
QAction *_exitAction;
|
||||||
QAction *_keysAction;
|
QAction *_keysAction;
|
||||||
QAction *_dataSourcesAction;
|
QAction *_pathsAction;
|
||||||
QAction *_aboutAction;
|
QAction *_aboutAction;
|
||||||
QAction *_aboutQtAction;
|
QAction *_aboutQtAction;
|
||||||
QAction *_printFileAction;
|
QAction *_printFileAction;
|
||||||
@ -158,6 +155,7 @@ private:
|
|||||||
QAction *_clearMapCacheAction;
|
QAction *_clearMapCacheAction;
|
||||||
QAction *_showGraphsAction;
|
QAction *_showGraphsAction;
|
||||||
QAction *_showGraphGridAction;
|
QAction *_showGraphGridAction;
|
||||||
|
QAction *_showGraphSliderInfoAction;
|
||||||
QAction *_distanceGraphAction;
|
QAction *_distanceGraphAction;
|
||||||
QAction *_timeGraphAction;
|
QAction *_timeGraphAction;
|
||||||
QAction *_showToolbarsAction;
|
QAction *_showToolbarsAction;
|
||||||
@ -188,17 +186,17 @@ private:
|
|||||||
QLabel *_distanceLabel;
|
QLabel *_distanceLabel;
|
||||||
QLabel *_timeLabel;
|
QLabel *_timeLabel;
|
||||||
|
|
||||||
PathView *_pathView;
|
MapView *_mapView;
|
||||||
QTabWidget *_graphTabWidget;
|
QTabWidget *_graphTabWidget;
|
||||||
QList<GraphTab*> _tabs;
|
QList<GraphTab*> _tabs;
|
||||||
|
|
||||||
POI *_poi;
|
POI *_poi;
|
||||||
MapList *_ml;
|
MapList *_ml;
|
||||||
|
Map *_map;
|
||||||
|
|
||||||
FileBrowser *_browser;
|
FileBrowser *_browser;
|
||||||
QList<QString> _files;
|
QList<QString> _files;
|
||||||
|
|
||||||
Map *_map;
|
|
||||||
int _trackCount;
|
int _trackCount;
|
||||||
int _routeCount;
|
int _routeCount;
|
||||||
int _waypointCount;
|
int _waypointCount;
|
@ -1,10 +1,10 @@
|
|||||||
#include "data.h"
|
#include "data/data.h"
|
||||||
|
#include "heartrategraphitem.h"
|
||||||
#include "heartrategraph.h"
|
#include "heartrategraph.h"
|
||||||
|
|
||||||
|
|
||||||
HeartRateGraph::HeartRateGraph(QWidget *parent) : GraphTab(parent)
|
HeartRateGraph::HeartRateGraph(QWidget *parent) : GraphTab(parent)
|
||||||
{
|
{
|
||||||
_units = Metric;
|
|
||||||
_showTracks = true;
|
_showTracks = true;
|
||||||
|
|
||||||
GraphView::setYUnits(tr("1/min"));
|
GraphView::setYUnits(tr("1/min"));
|
||||||
@ -28,21 +28,16 @@ void HeartRateGraph::loadData(const Data &data, const QList<PathItem *> &paths)
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < data.tracks().count(); i++) {
|
for (int i = 0; i < data.tracks().count(); i++) {
|
||||||
const Graph &graph = data.tracks().at(i)->heartRate();
|
const Graph &graph = data.tracks().at(i)->heartRate();
|
||||||
qreal sum = 0, w = 0;
|
|
||||||
|
|
||||||
if (graph.size() < 2) {
|
if (graph.size() < 2) {
|
||||||
skipColor();
|
skipColor();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int j = 1; j < graph.size(); j++) {
|
HeartRateGraphItem *gi = new HeartRateGraphItem(graph, _graphType);
|
||||||
qreal ds = graph.at(j).s() - graph.at(j-1).s();
|
GraphView::addGraph(gi, paths.at(i));
|
||||||
sum += graph.at(j).y() * ds;
|
|
||||||
w += ds;
|
|
||||||
}
|
|
||||||
_avg.append(QPointF(data.tracks().at(i)->distance(), sum/w));
|
|
||||||
|
|
||||||
GraphView::loadGraph(graph, paths.at(i));
|
_avg.append(QPointF(data.tracks().at(i)->distance(), gi->avg()));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < data.routes().count(); i++)
|
for (int i = 0; i < data.routes().count(); i++)
|
@ -22,7 +22,6 @@ private:
|
|||||||
|
|
||||||
QList<QPointF> _avg;
|
QList<QPointF> _avg;
|
||||||
|
|
||||||
enum Units _units;
|
|
||||||
bool _showTracks;
|
bool _showTracks;
|
||||||
};
|
};
|
||||||
|
|
26
src/GUI/heartrategraphitem.cpp
Normal file
26
src/GUI/heartrategraphitem.cpp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#include "tooltip.h"
|
||||||
|
#include "heartrategraphitem.h"
|
||||||
|
|
||||||
|
HeartRateGraphItem::HeartRateGraphItem(const Graph &graph, GraphType type,
|
||||||
|
QGraphicsItem *parent) : GraphItem(graph, type, parent)
|
||||||
|
{
|
||||||
|
qreal sum = 0;
|
||||||
|
|
||||||
|
for (int j = 1; j < graph.size(); j++)
|
||||||
|
sum += graph.at(j).y() * (graph.at(j).s() - graph.at(j-1).s());
|
||||||
|
_avg = sum/graph.last().s();
|
||||||
|
|
||||||
|
setToolTip(toolTip());
|
||||||
|
}
|
||||||
|
|
||||||
|
QString HeartRateGraphItem::toolTip() const
|
||||||
|
{
|
||||||
|
ToolTip tt;
|
||||||
|
|
||||||
|
tt.insert(tr("Maximum"), QString::number(max(), 'f', 0)
|
||||||
|
+ UNIT_SPACE + tr("1/min"));
|
||||||
|
tt.insert(tr("Average"), QString::number(avg(), 'f', 0)
|
||||||
|
+ UNIT_SPACE + tr("1/min"));
|
||||||
|
|
||||||
|
return tt.toString();
|
||||||
|
}
|
23
src/GUI/heartrategraphitem.h
Normal file
23
src/GUI/heartrategraphitem.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#ifndef HEARTRATEGRAPHITEM_H
|
||||||
|
#define HEARTRATEGRAPHITEM_H
|
||||||
|
|
||||||
|
#include "graphitem.h"
|
||||||
|
|
||||||
|
class HeartRateGraphItem : public GraphItem
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
HeartRateGraphItem(const Graph &graph, GraphType type,
|
||||||
|
QGraphicsItem *parent = 0);
|
||||||
|
|
||||||
|
qreal max() const {return -bounds().top();}
|
||||||
|
qreal avg() const {return _avg;}
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString toolTip() const;
|
||||||
|
|
||||||
|
qreal _avg;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // HEARTRATEGRAPHITEM_H
|
@ -10,7 +10,7 @@
|
|||||||
#define CLOSE_FILE_ICON ":/icons/dialog-close.png"
|
#define CLOSE_FILE_ICON ":/icons/dialog-close.png"
|
||||||
#define SHOW_POI_ICON ":/icons/flag.png"
|
#define SHOW_POI_ICON ":/icons/flag.png"
|
||||||
#define SHOW_MAP_ICON ":/icons/applications-internet.png"
|
#define SHOW_MAP_ICON ":/icons/applications-internet.png"
|
||||||
#define SHOW_GRAPHS_ICON ":/icons/office-chart-line-stacked.png"
|
#define SHOW_GRAPHS_ICON ":/icons/office-chart-line.png"
|
||||||
#define QUIT_ICON ":/icons/application-exit.png"
|
#define QUIT_ICON ":/icons/application-exit.png"
|
||||||
#define RELOAD_FILE_ICON ":/icons/view-refresh.png"
|
#define RELOAD_FILE_ICON ":/icons/view-refresh.png"
|
||||||
#define NEXT_FILE_ICON ":/icons/arrow-right.png"
|
#define NEXT_FILE_ICON ":/icons/arrow-right.png"
|
||||||
@ -24,5 +24,6 @@
|
|||||||
#define POI_ICON ":/icons/flag_48.png"
|
#define POI_ICON ":/icons/flag_48.png"
|
||||||
#define SYSTEM_ICON ":/icons/system-run.png"
|
#define SYSTEM_ICON ":/icons/system-run.png"
|
||||||
#define PRINT_EXPORT_ICON ":/icons/document-print-preview.png"
|
#define PRINT_EXPORT_ICON ":/icons/document-print-preview.png"
|
||||||
|
#define DATA_ICON ":/icons/view-filter.png"
|
||||||
|
|
||||||
#endif /* ICONS_H */
|
#endif /* ICONS_H */
|
@ -13,6 +13,9 @@
|
|||||||
#define ZOOM_IN QKeySequence::ZoomIn
|
#define ZOOM_IN QKeySequence::ZoomIn
|
||||||
#define ZOOM_OUT QKeySequence::ZoomOut
|
#define ZOOM_OUT QKeySequence::ZoomOut
|
||||||
|
|
||||||
|
#define TOGGLE_GRAPH_TYPE_KEY Qt::Key_X
|
||||||
|
#define TOGGLE_TIME_TYPE_KEY Qt::Key_T
|
||||||
|
|
||||||
#define QUIT_SHORTCUT QKeySequence(QKeySequence::Quit)
|
#define QUIT_SHORTCUT QKeySequence(QKeySequence::Quit)
|
||||||
#define OPEN_SHORTCUT QKeySequence(QKeySequence::Open)
|
#define OPEN_SHORTCUT QKeySequence(QKeySequence::Open)
|
||||||
#define CLOSE_SHORTCUT QKeySequence(QKeySequence::Close)
|
#define CLOSE_SHORTCUT QKeySequence(QKeySequence::Close)
|
||||||
@ -23,8 +26,6 @@
|
|||||||
#define NEXT_MAP_SHORTCUT QKeySequence(QKeySequence::Forward)
|
#define NEXT_MAP_SHORTCUT QKeySequence(QKeySequence::Forward)
|
||||||
#define PREV_MAP_SHORTCUT QKeySequence(QKeySequence::Back)
|
#define PREV_MAP_SHORTCUT QKeySequence(QKeySequence::Back)
|
||||||
#define SHOW_GRAPHS_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_G)
|
#define SHOW_GRAPHS_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_G)
|
||||||
#define DISTANCE_GRAPH_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_D)
|
|
||||||
#define TIME_GRAPH_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_T)
|
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
#define FULLSCREEN_SHORTCUT QKeySequence(Qt::META + Qt::CTRL + Qt::Key_F)
|
#define FULLSCREEN_SHORTCUT QKeySequence(Qt::META + Qt::CTRL + Qt::Key_F)
|
815
src/GUI/mapview.cpp
Normal file
815
src/GUI/mapview.cpp
Normal file
@ -0,0 +1,815 @@
|
|||||||
|
#include <QGraphicsView>
|
||||||
|
#include <QGraphicsScene>
|
||||||
|
#include <QWheelEvent>
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QPixmapCache>
|
||||||
|
#include <QScrollBar>
|
||||||
|
#include "data/poi.h"
|
||||||
|
#include "data/data.h"
|
||||||
|
#include "map/map.h"
|
||||||
|
#include "opengl.h"
|
||||||
|
#include "trackitem.h"
|
||||||
|
#include "routeitem.h"
|
||||||
|
#include "waypointitem.h"
|
||||||
|
#include "scaleitem.h"
|
||||||
|
#include "keys.h"
|
||||||
|
#include "mapview.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define MAX_DIGITAL_ZOOM 2
|
||||||
|
#define MIN_DIGITAL_ZOOM -3
|
||||||
|
#define MARGIN 10.0
|
||||||
|
#define SCALE_OFFSET 7
|
||||||
|
|
||||||
|
MapView::MapView(Map *map, POI *poi, QWidget *parent)
|
||||||
|
: QGraphicsView(parent)
|
||||||
|
{
|
||||||
|
Q_ASSERT(map != 0);
|
||||||
|
Q_ASSERT(poi != 0);
|
||||||
|
|
||||||
|
_scene = new QGraphicsScene(this);
|
||||||
|
setScene(_scene);
|
||||||
|
setCacheMode(QGraphicsView::CacheBackground);
|
||||||
|
setDragMode(QGraphicsView::ScrollHandDrag);
|
||||||
|
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
|
||||||
|
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
|
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
|
setRenderHint(QPainter::Antialiasing, true);
|
||||||
|
setAcceptDrops(false);
|
||||||
|
|
||||||
|
_mapScale = new ScaleItem();
|
||||||
|
_mapScale->setZValue(2.0);
|
||||||
|
_scene->addItem(_mapScale);
|
||||||
|
|
||||||
|
_map = map;
|
||||||
|
_map->load();
|
||||||
|
connect(_map, SIGNAL(loaded()), this, SLOT(reloadMap()));
|
||||||
|
|
||||||
|
_poi = poi;
|
||||||
|
connect(_poi, SIGNAL(pointsChanged()), this, SLOT(updatePOI()));
|
||||||
|
|
||||||
|
_units = Metric;
|
||||||
|
_opacity = 1.0;
|
||||||
|
_backgroundColor = Qt::white;
|
||||||
|
_markerColor = Qt::red;
|
||||||
|
|
||||||
|
_showMap = true;
|
||||||
|
_showTracks = true;
|
||||||
|
_showRoutes = true;
|
||||||
|
_showWaypoints = true;
|
||||||
|
_showWaypointLabels = true;
|
||||||
|
_showPOI = true;
|
||||||
|
_showPOILabels = true;
|
||||||
|
_overlapPOIs = true;
|
||||||
|
_showRouteWaypoints = true;
|
||||||
|
_trackWidth = 3;
|
||||||
|
_routeWidth = 3;
|
||||||
|
_trackStyle = Qt::SolidLine;
|
||||||
|
_routeStyle = Qt::DashLine;
|
||||||
|
_waypointSize = 8;
|
||||||
|
_waypointColor = Qt::black;
|
||||||
|
_poiSize = 8;
|
||||||
|
_poiColor = Qt::black;
|
||||||
|
|
||||||
|
_plot = false;
|
||||||
|
_digitalZoom = 0;
|
||||||
|
|
||||||
|
_map->setBackgroundColor(_backgroundColor);
|
||||||
|
_scene->setSceneRect(_map->bounds());
|
||||||
|
|
||||||
|
centerOn(_scene->sceneRect().center());
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
_mapScale->setResolution(_res);
|
||||||
|
}
|
||||||
|
|
||||||
|
PathItem *MapView::addTrack(const Track &track)
|
||||||
|
{
|
||||||
|
if (track.isNull()) {
|
||||||
|
_palette.nextColor();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
TrackItem *ti = new TrackItem(track, _map);
|
||||||
|
_tracks.append(ti);
|
||||||
|
_tr |= ti->path().boundingRect();
|
||||||
|
ti->setColor(_palette.nextColor());
|
||||||
|
ti->setWidth(_trackWidth);
|
||||||
|
ti->setStyle(_trackStyle);
|
||||||
|
ti->setUnits(_units);
|
||||||
|
ti->setVisible(_showTracks);
|
||||||
|
ti->setDigitalZoom(_digitalZoom);
|
||||||
|
ti->setMarkerColor(_markerColor);
|
||||||
|
_scene->addItem(ti);
|
||||||
|
|
||||||
|
if (_showTracks)
|
||||||
|
addPOI(_poi->points(ti->path()));
|
||||||
|
|
||||||
|
return ti;
|
||||||
|
}
|
||||||
|
|
||||||
|
PathItem *MapView::addRoute(const Route &route)
|
||||||
|
{
|
||||||
|
if (route.isNull()) {
|
||||||
|
_palette.nextColor();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
RouteItem *ri = new RouteItem(route, _map);
|
||||||
|
_routes.append(ri);
|
||||||
|
_rr |= ri->path().boundingRect();
|
||||||
|
ri->setColor(_palette.nextColor());
|
||||||
|
ri->setWidth(_routeWidth);
|
||||||
|
ri->setStyle(_routeStyle);
|
||||||
|
ri->setUnits(_units);
|
||||||
|
ri->setVisible(_showRoutes);
|
||||||
|
ri->showWaypoints(_showRouteWaypoints);
|
||||||
|
ri->showWaypointLabels(_showWaypointLabels);
|
||||||
|
ri->setDigitalZoom(_digitalZoom);
|
||||||
|
ri->setMarkerColor(_markerColor);
|
||||||
|
_scene->addItem(ri);
|
||||||
|
|
||||||
|
if (_showRoutes)
|
||||||
|
addPOI(_poi->points(ri->path()));
|
||||||
|
|
||||||
|
return ri;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::addWaypoints(const QList<Waypoint> &waypoints)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < waypoints.count(); i++) {
|
||||||
|
const Waypoint &w = waypoints.at(i);
|
||||||
|
|
||||||
|
WaypointItem *wi = new WaypointItem(w, _map);
|
||||||
|
_waypoints.append(wi);
|
||||||
|
_wr.unite(wi->waypoint().coordinates());
|
||||||
|
wi->setZValue(1);
|
||||||
|
wi->setSize(_waypointSize);
|
||||||
|
wi->setColor(_waypointColor);
|
||||||
|
wi->showLabel(_showWaypointLabels);
|
||||||
|
wi->setUnits(_units);
|
||||||
|
wi->setVisible(_showWaypoints);
|
||||||
|
wi->setDigitalZoom(_digitalZoom);
|
||||||
|
_scene->addItem(wi);
|
||||||
|
|
||||||
|
if (_showWaypoints)
|
||||||
|
addPOI(_poi->points(w));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<PathItem *> MapView::loadData(const Data &data)
|
||||||
|
{
|
||||||
|
QList<PathItem *> paths;
|
||||||
|
qreal zoom = _map->zoom();
|
||||||
|
|
||||||
|
for (int i = 0; i < data.tracks().count(); i++)
|
||||||
|
paths.append(addTrack(*(data.tracks().at(i))));
|
||||||
|
for (int i = 0; i < data.routes().count(); i++)
|
||||||
|
paths.append(addRoute(*(data.routes().at(i))));
|
||||||
|
addWaypoints(data.waypoints());
|
||||||
|
|
||||||
|
if (_tracks.empty() && _routes.empty() && _waypoints.empty())
|
||||||
|
return paths;
|
||||||
|
|
||||||
|
if (mapZoom() != zoom)
|
||||||
|
rescale();
|
||||||
|
else
|
||||||
|
updatePOIVisibility();
|
||||||
|
|
||||||
|
centerOn(contentCenter());
|
||||||
|
|
||||||
|
return paths;
|
||||||
|
}
|
||||||
|
|
||||||
|
qreal MapView::mapZoom() 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
QPointF MapView::contentCenter() const
|
||||||
|
{
|
||||||
|
RectC br = _tr | _rr | _wr;
|
||||||
|
|
||||||
|
return br.isNull() ? sceneRect().center() : _map->ll2xy(br.center());
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::updatePOIVisibility()
|
||||||
|
{
|
||||||
|
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it, jt;
|
||||||
|
|
||||||
|
if (!_showPOI)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||||
|
it.value()->show();
|
||||||
|
|
||||||
|
if (!_overlapPOIs) {
|
||||||
|
for (it = _pois.constBegin(); it != _pois.constEnd(); it++) {
|
||||||
|
for (jt = _pois.constBegin(); jt != _pois.constEnd(); jt++) {
|
||||||
|
if (it.value()->isVisible() && jt.value()->isVisible()
|
||||||
|
&& it != jt && it.value()->collidesWithItem(jt.value()))
|
||||||
|
jt.value()->hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::rescale()
|
||||||
|
{
|
||||||
|
_scene->setSceneRect(_map->bounds());
|
||||||
|
resetCachedContent();
|
||||||
|
|
||||||
|
for (int i = 0; i < _tracks.size(); i++)
|
||||||
|
_tracks.at(i)->setMap(_map);
|
||||||
|
for (int i = 0; i < _routes.size(); i++)
|
||||||
|
_routes.at(i)->setMap(_map);
|
||||||
|
for (int i = 0; i < _waypoints.size(); i++)
|
||||||
|
_waypoints.at(i)->setMap(_map);
|
||||||
|
|
||||||
|
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||||
|
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||||
|
it.value()->setMap(_map);
|
||||||
|
|
||||||
|
updatePOIVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::setPalette(const Palette &palette)
|
||||||
|
{
|
||||||
|
_palette = palette;
|
||||||
|
_palette.reset();
|
||||||
|
|
||||||
|
for (int i = 0; i < _tracks.count(); i++)
|
||||||
|
_tracks.at(i)->setColor(_palette.nextColor());
|
||||||
|
for (int i = 0; i < _routes.count(); i++)
|
||||||
|
_routes.at(i)->setColor(_palette.nextColor());
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::setMap(Map *map)
|
||||||
|
{
|
||||||
|
QPointF pos = mapToScene(viewport()->rect().center());
|
||||||
|
Coordinates center = _map->xy2ll(pos);
|
||||||
|
qreal resolution = _map->resolution(pos);
|
||||||
|
|
||||||
|
_map->unload();
|
||||||
|
disconnect(_map, SIGNAL(loaded()), this, SLOT(reloadMap()));
|
||||||
|
|
||||||
|
_map = map;
|
||||||
|
_map->load();
|
||||||
|
_map->setBackgroundColor(_backgroundColor);
|
||||||
|
connect(_map, SIGNAL(loaded()), this, SLOT(reloadMap()));
|
||||||
|
|
||||||
|
digitalZoom(0);
|
||||||
|
|
||||||
|
_map->zoomFit(resolution, center);
|
||||||
|
_scene->setSceneRect(_map->bounds());
|
||||||
|
|
||||||
|
for (int i = 0; i < _tracks.size(); i++)
|
||||||
|
_tracks.at(i)->setMap(map);
|
||||||
|
for (int i = 0; i < _routes.size(); i++)
|
||||||
|
_routes.at(i)->setMap(map);
|
||||||
|
for (int i = 0; i < _waypoints.size(); i++)
|
||||||
|
_waypoints.at(i)->setMap(map);
|
||||||
|
|
||||||
|
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||||
|
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||||
|
it.value()->setMap(_map);
|
||||||
|
updatePOIVisibility();
|
||||||
|
|
||||||
|
centerOn(_map->ll2xy(center));
|
||||||
|
|
||||||
|
resetCachedContent();
|
||||||
|
QPixmapCache::clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::setPOI(POI *poi)
|
||||||
|
{
|
||||||
|
disconnect(_poi, SIGNAL(pointsChanged()), this, SLOT(updatePOI()));
|
||||||
|
connect(poi, SIGNAL(pointsChanged()), this, SLOT(updatePOI()));
|
||||||
|
|
||||||
|
_poi = poi;
|
||||||
|
|
||||||
|
updatePOI();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::updatePOI()
|
||||||
|
{
|
||||||
|
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||||
|
|
||||||
|
for (it = _pois.constBegin(); it != _pois.constEnd(); it++) {
|
||||||
|
_scene->removeItem(it.value());
|
||||||
|
delete it.value();
|
||||||
|
}
|
||||||
|
_pois.clear();
|
||||||
|
|
||||||
|
if (_showTracks)
|
||||||
|
for (int i = 0; i < _tracks.size(); i++)
|
||||||
|
addPOI(_poi->points(_tracks.at(i)->path()));
|
||||||
|
if (_showRoutes)
|
||||||
|
for (int i = 0; i < _routes.size(); i++)
|
||||||
|
addPOI(_poi->points(_routes.at(i)->path()));
|
||||||
|
if (_showWaypoints)
|
||||||
|
for (int i = 0; i< _waypoints.size(); i++)
|
||||||
|
addPOI(_poi->points(_waypoints.at(i)->waypoint()));
|
||||||
|
|
||||||
|
updatePOIVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::addPOI(const QList<Waypoint> &waypoints)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < waypoints.size(); i++) {
|
||||||
|
const Waypoint &w = waypoints.at(i);
|
||||||
|
|
||||||
|
if (_pois.contains(SearchPointer<Waypoint>(&w)))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
WaypointItem *pi = new WaypointItem(w, _map);
|
||||||
|
pi->setZValue(1);
|
||||||
|
pi->setSize(_poiSize);
|
||||||
|
pi->setColor(_poiColor);
|
||||||
|
pi->showLabel(_showPOILabels);
|
||||||
|
pi->setVisible(_showPOI);
|
||||||
|
pi->setDigitalZoom(_digitalZoom);
|
||||||
|
_scene->addItem(pi);
|
||||||
|
|
||||||
|
_pois.insert(SearchPointer<Waypoint>(&(pi->waypoint())), pi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::setUnits(enum Units units)
|
||||||
|
{
|
||||||
|
_units = units;
|
||||||
|
|
||||||
|
_mapScale->setUnits(units);
|
||||||
|
|
||||||
|
for (int i = 0; i < _tracks.count(); i++)
|
||||||
|
_tracks[i]->setUnits(units);
|
||||||
|
for (int i = 0; i < _routes.count(); i++)
|
||||||
|
_routes[i]->setUnits(units);
|
||||||
|
for (int i = 0; i < _waypoints.size(); i++)
|
||||||
|
_waypoints.at(i)->setUnits(units);
|
||||||
|
|
||||||
|
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||||
|
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||||
|
it.value()->setUnits(units);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::clearMapCache()
|
||||||
|
{
|
||||||
|
_map->clearCache();
|
||||||
|
resetCachedContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::digitalZoom(int zoom)
|
||||||
|
{
|
||||||
|
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||||
|
|
||||||
|
if (zoom) {
|
||||||
|
_digitalZoom += zoom;
|
||||||
|
scale(pow(2, zoom), pow(2, zoom));
|
||||||
|
} else {
|
||||||
|
_digitalZoom = 0;
|
||||||
|
resetTransform();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < _tracks.size(); i++)
|
||||||
|
_tracks.at(i)->setDigitalZoom(_digitalZoom);
|
||||||
|
for (int i = 0; i < _routes.size(); i++)
|
||||||
|
_routes.at(i)->setDigitalZoom(_digitalZoom);
|
||||||
|
for (int i = 0; i < _waypoints.size(); i++)
|
||||||
|
_waypoints.at(i)->setDigitalZoom(_digitalZoom);
|
||||||
|
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||||
|
it.value()->setDigitalZoom(_digitalZoom);
|
||||||
|
|
||||||
|
_mapScale->setDigitalZoom(_digitalZoom);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::zoom(int zoom, const QPoint &pos, const Coordinates &c)
|
||||||
|
{
|
||||||
|
bool shift = QApplication::keyboardModifiers() & Qt::ShiftModifier;
|
||||||
|
|
||||||
|
if (_digitalZoom) {
|
||||||
|
if (((_digitalZoom > 0 && zoom > 0) && (!shift || _digitalZoom
|
||||||
|
>= MAX_DIGITAL_ZOOM)) || ((_digitalZoom < 0 && zoom < 0) && (!shift
|
||||||
|
|| _digitalZoom <= MIN_DIGITAL_ZOOM)))
|
||||||
|
return;
|
||||||
|
|
||||||
|
digitalZoom(zoom);
|
||||||
|
} else {
|
||||||
|
qreal os, ns;
|
||||||
|
os = _map->zoom();
|
||||||
|
ns = (zoom > 0) ? _map->zoomIn() : _map->zoomOut();
|
||||||
|
|
||||||
|
if (ns != os) {
|
||||||
|
rescale();
|
||||||
|
centerOn(_map->ll2xy(c) - (pos - viewport()->rect().center()));
|
||||||
|
} else {
|
||||||
|
if (shift)
|
||||||
|
digitalZoom(zoom);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::wheelEvent(QWheelEvent *event)
|
||||||
|
{
|
||||||
|
static int deg = 0;
|
||||||
|
|
||||||
|
deg += event->delta() / 8;
|
||||||
|
if (qAbs(deg) < 15)
|
||||||
|
return;
|
||||||
|
deg = 0;
|
||||||
|
|
||||||
|
Coordinates c = _map->xy2ll(mapToScene(event->pos()));
|
||||||
|
zoom((event->delta() > 0) ? 1 : -1, event->pos(), c);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::mouseDoubleClickEvent(QMouseEvent *event)
|
||||||
|
{
|
||||||
|
if (event->button() != Qt::LeftButton && event->button() != Qt::RightButton)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Coordinates c = _map->xy2ll(mapToScene(event->pos()));
|
||||||
|
zoom((event->button() == Qt::LeftButton) ? 1 : -1, event->pos(), c);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::keyPressEvent(QKeyEvent *event)
|
||||||
|
{
|
||||||
|
int z;
|
||||||
|
|
||||||
|
QPoint pos = viewport()->rect().center();
|
||||||
|
Coordinates c = _map->xy2ll(mapToScene(pos));
|
||||||
|
|
||||||
|
if (event->matches(ZOOM_IN))
|
||||||
|
z = 1;
|
||||||
|
else if (event->matches(ZOOM_OUT))
|
||||||
|
z = -1;
|
||||||
|
else if (_digitalZoom && event->key() == Qt::Key_Escape) {
|
||||||
|
digitalZoom(0);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
QGraphicsView::keyPressEvent(event);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
zoom(z, pos, c);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
|
||||||
|
bool hires)
|
||||||
|
{
|
||||||
|
QRect orig, adj;
|
||||||
|
qreal ratio, diff, origRes, q;
|
||||||
|
QPointF origScene, origPos;
|
||||||
|
Coordinates origLL;
|
||||||
|
|
||||||
|
|
||||||
|
// Enter plot mode
|
||||||
|
setUpdatesEnabled(false);
|
||||||
|
_plot = true;
|
||||||
|
_map->setBlockingMode(true);
|
||||||
|
|
||||||
|
// Compute sizes & ratios
|
||||||
|
orig = viewport()->rect();
|
||||||
|
origPos = _mapScale->pos();
|
||||||
|
|
||||||
|
if (orig.height() * (target.width() / target.height()) - orig.width() < 0) {
|
||||||
|
ratio = target.height() / target.width();
|
||||||
|
diff = (orig.width() * ratio) - orig.height();
|
||||||
|
adj = orig.adjusted(0, -diff/2, 0, diff/2);
|
||||||
|
} else {
|
||||||
|
ratio = target.width() / target.height();
|
||||||
|
diff = (orig.height() * ratio) - orig.width();
|
||||||
|
adj = orig.adjusted(-diff/2, 0, diff/2, 0);
|
||||||
|
}
|
||||||
|
q = (target.width() / scale) / adj.width();
|
||||||
|
|
||||||
|
// Adjust the view for printing
|
||||||
|
if (hires) {
|
||||||
|
origScene = mapToScene(orig.center());
|
||||||
|
origLL = _map->xy2ll(origScene);
|
||||||
|
origRes = _map->resolution(origScene);
|
||||||
|
|
||||||
|
QPointF s(painter->device()->logicalDpiX()
|
||||||
|
/ (qreal)metric(QPaintDevice::PdmDpiX),
|
||||||
|
painter->device()->logicalDpiY()
|
||||||
|
/ (qreal)metric(QPaintDevice::PdmDpiY));
|
||||||
|
adj = QRect(0, 0, adj.width() * s.x(), adj.height() * s.y());
|
||||||
|
_map->zoomFit(adj.size(), _tr | _rr | _wr);
|
||||||
|
rescale();
|
||||||
|
|
||||||
|
QPointF center = contentCenter();
|
||||||
|
centerOn(center);
|
||||||
|
adj.moveCenter(mapFromScene(center));
|
||||||
|
|
||||||
|
_mapScale->setDigitalZoom(-log2(s.x() / q));
|
||||||
|
_mapScale->setPos(mapToScene(QPoint(adj.bottomRight() + QPoint(
|
||||||
|
-(SCALE_OFFSET + _mapScale->boundingRect().width()) * (s.x() / q),
|
||||||
|
-(SCALE_OFFSET + _mapScale->boundingRect().height()) * (s.x() / q)))));
|
||||||
|
} else {
|
||||||
|
_mapScale->setDigitalZoom(-log2(1.0 / q));
|
||||||
|
_mapScale->setPos(mapToScene(QPoint(adj.bottomRight() + QPoint(
|
||||||
|
-(SCALE_OFFSET + _mapScale->boundingRect().width()) / q ,
|
||||||
|
-(SCALE_OFFSET + _mapScale->boundingRect().height()) / q))));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Print the view
|
||||||
|
render(painter, target, adj);
|
||||||
|
|
||||||
|
// Revert view changes to display mode
|
||||||
|
if (hires) {
|
||||||
|
_map->zoomFit(origRes, origLL);
|
||||||
|
rescale();
|
||||||
|
centerOn(origScene);
|
||||||
|
}
|
||||||
|
_mapScale->setDigitalZoom(0);
|
||||||
|
_mapScale->setPos(origPos);
|
||||||
|
|
||||||
|
// Exit plot mode
|
||||||
|
_map->setBlockingMode(false);
|
||||||
|
_plot = false;
|
||||||
|
setUpdatesEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::clear()
|
||||||
|
{
|
||||||
|
_pois.clear();
|
||||||
|
_tracks.clear();
|
||||||
|
_routes.clear();
|
||||||
|
_waypoints.clear();
|
||||||
|
|
||||||
|
_scene->removeItem(_mapScale);
|
||||||
|
_scene->clear();
|
||||||
|
_scene->addItem(_mapScale);
|
||||||
|
|
||||||
|
_palette.reset();
|
||||||
|
|
||||||
|
_tr = RectC();
|
||||||
|
_rr = RectC();
|
||||||
|
_wr = RectC();
|
||||||
|
|
||||||
|
digitalZoom(0);
|
||||||
|
|
||||||
|
// If not reset, causes huge redraw areas (and system memory exhaustion)
|
||||||
|
resetCachedContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::showTracks(bool show)
|
||||||
|
{
|
||||||
|
_showTracks = show;
|
||||||
|
|
||||||
|
for (int i = 0; i < _tracks.count(); i++)
|
||||||
|
_tracks.at(i)->setVisible(show);
|
||||||
|
|
||||||
|
updatePOI();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::showRoutes(bool show)
|
||||||
|
{
|
||||||
|
_showRoutes = show;
|
||||||
|
|
||||||
|
for (int i = 0; i < _routes.count(); i++)
|
||||||
|
_routes.at(i)->setVisible(show);
|
||||||
|
|
||||||
|
updatePOI();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::showWaypoints(bool show)
|
||||||
|
{
|
||||||
|
_showWaypoints = show;
|
||||||
|
|
||||||
|
for (int i = 0; i < _waypoints.count(); i++)
|
||||||
|
_waypoints.at(i)->setVisible(show);
|
||||||
|
|
||||||
|
updatePOI();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::showWaypointLabels(bool show)
|
||||||
|
{
|
||||||
|
_showWaypointLabels = show;
|
||||||
|
|
||||||
|
for (int i = 0; i < _waypoints.size(); i++)
|
||||||
|
_waypoints.at(i)->showLabel(show);
|
||||||
|
|
||||||
|
for (int i = 0; i < _routes.size(); i++)
|
||||||
|
_routes.at(i)->showWaypointLabels(show);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::showRouteWaypoints(bool show)
|
||||||
|
{
|
||||||
|
_showRouteWaypoints = show;
|
||||||
|
|
||||||
|
for (int i = 0; i < _routes.size(); i++)
|
||||||
|
_routes.at(i)->showWaypoints(show);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::showMap(bool show)
|
||||||
|
{
|
||||||
|
_showMap = show;
|
||||||
|
resetCachedContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::showPOI(bool show)
|
||||||
|
{
|
||||||
|
_showPOI = show;
|
||||||
|
|
||||||
|
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||||
|
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||||
|
it.value()->setVisible(show);
|
||||||
|
|
||||||
|
updatePOIVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::showPOILabels(bool show)
|
||||||
|
{
|
||||||
|
_showPOILabels = show;
|
||||||
|
|
||||||
|
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||||
|
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||||
|
it.value()->showLabel(show);
|
||||||
|
|
||||||
|
updatePOIVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::setPOIOverlap(bool overlap)
|
||||||
|
{
|
||||||
|
_overlapPOIs = overlap;
|
||||||
|
|
||||||
|
updatePOIVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::setTrackWidth(int width)
|
||||||
|
{
|
||||||
|
_trackWidth = width;
|
||||||
|
|
||||||
|
for (int i = 0; i < _tracks.count(); i++)
|
||||||
|
_tracks.at(i)->setWidth(width);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::setRouteWidth(int width)
|
||||||
|
{
|
||||||
|
_routeWidth = width;
|
||||||
|
|
||||||
|
for (int i = 0; i < _routes.count(); i++)
|
||||||
|
_routes.at(i)->setWidth(width);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::setTrackStyle(Qt::PenStyle style)
|
||||||
|
{
|
||||||
|
_trackStyle = style;
|
||||||
|
|
||||||
|
for (int i = 0; i < _tracks.count(); i++)
|
||||||
|
_tracks.at(i)->setStyle(style);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::setRouteStyle(Qt::PenStyle style)
|
||||||
|
{
|
||||||
|
_routeStyle = style;
|
||||||
|
|
||||||
|
for (int i = 0; i < _routes.count(); i++)
|
||||||
|
_routes.at(i)->setStyle(style);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::setWaypointSize(int size)
|
||||||
|
{
|
||||||
|
_waypointSize = size;
|
||||||
|
|
||||||
|
for (int i = 0; i < _waypoints.size(); i++)
|
||||||
|
_waypoints.at(i)->setSize(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::setWaypointColor(const QColor &color)
|
||||||
|
{
|
||||||
|
_waypointColor = color;
|
||||||
|
|
||||||
|
for (int i = 0; i < _waypoints.size(); i++)
|
||||||
|
_waypoints.at(i)->setColor(color);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::setPOISize(int size)
|
||||||
|
{
|
||||||
|
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||||
|
|
||||||
|
_poiSize = size;
|
||||||
|
|
||||||
|
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||||
|
it.value()->setSize(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::setPOIColor(const QColor &color)
|
||||||
|
{
|
||||||
|
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||||
|
|
||||||
|
_poiColor = color;
|
||||||
|
|
||||||
|
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||||
|
it.value()->setColor(color);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::setMapOpacity(int opacity)
|
||||||
|
{
|
||||||
|
_opacity = opacity / 100.0;
|
||||||
|
resetCachedContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::setBackgroundColor(const QColor &color)
|
||||||
|
{
|
||||||
|
_backgroundColor = color;
|
||||||
|
_map->setBackgroundColor(color);
|
||||||
|
resetCachedContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::drawBackground(QPainter *painter, const QRectF &rect)
|
||||||
|
{
|
||||||
|
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)
|
||||||
|
rescale();
|
||||||
|
|
||||||
|
centerOn(contentCenter());
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::paintEvent(QPaintEvent *event)
|
||||||
|
{
|
||||||
|
QPointF scenePos = mapToScene(rect().bottomRight() + QPoint(
|
||||||
|
-(SCALE_OFFSET + _mapScale->boundingRect().width()),
|
||||||
|
-(SCALE_OFFSET + _mapScale->boundingRect().height())));
|
||||||
|
if (_mapScale->pos() != scenePos && !_plot)
|
||||||
|
_mapScale->setPos(scenePos);
|
||||||
|
|
||||||
|
QGraphicsView::paintEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::scrollContentsBy(int dx, int dy)
|
||||||
|
{
|
||||||
|
QGraphicsView::scrollContentsBy(dx, dy);
|
||||||
|
|
||||||
|
QPointF center = mapToScene(viewport()->rect().center());
|
||||||
|
qreal res = _map->resolution(center);
|
||||||
|
|
||||||
|
if (qMax(res, _res) / qMin(res, _res) > 1.1) {
|
||||||
|
_mapScale->setResolution(res);
|
||||||
|
_res = res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::useOpenGL(bool use)
|
||||||
|
{
|
||||||
|
if (use)
|
||||||
|
setViewport(new OPENGL_WIDGET);
|
||||||
|
else
|
||||||
|
setViewport(new QWidget);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::useAntiAliasing(bool use)
|
||||||
|
{
|
||||||
|
setRenderHint(QPainter::Antialiasing, use);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::setMarkerColor(const QColor &color)
|
||||||
|
{
|
||||||
|
_markerColor = color;
|
||||||
|
|
||||||
|
for (int i = 0; i < _tracks.size(); i++)
|
||||||
|
_tracks.at(i)->setMarkerColor(color);
|
||||||
|
for (int i = 0; i < _routes.size(); i++)
|
||||||
|
_routes.at(i)->setMarkerColor(color);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapView::reloadMap()
|
||||||
|
{
|
||||||
|
resetCachedContent();
|
||||||
|
}
|
@ -1,13 +1,15 @@
|
|||||||
#ifndef TRACKVIEW_H
|
#ifndef MAPVIEW_H
|
||||||
#define TRACKVIEW_H
|
#define MAPVIEW_H
|
||||||
|
|
||||||
#include <QGraphicsView>
|
#include <QGraphicsView>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
#include "common/rectc.h"
|
||||||
|
#include "data/waypoint.h"
|
||||||
|
#include "searchpointer.h"
|
||||||
#include "units.h"
|
#include "units.h"
|
||||||
#include "palette.h"
|
#include "palette.h"
|
||||||
#include "waypoint.h"
|
|
||||||
|
|
||||||
class Data;
|
class Data;
|
||||||
class POI;
|
class POI;
|
||||||
@ -20,13 +22,12 @@ class WaypointItem;
|
|||||||
class ScaleItem;
|
class ScaleItem;
|
||||||
class PathItem;
|
class PathItem;
|
||||||
|
|
||||||
class PathView : public QGraphicsView
|
class MapView : public QGraphicsView
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PathView(Map *map, POI *poi, QWidget *parent = 0);
|
MapView(Map *map, POI *poi, QWidget *parent = 0);
|
||||||
~PathView();
|
|
||||||
|
|
||||||
QList<PathItem*> loadData(const Data &data);
|
QList<PathItem*> loadData(const Data &data);
|
||||||
|
|
||||||
@ -35,19 +36,25 @@ public:
|
|||||||
void setMap(Map *map);
|
void setMap(Map *map);
|
||||||
void setUnits(enum Units units);
|
void setUnits(enum Units units);
|
||||||
|
|
||||||
void plot(QPainter *painter, const QRectF &target);
|
void plot(QPainter *painter, const QRectF &target, qreal scale, bool hires);
|
||||||
|
|
||||||
int trackCount() const {return _tracks.count();}
|
|
||||||
int routeCount() const {return _routes.count();}
|
|
||||||
int waypointCount() const {return _waypoints.count();}
|
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
|
void setTrackWidth(int width);
|
||||||
|
void setRouteWidth(int width);
|
||||||
|
void setTrackStyle(Qt::PenStyle style);
|
||||||
|
void setRouteStyle(Qt::PenStyle style);
|
||||||
|
void setWaypointSize(int size);
|
||||||
|
void setWaypointColor(const QColor &color);
|
||||||
|
void setPOISize(int size);
|
||||||
|
void setPOIColor(const QColor &color);
|
||||||
|
void setMapOpacity(int opacity);
|
||||||
|
void setBackgroundColor(const QColor &color);
|
||||||
void useOpenGL(bool use);
|
void useOpenGL(bool use);
|
||||||
|
void useAntiAliasing(bool use);
|
||||||
|
void setMarkerColor(const QColor &color);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void redraw();
|
|
||||||
|
|
||||||
void showMap(bool show);
|
void showMap(bool show);
|
||||||
void showPOI(bool show);
|
void showPOI(bool show);
|
||||||
void setPOIOverlap(bool overlap);
|
void setPOIOverlap(bool overlap);
|
||||||
@ -57,30 +64,27 @@ public slots:
|
|||||||
void showRoutes(bool show);
|
void showRoutes(bool show);
|
||||||
void showWaypoints(bool show);
|
void showWaypoints(bool show);
|
||||||
void showRouteWaypoints(bool show);
|
void showRouteWaypoints(bool show);
|
||||||
void setTrackWidth(int width);
|
void clearMapCache();
|
||||||
void setRouteWidth(int width);
|
|
||||||
void setTrackStyle(Qt::PenStyle style);
|
|
||||||
void setRouteStyle(Qt::PenStyle style);
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void updatePOI();
|
void updatePOI();
|
||||||
|
void reloadMap();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PathItem *addTrack(const Track &track);
|
PathItem *addTrack(const Track &track);
|
||||||
PathItem *addRoute(const Route &route);
|
PathItem *addRoute(const Route &route);
|
||||||
void addWaypoints(const QList<Waypoint> &waypoints);
|
void addWaypoints(const QList<Waypoint> &waypoints);
|
||||||
void addPOI(const QVector<Waypoint> &waypoints);
|
void addPOI(const QList<Waypoint> &waypoints);
|
||||||
void loadPOI();
|
void loadPOI();
|
||||||
void clearPOI();
|
void clearPOI();
|
||||||
|
|
||||||
qreal mapScale() const;
|
qreal mapZoom() const;
|
||||||
QPointF contentCenter() const;
|
QPointF contentCenter() const;
|
||||||
void rescale();
|
void rescale();
|
||||||
|
void centerOn(const QPointF &pos);
|
||||||
void zoom(int zoom, const QPoint &pos, const Coordinates &c);
|
void zoom(int zoom, const QPoint &pos, const Coordinates &c);
|
||||||
void digitalZoom(int zoom);
|
void digitalZoom(int zoom);
|
||||||
void resetDigitalZoom();
|
|
||||||
void updatePOIVisibility();
|
void updatePOIVisibility();
|
||||||
void updateWaypointsBoundingRect(const QPointF &wp);
|
|
||||||
|
|
||||||
void mouseDoubleClickEvent(QMouseEvent *event);
|
void mouseDoubleClickEvent(QMouseEvent *event);
|
||||||
void wheelEvent(QWheelEvent *event);
|
void wheelEvent(QWheelEvent *event);
|
||||||
@ -95,10 +99,9 @@ private:
|
|||||||
QList<TrackItem*> _tracks;
|
QList<TrackItem*> _tracks;
|
||||||
QList<RouteItem*> _routes;
|
QList<RouteItem*> _routes;
|
||||||
QList<WaypointItem*> _waypoints;
|
QList<WaypointItem*> _waypoints;
|
||||||
QHash<Waypoint, WaypointItem*> _pois;
|
QHash<SearchPointer<Waypoint>, WaypointItem*> _pois;
|
||||||
|
|
||||||
QRectF _tr, _rr, _wr;
|
RectC _tr, _rr, _wr;
|
||||||
QPointF _wp;
|
|
||||||
qreal _res;
|
qreal _res;
|
||||||
|
|
||||||
Map *_map;
|
Map *_map;
|
||||||
@ -106,6 +109,8 @@ private:
|
|||||||
Palette _palette;
|
Palette _palette;
|
||||||
Units _units;
|
Units _units;
|
||||||
|
|
||||||
|
qreal _opacity;
|
||||||
|
QColor _backgroundColor;
|
||||||
bool _showMap;
|
bool _showMap;
|
||||||
bool _showTracks;
|
bool _showTracks;
|
||||||
bool _showRoutes;
|
bool _showRoutes;
|
||||||
@ -119,9 +124,14 @@ private:
|
|||||||
int _routeWidth;
|
int _routeWidth;
|
||||||
Qt::PenStyle _trackStyle;
|
Qt::PenStyle _trackStyle;
|
||||||
Qt::PenStyle _routeStyle;
|
Qt::PenStyle _routeStyle;
|
||||||
|
int _waypointSize;
|
||||||
|
int _poiSize;
|
||||||
|
QColor _waypointColor;
|
||||||
|
QColor _poiColor;
|
||||||
|
QColor _markerColor;
|
||||||
|
|
||||||
int _digitalZoom;
|
int _digitalZoom;
|
||||||
bool _plot;
|
bool _plot;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TRACKVIEW_H
|
#endif // MAPVIEW_H
|
@ -25,6 +25,11 @@ private:
|
|||||||
qreal _left, _top, _right, _bottom;
|
qreal _left, _top, _right, _bottom;
|
||||||
};
|
};
|
||||||
|
|
||||||
QDebug operator<<(QDebug dbg, const MarginsF &margins);
|
inline QDebug operator<<(QDebug dbg, const MarginsF &margins)
|
||||||
|
{
|
||||||
|
dbg.nospace() << "MarginsF(" << margins.left() << ", " << margins.top()
|
||||||
|
<< ", " << margins.right() << margins.bottom() << ")";
|
||||||
|
return dbg.space();
|
||||||
|
}
|
||||||
|
|
||||||
#endif // MARGINS_H
|
#endif // MARGINS_H
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
MarkerItem::MarkerItem(QGraphicsItem *parent) : QGraphicsItem(parent)
|
MarkerItem::MarkerItem(QGraphicsItem *parent) : QGraphicsItem(parent)
|
||||||
{
|
{
|
||||||
|
_color = Qt::red;
|
||||||
}
|
}
|
||||||
|
|
||||||
QRectF MarkerItem::boundingRect() const
|
QRectF MarkerItem::boundingRect() const
|
||||||
@ -22,9 +22,15 @@ void MarkerItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option
|
|||||||
Q_UNUSED(widget);
|
Q_UNUSED(widget);
|
||||||
|
|
||||||
painter->setRenderHint(QPainter::Antialiasing, false);
|
painter->setRenderHint(QPainter::Antialiasing, false);
|
||||||
painter->setPen(QPen(Qt::red, WIDTH));
|
painter->setPen(QPen(_color, WIDTH));
|
||||||
painter->drawLine(-SIZE/2, 0, SIZE/2, 0);
|
painter->drawLine(-SIZE/2, 0, SIZE/2, 0);
|
||||||
painter->drawLine(0, -SIZE/2, 0, SIZE/2);
|
painter->drawLine(0, -SIZE/2, 0, SIZE/2);
|
||||||
|
|
||||||
// painter->drawRect(boundingRect());
|
// painter->drawRect(boundingRect());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MarkerItem::setColor(const QColor &color)
|
||||||
|
{
|
||||||
|
_color = color;
|
||||||
|
update();
|
||||||
|
}
|
@ -2,6 +2,7 @@
|
|||||||
#define MARKERITEM_H
|
#define MARKERITEM_H
|
||||||
|
|
||||||
#include <QGraphicsItem>
|
#include <QGraphicsItem>
|
||||||
|
#include <QColor>
|
||||||
|
|
||||||
class MarkerItem : public QGraphicsItem
|
class MarkerItem : public QGraphicsItem
|
||||||
{
|
{
|
||||||
@ -11,6 +12,11 @@ public:
|
|||||||
QRectF boundingRect() const;
|
QRectF boundingRect() const;
|
||||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget);
|
QWidget *widget);
|
||||||
|
|
||||||
|
void setColor(const QColor &color);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QColor _color;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MARKERITEM_H
|
#endif // MARKERITEM_H
|
@ -1,7 +1,5 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cctype>
|
#include "nicenum.h"
|
||||||
#include "misc.h"
|
|
||||||
|
|
||||||
|
|
||||||
double niceNum(double x, int round)
|
double niceNum(double x, int round)
|
||||||
{
|
{
|
||||||
@ -34,23 +32,3 @@ double niceNum(double x, int round)
|
|||||||
|
|
||||||
return nf * pow(10.0, expv);
|
return nf * pow(10.0, expv);
|
||||||
}
|
}
|
||||||
|
|
||||||
int str2int(const char *str, int len)
|
|
||||||
{
|
|
||||||
int res = 0;
|
|
||||||
|
|
||||||
for (const char *sp = str; sp < str + len; sp++) {
|
|
||||||
if (::isdigit(*sp))
|
|
||||||
res = res * 10 + *sp - '0';
|
|
||||||
else
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
QRectF scaled(const QRectF &rect, qreal factor)
|
|
||||||
{
|
|
||||||
return QRectF(QPointF(rect.left() * factor, rect.top() * factor),
|
|
||||||
QSizeF(rect.width() * factor, rect.height() * factor));
|
|
||||||
}
|
|
6
src/GUI/nicenum.h
Normal file
6
src/GUI/nicenum.h
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#ifndef MISC_H
|
||||||
|
#define MISC_H
|
||||||
|
|
||||||
|
double niceNum(double x, int round);
|
||||||
|
|
||||||
|
#endif // MISC_H
|
20
src/GUI/oddspinbox.cpp
Normal file
20
src/GUI/oddspinbox.cpp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#include "oddspinbox.h"
|
||||||
|
|
||||||
|
OddSpinBox::OddSpinBox(QWidget *parent) : QSpinBox(parent)
|
||||||
|
{
|
||||||
|
setSingleStep(2);
|
||||||
|
setMinimum(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
QValidator::State OddSpinBox::validate(QString &text, int &pos) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(pos);
|
||||||
|
bool ok;
|
||||||
|
int val;
|
||||||
|
|
||||||
|
val = text.toInt(&ok);
|
||||||
|
if (!ok || val < 0 || val % 2 == 0)
|
||||||
|
return QValidator::Invalid;
|
||||||
|
|
||||||
|
return QValidator::Acceptable;
|
||||||
|
}
|
15
src/GUI/oddspinbox.h
Normal file
15
src/GUI/oddspinbox.h
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#ifndef ODDSPINBOX_H
|
||||||
|
#define ODDSPINBOX_H
|
||||||
|
|
||||||
|
#include <QSpinBox>
|
||||||
|
|
||||||
|
class OddSpinBox : public QSpinBox
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
OddSpinBox(QWidget *parent = 0);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QValidator::State validate(QString &text, int &pos) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ODDSPINBOX_H
|
551
src/GUI/optionsdialog.cpp
Normal file
551
src/GUI/optionsdialog.cpp
Normal file
@ -0,0 +1,551 @@
|
|||||||
|
#include <QVBoxLayout>
|
||||||
|
#include <QFormLayout>
|
||||||
|
#include <QDialogButtonBox>
|
||||||
|
#include <QListWidget>
|
||||||
|
#include <QListWidgetItem>
|
||||||
|
#include <QStackedWidget>
|
||||||
|
#include <QTabWidget>
|
||||||
|
#include <QSpinBox>
|
||||||
|
#include <QGroupBox>
|
||||||
|
#include <QCheckBox>
|
||||||
|
#include <QComboBox>
|
||||||
|
#include <QRadioButton>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QSysInfo>
|
||||||
|
#include "config.h"
|
||||||
|
#include "icons.h"
|
||||||
|
#include "colorbox.h"
|
||||||
|
#include "stylecombobox.h"
|
||||||
|
#include "oddspinbox.h"
|
||||||
|
#include "percentslider.h"
|
||||||
|
#include "optionsdialog.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define MENU_MARGIN 20
|
||||||
|
#define MENU_ICON_SIZE 32
|
||||||
|
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
static QFrame *line()
|
||||||
|
{
|
||||||
|
QFrame *l = new QFrame();
|
||||||
|
l->setFrameShape(QFrame::HLine);
|
||||||
|
l->setFrameShadow(QFrame::Sunken);
|
||||||
|
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QWidget *OptionsDialog::createGeneralPage()
|
||||||
|
{
|
||||||
|
_alwaysShowMap = new QCheckBox(tr("Always show the map"));
|
||||||
|
_alwaysShowMap->setChecked(_options->alwaysShowMap);
|
||||||
|
_alwaysShowMap->setToolTip("<p>" +
|
||||||
|
tr("Show the map even when no files are loaded.") + "</p>");
|
||||||
|
|
||||||
|
QFormLayout *showMapLayout = new QFormLayout();
|
||||||
|
showMapLayout->addWidget(_alwaysShowMap);
|
||||||
|
|
||||||
|
QWidget *generalTab = new QWidget();
|
||||||
|
QVBoxLayout *generalTabLayout = new QVBoxLayout();
|
||||||
|
generalTabLayout->addLayout(showMapLayout);
|
||||||
|
generalTabLayout->addStretch();
|
||||||
|
generalTab->setLayout(generalTabLayout);
|
||||||
|
|
||||||
|
QTabWidget *generalPage = new QTabWidget();
|
||||||
|
generalPage->addTab(generalTab, tr("General"));
|
||||||
|
|
||||||
|
return generalPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget *OptionsDialog::createAppearancePage()
|
||||||
|
{
|
||||||
|
// Paths
|
||||||
|
_baseColor = new ColorBox();
|
||||||
|
_baseColor->setColor(_options->palette.color());
|
||||||
|
_colorOffset = new QDoubleSpinBox();
|
||||||
|
_colorOffset->setMinimum(0);
|
||||||
|
_colorOffset->setMaximum(1.0);
|
||||||
|
_colorOffset->setSingleStep(0.01);
|
||||||
|
_colorOffset->setValue(_options->palette.shift());
|
||||||
|
QFormLayout *paletteLayout = new QFormLayout();
|
||||||
|
paletteLayout->addRow(tr("Base color:"), _baseColor);
|
||||||
|
paletteLayout->addRow(tr("Palette shift:"), _colorOffset);
|
||||||
|
#ifndef Q_OS_MAC
|
||||||
|
QGroupBox *colorBox = new QGroupBox(tr("Colors"));
|
||||||
|
colorBox->setLayout(paletteLayout);
|
||||||
|
#endif // Q_OS_MAC
|
||||||
|
|
||||||
|
_trackWidth = new QSpinBox();
|
||||||
|
_trackWidth->setValue(_options->trackWidth);
|
||||||
|
_trackWidth->setMinimum(1);
|
||||||
|
_trackStyle = new StyleComboBox();
|
||||||
|
_trackStyle->setValue(_options->trackStyle);
|
||||||
|
QFormLayout *trackLayout = new QFormLayout();
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
trackLayout->addRow(tr("Track width:"), _trackWidth);
|
||||||
|
trackLayout->addRow(tr("Track style:"), _trackStyle);
|
||||||
|
#else // Q_OS_MAC
|
||||||
|
trackLayout->addRow(tr("Width:"), _trackWidth);
|
||||||
|
trackLayout->addRow(tr("Style:"), _trackStyle);
|
||||||
|
QGroupBox *trackBox = new QGroupBox(tr("Tracks"));
|
||||||
|
trackBox->setLayout(trackLayout);
|
||||||
|
#endif // Q_OS_MAC
|
||||||
|
|
||||||
|
_routeWidth = new QSpinBox();
|
||||||
|
_routeWidth->setValue(_options->routeWidth);
|
||||||
|
_routeWidth->setMinimum(1);
|
||||||
|
_routeStyle = new StyleComboBox();
|
||||||
|
_routeStyle->setValue(_options->routeStyle);
|
||||||
|
QFormLayout *routeLayout = new QFormLayout();
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
routeLayout->addRow(tr("Route width:"), _routeWidth);
|
||||||
|
routeLayout->addRow(tr("Route style:"), _routeStyle);
|
||||||
|
#else // Q_OS_MAC
|
||||||
|
routeLayout->addRow(tr("Width:"), _routeWidth);
|
||||||
|
routeLayout->addRow(tr("Style:"), _routeStyle);
|
||||||
|
QGroupBox *routeBox = new QGroupBox(tr("Routes"));
|
||||||
|
routeBox->setLayout(routeLayout);
|
||||||
|
#endif // Q_OS_MAC
|
||||||
|
|
||||||
|
_pathAA = new QCheckBox(tr("Use anti-aliasing"));
|
||||||
|
_pathAA->setChecked(_options->pathAntiAliasing);
|
||||||
|
QFormLayout *pathAALayout = new QFormLayout();
|
||||||
|
pathAALayout->addWidget(_pathAA);
|
||||||
|
|
||||||
|
QWidget *pathTab = new QWidget();
|
||||||
|
QVBoxLayout *pathTabLayout = new QVBoxLayout();
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
pathTabLayout->addLayout(paletteLayout);
|
||||||
|
pathTabLayout->addWidget(line());
|
||||||
|
pathTabLayout->addLayout(trackLayout);
|
||||||
|
pathTabLayout->addWidget(line());
|
||||||
|
pathTabLayout->addLayout(routeLayout);
|
||||||
|
pathTabLayout->addWidget(line());
|
||||||
|
#else // Q_OS_MAC
|
||||||
|
pathTabLayout->addWidget(colorBox);
|
||||||
|
pathTabLayout->addWidget(trackBox);
|
||||||
|
pathTabLayout->addWidget(routeBox);
|
||||||
|
#endif // Q_OS_MAC
|
||||||
|
pathTabLayout->addLayout(pathAALayout);
|
||||||
|
pathTabLayout->addStretch();
|
||||||
|
pathTab->setLayout(pathTabLayout);
|
||||||
|
|
||||||
|
|
||||||
|
// Waypoints
|
||||||
|
_waypointSize = new QSpinBox();
|
||||||
|
_waypointSize->setMinimum(1);
|
||||||
|
_waypointSize->setValue(_options->waypointSize);
|
||||||
|
_waypointColor = new ColorBox();
|
||||||
|
_waypointColor->setColor(_options->waypointColor);
|
||||||
|
QFormLayout *waypointLayout = new QFormLayout();
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
waypointLayout->addRow(tr("Waypoint color:"), _waypointColor);
|
||||||
|
waypointLayout->addRow(tr("Waypoint size:"), _waypointSize);
|
||||||
|
#else // Q_OS_MAC
|
||||||
|
waypointLayout->addRow(tr("Color:"), _waypointColor);
|
||||||
|
waypointLayout->addRow(tr("Size:"), _waypointSize);
|
||||||
|
QGroupBox *waypointBox = new QGroupBox(tr("Waypoints"));
|
||||||
|
waypointBox->setLayout(waypointLayout);
|
||||||
|
#endif // Q_OS_MAC
|
||||||
|
|
||||||
|
_poiSize = new QSpinBox();
|
||||||
|
_poiSize->setMinimum(1);
|
||||||
|
_poiSize->setValue(_options->poiSize);
|
||||||
|
_poiColor = new ColorBox();
|
||||||
|
_poiColor->setColor(_options->poiColor);
|
||||||
|
QFormLayout *poiLayout = new QFormLayout();
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
poiLayout->addRow(tr("POI color:"), _poiColor);
|
||||||
|
poiLayout->addRow(tr("POI size:"), _poiSize);
|
||||||
|
#else // Q_OS_MAC
|
||||||
|
poiLayout->addRow(tr("Color:"), _poiColor);
|
||||||
|
poiLayout->addRow(tr("Size:"), _poiSize);
|
||||||
|
QGroupBox *poiBox = new QGroupBox(tr("POIs"));
|
||||||
|
poiBox->setLayout(poiLayout);
|
||||||
|
#endif // Q_OS_MAC
|
||||||
|
|
||||||
|
QWidget *pointTab = new QWidget();
|
||||||
|
QVBoxLayout *pointTabLayout = new QVBoxLayout();
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
pointTabLayout->addLayout(waypointLayout);
|
||||||
|
pointTabLayout->addWidget(line());
|
||||||
|
pointTabLayout->addLayout(poiLayout);
|
||||||
|
#else // Q_OS_MAC
|
||||||
|
pointTabLayout->addWidget(waypointBox);
|
||||||
|
pointTabLayout->addWidget(poiBox);
|
||||||
|
#endif // Q_OS_MAC
|
||||||
|
pointTabLayout->addStretch();
|
||||||
|
pointTab->setLayout(pointTabLayout);
|
||||||
|
|
||||||
|
|
||||||
|
// Graphs
|
||||||
|
_sliderColor = new ColorBox();
|
||||||
|
_sliderColor->setColor(_options->sliderColor);
|
||||||
|
_graphWidth = new QSpinBox();
|
||||||
|
_graphWidth->setValue(_options->graphWidth);
|
||||||
|
_graphWidth->setMinimum(1);
|
||||||
|
|
||||||
|
QFormLayout *graphLayout = new QFormLayout();
|
||||||
|
graphLayout->addRow(tr("Line width:"), _graphWidth);
|
||||||
|
graphLayout->addRow(tr("Slider color:"), _sliderColor);
|
||||||
|
|
||||||
|
_graphAA = new QCheckBox(tr("Use anti-aliasing"));
|
||||||
|
_graphAA->setChecked(_options->graphAntiAliasing);
|
||||||
|
QFormLayout *graphAALayout = new QFormLayout();
|
||||||
|
graphAALayout->addWidget(_graphAA);
|
||||||
|
|
||||||
|
QWidget *graphTab = new QWidget();
|
||||||
|
QVBoxLayout *graphTabLayout = new QVBoxLayout();
|
||||||
|
graphTabLayout->addLayout(graphLayout);
|
||||||
|
graphTabLayout->addLayout(graphAALayout);
|
||||||
|
graphTabLayout->addStretch();
|
||||||
|
graphTab->setLayout(graphTabLayout);
|
||||||
|
|
||||||
|
|
||||||
|
// Map
|
||||||
|
_mapOpacity = new PercentSlider();
|
||||||
|
_mapOpacity->setValue(_options->mapOpacity);
|
||||||
|
_backgroundColor = new ColorBox();
|
||||||
|
_backgroundColor->setColor(_options->backgroundColor);
|
||||||
|
_backgroundColor->enableAlphaChannel(false);
|
||||||
|
QFormLayout *mapLayout = new QFormLayout();
|
||||||
|
mapLayout->addRow(tr("Background color:"), _backgroundColor);
|
||||||
|
mapLayout->addRow(tr("Map opacity:"), _mapOpacity);
|
||||||
|
|
||||||
|
QWidget *mapTab = new QWidget();
|
||||||
|
QVBoxLayout *mapTabLayout = new QVBoxLayout();
|
||||||
|
mapTabLayout->addLayout(mapLayout);
|
||||||
|
mapTabLayout->addStretch();
|
||||||
|
mapTab->setLayout(mapTabLayout);
|
||||||
|
|
||||||
|
|
||||||
|
QTabWidget *appearancePage = new QTabWidget();
|
||||||
|
appearancePage->addTab(pathTab, tr("Paths"));
|
||||||
|
appearancePage->addTab(pointTab, tr("Points"));
|
||||||
|
appearancePage->addTab(graphTab, tr("Graphs"));
|
||||||
|
appearancePage->addTab(mapTab, tr("Map"));
|
||||||
|
|
||||||
|
return appearancePage;
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget *OptionsDialog::createDataPage()
|
||||||
|
{
|
||||||
|
QString filterToolTip = tr("Moving average window size");
|
||||||
|
|
||||||
|
_elevationFilter = new OddSpinBox();
|
||||||
|
_elevationFilter->setValue(_options->elevationFilter);
|
||||||
|
_elevationFilter->setToolTip(filterToolTip);
|
||||||
|
_speedFilter = new OddSpinBox();
|
||||||
|
_speedFilter->setValue(_options->speedFilter);
|
||||||
|
_speedFilter->setToolTip(filterToolTip);
|
||||||
|
_heartRateFilter = new OddSpinBox();
|
||||||
|
_heartRateFilter->setValue(_options->heartRateFilter);
|
||||||
|
_heartRateFilter->setToolTip(filterToolTip);
|
||||||
|
_cadenceFilter = new OddSpinBox();
|
||||||
|
_cadenceFilter->setValue(_options->cadenceFilter);
|
||||||
|
_cadenceFilter->setToolTip(filterToolTip);
|
||||||
|
_powerFilter = new OddSpinBox();
|
||||||
|
_powerFilter->setValue(_options->powerFilter);
|
||||||
|
_powerFilter->setToolTip(filterToolTip);
|
||||||
|
|
||||||
|
QFormLayout *smoothLayout = new QFormLayout();
|
||||||
|
smoothLayout->addRow(tr("Elevation:"), _elevationFilter);
|
||||||
|
smoothLayout->addRow(tr("Speed:"), _speedFilter);
|
||||||
|
smoothLayout->addRow(tr("Heart rate:"), _heartRateFilter);
|
||||||
|
smoothLayout->addRow(tr("Cadence:"), _cadenceFilter);
|
||||||
|
smoothLayout->addRow(tr("Power:"), _powerFilter);
|
||||||
|
#ifndef Q_OS_MAC
|
||||||
|
QGroupBox *smoothBox = new QGroupBox(tr("Smoothing"));
|
||||||
|
smoothBox->setLayout(smoothLayout);
|
||||||
|
#endif // Q_OS_MAC
|
||||||
|
|
||||||
|
_outlierEliminate = new QCheckBox(tr("Eliminate GPS outliers"));
|
||||||
|
_outlierEliminate->setChecked(_options->outlierEliminate);
|
||||||
|
|
||||||
|
QFormLayout *outlierLayout = new QFormLayout();
|
||||||
|
outlierLayout->addWidget(_outlierEliminate);
|
||||||
|
#ifndef Q_OS_MAC
|
||||||
|
QGroupBox *outlierBox = new QGroupBox(tr("Outlier elimination"));
|
||||||
|
outlierBox->setLayout(outlierLayout);
|
||||||
|
#endif // Q_OS_MAC
|
||||||
|
|
||||||
|
QWidget *filterTab = new QWidget();
|
||||||
|
QVBoxLayout *filterTabLayout = new QVBoxLayout();
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
filterTabLayout->addWidget(new QLabel(tr("Smoothing:")));
|
||||||
|
filterTabLayout->addLayout(smoothLayout);
|
||||||
|
filterTabLayout->addWidget(line());
|
||||||
|
filterTabLayout->addLayout(outlierLayout);
|
||||||
|
#else // Q_OS_MAC
|
||||||
|
filterTabLayout->addWidget(smoothBox);
|
||||||
|
filterTabLayout->addWidget(outlierBox);
|
||||||
|
#endif // Q_OS_MAC
|
||||||
|
filterTabLayout->addStretch();
|
||||||
|
filterTab->setLayout(filterTabLayout);
|
||||||
|
|
||||||
|
|
||||||
|
_pauseSpeed = new QDoubleSpinBox();
|
||||||
|
_pauseSpeed->setDecimals(1);
|
||||||
|
_pauseSpeed->setSingleStep(0.1);
|
||||||
|
_pauseSpeed->setMinimum(0.1);
|
||||||
|
if (_options->units == Imperial) {
|
||||||
|
_pauseSpeed->setValue(_options->pauseSpeed * MS2MIH);
|
||||||
|
_pauseSpeed->setSuffix(UNIT_SPACE + tr("mi/h"));
|
||||||
|
} else {
|
||||||
|
_pauseSpeed->setValue(_options->pauseSpeed * MS2KMH);
|
||||||
|
_pauseSpeed->setSuffix(UNIT_SPACE + tr("km/h"));
|
||||||
|
}
|
||||||
|
_pauseInterval = new QSpinBox();
|
||||||
|
_pauseInterval->setMinimum(1);
|
||||||
|
_pauseInterval->setSuffix(UNIT_SPACE + tr("s"));
|
||||||
|
_pauseInterval->setValue(_options->pauseInterval);
|
||||||
|
|
||||||
|
QFormLayout *pauseLayout = new QFormLayout();
|
||||||
|
pauseLayout->addRow(tr("Minimal speed:"), _pauseSpeed);
|
||||||
|
pauseLayout->addRow(tr("Minimal duration:"), _pauseInterval);
|
||||||
|
|
||||||
|
QWidget *pauseTab = new QWidget();
|
||||||
|
pauseTab->setLayout(pauseLayout);
|
||||||
|
|
||||||
|
|
||||||
|
QTabWidget *filterPage = new QTabWidget();
|
||||||
|
filterPage->addTab(filterTab, tr("Filtering"));
|
||||||
|
filterPage->addTab(pauseTab, tr("Pause detection"));
|
||||||
|
|
||||||
|
return filterPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget *OptionsDialog::createPOIPage()
|
||||||
|
{
|
||||||
|
_poiRadius = new QDoubleSpinBox();
|
||||||
|
_poiRadius->setSingleStep(1);
|
||||||
|
_poiRadius->setDecimals(1);
|
||||||
|
if (_options->units == Imperial) {
|
||||||
|
_poiRadius->setValue(_options->poiRadius / MIINM);
|
||||||
|
_poiRadius->setSuffix(UNIT_SPACE + tr("mi"));
|
||||||
|
} else {
|
||||||
|
_poiRadius->setValue(_options->poiRadius / KMINM);
|
||||||
|
_poiRadius->setSuffix(UNIT_SPACE + tr("km"));
|
||||||
|
}
|
||||||
|
|
||||||
|
QFormLayout *poiLayout = new QFormLayout();
|
||||||
|
poiLayout->addRow(tr("POI radius:"), _poiRadius);
|
||||||
|
|
||||||
|
QWidget *poiTab = new QWidget();
|
||||||
|
poiTab->setLayout(poiLayout);
|
||||||
|
|
||||||
|
QTabWidget *poiPage = new QTabWidget();
|
||||||
|
poiPage->addTab(poiTab, tr("POI"));
|
||||||
|
|
||||||
|
return poiPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget *OptionsDialog::createExportPage()
|
||||||
|
{
|
||||||
|
_wysiwyg = new QRadioButton(tr("WYSIWYG"));
|
||||||
|
_hires = new QRadioButton(tr("High-Resolution"));
|
||||||
|
if (_options->hiresPrint)
|
||||||
|
_hires->setChecked(true);
|
||||||
|
else
|
||||||
|
_wysiwyg->setChecked(true);
|
||||||
|
QLabel *lw = new QLabel(tr("The printed area is approximately the display"
|
||||||
|
" area. The map zoom level does not change."));
|
||||||
|
QLabel *lh = new QLabel(tr("The zoom level will be changed so that"
|
||||||
|
" the whole content (tracks/waypoints) fits to the printed area and"
|
||||||
|
" the map resolution is as close as possible to the print resolution."));
|
||||||
|
QFont f = lw->font();
|
||||||
|
f.setPointSize(f.pointSize() - 1);
|
||||||
|
lw->setWordWrap(true);
|
||||||
|
lh->setWordWrap(true);
|
||||||
|
lw->setFont(f);
|
||||||
|
lh->setFont(f);
|
||||||
|
|
||||||
|
QVBoxLayout *modeTabLayout = new QVBoxLayout();
|
||||||
|
modeTabLayout->addWidget(_wysiwyg);
|
||||||
|
modeTabLayout->addWidget(lw);
|
||||||
|
modeTabLayout->addSpacing(10);
|
||||||
|
modeTabLayout->addWidget(_hires);
|
||||||
|
modeTabLayout->addWidget(lh);
|
||||||
|
modeTabLayout->addStretch();
|
||||||
|
|
||||||
|
QWidget *modeTab = new QWidget();
|
||||||
|
modeTab->setLayout(modeTabLayout);
|
||||||
|
|
||||||
|
|
||||||
|
_name = new QCheckBox(tr("Name"));
|
||||||
|
_name->setChecked(_options->printName);
|
||||||
|
_date = new QCheckBox(tr("Date"));
|
||||||
|
_date->setChecked(_options->printDate);
|
||||||
|
_distance = new QCheckBox(tr("Distance"));
|
||||||
|
_distance->setChecked(_options->printDistance);
|
||||||
|
_time = new QCheckBox(tr("Time"));
|
||||||
|
_time->setChecked(_options->printTime);
|
||||||
|
_movingTime = new QCheckBox(tr("Moving time"));
|
||||||
|
_movingTime->setChecked(_options->printMovingTime);
|
||||||
|
_itemCount = new QCheckBox(tr("Item count (>1)"));
|
||||||
|
_itemCount->setChecked(_options->printItemCount);
|
||||||
|
|
||||||
|
QFormLayout *headerTabLayout = new QFormLayout();
|
||||||
|
headerTabLayout->addWidget(_name);
|
||||||
|
headerTabLayout->addWidget(_date);
|
||||||
|
headerTabLayout->addWidget(_distance);
|
||||||
|
headerTabLayout->addWidget(_time);
|
||||||
|
headerTabLayout->addWidget(_movingTime);
|
||||||
|
headerTabLayout->addItem(new QSpacerItem(10, 10));
|
||||||
|
headerTabLayout->addWidget(_itemCount);
|
||||||
|
QWidget *headerTab = new QWidget();
|
||||||
|
headerTab->setLayout(headerTabLayout);
|
||||||
|
|
||||||
|
|
||||||
|
_separateGraphPage = new QCheckBox(tr("Separate graph page"));
|
||||||
|
_separateGraphPage->setChecked(_options->separateGraphPage);
|
||||||
|
|
||||||
|
QFormLayout *graphTabLayout = new QFormLayout();
|
||||||
|
graphTabLayout->addWidget(_separateGraphPage);
|
||||||
|
QWidget *graphTab = new QWidget();
|
||||||
|
graphTab->setLayout(graphTabLayout);
|
||||||
|
|
||||||
|
|
||||||
|
QTabWidget *exportPage = new QTabWidget();
|
||||||
|
exportPage->addTab(modeTab, tr("Print mode"));
|
||||||
|
exportPage->addTab(headerTab, tr("Header"));
|
||||||
|
exportPage->addTab(graphTab, tr("Graphs"));
|
||||||
|
|
||||||
|
return exportPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget *OptionsDialog::createSystemPage()
|
||||||
|
{
|
||||||
|
_useOpenGL = new QCheckBox(tr("Use OpenGL"));
|
||||||
|
_useOpenGL->setChecked(_options->useOpenGL);
|
||||||
|
|
||||||
|
_pixmapCache = new QSpinBox();
|
||||||
|
_pixmapCache->setMinimum(16);
|
||||||
|
_pixmapCache->setMaximum(1024);
|
||||||
|
_pixmapCache->setSuffix(UNIT_SPACE + tr("MB"));
|
||||||
|
_pixmapCache->setValue(_options->pixmapCache);
|
||||||
|
|
||||||
|
QFormLayout *cacheLayout = new QFormLayout();
|
||||||
|
cacheLayout->addRow(tr("Image cache size:"), _pixmapCache);
|
||||||
|
|
||||||
|
QFormLayout *openGLLayout = new QFormLayout();
|
||||||
|
openGLLayout->addWidget(_useOpenGL);
|
||||||
|
|
||||||
|
QWidget *systemTab = new QWidget();
|
||||||
|
QVBoxLayout *systemTabLayout = new QVBoxLayout();
|
||||||
|
systemTabLayout->addLayout(cacheLayout);
|
||||||
|
systemTabLayout->addLayout(openGLLayout);
|
||||||
|
systemTabLayout->addStretch();
|
||||||
|
systemTab->setLayout(systemTabLayout);
|
||||||
|
|
||||||
|
QTabWidget *systemPage = new QTabWidget();
|
||||||
|
systemPage->addTab(systemTab, tr("System"));
|
||||||
|
|
||||||
|
return systemPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
OptionsDialog::OptionsDialog(Options *options, QWidget *parent)
|
||||||
|
: QDialog(parent), _options(options)
|
||||||
|
{
|
||||||
|
QStackedWidget *pages = new QStackedWidget();
|
||||||
|
pages->addWidget(createGeneralPage());
|
||||||
|
pages->addWidget(createAppearancePage());
|
||||||
|
pages->addWidget(createDataPage());
|
||||||
|
pages->addWidget(createPOIPage());
|
||||||
|
pages->addWidget(createExportPage());
|
||||||
|
pages->addWidget(createSystemPage());
|
||||||
|
|
||||||
|
QListWidget *menu = new QListWidget();
|
||||||
|
menu->setIconSize(QSize(MENU_ICON_SIZE, MENU_ICON_SIZE));
|
||||||
|
new QListWidgetItem(QIcon(QPixmap(APP_ICON)), tr("General"), menu);
|
||||||
|
new QListWidgetItem(QIcon(QPixmap(APPEARANCE_ICON)), tr("Appearance"),
|
||||||
|
menu);
|
||||||
|
new QListWidgetItem(QIcon(QPixmap(DATA_ICON)), tr("Data"), menu);
|
||||||
|
new QListWidgetItem(QIcon(QPixmap(POI_ICON)), tr("POI"), menu);
|
||||||
|
new QListWidgetItem(QIcon(QPixmap(PRINT_EXPORT_ICON)), tr("Print & Export"),
|
||||||
|
menu);
|
||||||
|
new QListWidgetItem(QIcon(QPixmap(SYSTEM_ICON)), tr("System"), menu);
|
||||||
|
|
||||||
|
QHBoxLayout *contentLayout = new QHBoxLayout();
|
||||||
|
contentLayout->addWidget(menu);
|
||||||
|
contentLayout->addWidget(pages);
|
||||||
|
|
||||||
|
menu->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
|
||||||
|
menu->setMaximumWidth(menu->sizeHintForColumn(0) + 2 * menu->frameWidth()
|
||||||
|
+ MENU_MARGIN);
|
||||||
|
pages->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
|
||||||
|
pages->setMinimumWidth(2 * menu->size().width());
|
||||||
|
|
||||||
|
connect(menu, SIGNAL(currentRowChanged(int)), pages,
|
||||||
|
SLOT(setCurrentIndex(int)));
|
||||||
|
menu->item(0)->setSelected(true);
|
||||||
|
|
||||||
|
|
||||||
|
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok
|
||||||
|
| QDialogButtonBox::Cancel);
|
||||||
|
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||||
|
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||||
|
|
||||||
|
QVBoxLayout *layout = new QVBoxLayout;
|
||||||
|
layout->addLayout(contentLayout);
|
||||||
|
layout->addWidget(buttonBox);
|
||||||
|
setLayout(layout);
|
||||||
|
|
||||||
|
setWindowTitle(tr("Options"));
|
||||||
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OptionsDialog::accept()
|
||||||
|
{
|
||||||
|
_options->alwaysShowMap = _alwaysShowMap->isChecked();
|
||||||
|
|
||||||
|
_options->palette.setColor(_baseColor->color());
|
||||||
|
_options->palette.setShift(_colorOffset->value());
|
||||||
|
_options->mapOpacity = _mapOpacity->value();
|
||||||
|
_options->backgroundColor = _backgroundColor->color();
|
||||||
|
_options->trackWidth = _trackWidth->value();
|
||||||
|
_options->trackStyle = (Qt::PenStyle) _trackStyle->itemData(
|
||||||
|
_trackStyle->currentIndex()).toInt();
|
||||||
|
_options->routeWidth = _routeWidth->value();
|
||||||
|
_options->routeStyle = (Qt::PenStyle) _routeStyle->itemData(
|
||||||
|
_routeStyle->currentIndex()).toInt();
|
||||||
|
_options->pathAntiAliasing = _pathAA->isChecked();
|
||||||
|
_options->waypointSize = _waypointSize->value();
|
||||||
|
_options->waypointColor = _waypointColor->color();
|
||||||
|
_options->poiSize = _poiSize->value();
|
||||||
|
_options->poiColor = _poiColor->color();
|
||||||
|
_options->graphWidth = _graphWidth->value();
|
||||||
|
_options->sliderColor = _sliderColor->color();
|
||||||
|
_options->graphAntiAliasing = _graphAA->isChecked();
|
||||||
|
|
||||||
|
_options->elevationFilter = _elevationFilter->value();
|
||||||
|
_options->speedFilter = _speedFilter->value();
|
||||||
|
_options->heartRateFilter = _heartRateFilter->value();
|
||||||
|
_options->cadenceFilter = _cadenceFilter->value();
|
||||||
|
_options->powerFilter = _powerFilter->value();
|
||||||
|
_options->outlierEliminate = _outlierEliminate->isChecked();
|
||||||
|
qreal pauseSpeed = (_options->units == Imperial)
|
||||||
|
? _pauseSpeed->value() / MS2MIH : _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;
|
||||||
|
if (qAbs(poiRadius - _options->poiRadius) > 0.01)
|
||||||
|
_options->poiRadius = poiRadius;
|
||||||
|
|
||||||
|
_options->useOpenGL = _useOpenGL->isChecked();
|
||||||
|
_options->pixmapCache = _pixmapCache->value();
|
||||||
|
|
||||||
|
_options->hiresPrint = _hires->isChecked();
|
||||||
|
_options->printName = _name->isChecked();
|
||||||
|
_options->printDate = _date->isChecked();
|
||||||
|
_options->printDistance = _distance->isChecked();
|
||||||
|
_options->printTime = _time->isChecked();
|
||||||
|
_options->printMovingTime = _movingTime->isChecked();
|
||||||
|
_options->printItemCount = _itemCount->isChecked();
|
||||||
|
_options->separateGraphPage = _separateGraphPage->isChecked();
|
||||||
|
|
||||||
|
QDialog::accept();
|
||||||
|
}
|
@ -7,26 +7,49 @@
|
|||||||
|
|
||||||
class ColorBox;
|
class ColorBox;
|
||||||
class StyleComboBox;
|
class StyleComboBox;
|
||||||
|
class OddSpinBox;
|
||||||
class QSpinBox;
|
class QSpinBox;
|
||||||
class QDoubleSpinBox;
|
class QDoubleSpinBox;
|
||||||
class QComboBox;
|
class QComboBox;
|
||||||
class QCheckBox;
|
class QCheckBox;
|
||||||
|
class QRadioButton;
|
||||||
|
class PercentSlider;
|
||||||
|
|
||||||
struct Options {
|
struct Options {
|
||||||
|
// General
|
||||||
|
bool alwaysShowMap;
|
||||||
// Appearance
|
// Appearance
|
||||||
Palette palette;
|
Palette palette;
|
||||||
int trackWidth;
|
int trackWidth;
|
||||||
int routeWidth;
|
int routeWidth;
|
||||||
Qt::PenStyle trackStyle;
|
Qt::PenStyle trackStyle;
|
||||||
Qt::PenStyle routeStyle;
|
Qt::PenStyle routeStyle;
|
||||||
|
QColor waypointColor;
|
||||||
|
QColor poiColor;
|
||||||
|
int waypointSize;
|
||||||
|
int poiSize;
|
||||||
int graphWidth;
|
int graphWidth;
|
||||||
|
QColor sliderColor;
|
||||||
bool pathAntiAliasing;
|
bool pathAntiAliasing;
|
||||||
bool graphAntiAliasing;
|
bool graphAntiAliasing;
|
||||||
|
int mapOpacity;
|
||||||
|
QColor backgroundColor;
|
||||||
|
// Data
|
||||||
|
int elevationFilter;
|
||||||
|
int speedFilter;
|
||||||
|
int heartRateFilter;
|
||||||
|
int cadenceFilter;
|
||||||
|
int powerFilter;
|
||||||
|
bool outlierEliminate;
|
||||||
|
qreal pauseSpeed;
|
||||||
|
int pauseInterval;
|
||||||
// POI
|
// POI
|
||||||
int poiRadius;
|
int poiRadius;
|
||||||
// System
|
// System
|
||||||
bool useOpenGL;
|
bool useOpenGL;
|
||||||
|
int pixmapCache;
|
||||||
// Print/Export
|
// Print/Export
|
||||||
|
bool hiresPrint;
|
||||||
bool printName;
|
bool printName;
|
||||||
bool printDate;
|
bool printDate;
|
||||||
bool printDistance;
|
bool printDistance;
|
||||||
@ -49,24 +72,51 @@ public slots:
|
|||||||
void accept();
|
void accept();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QWidget *createGeneralPage();
|
||||||
QWidget *createAppearancePage();
|
QWidget *createAppearancePage();
|
||||||
|
QWidget *createDataPage();
|
||||||
QWidget *createPOIPage();
|
QWidget *createPOIPage();
|
||||||
QWidget *createSystemPage();
|
QWidget *createSystemPage();
|
||||||
QWidget *createExportPage();
|
QWidget *createExportPage();
|
||||||
|
|
||||||
Options *_options;
|
Options *_options;
|
||||||
|
|
||||||
|
// General
|
||||||
|
QCheckBox *_alwaysShowMap;
|
||||||
|
// Appearance
|
||||||
ColorBox *_baseColor;
|
ColorBox *_baseColor;
|
||||||
QDoubleSpinBox *_colorOffset;
|
QDoubleSpinBox *_colorOffset;
|
||||||
|
PercentSlider *_mapOpacity;
|
||||||
|
ColorBox *_backgroundColor;
|
||||||
QSpinBox *_trackWidth;
|
QSpinBox *_trackWidth;
|
||||||
StyleComboBox *_trackStyle;
|
StyleComboBox *_trackStyle;
|
||||||
QSpinBox *_routeWidth;
|
QSpinBox *_routeWidth;
|
||||||
StyleComboBox *_routeStyle;
|
StyleComboBox *_routeStyle;
|
||||||
QCheckBox *_pathAA;
|
QCheckBox *_pathAA;
|
||||||
|
QSpinBox *_waypointSize;
|
||||||
|
ColorBox *_waypointColor;
|
||||||
|
QSpinBox *_poiSize;
|
||||||
|
ColorBox *_poiColor;
|
||||||
QSpinBox *_graphWidth;
|
QSpinBox *_graphWidth;
|
||||||
|
ColorBox *_sliderColor;
|
||||||
QCheckBox *_graphAA;
|
QCheckBox *_graphAA;
|
||||||
|
// Data
|
||||||
|
OddSpinBox *_elevationFilter;
|
||||||
|
OddSpinBox *_speedFilter;
|
||||||
|
OddSpinBox *_heartRateFilter;
|
||||||
|
OddSpinBox *_cadenceFilter;
|
||||||
|
OddSpinBox *_powerFilter;
|
||||||
|
QCheckBox *_outlierEliminate;
|
||||||
|
QDoubleSpinBox *_pauseSpeed;
|
||||||
|
QSpinBox *_pauseInterval;
|
||||||
|
// POI
|
||||||
QDoubleSpinBox *_poiRadius;
|
QDoubleSpinBox *_poiRadius;
|
||||||
|
// System
|
||||||
|
QSpinBox *_pixmapCache;
|
||||||
QCheckBox *_useOpenGL;
|
QCheckBox *_useOpenGL;
|
||||||
|
// Print/Export
|
||||||
|
QRadioButton *_wysiwyg;
|
||||||
|
QRadioButton *_hires;
|
||||||
QCheckBox *_name;
|
QCheckBox *_name;
|
||||||
QCheckBox *_date;
|
QCheckBox *_date;
|
||||||
QCheckBox *_distance;
|
QCheckBox *_distance;
|
@ -41,6 +41,5 @@ QDebug operator<<(QDebug dbg, const Palette &palette)
|
|||||||
{
|
{
|
||||||
dbg.nospace() << "Palette(" << palette.color() << ", " << palette.shift()
|
dbg.nospace() << "Palette(" << palette.color() << ", " << palette.shift()
|
||||||
<< ")";
|
<< ")";
|
||||||
|
return dbg.space();
|
||||||
return dbg.maybeSpace();
|
|
||||||
}
|
}
|
@ -2,9 +2,9 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QCursor>
|
#include <QCursor>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include "map/map.h"
|
||||||
#include "tooltip.h"
|
#include "tooltip.h"
|
||||||
#include "map.h"
|
#include "nicenum.h"
|
||||||
#include "misc.h"
|
|
||||||
#include "pathitem.h"
|
#include "pathitem.h"
|
||||||
|
|
||||||
|
|
||||||
@ -12,20 +12,21 @@ PathItem::PathItem(const Path &path, Map *map, QGraphicsItem *parent)
|
|||||||
: QGraphicsObject(parent)
|
: QGraphicsObject(parent)
|
||||||
{
|
{
|
||||||
Q_ASSERT(path.count() >= 2);
|
Q_ASSERT(path.count() >= 2);
|
||||||
|
|
||||||
_path = path;
|
_path = path;
|
||||||
_map = map;
|
_map = map;
|
||||||
|
_digitalZoom = 0;
|
||||||
updatePainterPath(map);
|
|
||||||
updateShape();
|
|
||||||
|
|
||||||
_width = 3;
|
_width = 3;
|
||||||
QBrush brush(Qt::SolidPattern);
|
QBrush brush(Qt::SolidPattern);
|
||||||
_pen = QPen(brush, _width);
|
_pen = QPen(brush, _width);
|
||||||
|
|
||||||
|
updatePainterPath(map);
|
||||||
|
updateShape();
|
||||||
|
|
||||||
_marker = new MarkerItem(this);
|
_marker = new MarkerItem(this);
|
||||||
_marker->setPos(position(_path.at(0).distance()));
|
_marker->setPos(position(_path.at(0).distance()));
|
||||||
_marker->setFlag(QGraphicsItem::ItemIgnoresTransformations);
|
_markerDistance = _path.at(0).distance();
|
||||||
_md = _path.at(0).distance();
|
|
||||||
|
|
||||||
setCursor(Qt::ArrowCursor);
|
setCursor(Qt::ArrowCursor);
|
||||||
setAcceptHoverEvents(true);
|
setAcceptHoverEvents(true);
|
||||||
@ -34,7 +35,7 @@ PathItem::PathItem(const Path &path, Map *map, QGraphicsItem *parent)
|
|||||||
void PathItem::updateShape()
|
void PathItem::updateShape()
|
||||||
{
|
{
|
||||||
QPainterPathStroker s;
|
QPainterPathStroker s;
|
||||||
s.setWidth((_width + 1) * 1.0/scale());
|
s.setWidth((_width + 1) * pow(2, -_digitalZoom));
|
||||||
_shape = s.createStroke(_painterPath);
|
_shape = s.createStroke(_painterPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,37 +66,61 @@ void PathItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|||||||
|
|
||||||
void PathItem::setMap(Map *map)
|
void PathItem::setMap(Map *map)
|
||||||
{
|
{
|
||||||
_map = map;
|
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
|
|
||||||
|
_map = map;
|
||||||
|
|
||||||
updatePainterPath(map);
|
updatePainterPath(map);
|
||||||
updateShape();
|
updateShape();
|
||||||
|
|
||||||
_marker->setPos(position(_md));
|
_marker->setPos(position(_markerDistance));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathItem::setColor(const QColor &color)
|
void PathItem::setColor(const QColor &color)
|
||||||
{
|
{
|
||||||
|
if (_pen.color() == color)
|
||||||
|
return;
|
||||||
|
|
||||||
_pen.setColor(color);
|
_pen.setColor(color);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathItem::setWidth(qreal width)
|
void PathItem::setWidth(qreal width)
|
||||||
{
|
{
|
||||||
|
if (_width == width)
|
||||||
|
return;
|
||||||
|
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
|
|
||||||
_width = width;
|
_width = width;
|
||||||
_pen.setWidthF(_width * 1.0/scale());
|
_pen.setWidthF(_width * pow(2, -_digitalZoom));
|
||||||
|
|
||||||
updateShape();
|
updateShape();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathItem::setStyle(Qt::PenStyle style)
|
void PathItem::setStyle(Qt::PenStyle style)
|
||||||
{
|
{
|
||||||
|
if (_pen.style() == style)
|
||||||
|
return;
|
||||||
|
|
||||||
_pen.setStyle(style);
|
_pen.setStyle(style);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PathItem::setDigitalZoom(int zoom)
|
||||||
|
{
|
||||||
|
if (_digitalZoom == zoom)
|
||||||
|
return;
|
||||||
|
|
||||||
|
prepareGeometryChange();
|
||||||
|
|
||||||
|
_digitalZoom = zoom;
|
||||||
|
_pen.setWidthF(_width * pow(2, -_digitalZoom));
|
||||||
|
_marker->setScale(pow(2, -_digitalZoom));
|
||||||
|
|
||||||
|
updateShape();
|
||||||
|
}
|
||||||
|
|
||||||
QPointF PathItem::position(qreal x) const
|
QPointF PathItem::position(qreal x) const
|
||||||
{
|
{
|
||||||
int low = 0;
|
int low = 0;
|
||||||
@ -137,16 +162,34 @@ void PathItem::moveMarker(qreal distance)
|
|||||||
&& distance <= _path.last().distance()) {
|
&& distance <= _path.last().distance()) {
|
||||||
_marker->setVisible(true);
|
_marker->setVisible(true);
|
||||||
_marker->setPos(position(distance));
|
_marker->setPos(position(distance));
|
||||||
_md = distance;
|
_markerDistance = distance;
|
||||||
} else
|
} else
|
||||||
_marker->setVisible(false);
|
_marker->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PathItem::setMarkerColor(const QColor &color)
|
||||||
|
{
|
||||||
|
_marker->setColor(color);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PathItem::hover(bool hover)
|
||||||
|
{
|
||||||
|
if (hover) {
|
||||||
|
_pen.setWidth(_width + 1);
|
||||||
|
setZValue(zValue() + 1.0);
|
||||||
|
} else {
|
||||||
|
_pen.setWidth(_width);
|
||||||
|
setZValue(zValue() - 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
void PathItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
void PathItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||||
{
|
{
|
||||||
Q_UNUSED(event);
|
Q_UNUSED(event);
|
||||||
|
|
||||||
_pen.setWidthF((_width + 1) * 1.0/scale());
|
_pen.setWidthF((_width + 1) * pow(2, -_digitalZoom));
|
||||||
setZValue(zValue() + 1.0);
|
setZValue(zValue() + 1.0);
|
||||||
update();
|
update();
|
||||||
|
|
||||||
@ -157,7 +200,7 @@ void PathItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
|||||||
{
|
{
|
||||||
Q_UNUSED(event);
|
Q_UNUSED(event);
|
||||||
|
|
||||||
_pen.setWidthF(_width * 1.0/scale());
|
_pen.setWidthF(_width * pow(2, -_digitalZoom));
|
||||||
setZValue(zValue() - 1.0);
|
setZValue(zValue() - 1.0);
|
||||||
update();
|
update();
|
||||||
|
|
@ -3,9 +3,8 @@
|
|||||||
|
|
||||||
#include <QGraphicsObject>
|
#include <QGraphicsObject>
|
||||||
#include <QPen>
|
#include <QPen>
|
||||||
|
#include "data/path.h"
|
||||||
#include "markeritem.h"
|
#include "markeritem.h"
|
||||||
#include "path.h"
|
|
||||||
|
|
||||||
|
|
||||||
class Map;
|
class Map;
|
||||||
|
|
||||||
@ -28,11 +27,12 @@ public:
|
|||||||
void setColor(const QColor &color);
|
void setColor(const QColor &color);
|
||||||
void setWidth(qreal width);
|
void setWidth(qreal width);
|
||||||
void setStyle(Qt::PenStyle style);
|
void setStyle(Qt::PenStyle style);
|
||||||
|
void setDigitalZoom(int zoom);
|
||||||
void showMarker(bool show) {_marker->setVisible(show);}
|
void setMarkerColor(const QColor &color);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void moveMarker(qreal distance);
|
void moveMarker(qreal distance);
|
||||||
|
void hover(bool hover);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void selected(bool);
|
void selected(bool);
|
||||||
@ -50,7 +50,8 @@ private:
|
|||||||
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
||||||
|
|
||||||
Map *_map;
|
Map *_map;
|
||||||
qreal _md;
|
qreal _markerDistance;
|
||||||
|
int _digitalZoom;
|
||||||
|
|
||||||
qreal _width;
|
qreal _width;
|
||||||
QPen _pen;
|
QPen _pen;
|
48
src/GUI/percentslider.cpp
Normal file
48
src/GUI/percentslider.cpp
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
#include <QSlider>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include "units.h"
|
||||||
|
#include "percentslider.h"
|
||||||
|
|
||||||
|
|
||||||
|
static QString format(int value)
|
||||||
|
{
|
||||||
|
return QString::number(value) + UNIT_SPACE + QString("%");
|
||||||
|
}
|
||||||
|
|
||||||
|
PercentSlider::PercentSlider(QWidget *parent) : QWidget(parent)
|
||||||
|
{
|
||||||
|
_slider = new QSlider(Qt::Horizontal);
|
||||||
|
_label = new QLabel();
|
||||||
|
|
||||||
|
_slider->setMinimum(0);
|
||||||
|
_slider->setMaximum(100);
|
||||||
|
|
||||||
|
QFontMetrics fm(_label->font());
|
||||||
|
_label->setFixedWidth(fm.boundingRect(format(_slider->maximum())).width());
|
||||||
|
_label->setAlignment(Qt::AlignRight);
|
||||||
|
|
||||||
|
connect(_slider, SIGNAL(sliderMoved(int)), this, SLOT(updateLabel(int)));
|
||||||
|
|
||||||
|
QHBoxLayout *layout = new QHBoxLayout();
|
||||||
|
layout->addWidget(_slider);
|
||||||
|
layout->addWidget(_label);
|
||||||
|
|
||||||
|
setLayout(layout);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PercentSlider::updateLabel(int value)
|
||||||
|
{
|
||||||
|
_label->setText(format(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
int PercentSlider::value() const
|
||||||
|
{
|
||||||
|
return _slider->value();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PercentSlider::setValue(int value)
|
||||||
|
{
|
||||||
|
_slider->setValue(value);
|
||||||
|
_label->setText(format(value));
|
||||||
|
}
|
29
src/GUI/percentslider.h
Normal file
29
src/GUI/percentslider.h
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#ifndef PERCENTSLIDER_H
|
||||||
|
#define PERCENTSLIDER_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
class QSlider;
|
||||||
|
class QLabel;
|
||||||
|
|
||||||
|
class PercentSlider : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
PercentSlider(QWidget *parent = 0);
|
||||||
|
|
||||||
|
int value() const;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void setValue(int value);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void updateLabel(int value);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QSlider *_slider;
|
||||||
|
QLabel *_label;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // PERCENTSLIDER_H
|
@ -1,10 +1,10 @@
|
|||||||
#include "data.h"
|
#include "data/data.h"
|
||||||
|
#include "powergraphitem.h"
|
||||||
#include "powergraph.h"
|
#include "powergraph.h"
|
||||||
|
|
||||||
|
|
||||||
PowerGraph::PowerGraph(QWidget *parent) : GraphTab(parent)
|
PowerGraph::PowerGraph(QWidget *parent) : GraphTab(parent)
|
||||||
{
|
{
|
||||||
_units = Metric;
|
|
||||||
_showTracks = true;
|
_showTracks = true;
|
||||||
|
|
||||||
GraphView::setYUnits(tr("W"));
|
GraphView::setYUnits(tr("W"));
|
||||||
@ -28,21 +28,16 @@ void PowerGraph::loadData(const Data &data, const QList<PathItem *> &paths)
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < data.tracks().count(); i++) {
|
for (int i = 0; i < data.tracks().count(); i++) {
|
||||||
const Graph &graph = data.tracks().at(i)->power();
|
const Graph &graph = data.tracks().at(i)->power();
|
||||||
qreal sum = 0, w = 0;
|
|
||||||
|
|
||||||
if (graph.size() < 2) {
|
if (graph.size() < 2) {
|
||||||
skipColor();
|
skipColor();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int j = 1; j < graph.size(); j++) {
|
PowerGraphItem *gi = new PowerGraphItem(graph, _graphType);
|
||||||
qreal ds = graph.at(j).s() - graph.at(j-1).s();
|
GraphView::addGraph(gi, paths.at(i));
|
||||||
sum += graph.at(j).y() * ds;
|
|
||||||
w += ds;
|
|
||||||
}
|
|
||||||
_avg.append(QPointF(data.tracks().at(i)->distance(), sum/w));
|
|
||||||
|
|
||||||
GraphView::loadGraph(graph, paths.at(i));
|
_avg.append(QPointF(data.tracks().at(i)->distance(), gi->avg()));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < data.routes().count(); i++)
|
for (int i = 0; i < data.routes().count(); i++)
|
@ -22,7 +22,6 @@ private:
|
|||||||
|
|
||||||
QList<QPointF> _avg;
|
QList<QPointF> _avg;
|
||||||
|
|
||||||
enum Units _units;
|
|
||||||
bool _showTracks;
|
bool _showTracks;
|
||||||
};
|
};
|
||||||
|
|
26
src/GUI/powergraphitem.cpp
Normal file
26
src/GUI/powergraphitem.cpp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#include "tooltip.h"
|
||||||
|
#include "powergraphitem.h"
|
||||||
|
|
||||||
|
PowerGraphItem::PowerGraphItem(const Graph &graph, GraphType type,
|
||||||
|
QGraphicsItem *parent) : GraphItem(graph, type, parent)
|
||||||
|
{
|
||||||
|
qreal sum = 0;
|
||||||
|
|
||||||
|
for (int j = 1; j < graph.size(); j++)
|
||||||
|
sum += graph.at(j).y() * (graph.at(j).s() - graph.at(j-1).s());
|
||||||
|
_avg = sum/graph.last().s();
|
||||||
|
|
||||||
|
setToolTip(toolTip());
|
||||||
|
}
|
||||||
|
|
||||||
|
QString PowerGraphItem::toolTip() const
|
||||||
|
{
|
||||||
|
ToolTip tt;
|
||||||
|
|
||||||
|
tt.insert(tr("Maximum"), QString::number(max(), 'f', 1)
|
||||||
|
+ UNIT_SPACE + tr("1/min"));
|
||||||
|
tt.insert(tr("Average"), QString::number(avg(), 'f', 1)
|
||||||
|
+ UNIT_SPACE + tr("1/min"));
|
||||||
|
|
||||||
|
return tt.toString();
|
||||||
|
}
|
23
src/GUI/powergraphitem.h
Normal file
23
src/GUI/powergraphitem.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#ifndef POWERGRAPHITEM_H
|
||||||
|
#define POWERGRAPHITEM_H
|
||||||
|
|
||||||
|
#include "graphitem.h"
|
||||||
|
|
||||||
|
class PowerGraphItem : public GraphItem
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
PowerGraphItem(const Graph &graph, GraphType type,
|
||||||
|
QGraphicsItem *parent = 0);
|
||||||
|
|
||||||
|
qreal max() const {return -bounds().top();}
|
||||||
|
qreal avg() const {return _avg;}
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString toolTip() const;
|
||||||
|
|
||||||
|
qreal _avg;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // POWERGRAPHITEM_H
|
@ -1,13 +1,13 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include "data/waypoint.h"
|
||||||
|
#include "map/map.h"
|
||||||
#include "format.h"
|
#include "format.h"
|
||||||
#include "waypoint.h"
|
|
||||||
#include "waypointitem.h"
|
#include "waypointitem.h"
|
||||||
#include "tooltip.h"
|
#include "tooltip.h"
|
||||||
#include "map.h"
|
|
||||||
#include "routeitem.h"
|
#include "routeitem.h"
|
||||||
|
|
||||||
|
|
||||||
QString RouteItem::toolTip(Units units)
|
QString RouteItem::toolTip(Units units) const
|
||||||
{
|
{
|
||||||
ToolTip tt;
|
ToolTip tt;
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
#ifndef ROUTEITEM_H
|
#ifndef ROUTEITEM_H
|
||||||
#define ROUTEITEM_H
|
#define ROUTEITEM_H
|
||||||
|
|
||||||
|
#include "data/route.h"
|
||||||
#include "pathitem.h"
|
#include "pathitem.h"
|
||||||
#include "route.h"
|
|
||||||
#include "units.h"
|
#include "units.h"
|
||||||
|
|
||||||
class Map;
|
class Map;
|
||||||
@ -14,7 +14,6 @@ class RouteItem : public PathItem
|
|||||||
public:
|
public:
|
||||||
RouteItem(const Route &route, Map *map, QGraphicsItem *parent = 0);
|
RouteItem(const Route &route, Map *map, QGraphicsItem *parent = 0);
|
||||||
|
|
||||||
//void setScale(qreal scale);
|
|
||||||
void setMap(Map *map);
|
void setMap(Map *map);
|
||||||
|
|
||||||
void setUnits(Units units);
|
void setUnits(Units units);
|
||||||
@ -22,7 +21,7 @@ public:
|
|||||||
void showWaypointLabels(bool show);
|
void showWaypointLabels(bool show);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString toolTip(Units units);
|
QString toolTip(Units units) const;
|
||||||
|
|
||||||
QString _name;
|
QString _name;
|
||||||
QString _desc;
|
QString _desc;
|
@ -1,6 +1,7 @@
|
|||||||
|
#include <cmath>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "misc.h"
|
#include "nicenum.h"
|
||||||
#include "scaleitem.h"
|
#include "scaleitem.h"
|
||||||
|
|
||||||
|
|
||||||
@ -15,6 +16,7 @@ ScaleItem::ScaleItem(QGraphicsItem *parent) : QGraphicsItem(parent)
|
|||||||
{
|
{
|
||||||
_units = Metric;
|
_units = Metric;
|
||||||
_res = 1.0;
|
_res = 1.0;
|
||||||
|
_digitalZoom = 0;
|
||||||
|
|
||||||
#ifndef Q_OS_MAC
|
#ifndef Q_OS_MAC
|
||||||
setCacheMode(QGraphicsItem::DeviceCoordinateCache);
|
setCacheMode(QGraphicsItem::DeviceCoordinateCache);
|
||||||
@ -87,24 +89,26 @@ QString ScaleItem::units() const
|
|||||||
|
|
||||||
void ScaleItem::computeScale()
|
void ScaleItem::computeScale()
|
||||||
{
|
{
|
||||||
|
qreal res = _res * pow(2, -_digitalZoom);
|
||||||
|
|
||||||
if (_units == Imperial) {
|
if (_units == Imperial) {
|
||||||
_length = niceNum((_res * M2FT * SCALE_WIDTH) / SEGMENTS, 1);
|
_length = niceNum((res * M2FT * SCALE_WIDTH) / SEGMENTS, 1);
|
||||||
if (_length >= MIINFT) {
|
if (_length >= MIINFT) {
|
||||||
_length = niceNum((_res * M2FT * FT2MI * SCALE_WIDTH) / SEGMENTS, 1);
|
_length = niceNum((res * M2FT * FT2MI * SCALE_WIDTH) / SEGMENTS, 1);
|
||||||
_width = (_length / (_res * M2FT * FT2MI));
|
_width = (_length / (res * M2FT * FT2MI));
|
||||||
_scale = true;
|
_scale = true;
|
||||||
} else {
|
} else {
|
||||||
_width = (_length / (_res * M2FT));
|
_width = (_length / (res * M2FT));
|
||||||
_scale = false;
|
_scale = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_length = niceNum((_res * SCALE_WIDTH) / SEGMENTS, 1);
|
_length = niceNum((res * SCALE_WIDTH) / SEGMENTS, 1);
|
||||||
if (_length >= KMINM) {
|
if (_length >= KMINM) {
|
||||||
_length *= M2KM;
|
_length *= M2KM;
|
||||||
_width = (_length / (_res * M2KM));
|
_width = (_length / (res * M2KM));
|
||||||
_scale = true;
|
_scale = true;
|
||||||
} else {
|
} else {
|
||||||
_width = (_length / _res);
|
_width = (_length / res);
|
||||||
_scale = false;
|
_scale = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -127,3 +131,14 @@ void ScaleItem::setUnits(enum Units units)
|
|||||||
updateBoundingRect();
|
updateBoundingRect();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScaleItem::setDigitalZoom(qreal zoom)
|
||||||
|
{
|
||||||
|
prepareGeometryChange();
|
||||||
|
_digitalZoom = zoom;
|
||||||
|
computeScale();
|
||||||
|
updateBoundingRect();
|
||||||
|
update();
|
||||||
|
|
||||||
|
setScale(pow(2, -_digitalZoom));
|
||||||
|
}
|
@ -15,6 +15,7 @@ public:
|
|||||||
|
|
||||||
void setResolution(qreal res);
|
void setResolution(qreal res);
|
||||||
void setUnits(enum Units units);
|
void setUnits(enum Units units);
|
||||||
|
void setDigitalZoom(qreal zoom);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateBoundingRect();
|
void updateBoundingRect();
|
||||||
@ -27,6 +28,8 @@ private:
|
|||||||
Units _units;
|
Units _units;
|
||||||
bool _scale;
|
bool _scale;
|
||||||
|
|
||||||
|
qreal _digitalZoom;
|
||||||
|
|
||||||
QRectF _boundingRect;
|
QRectF _boundingRect;
|
||||||
};
|
};
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user