1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +01:00

Yet another ENC style improvement

This commit is contained in:
Martin Tůma 2022-12-10 11:59:48 +01:00
parent d33716e3af
commit ca3e0eda49
10 changed files with 33 additions and 12 deletions

View File

@ -192,6 +192,10 @@
<file alias="pipeline-area-line.png">icons/map/marine/pipeline-area-line.png</file>
<file alias="windmotor.png">icons/map/marine/windmotor.png</file>
<file alias="gauge.png">icons/map/marine/gauge.png</file>
<file alias="fishing-farm-line.png">icons/map/marine/fishing-farm-line.png</file>
<file alias="shipyard.png">icons/map/marine/shipyard.png</file>
<file alias="pylon.png">icons/map/marine/pylon.png</file>
<file alias="fleeting-area.png">icons/map/marine/fleeting-area.png</file>
</qresource>
<!-- Mapsforge rendertheme -->

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

BIN
icons/map/marine/pylon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

View File

@ -6,6 +6,7 @@
#define CATDIS 21
#define CATHAF 30
#define CATLMK 35
#define CATMFA 38
#define CATMOR 40
#define CATTRK 54
#define CATREA 56
@ -26,6 +27,7 @@
#define I_CATHAF 17008
#define I_RDOCAL 17017
#define I_WTWDIS 17064
#define I_CATBRT 17066
#define I_HUNITS 17103
#endif // ENC_ATTRIBUTES_H

View File

@ -52,6 +52,7 @@ static QMap<uint,uint> 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<double,double>(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<QByteArray> &params) : _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<Coordinates> &path,
const QString &label, const QVector<QByteArray> &params)
: _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)) {

View File

@ -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

View File

@ -243,7 +243,8 @@ void RasterTile::processPolygons(QList<TextItem*> &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();

View File

@ -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"));