mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-01 21:39:15 +02:00
Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
201b3f6dae | |||
04f2a08b78 | |||
a736e3204f | |||
08f503249d | |||
f05e6ce29f | |||
209f58412a | |||
919d53ade9 | |||
4cba2ddefd | |||
e52a163529 | |||
70238062f2 | |||
7d749dfe5b | |||
64e65679fe | |||
7a6e60b83d | |||
a1ac09f615 | |||
236d045492 | |||
ba4ac9fe51 | |||
59d8b3cc77 |
@ -4,7 +4,7 @@ GPX viewer and analyzer.
|
||||
* User-definable map sources.
|
||||
* Track and elevation/speed graphs.
|
||||
* Support for multiple tracks in one view.
|
||||
* Support for POI files (Garmin CSV format).
|
||||
* Support for POI files.
|
||||
* Export to PDF.
|
||||
* Native GUI for Windows, Mac OS X and Linux.
|
||||
|
||||
@ -23,7 +23,8 @@ nmake release
|
||||
```
|
||||
|
||||
## Binaries
|
||||
Available at Sourceforge: http://sourceforge.net/projects/gpxsee
|
||||
* Windows & OS X builds: http://sourceforge.net/projects/gpxsee
|
||||
* Linux packages: https://build.opensuse.org/project/repositories/home:tumic:GPXSee
|
||||
|
||||
## Homepage
|
||||
GPXSee homepage: http://tumic.wz.cz/gpxsee
|
||||
|
@ -64,7 +64,7 @@ Section "GPXSee (required)" SEC_APP
|
||||
; Write the uninstall keys for Windows
|
||||
WriteRegStr HKLM "${REGENTRY}" "DisplayName" "GPXSee"
|
||||
WriteRegStr HKLM "${REGENTRY}" "Publisher" "Martin Tuma"
|
||||
WriteRegStr HKLM "${REGENTRY}" "DisplayVersion" "2.7"
|
||||
WriteRegStr HKLM "${REGENTRY}" "DisplayVersion" "2.8"
|
||||
WriteRegStr HKLM "${REGENTRY}" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
||||
WriteRegDWORD HKLM "${REGENTRY}" "NoModify" 1
|
||||
WriteRegDWORD HKLM "${REGENTRY}" "NoRepair" 1
|
||||
|
12
gpxsee.pro
12
gpxsee.pro
@ -13,8 +13,6 @@ HEADERS += src/config.h \
|
||||
src/rtree.h \
|
||||
src/ll.h \
|
||||
src/axisitem.h \
|
||||
src/poiitem.h \
|
||||
src/colorshop.h \
|
||||
src/keys.h \
|
||||
src/slideritem.h \
|
||||
src/markeritem.h \
|
||||
@ -33,7 +31,9 @@ HEADERS += src/config.h \
|
||||
src/trackview.h \
|
||||
src/track.h \
|
||||
src/graphview.h \
|
||||
src/trackpoint.h
|
||||
src/trackpoint.h \
|
||||
src/waypointitem.h \
|
||||
src/palette.h
|
||||
SOURCES += src/main.cpp \
|
||||
src/gui.cpp \
|
||||
src/gpx.cpp \
|
||||
@ -41,8 +41,6 @@ SOURCES += src/main.cpp \
|
||||
src/poi.cpp \
|
||||
src/ll.cpp \
|
||||
src/axisitem.cpp \
|
||||
src/poiitem.cpp \
|
||||
src/colorshop.cpp \
|
||||
src/slideritem.cpp \
|
||||
src/markeritem.cpp \
|
||||
src/infoitem.cpp \
|
||||
@ -57,7 +55,9 @@ SOURCES += src/main.cpp \
|
||||
src/nicenum.cpp \
|
||||
src/trackview.cpp \
|
||||
src/track.cpp \
|
||||
src/graphview.cpp
|
||||
src/graphview.cpp \
|
||||
src/waypointitem.cpp \
|
||||
src/palette.cpp
|
||||
RESOURCES += gpxsee.qrc
|
||||
TRANSLATIONS = lang/gpxsee_cs.ts
|
||||
macx:ICON = icons/gpxsee.icns
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.0" language="cs_CZ">
|
||||
<TS version="2.1" language="cs_CZ">
|
||||
<context>
|
||||
<name>ElevationGraph</name>
|
||||
<message>
|
||||
@ -59,336 +59,346 @@
|
||||
<context>
|
||||
<name>GUI</name>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="140"/>
|
||||
<location filename="../src/gui.cpp" line="161"/>
|
||||
<source>About Qt</source>
|
||||
<translation>O Qt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="350"/>
|
||||
<location filename="../src/gui.cpp" line="380"/>
|
||||
<source>GPXSee is distributed under the terms of the GNU General Public License version 3. For more info about GPXSee visit the project homepage at </source>
|
||||
<translation>Program GPXSee je distribuován pod podmínkami licence GNU General Public License verze 3. Pro více informací navštivte stránky programu na adrese </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="411"/>
|
||||
<location filename="../src/gui.cpp" line="441"/>
|
||||
<source>Open file</source>
|
||||
<translation>Otevřít soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="154"/>
|
||||
<location filename="../src/gui.cpp" line="175"/>
|
||||
<source>Save as</source>
|
||||
<translation>Uložit jako</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="471"/>
|
||||
<location filename="../src/gui.cpp" line="501"/>
|
||||
<source>Open POI file</source>
|
||||
<translation>Otevřít POI soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="145"/>
|
||||
<location filename="../src/gui.cpp" line="166"/>
|
||||
<source>Open</source>
|
||||
<translation>Otevřít</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="128"/>
|
||||
<location filename="../src/gui.cpp" line="149"/>
|
||||
<source>Quit</source>
|
||||
<translation>Ukončit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="135"/>
|
||||
<location filename="../src/gui.cpp" line="366"/>
|
||||
<location filename="../src/gui.cpp" line="367"/>
|
||||
<location filename="../src/gui.cpp" line="156"/>
|
||||
<location filename="../src/gui.cpp" line="396"/>
|
||||
<location filename="../src/gui.cpp" line="397"/>
|
||||
<source>Keyboard controls</source>
|
||||
<translation>Ovládací klávesy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="149"/>
|
||||
<location filename="../src/gui.cpp" line="170"/>
|
||||
<source>Save</source>
|
||||
<translation>Uložit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="159"/>
|
||||
<location filename="../src/gui.cpp" line="180"/>
|
||||
<source>Close</source>
|
||||
<translation>Zavřít</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="164"/>
|
||||
<location filename="../src/gui.cpp" line="185"/>
|
||||
<source>Reload</source>
|
||||
<translation>Znovu načíst</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="287"/>
|
||||
<location filename="../src/gui.cpp" line="317"/>
|
||||
<source>Show</source>
|
||||
<translation>Zobrazit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="237"/>
|
||||
<location filename="../src/gui.cpp" line="278"/>
|
||||
<location filename="../src/gui.cpp" line="262"/>
|
||||
<location filename="../src/gui.cpp" line="308"/>
|
||||
<source>File</source>
|
||||
<translation>Soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="133"/>
|
||||
<location filename="../src/gui.cpp" line="384"/>
|
||||
<location filename="../src/gui.cpp" line="385"/>
|
||||
<location filename="../src/gui.cpp" line="154"/>
|
||||
<location filename="../src/gui.cpp" line="414"/>
|
||||
<location filename="../src/gui.cpp" line="415"/>
|
||||
<source>Data sources</source>
|
||||
<translation>Zdroje dat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="171"/>
|
||||
<location filename="../src/gui.cpp" line="192"/>
|
||||
<source>Load POI file</source>
|
||||
<translation>Nahrát POI soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="174"/>
|
||||
<location filename="../src/gui.cpp" line="195"/>
|
||||
<source>Close POI files</source>
|
||||
<translation>Zavřit soubory POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="198"/>
|
||||
<source>Show POIs</source>
|
||||
<translation>Zobrazit POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="180"/>
|
||||
<location filename="../src/gui.cpp" line="205"/>
|
||||
<source>Show map</source>
|
||||
<translation>Zobrazit mapu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="193"/>
|
||||
<location filename="../src/gui.cpp" line="218"/>
|
||||
<source>Show graphs</source>
|
||||
<translation>Zobrazovat grafy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="199"/>
|
||||
<location filename="../src/gui.cpp" line="224"/>
|
||||
<source>Show toolbars</source>
|
||||
<translation>Zobrazovat nástrojové lišty</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="206"/>
|
||||
<location filename="../src/gui.cpp" line="231"/>
|
||||
<source>Metric</source>
|
||||
<translation>Metrické</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="212"/>
|
||||
<location filename="../src/gui.cpp" line="237"/>
|
||||
<source>Imperial</source>
|
||||
<translation>Imperiální</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="219"/>
|
||||
<location filename="../src/gui.cpp" line="244"/>
|
||||
<source>Next</source>
|
||||
<translation>Následující</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="222"/>
|
||||
<location filename="../src/gui.cpp" line="247"/>
|
||||
<source>Previous</source>
|
||||
<translation>Předchozí</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="226"/>
|
||||
<location filename="../src/gui.cpp" line="251"/>
|
||||
<source>Last</source>
|
||||
<translation>Poslední</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="229"/>
|
||||
<location filename="../src/gui.cpp" line="254"/>
|
||||
<source>First</source>
|
||||
<translation>První</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="251"/>
|
||||
<location filename="../src/gui.cpp" line="276"/>
|
||||
<source>Map</source>
|
||||
<translation>Mapa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="256"/>
|
||||
<location filename="../src/gui.cpp" line="281"/>
|
||||
<source>POI</source>
|
||||
<translation>POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="260"/>
|
||||
<location filename="../src/gui.cpp" line="282"/>
|
||||
<source>POI files</source>
|
||||
<translation>POI soubory</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="290"/>
|
||||
<source>Settings</source>
|
||||
<translation>Nastavení</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="261"/>
|
||||
<location filename="../src/gui.cpp" line="291"/>
|
||||
<source>Units</source>
|
||||
<translation>Jednotky</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="268"/>
|
||||
<location filename="../src/gui.cpp" line="298"/>
|
||||
<source>Help</source>
|
||||
<translation>Nápověda</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="318"/>
|
||||
<location filename="../src/gui.cpp" line="348"/>
|
||||
<source>Elevation</source>
|
||||
<translation>Výška</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="319"/>
|
||||
<location filename="../src/gui.cpp" line="349"/>
|
||||
<source>Speed</source>
|
||||
<translation>Rychlost</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="369"/>
|
||||
<location filename="../src/gui.cpp" line="399"/>
|
||||
<source>Next file</source>
|
||||
<translation>Následující soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="370"/>
|
||||
<location filename="../src/gui.cpp" line="400"/>
|
||||
<source>Previous file</source>
|
||||
<translation>Předchozí soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="372"/>
|
||||
<location filename="../src/gui.cpp" line="402"/>
|
||||
<source>First file</source>
|
||||
<translation>První soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="373"/>
|
||||
<location filename="../src/gui.cpp" line="403"/>
|
||||
<source>Last file</source>
|
||||
<translation>Poslední soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="374"/>
|
||||
<location filename="../src/gui.cpp" line="404"/>
|
||||
<source>Append modifier</source>
|
||||
<translation>Modifikátor nahradit/přidat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="388"/>
|
||||
<location filename="../src/gui.cpp" line="418"/>
|
||||
<source>Map (tiles) source URLs are read on program startup from the following file:</source>
|
||||
<translation>URL mapových zdrojů (dlaždic) jsou načteny při startu programu z následujícího souboru:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="392"/>
|
||||
<location filename="../src/gui.cpp" line="422"/>
|
||||
<source>The file format is one map entry per line, consisting of the map name and tiles URL delimited by a TAB character. The tile X and Y coordinates are replaced with $x and $y in the URL and the zoom level is replaced with $z. An example map file could look like:</source>
|
||||
<translation>Formát souboru je jeden mapový záznam na řádku, kde mapový záznam sestává ze jména mapy a URL dlaždic navzájem oddělených tabulátorem. Souřadnice dlaždice jsou v URL nahrazeny řetězci $x a $y, úroven přiblížení (zoom) pak řetězcem $z. Příklad:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="400"/>
|
||||
<location filename="../src/gui.cpp" line="430"/>
|
||||
<source>To make GPXSee load a POI file automatically on startup, add the file to the following directory:</source>
|
||||
<translation>POI soubory, které se mají automaticky nahrát při startu programu jsou načítány z následujícího adresáře:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="412"/>
|
||||
<location filename="../src/gui.cpp" line="442"/>
|
||||
<source>GPX files (*.gpx);;All files (*)</source>
|
||||
<translation>soubory GPX (*.gpx);;všechny soubory (*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="462"/>
|
||||
<location filename="../src/gui.cpp" line="479"/>
|
||||
<location filename="../src/gui.cpp" line="492"/>
|
||||
<location filename="../src/gui.cpp" line="509"/>
|
||||
<source>Line: %1</source>
|
||||
<translation>Řádka: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="472"/>
|
||||
<location filename="../src/gui.cpp" line="502"/>
|
||||
<source>GPX files (*.gpx);;CSV files (*.csv);;All files (*)</source>
|
||||
<translation>soubory GPX (*.gpx);;soubory CSV (*.csv);;všechny soubory (*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="526"/>
|
||||
<location filename="../src/gui.cpp" line="645"/>
|
||||
<location filename="../src/gui.cpp" line="577"/>
|
||||
<location filename="../src/gui.cpp" line="697"/>
|
||||
<source>mi</source>
|
||||
<translation>mi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="529"/>
|
||||
<location filename="../src/gui.cpp" line="531"/>
|
||||
<location filename="../src/gui.cpp" line="533"/>
|
||||
<location filename="../src/gui.cpp" line="535"/>
|
||||
<location filename="../src/gui.cpp" line="580"/>
|
||||
<location filename="../src/gui.cpp" line="582"/>
|
||||
<location filename="../src/gui.cpp" line="584"/>
|
||||
<location filename="../src/gui.cpp" line="586"/>
|
||||
<source>ft</source>
|
||||
<translation>ft</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="532"/>
|
||||
<location filename="../src/gui.cpp" line="544"/>
|
||||
<location filename="../src/gui.cpp" line="583"/>
|
||||
<location filename="../src/gui.cpp" line="595"/>
|
||||
<source>Maximum</source>
|
||||
<translation>Maximum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="534"/>
|
||||
<location filename="../src/gui.cpp" line="546"/>
|
||||
<location filename="../src/gui.cpp" line="585"/>
|
||||
<location filename="../src/gui.cpp" line="597"/>
|
||||
<source>Minimum</source>
|
||||
<translation>Minimum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="138"/>
|
||||
<location filename="../src/gui.cpp" line="346"/>
|
||||
<location filename="../src/gui.cpp" line="159"/>
|
||||
<location filename="../src/gui.cpp" line="376"/>
|
||||
<source>About GPXSee</source>
|
||||
<translation>O aplikaci GPXSee</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="294"/>
|
||||
<location filename="../src/gui.cpp" line="324"/>
|
||||
<source>Navigation</source>
|
||||
<translation>Navigace</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="348"/>
|
||||
<location filename="../src/gui.cpp" line="378"/>
|
||||
<source>GPX viewer and analyzer</source>
|
||||
<translation>Prohlížeč a analyzátor GPX</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="387"/>
|
||||
<location filename="../src/gui.cpp" line="417"/>
|
||||
<source>Map sources</source>
|
||||
<translation>Mapové zdroje</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="399"/>
|
||||
<location filename="../src/gui.cpp" line="429"/>
|
||||
<source>POIs</source>
|
||||
<translation>POI body</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="525"/>
|
||||
<location filename="../src/gui.cpp" line="537"/>
|
||||
<location filename="../src/gui.cpp" line="576"/>
|
||||
<location filename="../src/gui.cpp" line="588"/>
|
||||
<source>Distance</source>
|
||||
<translation>Vzdálenost</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="527"/>
|
||||
<location filename="../src/gui.cpp" line="539"/>
|
||||
<location filename="../src/gui.cpp" line="578"/>
|
||||
<location filename="../src/gui.cpp" line="590"/>
|
||||
<source>Time</source>
|
||||
<translation>Čas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="528"/>
|
||||
<location filename="../src/gui.cpp" line="540"/>
|
||||
<location filename="../src/gui.cpp" line="579"/>
|
||||
<location filename="../src/gui.cpp" line="591"/>
|
||||
<source>Ascent</source>
|
||||
<translation>Stoupání</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="541"/>
|
||||
<location filename="../src/gui.cpp" line="543"/>
|
||||
<location filename="../src/gui.cpp" line="545"/>
|
||||
<location filename="../src/gui.cpp" line="547"/>
|
||||
<location filename="../src/gui.cpp" line="592"/>
|
||||
<location filename="../src/gui.cpp" line="594"/>
|
||||
<location filename="../src/gui.cpp" line="596"/>
|
||||
<location filename="../src/gui.cpp" line="598"/>
|
||||
<source>m</source>
|
||||
<translation>m</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="530"/>
|
||||
<location filename="../src/gui.cpp" line="542"/>
|
||||
<location filename="../src/gui.cpp" line="581"/>
|
||||
<location filename="../src/gui.cpp" line="593"/>
|
||||
<source>Descent</source>
|
||||
<translation>Klesání</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="641"/>
|
||||
<location filename="../src/gui.cpp" line="693"/>
|
||||
<source>%1 tracks</source>
|
||||
<translation>Počet tras: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="538"/>
|
||||
<location filename="../src/gui.cpp" line="648"/>
|
||||
<location filename="../src/gui.cpp" line="589"/>
|
||||
<location filename="../src/gui.cpp" line="700"/>
|
||||
<source>km</source>
|
||||
<translation>km</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="464"/>
|
||||
<location filename="../src/gui.cpp" line="480"/>
|
||||
<location filename="../src/gui.cpp" line="494"/>
|
||||
<location filename="../src/gui.cpp" line="510"/>
|
||||
<source>Error</source>
|
||||
<translation>Chyba</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="459"/>
|
||||
<location filename="../src/gui.cpp" line="489"/>
|
||||
<source>Error loading GPX file:
|
||||
%1</source>
|
||||
<translation>Soubor GPX nelze otevřít:
|
||||
%1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="476"/>
|
||||
<location filename="../src/gui.cpp" line="506"/>
|
||||
<source>Error loading POI file:
|
||||
%1</source>
|
||||
<translation>Soubor POI nelze otevřít:
|
||||
@ -398,22 +408,22 @@
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../src/scaleitem.cpp" line="75"/>
|
||||
<location filename="../src/scaleitem.cpp" line="83"/>
|
||||
<source>mi</source>
|
||||
<translation>mi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/scaleitem.cpp" line="75"/>
|
||||
<location filename="../src/scaleitem.cpp" line="83"/>
|
||||
<source>ft</source>
|
||||
<translation>ft</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/scaleitem.cpp" line="77"/>
|
||||
<location filename="../src/scaleitem.cpp" line="85"/>
|
||||
<source>km</source>
|
||||
<translation>km</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/scaleitem.cpp" line="77"/>
|
||||
<location filename="../src/scaleitem.cpp" line="85"/>
|
||||
<source>m</source>
|
||||
<translation>m</translation>
|
||||
</message>
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#define APP_NAME "GPXSee"
|
||||
#define APP_HOMEPAGE "http://tumic.wz.cz/gpxsee"
|
||||
#define APP_VERSION "2.7"
|
||||
#define APP_VERSION "2.8"
|
||||
|
||||
#define FONT_FAMILY "Arial"
|
||||
#define FONT_SIZE 12
|
||||
|
@ -38,7 +38,7 @@ void ElevationGraph::loadGPX(const GPX &gpx)
|
||||
|
||||
gpx.track(i).elevationGraph(data);
|
||||
if (data.isEmpty())
|
||||
return;
|
||||
continue;
|
||||
|
||||
min = max = data.at(0).y();
|
||||
|
||||
|
@ -12,22 +12,22 @@
|
||||
class GPX
|
||||
{
|
||||
public:
|
||||
GPX() : _parser(_tracks, _waypoints) {}
|
||||
GPX() : _parser(_tracks, _waypoints), _errorLine(0) {}
|
||||
bool loadFile(const QString &fileName);
|
||||
const QString &errorString() const {return _error;}
|
||||
int errorLine() const {return _errorLine;}
|
||||
|
||||
int trackCount() const {return _tracks.count();}
|
||||
Track track(int i) const {return Track(_tracks.at(i));}
|
||||
const QList<WayPoint> &waypoints() const {return _waypoints;}
|
||||
const QList<Waypoint> &waypoints() const {return _waypoints;}
|
||||
|
||||
private:
|
||||
Parser _parser;
|
||||
QString _error;
|
||||
int _errorLine;
|
||||
|
||||
QList<QVector<TrackPoint> > _tracks;
|
||||
QList<WayPoint> _waypoints;
|
||||
QList<QVector<Trackpoint> > _tracks;
|
||||
QList<Waypoint> _waypoints;
|
||||
};
|
||||
|
||||
#endif // GPX_H
|
||||
|
@ -131,7 +131,6 @@ void GraphView::loadData(const QVector<QPointF> &data)
|
||||
{
|
||||
QPainterPath path;
|
||||
QGraphicsPathItem *pi;
|
||||
QColor color = _colorShop.color();
|
||||
|
||||
|
||||
if (data.size() < 2)
|
||||
@ -145,7 +144,7 @@ void GraphView::loadData(const QVector<QPointF> &data)
|
||||
}
|
||||
|
||||
pi = new QGraphicsPathItem(path);
|
||||
QBrush brush(color, Qt::SolidPattern);
|
||||
QBrush brush(_palette.color(), Qt::SolidPattern);
|
||||
QPen pen(brush, 0);
|
||||
pi->setPen(pen);
|
||||
_scene->addItem(pi);
|
||||
@ -262,7 +261,7 @@ void GraphView::clear()
|
||||
_info->clear();
|
||||
_scene->clear();
|
||||
_graphs.clear();
|
||||
_colorShop.reset();
|
||||
_palette.reset();
|
||||
|
||||
_xMax = -FLT_MAX;
|
||||
_xMin = FLT_MAX;
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <QVector>
|
||||
#include <QList>
|
||||
#include <QPointF>
|
||||
#include "colorshop.h"
|
||||
#include "palette.h"
|
||||
|
||||
|
||||
class AxisItem;
|
||||
@ -84,7 +84,7 @@ private:
|
||||
|
||||
QList<QGraphicsPathItem*> _graphs;
|
||||
qreal _xMin, _xMax, _yMin, _yMax;
|
||||
ColorShop _colorShop;
|
||||
Palette _palette;
|
||||
};
|
||||
|
||||
#endif // GRAPHVIEW_H
|
||||
|
68
src/gui.cpp
68
src/gui.cpp
@ -8,6 +8,12 @@
|
||||
#include <QPainter>
|
||||
#include <QKeyEvent>
|
||||
#include <QSignalMapper>
|
||||
#include <QMenu>
|
||||
#include <QToolBar>
|
||||
#include <QTabWidget>
|
||||
#include <QActionGroup>
|
||||
#include <QAction>
|
||||
#include <QLabel>
|
||||
#include "config.h"
|
||||
#include "icons.h"
|
||||
#include "keys.h"
|
||||
@ -110,6 +116,31 @@ void GUI::createMapActions()
|
||||
_currentMap = _maps.at(0);
|
||||
}
|
||||
|
||||
void GUI::createPOIFilesActions()
|
||||
{
|
||||
_poiFilesSM = new QSignalMapper(this);
|
||||
|
||||
for (int i = 0; i < _poi.files().count(); i++)
|
||||
createPOIFileAction(i);
|
||||
|
||||
connect(_poiFilesSM, SIGNAL(mapped(int)), this, SLOT(poiFileChecked(int)));
|
||||
}
|
||||
|
||||
QAction *GUI::createPOIFileAction(int index)
|
||||
{
|
||||
QAction *a = new QAction(QFileInfo(_poi.files().at(index)).fileName(),
|
||||
this);
|
||||
a->setCheckable(true);
|
||||
a->setChecked(true);
|
||||
|
||||
_poiFilesSM->setMapping(a, index);
|
||||
connect(a, SIGNAL(triggered()), _poiFilesSM, SLOT(map()));
|
||||
|
||||
_poiFilesActions.append(a);
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
void GUI::createActions()
|
||||
{
|
||||
// Action Groups
|
||||
@ -166,11 +197,15 @@ void GUI::createActions()
|
||||
_openPOIAction = new QAction(QIcon(QPixmap(OPEN_FILE_ICON)),
|
||||
tr("Load POI file"), this);
|
||||
connect(_openPOIAction, SIGNAL(triggered()), this, SLOT(openPOIFile()));
|
||||
_closePOIAction = new QAction(QIcon(QPixmap(CLOSE_FILE_ICON)),
|
||||
tr("Close POI files"), this);
|
||||
connect(_closePOIAction, SIGNAL(triggered()), this, SLOT(closePOIFiles()));
|
||||
_showPOIAction = new QAction(QIcon(QPixmap(SHOW_POI_ICON)),
|
||||
tr("Show POIs"), this);
|
||||
_showPOIAction->setCheckable(true);
|
||||
_showPOIAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_P));
|
||||
connect(_showPOIAction, SIGNAL(triggered(bool)), this, SLOT(showPOI(bool)));
|
||||
createPOIFilesActions();
|
||||
|
||||
// Map actions
|
||||
_showMapAction = new QAction(QIcon(QPixmap(SHOW_MAP_ICON)), tr("Show map"),
|
||||
@ -250,7 +285,12 @@ void GUI::createMenus()
|
||||
_mapMenu->addAction(_showMapAction);
|
||||
|
||||
_poiMenu = menuBar()->addMenu(tr("POI"));
|
||||
_poiFilesMenu = _poiMenu->addMenu(tr("POI files"));
|
||||
_poiFilesMenu->addActions(_poiFilesActions);
|
||||
_poiMenu->addSeparator();
|
||||
_poiMenu->addAction(_openPOIAction);
|
||||
_poiMenu->addAction(_closePOIAction);
|
||||
_poiMenu->addSeparator();
|
||||
_poiMenu->addAction(_showPOIAction);
|
||||
|
||||
_settingsMenu = menuBar()->addMenu(tr("Settings"));
|
||||
@ -477,10 +517,25 @@ void GUI::openPOIFile()
|
||||
} else {
|
||||
_showPOIAction->setChecked(true);
|
||||
_track->loadPOI(_poi);
|
||||
_poiFilesMenu->addAction(createPOIFileAction(
|
||||
_poi.files().indexOf(fileName)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GUI::closePOIFiles()
|
||||
{
|
||||
_poiFilesMenu->clear();
|
||||
|
||||
for (int i = 0; i < _poiFilesActions.count(); i++)
|
||||
delete _poiFilesActions[i];
|
||||
_poiFilesActions.clear();
|
||||
|
||||
_track->clearPOI();
|
||||
|
||||
_poi.clear();
|
||||
}
|
||||
|
||||
void GUI::saveAs()
|
||||
{
|
||||
QString fileName = QFileDialog::getSaveFileName(this, "Export to PDF",
|
||||
@ -552,6 +607,7 @@ void GUI::reloadFile()
|
||||
{
|
||||
_distance = 0;
|
||||
_time = 0;
|
||||
_trackCount = 0;
|
||||
|
||||
_elevationGraph->clear();
|
||||
_speedGraph->clear();
|
||||
@ -638,10 +694,10 @@ void GUI::updateStatusBarInfo()
|
||||
|
||||
if (_imperialUnitsAction->isChecked())
|
||||
_distanceLabel->setText(QString::number(_distance * M2MI, 'f', 1)
|
||||
+ " " + tr("mi"));
|
||||
+ UNIT_SPACE + tr("mi"));
|
||||
else
|
||||
_distanceLabel->setText(QString::number(_distance * M2KM, 'f', 1)
|
||||
+ " " + tr("km"));
|
||||
+ UNIT_SPACE + tr("km"));
|
||||
_timeLabel->setText(timeSpan(_time));
|
||||
}
|
||||
|
||||
@ -653,6 +709,14 @@ void GUI::mapChanged(int index)
|
||||
_track->setMap(_currentMap);
|
||||
}
|
||||
|
||||
void GUI::poiFileChecked(int index)
|
||||
{
|
||||
_poi.enableFile(_poi.files().at(index),
|
||||
_poiFilesActions.at(index)->isChecked());
|
||||
_track->clearPOI();
|
||||
_track->loadPOI(_poi);
|
||||
}
|
||||
|
||||
void GUI::graphChanged(int index)
|
||||
{
|
||||
if (_trackGraphs->widget(index) == _elevationGraph)
|
||||
|
26
src/gui.h
26
src/gui.h
@ -2,16 +2,17 @@
|
||||
#define GUI_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QMenu>
|
||||
#include <QToolBar>
|
||||
#include <QTabWidget>
|
||||
#include <QGraphicsView>
|
||||
#include <QActionGroup>
|
||||
#include <QAction>
|
||||
#include <QLabel>
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
#include "poi.h"
|
||||
|
||||
|
||||
class QMenu;
|
||||
class QToolBar;
|
||||
class QTabWidget;
|
||||
class QActionGroup;
|
||||
class QAction;
|
||||
class QLabel;
|
||||
class QSignalMapper;
|
||||
class FileBrowser;
|
||||
class ElevationGraph;
|
||||
class SpeedGraph;
|
||||
@ -37,6 +38,7 @@ private slots:
|
||||
void closeFile();
|
||||
void reloadFile();
|
||||
void openPOIFile();
|
||||
void closePOIFiles();
|
||||
void showPOI(bool checked);
|
||||
void showMap(bool checked);
|
||||
void showGraphs(bool checked);
|
||||
@ -44,6 +46,7 @@ private slots:
|
||||
|
||||
void mapChanged(int);
|
||||
void graphChanged(int);
|
||||
void poiFileChecked(int);
|
||||
|
||||
void next();
|
||||
void prev();
|
||||
@ -56,6 +59,8 @@ private slots:
|
||||
private:
|
||||
void loadFiles();
|
||||
|
||||
QAction *createPOIFileAction(int index);
|
||||
void createPOIFilesActions();
|
||||
void createMapActions();
|
||||
void createActions();
|
||||
void createMenus();
|
||||
@ -77,6 +82,7 @@ private:
|
||||
QMenu *_mapMenu;
|
||||
QMenu *_settingsMenu;
|
||||
QMenu *_unitsMenu;
|
||||
QMenu *_poiFilesMenu;
|
||||
|
||||
QToolBar *_fileToolBar;
|
||||
QToolBar *_showToolBar;
|
||||
@ -96,6 +102,7 @@ private:
|
||||
QAction *_closeFileAction;
|
||||
QAction *_reloadFileAction;
|
||||
QAction *_openPOIAction;
|
||||
QAction *_closePOIAction;
|
||||
QAction *_showPOIAction;
|
||||
QAction *_showMapAction;
|
||||
QAction *_showGraphsAction;
|
||||
@ -107,6 +114,9 @@ private:
|
||||
QAction *_metricUnitsAction;
|
||||
QAction *_imperialUnitsAction;
|
||||
QList<QAction*> _mapActions;
|
||||
QList<QAction*> _poiFilesActions;
|
||||
|
||||
QSignalMapper *_poiFilesSM;
|
||||
|
||||
QLabel *_fileNameLabel;
|
||||
QLabel *_distanceLabel;
|
||||
|
@ -19,10 +19,18 @@ void MarkerItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option
|
||||
{
|
||||
Q_UNUSED(option);
|
||||
Q_UNUSED(widget);
|
||||
bool aa;
|
||||
|
||||
|
||||
if ((aa = painter->testRenderHint(QPainter::Antialiasing)))
|
||||
painter->setRenderHint(QPainter::Antialiasing, false);
|
||||
|
||||
painter->setPen(Qt::red);
|
||||
painter->drawLine(-SIZE/2, 0, SIZE/2, 0);
|
||||
painter->drawLine(0, -SIZE/2, 0, SIZE/2);
|
||||
|
||||
if (aa)
|
||||
painter->setRenderHint(QPainter::Antialiasing, true);
|
||||
|
||||
// painter->drawRect(boundingRect());
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "colorshop.h"
|
||||
#include "palette.h"
|
||||
|
||||
|
||||
#define HUE_INIT 0.1f
|
||||
@ -43,12 +43,12 @@ static unsigned hsv2rgb(float h, float s, float v)
|
||||
+ (unsigned)(b * 256);
|
||||
}
|
||||
|
||||
ColorShop::ColorShop()
|
||||
Palette::Palette()
|
||||
{
|
||||
_hueState = HUE_INIT;
|
||||
}
|
||||
|
||||
QColor ColorShop::color()
|
||||
QColor Palette::color()
|
||||
{
|
||||
_hueState += HUE_INCREMENT;
|
||||
_hueState -= (int) _hueState;
|
||||
@ -56,7 +56,7 @@ QColor ColorShop::color()
|
||||
return QColor(hsv2rgb(_hueState, SATURATION, VALUE));
|
||||
}
|
||||
|
||||
void ColorShop::reset()
|
||||
void Palette::reset()
|
||||
{
|
||||
_hueState = HUE_INIT;
|
||||
}
|
@ -1,12 +1,12 @@
|
||||
#ifndef COLORSHOP_H
|
||||
#define COLORSHOP_H
|
||||
#ifndef PALETTE_H
|
||||
#define PALETTE_H
|
||||
|
||||
#include <QColor>
|
||||
|
||||
class ColorShop
|
||||
class Palette
|
||||
{
|
||||
public:
|
||||
ColorShop();
|
||||
Palette();
|
||||
QColor color();
|
||||
void reset();
|
||||
|
||||
@ -14,4 +14,4 @@ private:
|
||||
float _hueState;
|
||||
};
|
||||
|
||||
#endif // COLORSHOP_H
|
||||
#endif // PALLETE_H
|
@ -64,7 +64,7 @@ void Parser::trackPoints()
|
||||
{
|
||||
while (_reader.readNextStartElement()) {
|
||||
if (_reader.name() == "trkpt") {
|
||||
_track->append(TrackPoint());
|
||||
_track->append(Trackpoint());
|
||||
handleTrekPointAttributes(_reader.attributes());
|
||||
trackPointData();
|
||||
} else
|
||||
@ -96,11 +96,11 @@ void Parser::gpx()
|
||||
{
|
||||
while (_reader.readNextStartElement()) {
|
||||
if (_reader.name() == "trk") {
|
||||
_tracks.append(QVector<TrackPoint>());
|
||||
_tracks.append(QVector<Trackpoint>());
|
||||
_track = &_tracks.back();
|
||||
track();
|
||||
} else if (_reader.name() == "wpt") {
|
||||
_waypoints.append(WayPoint());
|
||||
_waypoints.append(Waypoint());
|
||||
handleWayPointAttributes(_reader.attributes());
|
||||
wayPointData();
|
||||
} else
|
||||
|
@ -11,7 +11,7 @@
|
||||
class Parser
|
||||
{
|
||||
public:
|
||||
Parser(QList<QVector<TrackPoint> > &tracks, QList<WayPoint> &waypoints)
|
||||
Parser(QList<QVector<Trackpoint> > &tracks, QList<Waypoint> &waypoints)
|
||||
: _tracks(tracks), _waypoints(waypoints) {_track = 0;}
|
||||
bool loadFile(QIODevice *device);
|
||||
QString errorString() const {return _reader.errorString();}
|
||||
@ -33,9 +33,9 @@ private:
|
||||
void handleExtensionData(QStringRef element, const QString &value);
|
||||
|
||||
QXmlStreamReader _reader;
|
||||
QList<QVector<TrackPoint> > &_tracks;
|
||||
QList<WayPoint> &_waypoints;
|
||||
QVector<TrackPoint> *_track;
|
||||
QList<QVector<Trackpoint> > &_tracks;
|
||||
QList<Waypoint> &_waypoints;
|
||||
QVector<Trackpoint> *_track;
|
||||
};
|
||||
|
||||
#endif // PARSER_H
|
||||
|
66
src/poi.cpp
66
src/poi.cpp
@ -6,8 +6,6 @@
|
||||
#include "poi.h"
|
||||
|
||||
|
||||
#define BOUNDING_RECT_SIZE 0.01
|
||||
|
||||
bool POI::loadFile(const QString &fileName)
|
||||
{
|
||||
QString error;
|
||||
@ -41,21 +39,28 @@ bool POI::loadFile(const QString &fileName)
|
||||
bool POI::loadGPXFile(const QString &fileName)
|
||||
{
|
||||
GPX gpx;
|
||||
int cnt = _data.size();
|
||||
FileIndex index;
|
||||
|
||||
index.enabled = true;
|
||||
index.start = _data.size();
|
||||
|
||||
if (gpx.loadFile(fileName)) {
|
||||
for (int i = 0; i < gpx.waypoints().size(); i++)
|
||||
_data.append(WayPoint(
|
||||
_data.append(Waypoint(
|
||||
ll2mercator(gpx.waypoints().at(i).coordinates()),
|
||||
gpx.waypoints().at(i).description()));
|
||||
index.end = _data.size() - 1;
|
||||
|
||||
for (int i = cnt; i < _data.size(); ++i) {
|
||||
for (int i = index.start; i <= index.end; i++) {
|
||||
qreal c[2];
|
||||
c[0] = _data.at(i).coordinates().x();
|
||||
c[1] = _data.at(i).coordinates().y();
|
||||
_tree.Insert(c, c, i);
|
||||
}
|
||||
|
||||
_files.append(fileName);
|
||||
_indexes.append(index);
|
||||
|
||||
return true;
|
||||
} else {
|
||||
_error = gpx.errorString();
|
||||
@ -68,8 +73,12 @@ bool POI::loadGPXFile(const QString &fileName)
|
||||
bool POI::loadCSVFile(const QString &fileName)
|
||||
{
|
||||
QFile file(fileName);
|
||||
FileIndex index;
|
||||
bool ret;
|
||||
int ln = 1, cnt = _data.size();
|
||||
int ln = 1;
|
||||
|
||||
index.enabled = true;
|
||||
index.start = _data.size();
|
||||
|
||||
if (!file.open(QFile::ReadOnly | QFile::Text)) {
|
||||
_error = qPrintable(file.errorString());
|
||||
@ -99,18 +108,22 @@ bool POI::loadCSVFile(const QString &fileName)
|
||||
}
|
||||
QByteArray ba = list[2].trimmed();
|
||||
|
||||
_data.append(WayPoint(ll2mercator(QPointF(lon, lat)),
|
||||
_data.append(Waypoint(ll2mercator(QPointF(lon, lat)),
|
||||
QString::fromUtf8(ba.data(), ba.size())));
|
||||
ln++;
|
||||
}
|
||||
index.end = _data.size() - 1;
|
||||
|
||||
for (int i = cnt; i < _data.size(); ++i) {
|
||||
for (int i = index.start; i <= index.end; i++) {
|
||||
qreal c[2];
|
||||
c[0] = _data.at(i).coordinates().x();
|
||||
c[1] = _data.at(i).coordinates().y();
|
||||
_tree.Insert(c, c, i);
|
||||
}
|
||||
|
||||
_files.append(fileName);
|
||||
_indexes.append(index);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -122,17 +135,17 @@ static bool cb(size_t data, void* context)
|
||||
return true;
|
||||
}
|
||||
|
||||
QVector<WayPoint> POI::points(const QVector<QPointF> &path) const
|
||||
QVector<Waypoint> POI::points(const QVector<QPointF> &path, qreal radius) const
|
||||
{
|
||||
QVector<WayPoint> ret;
|
||||
QVector<Waypoint> ret;
|
||||
QSet<int> set;
|
||||
qreal min[2], max[2];
|
||||
|
||||
for (int i = 0; i < path.count(); i++) {
|
||||
min[0] = path.at(i).x() - BOUNDING_RECT_SIZE;
|
||||
min[1] = path.at(i).y() - BOUNDING_RECT_SIZE;
|
||||
max[0] = path.at(i).x() + BOUNDING_RECT_SIZE;
|
||||
max[1] = path.at(i).y() + BOUNDING_RECT_SIZE;
|
||||
min[0] = path.at(i).x() - radius;
|
||||
min[1] = path.at(i).y() - radius;
|
||||
max[0] = path.at(i).x() + radius;
|
||||
max[1] = path.at(i).y() + radius;
|
||||
_tree.Search(min, max, cb, &set);
|
||||
}
|
||||
|
||||
@ -145,8 +158,33 @@ QVector<WayPoint> POI::points(const QVector<QPointF> &path) const
|
||||
return ret;
|
||||
}
|
||||
|
||||
void POI::enableFile(const QString &fileName, bool enable)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = _files.indexOf(fileName);
|
||||
Q_ASSERT(i >= 0);
|
||||
_indexes[i].enabled = enable;
|
||||
|
||||
_tree.RemoveAll();
|
||||
for (int i = 0; i < _indexes.count(); i++) {
|
||||
FileIndex idx = _indexes.at(i);
|
||||
if (!idx.enabled)
|
||||
continue;
|
||||
|
||||
for (int j = idx.start; j <= idx.end; j++) {
|
||||
qreal c[2];
|
||||
c[0] = _data.at(j).coordinates().x();
|
||||
c[1] = _data.at(j).coordinates().y();
|
||||
_tree.Insert(c, c, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void POI::clear()
|
||||
{
|
||||
_tree.RemoveAll();
|
||||
_data.clear();
|
||||
_files.clear();
|
||||
_indexes.clear();
|
||||
}
|
||||
|
18
src/poi.h
18
src/poi.h
@ -4,6 +4,7 @@
|
||||
#include <QVector>
|
||||
#include <QPointF>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include "waypoint.h"
|
||||
#include "rtree.h"
|
||||
|
||||
@ -11,22 +12,33 @@
|
||||
class POI
|
||||
{
|
||||
public:
|
||||
POI() : _errorLine(0) {}
|
||||
bool loadFile(const QString &fileName);
|
||||
QString errorString() const {return _error;}
|
||||
int errorLine() const {return _errorLine;}
|
||||
|
||||
QVector<WayPoint> points(const QVector<QPointF> &path) const;
|
||||
|
||||
QVector<Waypoint> points(const QVector<QPointF> &path,
|
||||
qreal radius = 0.01) const;
|
||||
const QStringList &files() const {return _files;}
|
||||
void enableFile(const QString &fileName, bool enable);
|
||||
void clear();
|
||||
|
||||
private:
|
||||
typedef RTree<size_t, qreal, 2> POITree;
|
||||
typedef struct {
|
||||
int start;
|
||||
int end;
|
||||
bool enabled;
|
||||
} FileIndex;
|
||||
|
||||
bool loadCSVFile(const QString &fileName);
|
||||
bool loadGPXFile(const QString &fileName);
|
||||
|
||||
POITree _tree;
|
||||
QVector<WayPoint> _data;
|
||||
QVector<Waypoint> _data;
|
||||
QStringList _files;
|
||||
QList<FileIndex> _indexes;
|
||||
|
||||
QString _error;
|
||||
int _errorLine;
|
||||
};
|
||||
|
@ -46,6 +46,11 @@ void ScaleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||
font.setFamily(FONT_FAMILY);
|
||||
QFontMetrics fm(font);
|
||||
QRect br;
|
||||
bool aa;
|
||||
|
||||
|
||||
if ((aa = painter->testRenderHint(QPainter::Antialiasing)))
|
||||
painter->setRenderHint(QPainter::Antialiasing, false);
|
||||
|
||||
painter->setFont(font);
|
||||
|
||||
@ -63,6 +68,9 @@ void ScaleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||
painter->fillRect(QRectF(i * _width, br.height() + PADDING, _width,
|
||||
SCALE_HEIGHT), Qt::black);
|
||||
|
||||
if (aa)
|
||||
painter->setRenderHint(QPainter::Antialiasing, true);
|
||||
|
||||
/*
|
||||
painter->setPen(Qt::red);
|
||||
painter->drawRect(boundingRect());
|
||||
|
@ -32,7 +32,7 @@ void SpeedGraph::loadGPX(const GPX &gpx)
|
||||
|
||||
gpx.track(i).speedGraph(data);
|
||||
if (data.isEmpty())
|
||||
return;
|
||||
continue;
|
||||
|
||||
_avg.append(QPointF(gpx.track(i).distance(), gpx.track(i).distance()
|
||||
/ gpx.track(i).time()));
|
||||
|
@ -8,7 +8,7 @@
|
||||
class Track
|
||||
{
|
||||
public:
|
||||
Track(const QVector<TrackPoint> &data) : _data(data) {}
|
||||
Track(const QVector<Trackpoint> &data) : _data(data) {}
|
||||
|
||||
void elevationGraph(QVector<QPointF> &graph) const;
|
||||
void speedGraph(QVector<QPointF> &graph) const;
|
||||
@ -18,7 +18,7 @@ public:
|
||||
QDateTime date() const;
|
||||
|
||||
private:
|
||||
const QVector<TrackPoint> &_data;
|
||||
const QVector<Trackpoint> &_data;
|
||||
};
|
||||
|
||||
#endif // TRACK_H
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <QPointF>
|
||||
#include <QDateTime>
|
||||
|
||||
struct TrackPoint
|
||||
struct Trackpoint
|
||||
{
|
||||
QPointF coordinates;
|
||||
QDateTime timestamp;
|
||||
@ -12,7 +12,7 @@ struct TrackPoint
|
||||
qreal geoidheight;
|
||||
qreal speed;
|
||||
|
||||
TrackPoint() {elevation = 0; geoidheight = 0; speed = -1;}
|
||||
Trackpoint() {elevation = 0; geoidheight = 0; speed = -1;}
|
||||
};
|
||||
|
||||
#endif // TRACKPOINT_H
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "poi.h"
|
||||
#include "gpx.h"
|
||||
#include "map.h"
|
||||
#include "poiitem.h"
|
||||
#include "waypointitem.h"
|
||||
#include "markeritem.h"
|
||||
#include "scaleitem.h"
|
||||
#include "ll.h"
|
||||
@ -27,12 +27,13 @@ TrackView::TrackView(QWidget *parent)
|
||||
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
setRenderHints(QPainter::Antialiasing);
|
||||
|
||||
_mapScale = new ScaleItem();
|
||||
_mapScale->setZValue(2.0);
|
||||
|
||||
_zoom = -1;
|
||||
_scale = 1.0;
|
||||
_scale = -1.0;
|
||||
_map = 0;
|
||||
_maxLen = 0;
|
||||
}
|
||||
@ -42,66 +43,74 @@ TrackView::~TrackView()
|
||||
delete _scene;
|
||||
}
|
||||
|
||||
void TrackView::addTrack(const QVector<QPointF> &track)
|
||||
{
|
||||
QPainterPath path;
|
||||
QGraphicsPathItem *pi;
|
||||
MarkerItem *mi;
|
||||
|
||||
|
||||
if (track.size() < 2)
|
||||
return;
|
||||
|
||||
_tracks.append(track);
|
||||
|
||||
path.moveTo(track.at(0).x(), -track.at(0).y());
|
||||
for (int i = 1; i < track.size(); i++)
|
||||
path.lineTo(track.at(i).x(), -track.at(i).y());
|
||||
|
||||
_maxLen = qMax(path.length(), _maxLen);
|
||||
|
||||
|
||||
pi = new QGraphicsPathItem(path);
|
||||
_trackPaths.append(pi);
|
||||
_zoom = scale2zoom(trackScale());
|
||||
_scale = mapScale();
|
||||
QBrush brush(_palette.color(), Qt::SolidPattern);
|
||||
QPen pen(brush, TRACK_WIDTH * _scale);
|
||||
pi->setPen(pen);
|
||||
pi->setScale(1.0/_scale);
|
||||
_scene->addItem(pi);
|
||||
|
||||
mi = new MarkerItem(pi);
|
||||
_markers.append(mi);
|
||||
mi->setPos(pi->path().pointAtPercent(0));
|
||||
mi->setScale(_scale);
|
||||
}
|
||||
|
||||
void TrackView::loadGPX(const GPX &gpx)
|
||||
{
|
||||
qreal scale = _scale;
|
||||
|
||||
for (int i = 0; i < gpx.trackCount(); i++) {
|
||||
QVector<QPointF> track;
|
||||
QPainterPath path;
|
||||
QGraphicsPathItem *pi;
|
||||
MarkerItem *mi;
|
||||
QColor color = _colorShop.color();
|
||||
qreal prevScale = _scale;
|
||||
|
||||
|
||||
gpx.track(i).track(track);
|
||||
|
||||
if (track.size() < 2)
|
||||
continue;
|
||||
|
||||
_tracks.append(track);
|
||||
|
||||
path.moveTo(track.at(0).x(), -track.at(0).y());
|
||||
for (int i = 1; i < track.size(); i++)
|
||||
path.lineTo(track.at(i).x(), -track.at(i).y());
|
||||
|
||||
_maxLen = qMax(path.length(), _maxLen);
|
||||
|
||||
|
||||
pi = new QGraphicsPathItem(path);
|
||||
_trackPaths.append(pi);
|
||||
_zoom = scale2zoom(trackScale());
|
||||
_scale = mapScale();
|
||||
QBrush brush(color, Qt::SolidPattern);
|
||||
QPen pen(brush, TRACK_WIDTH * _scale);
|
||||
pi->setPen(pen);
|
||||
pi->setScale(1.0/_scale);
|
||||
_scene->addItem(pi);
|
||||
|
||||
mi = new MarkerItem(pi);
|
||||
_markers.append(mi);
|
||||
mi->setPos(pi->path().pointAtPercent(0));
|
||||
mi->setScale(_scale);
|
||||
|
||||
if (_trackPaths.size() > 1 && prevScale != _scale)
|
||||
rescale(_scale);
|
||||
|
||||
QRectF br = trackBoundingRect();
|
||||
QRectF ba = br.adjusted(-TILE_SIZE, -TILE_SIZE, TILE_SIZE, TILE_SIZE);
|
||||
_scene->setSceneRect(ba);
|
||||
centerOn(ba.center());
|
||||
|
||||
if (_mapScale->scene() != _scene)
|
||||
_scene->addItem(_mapScale);
|
||||
|
||||
_mapScale->setLatitude(track.at(track.size() / 2).y());
|
||||
_mapScale->setZoom(_zoom);
|
||||
addTrack(track);
|
||||
}
|
||||
|
||||
if (_trackPaths.empty())
|
||||
return;
|
||||
if (_trackPaths.size() > 1 && scale != _scale)
|
||||
rescale(_scale);
|
||||
|
||||
QRectF br = trackBoundingRect();
|
||||
QRectF ba = br.adjusted(-TILE_SIZE, -TILE_SIZE, TILE_SIZE, TILE_SIZE);
|
||||
_scene->setSceneRect(ba);
|
||||
centerOn(ba.center());
|
||||
|
||||
_mapScale->setLatitude(-(br.center().ry() * _scale));
|
||||
_mapScale->setZoom(_zoom);
|
||||
if (_mapScale->scene() != _scene)
|
||||
_scene->addItem(_mapScale);
|
||||
}
|
||||
|
||||
QRectF TrackView::trackBoundingRect() const
|
||||
{
|
||||
qreal bottom, top, left, right;
|
||||
|
||||
if (_trackPaths.empty())
|
||||
return QRectF();
|
||||
|
||||
bottom = _trackPaths.at(0)->sceneBoundingRect().bottom();
|
||||
top = _trackPaths.at(0)->sceneBoundingRect().top();
|
||||
left = _trackPaths.at(0)->sceneBoundingRect().left();
|
||||
@ -156,7 +165,7 @@ void TrackView::rescale(qreal scale)
|
||||
_trackPaths.at(i)->setPen(pen);
|
||||
}
|
||||
|
||||
QHash<WayPoint, POIItem*>::const_iterator it, jt;
|
||||
QHash<Waypoint, WaypointItem*>::const_iterator it, jt;
|
||||
for (it = _pois.constBegin(); it != _pois.constEnd(); it++) {
|
||||
it.value()->setPos(QPointF(it.value()->entry().coordinates().x()
|
||||
* 1.0/scale, -it.value()->entry().coordinates().y() * 1.0/scale));
|
||||
@ -176,19 +185,19 @@ void TrackView::rescale(qreal scale)
|
||||
|
||||
void TrackView::loadPOI(const POI &poi)
|
||||
{
|
||||
QHash<WayPoint, POIItem*>::const_iterator it,jt;
|
||||
QHash<Waypoint, WaypointItem*>::const_iterator it,jt;
|
||||
|
||||
if (!_tracks.size())
|
||||
return;
|
||||
|
||||
for (int i = 0; i < _tracks.size(); i++) {
|
||||
QVector<WayPoint> p = poi.points(_tracks.at(i));
|
||||
QVector<Waypoint> p = poi.points(_tracks.at(i));
|
||||
|
||||
for (int i = 0; i < p.size(); i++) {
|
||||
if (_pois.contains(p.at(i)))
|
||||
continue;
|
||||
|
||||
POIItem *pi = new POIItem(p.at(i));
|
||||
WaypointItem *pi = new WaypointItem(p.at(i));
|
||||
pi->setPos(p.at(i).coordinates().x() * 1.0/_scale,
|
||||
-p.at(i).coordinates().y() * 1.0/_scale);
|
||||
pi->setZValue(1);
|
||||
@ -298,7 +307,7 @@ enum QPrinter::Orientation TrackView::orientation() const
|
||||
|
||||
void TrackView::clearPOI()
|
||||
{
|
||||
QHash<WayPoint, POIItem*>::const_iterator it;
|
||||
QHash<Waypoint, WaypointItem*>::const_iterator it;
|
||||
|
||||
for (it = _pois.constBegin(); it != _pois.constEnd(); it++) {
|
||||
_scene->removeItem(it.value());
|
||||
@ -318,11 +327,13 @@ void TrackView::clear()
|
||||
_trackPaths.clear();
|
||||
_markers.clear();
|
||||
_scene->clear();
|
||||
_colorShop.reset();
|
||||
_palette.reset();
|
||||
|
||||
_maxLen = 0;
|
||||
_zoom = -1;
|
||||
_scale = -1.0;
|
||||
|
||||
_scene->setSceneRect(0, 0, 0, 0);
|
||||
_scene->setSceneRect(QRectF());
|
||||
}
|
||||
|
||||
void TrackView::movePositionMarker(qreal val)
|
||||
|
@ -7,13 +7,13 @@
|
||||
#include <QList>
|
||||
#include <QPrinter>
|
||||
#include "units.h"
|
||||
#include "colorshop.h"
|
||||
#include "palette.h"
|
||||
#include "waypoint.h"
|
||||
|
||||
class GPX;
|
||||
class POI;
|
||||
class Map;
|
||||
class POIItem;
|
||||
class WaypointItem;
|
||||
class MarkerItem;
|
||||
class ScaleItem;
|
||||
|
||||
@ -44,6 +44,7 @@ private slots:
|
||||
void redraw();
|
||||
|
||||
private:
|
||||
void addTrack(const QVector<QPointF> &track);
|
||||
QRectF trackBoundingRect() const;
|
||||
qreal trackScale() const;
|
||||
qreal mapScale() const;
|
||||
@ -61,11 +62,11 @@ private:
|
||||
QList<QVector<QPointF> > _tracks;
|
||||
QList<QGraphicsPathItem*> _trackPaths;
|
||||
QList<MarkerItem*> _markers;
|
||||
QHash<WayPoint, POIItem*> _pois;
|
||||
QHash<Waypoint, WaypointItem*> _pois;
|
||||
Map *_map;
|
||||
ScaleItem *_mapScale;
|
||||
|
||||
ColorShop _colorShop;
|
||||
Palette _palette;
|
||||
qreal _maxLen;
|
||||
|
||||
qreal _scale;
|
||||
|
@ -5,11 +5,11 @@
|
||||
#include <QString>
|
||||
#include <QHash>
|
||||
|
||||
class WayPoint
|
||||
class Waypoint
|
||||
{
|
||||
public:
|
||||
WayPoint() {}
|
||||
WayPoint(const QPointF &coordinates, const QString &description)
|
||||
Waypoint() {}
|
||||
Waypoint(const QPointF &coordinates, const QString &description)
|
||||
: _coordinates(coordinates), _description(description) {}
|
||||
|
||||
const QPointF &coordinates() const {return _coordinates;}
|
||||
@ -19,7 +19,7 @@ public:
|
||||
void setDescription(const QString &description)
|
||||
{_description = description;}
|
||||
|
||||
bool operator==(const WayPoint &other) const
|
||||
bool operator==(const Waypoint &other) const
|
||||
{return this->_description == other._description
|
||||
&& this->_coordinates == other._coordinates;}
|
||||
|
||||
@ -28,7 +28,7 @@ private:
|
||||
QString _description;
|
||||
};
|
||||
|
||||
inline uint qHash(const WayPoint &key)
|
||||
inline uint qHash(const Waypoint &key)
|
||||
{
|
||||
return ::qHash(key.description());
|
||||
}
|
||||
|
@ -1,18 +1,18 @@
|
||||
#include <QPainter>
|
||||
#include "config.h"
|
||||
#include "poiitem.h"
|
||||
#include "waypointitem.h"
|
||||
|
||||
|
||||
#define POINT_SIZE 8
|
||||
|
||||
POIItem::POIItem(const WayPoint &entry, QGraphicsItem *parent)
|
||||
WaypointItem::WaypointItem(const Waypoint &entry, QGraphicsItem *parent)
|
||||
: QGraphicsItem(parent)
|
||||
{
|
||||
_entry = entry;
|
||||
updateBoundingRect();
|
||||
}
|
||||
|
||||
void POIItem::updateBoundingRect()
|
||||
void WaypointItem::updateBoundingRect()
|
||||
{
|
||||
QFont font;
|
||||
font.setPixelSize(FONT_SIZE);
|
||||
@ -24,7 +24,7 @@ void POIItem::updateBoundingRect()
|
||||
ts.height() + fm.descent() + POINT_SIZE);
|
||||
}
|
||||
|
||||
void POIItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||
void WaypointItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||
QWidget *widget)
|
||||
{
|
||||
Q_UNUSED(option);
|
@ -1,14 +1,14 @@
|
||||
#ifndef POIITEM_H
|
||||
#define POIITEM_H
|
||||
#ifndef WAYPOINTITEM_H
|
||||
#define WAYPOINTITEM_H
|
||||
|
||||
#include <QGraphicsItem>
|
||||
#include "waypoint.h"
|
||||
|
||||
class POIItem : public QGraphicsItem
|
||||
class WaypointItem : public QGraphicsItem
|
||||
{
|
||||
public:
|
||||
POIItem(const WayPoint &entry, QGraphicsItem *parent = 0);
|
||||
const WayPoint &entry() const {return _entry;}
|
||||
WaypointItem(const Waypoint &entry, QGraphicsItem *parent = 0);
|
||||
const Waypoint &entry() const {return _entry;}
|
||||
|
||||
QRectF boundingRect() const {return _boundingRect;}
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||
@ -17,8 +17,8 @@ public:
|
||||
private:
|
||||
void updateBoundingRect();
|
||||
|
||||
WayPoint _entry;
|
||||
Waypoint _entry;
|
||||
QRectF _boundingRect;
|
||||
};
|
||||
|
||||
#endif // POIITEM_H
|
||||
#endif // WAYPOINTITEM_H
|
Reference in New Issue
Block a user