From ca3e0eda496944ef78ce49ed55e867bcdeb9e278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sat, 10 Dec 2022 11:59:48 +0100 Subject: [PATCH] Yet another ENC style improvement --- gpxsee.qrc | 4 ++++ icons/map/marine/fishing-farm-line.png | Bin 0 -> 279 bytes icons/map/marine/fleeting-area.png | Bin 0 -> 241 bytes icons/map/marine/pylon.png | Bin 0 -> 150 bytes icons/map/marine/shipyard.png | Bin 0 -> 388 bytes src/map/ENC/attributes.h | 2 ++ src/map/ENC/mapdata.cpp | 15 +++++++++------ src/map/ENC/objects.h | 1 + src/map/ENC/rastertile.cpp | 3 ++- src/map/ENC/style.cpp | 20 +++++++++++++++----- 10 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 icons/map/marine/fishing-farm-line.png create mode 100644 icons/map/marine/fleeting-area.png create mode 100644 icons/map/marine/pylon.png create mode 100644 icons/map/marine/shipyard.png diff --git a/gpxsee.qrc b/gpxsee.qrc index eb672f47..d92de02e 100644 --- a/gpxsee.qrc +++ b/gpxsee.qrc @@ -192,6 +192,10 @@ icons/map/marine/pipeline-area-line.png icons/map/marine/windmotor.png icons/map/marine/gauge.png + icons/map/marine/fishing-farm-line.png + icons/map/marine/shipyard.png + icons/map/marine/pylon.png + icons/map/marine/fleeting-area.png diff --git a/icons/map/marine/fishing-farm-line.png b/icons/map/marine/fishing-farm-line.png new file mode 100644 index 0000000000000000000000000000000000000000..f229184be6ac2ba11c942763c93f577f5e5f0b7e GIT binary patch literal 279 zcmeAS@N?(olHy`uVBq!ia0vp^ia^ZC!3HGvNV}QT0a+HaGLp5L+A75;5*rm{ z=6FDDlgM$le~fHa%zJ0w>Ehnve&lX@{!@>YQ;eC5U$0ZU%kV^Y^1(^A{l6kC=e$b{ zJ#gZklH007hTs2KGRyY;{4-f+<{REjYX@(&s3zX$o96Iyx%XXLaO{Ufs7s90w{V8b hlkVx>e7)Saj(NsO_kz=!^NK(&_jL7hS?83{1OQTrS$F^d literal 0 HcmV?d00001 diff --git a/icons/map/marine/pylon.png b/icons/map/marine/pylon.png new file mode 100644 index 0000000000000000000000000000000000000000..cb57a6bad5bf5e23340f430447f89cfbe1fccebf GIT binary patch literal 150 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqY)RhkEGWQGRY9+L$D`cKoZ72>$-z)ayIJ&8M!a?vz zMgXE%=L5t52M2Bd?$twh^8%&kB*{qYV88^hq}nLWHrkQl%PovxRxplfZV*xF>I&Ejr)hjbjBiMsQ@ zt^(a$w7Mt0F)}lg6rE5rJGPN;YIu_VA?W(0&rDNDLWP4o#Zf_?m`D1z?^R_I6o0000 orderMapInit() map.insert(TYPE(I_RDOCAL), 27); map.insert(TYPE(I_TRNBSN), 28); map.insert(TYPE(HRBFAC), 29); + map.insert(TYPE(I_HRBFAC), 29); map.insert(TYPE(PILPNT), 30); map.insert(TYPE(ACHBRT), 31); map.insert(TYPE(I_ACHBRT), 31); @@ -221,10 +222,10 @@ MapData::Point::Point(uint type, const Coordinates &c, const QString &label, uint hash = (uint)qHash(QPair(c.lon(), c.lat())); _id = ((quint64)order(type))<<32 | hash; - if (type>>16 == I_DISMAR) { + if (type>>16 == I_DISMAR && params.size()) { _label = hUnits((type>>8)&0xFF) + " " + QString::fromLatin1(params.at(0)); _type = SUBTYPE(I_DISMAR, type & 0xFF); - } else if (type == TYPE(I_RDOCAL)) { + } else if (type == TYPE(I_RDOCAL) && params.size() > 1) { if (!params.at(1).isEmpty()) _label = QString("VHF ") + QString::fromLatin1(params.at(1)); _param = QVariant(params.at(0).toDouble()); @@ -234,9 +235,9 @@ MapData::Point::Point(uint type, const Coordinates &c, const QString &label, MapData::Poly::Poly(uint type, const Polygon &path, const QVector ¶ms) : _type(type), _path(path) { - if (type == TYPE(DEPARE)) + if (type == TYPE(DEPARE) && params.size()) _type = SUBTYPE(DEPARE, depthLevel(params.at(0))); - else if (type == TYPE(TSSLPT)) + else if (type == TYPE(TSSLPT) && params.size()) _param = QVariant(params.at(0).toDouble()); } @@ -244,7 +245,7 @@ MapData::Line::Line(uint type, const QVector &path, const QString &label, const QVector ¶ms) : _type(type), _path(path), _label(label) { - if (type == TYPE(DEPCNT) || type == TYPE(LNDELV)) + if ((type == TYPE(DEPCNT) || type == TYPE(LNDELV)) && params.size()) _label = QString::fromLatin1(params.at(0)); } @@ -566,7 +567,9 @@ MapData::Attr MapData::polyAttr(const ISO8211::Record &r, uint OBJL) || (OBJL == I_RESARE && key == CATREA) || (OBJL == ACHARE && key == CATACH) || (OBJL == I_ACHARE && key == I_CATACH) - || (OBJL == HRBFAC && key == CATHAF)) + || (OBJL == HRBFAC && key == CATHAF) + || (OBJL == MARKUL && key == CATMFA) + || (OBJL == I_BERTHS && key == I_CATBRT)) subtype = av.at(1).toByteArray().toUInt(); else if ((OBJL == RESARE && key == RESTRN) || (OBJL == I_RESARE && key == I_RESTRN)) { diff --git a/src/map/ENC/objects.h b/src/map/ENC/objects.h index ffc4340c..9568c3d1 100644 --- a/src/map/ENC/objects.h +++ b/src/map/ENC/objects.h @@ -48,6 +48,7 @@ #define LNDMRK 74 #define LIGHTS 75 #define LOKBSN 79 +#define MARKUL 82 #define MORFAC 84 #define NAVLNE 85 #define OBSTRN 86 diff --git a/src/map/ENC/rastertile.cpp b/src/map/ENC/rastertile.cpp index a5fb28a6..b2d57e82 100644 --- a/src/map/ENC/rastertile.cpp +++ b/src/map/ENC/rastertile.cpp @@ -243,7 +243,8 @@ void RasterTile::processPolygons(QList &textItems) const MapData::Poly *poly = _polygons.at(i); uint type = poly->type()>>16; - if (!(type == HRBFAC || type == I_TRNBSN)) + if (!(type == HRBFAC || type == I_TRNBSN + || poly->type() == SUBTYPE(I_BERTHS, 6))) continue; const Style::Point &style = s.point(poly->type()); const QImage *img = style.img().isNull() ? 0 : &style.img(); diff --git a/src/map/ENC/style.cpp b/src/map/ENC/style.cpp index 1f5fd195..7237104c 100644 --- a/src/map/ENC/style.cpp +++ b/src/map/ENC/style.cpp @@ -98,6 +98,9 @@ void Style::polygonStyle() Qt::DashLine)); _polygons[TYPE(CBLARE)] = Polygon(QImage(":/marine/cable-area-line.png")); _polygons[TYPE(PIPARE)] = Polygon(QImage(":/marine/pipeline-area-line.png")); + _polygons[SUBTYPE(MARKUL, 3)] = Polygon(QImage(":/marine/fishing-farm-line.png")); + _polygons[SUBTYPE(I_BERTHS, 6)] = Polygon(Qt::NoBrush, QPen(QColor("#eb49eb"), + 1, Qt::DashLine)); _drawOrder << TYPE(M_COVR) << TYPE(LNDARE) << SUBTYPE(DEPARE, 0) @@ -110,11 +113,12 @@ void Style::polygonStyle() << TYPE(I_TERMNL) << TYPE(SLCONS) << TYPE(I_SLCONS) << TYPE(PONTON) << TYPE(I_PONTON) << TYPE(HULKES) << TYPE(I_HULKES) << TYPE(FLODOC) << TYPE(I_FLODOC) << TYPE(DRYDOC) << TYPE(DAMCON) << TYPE(PYLONS) - << TYPE(MORFAC) << TYPE(GATCON) << TYPE(I_GATCON) << TYPE(DMPGRD) - << TYPE(TSEZNE) << TYPE(OBSTRN) << TYPE(UWTROC) << TYPE(DWRTPT) - << SUBTYPE(ACHARE, 1) << SUBTYPE(I_ACHARE, 1) << SUBTYPE(RESARE, 9) - << SUBTYPE(RESARE, 2) << SUBTYPE(I_RESARE, 2) << SUBTYPE(RESARE, 17) - << SUBTYPE(I_RESARE, 17) << TYPE(CBLARE) << TYPE(PIPARE) << TYPE(PRCARE); + << TYPE(MORFAC) << TYPE(GATCON) << TYPE(I_GATCON) << SUBTYPE(I_BERTHS, 6) + << TYPE(DMPGRD) << TYPE(TSEZNE) << TYPE(OBSTRN) << TYPE(UWTROC) + << TYPE(DWRTPT) << SUBTYPE(ACHARE, 1) << SUBTYPE(I_ACHARE, 1) + << SUBTYPE(RESARE, 9) << SUBTYPE(RESARE, 2) << SUBTYPE(I_RESARE, 2) + << SUBTYPE(RESARE, 17) << SUBTYPE(I_RESARE, 17) << TYPE(CBLARE) + << TYPE(PIPARE) << TYPE(PRCARE) << SUBTYPE(MARKUL, 3); } void Style::lineStyle() @@ -213,6 +217,10 @@ void Style::pointStyle() Small); _points[SUBTYPE(HRBFAC, 4)] = Point(QImage(":/marine/fishing-harbor.png")); _points[SUBTYPE(HRBFAC, 5)] = Point(QImage(":/marine/yacht-harbor.png")); + _points[SUBTYPE(HRBFAC, 9)] = Point(QImage(":/marine/shipyard.png")); + _points[SUBTYPE(I_HRBFAC, 4)] = Point(QImage(":/marine/fishing-harbor.png")); + _points[SUBTYPE(I_HRBFAC, 5)] = Point(QImage(":/marine/yacht-harbor.png")); + _points[SUBTYPE(I_HRBFAC, 9)] = Point(QImage(":/marine/shipyard.png")); _points[TYPE(ACHBRT)] = Point(QImage(":/marine/anchorage.png")); _points[TYPE(I_ACHBRT)] = Point(QImage(":/marine/anchorage.png")); _points[TYPE(OFSPLF)] = Point(QImage(":/marine/platform.png")); @@ -240,6 +248,8 @@ void Style::pointStyle() _points[TYPE(I_TRNBSN)] = Point(QImage(":/marine/turning-basin.png")); _points[TYPE(I_WTWGAG)] = Point(QImage(":/marine/gauge.png")); _points[TYPE(I_RDOCAL)].setTextColor(QColor("#eb49eb")); + _points[TYPE(PYLONS)] = Point(QImage(":/marine/pylon.png")); + _points[SUBTYPE(I_BERTHS, 6)] = Point(QImage(":/marine/fleeting-area.png")); _points[SUBTYPE(SMCFAC, 7)] = Point(QImage(":/POI/restaurant-11.png")); _points[SUBTYPE(SMCFAC, 11)] = Point(QImage(":/POI/pharmacy-11.png"));