1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-05-14 15:17:32 +02:00

Compare commits

..

18 Commits

Author SHA1 Message Date
53ace440c5 Fishing stakes non-directional line 2025-05-14 08:28:06 +02:00
46375cdee2 Unify all marine area lines 2025-05-14 07:45:42 +02:00
2bde41f09e Only use the image-lines when there is direction info present for the lines 2025-05-14 00:01:45 +02:00
3d4d0c7155 Improved shoreline constructions rendering 2025-05-13 09:26:43 +02:00
408a671279 Microoptimization 2025-05-11 09:07:46 +02:00
7f591cb2c2 Refactoring 2025-05-10 20:15:51 +02:00
f3b97cb71f Improved dumpgrounds rendering 2025-05-10 20:09:56 +02:00
ab3940d445 Traffic separation lines 2025-05-10 16:02:08 +02:00
6bb0c72361 Some more marine lines 2025-05-10 15:53:19 +02:00
4d33631844 Render marine lines with the propper direction 2025-05-10 14:27:51 +02:00
535f4c0752 Use a better imge for the noanchor/nofishing lines 2025-05-10 09:45:14 +02:00
77d4cd0a6e Removed duplicit entry 2025-05-10 09:19:01 +02:00
d95cc654fc Fishing-prohibited areas 2025-05-10 09:11:32 +02:00
42837bc2ca Fixed marine polygons draw order 2025-05-10 06:10:33 +02:00
dea0e019a1 IMG marine style enhancements 2025-05-09 22:58:18 +02:00
73ba181356 Cosmetics 2025-05-09 22:29:27 +02:00
e43c4b44f4 Also show the depths for underwater rocks 2025-05-08 15:31:36 +02:00
16d5e656bf Version++ 2025-05-08 15:31:07 +02:00
26 changed files with 266 additions and 72 deletions

View File

@ -1,4 +1,4 @@
version: 13.42.{build} version: 13.43.{build}
configuration: configuration:
- Release - Release

View File

@ -3,7 +3,7 @@ unix:!macx:!android {
} else { } else {
TARGET = GPXSee TARGET = GPXSee
} }
VERSION = 13.42 VERSION = 13.43
QT += core \ QT += core \
gui \ gui \

View File

@ -311,6 +311,9 @@
<file alias="fishing-farm.png">icons/map/marine/fishing-farm.png</file> <file alias="fishing-farm.png">icons/map/marine/fishing-farm.png</file>
<file alias="shellfish-farm-line.png">icons/map/marine/shellfish-farm-line.png</file> <file alias="shellfish-farm-line.png">icons/map/marine/shellfish-farm-line.png</file>
<file alias="degaussing-line.png">icons/map/marine/degaussing-line.png</file> <file alias="degaussing-line.png">icons/map/marine/degaussing-line.png</file>
<file alias="nofishing-line.png">icons/map/marine/nofishing-line.png</file>
<file alias="fishing-line.png">icons/map/marine/fishing-line.png</file>
<file alias="minefield-line.png">icons/map/marine/minefield-line.png</file>
</qresource> </qresource>
<!-- Patterns (Mapsforge) --> <!-- Patterns (Mapsforge) -->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 B

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 B

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 B

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 305 B

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B

After

Width:  |  Height:  |  Size: 334 B

View File

@ -49,7 +49,7 @@ Unicode true
; The name of the installer ; The name of the installer
Name "GPXSee" Name "GPXSee"
; Program version ; Program version
!define VERSION "13.42" !define VERSION "13.43"
; The file to write ; The file to write
OutFile "GPXSee-${VERSION}_x64.exe" OutFile "GPXSee-${VERSION}_x64.exe"

View File

@ -5,6 +5,7 @@
#define CATBUA 10 #define CATBUA 10
#define CATCOV 18 #define CATCOV 18
#define CATDIS 21 #define CATDIS 21
#define CATDPG 23
#define CATHAF 30 #define CATHAF 30
#define CATLMK 35 #define CATLMK 35
#define CATLIT 37 #define CATLIT 37
@ -12,6 +13,7 @@
#define CATMOR 40 #define CATMOR 40
#define CATTRK 54 #define CATTRK 54
#define CATREA 56 #define CATREA 56
#define CATSLC 60
#define CATSIT 61 #define CATSIT 61
#define CATSIL 63 #define CATSIL 63
#define CATSCF 65 #define CATSCF 65
@ -41,6 +43,7 @@
#define I_CATSIT 17002 #define I_CATSIT 17002
#define I_RESTRN 17004 #define I_RESTRN 17004
#define I_CATHAF 17008 #define I_CATHAF 17008
#define I_CATSLC 17012
#define I_RDOCAL 17017 #define I_RDOCAL 17017
#define I_WTWDIS 17064 #define I_WTWDIS 17064
#define I_CATBRT 17066 #define I_CATBRT 17066

View File

@ -87,6 +87,7 @@ static QMap<uint,uint> orderMapInit()
map.insert(TYPE(BUISGL), 46); map.insert(TYPE(BUISGL), 46);
map.insert(TYPE(ACHARE), 47); map.insert(TYPE(ACHARE), 47);
map.insert(TYPE(I_ACHARE), 47); map.insert(TYPE(I_ACHARE), 47);
map.insert(TYPE(DMPGRD), 48);
map.insert(TYPE(I_DISMAR), 0xFFFFFFFE); map.insert(TYPE(I_DISMAR), 0xFFFFFFFE);
map.insert(TYPE(SOUNDG), 0xFFFFFFFF); map.insert(TYPE(SOUNDG), 0xFFFFFFFF);
@ -191,7 +192,7 @@ 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 == LNDARE || baseType == LNDRGN || baseType == I_BUNSTA || baseType == LNDARE || baseType == LNDRGN || baseType == I_BUNSTA
|| baseType == PILBOP || baseType == PILBOP || baseType == DMPGRD
|| type == SUBTYPE(ACHARE, 2) || type == SUBTYPE(I_ACHARE, 2) || type == SUBTYPE(ACHARE, 2) || type == SUBTYPE(I_ACHARE, 2)
|| type == SUBTYPE(ACHARE, 3) || type == SUBTYPE(I_ACHARE, 3) || type == SUBTYPE(ACHARE, 3) || type == SUBTYPE(I_ACHARE, 3)
|| type == SUBTYPE(ACHARE, 9) || type == SUBTYPE(I_ACHARE, 9) || type == SUBTYPE(ACHARE, 9) || type == SUBTYPE(I_ACHARE, 9)
@ -199,6 +200,7 @@ static bool polygonPointCb(const MapData::Poly *polygon, void *context)
|| type == SUBTYPE(I_ACHARE, 12) || type == SUBTYPE(I_BERTHS, 6) || type == SUBTYPE(I_ACHARE, 12) || type == SUBTYPE(I_BERTHS, 6)
|| type == SUBTYPE(RESARE, 1) || type == SUBTYPE(I_RESARE, 1) || type == SUBTYPE(RESARE, 1) || type == SUBTYPE(I_RESARE, 1)
|| type == SUBTYPE(RESARE, 2) || type == SUBTYPE(I_RESARE, 2) || type == SUBTYPE(RESARE, 2) || type == SUBTYPE(I_RESARE, 2)
|| type == SUBTYPE(RESARE, 3) || type == SUBTYPE(I_RESARE, 3)
|| type == SUBTYPE(RESARE, 4) || type == SUBTYPE(I_RESARE, 4) || type == SUBTYPE(RESARE, 4) || type == SUBTYPE(I_RESARE, 4)
|| type == SUBTYPE(RESARE, 5) || type == SUBTYPE(I_RESARE, 5) || type == SUBTYPE(RESARE, 5) || type == SUBTYPE(I_RESARE, 5)
|| type == SUBTYPE(RESARE, 6) || type == SUBTYPE(I_RESARE, 6) || type == SUBTYPE(RESARE, 6) || type == SUBTYPE(I_RESARE, 6)
@ -323,6 +325,8 @@ static uint restrictionCategory(uint type, const MapData::Attributes &attr)
if (restrn == 1) if (restrn == 1)
return 2; return 2;
else if (restrn == 3)
return 3;
else if (restrn == 7) else if (restrn == 7)
return 17; return 17;
else else
@ -447,7 +451,7 @@ MapData::Point::Point(uint type, const Coordinates &c, const Attributes &attr,
if (ok && clr > 0) if (ok && clr > 0)
_label = QString::fromUtf8("\xE2\x86\x95") + UNIT_SPACE _label = QString::fromUtf8("\xE2\x86\x95") + UNIT_SPACE
+ QString::number(clr) + UNIT_SPACE + hUnits(HUNI); + QString::number(clr) + UNIT_SPACE + hUnits(HUNI);
} else if (type == OBSTRN || type == WRECKS) { } else if (type == OBSTRN || type == WRECKS || type == UWTROC) {
double depth = _attr.value(VALSOU).toDouble(&ok); double depth = _attr.value(VALSOU).toDouble(&ok);
if (ok && _label.isEmpty()) if (ok && _label.isEmpty())
_label = QString::number(depth); _label = QString::number(depth);
@ -474,6 +478,12 @@ MapData::Poly::Poly(uint type, const Polygon &path, const Attributes &attr,
subtype = I_CATBRT; subtype = I_CATBRT;
else if (type == M_COVR) else if (type == M_COVR)
subtype = CATCOV; subtype = CATCOV;
else if (type == DMPGRD)
subtype = CATDPG;
else if (type == SLCONS)
subtype = CATSLC;
else if (type == I_SLCONS)
subtype = I_CATSLC;
switch (type) { switch (type) {
case DEPARE: case DEPARE:

View File

@ -104,7 +104,19 @@ void Style::polygonStyle()
_polygons[SUBTYPE(DEPARE, 5)] = Polygon(QBrush(QColor(0xc0, 0xe0, 0xff))); _polygons[SUBTYPE(DEPARE, 5)] = Polygon(QBrush(QColor(0xc0, 0xe0, 0xff)));
_polygons[SUBTYPE(DEPARE, 6)] = Polygon(QBrush(QColor(0xff, 0xff, 0xff))); _polygons[SUBTYPE(DEPARE, 6)] = Polygon(QBrush(QColor(0xff, 0xff, 0xff)));
_polygons[TYPE(DMPGRD)] = Polygon(QBrush(QColor(0xa3, 0xa3, 0xa3), _polygons[TYPE(DMPGRD)] = Polygon(QBrush(QColor(0xa3, 0xa3, 0xa3),
Qt::Dense3Pattern)); Qt::Dense5Pattern));
_polygons[SUBTYPE(DMPGRD, 1)] = Polygon(QBrush(QColor(0xa3, 0xa3, 0xa3),
Qt::Dense5Pattern));
_polygons[SUBTYPE(DMPGRD, 2)] = Polygon(QBrush(QColor(0xa3, 0xa3, 0xa3),
Qt::Dense5Pattern));
_polygons[SUBTYPE(DMPGRD, 3)] = Polygon(QBrush(QColor(0xa3, 0xa3, 0xa3),
Qt::Dense5Pattern));
_polygons[SUBTYPE(DMPGRD, 4)] = Polygon(QBrush(QColor(0xff, 0x40, 0x40),
Qt::Dense5Pattern));
_polygons[SUBTYPE(DMPGRD, 5)] = Polygon(QBrush(QColor(0xa3, 0xa3, 0xa3),
Qt::Dense5Pattern));
_polygons[SUBTYPE(DMPGRD, 6)] = Polygon(QBrush(QColor(0xa3, 0xa3, 0xa3),
Qt::Dense5Pattern));
_polygons[TYPE(FAIRWY)] = Polygon(Qt::NoBrush, QPen(QColor(0x88, 0x88, 0x88), _polygons[TYPE(FAIRWY)] = Polygon(Qt::NoBrush, QPen(QColor(0x88, 0x88, 0x88),
1, Qt::DashDotDotLine)); 1, Qt::DashDotDotLine));
_polygons[TYPE(OBSTRN)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0), 1.5, _polygons[TYPE(OBSTRN)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0), 1.5,
@ -116,10 +128,46 @@ void Style::polygonStyle()
_polygons[TYPE(HULKES)] = Polygon(QBrush(QColor(0x33, 0x33, 0x33))); _polygons[TYPE(HULKES)] = Polygon(QBrush(QColor(0x33, 0x33, 0x33)));
_polygons[TYPE(I_HULKES)] = Polygon(QBrush(QColor(0x33, 0x33, 0x33))); _polygons[TYPE(I_HULKES)] = Polygon(QBrush(QColor(0x33, 0x33, 0x33)));
_polygons[TYPE(DRYDOC)] = Polygon(QBrush(QColor(0x33, 0x33, 0x33))); _polygons[TYPE(DRYDOC)] = Polygon(QBrush(QColor(0x33, 0x33, 0x33)));
_polygons[TYPE(SLCONS)] = Polygon(Qt::NoBrush, _polygons[TYPE(SLCONS)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0), 2));
QPen(QColor(0x33, 0x33, 0x33), 1.5, Qt::DashLine)); _polygons[SUBTYPE(SLCONS, 1)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0), 2));
_polygons[TYPE(I_SLCONS)] = Polygon(Qt::NoBrush, _polygons[SUBTYPE(SLCONS, 2)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0),
QPen(QColor(0x33, 0x33, 0x33), 1.5, Qt::DashLine)); 2, Qt::DashLine));
_polygons[SUBTYPE(SLCONS, 3)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0), 2));
_polygons[SUBTYPE(SLCONS, 4)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0), 2));
_polygons[SUBTYPE(SLCONS, 5)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0), 2));
_polygons[SUBTYPE(SLCONS, 6)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0), 2));
_polygons[SUBTYPE(SLCONS, 7)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0),
2, Qt::DashLine));
_polygons[SUBTYPE(SLCONS, 8)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0), 2));
_polygons[SUBTYPE(SLCONS, 9)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0), 2));
_polygons[SUBTYPE(SLCONS, 10)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0), 2));
_polygons[SUBTYPE(SLCONS, 11)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0), 2));
_polygons[SUBTYPE(SLCONS, 12)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0),
2, Qt::DashLine));
_polygons[SUBTYPE(SLCONS, 13)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0),
2, Qt::DashLine));
_polygons[SUBTYPE(SLCONS, 14)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0), 2));
_polygons[SUBTYPE(SLCONS, 15)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0), 2));
_polygons[SUBTYPE(SLCONS, 16)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0),
2, Qt::DashLine));
_polygons[TYPE(I_SLCONS)] = _polygons[TYPE(SLCONS)];
_polygons[SUBTYPE(I_SLCONS, 1)] = _polygons[SUBTYPE(SLCONS, 1)];
_polygons[SUBTYPE(I_SLCONS, 2)] = _polygons[SUBTYPE(SLCONS, 2)];
_polygons[SUBTYPE(I_SLCONS, 3)] = _polygons[SUBTYPE(SLCONS, 3)];
_polygons[SUBTYPE(I_SLCONS, 4)] = _polygons[SUBTYPE(SLCONS, 4)];
_polygons[SUBTYPE(I_SLCONS, 5)] = _polygons[SUBTYPE(SLCONS, 5)];
_polygons[SUBTYPE(I_SLCONS, 6)] = _polygons[SUBTYPE(SLCONS, 6)];
_polygons[SUBTYPE(I_SLCONS, 7)] = _polygons[SUBTYPE(SLCONS, 7)];
_polygons[SUBTYPE(I_SLCONS, 8)] = _polygons[SUBTYPE(SLCONS, 8)];
_polygons[SUBTYPE(I_SLCONS, 9)] = _polygons[SUBTYPE(SLCONS, 9)];
_polygons[SUBTYPE(I_SLCONS, 10)] = _polygons[SUBTYPE(SLCONS, 10)];
_polygons[SUBTYPE(I_SLCONS, 11)] = _polygons[SUBTYPE(SLCONS, 11)];
_polygons[SUBTYPE(I_SLCONS, 12)] = _polygons[SUBTYPE(SLCONS, 12)];
_polygons[SUBTYPE(I_SLCONS, 13)] = _polygons[SUBTYPE(SLCONS, 13)];
_polygons[SUBTYPE(I_SLCONS, 14)] = _polygons[SUBTYPE(SLCONS, 14)];
_polygons[SUBTYPE(I_SLCONS, 15)] = _polygons[SUBTYPE(SLCONS, 15)];
_polygons[SUBTYPE(I_SLCONS, 16)] = _polygons[SUBTYPE(SLCONS, 16)];
_polygons[SUBTYPE(I_SLCONS, 19)] = Polygon(Qt::NoBrush, QPen(QColor(0, 0, 0), 2));
_polygons[TYPE(LAKARE)] = Polygon(QBrush(QColor(0x9f, 0xc4, 0xe1)), _polygons[TYPE(LAKARE)] = Polygon(QBrush(QColor(0x9f, 0xc4, 0xe1)),
QPen(QColor(0, 0, 0), 1)); QPen(QColor(0, 0, 0), 1));
_polygons[TYPE(CANALS)] = Polygon(QBrush(QColor(0x9f, 0xc4, 0xe1)), _polygons[TYPE(CANALS)] = Polygon(QBrush(QColor(0x9f, 0xc4, 0xe1)),
@ -134,6 +182,7 @@ void Style::polygonStyle()
_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, 1)] = Polygon(QImage(":/marine/safety-zone-line.png"));
_polygons[SUBTYPE(RESARE, 2)] = Polygon(QImage(":/marine/noanchor-line.png")); _polygons[SUBTYPE(RESARE, 2)] = Polygon(QImage(":/marine/noanchor-line.png"));
_polygons[SUBTYPE(RESARE, 3)] = Polygon(QImage(":/marine/nofishing-line.png"));
_polygons[SUBTYPE(RESARE, 4)] = Polygon(QImage(":/marine/nature-reserve-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, 5)] = Polygon(QImage(":/marine/sanctuary-line.png"));
_polygons[SUBTYPE(RESARE, 6)] = Polygon(QImage(":/marine/sanctuary-line.png")); _polygons[SUBTYPE(RESARE, 6)] = Polygon(QImage(":/marine/sanctuary-line.png"));
@ -151,6 +200,7 @@ void Style::polygonStyle()
_polygons[SUBTYPE(RESARE, 26)] = Polygon(QImage(":/marine/safety-zone-line.png")); _polygons[SUBTYPE(RESARE, 26)] = Polygon(QImage(":/marine/safety-zone-line.png"));
_polygons[SUBTYPE(I_RESARE, 1)] = _polygons[SUBTYPE(RESARE, 1)]; _polygons[SUBTYPE(I_RESARE, 1)] = _polygons[SUBTYPE(RESARE, 1)];
_polygons[SUBTYPE(I_RESARE, 2)] = _polygons[SUBTYPE(RESARE, 2)]; _polygons[SUBTYPE(I_RESARE, 2)] = _polygons[SUBTYPE(RESARE, 2)];
_polygons[SUBTYPE(I_RESARE, 3)] = _polygons[SUBTYPE(RESARE, 3)];
_polygons[SUBTYPE(I_RESARE, 4)] = _polygons[SUBTYPE(RESARE, 4)]; _polygons[SUBTYPE(I_RESARE, 4)] = _polygons[SUBTYPE(RESARE, 4)];
_polygons[SUBTYPE(I_RESARE, 5)] = _polygons[SUBTYPE(RESARE, 5)]; _polygons[SUBTYPE(I_RESARE, 5)] = _polygons[SUBTYPE(RESARE, 5)];
_polygons[SUBTYPE(I_RESARE, 6)] = _polygons[SUBTYPE(RESARE, 6)]; _polygons[SUBTYPE(I_RESARE, 6)] = _polygons[SUBTYPE(RESARE, 6)];
@ -238,32 +288,45 @@ void Style::polygonStyle()
<< TYPE(DRGARE) << TYPE(FAIRWY) << TYPE(LOKBSN) << TYPE(I_LOKBSN) << TYPE(DRGARE) << TYPE(FAIRWY) << TYPE(LOKBSN) << TYPE(I_LOKBSN)
<< TYPE(BUAARE) << TYPE(BUISGL) << TYPE(SILTNK) << TYPE(AIRARE) << TYPE(BUAARE) << TYPE(BUISGL) << TYPE(SILTNK) << TYPE(AIRARE)
<< TYPE(BRIDGE) << TYPE(I_BRIDGE) << TYPE(TUNNEL) << TYPE(I_TERMNL) << TYPE(BRIDGE) << TYPE(I_BRIDGE) << TYPE(TUNNEL) << TYPE(I_TERMNL)
<< TYPE(SLCONS) << TYPE(I_SLCONS) << TYPE(PONTON) << TYPE(I_PONTON) << TYPE(SLCONS) << SUBTYPE(SLCONS, 1) << SUBTYPE(SLCONS, 2)
<< TYPE(HULKES) << TYPE(I_HULKES) << TYPE(FLODOC) << TYPE(I_FLODOC) << SUBTYPE(SLCONS, 3) << SUBTYPE(SLCONS, 4) << SUBTYPE(SLCONS, 5)
<< TYPE(DRYDOC) << TYPE(DAMCON) << TYPE(PYLONS) << TYPE(MORFAC) << SUBTYPE(SLCONS, 6) << SUBTYPE(SLCONS, 7) << SUBTYPE(SLCONS, 8)
<< TYPE(GATCON) << TYPE(I_GATCON) << TYPE(BERTHS) << TYPE(I_BERTHS) << SUBTYPE(SLCONS, 9) << SUBTYPE(SLCONS, 10) << SUBTYPE(SLCONS, 11)
<< SUBTYPE(I_BERTHS, 6) << TYPE(DMPGRD) << TYPE(TSEZNE) << TYPE(OBSTRN) << SUBTYPE(SLCONS, 12) << SUBTYPE(SLCONS, 13) << SUBTYPE(SLCONS, 14)
<< TYPE(UWTROC) << TYPE(DWRTPT) << SUBTYPE(ACHARE, 1) << SUBTYPE(SLCONS, 15) << SUBTYPE(SLCONS, 16) << TYPE(I_SLCONS)
<< SUBTYPE(ACHARE, 2) << SUBTYPE(ACHARE, 3) << SUBTYPE(ACHARE, 4) << SUBTYPE(I_SLCONS, 1) << SUBTYPE(I_SLCONS, 2) << SUBTYPE(I_SLCONS, 3)
<< SUBTYPE(ACHARE, 5) << SUBTYPE(ACHARE, 6) << SUBTYPE(ACHARE, 7) << SUBTYPE(I_SLCONS, 4) << SUBTYPE(I_SLCONS, 5) << SUBTYPE(I_SLCONS, 6)
<< SUBTYPE(ACHARE, 8) << SUBTYPE(ACHARE, 9) << SUBTYPE(I_ACHARE, 1) << SUBTYPE(I_SLCONS, 7) << SUBTYPE(I_SLCONS, 8) << SUBTYPE(I_SLCONS, 9)
<< SUBTYPE(I_ACHARE, 2) << SUBTYPE(I_ACHARE, 3) << SUBTYPE(I_ACHARE, 4) << SUBTYPE(I_SLCONS, 10) << SUBTYPE(I_SLCONS, 11) << SUBTYPE(I_SLCONS, 12)
<< SUBTYPE(I_ACHARE, 5) << SUBTYPE(I_ACHARE, 6) << SUBTYPE(I_ACHARE, 7) << SUBTYPE(I_SLCONS, 13) << SUBTYPE(I_SLCONS, 14) << SUBTYPE(I_SLCONS, 15)
<< SUBTYPE(I_ACHARE, 8) << SUBTYPE(I_ACHARE, 9) << SUBTYPE(I_ACHARE, 10) << SUBTYPE(I_SLCONS, 16) << SUBTYPE(I_SLCONS, 19) << TYPE(PONTON)
<< SUBTYPE(I_ACHARE, 11) << SUBTYPE(I_ACHARE, 12) << SUBTYPE(RESARE, 1) << TYPE(I_PONTON) << TYPE(HULKES) << TYPE(I_HULKES) << TYPE(FLODOC)
<< SUBTYPE(I_RESARE, 1) << SUBTYPE(RESARE, 2) << SUBTYPE(I_RESARE, 2) << TYPE(I_FLODOC) << TYPE(DRYDOC) << TYPE(DAMCON) << TYPE(PYLONS)
<< SUBTYPE(RESARE, 4) << SUBTYPE(I_RESARE, 4) << SUBTYPE(RESARE, 5) << TYPE(MORFAC) << TYPE(GATCON) << TYPE(I_GATCON) << TYPE(BERTHS)
<< SUBTYPE(I_RESARE, 5) << SUBTYPE(RESARE, 6) << SUBTYPE(I_RESARE, 6) << TYPE(I_BERTHS) << SUBTYPE(I_BERTHS, 6) << TYPE(DMPGRD)
<< SUBTYPE(RESARE, 7) << SUBTYPE(I_RESARE, 7) << SUBTYPE(RESARE, 8) << SUBTYPE(DMPGRD, 1) << SUBTYPE(DMPGRD, 2) << SUBTYPE(DMPGRD, 3)
<< SUBTYPE(I_RESARE, 8) << SUBTYPE(RESARE, 9) << SUBTYPE(I_RESARE, 9) << SUBTYPE(DMPGRD, 4) << SUBTYPE(DMPGRD, 5) << SUBTYPE(DMPGRD, 6)
<< SUBTYPE(RESARE, 12) << SUBTYPE(I_RESARE, 12) << SUBTYPE(RESARE, 14) << TYPE(TSEZNE) << TYPE(OBSTRN) << TYPE(UWTROC) << TYPE(DWRTPT)
<< SUBTYPE(I_RESARE, 14) << SUBTYPE(RESARE, 17) << SUBTYPE(I_RESARE, 17) << SUBTYPE(ACHARE, 1) << SUBTYPE(ACHARE, 2) << SUBTYPE(ACHARE, 3)
<< SUBTYPE(RESARE, 22) << SUBTYPE(I_RESARE, 22) << SUBTYPE(RESARE, 23) << SUBTYPE(ACHARE, 4) << SUBTYPE(ACHARE, 5) << SUBTYPE(ACHARE, 6)
<< SUBTYPE(I_RESARE, 23) << SUBTYPE(RESARE, 25) << SUBTYPE(I_RESARE, 25) << SUBTYPE(ACHARE, 7) << SUBTYPE(ACHARE, 8) << SUBTYPE(ACHARE, 9)
<< SUBTYPE(RESARE, 26) << SUBTYPE(I_RESARE, 26) << TYPE(CBLARE) << SUBTYPE(I_ACHARE, 1) << SUBTYPE(I_ACHARE, 2) << SUBTYPE(I_ACHARE, 3)
<< TYPE(PIPARE) << TYPE(PRCARE) << TYPE(I_TRNBSN) << TYPE(PILBOP) << SUBTYPE(I_ACHARE, 4) << SUBTYPE(I_ACHARE, 5) << SUBTYPE(I_ACHARE, 6)
<< SUBTYPE(MARCUL, 0) << SUBTYPE(MARCUL, 1) << SUBTYPE(MARCUL, 2) << SUBTYPE(I_ACHARE, 7) << SUBTYPE(I_ACHARE, 8) << SUBTYPE(I_ACHARE, 9)
<< SUBTYPE(MARCUL, 3) << TYPE(CONZNE); << SUBTYPE(I_ACHARE, 10) << SUBTYPE(I_ACHARE, 11) << SUBTYPE(I_ACHARE, 12)
<< SUBTYPE(RESARE, 1) << SUBTYPE(I_RESARE, 1) << SUBTYPE(RESARE, 2)
<< SUBTYPE(I_RESARE, 2) << 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, 8) << SUBTYPE(I_RESARE, 8) << SUBTYPE(RESARE, 9)
<< SUBTYPE(I_RESARE, 9) << SUBTYPE(RESARE, 12) << SUBTYPE(I_RESARE, 12)
<< SUBTYPE(RESARE, 14) << SUBTYPE(I_RESARE, 14) << SUBTYPE(RESARE, 17)
<< SUBTYPE(I_RESARE, 17) << SUBTYPE(RESARE, 22) << SUBTYPE(I_RESARE, 22)
<< SUBTYPE(RESARE, 23) << SUBTYPE(I_RESARE, 23) << SUBTYPE(RESARE, 25)
<< SUBTYPE(I_RESARE, 25) << SUBTYPE(RESARE, 26) << SUBTYPE(I_RESARE, 26)
<< TYPE(CBLARE) << TYPE(PIPARE) << TYPE(PRCARE) << TYPE(I_TRNBSN)
<< TYPE(PILBOP) << SUBTYPE(MARCUL, 0) << SUBTYPE(MARCUL, 1)
<< SUBTYPE(MARCUL, 2) << SUBTYPE(MARCUL, 3) << TYPE(CONZNE);
} }
void Style::lineStyle(qreal ratio) void Style::lineStyle(qreal ratio)
@ -282,8 +345,33 @@ void Style::lineStyle(qreal ratio)
_lines[TYPE(PIPSOL)].setTextFontSize(Small); _lines[TYPE(PIPSOL)].setTextFontSize(Small);
_lines[TYPE(NAVLNE)] = Line(QPen(QColor(0, 0, 0), 1, Qt::DashLine)); _lines[TYPE(NAVLNE)] = Line(QPen(QColor(0, 0, 0), 1, Qt::DashLine));
_lines[TYPE(COALNE)] = Line(QPen(QColor(0, 0, 0), 1, Qt::SolidLine)); _lines[TYPE(COALNE)] = Line(QPen(QColor(0, 0, 0), 1, Qt::SolidLine));
_lines[TYPE(SLCONS)] = Line(QPen(QColor(0, 0, 0), 2, Qt::SolidLine)); _lines[TYPE(SLCONS)] = Line(QPen(QColor(0, 0, 0), 2));
_lines[TYPE(I_SLCONS)] = Line(QPen(QColor(0, 0, 0), 2, Qt::SolidLine)); _lines[SUBTYPE(SLCONS, 1)] = Line(QPen(QColor(0, 0, 0), 2));
_lines[SUBTYPE(SLCONS, 2)] = Line(QPen(QColor(0, 0, 0), 2, Qt::DashLine));
_lines[SUBTYPE(SLCONS, 3)] = Line(QPen(QColor(0, 0, 0), 2));
_lines[SUBTYPE(SLCONS, 4)] = Line(QPen(QColor(0, 0, 0), 2));
_lines[SUBTYPE(SLCONS, 5)] = Line(QPen(QColor(0, 0, 0), 2));
_lines[SUBTYPE(SLCONS, 6)] = Line(QPen(QColor(0, 0, 0), 2));
_lines[SUBTYPE(SLCONS, 7)] = Line(QPen(QColor(0, 0, 0), 2, Qt::DashLine));
_lines[SUBTYPE(SLCONS, 10)] = Line(QPen(QColor(0, 0, 0), 2));
_lines[SUBTYPE(SLCONS, 11)] = Line(QPen(QColor(0, 0, 0), 2));
_lines[SUBTYPE(SLCONS, 12)] = Line(QPen(QColor(0, 0, 0), 2, Qt::DashLine));
_lines[SUBTYPE(SLCONS, 13)] = Line(QPen(QColor(0, 0, 0), 2, Qt::DashLine));
_lines[SUBTYPE(SLCONS, 15)] = Line(QPen(QColor(0, 0, 0), 2));
_lines[TYPE(I_SLCONS)] = _lines[TYPE(SLCONS)];
_lines[SUBTYPE(I_SLCONS, 1)] = _lines[SUBTYPE(SLCONS, 1)];
_lines[SUBTYPE(I_SLCONS, 2)] = _lines[SUBTYPE(SLCONS, 2)];
_lines[SUBTYPE(I_SLCONS, 3)] = _lines[SUBTYPE(SLCONS, 3)];
_lines[SUBTYPE(I_SLCONS, 4)] = _lines[SUBTYPE(SLCONS, 4)];
_lines[SUBTYPE(I_SLCONS, 5)] = _lines[SUBTYPE(SLCONS, 5)];
_lines[SUBTYPE(I_SLCONS, 6)] = _lines[SUBTYPE(SLCONS, 6)];
_lines[SUBTYPE(I_SLCONS, 7)] = _lines[SUBTYPE(SLCONS, 7)];
_lines[SUBTYPE(I_SLCONS, 10)] = _lines[SUBTYPE(SLCONS, 10)];
_lines[SUBTYPE(I_SLCONS, 11)] = _lines[SUBTYPE(SLCONS, 11)];
_lines[SUBTYPE(I_SLCONS, 12)] = _lines[SUBTYPE(SLCONS, 12)];
_lines[SUBTYPE(I_SLCONS, 13)] = _lines[SUBTYPE(SLCONS, 13)];
_lines[SUBTYPE(I_SLCONS, 15)] = _lines[SUBTYPE(SLCONS, 15)];
_lines[SUBTYPE(I_SLCONS, 19)] = Line(QPen(QColor(0, 0, 0), 2));
_lines[TYPE(PONTON)] = Line(QPen(QColor(0x33, 0x33, 0x33), 1, Qt::SolidLine)); _lines[TYPE(PONTON)] = Line(QPen(QColor(0x33, 0x33, 0x33), 1, Qt::SolidLine));
_lines[TYPE(DYKCON)] = Line(QPen(QColor(0x33, 0x33, 0x33), 2, Qt::SolidLine)); _lines[TYPE(DYKCON)] = Line(QPen(QColor(0x33, 0x33, 0x33), 2, Qt::SolidLine));
_lines[TYPE(RIVERS)] = Line(QPen(QColor(0, 0, 0), 1, Qt::SolidLine)); _lines[TYPE(RIVERS)] = Line(QPen(QColor(0, 0, 0), 1, Qt::SolidLine));
@ -458,6 +546,7 @@ void Style::pointStyle(qreal ratio)
_points[TYPE(PILBOP)] = Point(QImage(":/marine/boarding-place.png")); _points[TYPE(PILBOP)] = Point(QImage(":/marine/boarding-place.png"));
_points[TYPE(SISTAT)] = Point(QImage(":/marine/pylon.png")); _points[TYPE(SISTAT)] = Point(QImage(":/marine/pylon.png"));
_points[TYPE(SLCONS)] = Point(QImage(":/marine/construction.png"), Small); _points[TYPE(SLCONS)] = Point(QImage(":/marine/construction.png"), Small);
_points[TYPE(I_SLCONS)] = Point(QImage(":/marine/construction.png"), Small);
_points[TYPE(CURENT)] = Point(QImage(":/marine/current.png")); _points[TYPE(CURENT)] = Point(QImage(":/marine/current.png"));
_points[SUBTYPE(WEDKLP, 0)] = Point(QImage(":/marine/kelp.png")); _points[SUBTYPE(WEDKLP, 0)] = Point(QImage(":/marine/kelp.png"));
_points[SUBTYPE(WEDKLP, 1)] = Point(QImage(":/marine/kelp.png")); _points[SUBTYPE(WEDKLP, 1)] = Point(QImage(":/marine/kelp.png"));
@ -540,6 +629,15 @@ void Style::pointStyle(qreal ratio)
_points[SUBTYPE(I_RESARE, 23)] = _points[SUBTYPE(RESARE, 23)]; _points[SUBTYPE(I_RESARE, 23)] = _points[SUBTYPE(RESARE, 23)];
_points[SUBTYPE(I_RESARE, 25)] = _points[SUBTYPE(RESARE, 25)]; _points[SUBTYPE(I_RESARE, 25)] = _points[SUBTYPE(RESARE, 25)];
_points[SUBTYPE(I_RESARE, 26)] = _points[SUBTYPE(RESARE, 26)]; _points[SUBTYPE(I_RESARE, 26)] = _points[SUBTYPE(RESARE, 26)];
_points[TYPE(DMPGRD)].setTextColor(QColor(0x5d, 0x5b, 0x59));
_points[TYPE(DMPGRD)].setHaloColor(QColor());
_points[SUBTYPE(DMPGRD, 1)] = _points[TYPE(DMPGRD)];
_points[SUBTYPE(DMPGRD, 2)] = _points[TYPE(DMPGRD)];
_points[SUBTYPE(DMPGRD, 3)] = _points[TYPE(DMPGRD)];
_points[SUBTYPE(DMPGRD, 4)].setTextColor(QColor(0xff, 0x40, 0x40));
_points[SUBTYPE(DMPGRD, 4)].setHaloColor(QColor());
_points[SUBTYPE(DMPGRD, 5)] = _points[TYPE(DMPGRD)];
_points[SUBTYPE(DMPGRD, 6)] = _points[TYPE(DMPGRD)];
_points[SUBTYPE(I_BUNSTA, 1)] = Point(svg2img(":/POI/fuel-11.svg", ratio), _points[SUBTYPE(I_BUNSTA, 1)] = Point(svg2img(":/POI/fuel-11.svg", ratio),
Small); Small);

View File

@ -29,18 +29,24 @@ class MapData
{ {
public: public:
struct Poly { struct Poly {
Poly() : oneway(false) {} Poly() : flags(0) {}
enum Flags {
OneWay = 1,
Invert = 2,
Direction = 4
};
/* QPointF insted of Coordinates for performance reasons (no need to /* QPointF insted of Coordinates for performance reasons (no need to
duplicate all the vectors for drawing). Note, that we do not want to duplicate all the vectors for drawing). Note, that we do not want to
ll2xy() the points in the MapData class as this can not be done in ll2xy() the points in the MapData class as this can not be done in
parallel. */ parallel. */
QVector<QPointF> points; QVector<QPointF> points;
RectC boundingRect;
Label label; Label label;
Raster raster; Raster raster;
quint32 type; quint32 type;
RectC boundingRect; quint32 flags;
bool oneway;
bool operator<(const Poly &other) const bool operator<(const Poly &other) const
{return type > other.type;} {return type > other.type;}
@ -50,7 +56,6 @@ public:
Point() : id(0), flags(0) {} Point() : id(0), flags(0) {}
enum Flags { enum Flags {
NoFlag = 0,
ClassLabel = 1, ClassLabel = 1,
}; };

View File

@ -480,7 +480,7 @@ bool NETFile::link(const SubDiv *subdiv, quint32 shift, Handle &hdl,
if (lbl) if (lbl)
linkLabel(hdl, linkOffset, lbl, lblHdl, poly.label); linkLabel(hdl, linkOffset, lbl, lblHdl, poly.label);
if ((linkInfo.flags >> 3) & 1) if ((linkInfo.flags >> 3) & 1)
poly.oneway = true; poly.flags |= MapData::Poly::OneWay;
lines->append(poly); lines->append(poly);

View File

@ -204,11 +204,16 @@ void RasterTile::drawLines(QPainter *painter,
for (int i = 0; i < lines.size(); i++) { for (int i = 0; i < lines.size(); i++) {
const MapData::Poly &poly = lines.at(i); const MapData::Poly &poly = lines.at(i);
const Style::Line &style = _data->style()->line(poly.type); const Style::Line &style = _data->style()->line(
(poly.flags & MapData::Poly::Direction)
? poly.type | 1<<20 : poly.type);
if (!style.img().isNull()) if (!style.img().isNull()) {
if (poly.flags & MapData::Poly::Invert)
BitmapLine::drawR(painter, poly.points, style.img());
else
BitmapLine::draw(painter, poly.points, style.img()); BitmapLine::draw(painter, poly.points, style.img());
else if (style.foreground() != Qt::NoPen) { } else if (style.foreground() != Qt::NoPen) {
painter->setPen(style.foreground()); painter->setPen(style.foreground());
painter->drawPolyline(poly.points); painter->drawPolyline(poly.points);
} }
@ -383,7 +388,7 @@ void RasterTile::processStreetNames(const QList<MapData::Poly> &lines,
? &style.text().color() : Style::isContourLine(poly.type) ? &style.text().color() : Style::isContourLine(poly.type)
? 0 : &textColor; ? 0 : &textColor;
const QColor *hColor = Style::isContourLine(poly.type) ? 0 : &haloColor; const QColor *hColor = Style::isContourLine(poly.type) ? 0 : &haloColor;
const QImage *img = poly.oneway const QImage *img = (poly.flags & MapData::Poly::OneWay)
? Style::isWaterLine(poly.type) ? Style::isWaterLine(poly.type)
? &arrows[WATER] : &arrows[ROAD] : 0; ? &arrows[WATER] : &arrows[ROAD] : 0;
const QString *label = poly.label.text().isEmpty() const QString *label = poly.label.text().isEmpty()
@ -559,8 +564,6 @@ void RasterTile::processPoints(QList<MapData::Point> &points,
} else } else
delete item; delete item;
} }
} }
void RasterTile::fetchData(QList<MapData::Poly> &polygons, void RasterTile::fetchData(QList<MapData::Poly> &polygons,

View File

@ -244,6 +244,24 @@ bool RGNFile::readLabel(Handle &hdl, LBLFile *lbl, Handle &lblHdl,
return true; return true;
} }
bool RGNFile::readLineInfo(Handle &hdl, quint32 size, MapData::Poly *line) const
{
if (size == 1) {
quint32 val;
if (!readUInt8(hdl, val))
return false;
if ((val >> 3) & 3)
line->flags |= MapData::Poly::Direction;
if ((val >> 3) & 2)
line->flags |= MapData::Poly::Invert;
return true;
} else
return (!size);
}
bool RGNFile::readClassFields(Handle &hdl, SegmentType segmentType, bool RGNFile::readClassFields(Handle &hdl, SegmentType segmentType,
void *object, LBLFile *lbl, Handle &lblHdl) const void *object, LBLFile *lbl, Handle &lblHdl) const
{ {
@ -251,6 +269,8 @@ bool RGNFile::readClassFields(Handle &hdl, SegmentType segmentType,
quint32 rs = 0; quint32 rs = 0;
MapData::Poly *poly = (segmentType == Polygon) MapData::Poly *poly = (segmentType == Polygon)
? (MapData::Poly *) object : 0; ? (MapData::Poly *) object : 0;
MapData::Poly *line = (segmentType == Line)
? (MapData::Poly *) object : 0;
MapData::Point *point = (segmentType == Point) MapData::Point *point = (segmentType == Point)
? (MapData::Point *) object : 0; ? (MapData::Point *) object : 0;
@ -289,6 +309,9 @@ bool RGNFile::readClassFields(Handle &hdl, SegmentType segmentType,
if (point && Style::isLight(point->type)) if (point && Style::isLight(point->type))
readLightInfo(hdl, flags, rs, point); readLightInfo(hdl, flags, rs, point);
if (line && Style::isMarineLine(line->type))
readLineInfo(hdl, rs, line);
return seek(hdl, off + rs); return seek(hdl, off + rs);
} }
@ -597,8 +620,7 @@ bool RGNFile::polyObjects(Handle &hdl, const SubDiv *subdiv,
poly.type = (segmentType == Polygon) poly.type = (segmentType == Polygon)
? ((quint32)(type & 0x7F)) << 8 : ((quint32)(type & 0x3F)) << 8; ? ((quint32)(type & 0x7F)) << 8 : ((quint32)(type & 0x3F)) << 8;
if (segmentType == Line && type & 0x40) if (segmentType == Line && type & 0x40)
poly.oneway = true; poly.flags |= MapData::Poly::OneWay;
QPoint pos(subdiv->lon() + LS(lon, 24-subdiv->bits()), QPoint pos(subdiv->lon() + LS(lon, 24-subdiv->bits()),
subdiv->lat() + LS(lat, 24-subdiv->bits())); subdiv->lat() + LS(lat, 24-subdiv->bits()));

View File

@ -69,6 +69,7 @@ private:
MapData::Point *point) const; MapData::Point *point) const;
bool readLightInfo(Handle &hdl, quint8 flags, quint32 size, bool readLightInfo(Handle &hdl, quint8 flags, quint32 size,
MapData::Point *point) const; MapData::Point *point) const;
bool readLineInfo(Handle &hdl, quint32 size, MapData::Poly *line) const;
bool readLabel(Handle &hdl, LBLFile *lbl, Handle &lblHdl, bool readLabel(Handle &hdl, LBLFile *lbl, Handle &lblHdl,
quint8 flags, quint32 size, MapData::Point *point) const; quint8 flags, quint32 size, MapData::Point *point) const;
bool readLclNavaid(Handle &hdl, quint32 size, bool readLclNavaid(Handle &hdl, quint32 size,

View File

@ -351,13 +351,13 @@ void Style::defaultPolygonStyle()
_polygons[0x10307] = Polygon(QBrush(QColor(0xff, 0xff, 0xff))); _polygons[0x10307] = Polygon(QBrush(QColor(0xff, 0xff, 0xff)));
_polygons[0x10308] = Polygon(QBrush(QColor(0xff, 0xff, 0xff))); _polygons[0x10308] = Polygon(QBrush(QColor(0xff, 0xff, 0xff)));
_polygons[0x10407] = Polygon(QBrush(QColor(0xa3, 0xa3, 0xa3), _polygons[0x10407] = Polygon(QBrush(QColor(0xa3, 0xa3, 0xa3),
Qt::Dense3Pattern)); Qt::Dense5Pattern));
_polygons[0x10408] = Polygon(QBrush(QColor(0xff, 0x40, 0x40),
Qt::Dense5Pattern));
_polygons[0x10409] = Polygon(QBrush(QColor(0xff, 0x40, 0x40), _polygons[0x10409] = Polygon(QBrush(QColor(0xff, 0x40, 0x40),
Qt::FDiagPattern)); Qt::FDiagPattern));
_polygons[0x10503] = Polygon(QBrush(QColor(0xff, 0x40, 0x40), _polygons[0x10503] = Polygon(QBrush(QColor(0xff, 0x40, 0x40),
Qt::FDiagPattern)); Qt::FDiagPattern));
_polygons[0x10504] = Polygon(QBrush(QColor(0xff, 0x40, 0x40),
Qt::FDiagPattern));
_polygons[0x10601] = Polygon(QBrush(QColor(0xaa, 0xaa, 0xaa))); _polygons[0x10601] = Polygon(QBrush(QColor(0xaa, 0xaa, 0xaa)));
_polygons[0x1060a] = Polygon(QBrush(QColor(0xfc, 0xb4, 0xfc))); _polygons[0x1060a] = Polygon(QBrush(QColor(0xfc, 0xb4, 0xfc)));
_polygons[0x10614] = Polygon(QBrush(QColor(0xff, 0xff, 0xff))); _polygons[0x10614] = Polygon(QBrush(QColor(0xff, 0xff, 0xff)));
@ -366,7 +366,7 @@ void Style::defaultPolygonStyle()
_drawOrder _drawOrder
<< TYPE(0x4b) << 0x10d01 << 0x10106 << 0x10104 << TYPE(0x4a) << 0x10614 << TYPE(0x4b) << 0x10d01 << 0x10106 << 0x10104 << TYPE(0x4a) << 0x10614
<< 0x10101 << 0x10102 << 0x10301 << 0x10302 << 0x10303 << 0x10304 << 0x10101 << 0x10102 << 0x10301 << 0x10302 << 0x10303 << 0x10304
<< 0x10305 << 0x10306 << 0x10307 << 0x10308 << 0x10601 << 0x10105 << 0x10305 << 0x10306 << 0x10307 << 0x10308 << 0x10601
<< TYPE(0x01) << 0x10800 << TYPE(0x02) << 0x10801 << TYPE(0x03) << 0x10802 << TYPE(0x01) << 0x10800 << TYPE(0x02) << 0x10801 << TYPE(0x03) << 0x10802
<< TYPE(0x17) << 0x10a04 << TYPE(0x18) << 0x1090c << TYPE(0x1a) << 0x1090e << TYPE(0x17) << 0x10a04 << TYPE(0x18) << 0x1090c << TYPE(0x1a) << 0x1090e
<< TYPE(0x28) << 0x10b01 << TYPE(0x32) << 0x10b02 << TYPE(0x3c) << 0x10b03 << TYPE(0x28) << 0x10b01 << TYPE(0x32) << 0x10b02 << TYPE(0x3c) << 0x10b03
@ -381,10 +381,11 @@ void Style::defaultPolygonStyle()
<< TYPE(0x04) << 0x10901 << TYPE(0x05) << 0x10902 << TYPE(0x06) << 0x10903 << TYPE(0x04) << 0x10901 << TYPE(0x05) << 0x10902 << TYPE(0x06) << 0x10903
<< TYPE(0x07) << 0x10904 << TYPE(0x08) << 0x10905 << TYPE(0x09) << 0x10906 << TYPE(0x07) << 0x10904 << TYPE(0x08) << 0x10905 << TYPE(0x09) << 0x10906
<< TYPE(0x0a) << 0x10907 << TYPE(0x0b) << 0x10908 << TYPE(0x0c) << 0x10909 << TYPE(0x0a) << 0x10907 << TYPE(0x0b) << 0x10908 << TYPE(0x0c) << 0x10909
<< TYPE(0x26) << TYPE(0x0d) << 0x1090a << TYPE(0x0e) << 0x1090b << TYPE(0x0f) << TYPE(0x26) << TYPE(0x0d) << 0x1090a << TYPE(0x0e) << 0x1090b
<< TYPE(0x10) << TYPE(0x11) << TYPE(0x12) << TYPE(0x19) << 0x1090d << TYPE(0x0f) << TYPE(0x10) << TYPE(0x11) << TYPE(0x12)
<< TYPE(0x13) << 0x10900 << 0x10613 << 0x10407 << 0x10409 << 0x10503 << TYPE(0x19) << 0x1090d << TYPE(0x13) << 0x10900
<< 0x10504 << 0x1060a; << 0x10613 /*raster*/ << 0x1060a << 0x10407 << 0x10408 << 0x10409
<< 0x10503 << 0x10105;
} }
void Style::defaultLineStyle(qreal ratio) void Style::defaultLineStyle(qreal ratio)
@ -494,20 +495,42 @@ void Style::defaultLineStyle(qreal ratio)
_lines[0x10309] = Line(QPen(QColor(0x0e, 0x10, 0x87), 1, Qt::SolidLine)); _lines[0x10309] = Line(QPen(QColor(0x0e, 0x10, 0x87), 1, Qt::SolidLine));
_lines[0x10401] = Line(QImage(":/marine/cable.png")); _lines[0x10401] = Line(QImage(":/marine/cable.png"));
_lines[0x10402] = Line(QImage(":/marine/pipeline.png")); _lines[0x10402] = Line(QImage(":/marine/pipeline.png"));
_lines[0x10404] = Line(QImage(":/marine/fishing-farm-line.png")); _lines[0x10403] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 2, Qt::DotLine));
_lines[0x10405] = Line(QImage(":/marine/pipeline-area-line.png")); _lines[0x10404] = Line(QPen(QColor(0, 0, 0), 1, Qt::DashLine));
_lines[0x10406] = Line(QImage(":/marine/cable-area-line.png")); _lines[0x110404] = Line(QImage(":/marine/fishing-farm-line.png"));
_lines[0x10405] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x110405] = Line(QImage(":/marine/pipeline-area-line.png"));
_lines[0x10406] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x110406] = Line(QImage(":/marine/cable-area-line.png"));
_lines[0x10407] = Line(QPen(QColor(0xa3, 0xa3, 0xa3), 1, Qt::DashLine)); _lines[0x10407] = Line(QPen(QColor(0xa3, 0xa3, 0xa3), 1, Qt::DashLine));
_lines[0x10408] = Line(QPen(QColor(0xff, 0x40, 0x40), 1, Qt::DashLine));
_lines[0x10409] = Line(QPen(QColor(0, 0, 0), 1, Qt::DotLine)); _lines[0x10409] = Line(QPen(QColor(0, 0, 0), 1, Qt::DotLine));
_lines[0x10501] = Line(QImage(":/marine/noanchor-line.png")); _lines[0x1040b] = Line(QPen(QColor(0, 0, 0), 2, Qt::DashLine));
_lines[0x10503] = Line(QImage(":/marine/entry-prohibited-line.png")); _lines[0x1040c] = Line(QPen(QColor(0, 0, 0), 2));
_lines[0x10501] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x110501] = Line(QImage(":/marine/noanchor-line.png"));
_lines[0x10502] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x110502] = Line(QImage(":/marine/nofishing-line.png"));
_lines[0x10503] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x110503] = Line(QImage(":/marine/entry-prohibited-line.png"));
_lines[0x10504] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine)); _lines[0x10504] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x10505] = Line(QImage(":/marine/safety-zone-line.png")); _lines[0x10505] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x10506] = Line(QImage(":/marine/nature-reserve-line.png")); _lines[0x110505] = Line(QImage(":/marine/noanchor-line.png"));
_lines[0x10507] = Line(QImage(":/marine/safety-zone-line.png")); _lines[0x10506] = Line(QPen(QColor(0x30, 0xa0, 0x1b), 1, Qt::DashLine));
_lines[0x10601] = Line(QPen(QColor(0, 0, 0), 1, Qt::SolidLine)); _lines[0x110506] = Line(QImage(":/marine/nature-reserve-line.png"));
_lines[0x10603] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 2, Qt::DashDotLine)); _lines[0x10507] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x10606] = Line(QImage(":/marine/anchor-line.png")); _lines[0x110507] = Line(QImage(":/marine/safety-zone-line.png"));
_lines[0x10508] = Line(QPen(QColor(0xff, 0x40, 0x40), 1, Qt::DashLine));
_lines[0x110508] = Line(QImage(":/marine/minefield-line.png"));
_lines[0x10601] = Line(QPen(QColor(0, 0, 0), 1, Qt::DashLine));
_lines[0x10602] = Line(QPen(QColor(0xfc, 0xb4, 0xfc), 2));
_lines[0x10603] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1.5, Qt::DashDotLine));
_lines[0x10604] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashDotLine));
_lines[0x10606] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x110606] = Line(QImage(":/marine/anchor-line.png"));
_lines[0x10608] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x110608] = Line(QImage(":/marine/fishing-line.png"));
_lines[0x1060b] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashDotDotLine));
_lines[0x1060c] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::SolidLine)); _lines[0x1060c] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::SolidLine));
_lines[0x1060d] = Line(QPen(QColor(0xeb, 0x49, 0xeb), 1, Qt::DashLine)); _lines[0x1060d] = Line(QPen(QColor(0xeb, 0x49, 0xeb), 1, Qt::DashLine));
_lines[0x10611] = Line(QPen(QColor(0xeb, 0x49, 0xeb), 1, Qt::DashLine)); _lines[0x10611] = Line(QPen(QColor(0xeb, 0x49, 0xeb), 1, Qt::DashLine));
@ -790,6 +813,8 @@ void Style::defaultPointStyle(qreal ratio)
COLORSET(0x10214, "beacon", 0, -8); COLORSET(0x10214, "beacon", 0, -8);
COLORSET(0x10215, "beacon", 0, -8); COLORSET(0x10215, "beacon", 0, -8);
_points[0x10216] = Point(QImage(":/marine/mooring-buoy.png"), QPoint(0, -5)); _points[0x10216] = Point(QImage(":/marine/mooring-buoy.png"), QPoint(0, -5));
_points[0x10217] = Point(QImage(":/marine/pylon.png"));
_points[0x10218] = Point(QImage(":/marine/pylon.png"));
_points[0x10304] = Point(QImage(":/marine/building.png")); _points[0x10304] = Point(QImage(":/marine/building.png"));
_points[0x10305] = Point(QImage(":/marine/chimney.png"), QPoint(0, -11)); _points[0x10305] = Point(QImage(":/marine/chimney.png"), QPoint(0, -11));
@ -804,6 +829,7 @@ void Style::defaultPointStyle(qreal ratio)
_points[0x10402] = Point(QImage(":/marine/wreck.png")); _points[0x10402] = Point(QImage(":/marine/wreck.png"));
_points[0x10403] = Point(QImage(":/marine/wreck-exposed.png"), QPoint(0, -4)); _points[0x10403] = Point(QImage(":/marine/wreck-exposed.png"), QPoint(0, -4));
_points[0x10408] = Point(QImage(":/marine/obstruction-covers.png")); _points[0x10408] = Point(QImage(":/marine/obstruction-covers.png"));
_points[0x10409] = Point(QImage(":/marine/fishing-farm.png"));
_points[0x1040a] = Point(QImage(":/marine/rock-dangerous.png")); _points[0x1040a] = Point(QImage(":/marine/rock-dangerous.png"));
_points[0x1040c] = Point(QImage(":/marine/rock-exposed.png")); _points[0x1040c] = Point(QImage(":/marine/rock-exposed.png"));

View File

@ -154,10 +154,12 @@ public:
{return (type >= 0x10100 && type < 0x10200);} {return (type >= 0x10100 && type < 0x10200);}
static bool isMarinePoint(quint32 type) static bool isMarinePoint(quint32 type)
{return type >= 0x10100 && type < 0x10a00;} {return type >= 0x10100 && type < 0x10a00;}
static bool isMarineLine(quint32 type)
{return type >= 0x10400 && type < 0x10700;}
static bool isMarina(quint32 type) static bool isMarina(quint32 type)
{return type == 0x10703;} {return type == 0x10703;}
static bool hasColorset(quint32 type) static bool hasColorset(quint32 type)
{return (isBuoy(type) && !(type == 0x1020d || type == 0x10216));} {return (isBuoy(type) && !(type == 0x1020d || type >= 0x10216));}
static QColor color(Light::Color c); static QColor color(Light::Color c);

View File

@ -53,6 +53,26 @@ void BitmapLine::draw(QPainter *painter, const QPolygonF &line,
} }
} }
void BitmapLine::drawR(QPainter *painter, const QPolygonF &line,
const QImage &img)
{
int offset = 0;
for (int i = line.size() - 1; i > 0; i--) {
QLineF segment(line.at(i).x(), line.at(i).y(), line.at(i-1).x(),
line.at(i-1).y());
int len = qCeil(segment.length() * img.devicePixelRatio());
painter->save();
painter->translate(segment.p1());
painter->rotate(-segment.angle());
painter->drawImage(0.0, -img.height()/2.0, img2line(img, len, offset));
painter->restore();
offset = (len + offset) % img.width();
}
}
void BitmapLine::draw(QPainter *painter, const QVector<QPolygonF> &lines, void BitmapLine::draw(QPainter *painter, const QVector<QPolygonF> &lines,
const QImage &img) const QImage &img)
{ {

View File

@ -11,6 +11,7 @@ class QPainterPath;
namespace BitmapLine namespace BitmapLine
{ {
void draw(QPainter *painter, const QPolygonF &line, const QImage &img); void draw(QPainter *painter, const QPolygonF &line, const QImage &img);
void drawR(QPainter *painter, const QPolygonF &line, const QImage &img);
void draw(QPainter *painter, const QVector<QPolygonF> &lines, void draw(QPainter *painter, const QVector<QPolygonF> &lines,
const QImage &img); const QImage &img);
void draw(QPainter *painter, const QPainterPath &line, const QImage &img); void draw(QPainter *painter, const QPainterPath &line, const QImage &img);