Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package gpxsee for openSUSE:Factory checked in at 2022-11-17 17:24:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gpxsee (Old) and /work/SRC/openSUSE:Factory/.gpxsee.new.1597 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gpxsee" Thu Nov 17 17:24:57 2022 rev:96 rq:1036455 version:11.9 Changes: -------- --- /work/SRC/openSUSE:Factory/gpxsee/gpxsee.changes 2022-11-07 13:52:30.276075814 +0100 +++ /work/SRC/openSUSE:Factory/.gpxsee.new.1597/gpxsee.changes 2022-11-17 17:25:13.209292618 +0100 @@ -1,0 +2,13 @@ +Thu Nov 17 13:38:08 CET 2022 - [email protected] + +- Update to version 11.9 + * Improved ENC maps render style. + +------------------------------------------------------------------- +Fri Nov 11 01:44:12 CET 2022 - [email protected] + +- Update to version 11.8 + * Fixed crash on ENC maps unload. + * Improved ENC maps render style. + +------------------------------------------------------------------- Old: ---- GPXSee-11.7.tar.gz New: ---- GPXSee-11.9.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gpxsee.spec ++++++ --- /var/tmp/diff_new_pack.NlfboO/_old 2022-11-17 17:25:13.901296285 +0100 +++ /var/tmp/diff_new_pack.NlfboO/_new 2022-11-17 17:25:13.909296327 +0100 @@ -19,7 +19,7 @@ # See also http://en.opensuse.org/openSUSE:Specfile_guidelines Name: gpxsee -Version: 11.7 +Version: 11.9 Release: 1 Summary: GPS log file visualization and analysis tool License: GPL-3.0-only ++++++ GPXSee-11.7.tar.gz -> GPXSee-11.9.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GPXSee-11.7/.appveyor.yml new/GPXSee-11.9/.appveyor.yml --- old/GPXSee-11.7/.appveyor.yml 2022-11-06 16:09:41.000000000 +0100 +++ new/GPXSee-11.9/.appveyor.yml 2022-11-17 13:26:45.000000000 +0100 @@ -1,4 +1,4 @@ -version: 11.7.{build} +version: 11.9.{build} configuration: - Release diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GPXSee-11.7/gpxsee.pro new/GPXSee-11.9/gpxsee.pro --- old/GPXSee-11.7/gpxsee.pro 2022-11-06 16:09:41.000000000 +0100 +++ new/GPXSee-11.9/gpxsee.pro 2022-11-17 13:26:45.000000000 +0100 @@ -3,7 +3,7 @@ } else { TARGET = GPXSee } -VERSION = 11.7 +VERSION = 11.9 QT += core \ gui \ @@ -29,6 +29,7 @@ src/GUI/pluginparameters.h \ src/common/garmin.h \ src/common/coordinates.h \ + src/common/linec.h \ src/common/range.h \ src/common/rectc.h \ src/common/textcodec.h \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GPXSee-11.7/gpxsee.qrc new/GPXSee-11.9/gpxsee.qrc --- old/GPXSee-11.7/gpxsee.qrc 2022-11-06 16:09:41.000000000 +0100 +++ new/GPXSee-11.9/gpxsee.qrc 2022-11-17 13:26:45.000000000 +0100 @@ -172,6 +172,7 @@ <file alias="chimney.png">icons/map/marine/chimney.png</file> <file alias="platform.png">icons/map/marine/platform.png</file> <file alias="ferry-line.png">icons/map/marine/ferry-line.png</file> + <file alias="dw-route-line.png">icons/map/marine/dw-route-line.png</file> </qresource> <!-- Mapsforge rendertheme --> Binary files old/GPXSee-11.7/icons/map/marine/dw-route-line.png and new/GPXSee-11.9/icons/map/marine/dw-route-line.png differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GPXSee-11.7/lang/gpxsee_ca.ts new/GPXSee-11.9/lang/gpxsee_ca.ts --- old/GPXSee-11.7/lang/gpxsee_ca.ts 2022-11-06 16:09:41.000000000 +0100 +++ new/GPXSee-11.9/lang/gpxsee_ca.ts 2022-11-17 13:26:45.000000000 +0100 @@ -1216,7 +1216,7 @@ <message> <location filename="../src/map/maplist.cpp" line="158"/> <source>Electronic Navigational Charts</source> - <translation type="unfinished"></translation> + <translation>Cartes Nà utiques Electròniques</translation> </message> <message> <location filename="../src/map/maplist.cpp" line="159"/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GPXSee-11.7/lang/gpxsee_nb.ts new/GPXSee-11.9/lang/gpxsee_nb.ts --- old/GPXSee-11.7/lang/gpxsee_nb.ts 2022-11-06 16:09:41.000000000 +0100 +++ new/GPXSee-11.9/lang/gpxsee_nb.ts 2022-11-17 13:26:45.000000000 +0100 @@ -1246,7 +1246,7 @@ <message> <location filename="../src/map/maplist.cpp" line="158"/> <source>Electronic Navigational Charts</source> - <translation type="unfinished"></translation> + <translation>Elektroniske sjøkart</translation> </message> <message> <location filename="../src/map/maplist.cpp" line="165"/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GPXSee-11.7/lang/gpxsee_zh.ts new/GPXSee-11.9/lang/gpxsee_zh.ts --- old/GPXSee-11.7/lang/gpxsee_zh.ts 2022-11-06 16:09:41.000000000 +0100 +++ new/GPXSee-11.9/lang/gpxsee_zh.ts 2022-11-17 13:26:45.000000000 +0100 @@ -1240,7 +1240,7 @@ <message> <location filename="../src/map/maplist.cpp" line="158"/> <source>Electronic Navigational Charts</source> - <translation type="unfinished"></translation> + <translation>çµåèªæµ·å¾</translation> </message> <message> <location filename="../src/map/maplist.cpp" line="165"/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GPXSee-11.7/pkg/gpxsee64.nsi new/GPXSee-11.9/pkg/gpxsee64.nsi --- old/GPXSee-11.7/pkg/gpxsee64.nsi 2022-11-06 16:09:41.000000000 +0100 +++ new/GPXSee-11.9/pkg/gpxsee64.nsi 2022-11-17 13:26:45.000000000 +0100 @@ -37,7 +37,7 @@ ; The name of the installer Name "GPXSee" ; Program version -!define VERSION "11.7" +!define VERSION "11.9" ; The file to write OutFile "GPXSee-${VERSION}_x64.exe" @@ -181,13 +181,14 @@ !insertmacro FILE_ASSOCIATION_ADD "qct" "QuickChart Map File" 24 !insertmacro FILE_ASSOCIATION_ADD "trk" "TwoNav Track File" 25 !insertmacro FILE_ASSOCIATION_ADD "gemf" "GEMF Map File" 26 - !insertmacro FILE_ASSOCIATION_ADD "kml" "Keyhole Markup Language" 27 - !insertmacro FILE_ASSOCIATION_ADD "kmz" "KML geographic compressed data" 27 - !insertmacro FILE_ASSOCIATION_ADD "fit" "Flexible and Interoperable Data Transfer" 28 - !insertmacro FILE_ASSOCIATION_ADD "igc" "Flight Recorder Data Format" 29 - !insertmacro FILE_ASSOCIATION_ADD "nmea" "NMEA 0183 Data" 30 - !insertmacro FILE_ASSOCIATION_ADD "plt" "OziExplorer Track File" 31 - !insertmacro FILE_ASSOCIATION_ADD "rte" "OziExplorer Route File" 32 + !insertmacro FILE_ASSOCIATION_ADD "000" "IHO S-57 Electronic Navigation Chart" 27 + !insertmacro FILE_ASSOCIATION_ADD "kml" "Keyhole Markup Language" 28 + !insertmacro FILE_ASSOCIATION_ADD "kmz" "KML geographic compressed data" 28 + !insertmacro FILE_ASSOCIATION_ADD "fit" "Flexible and Interoperable Data Transfer" 29 + !insertmacro FILE_ASSOCIATION_ADD "igc" "Flight Recorder Data Format" 30 + !insertmacro FILE_ASSOCIATION_ADD "nmea" "NMEA 0183 Data" 31 + !insertmacro FILE_ASSOCIATION_ADD "plt" "OziExplorer Track File" 32 + !insertmacro FILE_ASSOCIATION_ADD "rte" "OziExplorer Route File" 33 WriteRegStr HKCR "Applications\GPXSee.exe\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\"" WriteRegStr HKCR ".gpx\OpenWithList" "GPXSee.exe" "" @@ -237,6 +238,7 @@ WriteRegStr HKCR ".qct\OpenWithList" "GPXSee.exe" "" WriteRegStr HKCR ".trk\OpenWithList" "GPXSee.exe" "" WriteRegStr HKCR ".gemf\OpenWithList" "GPXSee.exe" "" + WriteRegStr HKCR ".000\OpenWithList" "GPXSee.exe" "" System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' @@ -392,6 +394,7 @@ !insertmacro FILE_ASSOCIATION_REMOVE "qct" !insertmacro FILE_ASSOCIATION_REMOVE "trk" !insertmacro FILE_ASSOCIATION_REMOVE "gemf" + !insertmacro FILE_ASSOCIATION_REMOVE "000" DeleteRegValue HKCR ".gpx\OpenWithList" "GPXSee.exe" DeleteRegValue HKCR ".tcx\OpenWithList" "GPXSee.exe" @@ -440,6 +443,7 @@ DeleteRegValue HKCR ".qct\OpenWithList" "GPXSee.exe" DeleteRegValue HKCR ".trk\OpenWithList" "GPXSee.exe" DeleteRegValue HKCR ".gemf\OpenWithList" "GPXSee.exe" + DeleteRegValue HKCR ".000\OpenWithList" "GPXSee.exe" DeleteRegKey HKCR "Applications\GPXSee.exe" System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GPXSee-11.7/src/common/linec.h new/GPXSee-11.9/src/common/linec.h --- old/GPXSee-11.7/src/common/linec.h 1970-01-01 01:00:00.000000000 +0100 +++ new/GPXSee-11.9/src/common/linec.h 2022-11-17 13:26:45.000000000 +0100 @@ -0,0 +1,25 @@ +#ifndef LINEC_H +#define LINEC_H + +#include "coordinates.h" + +class LineC +{ +public: + LineC(const Coordinates &c1, const Coordinates &c2) : _c1(c1), _c2(c2) {} + + const Coordinates &c1() const {return _c1;} + const Coordinates &c2() const {return _c2;} + + Coordinates pointAt(double t) const + { + return Coordinates( + _c1.lon() + (_c2.lon() - _c1.lon()) * t, + _c1.lat() + (_c2.lat() - _c1.lat()) * t); + } + +private: + Coordinates _c1, _c2; +}; + +#endif // LINEC_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GPXSee-11.7/src/map/ENC/attributes.h new/GPXSee-11.9/src/map/ENC/attributes.h --- old/GPXSee-11.7/src/map/ENC/attributes.h 2022-11-06 16:09:41.000000000 +0100 +++ new/GPXSee-11.9/src/map/ENC/attributes.h 2022-11-17 13:26:45.000000000 +0100 @@ -1,14 +1,20 @@ #ifndef ENC_ATTRIBUTES_H #define ENC_ATTRIBUTES_H +#define CATACH 8 +#define CATBUA 10 #define CATHAF 30 #define CATLMK 35 #define CATMOR 40 +#define CATTRK 54 #define CATREA 56 #define CATWRK 71 #define DRVAL1 87 #define ELEVAT 90 #define OBJNAM 116 +#define ORIENT 117 +#define RESTRN 131 #define VALDCO 174 +#define WATLEV 187 #endif // ENC_ATTRIBUTES_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GPXSee-11.7/src/map/ENC/mapdata.cpp new/GPXSee-11.9/src/map/ENC/mapdata.cpp --- old/GPXSee-11.7/src/map/ENC/mapdata.cpp 2022-11-06 16:09:41.000000000 +0100 +++ new/GPXSee-11.9/src/map/ENC/mapdata.cpp 2022-11-17 13:26:45.000000000 +0100 @@ -2,6 +2,7 @@ #include "common/util.h" #include "objects.h" #include "attributes.h" +#include "style.h" #include "mapdata.h" using namespace ENC; @@ -15,6 +16,52 @@ #define PRIM_L 2 #define PRIM_A 3 +static QMap<uint,uint> orderMapInit() +{ + QMap<uint,uint> map; + + map.insert(SUBTYPE(BUAARE, 1), 1); + map.insert(SUBTYPE(BUAARE, 5), 2); + map.insert(SUBTYPE(BUAARE, 4), 3); + map.insert(SUBTYPE(BUAARE, 3), 4); + map.insert(SUBTYPE(BUAARE, 2), 5); + map.insert(SUBTYPE(BUAARE, 6), 6); + map.insert(SUBTYPE(BUAARE, 0), 7); + map.insert(TYPE(BCNISD), 8); + map.insert(TYPE(BCNLAT), 9); + map.insert(TYPE(BCNSAW), 10); + map.insert(TYPE(BCNSPP), 11); + map.insert(TYPE(BOYCAR), 12); + map.insert(TYPE(BOYINB), 13); + map.insert(TYPE(BOYISD), 14); + map.insert(TYPE(BOYLAT), 15); + map.insert(TYPE(BOYSAW), 16); + map.insert(TYPE(BOYSPP), 17); + map.insert(TYPE(MORFAC), 18); + map.insert(TYPE(OFSPLF), 19); + map.insert(TYPE(LIGHTS), 20); + map.insert(TYPE(OBSTRN), 21); + map.insert(TYPE(WRECKS), 22); + map.insert(TYPE(UWTROC), 23); + map.insert(TYPE(HRBFAC), 24); + map.insert(TYPE(PILPNT), 25); + map.insert(TYPE(ACHBRT), 26); + map.insert(TYPE(LNDELV), 27); + map.insert(TYPE(LNDMRK), 28); + map.insert(TYPE(SOUNDG), 0xFFFFFFFF); + + return map; +} + +static QMap<uint,uint> orderMap = orderMapInit(); + +static uint order(uint type) +{ + uint st = ((type>>16) == BUAARE) ? type : (type & 0xFFFF0000); + QMap<uint, uint>::const_iterator it = orderMap.find(st); + return (it == orderMap.constEnd()) ? (type>>16) + 512 : it.value(); +} + static void warning(const ISO8211::Field &FRID, uint PRIM) { uint RCID = 0xFFFFFFFF; @@ -132,6 +179,13 @@ return coordinates(x, y, COMF); } +MapData::Point::Point(uint type, const Coordinates &c, const QString &label) + : _type(type), _pos(c), _label(label) +{ + uint hash = (uint)qHash(QPair<double,double>(c.lon(), c.lat())); + _id = ((quint64)order(type))<<32 | hash; +} + QVector<MapData::Sounding> MapData::soundings(const ISO8211::Record &r, uint COMF, uint SOMF) { @@ -212,7 +266,7 @@ { QVector<Coordinates> path; Coordinates c[2]; - uint ORNT, MASK; + uint ORNT; quint8 type; quint32 id; @@ -224,8 +278,6 @@ if (!parseNAME(FSPT, &type, &id, i) || type != RCNM_VE) return QVector<Coordinates>(); ORNT = FSPT->data().at(i).at(1).toUInt(); - MASK = FSPT->data().at(i).at(3).toUInt(); - Q_ASSERT(MASK != 1); RecordMapIterator it = ve.find(id); if (it == ve.constEnd()) @@ -280,7 +332,7 @@ Polygon path; QVector<Coordinates> v; Coordinates c[2]; - uint ORNT, USAG, MASK; + uint ORNT, USAG; quint8 type; quint32 id; @@ -293,8 +345,6 @@ return Polygon(); ORNT = FSPT->data().at(i).at(1).toUInt(); USAG = FSPT->data().at(i).at(2).toUInt(); - MASK = FSPT->data().at(i).at(3).toUInt(); - Q_ASSERT(MASK != 1); if (USAG == 2 && path.isEmpty()) { path.append(v); @@ -370,12 +420,14 @@ uint key = av.at(0).toUInt(); if (key == OBJNAM) - label = av.at(1).toString(); + label = QString::fromLatin1(av.at(1).toByteArray()); if ((OBJL == HRBFAC && key == CATHAF) || (OBJL == LNDMRK && key == CATLMK) || (OBJL == WRECKS && key == CATWRK) - || (OBJL == MORFAC && key == CATMOR)) - subtype = av.at(1).toString().toUInt(); + || (OBJL == MORFAC && key == CATMOR) + || (OBJL == UWTROC && key == WATLEV) + || (OBJL == BUAARE && key == CATBUA)) + subtype = av.at(1).toByteArray().toUInt(); } return Attr(subtype, label); @@ -395,10 +447,12 @@ uint key = av.at(0).toUInt(); if (key == OBJNAM) - label = av.at(1).toString(); + label = QString::fromLatin1(av.at(1).toByteArray()); if ((OBJL == DEPCNT && key == VALDCO) || (OBJL == LNDELV && key == ELEVAT)) - label = av.at(1).toString(); + label = QString::fromLatin1(av.at(1).toByteArray()); + if ((OBJL == RECTRC || OBJL == RCRTCL) && key == CATTRK) + subtype = av.at(1).toByteArray().toUInt(); } return Attr(subtype, label); @@ -418,9 +472,17 @@ uint key = av.at(0).toUInt(); if (OBJL == DEPARE && key == DRVAL1) - subtype = depthLevel(av.at(1).toString()); - else if (OBJL == RESARE && key == CATREA) - subtype = av.at(1).toString().toUInt(); + subtype = depthLevel(av.at(1).toByteArray()); + else if ((OBJL == RESARE && key == CATREA) + || (OBJL == ACHARE && key == CATACH)) + subtype = av.at(1).toByteArray().toUInt(); + else if (OBJL == RESARE && key == RESTRN) { + if (av.at(1).toByteArray().toUInt() == 1) + subtype = 2; + } else if (OBJL == TSSLPT && key == ORIENT) { + double angle = av.at(1).toByteArray().toDouble(); + subtype = (uint)(angle * 10); + } } return Attr(subtype, label); @@ -557,7 +619,7 @@ return true; } -bool MapData::fetchBoundsAndName() +MapData::MapData(const QString &path): _fileName(path) { QFile file(_fileName); QVector<ISO8211::Record> gv; @@ -566,42 +628,34 @@ if (!file.open(QIODevice::ReadOnly)) { _errorString = file.errorString(); - return false; + return; } if (!ddf.readDDR(file)) { _errorString = ddf.errorString(); - return false; + return; } while (!file.atEnd()) { ISO8211::Record record; if (!ddf.readRecord(file, record)) { _errorString = ddf.errorString(); - return false; + return; } if (!processRecord(record, gv, COMF, _name)) - return false; + return; } Rect b; if (!bounds(gv, b)) { _errorString = "Error fetching geometries bounds"; - return false; + return; } RectC br(Coordinates(b.minX() / (double)COMF, b.maxY() / (double)COMF), Coordinates(b.maxX() / (double)COMF, b.minY() / (double)COMF)); - if (!br.isValid()) { + if (!br.isValid()) _errorString = "Invalid geometries bounds"; - return false; - } else + else _bounds = br; - - return true; -} - -MapData::MapData(const QString &path): _fileName(path) -{ - fetchBoundsAndName(); } MapData::~MapData() @@ -731,3 +785,41 @@ rectcBounds(rect, min, max); _areas.Search(min, max, polygonCb, polygons); } + +Range MapData::zooms() const +{ + double size = qMin(_bounds.width(), _bounds.height()); + + if (size > 180) + return Range(0, 20); + else if (size > 90) + return Range(1, 20); + else if (size > 45) + return Range(2, 20); + else if (size > 22.5) + return Range(3, 20); + else if (size > 11.25) + return Range(4, 20); + else if (size > 5.625) + return Range(5, 20); + else if (size > 2.813) + return Range(6, 20); + else if (size > 1.406) + return Range(7, 20); + else if (size > 0.703) + return Range(8, 20); + else if (size > 0.352) + return Range(9, 20); + else if (size > 0.176) + return Range(10, 20); + else if (size > 0.088) + return Range(11, 20); + else if (size > 0.044) + return Range(12, 20); + else if (size > 0.022) + return Range(13, 20); + else if (size > 0.011) + return Range(14, 20); + else + return Range(15, 20); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GPXSee-11.7/src/map/ENC/mapdata.h new/GPXSee-11.9/src/map/ENC/mapdata.h --- old/GPXSee-11.7/src/map/ENC/mapdata.h 2022-11-06 16:09:41.000000000 +0100 +++ new/GPXSee-11.9/src/map/ENC/mapdata.h 2022-11-17 13:26:45.000000000 +0100 @@ -5,6 +5,7 @@ #include "common/rectc.h" #include "common/rtree.h" #include "common/polygon.h" +#include "common/range.h" #include "iso8211.h" namespace ENC { @@ -52,12 +53,7 @@ class Point { public: - Point(uint type, const Coordinates &c, const QString &label) - : _type(type), _pos(c), _label(label) - { - uint hash = (uint)qHash(QPair<double,double>(c.lon(), c.lat())); - _id = ((quint64)type)<<32 | hash; - } + Point(uint type, const Coordinates &c, const QString &label); const Coordinates &pos() const {return _pos;} uint type() const {return _type;} @@ -78,6 +74,7 @@ const QString &name() const {return _name;} RectC bounds() const {return _bounds;} + Range zooms() const; void polygons(const RectC &rect, QList<Poly*> *polygons); void lines(const RectC &rect, QList<Line*> *lines); @@ -152,8 +149,6 @@ typedef RTree<Line*, double, 2> LineTree; typedef RTree<Point*, double, 2> PointTree; - bool fetchBoundsAndName(); - static QVector<Sounding> soundings(const ISO8211::Record &r, uint COMF, uint SOMF); static QVector<Sounding> soundingGeometry(const ISO8211::Record &r, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GPXSee-11.7/src/map/ENC/objects.h new/GPXSee-11.9/src/map/ENC/objects.h --- old/GPXSee-11.7/src/map/ENC/objects.h 2022-11-06 16:09:41.000000000 +0100 +++ new/GPXSee-11.9/src/map/ENC/objects.h 2022-11-17 13:26:45.000000000 +0100 @@ -9,6 +9,7 @@ #define BCNLAT 7 #define BCNSAW 8 #define BCNSPP 9 +#define BERTHS 10 #define BRIDGE 11 #define BUISGL 12 #define BUAARE 13 @@ -22,13 +23,17 @@ #define CBLSUB 22 #define CANALS 23 #define COALNE 30 +#define DAMCON 38 +#define DWRTPT 41 #define DEPARE 42 #define DEPCNT 43 #define DRGARE 46 +#define DRYDOC 47 #define DMPGRD 48 #define DYKCON 49 #define FAIRWY 51 #define FERYRT 53 +#define FLODOC 57 #define GATCON 61 #define HRBFAC 64 #define LAKARE 69 @@ -43,14 +48,20 @@ #define PILPNT 90 #define PIPSOL 94 #define PONTON 95 +#define PRCARE 96 +#define PYLONS 98 #define RAILWY 106 +#define RCRTCL 108 +#define RECTRC 109 #define RESARE 112 #define RIVERS 114 #define ROADWY 116 #define SLCONS 122 #define SLOTOP 126 #define SOUNDG 129 +#define TSELNE 145 #define TSSBND 146 +#define TSSLPT 148 #define TSEZNE 150 #define UWTROC 153 #define UNSARE 154 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GPXSee-11.7/src/map/ENC/rastertile.cpp new/GPXSee-11.9/src/map/ENC/rastertile.cpp --- old/GPXSee-11.7/src/map/ENC/rastertile.cpp 2022-11-06 16:09:41.000000000 +0100 +++ new/GPXSee-11.9/src/map/ENC/rastertile.cpp 2022-11-17 13:26:45.000000000 +0100 @@ -1,4 +1,6 @@ +#include <QtMath> #include <QPainter> +#include "common/linec.h" #include "map/bitmapline.h" #include "map/textpointitem.h" #include "map/textpathitem.h" @@ -8,9 +10,12 @@ using namespace ENC; #define ICON_PADDING 2 +#define ARROW_SIZE 0.005 #define ECDIS(x) (((x)>TYPE(17000))?((x)-TYPE(17000)):(x)) +const float C1 = 0.866025f; /* sqrt(3)/2 */ + static const QColor haloColor(Qt::white); static struct { @@ -51,6 +56,36 @@ return s; } +static double area(const QVector<Coordinates> &polygon) +{ + double area = 0; + + for (int i = 0; i < polygon.size(); i++) { + int j = (i + 1) % polygon.size(); + area += polygon.at(i).lon() * polygon.at(j).lat(); + area -= polygon.at(i).lat() * polygon.at(j).lon(); + } + area /= 2.0; + + return area; +} + +static Coordinates centroid(const QVector<Coordinates> &polygon) +{ + double cx = 0, cy = 0; + double factor = 1.0 / (6.0 * area(polygon)); + + for (int i = 0; i < polygon.size(); i++) { + int j = (i + 1) % polygon.size(); + qreal f = (polygon.at(i).lon() * polygon.at(j).lat() + - polygon.at(j).lon() * polygon.at(i).lat()); + cx += (polygon.at(i).lon() + polygon.at(j).lon()) * f; + cy += (polygon.at(i).lat() + polygon.at(j).lat()) * f; + } + + return Coordinates(cx * factor, cy * factor); +} + QPainterPath RasterTile::painterPath(const Polygon &polygon) const { QPainterPath path; @@ -77,6 +112,48 @@ return polygon; } +QPolygonF RasterTile::arrow(const Coordinates &c, qreal angle) const +{ + Coordinates t[3], r[4]; + QPolygonF polygon; + + t[0] = c; + t[1] = Coordinates(t[0].lon() - qCos(angle - M_PI/3) * ARROW_SIZE, + t[0].lat() - qSin(angle - M_PI/3) * ARROW_SIZE); + t[2] = Coordinates(t[0].lon() - qCos(angle - M_PI + M_PI/3) * ARROW_SIZE, + t[0].lat() - qSin(angle - M_PI + M_PI/3) * ARROW_SIZE); + + LineC l(t[1], t[2]); + r[0] = l.pointAt(0.25); + r[1] = l.pointAt(0.75); + r[2] = Coordinates(r[0].lon() - C1 * ARROW_SIZE * qCos(angle - M_PI/2), + r[0].lat() - C1 * ARROW_SIZE * qSin(angle - M_PI/2)); + r[3] = Coordinates(r[1].lon() - C1 * ARROW_SIZE * qCos(angle - M_PI/2), + r[1].lat() - C1 * ARROW_SIZE * qSin(angle - M_PI/2)); + + polygon << ll2xy(t[0]) << ll2xy(t[2]) << ll2xy(r[1]) << ll2xy(r[3]) + << ll2xy(r[2]) << ll2xy(r[0]) << ll2xy(t[1]); + + return polygon; +} + +void RasterTile::drawArrows(QPainter *painter) +{ + painter->setPen(QPen(QColor("#eb49eb"), 1)); + painter->setBrush(QBrush("#80eb49eb")); + + for (int i = 0; i < _polygons.size(); i++) { + const MapData::Poly *poly = _polygons.at(i); + + if (poly->type()>>16 == TSSLPT) { + qreal angle = (poly->type() & 0xFFFF) / 10.0; + QPolygonF polygon(arrow(centroid(poly->path().first()), + deg2rad(180 - angle))); + painter->drawPolygon(polygon); + } + } +} + void RasterTile::drawPolygons(QPainter *painter) { const Style &s = style(); @@ -88,9 +165,15 @@ continue; const Style::Polygon &style = s.polygon(ECDIS(poly->type())); - painter->setPen(style.pen()); - painter->setBrush(style.brush()); - painter->drawPath(painterPath(poly->path())); + if (!style.img().isNull()) { + for (int i = 0; i < poly->path().size(); i++) + BitmapLine::draw(painter, polyline(poly->path().at(i)), + style.img()); + } else { + painter->setPen(style.pen()); + painter->setBrush(style.brush()); + painter->drawPath(painterPath(poly->path())); + } } } } @@ -192,6 +275,7 @@ drawPolygons(&painter); drawLines(&painter); + drawArrows(&painter); drawTextItems(&painter, textItems); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GPXSee-11.7/src/map/ENC/rastertile.h new/GPXSee-11.9/src/map/ENC/rastertile.h --- old/GPXSee-11.7/src/map/ENC/rastertile.h 2022-11-06 16:09:41.000000000 +0100 +++ new/GPXSee-11.9/src/map/ENC/rastertile.h 2022-11-17 13:26:45.000000000 +0100 @@ -32,10 +32,12 @@ {return _transform.proj2img(_proj.ll2xy(c));} QPainterPath painterPath(const Polygon &polygon) const; QPolygonF polyline(const QVector<Coordinates> &path) const; + QPolygonF arrow(const Coordinates &c, qreal angle) const; void processPoints(QList<TextItem*> &textItems); void processLines(QList<TextItem*> &textItems); void drawBitmapPath(QPainter *painter, const QImage &img, const Polygon &polygon); + void drawArrows(QPainter *painter); void drawPolygons(QPainter *painter); void drawLines(QPainter *painter); void drawTextItems(QPainter *painter, const QList<TextItem*> &textItems); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GPXSee-11.7/src/map/ENC/style.cpp new/GPXSee-11.9/src/map/ENC/style.cpp --- old/GPXSee-11.7/src/map/ENC/style.cpp 2022-11-06 16:09:41.000000000 +0100 +++ new/GPXSee-11.9/src/map/ENC/style.cpp 2022-11-17 13:26:45.000000000 +0100 @@ -36,10 +36,9 @@ _polygons[TYPE(OBSTRN)] = Polygon(Qt::NoBrush, QPen(QColor("#000000"), 1.5, Qt::DotLine)); _polygons[TYPE(PONTON)] = Polygon(QBrush("#333333")); + _polygons[TYPE(DRYDOC)] = Polygon(QBrush("#333333")); _polygons[TYPE(SLCONS)] = Polygon(Qt::NoBrush, QPen(QColor("#333333"), 1.5, Qt::DashLine)); - _polygons[TYPE(ACHARE)] = Polygon(Qt::NoBrush, QPen(QColor("#e728e7"), 1, - Qt::DashDotLine)); _polygons[TYPE(LAKARE)] = Polygon(QBrush("#9fc4e1"), QPen(QColor("#000000"), 1)); _polygons[TYPE(CANALS)] = Polygon(QBrush("#9fc4e1"), @@ -48,12 +47,25 @@ _polygons[TYPE(DYKCON)] = Polygon(QBrush(QColor("#9fc4e1"), Qt::Dense4Pattern), QPen(QColor("#000000"), 1)); _polygons[TYPE(AIRARE)] = Polygon(QBrush("#333333")); - _polygons[SUBTYPE(RESARE, 9)] = Polygon(QBrush(QColor("#ff0000"), - Qt::BDiagPattern), QPen(QColor("#ff0000"), 1)); _polygons[TYPE(TSEZNE)] = Polygon(QBrush("#80fcb4fc")); _polygons[TYPE(DRGARE)] = Polygon(QBrush(QColor("#a0a0ff"), Qt::Dense4Pattern)); _polygons[TYPE(UNSARE)] = Polygon(QBrush("#999999")); + _polygons[SUBTYPE(RESARE, 9)] = Polygon(QBrush(QColor("#ff0000"), + Qt::BDiagPattern)); + _polygons[SUBTYPE(RESARE, 2)] = Polygon(QImage(":/marine/noanchor-line.png")); + _polygons[SUBTYPE(ACHARE, 1)] = Polygon(QImage(":/marine/anchor-line.png")); + _polygons[TYPE(PRCARE)] = Polygon(QBrush(QColor("#eb49eb"), + Qt::BDiagPattern)); + _polygons[TYPE(DAMCON)] = Polygon(QBrush("#d98b21"), QPen(QColor("#000000"), + 1)); + _polygons[TYPE(DRYDOC)] = Polygon(QBrush("#ebab54"), QPen(QColor("#000000"), + 1)); + _polygons[TYPE(PYLONS)] = Polygon(QBrush("#a58140"), QPen(QColor("#000000"), + 1)); + _polygons[TYPE(FLODOC)] = Polygon(QBrush("#333333"), QPen(QColor("#000000"), + 1)); + _polygons[TYPE(DWRTPT)] = Polygon(QImage(":/marine/dw-route-line")); _drawOrder << TYPE(M_COVR) << TYPE(LNDARE) << SUBTYPE(DEPARE, 0) @@ -62,12 +74,15 @@ << SUBTYPE(DEPARE, 6) << TYPE(LAKARE) << TYPE(CANALS) << TYPE(DYKCON) << TYPE(RIVERS) << TYPE(DRGARE) << TYPE(FAIRWY) << TYPE(BUAARE) << TYPE(BUISGL) << TYPE(AIRARE) << TYPE(BRIDGE) << TYPE(SLCONS) - << TYPE(PONTON) << TYPE(DMPGRD) << TYPE(TSEZNE) << TYPE(OBSTRN) - << TYPE(ACHARE) << SUBTYPE(RESARE, 9) << TYPE(154); + << TYPE(PONTON) << TYPE(FLODOC) << TYPE(DRYDOC) << TYPE(DAMCON) + << TYPE(PYLONS) << TYPE(DMPGRD) << TYPE(TSEZNE) << TYPE(OBSTRN) + << TYPE(DWRTPT) << SUBTYPE(ACHARE, 1) << SUBTYPE(RESARE, 9) + << SUBTYPE(RESARE, 2) << TYPE(PRCARE); } void Style::defaultLineStyle() { + _lines[TYPE(BUISGL)] = Line(QPen(QColor("#966118"), 1.5)); _lines[TYPE(DEPCNT)] = Line(QPen(QColor("#659aef"), 1, Qt::SolidLine)); _lines[TYPE(DEPCNT)].setTextColor(QColor("#558adf")); _lines[TYPE(DEPCNT)].setTextFontSize(Small); @@ -92,11 +107,22 @@ _lines[TYPE(RAILWY)] = Line(railroad()); _lines[TYPE(ROADWY)] = Line(QPen(QColor("#000000"), 2, Qt::SolidLine)); _lines[TYPE(GATCON)] = Line(QPen(QColor("#000000"), 2, Qt::SolidLine)); + _lines[TYPE(TSELNE)] = Line(QPen(QColor("#80fcb4fc"), 4, Qt::SolidLine)); + _lines[SUBTYPE(RECTRC, 1)] = Line(QPen(QColor("#000000"), 0, Qt::SolidLine)); + _lines[SUBTYPE(RECTRC, 2)] = Line(QPen(QColor("#000000"), 0, Qt::DashLine)); + _lines[SUBTYPE(RCRTCL, 1)] = Line(QPen(QColor("#eb49eb"), 0, Qt::SolidLine)); + _lines[SUBTYPE(RCRTCL, 2)] = Line(QPen(QColor("#eb49eb"), 0, Qt::DashLine)); + _lines[TYPE(FAIRWY)] = Line(QPen(QColor("#888888"), 1, Qt::DashDotDotLine)); + _lines[TYPE(BERTHS)] = Line(QPen(QColor("#333333"), 2)); } void Style::defaultPointStyle() { - _points[TYPE(BUAARE)].setTextFontSize(Large); + _points[SUBTYPE(BUAARE, 1)].setTextFontSize(Large); + _points[SUBTYPE(BUAARE, 5)].setTextFontSize(Large); + _points[SUBTYPE(BUAARE, 3)].setTextFontSize(Small); + _points[SUBTYPE(BUAARE, 6)].setTextFontSize(Small); + _points[SUBTYPE(BUAARE, 0)].setTextFontSize(Small); _points[TYPE(SOUNDG)].setTextFontSize(Small); _points[TYPE(LIGHTS)] = Point(QImage(":/marine/light-major.png"), Small); _points[TYPE(BOYCAR)] = Point(QImage(":/marine/buoy.png"), Small); @@ -114,19 +140,28 @@ _points[SUBTYPE(LNDMRK, 17)] = Point(QImage(":/marine/tower.png")); _points[TYPE(LNDELV)] = Point(QImage(":/marine/triangulation-point.png")); _points[TYPE(OBSTRN)] = Point(QImage(":/marine/obstruction.png"), Small); - _points[TYPE(WRECKS)] = Point(QImage(":/marine/wreck.png"), Small); _points[SUBTYPE(WRECKS, 1)] = Point(QImage(":/marine/wreck.png"), Small); _points[SUBTYPE(WRECKS, 2)] = Point(QImage(":/marine/wreck-dangerous.png"), Small); _points[SUBTYPE(WRECKS, 3)] = Point(QImage(":/marine/wreck.png"), Small); _points[SUBTYPE(WRECKS, 4)] = Point(QImage(":/marine/wreck.png"), Small); _points[SUBTYPE(WRECKS, 5)] = Point(QImage(":/marine/wreck-exposed.png")); - _points[TYPE(UWTROC)] = Point(QImage(":/marine/rock-dangerous.png"), Small); + _points[SUBTYPE(UWTROC, 1)] = Point(QImage(":/marine/rock-exposed.png"), + Small); + _points[SUBTYPE(UWTROC, 2)] = Point(QImage(":/marine/rock-exposed.png"), + Small); + _points[SUBTYPE(UWTROC, 3)] = Point(QImage(":/marine/rock-dangerous.png"), + Small); + _points[SUBTYPE(UWTROC, 4)] = Point(QImage(":/marine/rock-dangerous.png"), + Small); + _points[SUBTYPE(UWTROC, 5)] = Point(QImage(":/marine/rock-dangerous.png"), + Small); _points[SUBTYPE(HRBFAC, 5)] = Point(QImage(":/marine/yacht-harbor.png")); _points[TYPE(ACHBRT)] = Point(QImage(":/marine/anchorage.png")); _points[TYPE(OFSPLF)] = Point(QImage(":/marine/platform.png")); _points[TYPE(PILPNT)] = Point(QImage(":/marine/pile.png"), Small); _points[SUBTYPE(MORFAC, 1)] = Point(QImage(":/marine/pile.png"), Small); + _points[SUBTYPE(MORFAC, 3)] = Point(QImage(":/marine/pile.png"), Small); _points[SUBTYPE(MORFAC, 5)] = Point(QImage(":/marine/pile.png"), Small); _points[SUBTYPE(MORFAC, 7)] = Point(QImage(":/marine/mooring-buoy.png"), Small); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GPXSee-11.7/src/map/ENC/style.h new/GPXSee-11.9/src/map/ENC/style.h --- old/GPXSee-11.7/src/map/ENC/style.h 2022-11-06 16:09:41.000000000 +0100 +++ new/GPXSee-11.9/src/map/ENC/style.h 2022-11-17 13:26:45.000000000 +0100 @@ -29,13 +29,18 @@ { _pen = (pen == Qt::NoPen) ? QPen(_brush, 0) : pen; } + Polygon(const QImage &img) + : _brush(Qt::NoBrush), _pen(Qt::NoPen), _img(img.convertToFormat( + QImage::Format_ARGB32_Premultiplied)) {} const QPen &pen() const {return _pen;} const QBrush &brush() const {return _brush;} + const QImage &img() const {return _img;} private: QBrush _brush; QPen _pen; + QImage _img; }; class Line { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GPXSee-11.7/src/map/encmap.cpp new/GPXSee-11.9/src/map/encmap.cpp --- old/GPXSee-11.7/src/map/encmap.cpp 2022-11-06 16:09:41.000000000 +0100 +++ new/GPXSee-11.9/src/map/encmap.cpp 2022-11-17 13:26:45.000000000 +0100 @@ -11,7 +11,6 @@ using namespace ENC; -static Range ZOOMS = Range(0, 20); ENCMap::ENCMap(const QString &fileName, QObject *parent) : Map(fileName, parent), _data(fileName), _projection(PCS::pcs(3857)), @@ -30,6 +29,7 @@ void ENCMap::unload() { + cancelJobs(true); _data.clear(); } @@ -38,8 +38,8 @@ if (rect.isValid()) { RectD pr(rect, _projection, 10); - _zoom = ZOOMS.min(); - for (int i = ZOOMS.min() + 1; i <= ZOOMS.max(); i++) { + _zoom = _data.zooms().min(); + for (int i = _data.zooms().min() + 1; i <= _data.zooms().max(); i++) { Transform t(transform(i)); QRectF r(t.proj2img(pr.topLeft()), t.proj2img(pr.bottomRight())); if (size.width() < r.width() || size.height() < r.height()) @@ -47,7 +47,7 @@ _zoom = i; } } else - _zoom = ZOOMS.max(); + _zoom = _data.zooms().max(); updateTransform(); @@ -56,18 +56,18 @@ int ENCMap::zoomIn() { - cancelJobs(); + cancelJobs(false); - _zoom = qMin(_zoom + 1, ZOOMS.max()); + _zoom = qMin(_zoom + 1, _data.zooms().max()); updateTransform(); return _zoom; } int ENCMap::zoomOut() { - cancelJobs(); + cancelJobs(false); - _zoom = qMax(_zoom - 1, ZOOMS.min()); + _zoom = qMax(_zoom - 1, _data.zooms().min()); updateTransform(); return _zoom; } @@ -141,10 +141,10 @@ emit tilesLoaded(); } -void ENCMap::cancelJobs() +void ENCMap::cancelJobs(bool wait) { for (int i = 0; i < _jobs.size(); i++) - _jobs.at(i)->cancel(); + _jobs.at(i)->cancel(wait); } QString ENCMap::key(int zoom, const QPoint &xy) const diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GPXSee-11.7/src/map/encmap.h new/GPXSee-11.9/src/map/encmap.h --- old/GPXSee-11.7/src/map/encmap.h 2022-11-06 16:09:41.000000000 +0100 +++ new/GPXSee-11.9/src/map/encmap.h 2022-11-17 13:26:45.000000000 +0100 @@ -23,7 +23,12 @@ _future = QtConcurrent::map(_tiles, &ENC::RasterTile::render); _watcher.setFuture(_future); } - void cancel() {_future.cancel();} + void cancel(bool wait) + { + _future.cancel(); + if (wait) + _future.waitForFinished(); + } const QList<ENC::RasterTile> &tiles() const {return _tiles;} signals: @@ -82,7 +87,7 @@ bool isRunning(int zoom, const QPoint &xy) const; void runJob(ENCMapJob *job); void removeJob(ENCMapJob *job); - void cancelJobs(); + void cancelJobs(bool wait); QString key(int zoom, const QPoint &xy) const; ENC::MapData _data; ++++++ PKGBUILD ++++++ --- /var/tmp/diff_new_pack.NlfboO/_old 2022-11-17 17:25:14.393298891 +0100 +++ /var/tmp/diff_new_pack.NlfboO/_new 2022-11-17 17:25:14.397298912 +0100 @@ -1,5 +1,5 @@ pkgname=gpxsee -pkgver=11.7 +pkgver=11.9 pkgrel=1 pkgdesc='GPS log files visualizing and analyzing tool' arch=('i686' 'x86_64') ++++++ debian.changelog ++++++ --- /var/tmp/diff_new_pack.NlfboO/_old 2022-11-17 17:25:14.421299040 +0100 +++ /var/tmp/diff_new_pack.NlfboO/_new 2022-11-17 17:25:14.421299040 +0100 @@ -1,3 +1,16 @@ +gpxsee (11.9) stable; urgency=low + + * Improved ENC maps render style. + + -- Martin Tuma <[email protected]> Thu, 17 Nov 2022 13:40:20 +0100 + +gpxsee (11.8) stable; urgency=low + + * Fixed crash on ENC maps unload. + * Improved ENC maps render style. + + -- Martin Tuma <[email protected]> Fri, 11 Nov 2022 01:46:11 +0100 + gpxsee (11.7) stable; urgency=low * Added support for ENC charts. ++++++ gpxsee.dsc ++++++ --- /var/tmp/diff_new_pack.NlfboO/_old 2022-11-17 17:25:14.477299336 +0100 +++ /var/tmp/diff_new_pack.NlfboO/_new 2022-11-17 17:25:14.481299358 +0100 @@ -1,10 +1,10 @@ Format: 1.0 Source: gpxsee -Version: 11.7-1 +Version: 11.9-1 Binary: gpxsee Maintainer: Martin Tuma <[email protected]> Architecture: any Build-Depends: debhelper (>= 9), qtbase5-dev, qtbase5-private-dev, qtbase5-dev-tools, qt5-qmake, qttools5-dev-tools, libqt5opengl5-dev, qtpositioning5-dev, libqt5svg5-dev Files: - 00000000000000000000000000000000 0 GPXSee-11.7.tar.gz + 00000000000000000000000000000000 0 GPXSee-11.9.tar.gz
