Compare commits
99 Commits
Author | SHA1 | Date | |
---|---|---|---|
494a8a6da1 | |||
47206316b7 | |||
fe69280cc5 | |||
ff3c0aafa1 | |||
2fb2beecda | |||
432ca35df9 | |||
301172f5e8 | |||
20956625db | |||
273fe51dcd | |||
e4098e6dfb | |||
747acf1580 | |||
738b49668c | |||
48674bb50b | |||
6d054c76f9 | |||
40578d0dee | |||
a16354a6ba | |||
44862cebcc | |||
ef5cfde22b | |||
019bd4de10 | |||
9c6ffed35e | |||
d7a55b3f9c | |||
a9327d2cca | |||
c059cbb848 | |||
3b3559eacf | |||
f071e88bd0 | |||
8bec307e03 | |||
3204723614 | |||
c688b5fc09 | |||
94bca87982 | |||
3f97d12a76 | |||
ab7aa63a33 | |||
4de22d6679 | |||
c58a52e362 | |||
5b2af9fc9c | |||
4eb54ed8f2 | |||
681c83d017 | |||
dbd8750524 | |||
d9489935df | |||
f5d2ccfdb9 | |||
1afd59902b | |||
a253147760 | |||
667a1c350d | |||
d7a9464e37 | |||
d1be147f64 | |||
98708f11ac | |||
c5605eeab1 | |||
f29ac69594 | |||
49101cba6c | |||
c1f746b32a | |||
704be7baf9 | |||
3c6ec704ab | |||
bf6b6fb100 | |||
56a2618f29 | |||
785bf94a01 | |||
3747ae6afc | |||
1f5a051bee | |||
268c42ab03 | |||
8a8595d98e | |||
37c971a720 | |||
f0d71d667b | |||
f652457f19 | |||
1acf603076 | |||
86f5da9355 | |||
3587d29cb6 | |||
beb93bcd1f | |||
dd911a95b0 | |||
1fc644e1d6 | |||
dc628c9554 | |||
ec3eccd580 | |||
a3d22dcd2a | |||
c13d7ae51d | |||
e4085cc25a | |||
8a13355740 | |||
8f799e1bcf | |||
5cd0a3a8b0 | |||
283197612b | |||
2d0ac129ce | |||
499869119a | |||
fdcc431a4e | |||
38a4a4c32b | |||
6efd8e7fd1 | |||
5b3c448582 | |||
054ae32689 | |||
0594774570 | |||
e11d6d280d | |||
897de9920e | |||
82923a4529 | |||
4daa9fd55c | |||
3270625172 | |||
d70c4fefd5 | |||
c364121288 | |||
62eb5a09ae | |||
d0438b3ee8 | |||
5b83f1b86b | |||
241ecb36f2 | |||
f5b9f6e392 | |||
d04775d58e | |||
68644aa25d | |||
acbf72a983 |
@ -1,4 +1,4 @@
|
|||||||
version: 7.5.{build}
|
version: 7.8.{build}
|
||||||
configuration: Release
|
configuration: Release
|
||||||
platform: Any CPU
|
platform: Any CPU
|
||||||
environment:
|
environment:
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
GPXSee is a Qt-based GPS log file viewer and analyzer that supports all common GPS log file formats.
|
GPXSee is a Qt-based GPS log file viewer and analyzer that supports all common GPS log file formats.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
* Opens GPX, TCX, FIT, KML, IGC, NMEA, SLF, LOC, GeoJSON, OziExplorer (PLT, RTE, WPT) and Garmin CSV files.
|
* Opens GPX, TCX, FIT, KML, IGC, NMEA, SLF, LOC, GeoJSON, OziExplorer (PLT, RTE, WPT), Garmin CSV and geotagged JPEG files.
|
||||||
* User-definable online maps (OpenStreetMap/Google tiles, WMTS, WMS, TMS).
|
* User-definable online maps (OpenStreetMap/Google tiles, WMTS, WMS, TMS).
|
||||||
* Offline maps (MBTiles, OziExplorer maps, TrekBuddy maps/atlases, Garmin JNX maps, TwoNav RMaps, GeoTIFF images).
|
* Offline maps (MBTiles, OziExplorer maps, TrekBuddy maps/atlases, Garmin IMG & JNX maps, TwoNav RMaps, GeoTIFF images).
|
||||||
* Elevation, speed, heart rate, cadence, power, temperature and gear ratio/shifts graphs.
|
* Elevation, speed, heart rate, cadence, power, temperature and gear ratio/shifts graphs.
|
||||||
* Support for DEM files (SRTM HGT).
|
* Support for DEM files (SRTM HGT).
|
||||||
* Support for multiple tracks in one view.
|
* Support for multiple tracks in one view.
|
||||||
|
36
gpxsee.pro
@ -3,7 +3,7 @@ unix:!macx {
|
|||||||
} else {
|
} else {
|
||||||
TARGET = GPXSee
|
TARGET = GPXSee
|
||||||
}
|
}
|
||||||
VERSION = 7.5
|
VERSION = 7.8
|
||||||
|
|
||||||
QT += core \
|
QT += core \
|
||||||
gui \
|
gui \
|
||||||
@ -84,6 +84,9 @@ HEADERS += src/common/config.h \
|
|||||||
src/GUI/mapview.h \
|
src/GUI/mapview.h \
|
||||||
src/GUI/font.h \
|
src/GUI/font.h \
|
||||||
src/GUI/areaitem.h \
|
src/GUI/areaitem.h \
|
||||||
|
src/map/IMG/bitmapline.h \
|
||||||
|
src/map/IMG/textpathitem.h \
|
||||||
|
src/map/IMG/textpointitem.h \
|
||||||
src/map/projection.h \
|
src/map/projection.h \
|
||||||
src/map/ellipsoid.h \
|
src/map/ellipsoid.h \
|
||||||
src/map/datum.h \
|
src/map/datum.h \
|
||||||
@ -163,7 +166,20 @@ HEADERS += src/common/config.h \
|
|||||||
src/map/calibrationpoint.h \
|
src/map/calibrationpoint.h \
|
||||||
src/map/color.h \
|
src/map/color.h \
|
||||||
src/data/exifparser.h \
|
src/data/exifparser.h \
|
||||||
src/data/imageinfo.h
|
src/data/imageinfo.h \
|
||||||
|
src/map/imgmap.h \
|
||||||
|
src/map/IMG/img.h \
|
||||||
|
src/map/IMG/subfile.h \
|
||||||
|
src/map/IMG/trefile.h \
|
||||||
|
src/map/IMG/rgnfile.h \
|
||||||
|
src/map/IMG/lblfile.h \
|
||||||
|
src/map/IMG/vectortile.h \
|
||||||
|
src/map/IMG/subdiv.h \
|
||||||
|
src/map/IMG/units.h \
|
||||||
|
src/map/IMG/style.h \
|
||||||
|
src/map/IMG/netfile.h \
|
||||||
|
src/GUI/limitedcombobox.h \
|
||||||
|
src/GUI/pathtickitem.h
|
||||||
SOURCES += src/main.cpp \
|
SOURCES += src/main.cpp \
|
||||||
src/common/coordinates.cpp \
|
src/common/coordinates.cpp \
|
||||||
src/common/rectc.cpp \
|
src/common/rectc.cpp \
|
||||||
@ -215,6 +231,9 @@ SOURCES += src/main.cpp \
|
|||||||
src/GUI/gearratiographitem.cpp \
|
src/GUI/gearratiographitem.cpp \
|
||||||
src/GUI/mapview.cpp \
|
src/GUI/mapview.cpp \
|
||||||
src/GUI/areaitem.cpp \
|
src/GUI/areaitem.cpp \
|
||||||
|
src/map/IMG/bitmapline.cpp \
|
||||||
|
src/map/IMG/textpathitem.cpp \
|
||||||
|
src/map/IMG/textpointitem.cpp \
|
||||||
src/map/maplist.cpp \
|
src/map/maplist.cpp \
|
||||||
src/map/onlinemap.cpp \
|
src/map/onlinemap.cpp \
|
||||||
src/map/downloader.cpp \
|
src/map/downloader.cpp \
|
||||||
@ -280,7 +299,17 @@ SOURCES += src/main.cpp \
|
|||||||
src/map/obliquestereographic.cpp \
|
src/map/obliquestereographic.cpp \
|
||||||
src/GUI/coordinatesitem.cpp \
|
src/GUI/coordinatesitem.cpp \
|
||||||
src/map/rmap.cpp \
|
src/map/rmap.cpp \
|
||||||
src/data/exifparser.cpp
|
src/data/exifparser.cpp \
|
||||||
|
src/map/imgmap.cpp \
|
||||||
|
src/map/IMG/img.cpp \
|
||||||
|
src/map/IMG/subfile.cpp \
|
||||||
|
src/map/IMG/trefile.cpp \
|
||||||
|
src/map/IMG/rgnfile.cpp \
|
||||||
|
src/map/IMG/lblfile.cpp \
|
||||||
|
src/map/IMG/vectortile.cpp \
|
||||||
|
src/map/IMG/style.cpp \
|
||||||
|
src/map/IMG/netfile.cpp \
|
||||||
|
src/GUI/pathtickitem.cpp
|
||||||
|
|
||||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||||
HEADERS += src/data/geojsonparser.h
|
HEADERS += src/data/geojsonparser.h
|
||||||
@ -362,6 +391,7 @@ win32 {
|
|||||||
|
|
||||||
unix:!macx {
|
unix:!macx {
|
||||||
isEmpty(PREFIX):PREFIX = /usr/local
|
isEmpty(PREFIX):PREFIX = /usr/local
|
||||||
|
DEFINES += PREFIX=\\\"$$PREFIX\\\"
|
||||||
|
|
||||||
maps.files = pkg/maps/*
|
maps.files = pkg/maps/*
|
||||||
maps.path = $$PREFIX/share/gpxsee/maps
|
maps.path = $$PREFIX/share/gpxsee/maps
|
||||||
|
84
gpxsee.qrc
@ -1,46 +1,46 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>icons/dialog-close.png</file>
|
<file alias="gpxsee.png">icons/gpxsee.png</file>
|
||||||
<file>icons/dialog-close@2x.png</file>
|
<file alias="gpxsee@2x.png">icons/gpxsee@2x.png</file>
|
||||||
<file>icons/document-open.png</file>
|
<file alias="dialog-close.png">icons/GUI/dialog-close.png</file>
|
||||||
<file>icons/document-open@2x.png</file>
|
<file alias="dialog-close@2x.png">icons/GUI/dialog-close@2x.png</file>
|
||||||
<file>icons/document-print.png</file>
|
<file alias="document-open.png">icons/GUI/document-open.png</file>
|
||||||
<file>icons/document-print@2x.png</file>
|
<file alias="document-open@2x.png">icons/GUI/document-open@2x.png</file>
|
||||||
<file>icons/document-export.png</file>
|
<file alias="document-print.png">icons/GUI/document-print.png</file>
|
||||||
<file>icons/document-export@2x.png</file>
|
<file alias="document-print@2x.png">icons/GUI/document-print@2x.png</file>
|
||||||
<file>icons/flag.png</file>
|
<file alias="document-export.png">icons/GUI/document-export.png</file>
|
||||||
<file>icons/flag@2x.png</file>
|
<file alias="document-export@2x.png">icons/GUI/document-export@2x.png</file>
|
||||||
<file>icons/gpxsee.png</file>
|
<file alias="flag.png">icons/GUI/flag.png</file>
|
||||||
<file>icons/gpxsee@2x.png</file>
|
<file alias="flag@2x.png">icons/GUI/flag@2x.png</file>
|
||||||
<file>icons/application-exit.png</file>
|
<file alias="application-exit.png">icons/GUI/application-exit.png</file>
|
||||||
<file>icons/application-exit@2x.png</file>
|
<file alias="application-exit@2x.png">icons/GUI/application-exit@2x.png</file>
|
||||||
<file>icons/applications-internet.png</file>
|
<file alias="applications-internet.png">icons/GUI/applications-internet.png</file>
|
||||||
<file>icons/applications-internet@2x.png</file>
|
<file alias="applications-internet@2x.png">icons/GUI/applications-internet@2x.png</file>
|
||||||
<file>icons/view-refresh.png</file>
|
<file alias="view-refresh.png">icons/GUI/view-refresh.png</file>
|
||||||
<file>icons/view-refresh@2x.png</file>
|
<file alias="view-refresh@2x.png">icons/GUI/view-refresh@2x.png</file>
|
||||||
<file>icons/arrow-left.png</file>
|
<file alias="arrow-left.png">icons/GUI/arrow-left.png</file>
|
||||||
<file>icons/arrow-left@2x.png</file>
|
<file alias="arrow-left@2x.png">icons/GUI/arrow-left@2x.png</file>
|
||||||
<file>icons/arrow-right.png</file>
|
<file alias="arrow-right.png">icons/GUI/arrow-right.png</file>
|
||||||
<file>icons/arrow-right@2x.png</file>
|
<file alias="arrow-right@2x.png">icons/GUI/arrow-right@2x.png</file>
|
||||||
<file>icons/arrow-left-double.png</file>
|
<file alias="arrow-left-double.png">icons/GUI/arrow-left-double.png</file>
|
||||||
<file>icons/arrow-left-double@2x.png</file>
|
<file alias="arrow-left-double@2x.png">icons/GUI/arrow-left-double@2x.png</file>
|
||||||
<file>icons/arrow-right-double.png</file>
|
<file alias="arrow-right-double.png">icons/GUI/arrow-right-double.png</file>
|
||||||
<file>icons/arrow-right-double@2x.png</file>
|
<file alias="arrow-right-double@2x.png">icons/GUI/arrow-right-double@2x.png</file>
|
||||||
<file>icons/view-fullscreen.png</file>
|
<file alias="view-fullscreen.png">icons/GUI/view-fullscreen.png</file>
|
||||||
<file>icons/view-fullscreen@2x.png</file>
|
<file alias="view-fullscreen@2x.png">icons/GUI/view-fullscreen@2x.png</file>
|
||||||
<file>icons/office-chart-line.png</file>
|
<file alias="office-chart-line.png">icons/GUI/office-chart-line.png</file>
|
||||||
<file>icons/office-chart-line@2x.png</file>
|
<file alias="office-chart-line@2x.png">icons/GUI/office-chart-line@2x.png</file>
|
||||||
<file>icons/format-stroke-color.png</file>
|
<file alias="format-stroke-color.png">icons/GUI/format-stroke-color.png</file>
|
||||||
<file>icons/format-stroke-color@2x.png</file>
|
<file alias="format-stroke-color@2x.png">icons/GUI/format-stroke-color@2x.png</file>
|
||||||
<file>icons/flag_32.png</file>
|
<file alias="flag_32.png">icons/GUI/flag_32.png</file>
|
||||||
<file>icons/flag_32@2x.png</file>
|
<file alias="flag_32@2x.png">icons/GUI/flag_32@2x.png</file>
|
||||||
<file>icons/preferences-system.png</file>
|
<file alias="preferences-system.png">icons/GUI/preferences-system.png</file>
|
||||||
<file>icons/preferences-system@2x.png</file>
|
<file alias="preferences-system@2x.png">icons/GUI/preferences-system@2x.png</file>
|
||||||
<file>icons/document-print_32.png</file>
|
<file alias="document-print_32.png">icons/GUI/document-print_32.png</file>
|
||||||
<file>icons/document-print_32@2x.png</file>
|
<file alias="document-print_32@2x.png">icons/GUI/document-print_32@2x.png</file>
|
||||||
<file>icons/view-filter.png</file>
|
<file alias="view-filter.png">icons/GUI/view-filter.png</file>
|
||||||
<file>icons/view-filter@2x.png</file>
|
<file alias="view-filter@2x.png">icons/GUI/view-filter@2x.png</file>
|
||||||
<file>icons/applications-internet_32.png</file>
|
<file alias="applications-internet_32.png">icons/GUI/applications-internet_32.png</file>
|
||||||
<file>icons/applications-internet_32@2x.png</file>
|
<file alias="applications-internet_32@2x.png">icons/GUI/applications-internet_32@2x.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 926 B After Width: | Height: | Size: 926 B |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 707 B After Width: | Height: | Size: 707 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 924 B After Width: | Height: | Size: 924 B |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 682 B After Width: | Height: | Size: 682 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 865 B After Width: | Height: | Size: 865 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 880 B After Width: | Height: | Size: 880 B |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
169
icons/GUI/licence.txt
Normal file
@ -0,0 +1,169 @@
|
|||||||
|
The GUI icons are Oxygen icons from the KDE project (http://www.kde.org)
|
||||||
|
licensed under LGPLv3.
|
||||||
|
|
||||||
|
-----
|
||||||
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
|
||||||
|
This version of the GNU Lesser General Public License incorporates
|
||||||
|
the terms and conditions of version 3 of the GNU General Public
|
||||||
|
License, supplemented by the additional permissions listed below.
|
||||||
|
|
||||||
|
0. Additional Definitions.
|
||||||
|
|
||||||
|
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||||
|
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||||
|
General Public License.
|
||||||
|
|
||||||
|
"The Library" refers to a covered work governed by this License,
|
||||||
|
other than an Application or a Combined Work as defined below.
|
||||||
|
|
||||||
|
An "Application" is any work that makes use of an interface provided
|
||||||
|
by the Library, but which is not otherwise based on the Library.
|
||||||
|
Defining a subclass of a class defined by the Library is deemed a mode
|
||||||
|
of using an interface provided by the Library.
|
||||||
|
|
||||||
|
A "Combined Work" is a work produced by combining or linking an
|
||||||
|
Application with the Library. The particular version of the Library
|
||||||
|
with which the Combined Work was made is also called the "Linked
|
||||||
|
Version".
|
||||||
|
|
||||||
|
The "Minimal Corresponding Source" for a Combined Work means the
|
||||||
|
Corresponding Source for the Combined Work, excluding any source code
|
||||||
|
for portions of the Combined Work that, considered in isolation, are
|
||||||
|
based on the Application, and not on the Linked Version.
|
||||||
|
|
||||||
|
The "Corresponding Application Code" for a Combined Work means the
|
||||||
|
object code and/or source code for the Application, including any data
|
||||||
|
and utility programs needed for reproducing the Combined Work from the
|
||||||
|
Application, but excluding the System Libraries of the Combined Work.
|
||||||
|
|
||||||
|
1. Exception to Section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
You may convey a covered work under sections 3 and 4 of this License
|
||||||
|
without being bound by section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
2. Conveying Modified Versions.
|
||||||
|
|
||||||
|
If you modify a copy of the Library, and, in your modifications, a
|
||||||
|
facility refers to a function or data to be supplied by an Application
|
||||||
|
that uses the facility (other than as an argument passed when the
|
||||||
|
facility is invoked), then you may convey a copy of the modified
|
||||||
|
version:
|
||||||
|
|
||||||
|
a) under this License, provided that you make a good faith effort to
|
||||||
|
ensure that, in the event an Application does not supply the
|
||||||
|
function or data, the facility still operates, and performs
|
||||||
|
whatever part of its purpose remains meaningful, or
|
||||||
|
|
||||||
|
b) under the GNU GPL, with none of the additional permissions of
|
||||||
|
this License applicable to that copy.
|
||||||
|
|
||||||
|
3. Object Code Incorporating Material from Library Header Files.
|
||||||
|
|
||||||
|
The object code form of an Application may incorporate material from
|
||||||
|
a header file that is part of the Library. You may convey such object
|
||||||
|
code under terms of your choice, provided that, if the incorporated
|
||||||
|
material is not limited to numerical parameters, data structure
|
||||||
|
layouts and accessors, or small macros, inline functions and templates
|
||||||
|
(ten or fewer lines in length), you do both of the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the object code that the
|
||||||
|
Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
4. Combined Works.
|
||||||
|
|
||||||
|
You may convey a Combined Work under terms of your choice that,
|
||||||
|
taken together, effectively do not restrict modification of the
|
||||||
|
portions of the Library contained in the Combined Work and reverse
|
||||||
|
engineering for debugging such modifications, if you also do each of
|
||||||
|
the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the Combined Work that
|
||||||
|
the Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
c) For a Combined Work that displays copyright notices during
|
||||||
|
execution, include the copyright notice for the Library among
|
||||||
|
these notices, as well as a reference directing the user to the
|
||||||
|
copies of the GNU GPL and this license document.
|
||||||
|
|
||||||
|
d) Do one of the following:
|
||||||
|
|
||||||
|
0) Convey the Minimal Corresponding Source under the terms of this
|
||||||
|
License, and the Corresponding Application Code in a form
|
||||||
|
suitable for, and under terms that permit, the user to
|
||||||
|
recombine or relink the Application with a modified version of
|
||||||
|
the Linked Version to produce a modified Combined Work, in the
|
||||||
|
manner specified by section 6 of the GNU GPL for conveying
|
||||||
|
Corresponding Source.
|
||||||
|
|
||||||
|
1) Use a suitable shared library mechanism for linking with the
|
||||||
|
Library. A suitable mechanism is one that (a) uses at run time
|
||||||
|
a copy of the Library already present on the user's computer
|
||||||
|
system, and (b) will operate properly with a modified version
|
||||||
|
of the Library that is interface-compatible with the Linked
|
||||||
|
Version.
|
||||||
|
|
||||||
|
e) Provide Installation Information, but only if you would otherwise
|
||||||
|
be required to provide such information under section 6 of the
|
||||||
|
GNU GPL, and only to the extent that such information is
|
||||||
|
necessary to install and execute a modified version of the
|
||||||
|
Combined Work produced by recombining or relinking the
|
||||||
|
Application with a modified version of the Linked Version. (If
|
||||||
|
you use option 4d0, the Installation Information must accompany
|
||||||
|
the Minimal Corresponding Source and Corresponding Application
|
||||||
|
Code. If you use option 4d1, you must provide the Installation
|
||||||
|
Information in the manner specified by section 6 of the GNU GPL
|
||||||
|
for conveying Corresponding Source.)
|
||||||
|
|
||||||
|
5. Combined Libraries.
|
||||||
|
|
||||||
|
You may place library facilities that are a work based on the
|
||||||
|
Library side by side in a single library together with other library
|
||||||
|
facilities that are not Applications and are not covered by this
|
||||||
|
License, and convey such a combined library under terms of your
|
||||||
|
choice, if you do both of the following:
|
||||||
|
|
||||||
|
a) Accompany the combined library with a copy of the same work based
|
||||||
|
on the Library, uncombined with any other library facilities,
|
||||||
|
conveyed under the terms of this License.
|
||||||
|
|
||||||
|
b) Give prominent notice with the combined library that part of it
|
||||||
|
is a work based on the Library, and explaining where to find the
|
||||||
|
accompanying uncombined form of the same work.
|
||||||
|
|
||||||
|
6. Revised Versions of the GNU Lesser General Public License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the GNU Lesser General Public License from time to time. Such new
|
||||||
|
versions will be similar in spirit to the present version, but may
|
||||||
|
differ in detail to address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Library as you received it specifies that a certain numbered version
|
||||||
|
of the GNU Lesser General Public License "or any later version"
|
||||||
|
applies to it, you have the option of following the terms and
|
||||||
|
conditions either of that published version or of any later version
|
||||||
|
published by the Free Software Foundation. If the Library as you
|
||||||
|
received it does not specify a version number of the GNU Lesser
|
||||||
|
General Public License, you may choose any version of the GNU Lesser
|
||||||
|
General Public License ever published by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Library as you received it specifies that a proxy can decide
|
||||||
|
whether future versions of the GNU Lesser General Public License shall
|
||||||
|
apply, that proxy's public statement of acceptance of any version is
|
||||||
|
permanent authorization for you to choose that version for the
|
||||||
|
Library.
|
Before Width: | Height: | Size: 728 B After Width: | Height: | Size: 728 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 885 B After Width: | Height: | Size: 885 B |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 381 B After Width: | Height: | Size: 381 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
@ -7,15 +7,17 @@
|
|||||||
<name>GPXSee</name>
|
<name>GPXSee</name>
|
||||||
<summary>GPS log file viewer and analyzer</summary>
|
<summary>GPS log file viewer and analyzer</summary>
|
||||||
<description>
|
<description>
|
||||||
<p>GPXSee is a GPS log file viewer and analyzer that supports GPX, TCX,
|
<p>GPXSee is a GPS log file viewer and analyzer that supports all common
|
||||||
KML, FIT, IGC, NMEA, SLF, LOC, GeoJSON and OziExplorer files.</p>
|
GPS log file formats.</p>
|
||||||
|
|
||||||
<p>Features:</p>
|
<p>Features:</p>
|
||||||
<ul>
|
<ul>
|
||||||
|
<li>Opens GPX, TCX, FIT, KML, IGC, NMEA, SLF, LOC, OziExplorer (PLT,
|
||||||
|
WPT, RTE), GeoJSON, Garmin CSV and geotagged JPEG files.</li>
|
||||||
<li>User-definable online maps (OpenStreetMap/Google tiles, WMTS,
|
<li>User-definable online maps (OpenStreetMap/Google tiles, WMTS,
|
||||||
WMS, TMS).</li>
|
WMS, TMS).</li>
|
||||||
<li>Offline maps (MBTiles, OziExplorer maps, TrekBuddy maps/atlases,
|
<li>Offline maps (MBTiles, OziExplorer maps, TrekBuddy maps/atlases,
|
||||||
GeoTIFF images).</li>
|
TwoNav RMaps, Garmin IMG & JNX, GeoTIFF images).</li>
|
||||||
<li>Elevation, speed, heart rate, cadence, power and temperature
|
<li>Elevation, speed, heart rate, cadence, power and temperature
|
||||||
graphs.</li>
|
graphs.</li>
|
||||||
<li>Support for multiple tracks in one view.</li>
|
<li>Support for multiple tracks in one view.</li>
|
||||||
@ -23,8 +25,6 @@
|
|||||||
<li>Print/export to PDF.</li>
|
<li>Print/export to PDF.</li>
|
||||||
<li>Full-screen mode.</li>
|
<li>Full-screen mode.</li>
|
||||||
<li>HiDPI/Retina displays & maps support.</li>
|
<li>HiDPI/Retina displays & maps support.</li>
|
||||||
<li>Opens GPX, TCX, FIT, KML, IGC, NMEA, SLF, LOC, OziExplorer (PLT,
|
|
||||||
WPT, RTE), GeoJSON and Garmin CSV files.</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
; The name of the installer
|
; The name of the installer
|
||||||
Name "GPXSee"
|
Name "GPXSee"
|
||||||
; Program version
|
; Program version
|
||||||
!define VERSION "7.5"
|
!define VERSION "7.8"
|
||||||
|
|
||||||
; The file to write
|
; The file to write
|
||||||
OutFile "GPXSee-${VERSION}.exe"
|
OutFile "GPXSee-${VERSION}.exe"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
; The name of the installer
|
; The name of the installer
|
||||||
Name "GPXSee"
|
Name "GPXSee"
|
||||||
; Program version
|
; Program version
|
||||||
!define VERSION "7.5"
|
!define VERSION "7.8"
|
||||||
|
|
||||||
; The file to write
|
; The file to write
|
||||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<map xmlns="http://www.gpxsee.org/map/1.0">
|
<map xmlns="http://www.gpxsee.org/map/1.3">
|
||||||
<name>4UMaps</name>
|
<name>4UMaps</name>
|
||||||
<url>https://4umaps.com/$z/$x/$y.png</url>
|
<url>https://4umaps.com/$z/$x/$y.png</url>
|
||||||
<copyright>Map data: © OpenStreetMap contributors (ODbL) | Rendering: © 4UMaps.eu</copyright>
|
|
||||||
<zoom min="2" max="15"/>
|
<zoom min="2" max="15"/>
|
||||||
<bounds bottom="-65"/>
|
<bounds bottom="-65"/>
|
||||||
|
<copyright>Map data: © OpenStreetMap contributors (ODbL) | Rendering: © 4UMaps.eu</copyright>
|
||||||
</map>
|
</map>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<map xmlns="http://www.gpxsee.org/map/1.0" type="WMTS">
|
<map xmlns="http://www.gpxsee.org/map/1.3" type="WMTS">
|
||||||
<name>Antarctica</name>
|
<name>Antarctica</name>
|
||||||
<url type="REST">https://gis.ngdc.noaa.gov/arcgis/rest/services/antarctic/antarctic_basemap/MapServer/WMTS/1.0.0/WMTSCapabilities.xml</url>
|
<url type="REST">https://gis.ngdc.noaa.gov/arcgis/rest/services/antarctic/antarctic_basemap/MapServer/WMTS/1.0.0/WMTSCapabilities.xml</url>
|
||||||
<copyright>NOAA National Centers for Environmental Information (NCEI); International Bathymetric Chart of the Southern Ocean (IBCSO); General Bathymetric Chart of the Oceans (GEBCO); Natural Earth</copyright>
|
<copyright>NOAA National Centers for Environmental Information (NCEI); International Bathymetric Chart of the Southern Ocean (IBCSO); General Bathymetric Chart of the Oceans (GEBCO); Natural Earth</copyright>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<map xmlns="http://www.gpxsee.org/map/1.0">
|
<map xmlns="http://www.gpxsee.org/map/1.3">
|
||||||
<name>Open Street Map</name>
|
<name>Open Street Map</name>
|
||||||
<url>http://tile.openstreetmap.org/$z/$x/$y.png</url>
|
<url>http://tile.openstreetmap.org/$z/$x/$y.png</url>
|
||||||
<copyright>Map data: © OpenStreetMap contributors (ODbL) | Rendering: © OpenStreetMap (CC-BY-SA)</copyright>
|
<copyright>Map data: © OpenStreetMap contributors (ODbL) | Rendering: © OpenStreetMap (CC-BY-SA)</copyright>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<map xmlns="http://www.gpxsee.org/map/1.0">
|
<map xmlns="http://www.gpxsee.org/map/1.3">
|
||||||
<name>Open Topo Map</name>
|
<name>Open Topo Map</name>
|
||||||
<url>https://a.tile.opentopomap.org/$z/$x/$y.png</url>
|
<url>https://a.tile.opentopomap.org/$z/$x/$y.png</url>
|
||||||
<copyright>Map data: © OpenStreetMap contributors (ODbL), SRTM | Rendering: © OpenTopoMap (CC-BY-SA)</copyright>
|
|
||||||
<zoom max="17"/>
|
<zoom max="17"/>
|
||||||
|
<copyright>Map data: © OpenStreetMap contributors (ODbL), SRTM | Rendering: © OpenTopoMap (CC-BY-SA)</copyright>
|
||||||
</map>
|
</map>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<map xmlns="http://www.gpxsee.org/map/1.0">
|
<map xmlns="http://www.gpxsee.org/map/1.3">
|
||||||
<name>USGS Imagery</name>
|
<name>USGS Imagery</name>
|
||||||
<url>https://basemap.nationalmap.gov/ArcGIS/rest/services/USGSImageryOnly/MapServer/tile/$z/$y/$x</url>
|
<url>https://basemap.nationalmap.gov/ArcGIS/rest/services/USGSImageryOnly/MapServer/tile/$z/$y/$x</url>
|
||||||
<copyright>Map services and data available from U.S. Geological Survey, National Geospatial Program.</copyright>
|
|
||||||
<zoom min="2" max="15"/>
|
<zoom min="2" max="15"/>
|
||||||
<bounds bottom="0" top="74"/>
|
<bounds bottom="0" top="74"/>
|
||||||
|
<copyright>Map services and data available from U.S. Geological Survey, National Geospatial Program.</copyright>
|
||||||
</map>
|
</map>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<map xmlns="http://www.gpxsee.org/map/1.0">
|
<map xmlns="http://www.gpxsee.org/map/1.3">
|
||||||
<name>USGS Topo</name>
|
<name>USGS Topo</name>
|
||||||
<url>https://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/$z/$y/$x</url>
|
<url>https://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/$z/$y/$x</url>
|
||||||
<copyright>Map services and data available from U.S. Geological Survey, National Geospatial Program.</copyright>
|
|
||||||
<zoom min="2" max="15"/>
|
<zoom min="2" max="15"/>
|
||||||
|
<copyright>Map services and data available from U.S. Geological Survey, National Geospatial Program.</copyright>
|
||||||
</map>
|
</map>
|
||||||
|
@ -51,7 +51,7 @@ App::App(int &argc, char **argv) : QApplication(argc, argv)
|
|||||||
"QThreadStorage: Thread X exited after QThreadStorage Y destroyed" */
|
"QThreadStorage: Thread X exited after QThreadStorage Y destroyed" */
|
||||||
Downloader::setNetworkManager(new QNetworkAccessManager(this));
|
Downloader::setNetworkManager(new QNetworkAccessManager(this));
|
||||||
DEM::setDir(ProgramPaths::demDir());
|
DEM::setDir(ProgramPaths::demDir());
|
||||||
OPENGL_SET_SAMPLES(4);
|
OPENGL_SET_FORMAT(4, 8);
|
||||||
|
|
||||||
loadDatums();
|
loadDatums();
|
||||||
loadPCSs();
|
loadPCSs();
|
||||||
|
@ -29,8 +29,8 @@ private:
|
|||||||
|
|
||||||
Ticks::Ticks(double minValue, double maxValue, int maxCount)
|
Ticks::Ticks(double minValue, double maxValue, int maxCount)
|
||||||
{
|
{
|
||||||
double range = niceNum(maxValue - minValue, 0);
|
double range = niceNum(maxValue - minValue, false);
|
||||||
_d = niceNum(range / maxCount, 1);
|
_d = niceNum(range / maxCount, true);
|
||||||
_min = ceil(minValue / _d) * _d;
|
_min = ceil(minValue / _d) * _d;
|
||||||
_max = floor(maxValue / _d) * _d;
|
_max = floor(maxValue / _d) * _d;
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ ColorBox::ColorBox(QWidget *parent) : QWidget(parent)
|
|||||||
_alpha = true;
|
_alpha = true;
|
||||||
|
|
||||||
setSizePolicy(QSizePolicy::QSizePolicy::Minimum, QSizePolicy::Fixed);
|
setSizePolicy(QSizePolicy::QSizePolicy::Minimum, QSizePolicy::Fixed);
|
||||||
|
setAttribute(Qt::WA_Hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize ColorBox::sizeHint() const
|
QSize ColorBox::sizeHint() const
|
||||||
|
@ -11,6 +11,10 @@ CoordinatesItem::CoordinatesItem(QGraphicsItem *parent) : QGraphicsItem(parent)
|
|||||||
_font.setPixelSize(FONT_SIZE);
|
_font.setPixelSize(FONT_SIZE);
|
||||||
_font.setFamily(FONT_FAMILY);
|
_font.setFamily(FONT_FAMILY);
|
||||||
|
|
||||||
|
_digitalZoom = 0;
|
||||||
|
|
||||||
|
setAcceptHoverEvents(true);
|
||||||
|
|
||||||
updateBoundingRect();
|
updateBoundingRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,6 +52,12 @@ void CoordinatesItem::setFormat(const CoordinatesFormat &format)
|
|||||||
updateBoundingRect();
|
updateBoundingRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CoordinatesItem::setDigitalZoom(qreal zoom)
|
||||||
|
{
|
||||||
|
_digitalZoom = zoom;
|
||||||
|
setScale(pow(2, -_digitalZoom));
|
||||||
|
}
|
||||||
|
|
||||||
void CoordinatesItem::updateBoundingRect()
|
void CoordinatesItem::updateBoundingRect()
|
||||||
{
|
{
|
||||||
QFontMetrics fm(_font);
|
QFontMetrics fm(_font);
|
||||||
|
@ -17,6 +17,7 @@ public:
|
|||||||
|
|
||||||
void setCoordinates(const Coordinates &c);
|
void setCoordinates(const Coordinates &c);
|
||||||
void setFormat(const CoordinatesFormat &format);
|
void setFormat(const CoordinatesFormat &format);
|
||||||
|
void setDigitalZoom(qreal zoom);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateBoundingRect();
|
void updateBoundingRect();
|
||||||
@ -25,6 +26,7 @@ private:
|
|||||||
CoordinatesFormat _format;
|
CoordinatesFormat _format;
|
||||||
QRectF _boundingRect;
|
QRectF _boundingRect;
|
||||||
QFont _font;
|
QFont _font;
|
||||||
|
qreal _digitalZoom;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // COORDINATESITEM_H
|
#endif // COORDINATESITEM_H
|
||||||
|
@ -103,7 +103,6 @@ GUI::GUI()
|
|||||||
readSettings();
|
readSettings();
|
||||||
|
|
||||||
updateGraphTabs();
|
updateGraphTabs();
|
||||||
updateMapView();
|
|
||||||
updateStatusBarInfo();
|
updateStatusBarInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,6 +349,11 @@ void GUI::createActions()
|
|||||||
_showRouteWaypointsAction->setCheckable(true);
|
_showRouteWaypointsAction->setCheckable(true);
|
||||||
connect(_showRouteWaypointsAction, SIGNAL(triggered(bool)), _mapView,
|
connect(_showRouteWaypointsAction, SIGNAL(triggered(bool)), _mapView,
|
||||||
SLOT(showRouteWaypoints(bool)));
|
SLOT(showRouteWaypoints(bool)));
|
||||||
|
_showTicksAction = new QAction(tr("km/mi markers"), this);
|
||||||
|
_showTicksAction->setMenuRole(QAction::NoRole);
|
||||||
|
_showTicksAction->setCheckable(true);
|
||||||
|
connect(_showTicksAction, SIGNAL(triggered(bool)), _mapView,
|
||||||
|
SLOT(showTicks(bool)));
|
||||||
|
|
||||||
// Graph actions
|
// Graph actions
|
||||||
_showGraphsAction = new QAction(QIcon(SHOW_GRAPHS_ICON), tr("Show graphs"),
|
_showGraphsAction = new QAction(QIcon(SHOW_GRAPHS_ICON), tr("Show graphs"),
|
||||||
@ -537,6 +541,7 @@ void GUI::createMenus()
|
|||||||
QMenu *displayMenu = dataMenu->addMenu(tr("Display"));
|
QMenu *displayMenu = dataMenu->addMenu(tr("Display"));
|
||||||
displayMenu->addAction(_showWaypointLabelsAction);
|
displayMenu->addAction(_showWaypointLabelsAction);
|
||||||
displayMenu->addAction(_showRouteWaypointsAction);
|
displayMenu->addAction(_showRouteWaypointsAction);
|
||||||
|
displayMenu->addAction(_showTicksAction);
|
||||||
dataMenu->addSeparator();
|
dataMenu->addSeparator();
|
||||||
dataMenu->addAction(_showTracksAction);
|
dataMenu->addAction(_showTracksAction);
|
||||||
dataMenu->addAction(_showRoutesAction);
|
dataMenu->addAction(_showRoutesAction);
|
||||||
@ -725,6 +730,8 @@ void GUI::paths()
|
|||||||
+ QDir::cleanPath(ProgramPaths::csvDir(true)) + "</code></td></tr><tr><td>"
|
+ QDir::cleanPath(ProgramPaths::csvDir(true)) + "</code></td></tr><tr><td>"
|
||||||
+ tr("DEM directory:") + "</td><td><code>"
|
+ tr("DEM directory:") + "</td><td><code>"
|
||||||
+ QDir::cleanPath(ProgramPaths::demDir(true)) + "</code></td></tr><tr><td>"
|
+ QDir::cleanPath(ProgramPaths::demDir(true)) + "</code></td></tr><tr><td>"
|
||||||
|
+ tr("Styles directory:") + "</td><td><code>"
|
||||||
|
+ QDir::cleanPath(ProgramPaths::styleDir(true)) + "</code></td></tr><tr><td>"
|
||||||
+ tr("Tile cache directory:") + "</td><td><code>"
|
+ tr("Tile cache directory:") + "</td><td><code>"
|
||||||
+ QDir::cleanPath(ProgramPaths::tilesDir()) + "</code></td></tr></table>"
|
+ QDir::cleanPath(ProgramPaths::tilesDir()) + "</code></td></tr></table>"
|
||||||
);
|
);
|
||||||
@ -805,7 +812,7 @@ bool GUI::loadFile(const QString &fileName)
|
|||||||
|
|
||||||
for (int i = 0; i < _tabs.count(); i++)
|
for (int i = 0; i < _tabs.count(); i++)
|
||||||
graphs.append(_tabs.at(i)->loadData(data));
|
graphs.append(_tabs.at(i)->loadData(data));
|
||||||
if (updateGraphTabs() | updateMapView())
|
if (updateGraphTabs())
|
||||||
_splitter->refresh();
|
_splitter->refresh();
|
||||||
paths = _mapView->loadData(data);
|
paths = _mapView->loadData(data);
|
||||||
|
|
||||||
@ -828,7 +835,6 @@ bool GUI::loadFile(const QString &fileName)
|
|||||||
updateStatusBarInfo();
|
updateStatusBarInfo();
|
||||||
updateWindowTitle();
|
updateWindowTitle();
|
||||||
updateGraphTabs();
|
updateGraphTabs();
|
||||||
updateMapView();
|
|
||||||
|
|
||||||
QString error = tr("Error loading data file:") + "\n\n"
|
QString error = tr("Error loading data file:") + "\n\n"
|
||||||
+ fileName + "\n\n" + data.errorString();
|
+ fileName + "\n\n" + data.errorString();
|
||||||
@ -930,6 +936,7 @@ void GUI::openOptions()
|
|||||||
SET_VIEW_OPTION(pathAntiAliasing, useAntiAliasing);
|
SET_VIEW_OPTION(pathAntiAliasing, useAntiAliasing);
|
||||||
SET_VIEW_OPTION(useOpenGL, useOpenGL);
|
SET_VIEW_OPTION(useOpenGL, useOpenGL);
|
||||||
SET_VIEW_OPTION(sliderColor, setMarkerColor);
|
SET_VIEW_OPTION(sliderColor, setMarkerColor);
|
||||||
|
SET_VIEW_OPTION(projection, setProjection);
|
||||||
|
|
||||||
SET_TAB_OPTION(palette, setPalette);
|
SET_TAB_OPTION(palette, setPalette);
|
||||||
SET_TAB_OPTION(graphWidth, setGraphWidth);
|
SET_TAB_OPTION(graphWidth, setGraphWidth);
|
||||||
@ -974,8 +981,6 @@ void GUI::openOptions()
|
|||||||
reloadFile();
|
reloadFile();
|
||||||
|
|
||||||
_options = options;
|
_options = options;
|
||||||
|
|
||||||
updateMapView();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::printFile()
|
void GUI::printFile()
|
||||||
@ -1230,7 +1235,6 @@ void GUI::closeAll()
|
|||||||
updateStatusBarInfo();
|
updateStatusBarInfo();
|
||||||
updateWindowTitle();
|
updateWindowTitle();
|
||||||
updateGraphTabs();
|
updateGraphTabs();
|
||||||
updateMapView();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::showGraphs(bool show)
|
void GUI::showGraphs(bool show)
|
||||||
@ -1473,19 +1477,6 @@ bool GUI::updateGraphTabs()
|
|||||||
return (hidden != _graphTabWidget->isHidden());
|
return (hidden != _graphTabWidget->isHidden());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GUI::updateMapView()
|
|
||||||
{
|
|
||||||
bool hidden = _mapView->isHidden();
|
|
||||||
|
|
||||||
if (_options.alwaysShowMap)
|
|
||||||
_mapView->setHidden(false);
|
|
||||||
else
|
|
||||||
_mapView->setHidden(!(_trackCount + _routeCount + _waypointCount
|
|
||||||
+ _areaCount));
|
|
||||||
|
|
||||||
return (hidden != _mapView->isHidden());
|
|
||||||
}
|
|
||||||
|
|
||||||
void GUI::setTimeType(TimeType type)
|
void GUI::setTimeType(TimeType type)
|
||||||
{
|
{
|
||||||
for (int i = 0; i <_tabs.count(); i++)
|
for (int i = 0; i <_tabs.count(); i++)
|
||||||
@ -1736,6 +1727,9 @@ void GUI::writeSettings()
|
|||||||
if (_showRouteWaypointsAction->isChecked() != SHOW_ROUTE_WAYPOINTS_DEFAULT)
|
if (_showRouteWaypointsAction->isChecked() != SHOW_ROUTE_WAYPOINTS_DEFAULT)
|
||||||
settings.setValue(SHOW_ROUTE_WAYPOINTS_SETTING,
|
settings.setValue(SHOW_ROUTE_WAYPOINTS_SETTING,
|
||||||
_showRouteWaypointsAction->isChecked());
|
_showRouteWaypointsAction->isChecked());
|
||||||
|
if (_showTicksAction->isChecked() != SHOW_TICKS_DEFAULT)
|
||||||
|
settings.setValue(SHOW_TICKS_SETTING,
|
||||||
|
_showTicksAction->isChecked());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
settings.beginGroup(EXPORT_SETTINGS_GROUP);
|
settings.beginGroup(EXPORT_SETTINGS_GROUP);
|
||||||
@ -1847,8 +1841,8 @@ void GUI::writeSettings()
|
|||||||
_options.separateGraphPage);
|
_options.separateGraphPage);
|
||||||
if (_options.sliderColor != SLIDER_COLOR_DEFAULT)
|
if (_options.sliderColor != SLIDER_COLOR_DEFAULT)
|
||||||
settings.setValue(SLIDER_COLOR_SETTING, _options.sliderColor);
|
settings.setValue(SLIDER_COLOR_SETTING, _options.sliderColor);
|
||||||
if (_options.alwaysShowMap != ALWAYS_SHOW_MAP_DEFAULT)
|
if (_options.projection != PROJECTION_DEFAULT)
|
||||||
settings.setValue(ALWAYS_SHOW_MAP_SETTING, _options.alwaysShowMap);
|
settings.setValue(PROJECTION_SETTING, _options.projection);
|
||||||
#ifdef ENABLE_HIDPI
|
#ifdef ENABLE_HIDPI
|
||||||
if (_options.hidpiMap != HIDPI_MAP_DEFAULT)
|
if (_options.hidpiMap != HIDPI_MAP_DEFAULT)
|
||||||
settings.setValue(HIDPI_MAP_SETTING, _options.hidpiMap);
|
settings.setValue(HIDPI_MAP_SETTING, _options.hidpiMap);
|
||||||
@ -1999,6 +1993,10 @@ void GUI::readSettings()
|
|||||||
_mapView->showRouteWaypoints(false);
|
_mapView->showRouteWaypoints(false);
|
||||||
else
|
else
|
||||||
_showRouteWaypointsAction->setChecked(true);
|
_showRouteWaypointsAction->setChecked(true);
|
||||||
|
if (settings.value(SHOW_TICKS_SETTING, SHOW_TICKS_DEFAULT).toBool()) {
|
||||||
|
_mapView->showTicks(true);
|
||||||
|
_showTicksAction->setChecked(true);
|
||||||
|
}
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
settings.beginGroup(EXPORT_SETTINGS_GROUP);
|
settings.beginGroup(EXPORT_SETTINGS_GROUP);
|
||||||
@ -2110,8 +2108,8 @@ void GUI::readSettings()
|
|||||||
SEPARATE_GRAPH_PAGE_DEFAULT).toBool();
|
SEPARATE_GRAPH_PAGE_DEFAULT).toBool();
|
||||||
_options.sliderColor = settings.value(SLIDER_COLOR_SETTING,
|
_options.sliderColor = settings.value(SLIDER_COLOR_SETTING,
|
||||||
SLIDER_COLOR_DEFAULT).value<QColor>();
|
SLIDER_COLOR_DEFAULT).value<QColor>();
|
||||||
_options.alwaysShowMap = settings.value(ALWAYS_SHOW_MAP_SETTING,
|
_options.projection = settings.value(PROJECTION_SETTING, PROJECTION_DEFAULT)
|
||||||
ALWAYS_SHOW_MAP_DEFAULT).toBool();
|
.toInt();
|
||||||
#ifdef ENABLE_HIDPI
|
#ifdef ENABLE_HIDPI
|
||||||
_options.hidpiMap = settings.value(HIDPI_MAP_SETTING, HIDPI_MAP_SETTING)
|
_options.hidpiMap = settings.value(HIDPI_MAP_SETTING, HIDPI_MAP_SETTING)
|
||||||
.toBool();
|
.toBool();
|
||||||
@ -2139,6 +2137,7 @@ void GUI::readSettings()
|
|||||||
_mapView->setDevicePixelRatio(devicePixelRatioF(),
|
_mapView->setDevicePixelRatio(devicePixelRatioF(),
|
||||||
_options.hidpiMap ? devicePixelRatioF() : 1.0);
|
_options.hidpiMap ? devicePixelRatioF() : 1.0);
|
||||||
#endif // ENABLE_HIDPI
|
#endif // ENABLE_HIDPI
|
||||||
|
_mapView->setProjection(_options.projection);
|
||||||
|
|
||||||
for (int i = 0; i < _tabs.count(); i++) {
|
for (int i = 0; i < _tabs.count(); i++) {
|
||||||
_tabs.at(i)->setPalette(_options.palette);
|
_tabs.at(i)->setPalette(_options.palette);
|
||||||
|
@ -116,7 +116,6 @@ private:
|
|||||||
void updateWindowTitle();
|
void updateWindowTitle();
|
||||||
void updateNavigationActions();
|
void updateNavigationActions();
|
||||||
bool updateGraphTabs();
|
bool updateGraphTabs();
|
||||||
bool updateMapView();
|
|
||||||
|
|
||||||
TimeType timeType() const;
|
TimeType timeType() const;
|
||||||
Units units() const;
|
Units units() const;
|
||||||
@ -193,6 +192,7 @@ private:
|
|||||||
QAction *_showAreasAction;
|
QAction *_showAreasAction;
|
||||||
QAction *_showRouteWaypointsAction;
|
QAction *_showRouteWaypointsAction;
|
||||||
QAction *_showMarkersAction;
|
QAction *_showMarkersAction;
|
||||||
|
QAction *_showTicksAction;
|
||||||
QAction *_showCoordinatesAction;
|
QAction *_showCoordinatesAction;
|
||||||
QAction *_openOptionsAction;
|
QAction *_openOptionsAction;
|
||||||
QAction *_mapsEnd;
|
QAction *_mapsEnd;
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
#ifndef ICONS_H
|
#ifndef ICONS_H
|
||||||
#define ICONS_H
|
#define ICONS_H
|
||||||
|
|
||||||
#define APP_ICON ":/icons/gpxsee.png"
|
#define APP_ICON ":/gpxsee.png"
|
||||||
|
|
||||||
// Toolbar/menu icons
|
// Toolbar/menu icons
|
||||||
#define OPEN_FILE_ICON ":/icons/document-open.png"
|
#define OPEN_FILE_ICON ":/document-open.png"
|
||||||
#define EXPORT_FILE_ICON ":/icons/document-export.png"
|
#define EXPORT_FILE_ICON ":/document-export.png"
|
||||||
#define PRINT_FILE_ICON ":/icons/document-print.png"
|
#define PRINT_FILE_ICON ":/document-print.png"
|
||||||
#define CLOSE_FILE_ICON ":/icons/dialog-close.png"
|
#define CLOSE_FILE_ICON ":/dialog-close.png"
|
||||||
#define SHOW_POI_ICON ":/icons/flag.png"
|
#define SHOW_POI_ICON ":/flag.png"
|
||||||
#define SHOW_MAP_ICON ":/icons/applications-internet.png"
|
#define SHOW_MAP_ICON ":/applications-internet.png"
|
||||||
#define SHOW_GRAPHS_ICON ":/icons/office-chart-line.png"
|
#define SHOW_GRAPHS_ICON ":/office-chart-line.png"
|
||||||
#define QUIT_ICON ":/icons/application-exit.png"
|
#define QUIT_ICON ":/application-exit.png"
|
||||||
#define RELOAD_FILE_ICON ":/icons/view-refresh.png"
|
#define RELOAD_FILE_ICON ":/view-refresh.png"
|
||||||
#define NEXT_FILE_ICON ":/icons/arrow-right.png"
|
#define NEXT_FILE_ICON ":/arrow-right.png"
|
||||||
#define PREV_FILE_ICON ":/icons/arrow-left.png"
|
#define PREV_FILE_ICON ":/arrow-left.png"
|
||||||
#define LAST_FILE_ICON ":/icons/arrow-right-double.png"
|
#define LAST_FILE_ICON ":/arrow-right-double.png"
|
||||||
#define FIRST_FILE_ICON ":/icons/arrow-left-double.png"
|
#define FIRST_FILE_ICON ":/arrow-left-double.png"
|
||||||
#define FULLSCREEN_ICON ":/icons/view-fullscreen.png"
|
#define FULLSCREEN_ICON ":/view-fullscreen.png"
|
||||||
|
|
||||||
// Options dialog icons
|
// Options dialog icons
|
||||||
#define APPEARANCE_ICON ":/icons/format-stroke-color.png"
|
#define APPEARANCE_ICON ":/format-stroke-color.png"
|
||||||
#define POI_ICON ":/icons/flag_32.png"
|
#define POI_ICON ":/flag_32.png"
|
||||||
#define SYSTEM_ICON ":/icons/preferences-system.png"
|
#define SYSTEM_ICON ":/preferences-system.png"
|
||||||
#define PRINT_EXPORT_ICON ":/icons/document-print_32.png"
|
#define PRINT_EXPORT_ICON ":/document-print_32.png"
|
||||||
#define DATA_ICON ":/icons/view-filter.png"
|
#define DATA_ICON ":/view-filter.png"
|
||||||
#define MAPS_ICON ":/icons/applications-internet_32.png"
|
#define MAPS_ICON ":/applications-internet_32.png"
|
||||||
|
|
||||||
#endif /* ICONS_H */
|
#endif /* ICONS_H */
|
||||||
|
39
src/GUI/limitedcombobox.h
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#ifndef LIMITEDCOMBOBOX_H
|
||||||
|
#define LIMITEDCOMBOBOX_H
|
||||||
|
|
||||||
|
#include <QComboBox>
|
||||||
|
#include <QEvent>
|
||||||
|
|
||||||
|
class LimitedComboBox : public QComboBox
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LimitedComboBox(int limit, QWidget *parent = 0)
|
||||||
|
: QComboBox(parent), _limit(limit)
|
||||||
|
{
|
||||||
|
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
||||||
|
setStyleSheet("combobox-popup: 0;");
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize sizeHint() const
|
||||||
|
{
|
||||||
|
return QSize(qMin(_limit, QComboBox::sizeHint().width()),
|
||||||
|
QComboBox::sizeHint().height());
|
||||||
|
}
|
||||||
|
QSize minimumSizeHint() const
|
||||||
|
{
|
||||||
|
return QSize(qMin(_limit, QComboBox::minimumSizeHint().width()),
|
||||||
|
QComboBox::minimumSizeHint().height());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool event(QEvent *e)
|
||||||
|
{
|
||||||
|
if (e->type() == QEvent::Polish)
|
||||||
|
view()->setMinimumWidth(QComboBox::sizeHint().width());
|
||||||
|
return QComboBox::event(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
int _limit;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // LIMITEDCOMBOBOX_H
|
@ -7,6 +7,7 @@
|
|||||||
#include "data/poi.h"
|
#include "data/poi.h"
|
||||||
#include "data/data.h"
|
#include "data/data.h"
|
||||||
#include "map/map.h"
|
#include "map/map.h"
|
||||||
|
#include "map/pcs.h"
|
||||||
#include "opengl.h"
|
#include "opengl.h"
|
||||||
#include "trackitem.h"
|
#include "trackitem.h"
|
||||||
#include "routeitem.h"
|
#include "routeitem.h"
|
||||||
@ -39,7 +40,6 @@ MapView::MapView(Map *map, POI *poi, QWidget *parent)
|
|||||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
setRenderHint(QPainter::Antialiasing, true);
|
setRenderHint(QPainter::Antialiasing, true);
|
||||||
setAcceptDrops(false);
|
setAcceptDrops(false);
|
||||||
setMouseTracking(true);
|
|
||||||
|
|
||||||
_mapScale = new ScaleItem();
|
_mapScale = new ScaleItem();
|
||||||
_mapScale->setZValue(2.0);
|
_mapScale->setZValue(2.0);
|
||||||
@ -49,8 +49,10 @@ MapView::MapView(Map *map, POI *poi, QWidget *parent)
|
|||||||
_coordinates->setVisible(false);
|
_coordinates->setVisible(false);
|
||||||
_scene->addItem(_coordinates);
|
_scene->addItem(_coordinates);
|
||||||
|
|
||||||
|
_projection = PCS::pcs(3857);
|
||||||
_map = map;
|
_map = map;
|
||||||
_map->load();
|
_map->load();
|
||||||
|
_map->setProjection(_projection);
|
||||||
connect(_map, SIGNAL(loaded()), this, SLOT(reloadMap()));
|
connect(_map, SIGNAL(loaded()), this, SLOT(reloadMap()));
|
||||||
|
|
||||||
_poi = poi;
|
_poi = poi;
|
||||||
@ -73,6 +75,7 @@ MapView::MapView(Map *map, POI *poi, QWidget *parent)
|
|||||||
_overlapPOIs = true;
|
_overlapPOIs = true;
|
||||||
_showRouteWaypoints = true;
|
_showRouteWaypoints = true;
|
||||||
_showMarkers = true;
|
_showMarkers = true;
|
||||||
|
_showPathTicks = false;
|
||||||
_trackWidth = 3;
|
_trackWidth = 3;
|
||||||
_routeWidth = 3;
|
_routeWidth = 3;
|
||||||
_trackStyle = Qt::SolidLine;
|
_trackStyle = Qt::SolidLine;
|
||||||
@ -123,6 +126,7 @@ PathItem *MapView::addTrack(const Track &track)
|
|||||||
ti->setDigitalZoom(_digitalZoom);
|
ti->setDigitalZoom(_digitalZoom);
|
||||||
ti->setMarkerColor(_markerColor);
|
ti->setMarkerColor(_markerColor);
|
||||||
ti->showMarker(_showMarkers);
|
ti->showMarker(_showMarkers);
|
||||||
|
ti->showTicks(_showPathTicks);
|
||||||
_scene->addItem(ti);
|
_scene->addItem(ti);
|
||||||
|
|
||||||
if (_showTracks)
|
if (_showTracks)
|
||||||
@ -152,6 +156,7 @@ PathItem *MapView::addRoute(const Route &route)
|
|||||||
ri->setDigitalZoom(_digitalZoom);
|
ri->setDigitalZoom(_digitalZoom);
|
||||||
ri->setMarkerColor(_markerColor);
|
ri->setMarkerColor(_markerColor);
|
||||||
ri->showMarker(_showMarkers);
|
ri->showMarker(_showMarkers);
|
||||||
|
ri->showTicks(_showPathTicks);
|
||||||
_scene->addItem(ri);
|
_scene->addItem(ri);
|
||||||
|
|
||||||
if (_showRoutes)
|
if (_showRoutes)
|
||||||
@ -313,6 +318,7 @@ void MapView::setMap(Map *map)
|
|||||||
|
|
||||||
_map = map;
|
_map = map;
|
||||||
_map->load();
|
_map->load();
|
||||||
|
_map->setProjection(_projection);
|
||||||
#ifdef ENABLE_HIDPI
|
#ifdef ENABLE_HIDPI
|
||||||
_map->setDevicePixelRatio(_deviceRatio, _mapRatio);
|
_map->setDevicePixelRatio(_deviceRatio, _mapRatio);
|
||||||
#endif // ENABLE_HIDPI
|
#endif // ENABLE_HIDPI
|
||||||
@ -476,6 +482,7 @@ void MapView::digitalZoom(int zoom)
|
|||||||
it.value()->setDigitalZoom(_digitalZoom);
|
it.value()->setDigitalZoom(_digitalZoom);
|
||||||
|
|
||||||
_mapScale->setDigitalZoom(_digitalZoom);
|
_mapScale->setDigitalZoom(_digitalZoom);
|
||||||
|
_coordinates->setDigitalZoom(_digitalZoom);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapView::zoom(int zoom, const QPoint &pos)
|
void MapView::zoom(int zoom, const QPoint &pos)
|
||||||
@ -720,6 +727,15 @@ void MapView::showMarkers(bool show)
|
|||||||
_routes.at(i)->showMarker(show);
|
_routes.at(i)->showMarker(show);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MapView::showTicks(bool show)
|
||||||
|
{
|
||||||
|
_showPathTicks = show;
|
||||||
|
for (int i = 0; i < _tracks.size(); i++)
|
||||||
|
_tracks.at(i)->showTicks(show);
|
||||||
|
for (int i = 0; i < _routes.size(); i++)
|
||||||
|
_routes.at(i)->showTicks(show);
|
||||||
|
}
|
||||||
|
|
||||||
void MapView::showMap(bool show)
|
void MapView::showMap(bool show)
|
||||||
{
|
{
|
||||||
_showMap = show;
|
_showMap = show;
|
||||||
@ -751,6 +767,7 @@ void MapView::showPOILabels(bool show)
|
|||||||
void MapView::showCoordinates(bool show)
|
void MapView::showCoordinates(bool show)
|
||||||
{
|
{
|
||||||
_coordinates->setVisible(show);
|
_coordinates->setVisible(show);
|
||||||
|
setMouseTracking(show);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapView::setPOIOverlap(bool overlap)
|
void MapView::setPOIOverlap(bool overlap)
|
||||||
@ -1011,3 +1028,17 @@ void MapView::setDevicePixelRatio(qreal deviceRatio, qreal mapRatio)
|
|||||||
Q_UNUSED(mapRatio);
|
Q_UNUSED(mapRatio);
|
||||||
#endif // ENABLE_HIDPI
|
#endif // ENABLE_HIDPI
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MapView::setProjection(int id)
|
||||||
|
{
|
||||||
|
Projection projection(PCS::pcs(id));
|
||||||
|
if (!projection.isValid())
|
||||||
|
return;
|
||||||
|
|
||||||
|
_projection = projection;
|
||||||
|
|
||||||
|
Coordinates center = _map->xy2ll(mapToScene(viewport()->rect().center()));
|
||||||
|
_map->setProjection(_projection);
|
||||||
|
rescale();
|
||||||
|
centerOn(_map->ll2xy(center));
|
||||||
|
}
|
||||||
|
@ -8,11 +8,13 @@
|
|||||||
#include "common/rectc.h"
|
#include "common/rectc.h"
|
||||||
#include "common/config.h"
|
#include "common/config.h"
|
||||||
#include "data/waypoint.h"
|
#include "data/waypoint.h"
|
||||||
|
#include "data/polygon.h"
|
||||||
|
#include "map/projection.h"
|
||||||
#include "searchpointer.h"
|
#include "searchpointer.h"
|
||||||
#include "units.h"
|
#include "units.h"
|
||||||
#include "format.h"
|
#include "format.h"
|
||||||
#include "palette.h"
|
#include "palette.h"
|
||||||
#include "data/polygon.h"
|
|
||||||
|
|
||||||
class Data;
|
class Data;
|
||||||
class POI;
|
class POI;
|
||||||
@ -77,9 +79,11 @@ public slots:
|
|||||||
void showRouteWaypoints(bool show);
|
void showRouteWaypoints(bool show);
|
||||||
void showMarkers(bool show);
|
void showMarkers(bool show);
|
||||||
void showCoordinates(bool show);
|
void showCoordinates(bool show);
|
||||||
|
void showTicks(bool show);
|
||||||
void clearMapCache();
|
void clearMapCache();
|
||||||
void setCoordinatesFormat(CoordinatesFormat format);
|
void setCoordinatesFormat(CoordinatesFormat format);
|
||||||
void setDevicePixelRatio(qreal deviceRatio, qreal mapRatio);
|
void setDevicePixelRatio(qreal deviceRatio, qreal mapRatio);
|
||||||
|
void setProjection(int id);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void updatePOI();
|
void updatePOI();
|
||||||
@ -132,10 +136,11 @@ private:
|
|||||||
Units _units;
|
Units _units;
|
||||||
CoordinatesFormat _coordinatesFormat;
|
CoordinatesFormat _coordinatesFormat;
|
||||||
qreal _mapOpacity;
|
qreal _mapOpacity;
|
||||||
|
Projection _projection;
|
||||||
|
|
||||||
bool _showMap, _showTracks, _showRoutes, _showAreas, _showWaypoints,
|
bool _showMap, _showTracks, _showRoutes, _showAreas, _showWaypoints,
|
||||||
_showWaypointLabels, _showPOI, _showPOILabels, _showRouteWaypoints,
|
_showWaypointLabels, _showPOI, _showPOILabels, _showRouteWaypoints,
|
||||||
_showMarkers;
|
_showMarkers, _showPathTicks;
|
||||||
bool _overlapPOIs;
|
bool _overlapPOIs;
|
||||||
int _trackWidth, _routeWidth, _areaWidth;
|
int _trackWidth, _routeWidth, _areaWidth;
|
||||||
Qt::PenStyle _trackStyle, _routeStyle, _areaStyle;
|
Qt::PenStyle _trackStyle, _routeStyle, _areaStyle;
|
||||||
|
@ -14,13 +14,15 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
|
||||||
#define OPENGL_SET_SAMPLES(samples) \
|
#define OPENGL_SET_FORMAT(samples, stencilBuffer) \
|
||||||
{QGLFormat fmt; \
|
{QGLFormat fmt; \
|
||||||
|
fmt.setStencilBufferSize(stencilBuffer); \
|
||||||
fmt.setSamples(samples); \
|
fmt.setSamples(samples); \
|
||||||
QGLFormat::setDefaultFormat(fmt);}
|
QGLFormat::setDefaultFormat(fmt);}
|
||||||
#else
|
#else
|
||||||
#define OPENGL_SET_SAMPLES(samples) \
|
#define OPENGL_SET_FORMAT(samples, stencilBuffer) \
|
||||||
{QSurfaceFormat fmt; \
|
{QSurfaceFormat fmt; \
|
||||||
fmt.setSamples(samples);\
|
fmt.setStencilBufferSize(stencilBuffer); \
|
||||||
|
fmt.setSamples(samples); \
|
||||||
QSurfaceFormat::setDefaultFormat(fmt);}
|
QSurfaceFormat::setDefaultFormat(fmt);}
|
||||||
#endif
|
#endif
|
||||||
|
@ -12,11 +12,14 @@
|
|||||||
#include <QRadioButton>
|
#include <QRadioButton>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QSysInfo>
|
#include <QSysInfo>
|
||||||
|
#include <QInputDialog>
|
||||||
|
#include "map/pcs.h"
|
||||||
#include "icons.h"
|
#include "icons.h"
|
||||||
#include "colorbox.h"
|
#include "colorbox.h"
|
||||||
#include "stylecombobox.h"
|
#include "stylecombobox.h"
|
||||||
#include "oddspinbox.h"
|
#include "oddspinbox.h"
|
||||||
#include "percentslider.h"
|
#include "percentslider.h"
|
||||||
|
#include "limitedcombobox.h"
|
||||||
#include "optionsdialog.h"
|
#include "optionsdialog.h"
|
||||||
|
|
||||||
|
|
||||||
@ -36,10 +39,15 @@ static QFrame *line()
|
|||||||
|
|
||||||
QWidget *OptionsDialog::createMapPage()
|
QWidget *OptionsDialog::createMapPage()
|
||||||
{
|
{
|
||||||
_alwaysShowMap = new QCheckBox(tr("Always show the map"));
|
_projection = new LimitedComboBox(200);
|
||||||
_alwaysShowMap->setChecked(_options->alwaysShowMap);
|
QList<PCS::Info> projections(PCS::pcsList());
|
||||||
_alwaysShowMap->setToolTip("<p>" +
|
qSort(projections);
|
||||||
tr("Show the map even when no files are loaded.") + "</p>");
|
for (int i = 0; i < projections.size(); i++) {
|
||||||
|
QString text = QString::number(projections.at(i).id()) + " - "
|
||||||
|
+ projections.at(i).name();
|
||||||
|
_projection->addItem(text, QVariant(projections.at(i).id()));
|
||||||
|
}
|
||||||
|
_projection->setCurrentIndex(_projection->findData(_options->projection));
|
||||||
|
|
||||||
#ifdef ENABLE_HIDPI
|
#ifdef ENABLE_HIDPI
|
||||||
_hidpi = new QRadioButton(tr("High-resolution"));
|
_hidpi = new QRadioButton(tr("High-resolution"));
|
||||||
@ -60,14 +68,14 @@ QWidget *OptionsDialog::createMapPage()
|
|||||||
llo->setFont(f);
|
llo->setFont(f);
|
||||||
#endif // ENABLE_HIDPI
|
#endif // ENABLE_HIDPI
|
||||||
|
|
||||||
QFormLayout *showMapLayout = new QFormLayout();
|
QFormLayout *vectorLayout = new QFormLayout();
|
||||||
showMapLayout->addWidget(_alwaysShowMap);
|
vectorLayout->addRow(tr("Projection:"), _projection);
|
||||||
|
|
||||||
QWidget *mapTab = new QWidget();
|
QWidget *vectorMapsTab = new QWidget();
|
||||||
QVBoxLayout *mapTabLayout = new QVBoxLayout();
|
QVBoxLayout *vectorMapsTabLayout = new QVBoxLayout();
|
||||||
mapTabLayout->addLayout(showMapLayout);
|
vectorMapsTabLayout->addLayout(vectorLayout);
|
||||||
mapTabLayout->addStretch();
|
vectorMapsTabLayout->addStretch();
|
||||||
mapTab->setLayout(mapTabLayout);
|
vectorMapsTab->setLayout(vectorMapsTabLayout);
|
||||||
|
|
||||||
#ifdef ENABLE_HIDPI
|
#ifdef ENABLE_HIDPI
|
||||||
QVBoxLayout *hidpiTabLayout = new QVBoxLayout();
|
QVBoxLayout *hidpiTabLayout = new QVBoxLayout();
|
||||||
@ -83,7 +91,7 @@ QWidget *OptionsDialog::createMapPage()
|
|||||||
#endif // ENABLE_HIDPI
|
#endif // ENABLE_HIDPI
|
||||||
|
|
||||||
QTabWidget *mapPage = new QTabWidget();
|
QTabWidget *mapPage = new QTabWidget();
|
||||||
mapPage->addTab(mapTab, tr("General"));
|
mapPage->addTab(vectorMapsTab, tr("Vector maps"));
|
||||||
#ifdef ENABLE_HIDPI
|
#ifdef ENABLE_HIDPI
|
||||||
mapPage->addTab(hidpiTab, tr("HiDPI display mode"));
|
mapPage->addTab(hidpiTab, tr("HiDPI display mode"));
|
||||||
#endif // ENABLE_HIDPI
|
#endif // ENABLE_HIDPI
|
||||||
@ -261,6 +269,7 @@ QWidget *OptionsDialog::createAppearancePage()
|
|||||||
_backgroundColor = new ColorBox();
|
_backgroundColor = new ColorBox();
|
||||||
_backgroundColor->setColor(_options->backgroundColor);
|
_backgroundColor->setColor(_options->backgroundColor);
|
||||||
_backgroundColor->enableAlphaChannel(false);
|
_backgroundColor->enableAlphaChannel(false);
|
||||||
|
|
||||||
QFormLayout *mapLayout = new QFormLayout();
|
QFormLayout *mapLayout = new QFormLayout();
|
||||||
mapLayout->addRow(tr("Background color:"), _backgroundColor);
|
mapLayout->addRow(tr("Background color:"), _backgroundColor);
|
||||||
mapLayout->addRow(tr("Map opacity:"), _mapOpacity);
|
mapLayout->addRow(tr("Map opacity:"), _mapOpacity);
|
||||||
@ -656,7 +665,8 @@ void OptionsDialog::accept()
|
|||||||
_options->sliderColor = _sliderColor->color();
|
_options->sliderColor = _sliderColor->color();
|
||||||
_options->graphAntiAliasing = _graphAA->isChecked();
|
_options->graphAntiAliasing = _graphAA->isChecked();
|
||||||
|
|
||||||
_options->alwaysShowMap = _alwaysShowMap->isChecked();
|
_options->projection = _projection->itemData(_projection->currentIndex())
|
||||||
|
.toInt();
|
||||||
#ifdef ENABLE_HIDPI
|
#ifdef ENABLE_HIDPI
|
||||||
_options->hidpiMap = _hidpi->isChecked();
|
_options->hidpiMap = _hidpi->isChecked();
|
||||||
#endif // ENABLE_HIDPI
|
#endif // ENABLE_HIDPI
|
||||||
|
@ -15,6 +15,7 @@ class QComboBox;
|
|||||||
class QCheckBox;
|
class QCheckBox;
|
||||||
class QRadioButton;
|
class QRadioButton;
|
||||||
class PercentSlider;
|
class PercentSlider;
|
||||||
|
class LimitedComboBox;
|
||||||
|
|
||||||
struct Options {
|
struct Options {
|
||||||
// Appearance
|
// Appearance
|
||||||
@ -37,7 +38,7 @@ struct Options {
|
|||||||
int mapOpacity;
|
int mapOpacity;
|
||||||
QColor backgroundColor;
|
QColor backgroundColor;
|
||||||
// Map
|
// Map
|
||||||
bool alwaysShowMap;
|
int projection;
|
||||||
#ifdef ENABLE_HIDPI
|
#ifdef ENABLE_HIDPI
|
||||||
bool hidpiMap;
|
bool hidpiMap;
|
||||||
#endif // ENABLE_HIDPI
|
#endif // ENABLE_HIDPI
|
||||||
@ -79,11 +80,14 @@ class OptionsDialog : public QDialog
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void accept();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OptionsDialog(Options *options, QWidget *parent = 0);
|
OptionsDialog(Options *options, QWidget *parent = 0);
|
||||||
|
|
||||||
public slots:
|
//private slots:
|
||||||
void accept();
|
// void projectionChanged(int index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QWidget *createMapPage();
|
QWidget *createMapPage();
|
||||||
@ -116,7 +120,7 @@ private:
|
|||||||
ColorBox *_sliderColor;
|
ColorBox *_sliderColor;
|
||||||
QCheckBox *_graphAA;
|
QCheckBox *_graphAA;
|
||||||
// Map
|
// Map
|
||||||
QCheckBox *_alwaysShowMap;
|
LimitedComboBox *_projection;
|
||||||
#ifdef ENABLE_HIDPI
|
#ifdef ENABLE_HIDPI
|
||||||
QRadioButton *_hidpi;
|
QRadioButton *_hidpi;
|
||||||
QRadioButton *_lodpi;
|
QRadioButton *_lodpi;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include "common/greatcircle.h"
|
#include "common/greatcircle.h"
|
||||||
#include "map/map.h"
|
#include "map/map.h"
|
||||||
|
#include "pathtickitem.h"
|
||||||
#include "pathitem.h"
|
#include "pathitem.h"
|
||||||
|
|
||||||
|
|
||||||
@ -23,14 +24,17 @@ PathItem::PathItem(const Path &path, Map *map, QGraphicsItem *parent)
|
|||||||
{
|
{
|
||||||
Q_ASSERT(_path.isValid());
|
Q_ASSERT(_path.isValid());
|
||||||
|
|
||||||
|
_units = Metric;
|
||||||
_digitalZoom = 0;
|
_digitalZoom = 0;
|
||||||
_width = 3;
|
_width = 3;
|
||||||
QBrush brush(Qt::SolidPattern);
|
QBrush brush(Qt::SolidPattern);
|
||||||
_pen = QPen(brush, _width);
|
_pen = QPen(brush, _width);
|
||||||
_showMarker = true;
|
_showMarker = true;
|
||||||
|
_showTicks = false;
|
||||||
|
|
||||||
updatePainterPath();
|
updatePainterPath();
|
||||||
updateShape();
|
updateShape();
|
||||||
|
updateTicks();
|
||||||
|
|
||||||
_markerDistance = _path.first().first().distance();
|
_markerDistance = _path.first().first().distance();
|
||||||
_marker = new MarkerItem(this);
|
_marker = new MarkerItem(this);
|
||||||
@ -111,8 +115,7 @@ void PathItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|||||||
painter->drawPath(_painterPath);
|
painter->drawPath(_painterPath);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
QPen p = QPen(QBrush(Qt::red), 0);
|
painter->setPen(Qt::red);
|
||||||
painter->setPen(p);
|
|
||||||
painter->drawRect(boundingRect());
|
painter->drawRect(boundingRect());
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
@ -125,6 +128,7 @@ void PathItem::setMap(Map *map)
|
|||||||
|
|
||||||
updatePainterPath();
|
updatePainterPath();
|
||||||
updateShape();
|
updateShape();
|
||||||
|
updateTicks();
|
||||||
|
|
||||||
QPointF pos = position(_markerDistance);
|
QPointF pos = position(_markerDistance);
|
||||||
if (isValid(pos))
|
if (isValid(pos))
|
||||||
@ -284,6 +288,75 @@ void PathItem::showMarker(bool show)
|
|||||||
_marker->setVisible(show && isValid(position(_markerDistance)));
|
_marker->setVisible(show && isValid(position(_markerDistance)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qreal PathItem::xInM() const
|
||||||
|
{
|
||||||
|
return (_units == Nautical) ? NMIINM : (_units == Imperial) ? MIINM : KMINM;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned PathItem::tickSize() const
|
||||||
|
{
|
||||||
|
qreal res = _map->resolution(sceneBoundingRect());
|
||||||
|
|
||||||
|
if (res < 10)
|
||||||
|
return 1;
|
||||||
|
else if (res < 25)
|
||||||
|
return 5;
|
||||||
|
else if (res < 100)
|
||||||
|
return 10;
|
||||||
|
else if (res < 500)
|
||||||
|
return 50;
|
||||||
|
else if (res < 2000)
|
||||||
|
return 100;
|
||||||
|
else if (res < 10000)
|
||||||
|
return 500;
|
||||||
|
else if (res < 20000)
|
||||||
|
return 1000;
|
||||||
|
else
|
||||||
|
return 5000;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PathItem::updateTicks()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < _ticks.size(); i++)
|
||||||
|
delete _ticks[i];
|
||||||
|
_ticks.clear();
|
||||||
|
|
||||||
|
if (!_showTicks)
|
||||||
|
return;
|
||||||
|
|
||||||
|
int ts = tickSize();
|
||||||
|
int tc = _path.last().last().distance() / (ts * xInM());
|
||||||
|
QRect tr = PathTickItem::tickRect(ts * tc);
|
||||||
|
|
||||||
|
_ticks.resize(tc);
|
||||||
|
for (int i = 0; i < tc; i++) {
|
||||||
|
_ticks[i] = new PathTickItem(tr, (i + 1) * ts, this);
|
||||||
|
_ticks[i]->setPos(position((i + 1) * ts * xInM()));
|
||||||
|
_ticks[i]->setColor(_pen.color());
|
||||||
|
_ticks[i]->setToolTip(toolTip());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PathItem::showTicks(bool show)
|
||||||
|
{
|
||||||
|
if (_showTicks == show)
|
||||||
|
return;
|
||||||
|
|
||||||
|
prepareGeometryChange();
|
||||||
|
_showTicks = show;
|
||||||
|
updateTicks();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PathItem::setUnits(Units units)
|
||||||
|
{
|
||||||
|
if (_units == units)
|
||||||
|
return;
|
||||||
|
|
||||||
|
prepareGeometryChange();
|
||||||
|
_units = units;
|
||||||
|
updateTicks();
|
||||||
|
}
|
||||||
|
|
||||||
void PathItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
void PathItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||||
{
|
{
|
||||||
Q_UNUSED(event);
|
Q_UNUSED(event);
|
||||||
|
@ -5,8 +5,10 @@
|
|||||||
#include <QPen>
|
#include <QPen>
|
||||||
#include "data/path.h"
|
#include "data/path.h"
|
||||||
#include "markeritem.h"
|
#include "markeritem.h"
|
||||||
|
#include "units.h"
|
||||||
|
|
||||||
class Map;
|
class Map;
|
||||||
|
class PathTickItem;
|
||||||
|
|
||||||
class PathItem : public QGraphicsObject
|
class PathItem : public QGraphicsObject
|
||||||
{
|
{
|
||||||
@ -24,12 +26,16 @@ public:
|
|||||||
|
|
||||||
void setMap(Map *map);
|
void setMap(Map *map);
|
||||||
|
|
||||||
|
void setUnits(Units units);
|
||||||
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 setDigitalZoom(int zoom);
|
||||||
void setMarkerColor(const QColor &color);
|
void setMarkerColor(const QColor &color);
|
||||||
void showMarker(bool show);
|
void showMarker(bool show);
|
||||||
|
void showTicks(bool show);
|
||||||
|
|
||||||
|
Units units() const {return _units;}
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void moveMarker(qreal distance);
|
void moveMarker(qreal distance);
|
||||||
@ -38,10 +44,6 @@ public slots:
|
|||||||
signals:
|
signals:
|
||||||
void selected(bool);
|
void selected(bool);
|
||||||
|
|
||||||
protected:
|
|
||||||
Path _path;
|
|
||||||
MarkerItem *_marker;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const PathSegment *segment(qreal x) const;
|
const PathSegment *segment(qreal x) const;
|
||||||
QPointF position(qreal distance) const;
|
QPointF position(qreal distance) const;
|
||||||
@ -49,19 +51,28 @@ private:
|
|||||||
void updateShape();
|
void updateShape();
|
||||||
void addSegment(const Coordinates &c1, const Coordinates &c2);
|
void addSegment(const Coordinates &c1, const Coordinates &c2);
|
||||||
|
|
||||||
|
qreal xInM() const;
|
||||||
|
unsigned tickSize() const;
|
||||||
|
void updateTicks();
|
||||||
|
|
||||||
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
||||||
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
||||||
|
|
||||||
|
Path _path;
|
||||||
Map *_map;
|
Map *_map;
|
||||||
qreal _markerDistance;
|
qreal _markerDistance;
|
||||||
int _digitalZoom;
|
int _digitalZoom;
|
||||||
|
|
||||||
|
Units _units;
|
||||||
qreal _width;
|
qreal _width;
|
||||||
QPen _pen;
|
QPen _pen;
|
||||||
QPainterPath _shape;
|
QPainterPath _shape;
|
||||||
QPainterPath _painterPath;
|
QPainterPath _painterPath;
|
||||||
bool _showMarker;
|
bool _showMarker;
|
||||||
|
bool _showTicks;
|
||||||
|
|
||||||
|
MarkerItem *_marker;
|
||||||
|
QVector<PathTickItem*> _ticks;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PATHITEM_H
|
#endif // PATHITEM_H
|
||||||
|
71
src/GUI/pathtickitem.cpp
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
#include <QPainter>
|
||||||
|
#include <QCursor>
|
||||||
|
#include "font.h"
|
||||||
|
#include "pathtickitem.h"
|
||||||
|
|
||||||
|
|
||||||
|
static QFont defaultFont()
|
||||||
|
{
|
||||||
|
QFont font;
|
||||||
|
font.setPixelSize(10);
|
||||||
|
font.setFamily(FONT_FAMILY);
|
||||||
|
font.setBold(true);
|
||||||
|
|
||||||
|
return font;
|
||||||
|
}
|
||||||
|
|
||||||
|
QFont PathTickItem::_font = defaultFont();
|
||||||
|
|
||||||
|
PathTickItem::PathTickItem(const QRectF &tickRect, int value,
|
||||||
|
QGraphicsItem *parent) : QGraphicsItem(parent), _tickRect(tickRect),
|
||||||
|
_text(QString::number(value))
|
||||||
|
{
|
||||||
|
_tickRect.moveCenter(QPointF(0, -_tickRect.height()/2.0 - 3));
|
||||||
|
|
||||||
|
setCursor(Qt::ArrowCursor);
|
||||||
|
setAcceptHoverEvents(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
QRectF PathTickItem::boundingRect() const
|
||||||
|
{
|
||||||
|
return _tickRect.adjusted(0, 0, 0, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PathTickItem::paint(QPainter *painter,
|
||||||
|
const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
|
{
|
||||||
|
Q_UNUSED(option);
|
||||||
|
Q_UNUSED(widget);
|
||||||
|
|
||||||
|
QPointF arrow[3] = {QPointF(0, 0), QPointF(3, -3), QPointF(-3, -3)};
|
||||||
|
|
||||||
|
painter->setFont(_font);
|
||||||
|
painter->setRenderHint(QPainter::Antialiasing, false);
|
||||||
|
|
||||||
|
painter->setPen(Qt::white);
|
||||||
|
painter->setBrush(_brush);
|
||||||
|
painter->drawPolygon(arrow, 3);
|
||||||
|
painter->drawRoundedRect(_tickRect, 1.5, 1.5);
|
||||||
|
painter->drawText(_tickRect, Qt::AlignCenter, _text);
|
||||||
|
|
||||||
|
/*
|
||||||
|
painter->setBrush(Qt::NoBrush);
|
||||||
|
painter->setPen(Qt::red);
|
||||||
|
painter->drawRect(boundingRect());
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
void PathTickItem::setPos(const QPointF &pos)
|
||||||
|
{
|
||||||
|
/* For propper rounded rect rendering, the item must be positioned in the
|
||||||
|
middle of a pixel */
|
||||||
|
QPoint p(pos.toPoint());
|
||||||
|
QGraphicsItem::setPos(QPointF(p.x() - 0.5, p.y() - 0.5));
|
||||||
|
}
|
||||||
|
|
||||||
|
QRect PathTickItem::tickRect(int value)
|
||||||
|
{
|
||||||
|
QFontMetrics fm(_font);
|
||||||
|
return fm.boundingRect(QRect(), Qt::AlignCenter,
|
||||||
|
QString::number(qMax(value, 10))).adjusted(-2, 0, 2, 0);
|
||||||
|
}
|
29
src/GUI/pathtickitem.h
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#ifndef PATHTICKITEM_H
|
||||||
|
#define PATHTICKITEM_H
|
||||||
|
|
||||||
|
#include <QFont>
|
||||||
|
#include <QGraphicsItem>
|
||||||
|
|
||||||
|
class PathTickItem : public QGraphicsItem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PathTickItem(const QRectF &tickRect, int value, QGraphicsItem *parent = 0);
|
||||||
|
|
||||||
|
QRectF boundingRect() const;
|
||||||
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
|
QWidget *widget);
|
||||||
|
|
||||||
|
void setPos(const QPointF &pos);
|
||||||
|
void setColor(const QColor &color) {_brush = QBrush(color);}
|
||||||
|
|
||||||
|
static QRect tickRect(int value);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QRectF _tickRect;
|
||||||
|
QString _text;
|
||||||
|
QBrush _brush;
|
||||||
|
|
||||||
|
static QFont _font;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // PATHTICKITEM_H
|
@ -15,7 +15,7 @@ QString RouteItem::toolTip(Units units) const
|
|||||||
tt.insert(tr("Name"), _name);
|
tt.insert(tr("Name"), _name);
|
||||||
if (!_desc.isEmpty())
|
if (!_desc.isEmpty())
|
||||||
tt.insert(tr("Description"), _desc);
|
tt.insert(tr("Description"), _desc);
|
||||||
tt.insert(tr("Distance"), Format::distance(_path.last().last().distance(),
|
tt.insert(tr("Distance"), Format::distance(path().last().last().distance(),
|
||||||
units));
|
units));
|
||||||
|
|
||||||
return tt.toString();
|
return tt.toString();
|
||||||
@ -26,12 +26,12 @@ RouteItem::RouteItem(const Route &route, Map *map, QGraphicsItem *parent)
|
|||||||
{
|
{
|
||||||
const QVector<Waypoint> &waypoints = route.waypoints();
|
const QVector<Waypoint> &waypoints = route.waypoints();
|
||||||
|
|
||||||
|
_waypoints.resize(waypoints.size());
|
||||||
for (int i = 0; i < waypoints.size(); i++)
|
for (int i = 0; i < waypoints.size(); i++)
|
||||||
new WaypointItem(waypoints.at(i), map, this);
|
_waypoints[i] = new WaypointItem(waypoints.at(i), map, this);
|
||||||
|
|
||||||
_name = route.name();
|
_name = route.name();
|
||||||
_desc = route.description();
|
_desc = route.description();
|
||||||
_units = Metric;
|
|
||||||
_coordinatesFormat = DecimalDegrees;
|
_coordinatesFormat = DecimalDegrees;
|
||||||
|
|
||||||
setToolTip(toolTip(Metric));
|
setToolTip(toolTip(Metric));
|
||||||
@ -39,33 +39,23 @@ RouteItem::RouteItem(const Route &route, Map *map, QGraphicsItem *parent)
|
|||||||
|
|
||||||
void RouteItem::setMap(Map *map)
|
void RouteItem::setMap(Map *map)
|
||||||
{
|
{
|
||||||
QList<QGraphicsItem *> childs = childItems();
|
for (int i = 0; i < _waypoints.count(); i++)
|
||||||
for (int i = 0; i < childs.count(); i++) {
|
_waypoints[i]->setMap(map);
|
||||||
if (childs.at(i) != _marker) {
|
|
||||||
WaypointItem *wi = static_cast<WaypointItem*>(childs.at(i));
|
|
||||||
wi->setMap(map);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PathItem::setMap(map);
|
PathItem::setMap(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RouteItem::setUnits(Units units)
|
void RouteItem::setUnits(Units u)
|
||||||
{
|
{
|
||||||
if (_units == units)
|
if (units() == u)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_units = units;
|
PathItem::setUnits(u);
|
||||||
|
|
||||||
setToolTip(toolTip(_units));
|
setToolTip(toolTip(units()));
|
||||||
|
|
||||||
QList<QGraphicsItem *> childs = childItems();
|
for (int i = 0; i < _waypoints.count(); i++)
|
||||||
for (int i = 0; i < childs.count(); i++) {
|
_waypoints[i]->setToolTipFormat(units(), _coordinatesFormat);
|
||||||
if (childs.at(i) != _marker) {
|
|
||||||
WaypointItem *wi = static_cast<WaypointItem*>(childs.at(i));
|
|
||||||
wi->setToolTipFormat(_units, _coordinatesFormat);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RouteItem::setCoordinatesFormat(CoordinatesFormat format)
|
void RouteItem::setCoordinatesFormat(CoordinatesFormat format)
|
||||||
@ -75,30 +65,18 @@ void RouteItem::setCoordinatesFormat(CoordinatesFormat format)
|
|||||||
|
|
||||||
_coordinatesFormat = format;
|
_coordinatesFormat = format;
|
||||||
|
|
||||||
QList<QGraphicsItem *> childs = childItems();
|
for (int i = 0; i < _waypoints.count(); i++)
|
||||||
for (int i = 0; i < childs.count(); i++) {
|
_waypoints[i]->setToolTipFormat(units(), _coordinatesFormat);
|
||||||
if (childs.at(i) != _marker) {
|
|
||||||
WaypointItem *wi = static_cast<WaypointItem*>(childs.at(i));
|
|
||||||
wi->setToolTipFormat(_units, _coordinatesFormat);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RouteItem::showWaypoints(bool show)
|
void RouteItem::showWaypoints(bool show)
|
||||||
{
|
{
|
||||||
QList<QGraphicsItem *> childs = childItems();
|
for (int i = 0; i < _waypoints.count(); i++)
|
||||||
for (int i = 0; i < childs.count(); i++)
|
_waypoints[i]->setVisible(show);
|
||||||
if (childs.at(i) != _marker)
|
|
||||||
childs.at(i)->setVisible(show);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RouteItem::showWaypointLabels(bool show)
|
void RouteItem::showWaypointLabels(bool show)
|
||||||
{
|
{
|
||||||
QList<QGraphicsItem *> childs = childItems();
|
for (int i = 0; i < _waypoints.count(); i++)
|
||||||
for (int i = 0; i < childs.count(); i++) {
|
_waypoints[i]->showLabel(show);
|
||||||
if (childs.at(i) != _marker) {
|
|
||||||
WaypointItem *wi = static_cast<WaypointItem*>(childs.at(i));
|
|
||||||
wi->showLabel(show);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include "format.h"
|
#include "format.h"
|
||||||
|
|
||||||
class Map;
|
class Map;
|
||||||
|
class WaypointItem;
|
||||||
|
|
||||||
class RouteItem : public PathItem
|
class RouteItem : public PathItem
|
||||||
{
|
{
|
||||||
@ -17,7 +18,7 @@ public:
|
|||||||
|
|
||||||
void setMap(Map *map);
|
void setMap(Map *map);
|
||||||
|
|
||||||
void setUnits(Units units);
|
void setUnits(Units u);
|
||||||
void setCoordinatesFormat(CoordinatesFormat format);
|
void setCoordinatesFormat(CoordinatesFormat format);
|
||||||
void showWaypoints(bool show);
|
void showWaypoints(bool show);
|
||||||
void showWaypointLabels(bool show);
|
void showWaypointLabels(bool show);
|
||||||
@ -27,8 +28,9 @@ private:
|
|||||||
|
|
||||||
QString _name;
|
QString _name;
|
||||||
QString _desc;
|
QString _desc;
|
||||||
Units _units;
|
|
||||||
CoordinatesFormat _coordinatesFormat;
|
CoordinatesFormat _coordinatesFormat;
|
||||||
|
|
||||||
|
QVector<WaypointItem*> _waypoints;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ROUTEITEM_H
|
#endif // ROUTEITEM_H
|
||||||
|
@ -61,9 +61,9 @@ void ScaleItem::computeScale()
|
|||||||
qreal res = _res * pow(2, -_digitalZoom);
|
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, true);
|
||||||
if (_length >= MIINFT) {
|
if (_length >= MIINFT) {
|
||||||
_length = niceNum((res * M2MI * SCALE_WIDTH) / SEGMENTS, 1);
|
_length = niceNum((res * M2MI * SCALE_WIDTH) / SEGMENTS, true);
|
||||||
_width = (_length / (res * M2MI));
|
_width = (_length / (res * M2MI));
|
||||||
_scale = true;
|
_scale = true;
|
||||||
} else {
|
} else {
|
||||||
@ -71,9 +71,9 @@ void ScaleItem::computeScale()
|
|||||||
_scale = false;
|
_scale = false;
|
||||||
}
|
}
|
||||||
} else if (_units == Nautical) {
|
} else if (_units == Nautical) {
|
||||||
_length = niceNum((res * M2FT * SCALE_WIDTH) / SEGMENTS, 1);
|
_length = niceNum((res * M2FT * SCALE_WIDTH) / SEGMENTS, true);
|
||||||
if (_length >= NMIINFT) {
|
if (_length >= NMIINFT) {
|
||||||
_length = niceNum((res * M2NMI * SCALE_WIDTH) / SEGMENTS, 1);
|
_length = niceNum((res * M2NMI * SCALE_WIDTH) / SEGMENTS, true);
|
||||||
_width = (_length / (res * M2NMI));
|
_width = (_length / (res * M2NMI));
|
||||||
_scale = true;
|
_scale = true;
|
||||||
} else {
|
} else {
|
||||||
@ -81,7 +81,7 @@ void ScaleItem::computeScale()
|
|||||||
_scale = false;
|
_scale = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_length = niceNum((res * SCALE_WIDTH) / SEGMENTS, 1);
|
_length = niceNum((res * SCALE_WIDTH) / SEGMENTS, true);
|
||||||
if (_length >= KMINM) {
|
if (_length >= KMINM) {
|
||||||
_length *= M2KM;
|
_length *= M2KM;
|
||||||
_width = (_length / (res * M2KM));
|
_width = (_length / (res * M2KM));
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
#define SHOW_GRAPH_SLIDER_INFO_DEFAULT true
|
#define SHOW_GRAPH_SLIDER_INFO_DEFAULT true
|
||||||
#define SHOW_MARKERS_SETTING "pathMarkers"
|
#define SHOW_MARKERS_SETTING "pathMarkers"
|
||||||
#define SHOW_MARKERS_DEFAULT true
|
#define SHOW_MARKERS_DEFAULT true
|
||||||
|
#define SHOW_TICKS_SETTING "pathTicks"
|
||||||
|
#define SHOW_TICKS_DEFAULT false
|
||||||
|
|
||||||
#define MAP_SETTINGS_GROUP "Map"
|
#define MAP_SETTINGS_GROUP "Map"
|
||||||
#define CURRENT_MAP_SETTING "map"
|
#define CURRENT_MAP_SETTING "map"
|
||||||
@ -171,8 +173,8 @@
|
|||||||
#define SEPARATE_GRAPH_PAGE_DEFAULT false
|
#define SEPARATE_GRAPH_PAGE_DEFAULT false
|
||||||
#define SLIDER_COLOR_SETTING "sliderColor"
|
#define SLIDER_COLOR_SETTING "sliderColor"
|
||||||
#define SLIDER_COLOR_DEFAULT QColor(Qt::red)
|
#define SLIDER_COLOR_DEFAULT QColor(Qt::red)
|
||||||
#define ALWAYS_SHOW_MAP_SETTING "alwaysShowMap"
|
#define PROJECTION_SETTING "projection"
|
||||||
#define ALWAYS_SHOW_MAP_DEFAULT true
|
#define PROJECTION_DEFAULT 3857
|
||||||
#define HIDPI_MAP_SETTING "HiDPIMap"
|
#define HIDPI_MAP_SETTING "HiDPIMap"
|
||||||
#define HIDPI_MAP_DEFAULT true
|
#define HIDPI_MAP_DEFAULT true
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ QString TrackItem::toolTip(Units units) const
|
|||||||
tt.insert(tr("Name"), _name);
|
tt.insert(tr("Name"), _name);
|
||||||
if (!_desc.isEmpty())
|
if (!_desc.isEmpty())
|
||||||
tt.insert(tr("Description"), _desc);
|
tt.insert(tr("Description"), _desc);
|
||||||
tt.insert(tr("Distance"), Format::distance(_path.last().last().distance(),
|
tt.insert(tr("Distance"), Format::distance(path().last().last().distance(),
|
||||||
units));
|
units));
|
||||||
if (_time > 0)
|
if (_time > 0)
|
||||||
tt.insert(tr("Total time"), Format::timeSpan(_time));
|
tt.insert(tr("Total time"), Format::timeSpan(_time));
|
||||||
@ -39,5 +39,6 @@ TrackItem::TrackItem(const Track &track, Map *map, QGraphicsItem *parent)
|
|||||||
|
|
||||||
void TrackItem::setUnits(Units units)
|
void TrackItem::setUnits(Units units)
|
||||||
{
|
{
|
||||||
|
PathItem::setUnits(units);
|
||||||
setToolTip(toolTip(units));
|
setToolTip(toolTip(units));
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,8 @@
|
|||||||
#define ENABLE_HIDPI
|
#define ENABLE_HIDPI
|
||||||
#endif // QT >= 5.6
|
#endif // QT >= 5.6
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||||
|
#define ENABLE_GEOJSON
|
||||||
|
#endif // QT >= 5.0
|
||||||
|
|
||||||
#endif /* CONFIG_H */
|
#endif /* CONFIG_H */
|
||||||
|
@ -9,9 +9,11 @@
|
|||||||
#define DEM_DIR "DEM"
|
#define DEM_DIR "DEM"
|
||||||
#define TILES_DIR "tiles"
|
#define TILES_DIR "tiles"
|
||||||
#define TRANSLATIONS_DIR "translations"
|
#define TRANSLATIONS_DIR "translations"
|
||||||
|
#define STYLE_DIR "style"
|
||||||
#define ELLIPSOID_FILE "ellipsoids.csv"
|
#define ELLIPSOID_FILE "ellipsoids.csv"
|
||||||
#define GCS_FILE "gcs.csv"
|
#define GCS_FILE "gcs.csv"
|
||||||
#define PCS_FILE "pcs.csv"
|
#define PCS_FILE "pcs.csv"
|
||||||
|
#define TYP_FILE "style.typ"
|
||||||
|
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
|
||||||
@ -31,7 +33,7 @@
|
|||||||
#else
|
#else
|
||||||
#define USER_DIR QDir::homePath() + QString("/.local/share/") \
|
#define USER_DIR QDir::homePath() + QString("/.local/share/") \
|
||||||
+ qApp->applicationName()
|
+ qApp->applicationName()
|
||||||
#define GLOBAL_DIR QString("/usr/share/") + qApp->applicationName()
|
#define GLOBAL_DIR QString(PREFIX "/share/") + qApp->applicationName()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static QString dir(const QString &dirName, bool writable = false)
|
static QString dir(const QString &dirName, bool writable = false)
|
||||||
@ -79,6 +81,11 @@ QString ProgramPaths::demDir(bool writable)
|
|||||||
return dir(DEM_DIR, writable);
|
return dir(DEM_DIR, writable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString ProgramPaths::styleDir(bool writable)
|
||||||
|
{
|
||||||
|
return dir(STYLE_DIR, writable);
|
||||||
|
}
|
||||||
|
|
||||||
QString ProgramPaths::tilesDir()
|
QString ProgramPaths::tilesDir()
|
||||||
{
|
{
|
||||||
#if defined(Q_OS_WIN32)
|
#if defined(Q_OS_WIN32)
|
||||||
@ -113,6 +120,11 @@ QString ProgramPaths::pcsFile()
|
|||||||
return file(dir(CSV_DIR), PCS_FILE);
|
return file(dir(CSV_DIR), PCS_FILE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString ProgramPaths::typFile()
|
||||||
|
{
|
||||||
|
return file(dir(STYLE_DIR), TYP_FILE);
|
||||||
|
}
|
||||||
|
|
||||||
#else // QT_VERSION < 5
|
#else // QT_VERSION < 5
|
||||||
|
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
@ -157,6 +169,16 @@ QString ProgramPaths::demDir(bool writable)
|
|||||||
DEM_DIR, QStandardPaths::LocateDirectory);
|
DEM_DIR, QStandardPaths::LocateDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString ProgramPaths::styleDir(bool writable)
|
||||||
|
{
|
||||||
|
if (writable)
|
||||||
|
return QDir(QStandardPaths::writableLocation(
|
||||||
|
QStandardPaths::AppDataLocation)).filePath(STYLE_DIR);
|
||||||
|
else
|
||||||
|
return QStandardPaths::locate(QStandardPaths::AppDataLocation,
|
||||||
|
STYLE_DIR, QStandardPaths::LocateDirectory);
|
||||||
|
}
|
||||||
|
|
||||||
QString ProgramPaths::tilesDir()
|
QString ProgramPaths::tilesDir()
|
||||||
{
|
{
|
||||||
return QDir(QStandardPaths::writableLocation(
|
return QDir(QStandardPaths::writableLocation(
|
||||||
@ -187,4 +209,10 @@ QString ProgramPaths::pcsFile()
|
|||||||
CSV_DIR "/" PCS_FILE, QStandardPaths::LocateFile);
|
CSV_DIR "/" PCS_FILE, QStandardPaths::LocateFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString ProgramPaths::typFile()
|
||||||
|
{
|
||||||
|
return QStandardPaths::locate(QStandardPaths::AppDataLocation,
|
||||||
|
STYLE_DIR "/" TYP_FILE, QStandardPaths::LocateFile);
|
||||||
|
}
|
||||||
|
|
||||||
#endif // QT_VERSION < 5
|
#endif // QT_VERSION < 5
|
||||||
|
@ -9,11 +9,13 @@ namespace ProgramPaths
|
|||||||
QString poiDir(bool writable = false);
|
QString poiDir(bool writable = false);
|
||||||
QString csvDir(bool writable = false);
|
QString csvDir(bool writable = false);
|
||||||
QString demDir(bool writable = false);
|
QString demDir(bool writable = false);
|
||||||
|
QString styleDir(bool writable = false);
|
||||||
QString tilesDir();
|
QString tilesDir();
|
||||||
QString translationsDir();
|
QString translationsDir();
|
||||||
QString ellipsoidsFile();
|
QString ellipsoidsFile();
|
||||||
QString gcsFile();
|
QString gcsFile();
|
||||||
QString pcsFile();
|
QString pcsFile();
|
||||||
|
QString typFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // PROGRAMPATHS_H
|
#endif // PROGRAMPATHS_H
|
||||||
|
@ -28,6 +28,11 @@ public:
|
|||||||
double left() const {return _tl.lon();}
|
double left() const {return _tl.lon();}
|
||||||
double right() const {return _br.lon();}
|
double right() const {return _br.lon();}
|
||||||
|
|
||||||
|
void setLeft(double val) {_tl.rlon() = val;}
|
||||||
|
void setRight(double val) {_br.rlon() = val;}
|
||||||
|
void setTop(double val) {_tl.rlat() = val;}
|
||||||
|
void setBottom(double val) {_br.rlat() = val;}
|
||||||
|
|
||||||
RectC operator|(const RectC &r) const;
|
RectC operator|(const RectC &r) const;
|
||||||
RectC &operator|=(const RectC &r) {*this = *this | r; return *this;}
|
RectC &operator|=(const RectC &r) {*this = *this | r; return *this;}
|
||||||
RectC operator&(const RectC &r) const;
|
RectC operator&(const RectC &r) const;
|
||||||
@ -35,6 +40,13 @@ public:
|
|||||||
|
|
||||||
RectC united(const Coordinates &c) const;
|
RectC united(const Coordinates &c) const;
|
||||||
|
|
||||||
|
bool intersects(const RectC &r) const
|
||||||
|
{return (right() >= r.left() && bottom() <= r.top() && left() <= r.right()
|
||||||
|
&& top() >= r.bottom());}
|
||||||
|
bool contains(const Coordinates&c) const
|
||||||
|
{return (c.lon() >= left() && c.lon() <= right() && c.lat() <= top()
|
||||||
|
&& c.lat() >= bottom());}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Coordinates _tl, _br;
|
Coordinates _tl, _br;
|
||||||
};
|
};
|
||||||
|
@ -215,6 +215,8 @@ public:
|
|||||||
StackElement m_stack[MAX_STACK];
|
StackElement m_stack[MAX_STACK];
|
||||||
// Top Of Stack index
|
// Top Of Stack index
|
||||||
int m_tos;
|
int m_tos;
|
||||||
|
|
||||||
|
friend class RTree;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Get 'first' for iteration
|
// Get 'first' for iteration
|
||||||
|
@ -17,7 +17,7 @@ int str2int(const char *str, int len)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
double niceNum(double x, int round)
|
double niceNum(double x, bool round)
|
||||||
{
|
{
|
||||||
int expv;
|
int expv;
|
||||||
double f;
|
double f;
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
#define UTIL_H
|
#define UTIL_H
|
||||||
|
|
||||||
int str2int(const char *str, int len);
|
int str2int(const char *str, int len);
|
||||||
double niceNum(double x, int round);
|
double niceNum(double x, bool round);
|
||||||
|
|
||||||
#endif // UTIL_H
|
#endif // UTIL_H
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
|
#include "common/config.h"
|
||||||
#include "gpxparser.h"
|
#include "gpxparser.h"
|
||||||
#include "tcxparser.h"
|
#include "tcxparser.h"
|
||||||
#include "csvparser.h"
|
#include "csvparser.h"
|
||||||
@ -12,9 +13,9 @@
|
|||||||
#include "oziparsers.h"
|
#include "oziparsers.h"
|
||||||
#include "locparser.h"
|
#include "locparser.h"
|
||||||
#include "slfparser.h"
|
#include "slfparser.h"
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
#ifdef ENABLE_GEOJSON
|
||||||
#include "geojsonparser.h"
|
#include "geojsonparser.h"
|
||||||
#endif // QT 5
|
#endif // ENABLE_GEOJSON
|
||||||
#include "exifparser.h"
|
#include "exifparser.h"
|
||||||
#include "dem.h"
|
#include "dem.h"
|
||||||
#include "data.h"
|
#include "data.h"
|
||||||
@ -32,9 +33,9 @@ static WPTParser wpt;
|
|||||||
static RTEParser rte;
|
static RTEParser rte;
|
||||||
static LOCParser loc;
|
static LOCParser loc;
|
||||||
static SLFParser slf;
|
static SLFParser slf;
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
#ifdef ENABLE_GEOJSON
|
||||||
static GeoJSONParser geojson;
|
static GeoJSONParser geojson;
|
||||||
#endif // QT 5
|
#endif // ENABLE_GEOJSON
|
||||||
static EXIFParser exif;
|
static EXIFParser exif;
|
||||||
|
|
||||||
static QHash<QString, Parser*> parsers()
|
static QHash<QString, Parser*> parsers()
|
||||||
@ -53,10 +54,10 @@ static QHash<QString, Parser*> parsers()
|
|||||||
hash.insert("rte", &rte);
|
hash.insert("rte", &rte);
|
||||||
hash.insert("loc", &loc);
|
hash.insert("loc", &loc);
|
||||||
hash.insert("slf", &slf);
|
hash.insert("slf", &slf);
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
#ifdef ENABLE_GEOJSON
|
||||||
hash.insert("json", &geojson);
|
hash.insert("json", &geojson);
|
||||||
hash.insert("geojson", &geojson);
|
hash.insert("geojson", &geojson);
|
||||||
#endif // QT 5
|
#endif // ENABLE_GEOJSON
|
||||||
hash.insert("jpeg", &exif);
|
hash.insert("jpeg", &exif);
|
||||||
hash.insert("jpg", &exif);
|
hash.insert("jpg", &exif);
|
||||||
|
|
||||||
@ -147,9 +148,9 @@ QString Data::formats()
|
|||||||
qApp->translate("Data", "Supported files") + " (" + supported + ");;"
|
qApp->translate("Data", "Supported files") + " (" + supported + ");;"
|
||||||
+ qApp->translate("Data", "CSV files") + " (*.csv);;"
|
+ qApp->translate("Data", "CSV files") + " (*.csv);;"
|
||||||
+ qApp->translate("Data", "FIT files") + " (*.fit);;"
|
+ qApp->translate("Data", "FIT files") + " (*.fit);;"
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
#ifdef ENABLE_GEOJSON
|
||||||
+ qApp->translate("Data", "GeoJSON files") + " (*.geojson *.json);;"
|
+ qApp->translate("Data", "GeoJSON files") + " (*.geojson *.json);;"
|
||||||
#endif // QT5
|
#endif // ENABLE_GEOJSON
|
||||||
+ qApp->translate("Data", "GPX files") + " (*.gpx);;"
|
+ qApp->translate("Data", "GPX files") + " (*.gpx);;"
|
||||||
+ qApp->translate("Data", "IGC files") + " (*.igc);;"
|
+ qApp->translate("Data", "IGC files") + " (*.igc);;"
|
||||||
+ qApp->translate("Data", "JPEG images") + " (*.jpg *.jpeg);;"
|
+ qApp->translate("Data", "JPEG images") + " (*.jpg *.jpeg);;"
|
||||||
|
@ -118,6 +118,9 @@ void GPXParser::trackpointData(Trackpoint &trackpoint)
|
|||||||
trackpoint.setTimestamp(time());
|
trackpoint.setTimestamp(time());
|
||||||
else if (_reader.name() == QLatin1String("geoidheight"))
|
else if (_reader.name() == QLatin1String("geoidheight"))
|
||||||
gh = number();
|
gh = number();
|
||||||
|
// GPX 1.0
|
||||||
|
else if (_reader.name() == QLatin1String("speed"))
|
||||||
|
trackpoint.setSpeed(number());
|
||||||
else if (_reader.name() == QLatin1String("extensions"))
|
else if (_reader.name() == QLatin1String("extensions"))
|
||||||
trkptExtensions(trackpoint);
|
trkptExtensions(trackpoint);
|
||||||
else
|
else
|
||||||
|
@ -217,7 +217,7 @@ Graph Track::speed() const
|
|||||||
v = 0;
|
v = 0;
|
||||||
stop.append(gs.size());
|
stop.append(gs.size());
|
||||||
} else if (_useReportedSpeed && sd.at(j).hasSpeed()
|
} else if (_useReportedSpeed && sd.at(j).hasSpeed()
|
||||||
&& seg.outliers.contains(j))
|
&& !seg.outliers.contains(j))
|
||||||
v = sd.at(j).speed();
|
v = sd.at(j).speed();
|
||||||
else if (!std::isnan(seg.speed.at(j)) && !seg.outliers.contains(j))
|
else if (!std::isnan(seg.speed.at(j)) && !seg.outliers.contains(j))
|
||||||
v = seg.speed.at(j);
|
v = seg.speed.at(j);
|
||||||
|
39
src/map/IMG/bitmapline.cpp
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#include <QPainter>
|
||||||
|
#include <QImage>
|
||||||
|
#include "bitmapline.h"
|
||||||
|
|
||||||
|
static QImage img2line(const QImage &img, int width)
|
||||||
|
{
|
||||||
|
Q_ASSERT(img.format() == QImage::Format_ARGB32_Premultiplied);
|
||||||
|
QImage res(width, img.height(), QImage::Format_ARGB32_Premultiplied);
|
||||||
|
const int srcBpl = img.bytesPerLine();
|
||||||
|
const int dstBpl = res.bytesPerLine();
|
||||||
|
const uchar *srcBits = img.bits();
|
||||||
|
uchar *dstBits = res.bits();
|
||||||
|
|
||||||
|
for (int i = 0; i < img.height(); i++) {
|
||||||
|
const uchar *srcLine = srcBits + srcBpl * i;
|
||||||
|
uchar *dstLine = dstBits + dstBpl * i;
|
||||||
|
|
||||||
|
for (int j = dstBpl; j > 0; j -= srcBpl, dstLine += srcBpl)
|
||||||
|
memcpy(dstLine, srcLine, qMin(j, srcBpl));
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BitmapLine::draw(QPainter *painter, const QPolygonF &line,
|
||||||
|
const QImage &img)
|
||||||
|
{
|
||||||
|
for (int i = 1; i < line.size(); i++) {
|
||||||
|
QLineF segment(line.at(i-1).x(), line.at(i-1).y(), line.at(i).x(),
|
||||||
|
line.at(i).y());
|
||||||
|
|
||||||
|
painter->save();
|
||||||
|
painter->translate(segment.p1());
|
||||||
|
painter->rotate(-segment.angle());
|
||||||
|
painter->drawImage(0, -img.height()/2, img2line(img, segment.length()));
|
||||||
|
painter->restore();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|