1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-02-22 02:20:47 +01:00

Compare commits

..

4 Commits

6 changed files with 108 additions and 30 deletions

View File

@ -214,6 +214,8 @@
<file alias="24h-anchorage.png">icons/map/marine/24h-anchorage.png</file> <file alias="24h-anchorage.png">icons/map/marine/24h-anchorage.png</file>
<file alias="dw-anchorage.png">icons/map/marine/dw-anchorage.png</file> <file alias="dw-anchorage.png">icons/map/marine/dw-anchorage.png</file>
<file alias="tanker-anchorage.png">icons/map/marine/tanker-anchorage.png</file> <file alias="tanker-anchorage.png">icons/map/marine/tanker-anchorage.png</file>
<file alias="nature-reserve-line.png">icons/map/marine/nature-reserve-line.png</file>
<file alias="sanctuary-line.png">icons/map/marine/sanctuary-line.png</file>
</qresource> </qresource>
<!-- Patterns (Mapsforge) --> <!-- Patterns (Mapsforge) -->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

View File

@ -178,12 +178,22 @@ static bool polygonPointCb(const MapData::Poly *polygon, void *context)
if (baseType == TSSLPT || baseType == RCTLPT || baseType == I_TRNBSN if (baseType == TSSLPT || baseType == RCTLPT || baseType == I_TRNBSN
|| baseType == BRIDGE || baseType == I_BRIDGE || baseType == BUAARE || baseType == BRIDGE || baseType == I_BRIDGE || baseType == BUAARE
|| baseType == RESARE || baseType == I_RESARE || baseType == LNDARE || baseType == LNDARE || baseType == LNDRGN
|| baseType == LNDRGN || type == SUBTYPE(ACHARE, 2) || type == SUBTYPE(I_ACHARE, 2)
|| type == SUBTYPE(ACHARE, 2) || type == SUBTYPE(ACHARE, 3) || type == SUBTYPE(ACHARE, 3) || type == SUBTYPE(I_ACHARE, 3)
|| type == SUBTYPE(ACHARE, 9) || type == SUBTYPE(I_ACHARE, 2) || type == SUBTYPE(ACHARE, 9) || type == SUBTYPE(I_ACHARE, 9)
|| type == SUBTYPE(I_ACHARE, 3) || type == SUBTYPE(I_ACHARE, 9) || type == SUBTYPE(I_BERTHS, 6)
|| type == SUBTYPE(I_BERTHS, 6)) || type == SUBTYPE(RESARE, 1) || type == SUBTYPE(I_RESARE, 1)
|| type == SUBTYPE(RESARE, 2) || type == SUBTYPE(I_RESARE, 2)
|| type == SUBTYPE(RESARE, 4) || type == SUBTYPE(I_RESARE, 4)
|| type == SUBTYPE(RESARE, 5) || type == SUBTYPE(I_RESARE, 5)
|| type == SUBTYPE(RESARE, 6) || type == SUBTYPE(I_RESARE, 6)
|| type == SUBTYPE(RESARE, 7) || type == SUBTYPE(I_RESARE, 7)
|| type == SUBTYPE(RESARE, 9) || type == SUBTYPE(I_RESARE, 9)
|| type == SUBTYPE(RESARE, 12) || type == SUBTYPE(I_RESARE, 12)
|| type == SUBTYPE(RESARE, 17) || type == SUBTYPE(I_RESARE, 17)
|| type == SUBTYPE(RESARE, 22) || type == SUBTYPE(I_RESARE, 22)
|| type == SUBTYPE(RESARE, 23) || type == SUBTYPE(I_RESARE, 23))
points->append(MapData::Point(baseType, polygon->bounds().center(), points->append(MapData::Point(baseType, polygon->bounds().center(),
polygon->attributes(), polygon->HUNI(), true)); polygon->attributes(), polygon->HUNI(), true));
@ -285,6 +295,24 @@ static QString weed(uint type)
} }
} }
static uint restrictionCategory(uint type, const MapData::Attributes &attr)
{
uint catrea = attr.value(CATREA).toUInt();
if (!catrea) {
uint restrn = attr.value(
(type == RESARE) ? RESTRN : I_RESTRN).toUInt();
if (restrn == 1)
return 2;
else if (restrn == 7)
return 17;
else
return 0;
} else
return catrea;
}
MapData::Point::Point(uint type, const Coordinates &c, const QString &label) MapData::Point::Point(uint type, const Coordinates &c, const QString &label)
: _type(SUBTYPE(type, 0)), _pos(c), _label(label), _polygon(false) : _type(SUBTYPE(type, 0)), _pos(c), _label(label), _polygon(false)
{ {
@ -328,10 +356,18 @@ MapData::Point::Point(uint type, const Coordinates &c, const Attributes &attr,
subtype = CATLIT; subtype = CATLIT;
else if (type == I_DISMAR) else if (type == I_DISMAR)
subtype = CATDIS; subtype = CATDIS;
else if (type == I_BERTHS)
subtype = I_CATBRT;
else if (type == ACHARE)
subtype = CATACH;
else if (type == I_ACHARE)
subtype = I_CATACH;
QList<QByteArray> list(_attr.value(subtype).split(',')); QList<QByteArray> list(_attr.value(subtype).split(','));
std::sort(list.begin(), list.end()); std::sort(list.begin(), list.end());
_type = SUBTYPE(type, list.first().toUInt()); _type = (type == RESARE || type == I_RESARE)
? SUBTYPE(type, restrictionCategory(type, _attr))
: SUBTYPE(type, list.first().toUInt());
_id = ((quint64)order(_type))<<32 | (uint)qHash(c); _id = ((quint64)order(_type))<<32 | (uint)qHash(c);
_label = QString::fromLatin1(_attr.value(OBJNAM)); _label = QString::fromLatin1(_attr.value(OBJNAM));
@ -377,9 +413,7 @@ MapData::Poly::Poly(uint type, const Polygon &path, const Attributes &attr,
{ {
uint subtype = 0; uint subtype = 0;
if (type == RESARE || type == I_RESARE) if (type == ACHARE)
subtype = CATREA;
else if (type == ACHARE)
subtype = CATACH; subtype = CATACH;
else if (type == I_ACHARE) else if (type == I_ACHARE)
subtype = I_CATACH; subtype = I_CATACH;
@ -389,17 +423,19 @@ MapData::Poly::Poly(uint type, const Polygon &path, const Attributes &attr,
subtype = CATMFA; subtype = CATMFA;
else if (type == I_BERTHS) else if (type == I_BERTHS)
subtype = I_CATBRT; subtype = I_CATBRT;
else if (type == RESARE || type == I_RESARE) {
uint restr = _attr.value((type == RESARE) ? RESTRN : I_RESTRN).toUInt(); switch (type) {
if (restr == 1) case DEPARE:
subtype = 2; _type = SUBTYPE(type, depthLevel(_attr.value(DRVAL1).toDouble()));
else if (restr == 7) break;
subtype = 17; case RESARE:
case I_RESARE:
_type = SUBTYPE(type, restrictionCategory(type, attr));
break;
default:
_type = SUBTYPE(type, _attr.value(subtype).toUInt());
} }
_type = (type == DEPARE)
? SUBTYPE(DEPARE, depthLevel(_attr.value(DRVAL1).toDouble()))
: SUBTYPE(type, _attr.value(subtype).toUInt());
} }
MapData::Line::Line(uint type, const QVector<Coordinates> &path, MapData::Line::Line(uint type, const QVector<Coordinates> &path,

View File

@ -70,17 +70,26 @@ void Style::polygonStyle()
_polygons[TYPE(DRGARE)] = Polygon(QBrush(QColor(0xa0, 0xa0, 0xff), _polygons[TYPE(DRGARE)] = Polygon(QBrush(QColor(0xa0, 0xa0, 0xff),
Qt::Dense4Pattern)); Qt::Dense4Pattern));
_polygons[TYPE(UNSARE)] = Polygon(QBrush(QColor(0x99, 0x99, 0x99))); _polygons[TYPE(UNSARE)] = Polygon(QBrush(QColor(0x99, 0x99, 0x99)));
_polygons[SUBTYPE(RESARE, 1)] = Polygon(QImage(":/marine/safety-zone-line.png"));
_polygons[SUBTYPE(RESARE, 2)] = Polygon(QImage(":/marine/noanchor-line.png"));
_polygons[SUBTYPE(RESARE, 4)] = Polygon(QImage(":/marine/nature-reserve-line.png"));
_polygons[SUBTYPE(RESARE, 5)] = Polygon(QImage(":/marine/sanctuary-line.png"));
_polygons[SUBTYPE(RESARE, 6)] = Polygon(QImage(":/marine/sanctuary-line.png"));
_polygons[SUBTYPE(RESARE, 7)] = Polygon(QImage(":/marine/sanctuary-line.png"));
_polygons[SUBTYPE(RESARE, 9)] = Polygon(QBrush(QColor(0xff, 0x00, 0x00), _polygons[SUBTYPE(RESARE, 9)] = Polygon(QBrush(QColor(0xff, 0x00, 0x00),
Qt::BDiagPattern)); Qt::BDiagPattern));
_polygons[SUBTYPE(RESARE, 2)] = Polygon(QImage(":/marine/noanchor-line.png"));
_polygons[SUBTYPE(I_RESARE, 2)] = Polygon(QImage(":/marine/noanchor-line.png"));
_polygons[SUBTYPE(RESARE, 17)] = Polygon(
QImage(":/marine/entry-prohibited-line.png"));
_polygons[SUBTYPE(I_RESARE, 17)] = Polygon(
QImage(":/marine/entry-prohibited-line.png"));
_polygons[SUBTYPE(RESARE, 12)] = Polygon(QImage(":/marine/safety-zone-line.png")); _polygons[SUBTYPE(RESARE, 12)] = Polygon(QImage(":/marine/safety-zone-line.png"));
_polygons[SUBTYPE(I_RESARE, 12)] = Polygon(QImage(":/marine/safety-zone-line.png")); _polygons[SUBTYPE(RESARE, 17)] = Polygon(QImage(":/marine/entry-prohibited-line.png"));
_polygons[SUBTYPE(RESARE, 1)] = Polygon(QImage(":/marine/safety-zone-line.png")); _polygons[SUBTYPE(RESARE, 22)] = Polygon(QImage(":/marine/sanctuary-line.png"));
_polygons[SUBTYPE(RESARE, 23)] = Polygon(QImage(":/marine/nature-reserve-line.png"));
_polygons[SUBTYPE(I_RESARE, 1)] = _polygons[SUBTYPE(RESARE, 1)];
_polygons[SUBTYPE(I_RESARE, 2)] = _polygons[SUBTYPE(RESARE, 2)];
_polygons[SUBTYPE(I_RESARE, 4)] = _polygons[SUBTYPE(RESARE, 4)];
_polygons[SUBTYPE(I_RESARE, 9)] = _polygons[SUBTYPE(RESARE, 9)];
_polygons[SUBTYPE(I_RESARE, 12)] = _polygons[SUBTYPE(RESARE, 12)];
_polygons[SUBTYPE(I_RESARE, 17)] = _polygons[SUBTYPE(RESARE, 17)];
_polygons[SUBTYPE(I_RESARE, 22)] = _polygons[SUBTYPE(RESARE, 22)];
_polygons[SUBTYPE(I_RESARE, 23)] = _polygons[SUBTYPE(RESARE, 23)];
_polygons[SUBTYPE(ACHARE, 1)] = Polygon(QImage(":/marine/anchor-line.png")); _polygons[SUBTYPE(ACHARE, 1)] = Polygon(QImage(":/marine/anchor-line.png"));
_polygons[SUBTYPE(ACHARE, 2)] = _polygons[SUBTYPE(ACHARE, 1)]; _polygons[SUBTYPE(ACHARE, 2)] = _polygons[SUBTYPE(ACHARE, 1)];
_polygons[SUBTYPE(ACHARE, 3)] = _polygons[SUBTYPE(ACHARE, 1)]; _polygons[SUBTYPE(ACHARE, 3)] = _polygons[SUBTYPE(ACHARE, 1)];
@ -162,9 +171,14 @@ void Style::polygonStyle()
<< SUBTYPE(I_ACHARE, 2) << SUBTYPE(I_ACHARE, 3) << SUBTYPE(I_ACHARE, 4) << SUBTYPE(I_ACHARE, 2) << SUBTYPE(I_ACHARE, 3) << SUBTYPE(I_ACHARE, 4)
<< SUBTYPE(I_ACHARE, 5) << SUBTYPE(I_ACHARE, 6) << SUBTYPE(I_ACHARE, 7) << SUBTYPE(I_ACHARE, 5) << SUBTYPE(I_ACHARE, 6) << SUBTYPE(I_ACHARE, 7)
<< SUBTYPE(I_ACHARE, 8) << SUBTYPE(I_ACHARE, 9) << SUBTYPE(I_ACHARE, 10) << SUBTYPE(I_ACHARE, 8) << SUBTYPE(I_ACHARE, 9) << SUBTYPE(I_ACHARE, 10)
<< SUBTYPE(I_ACHARE, 11) << SUBTYPE(I_ACHARE, 12) << SUBTYPE(RESARE, 9) << SUBTYPE(I_ACHARE, 11) << SUBTYPE(I_ACHARE, 12) << SUBTYPE(RESARE, 1)
<< SUBTYPE(RESARE, 2) << SUBTYPE(I_RESARE, 2) << SUBTYPE(RESARE, 17) << SUBTYPE(I_RESARE, 1) << SUBTYPE(RESARE, 2) << SUBTYPE(I_RESARE, 2)
<< SUBTYPE(I_RESARE, 17) << SUBTYPE(RESARE, 12) << SUBTYPE(I_RESARE, 12) << SUBTYPE(RESARE, 4) << SUBTYPE(I_RESARE, 4) << SUBTYPE(RESARE, 5)
<< SUBTYPE(I_RESARE, 5) << SUBTYPE(RESARE, 6) << SUBTYPE(I_RESARE, 6)
<< SUBTYPE(RESARE, 7) << SUBTYPE(I_RESARE, 7) << SUBTYPE(RESARE, 9)
<< SUBTYPE(I_RESARE, 9) << SUBTYPE(RESARE, 12) << SUBTYPE(I_RESARE, 12)
<< SUBTYPE(RESARE, 17) << SUBTYPE(I_RESARE, 17) << SUBTYPE(RESARE, 22)
<< SUBTYPE(I_RESARE, 22) << SUBTYPE(RESARE, 23) << SUBTYPE(I_RESARE, 23)
<< SUBTYPE(RESARE, 1) << TYPE(CBLARE) << TYPE(PIPARE) << TYPE(PRCARE) << SUBTYPE(RESARE, 1) << TYPE(CBLARE) << TYPE(PIPARE) << TYPE(PRCARE)
<< TYPE(I_TRNBSN) << SUBTYPE(MARKUL, 3) << TYPE(CONZNE); << TYPE(I_TRNBSN) << SUBTYPE(MARKUL, 3) << TYPE(CONZNE);
} }
@ -382,6 +396,8 @@ void Style::pointStyle(qreal ratio)
_points[SUBTYPE(I_BERTHS, 6)] = Point(QImage(":/marine/fleeting-area.png"), _points[SUBTYPE(I_BERTHS, 6)] = Point(QImage(":/marine/fleeting-area.png"),
Small); Small);
_points[SUBTYPE(I_BERTHS, 6)].setTextColor(QColor(0xeb, 0x49, 0xeb));
_points[SUBTYPE(I_BERTHS, 6)].setHaloColor(QColor());
_points[SUBTYPE(ACHARE, 2)] = Point(QImage(":/marine/dw-anchorage.png"), _points[SUBTYPE(ACHARE, 2)] = Point(QImage(":/marine/dw-anchorage.png"),
Small); Small);
_points[SUBTYPE(ACHARE, 3)] = Point(QImage(":/marine/tanker-anchorage.png"), _points[SUBTYPE(ACHARE, 3)] = Point(QImage(":/marine/tanker-anchorage.png"),
@ -391,6 +407,30 @@ void Style::pointStyle(qreal ratio)
_points[SUBTYPE(I_ACHARE, 2)] = _points[SUBTYPE(ACHARE, 2)]; _points[SUBTYPE(I_ACHARE, 2)] = _points[SUBTYPE(ACHARE, 2)];
_points[SUBTYPE(I_ACHARE, 3)] = _points[SUBTYPE(ACHARE, 3)]; _points[SUBTYPE(I_ACHARE, 3)] = _points[SUBTYPE(ACHARE, 3)];
_points[SUBTYPE(I_ACHARE, 9)] = _points[SUBTYPE(ACHARE, 9)]; _points[SUBTYPE(I_ACHARE, 9)] = _points[SUBTYPE(ACHARE, 9)];
_points[SUBTYPE(RESARE, 1)].setTextColor(QColor(0xeb, 0x49, 0xeb));
_points[SUBTYPE(RESARE, 1)].setHaloColor(QColor());
_points[SUBTYPE(RESARE, 2)] = _points[SUBTYPE(RESARE, 1)];
_points[SUBTYPE(RESARE, 4)].setTextColor(QColor(0x30, 0xa0, 0x1b));
_points[SUBTYPE(RESARE, 4)].setHaloColor(QColor());
_points[SUBTYPE(RESARE, 5)] = _points[SUBTYPE(RESARE, 4)];
_points[SUBTYPE(RESARE, 6)] = _points[SUBTYPE(RESARE, 4)];
_points[SUBTYPE(RESARE, 7)] = _points[SUBTYPE(RESARE, 4)];
_points[SUBTYPE(RESARE, 9)] = _points[SUBTYPE(RESARE, 1)];
_points[SUBTYPE(RESARE, 12)] = _points[SUBTYPE(RESARE, 1)];
_points[SUBTYPE(RESARE, 17)] = _points[SUBTYPE(RESARE, 1)];
_points[SUBTYPE(RESARE, 22)] = _points[SUBTYPE(RESARE, 4)];
_points[SUBTYPE(RESARE, 23)] = _points[SUBTYPE(RESARE, 4)];
_points[SUBTYPE(I_RESARE, 1)] = _points[SUBTYPE(RESARE, 1)];
_points[SUBTYPE(I_RESARE, 2)] = _points[SUBTYPE(RESARE, 2)];
_points[SUBTYPE(I_RESARE, 4)] = _points[SUBTYPE(RESARE, 4)];
_points[SUBTYPE(I_RESARE, 5)] = _points[SUBTYPE(RESARE, 5)];
_points[SUBTYPE(I_RESARE, 6)] = _points[SUBTYPE(RESARE, 6)];
_points[SUBTYPE(I_RESARE, 7)] = _points[SUBTYPE(RESARE, 7)];
_points[SUBTYPE(I_RESARE, 9)] = _points[SUBTYPE(RESARE, 9)];
_points[SUBTYPE(I_RESARE, 12)] = _points[SUBTYPE(RESARE, 12)];
_points[SUBTYPE(I_RESARE, 17)] = _points[SUBTYPE(RESARE, 17)];
_points[SUBTYPE(I_RESARE, 22)] = _points[SUBTYPE(RESARE, 22)];
_points[SUBTYPE(I_RESARE, 23)] = _points[SUBTYPE(RESARE, 23)];
_points[SUBTYPE(SMCFAC, 7)] = Point(svg2img(":/POI/restaurant-11.svg", _points[SUBTYPE(SMCFAC, 7)] = Point(svg2img(":/POI/restaurant-11.svg",
ratio), Small); ratio), Small);