diff --git a/gpxsee.qrc b/gpxsee.qrc index 469cea0e..b749a107 100644 --- a/gpxsee.qrc +++ b/gpxsee.qrc @@ -139,7 +139,47 @@ icons/map/marine/light-major.png icons/map/marine/buoy.png + icons/map/marine/buoy-white.png + icons/map/marine/buoy-white-black.png + icons/map/marine/buoy-white-green.png + icons/map/marine/buoy-white-red.png + icons/map/marine/buoy-white-yellow.png + icons/map/marine/buoy-green.png + icons/map/marine/buoy-green-white.png + icons/map/marine/buoy-green-black.png + icons/map/marine/buoy-green-red.png + icons/map/marine/buoy-red.png + icons/map/marine/buoy-red-white.png + icons/map/marine/buoy-red-black.png + icons/map/marine/buoy-red-green.png + icons/map/marine/buoy-yellow.png + icons/map/marine/buoy-yellow-white.png + icons/map/marine/buoy-yellow-black.png + icons/map/marine/buoy-black-white.png + icons/map/marine/buoy-black-red.png + icons/map/marine/buoy-black-green.png + icons/map/marine/buoy-black-yellow.png icons/map/marine/beacon.png + icons/map/marine/beacon-white.png + icons/map/marine/beacon-white-black.png + icons/map/marine/beacon-white-green.png + icons/map/marine/beacon-white-red.png + icons/map/marine/beacon-white-yellow.png + icons/map/marine/beacon-green.png + icons/map/marine/beacon-green-white.png + icons/map/marine/beacon-green-black.png + icons/map/marine/beacon-green-red.png + icons/map/marine/beacon-red.png + icons/map/marine/beacon-red-white.png + icons/map/marine/beacon-red-black.png + icons/map/marine/beacon-red-green.png + icons/map/marine/beacon-yellow.png + icons/map/marine/beacon-yellow-white.png + icons/map/marine/beacon-yellow-black.png + icons/map/marine/beacon-black-white.png + icons/map/marine/beacon-black-red.png + icons/map/marine/beacon-black-green.png + icons/map/marine/beacon-black-yellow.png icons/map/marine/rock-exposed.png icons/map/marine/rock-dangerous.png icons/map/marine/wreck.png diff --git a/icons/map/marine/beacon-black-green.png b/icons/map/marine/beacon-black-green.png new file mode 100644 index 00000000..63bf20cb Binary files /dev/null and b/icons/map/marine/beacon-black-green.png differ diff --git a/icons/map/marine/beacon-black-red.png b/icons/map/marine/beacon-black-red.png new file mode 100644 index 00000000..b1c483d1 Binary files /dev/null and b/icons/map/marine/beacon-black-red.png differ diff --git a/icons/map/marine/beacon-black-white.png b/icons/map/marine/beacon-black-white.png new file mode 100644 index 00000000..49c14904 Binary files /dev/null and b/icons/map/marine/beacon-black-white.png differ diff --git a/icons/map/marine/beacon-black-yellow.png b/icons/map/marine/beacon-black-yellow.png new file mode 100644 index 00000000..99a90302 Binary files /dev/null and b/icons/map/marine/beacon-black-yellow.png differ diff --git a/icons/map/marine/beacon-green-black.png b/icons/map/marine/beacon-green-black.png new file mode 100644 index 00000000..803a56e3 Binary files /dev/null and b/icons/map/marine/beacon-green-black.png differ diff --git a/icons/map/marine/beacon-green-red.png b/icons/map/marine/beacon-green-red.png new file mode 100644 index 00000000..483ef81d Binary files /dev/null and b/icons/map/marine/beacon-green-red.png differ diff --git a/icons/map/marine/beacon-green-white.png b/icons/map/marine/beacon-green-white.png new file mode 100644 index 00000000..f693e9c3 Binary files /dev/null and b/icons/map/marine/beacon-green-white.png differ diff --git a/icons/map/marine/beacon-green.png b/icons/map/marine/beacon-green.png new file mode 100644 index 00000000..36e522dc Binary files /dev/null and b/icons/map/marine/beacon-green.png differ diff --git a/icons/map/marine/beacon-red-black.png b/icons/map/marine/beacon-red-black.png new file mode 100644 index 00000000..b96ea97c Binary files /dev/null and b/icons/map/marine/beacon-red-black.png differ diff --git a/icons/map/marine/beacon-red-green.png b/icons/map/marine/beacon-red-green.png new file mode 100644 index 00000000..72482371 Binary files /dev/null and b/icons/map/marine/beacon-red-green.png differ diff --git a/icons/map/marine/beacon-red-white.png b/icons/map/marine/beacon-red-white.png new file mode 100644 index 00000000..e6d151cf Binary files /dev/null and b/icons/map/marine/beacon-red-white.png differ diff --git a/icons/map/marine/beacon-red.png b/icons/map/marine/beacon-red.png new file mode 100644 index 00000000..4a68ce33 Binary files /dev/null and b/icons/map/marine/beacon-red.png differ diff --git a/icons/map/marine/beacon-white-black.png b/icons/map/marine/beacon-white-black.png new file mode 100644 index 00000000..7c48f3df Binary files /dev/null and b/icons/map/marine/beacon-white-black.png differ diff --git a/icons/map/marine/beacon-white-green.png b/icons/map/marine/beacon-white-green.png new file mode 100644 index 00000000..baabfddd Binary files /dev/null and b/icons/map/marine/beacon-white-green.png differ diff --git a/icons/map/marine/beacon-white-red.png b/icons/map/marine/beacon-white-red.png new file mode 100644 index 00000000..41bfaf1c Binary files /dev/null and b/icons/map/marine/beacon-white-red.png differ diff --git a/icons/map/marine/beacon-white-yellow.png b/icons/map/marine/beacon-white-yellow.png new file mode 100644 index 00000000..57f41a74 Binary files /dev/null and b/icons/map/marine/beacon-white-yellow.png differ diff --git a/icons/map/marine/beacon-white.png b/icons/map/marine/beacon-white.png new file mode 100644 index 00000000..2c1de323 Binary files /dev/null and b/icons/map/marine/beacon-white.png differ diff --git a/icons/map/marine/beacon-yellow-black.png b/icons/map/marine/beacon-yellow-black.png new file mode 100644 index 00000000..f74fa690 Binary files /dev/null and b/icons/map/marine/beacon-yellow-black.png differ diff --git a/icons/map/marine/beacon-yellow-white.png b/icons/map/marine/beacon-yellow-white.png new file mode 100644 index 00000000..6e2c0266 Binary files /dev/null and b/icons/map/marine/beacon-yellow-white.png differ diff --git a/icons/map/marine/beacon-yellow.png b/icons/map/marine/beacon-yellow.png new file mode 100644 index 00000000..8f7cc09a Binary files /dev/null and b/icons/map/marine/beacon-yellow.png differ diff --git a/icons/map/marine/beacon.png b/icons/map/marine/beacon.png index 36d054d2..5e400143 100644 Binary files a/icons/map/marine/beacon.png and b/icons/map/marine/beacon.png differ diff --git a/icons/map/marine/buoy-black-green.png b/icons/map/marine/buoy-black-green.png new file mode 100644 index 00000000..fb6b2cda Binary files /dev/null and b/icons/map/marine/buoy-black-green.png differ diff --git a/icons/map/marine/buoy-black-red.png b/icons/map/marine/buoy-black-red.png new file mode 100644 index 00000000..ff610b6b Binary files /dev/null and b/icons/map/marine/buoy-black-red.png differ diff --git a/icons/map/marine/buoy-black-white.png b/icons/map/marine/buoy-black-white.png new file mode 100644 index 00000000..c0a4e46a Binary files /dev/null and b/icons/map/marine/buoy-black-white.png differ diff --git a/icons/map/marine/buoy-black-yellow.png b/icons/map/marine/buoy-black-yellow.png new file mode 100644 index 00000000..6f9d9833 Binary files /dev/null and b/icons/map/marine/buoy-black-yellow.png differ diff --git a/icons/map/marine/buoy-green-black.png b/icons/map/marine/buoy-green-black.png new file mode 100644 index 00000000..f002b93b Binary files /dev/null and b/icons/map/marine/buoy-green-black.png differ diff --git a/icons/map/marine/buoy-green-red.png b/icons/map/marine/buoy-green-red.png new file mode 100644 index 00000000..024ab597 Binary files /dev/null and b/icons/map/marine/buoy-green-red.png differ diff --git a/icons/map/marine/buoy-green-white.png b/icons/map/marine/buoy-green-white.png new file mode 100644 index 00000000..2b21ebbb Binary files /dev/null and b/icons/map/marine/buoy-green-white.png differ diff --git a/icons/map/marine/buoy-green.png b/icons/map/marine/buoy-green.png new file mode 100644 index 00000000..168dd827 Binary files /dev/null and b/icons/map/marine/buoy-green.png differ diff --git a/icons/map/marine/buoy-red-black.png b/icons/map/marine/buoy-red-black.png new file mode 100644 index 00000000..0c0853e9 Binary files /dev/null and b/icons/map/marine/buoy-red-black.png differ diff --git a/icons/map/marine/buoy-red-green.png b/icons/map/marine/buoy-red-green.png new file mode 100644 index 00000000..7c5a06d9 Binary files /dev/null and b/icons/map/marine/buoy-red-green.png differ diff --git a/icons/map/marine/buoy-red-white.png b/icons/map/marine/buoy-red-white.png new file mode 100644 index 00000000..9c82e5b6 Binary files /dev/null and b/icons/map/marine/buoy-red-white.png differ diff --git a/icons/map/marine/buoy-red.png b/icons/map/marine/buoy-red.png new file mode 100644 index 00000000..bc57dfb4 Binary files /dev/null and b/icons/map/marine/buoy-red.png differ diff --git a/icons/map/marine/buoy-white-black.png b/icons/map/marine/buoy-white-black.png new file mode 100644 index 00000000..f9d25421 Binary files /dev/null and b/icons/map/marine/buoy-white-black.png differ diff --git a/icons/map/marine/buoy-white-green.png b/icons/map/marine/buoy-white-green.png new file mode 100644 index 00000000..5fde7a38 Binary files /dev/null and b/icons/map/marine/buoy-white-green.png differ diff --git a/icons/map/marine/buoy-white-red.png b/icons/map/marine/buoy-white-red.png new file mode 100644 index 00000000..24a99acb Binary files /dev/null and b/icons/map/marine/buoy-white-red.png differ diff --git a/icons/map/marine/buoy-white-yellow.png b/icons/map/marine/buoy-white-yellow.png new file mode 100644 index 00000000..857f17fa Binary files /dev/null and b/icons/map/marine/buoy-white-yellow.png differ diff --git a/icons/map/marine/buoy-white.png b/icons/map/marine/buoy-white.png new file mode 100644 index 00000000..d2ef25e8 Binary files /dev/null and b/icons/map/marine/buoy-white.png differ diff --git a/icons/map/marine/buoy-yellow-black.png b/icons/map/marine/buoy-yellow-black.png new file mode 100644 index 00000000..4e2ad793 Binary files /dev/null and b/icons/map/marine/buoy-yellow-black.png differ diff --git a/icons/map/marine/buoy-yellow-white.png b/icons/map/marine/buoy-yellow-white.png new file mode 100644 index 00000000..4f482d42 Binary files /dev/null and b/icons/map/marine/buoy-yellow-white.png differ diff --git a/icons/map/marine/buoy-yellow.png b/icons/map/marine/buoy-yellow.png new file mode 100644 index 00000000..e0d0ff0e Binary files /dev/null and b/icons/map/marine/buoy-yellow.png differ diff --git a/src/map/ENC/mapdata.cpp b/src/map/ENC/mapdata.cpp index b9b32176..eb35853c 100644 --- a/src/map/ENC/mapdata.cpp +++ b/src/map/ENC/mapdata.cpp @@ -331,6 +331,16 @@ static uint restrictionCategory(uint type, const MapData::Attributes &attr) return catrea; } +static uint color(const QList &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 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)); diff --git a/src/map/ENC/style.cpp b/src/map/ENC/style.cpp index f39c1bd5..b0fd16e6 100644 --- a/src/map/ENC/style.cpp +++ b/src/map/ENC/style.cpp @@ -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"),