1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-05-05 10:57:44 +02:00

Use colored buoys/beacons in ENC maps

This commit is contained in:
Martin Tůma 2025-05-04 15:50:02 +02:00
parent 415962b583
commit f5553377f9
44 changed files with 150 additions and 30 deletions

View File

@ -139,7 +139,47 @@
<qresource prefix="/marine">
<file alias="light-major.png">icons/map/marine/light-major.png</file>
<file alias="buoy.png">icons/map/marine/buoy.png</file>
<file alias="buoy-white.png">icons/map/marine/buoy-white.png</file>
<file alias="buoy-white-black.png">icons/map/marine/buoy-white-black.png</file>
<file alias="buoy-white-green.png">icons/map/marine/buoy-white-green.png</file>
<file alias="buoy-white-red.png">icons/map/marine/buoy-white-red.png</file>
<file alias="buoy-white-yellow.png">icons/map/marine/buoy-white-yellow.png</file>
<file alias="buoy-green.png">icons/map/marine/buoy-green.png</file>
<file alias="buoy-green-white.png">icons/map/marine/buoy-green-white.png</file>
<file alias="buoy-green-black.png">icons/map/marine/buoy-green-black.png</file>
<file alias="buoy-green-red.png">icons/map/marine/buoy-green-red.png</file>
<file alias="buoy-red.png">icons/map/marine/buoy-red.png</file>
<file alias="buoy-red-white.png">icons/map/marine/buoy-red-white.png</file>
<file alias="buoy-red-black.png">icons/map/marine/buoy-red-black.png</file>
<file alias="buoy-red-green.png">icons/map/marine/buoy-red-green.png</file>
<file alias="buoy-yellow.png">icons/map/marine/buoy-yellow.png</file>
<file alias="buoy-yellow-white.png">icons/map/marine/buoy-yellow-white.png</file>
<file alias="buoy-yellow-black.png">icons/map/marine/buoy-yellow-black.png</file>
<file alias="buoy-black-white.png">icons/map/marine/buoy-black-white.png</file>
<file alias="buoy-black-red.png">icons/map/marine/buoy-black-red.png</file>
<file alias="buoy-black-green.png">icons/map/marine/buoy-black-green.png</file>
<file alias="buoy-black-yellow.png">icons/map/marine/buoy-black-yellow.png</file>
<file alias="beacon.png">icons/map/marine/beacon.png</file>
<file alias="beacon-white.png">icons/map/marine/beacon-white.png</file>
<file alias="beacon-white-black.png">icons/map/marine/beacon-white-black.png</file>
<file alias="beacon-white-green.png">icons/map/marine/beacon-white-green.png</file>
<file alias="beacon-white-red.png">icons/map/marine/beacon-white-red.png</file>
<file alias="beaon-white-yellow.png">icons/map/marine/beacon-white-yellow.png</file>
<file alias="beacon-green.png">icons/map/marine/beacon-green.png</file>
<file alias="beacon-green-white.png">icons/map/marine/beacon-green-white.png</file>
<file alias="beacon-green-black.png">icons/map/marine/beacon-green-black.png</file>
<file alias="beaco-green-red.png">icons/map/marine/beacon-green-red.png</file>
<file alias="beacon-red.png">icons/map/marine/beacon-red.png</file>
<file alias="beacon-red-white.png">icons/map/marine/beacon-red-white.png</file>
<file alias="beacon-red-black.png">icons/map/marine/beacon-red-black.png</file>
<file alias="beacon-red-green.png">icons/map/marine/beacon-red-green.png</file>
<file alias="beacon-yellow.png">icons/map/marine/beacon-yellow.png</file>
<file alias="beacon-yellow-white.png">icons/map/marine/beacon-yellow-white.png</file>
<file alias="beacon-yellow-black.png">icons/map/marine/beacon-yellow-black.png</file>
<file alias="beacon-black-white.png">icons/map/marine/beacon-black-white.png</file>
<file alias="beacon-black-red.png">icons/map/marine/beacon-black-red.png</file>
<file alias="beacon-black-green.png">icons/map/marine/beacon-black-green.png</file>
<file alias="beacon-black-yellow.png">icons/map/marine/beacon-black-yellow.png</file>
<file alias="rock-exposed.png">icons/map/marine/rock-exposed.png</file>
<file alias="rock-dangerous.png">icons/map/marine/rock-dangerous.png</file>
<file alias="wreck.png">icons/map/marine/wreck.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 B

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

View File

@ -331,6 +331,16 @@ static uint restrictionCategory(uint type, const MapData::Attributes &attr)
return catrea;
}
static uint color(const QList<QByteArray> &list)
{
uint c = 0;
for (int i = 0; i < list.size() && i < 2; i++)
c |= list.at(i).toUInt() << (i * 8);
return c;
}
MapData::Point::Point(uint type, const Coordinates &c, const QString &label)
: _type(SUBTYPE(type, 0)), _pos(c), _label(label), _polygon(false)
{
@ -384,12 +394,22 @@ MapData::Point::Point(uint type, const Coordinates &c, const Attributes &attr,
subtype = CATMFA;
else if (type == I_BUNSTA)
subtype = I_CATBUN;
else if (type == BOYCAR || type == BOYINB || type == BOYISD
|| type == BOYLAT || type == I_BOYLAT || type == BOYSAW || type == BOYSPP
|| type == BCNCAR || type == BCNISD || type == BCNLAT || type == I_BCNLAT
|| type == BCNSAW || type == BCNSPP)
subtype = COLOUR;
QList<QByteArray> list(_attr.value(subtype).split(','));
std::sort(list.begin(), list.end());
_type = (type == RESARE || type == I_RESARE)
? SUBTYPE(type, restrictionCategory(type, _attr))
: SUBTYPE(type, list.first().toUInt());
if (type == RESARE || type == I_RESARE)
_type = SUBTYPE(type, restrictionCategory(type, _attr));
else if (subtype == COLOUR)
_type = SUBTYPE(type, color(list));
else {
std::sort(list.begin(), list.end());
_type = SUBTYPE(type, list.first().toUInt());
}
_id = ((quint64)order(_type))<<32 | (uint)qHash(c);
_label = QString::fromLatin1(_attr.value(OBJNAM));

View File

@ -6,6 +6,77 @@
using namespace ENC;
using namespace Util;
#define IMG(type, subtype, img, dx, dy) \
_points[SUBTYPE((type), (subtype))] = Point(QImage(img), Small, QPoint(dx, dy));
#define BUOY(type) \
IMG((type), 0, ":/marine/buoy.png", 6, -6); \
IMG((type), 1, ":/marine/buoy-white.png", 6, -6); \
IMG((type), 2, ":/marine/buoy.png", 6, -6); \
IMG((type), 3, ":/marine/buoy-red.png", 6, -6); \
IMG((type), 4, ":/marine/buoy-green.png", 6, -6); \
IMG((type), 5, ":/marine/buoy.png", 6, -6); \
IMG((type), 6, ":/marine/buoy-yellow.png", 6, -6); \
IMG((type), 7, ":/marine/buoy.png", 6, -6); \
IMG((type), 8, ":/marine/buoy.png", 6, -6); \
IMG((type), 9, ":/marine/buoy.png", 6, -6); \
IMG((type), 10, ":/marine/buoy.png", 6, -6); \
IMG((type), 11, ":/marine/buoy-yellow.png", 6, -6); \
IMG((type), 12, ":/marine/buoy.png", 6, -6); \
IMG((type), 13, ":/marine/buoy.png", 6, -6); \
IMG((type), 0x201, ":/marine/buoy-white-black.png", 6, -6); \
IMG((type), 0x301, ":/marine/buoy-white-red.png", 6, -6); \
IMG((type), 0x401, ":/marine/buoy-white-green.png", 6, -6); \
IMG((type), 0x601, ":/marine/buoy-white-yellow.png", 6, -6); \
IMG((type), 0xb01, ":/marine/buoy-white-yellow.png", 6, -6); \
IMG((type), 0x102, ":/marine/buoy-black-white.png", 6, -6); \
IMG((type), 0x302, ":/marine/buoy-black-red.png", 6, -6); \
IMG((type), 0x402, ":/marine/buoy-black-green.png", 6, -6); \
IMG((type), 0x602, ":/marine/buoy-black-yellow.png", 6, -6); \
IMG((type), 0xb02, ":/marine/buoy-black-yellow.png", 6, -6); \
IMG((type), 0x103, ":/marine/buoy-red-white.png", 6, -6); \
IMG((type), 0x203, ":/marine/buoy-red-black.png", 6, -6); \
IMG((type), 0x403, ":/marine/buoy-red-green.png", 6, -6); \
IMG((type), 0x104, ":/marine/buoy-green-white.png", 6, -6); \
IMG((type), 0x204, ":/marine/buoy-green-black.png", 6, -6); \
IMG((type), 0x304, ":/marine/buoy-green-red.png", 6, -6); \
IMG((type), 0x106, ":/marine/buoy-yellow-white.png", 6, -6); \
IMG((type), 0x206, ":/marine/buoy-yellow-black.png", 6, -6);
#define BEACON(type) \
IMG((type), 0, ":/marine/beacon.png", 0, -8); \
IMG((type), 1, ":/marine/beacon-white.png", 0, -8); \
IMG((type), 2, ":/marine/beacon.png", 0, -8); \
IMG((type), 3, ":/marine/beacon-red.png", 0, -8); \
IMG((type), 4, ":/marine/beacon-green.png", 0, -8); \
IMG((type), 5, ":/marine/beacon.png", 0, -8); \
IMG((type), 6, ":/marine/beacon-yellow.png", 0, -8); \
IMG((type), 7, ":/marine/beacon.png", 0, -8); \
IMG((type), 8, ":/marine/beacon.png", 0, -8); \
IMG((type), 9, ":/marine/beacon.png", 0, -8); \
IMG((type), 10, ":/marine/beacon.png", 0, -8); \
IMG((type), 11, ":/marine/beacon-yellow.png", 0, -8); \
IMG((type), 12, ":/marine/beacon.png", 0, -8); \
IMG((type), 13, ":/marine/beacon.png", 0, -8); \
IMG((type), 0x201, ":/marine/beacon-white-black.png", 0, -8); \
IMG((type), 0x301, ":/marine/beacon-white-red.png", 0, -8); \
IMG((type), 0x401, ":/marine/beacon-white-green.png", 0, -8); \
IMG((type), 0x601, ":/marine/beacon-white-yellow.png", 0, -8); \
IMG((type), 0xb01, ":/marine/beacon-white-yellow.png", 0, -8); \
IMG((type), 0x102, ":/marine/beacon-black-white.png", 0, -8); \
IMG((type), 0x302, ":/marine/beacon-black-red.png", 0, -8); \
IMG((type), 0x402, ":/marine/beacon-black-green.png", 0, -8); \
IMG((type), 0x602, ":/marine/beacon-black-yellow.png", 0, -8); \
IMG((type), 0xb02, ":/marine/beacon-black-yellow.png", 0, -8); \
IMG((type), 0x103, ":/marine/beacon-red-white.png", 0, -8); \
IMG((type), 0x203, ":/marine/beacon-red-black.png", 0, -8); \
IMG((type), 0x403, ":/marine/beacon-red-green.png", 0, -8); \
IMG((type), 0x104, ":/marine/beacon-green-white.png", 0, -8); \
IMG((type), 0x204, ":/marine/beacon-green-black.png", 0, -8); \
IMG((type), 0x304, ":/marine/beacon-green-red.png", 0, -8); \
IMG((type), 0x106, ":/marine/beacon-yellow-white.png", 0, -8); \
IMG((type), 0x206, ":/marine/beacon-yellow-black.png", 0, -8);
static QImage railroad(qreal ratio)
{
QImage img(16 * ratio, 4 * ratio, QImage::Format_ARGB32_Premultiplied);
@ -268,6 +339,21 @@ void Style::lineStyle(qreal ratio)
void Style::pointStyle(qreal ratio)
{
BUOY(BOYCAR);
BUOY(BOYINB);
BUOY(BOYISD);
BUOY(BOYLAT);
BUOY(I_BOYLAT);
BUOY(BOYSAW);
BUOY(BOYSPP);
BEACON(BCNCAR);
BEACON(BCNISD);
BEACON(BCNLAT);
BEACON(I_BCNLAT);
BEACON(BCNSAW);
BEACON(BCNSPP);
_points[SUBTYPE(BUAARE, 1)].setTextFontSize(Large);
_points[SUBTYPE(BUAARE, 5)].setTextFontSize(Large);
_points[SUBTYPE(BUAARE, 4)].setTextFontSize(Large);
@ -275,32 +361,6 @@ void Style::pointStyle(qreal ratio)
_points[SUBTYPE(BUAARE, 6)].setTextFontSize(Small);
_points[TYPE(SOUNDG)].setTextFontSize(Small);
_points[TYPE(SOUNDG)].setHaloColor(QColor());
_points[TYPE(BOYCAR)] = Point(QImage(":/marine/buoy.png"), Small,
QPoint(6, -6));
_points[TYPE(BOYINB)] = Point(QImage(":/marine/buoy.png"), Small,
QPoint(6, -6));
_points[TYPE(BOYISD)] = Point(QImage(":/marine/buoy.png"), Small,
QPoint(6, -6));
_points[TYPE(BOYLAT)] = Point(QImage(":/marine/buoy.png"), Small,
QPoint(6, -6));
_points[TYPE(I_BOYLAT)] = Point(QImage(":/marine/buoy.png"), Small,
QPoint(6, -6));
_points[TYPE(BOYSAW)] = Point(QImage(":/marine/buoy.png"), Small,
QPoint(6, -6));
_points[TYPE(BOYSPP)] = Point(QImage(":/marine/buoy.png"), Small,
QPoint(6, -6));
_points[TYPE(BCNCAR)] = Point(QImage(":/marine/beacon.png"), Small,
QPoint(0, -8));
_points[TYPE(BCNISD)] = Point(QImage(":/marine/beacon.png"), Small,
QPoint(0, -8));
_points[TYPE(BCNLAT)] = Point(QImage(":/marine/beacon.png"), Small,
QPoint(0, -8));
_points[TYPE(I_BCNLAT)] = Point(QImage(":/marine/beacon.png"), Small,
QPoint(0, -8));
_points[TYPE(BCNSAW)] = Point(QImage(":/marine/beacon.png"), Small,
QPoint(0, -8));
_points[TYPE(BCNSPP)] = Point(QImage(":/marine/beacon.png"), Small,
QPoint(0, -8));
_points[SUBTYPE(LNDMRK, 3)] = Point(QImage(":/marine/chimney.png"),
Small, QPoint(0, -11));
_points[SUBTYPE(LNDMRK, 5)] = Point(QImage(":/marine/flagstaff.png"),