1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-06-07 18:53:02 +02:00

Compare commits

...

36 Commits

Author SHA1 Message Date
a9fa3a4bcf Merge branch 'master' into android-latest 2025-05-20 08:43:44 +02:00
23e293f39a Radio reporting points 2025-05-20 08:40:47 +02:00
f588bad785 Use different flags for the "dashed" and "directional" line styles 2025-05-19 23:01:35 +02:00
8ba97e65f5 Properly parse the whole recommended route data 2025-05-19 23:00:44 +02:00
93fc190748 Recommended routes style 2025-05-19 09:18:32 +02:00
744cfde08f Refactoring 2025-05-18 21:50:56 +02:00
7f491330b1 Dashed misc/cartographic lines 2025-05-18 21:42:57 +02:00
b2a123a731 Some more GARMIN marine lines fixes/improvements 2025-05-18 13:27:19 +02:00
a19188f58c Fouls 2025-05-18 00:32:21 +02:00
fc96d4e88c Redesigned the straight territorial sea baseline 2025-05-17 23:21:47 +02:00
2fec4dafda Show recommended tracks orientation 2025-05-17 06:53:16 +02:00
d9e4d6c519 Extend the maximal point text box width 2025-05-17 00:22:40 +02:00
7c3a7c1973 Boundary limits style enhancements 2025-05-17 00:21:26 +02:00
7e1d0dfb22 IMG marine style enhancements 2025-05-16 22:35:55 +02:00
10555723cd Orange and grey buoys 2025-05-15 18:59:49 +02:00
018ec28339 Merge consecutive same colors 2025-05-15 09:05:35 +02:00
cebe4cde69 Some more SLCONS style tweaking 2025-05-14 20:59:59 +02:00
4f25835281 Properly fill the SLCONS areas 2025-05-14 20:05:49 +02:00
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
49 changed files with 524 additions and 97 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

@ -144,7 +144,9 @@
<file alias="buoy-white-green.png">icons/map/marine/buoy-white-green.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-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-white-yellow.png">icons/map/marine/buoy-white-yellow.png</file>
<file alias="buoy-white-orange.png">icons/map/marine/buoy-white-orange.png</file>
<file alias="buoy-white-yellow-white.png">icons/map/marine/buoy-white-yellow-white.png</file> <file alias="buoy-white-yellow-white.png">icons/map/marine/buoy-white-yellow-white.png</file>
<file alias="buoy-white-orange-white.png">icons/map/marine/buoy-white-orange-white.png</file>
<file alias="buoy-green.png">icons/map/marine/buoy-green.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-white.png">icons/map/marine/buoy-green-white.png</file>
<file alias="buoy-green-white-green-white.png">icons/map/marine/buoy-green-white-green-white.png</file> <file alias="buoy-green-white-green-white.png">icons/map/marine/buoy-green-white-green-white.png</file>
@ -172,14 +174,21 @@
<file alias="buoy-black-red-black.png">icons/map/marine/buoy-black-red-black.png</file> <file alias="buoy-black-red-black.png">icons/map/marine/buoy-black-red-black.png</file>
<file alias="buoy-black-green.png">icons/map/marine/buoy-black-green.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="buoy-black-yellow.png">icons/map/marine/buoy-black-yellow.png</file>
<file alias="buoy-black-orange.png">icons/map/marine/buoy-black-orange.png</file>
<file alias="buoy-black-yellow-black.png">icons/map/marine/buoy-black-yellow-black.png</file> <file alias="buoy-black-yellow-black.png">icons/map/marine/buoy-black-yellow-black.png</file>
<file alias="buoy-orange.png">icons/map/marine/buoy-orange.png</file>
<file alias="buoy-orange-white.png">icons/map/marine/buoy-orange-white.png</file>
<file alias="buoy-orange-black.png">icons/map/marine/buoy-orange-black.png</file>
<file alias="buoy-grey.png">icons/map/marine/buoy-grey.png</file>
<file alias="beacon.png">icons/map/marine/beacon.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.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-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-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="beacon-white-red.png">icons/map/marine/beacon-white-red.png</file>
<file alias="beacon-white-yellow.png">icons/map/marine/beacon-white-yellow.png</file> <file alias="beacon-white-yellow.png">icons/map/marine/beacon-white-yellow.png</file>
<file alias="beacon-white-orange.png">icons/map/marine/beacon-white-orange.png</file>
<file alias="beacon-white-yellow-white.png">icons/map/marine/beacon-white-yellow-white.png</file> <file alias="beacon-white-yellow-white.png">icons/map/marine/beacon-white-yellow-white.png</file>
<file alias="beacon-white-orange-white.png">icons/map/marine/beacon-white-orange-white.png</file>
<file alias="beacon-green.png">icons/map/marine/beacon-green.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-white.png">icons/map/marine/beacon-green-white.png</file>
<file alias="beacon-green-white-green-white.png">icons/map/marine/beacon-green-white-green-white.png</file> <file alias="beacon-green-white-green-white.png">icons/map/marine/beacon-green-white-green-white.png</file>
@ -207,7 +216,12 @@
<file alias="beacon-black-red-black.png">icons/map/marine/beacon-black-red-black.png</file> <file alias="beacon-black-red-black.png">icons/map/marine/beacon-black-red-black.png</file>
<file alias="beacon-black-green.png">icons/map/marine/beacon-black-green.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="beacon-black-yellow.png">icons/map/marine/beacon-black-yellow.png</file>
<file alias="beacon-black-orange.png">icons/map/marine/beacon-black-orange.png</file>
<file alias="beacon-black-yellow-black.png">icons/map/marine/beacon-black-yellow-black.png</file> <file alias="beacon-black-yellow-black.png">icons/map/marine/beacon-black-yellow-black.png</file>
<file alias="beacon-orange.png">icons/map/marine/beacon-orange.png</file>
<file alias="beacon-orange-white.png">icons/map/marine/beacon-orange-white.png</file>
<file alias="beacon-orange-black.png">icons/map/marine/beacon-orange-black.png</file>
<file alias="beacon-grey.png">icons/map/marine/beacon-grey.png</file>
<file alias="spar-buoy.png">icons/map/marine/spar-buoy.png</file> <file alias="spar-buoy.png">icons/map/marine/spar-buoy.png</file>
<file alias="spar-buoy-red.png">icons/map/marine/spar-buoy-red.png</file> <file alias="spar-buoy-red.png">icons/map/marine/spar-buoy-red.png</file>
<file alias="spar-buoy-green.png">icons/map/marine/spar-buoy-green.png</file> <file alias="spar-buoy-green.png">icons/map/marine/spar-buoy-green.png</file>
@ -311,6 +325,16 @@
<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>
<file alias="international-maritime-boundary.png">icons/map/marine/international-maritime-boundary.png</file>
<file alias="straight-territorial-sea-baseline.png">icons/map/marine/straight-territorial-sea-baseline.png</file>
<file alias="seaward-limit-of-territorial-sea.png">icons/map/marine/seaward-limit-of-territorial-sea.png</file>
<file alias="seaward-limit-of-contiguous-zone.png">icons/map/marine/seaward-limit-of-contiguous-zone.png</file>
<file alias="foul.png">icons/map/marine/foul.png</file>
<file alias="dumping-ground-line.png">icons/map/marine/dumping-ground-line.png</file>
<file alias="radio-call-garmin.png">icons/map/marine/radio-call-garmin.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.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 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: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 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

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 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.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 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
@ -24,6 +26,7 @@
#define DRVAL1 87 #define DRVAL1 87
#define ELEVAT 90 #define ELEVAT 90
#define FUNCTN 94 #define FUNCTN 94
#define JRSDTN 103
#define LITVIS 108 #define LITVIS 108
#define OBJNAM 116 #define OBJNAM 116
#define ORIENT 117 #define ORIENT 117
@ -41,6 +44,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
@ -335,8 +339,12 @@ static uint color(const QList<QByteArray> &list)
{ {
uint c = 0; uint c = 0;
for (int i = 0; i < list.size() && i < 4; i++) for (int i = 0, j = 0; i < list.size() && j < 4; i++) {
c |= list.at(i).toUInt() << (i * 4); if (!(i && list.at(i) == list.at(i-1))) {
c |= list.at(i).toUInt() << (j * 4);
j++;
}
}
return c; return c;
} }
@ -447,7 +455,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 +482,14 @@ 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;
else if (type == ADMARE)
subtype = JRSDTN;
switch (type) { switch (type) {
case DEPARE: case DEPARE:
@ -509,6 +525,8 @@ MapData::Line::Line(uint type, const QVector<Coordinates> &path,
_label = QString::fromLatin1(_attr.value(VALDCO)); _label = QString::fromLatin1(_attr.value(VALDCO));
else if (type == LNDELV) else if (type == LNDELV)
_label = QString::fromLatin1(_attr.value(ELEVAT)); _label = QString::fromLatin1(_attr.value(ELEVAT));
else if (type == RECTRC)
_label = QString::fromLatin1(_attr.value(ORIENT));
else else
_label = QString::fromLatin1(_attr.value(OBJNAM)); _label = QString::fromLatin1(_attr.value(OBJNAM));
} }

View File

@ -4,6 +4,7 @@
#define TYPE(t) ((t)<<16) #define TYPE(t) ((t)<<16)
#define SUBTYPE(t, s) (((t)<<16)|(s)) #define SUBTYPE(t, s) (((t)<<16)|(s))
#define ADMARE 1
#define AIRARE 2 #define AIRARE 2
#define ACHBRT 3 #define ACHBRT 3
#define ACHARE 4 #define ACHARE 4
@ -88,6 +89,8 @@
#define SLOTOP 126 #define SLOTOP 126
#define SMCFAC 128 #define SMCFAC 128
#define SOUNDG 129 #define SOUNDG 129
#define STSLNE 132
#define TESARE 135
#define TSELNE 145 #define TSELNE 145
#define TSSBND 146 #define TSSBND 146
#define TSSLPT 148 #define TSSLPT 148

View File

@ -21,25 +21,26 @@ using namespace Util;
PNT(type, 4, ":/marine/" name "-green.png", dx, dy); \ PNT(type, 4, ":/marine/" name "-green.png", dx, dy); \
PNT(type, 5, ":/marine/" name ".png", dx, dy); \ PNT(type, 5, ":/marine/" name ".png", dx, dy); \
PNT(type, 6, ":/marine/" name "-yellow.png", dx, dy); \ PNT(type, 6, ":/marine/" name "-yellow.png", dx, dy); \
PNT(type, 7, ":/marine/" name ".png", dx, dy); \ PNT(type, 7, ":/marine/" name "-grey.png", dx, dy); \
PNT(type, 8, ":/marine/" name ".png", dx, dy); \ PNT(type, 8, ":/marine/" name "-orange.png", dx, dy); \
PNT(type, 9, ":/marine/" name "-yellow.png", dx, dy); \ PNT(type, 9, ":/marine/" name "-orange.png", dx, dy); \
PNT(type, 10, ":/marine/" name ".png", dx, dy); \ PNT(type, 10, ":/marine/" name ".png", dx, dy); \
PNT(type, 11, ":/marine/" name "-yellow.png", dx, dy); \ PNT(type, 11, ":/marine/" name "-orange.png", dx, dy); \
PNT(type, 12, ":/marine/" name ".png", dx, dy); \ PNT(type, 12, ":/marine/" name ".png", dx, dy); \
PNT(type, 13, ":/marine/" name ".png", dx, dy); \ PNT(type, 13, ":/marine/" name ".png", dx, dy); \
PNT(type, COLOR2(1, 2), ":/marine/" name "-white-black.png", dx, dy); \ PNT(type, COLOR2(1, 2), ":/marine/" name "-white-black.png", dx, dy); \
PNT(type, COLOR2(1, 3), ":/marine/" name "-white-red.png", dx, dy); \ PNT(type, COLOR2(1, 3), ":/marine/" name "-white-red.png", dx, dy); \
PNT(type, COLOR2(1, 4), ":/marine/" name "-white-green.png", dx, dy); \ PNT(type, COLOR2(1, 4), ":/marine/" name "-white-green.png", dx, dy); \
PNT(type, COLOR2(1, 6), ":/marine/" name "-white-yellow.png", dx, dy); \ PNT(type, COLOR2(1, 6), ":/marine/" name "-white-yellow.png", dx, dy); \
PNT(type, COLOR2(1, 9), ":/marine/" name "-white-yellow.png", dx, dy); \ PNT(type, COLOR2(1, 8), ":/marine/" name "-white-orange.png", dx, dy); \
PNT(type, COLOR2(1, 11), ":/marine/" name "-white-yellow.png", dx, dy); \ PNT(type, COLOR2(1, 9), ":/marine/" name "-white-orange.png", dx, dy); \
PNT(type, COLOR2(1, 11), ":/marine/" name "-white-orange.png", dx, dy); \
PNT(type, COLOR2(2, 1), ":/marine/" name "-black-white.png", dx, dy); \ PNT(type, COLOR2(2, 1), ":/marine/" name "-black-white.png", dx, dy); \
PNT(type, COLOR2(2, 3), ":/marine/" name "-black-red.png", dx, dy); \ PNT(type, COLOR2(2, 3), ":/marine/" name "-black-red.png", dx, dy); \
PNT(type, COLOR2(2, 4), ":/marine/" name "-black-green.png", dx, dy); \ PNT(type, COLOR2(2, 4), ":/marine/" name "-black-green.png", dx, dy); \
PNT(type, COLOR2(2, 6), ":/marine/" name "-black-yellow.png", dx, dy); \ PNT(type, COLOR2(2, 6), ":/marine/" name "-black-yellow.png", dx, dy); \
PNT(type, COLOR2(2, 9), ":/marine/" name "-black-yellow.png", dx, dy); \ PNT(type, COLOR2(2, 9), ":/marine/" name "-black-orange.png", dx, dy); \
PNT(type, COLOR2(2, 11), ":/marine/" name "-black-yellow.png", dx, dy); \ PNT(type, COLOR2(2, 11), ":/marine/" name "-black-orange.png", dx, dy); \
PNT(type, COLOR2(3, 1), ":/marine/" name "-red-white.png", dx, dy); \ PNT(type, COLOR2(3, 1), ":/marine/" name "-red-white.png", dx, dy); \
PNT(type, COLOR2(3, 2), ":/marine/" name "-red-black.png", dx, dy); \ PNT(type, COLOR2(3, 2), ":/marine/" name "-red-black.png", dx, dy); \
PNT(type, COLOR2(3, 4), ":/marine/" name "-red-green.png", dx, dy); \ PNT(type, COLOR2(3, 4), ":/marine/" name "-red-green.png", dx, dy); \
@ -48,14 +49,15 @@ using namespace Util;
PNT(type, COLOR2(4, 2), ":/marine/" name "-green-black.png", dx, dy); \ PNT(type, COLOR2(4, 2), ":/marine/" name "-green-black.png", dx, dy); \
PNT(type, COLOR2(4, 3), ":/marine/" name "-green-red.png", dx, dy); \ PNT(type, COLOR2(4, 3), ":/marine/" name "-green-red.png", dx, dy); \
PNT(type, COLOR2(6, 1), ":/marine/" name "-yellow-white.png", dx, dy); \ PNT(type, COLOR2(6, 1), ":/marine/" name "-yellow-white.png", dx, dy); \
PNT(type, COLOR2(9, 1), ":/marine/" name "-yellow-white.png", dx, dy); \ PNT(type, COLOR2(8, 1), ":/marine/" name "-orange-white.png", dx, dy); \
PNT(type, COLOR2(11, 1), ":/marine/" name "-yellow-white.png", dx, dy); \ PNT(type, COLOR2(9, 1), ":/marine/" name "-orange-white.png", dx, dy); \
PNT(type, COLOR2(11, 1), ":/marine/" name "-orange-white.png", dx, dy); \
PNT(type, COLOR2(6, 2), ":/marine/" name "-yellow-black.png", dx, dy); \ PNT(type, COLOR2(6, 2), ":/marine/" name "-yellow-black.png", dx, dy); \
PNT(type, COLOR2(9, 2), ":/marine/" name "-yellow-black.png", dx, dy); \ PNT(type, COLOR2(9, 2), ":/marine/" name "-orange-black.png", dx, dy); \
PNT(type, COLOR2(11, 2), ":/marine/" name "-yellow-black.png", dx, dy); \ PNT(type, COLOR2(11, 2), ":/marine/" name "-orange-black.png", dx, dy); \
PNT(type, COLOR3(1, 6, 1), ":/marine/" name "-white-yellow-white.png", dx, dy); \ PNT(type, COLOR3(1, 6, 1), ":/marine/" name "-white-yellow-white.png", dx, dy); \
PNT(type, COLOR3(1, 9, 1), ":/marine/" name "-white-yellow-white.png", dx, dy); \ PNT(type, COLOR3(1, 9, 1), ":/marine/" name "-white-orange-white.png", dx, dy); \
PNT(type, COLOR3(1, 11, 1), ":/marine/" name "-white-yellow-white.png", dx, dy); \ PNT(type, COLOR3(1, 11, 1), ":/marine/" name "-white-orange-white.png", dx, dy); \
PNT(type, COLOR3(2, 1, 2), ":/marine/" name "-black-white-black.png", dx, dy); \ PNT(type, COLOR3(2, 1, 2), ":/marine/" name "-black-white-black.png", dx, dy); \
PNT(type, COLOR3(2, 3, 2), ":/marine/" name "-black-red-black.png", dx, dy); \ PNT(type, COLOR3(2, 3, 2), ":/marine/" name "-black-red-black.png", dx, dy); \
PNT(type, COLOR3(2, 6, 2), ":/marine/" name "-black-yellow-black.png", dx, dy); \ PNT(type, COLOR3(2, 6, 2), ":/marine/" name "-black-yellow-black.png", dx, dy); \
@ -104,7 +106,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 +130,57 @@ 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(QBrush(QColor(0xe8, 0xe0, 0x64)),
QPen(QColor(0x33, 0x33, 0x33), 1.5, Qt::DashLine)); QPen(QColor(0, 0, 0), 2));
_polygons[TYPE(I_SLCONS)] = Polygon(Qt::NoBrush, _polygons[SUBTYPE(SLCONS, 1)] = Polygon(QBrush(QColor(0xe8, 0xe0, 0x64),
QPen(QColor(0x33, 0x33, 0x33), 1.5, Qt::DashLine)); Qt::Dense4Pattern), QPen(QColor(0, 0, 0), 2));
_polygons[SUBTYPE(SLCONS, 2)] = Polygon(QBrush(QColor(0xe8, 0xe0, 0x64),
Qt::Dense4Pattern), QPen(QColor(0, 0, 0), 2, Qt::DashLine));
_polygons[SUBTYPE(SLCONS, 3)] = Polygon(QBrush(QColor(0xe8, 0xe0, 0x64)),
QPen(QColor(0, 0, 0), 2));
_polygons[SUBTYPE(SLCONS, 4)] = Polygon(QBrush(QColor(0xe8, 0xe0, 0x64)),
QPen(QColor(0, 0, 0), 2));
_polygons[SUBTYPE(SLCONS, 5)] = Polygon(QBrush(QColor(0xe8, 0xe0, 0x64)),
QPen(QColor(0, 0, 0), 2));
_polygons[SUBTYPE(SLCONS, 6)] = Polygon(QBrush(QColor(0xe8, 0xe0, 0x64)),
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(QBrush(QColor(0xe8, 0xe0, 0x64),
Qt::Dense4Pattern), QPen(QColor(0, 0, 0), 2));
_polygons[SUBTYPE(SLCONS, 9)] = Polygon(QBrush(QColor(0xe8, 0xe0, 0x64),
Qt::Dense4Pattern), QPen(QColor(0, 0, 0), 2));
_polygons[SUBTYPE(SLCONS, 10)] = Polygon(QBrush(QColor(0xe8, 0xe0, 0x64)),
QPen(QColor(0, 0, 0), 2));
_polygons[SUBTYPE(SLCONS, 11)] = Polygon(QBrush(QColor(0xe8, 0xe0, 0x64)),
QPen(QColor(0, 0, 0), 2));
_polygons[SUBTYPE(SLCONS, 12)] = Polygon(QBrush(QColor(0xe8, 0xe0, 0x64)),
QPen(QColor(0, 0, 0), 2, Qt::DashLine));
_polygons[SUBTYPE(SLCONS, 13)] = Polygon(QBrush(QColor(0xe8, 0xe0, 0x64)),
QPen(QColor(0, 0, 0), 2, Qt::DashLine));
_polygons[SUBTYPE(SLCONS, 14)] = Polygon(QBrush(QColor(0xe8, 0xe0, 0x64)),
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 +195,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 +213,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)];
@ -225,10 +288,14 @@ void Style::polygonStyle()
_polygons[SUBTYPE(I_BERTHS, 6)] = _polygons[TYPE(BERTHS)]; _polygons[SUBTYPE(I_BERTHS, 6)] = _polygons[TYPE(BERTHS)];
_polygons[TYPE(I_TRNBSN)] = Polygon(Qt::NoBrush, QPen(QColor(0xeb, 0x49, 0xeb), _polygons[TYPE(I_TRNBSN)] = Polygon(Qt::NoBrush, QPen(QColor(0xeb, 0x49, 0xeb),
1, Qt::DashLine)); 1, Qt::DashLine));
_polygons[TYPE(CONZNE)] = Polygon(Qt::NoBrush, QPen(QColor(0xeb, 0x49, 0xeb),
1, Qt::DashDotLine));
_polygons[TYPE(PILBOP)] = Polygon(Qt::NoBrush, QPen(QColor(0xeb, 0x49, 0xeb), _polygons[TYPE(PILBOP)] = Polygon(Qt::NoBrush, QPen(QColor(0xeb, 0x49, 0xeb),
1, Qt::DashLine)); 1, Qt::DashLine));
_polygons[TYPE(CONZNE)] = Polygon(
QImage(":/marine/seaward-limit-of-contiguous-zone.png"));
_polygons[TYPE(TESARE)] = Polygon(
QImage(":/marine/seaward-limit-of-territorial-sea.png"));
_polygons[SUBTYPE(ADMARE, 2)] = Polygon(
QImage(":/marine/international-maritime-boundary.png"));
_drawOrder _drawOrder
<< TYPE(LNDARE) << SUBTYPE(DEPARE, 0) << SUBTYPE(DEPARE, 1) << TYPE(LNDARE) << SUBTYPE(DEPARE, 0) << SUBTYPE(DEPARE, 1)
@ -238,32 +305,46 @@ 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, 8) << SUBTYPE(SLCONS, 9) << SUBTYPE(SLCONS, 3)
<< TYPE(DRYDOC) << TYPE(DAMCON) << TYPE(PYLONS) << TYPE(MORFAC) << SUBTYPE(SLCONS, 4) << SUBTYPE(SLCONS, 5) << SUBTYPE(SLCONS, 6)
<< TYPE(GATCON) << TYPE(I_GATCON) << TYPE(BERTHS) << TYPE(I_BERTHS) << SUBTYPE(SLCONS, 7) << 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)
<< TYPE(TESARE) << SUBTYPE(ADMARE, 2);
} }
void Style::lineStyle(qreal ratio) void Style::lineStyle(qreal ratio)
@ -282,8 +363,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));
@ -305,6 +411,7 @@ void Style::lineStyle(qreal ratio)
Qt::SolidLine)); Qt::SolidLine));
_lines[TYPE(I_WTWAXS)] = Line(QPen(QColor(0, 0, 0), 0, Qt::DashLine)); _lines[TYPE(I_WTWAXS)] = Line(QPen(QColor(0, 0, 0), 0, Qt::DashLine));
_lines[SUBTYPE(RECTRC, 1)] = Line(QPen(QColor(0, 0, 0), 0, Qt::SolidLine)); _lines[SUBTYPE(RECTRC, 1)] = Line(QPen(QColor(0, 0, 0), 0, Qt::SolidLine));
_lines[SUBTYPE(RECTRC, 1)].setTextFontSize(Small);
_lines[SUBTYPE(RECTRC, 2)] = Line(QPen(QColor(0, 0, 0), 0, Qt::DashLine)); _lines[SUBTYPE(RECTRC, 2)] = Line(QPen(QColor(0, 0, 0), 0, Qt::DashLine));
_lines[SUBTYPE(RCRTCL, 1)] = Line(QPen(QColor(0xeb, 0x49, 0xeb), 0, _lines[SUBTYPE(RCRTCL, 1)] = Line(QPen(QColor(0xeb, 0x49, 0xeb), 0,
Qt::SolidLine)); Qt::SolidLine));
@ -327,6 +434,8 @@ void Style::lineStyle(qreal ratio)
Qt::DashLine)); Qt::DashLine));
_lines[SUBTYPE(RDOCAL, 4)] = Line(QPen(QColor(0xeb, 0x49, 0xeb), 1, _lines[SUBTYPE(RDOCAL, 4)] = Line(QPen(QColor(0xeb, 0x49, 0xeb), 1,
Qt::DashLine)); Qt::DashLine));
_lines[TYPE(STSLNE)] = Line(
QImage(":/marine/straight-territorial-sea-baseline.png"));
} }
void Style::pointStyle(qreal ratio) void Style::pointStyle(qreal ratio)
@ -458,6 +567,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 +650,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,25 @@ class MapData
{ {
public: public:
struct Poly { struct Poly {
Poly() : oneway(false) {} Poly() : flags(0) {}
enum Flags {
OneWay = 1,
Invert = 2,
Direction = 4,
Dashed = 8
};
/* 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 +57,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

@ -186,6 +186,21 @@ void RasterTile::drawPolygons(QPainter *painter,
} }
} }
static quint32 lineType(quint32 type, quint32 flags)
{
if (Style::isCartographicLine(type)) {
if (flags & MapData::Poly::Dashed)
return type | (flags & 0xFF000000) | 1<<20;
else
return type | (flags & 0xFF000000);
} else if (Style::isRecommendedRoute(type))
return (flags & MapData::Poly::Dashed) ? type | 1<<20 : type;
else if (flags & MapData::Poly::Direction)
return type | 2<<20;
else
return type;
}
void RasterTile::drawLines(QPainter *painter, void RasterTile::drawLines(QPainter *painter,
const QList<MapData::Poly> &lines) const const QList<MapData::Poly> &lines) const
{ {
@ -204,11 +219,15 @@ 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(
lineType(poly.type, poly.flags));
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 +402,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()
@ -523,7 +542,8 @@ void RasterTile::processPoints(QList<MapData::Point> &points,
const MapData::Point &point = points.at(i); const MapData::Point &point = points.at(i);
const Style *style = _data->style(); const Style *style = _data->style();
const Style::Point &ps = style->point(Style::hasColorset(point.type) const Style::Point &ps = style->point(Style::hasColorset(point.type)
? point.type | (point.flags & 0xFF000000) : point.type); ? point.type | (point.flags & 0xFF000000)
: point.type | (point.flags & 0x00F00000));
bool poi = Style::isPOI(point.type); bool poi = Style::isPOI(point.type);
bool sl = sectorLight(point.lights); bool sl = sectorLight(point.lights);
@ -559,8 +579,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,101 @@ bool RGNFile::readLabel(Handle &hdl, LBLFile *lbl, Handle &lblHdl,
return true; return true;
} }
bool RGNFile::readLineStyle(Handle &hdl, quint8 flags, quint32 size,
MapData::Poly *line) const
{
line->flags |= (flags & 0xf)<<24;
if (size == 1) {
quint32 val;
if (!readUInt8(hdl, val))
return false;
if (val & 3)
line->flags |= MapData::Poly::Dashed;
if ((val >> 3) & 3)
line->flags |= MapData::Poly::Direction;
if ((val >> 3) & 2)
line->flags |= MapData::Poly::Invert;
return true;
} else {
if ((flags >> 4) & 3)
line->flags |= MapData::Poly::Dashed;
return (!size);
}
}
bool RGNFile::readRecommendedRoute(Handle &hdl, quint8 flags, quint32 size,
MapData::Poly *line) const
{
quint32 f2;
if (!(size >= 1 && readUInt8(hdl, f2)))
return false;
size--;
if ((flags >> 5) == 7) {
quint32 f3;
if (!(size >= 1 && readUInt8(hdl, f3)))
return false;
size--;
if (f3 & 1) {
quint32 v1;
if (!(size >= 1 && readUInt8(hdl, v1)))
return false;
size--;
if (v1 & 1) {
quint32 v2;
if (!(size >= 1 && readUInt8(hdl, v2)))
return false;
size--;
}
}
if (f3 & 2) {
quint32 angle;
if (!(size >= 2 && readUInt16(hdl, angle)))
return false;
size -= 2;
line->label = Label(QString::number(angle / 10.0) + QChar(0x00B0));
}
if (f3 & 4) {
quint32 v;
if (!(size >= 1 && readUInt8(hdl, v)))
return false;
size--;
if ((v >> 4) & 3) {
line->flags |= MapData::Poly::Dashed;
line->label = Label();
}
}
} else {
if ((f2 & 0xe)) {
quint32 angle;
if (!(size >= 2 && readUInt16(hdl, angle)))
return false;
size -= 2;
line->label = Label(QString::number(angle / 10.0) + QChar(0x00B0));
} else if (f2 & 0x70) {
quint32 v1;
if (!(size >= 1 && readUInt8(hdl, v1)))
return false;
size--;
if (v1 & 1) {
quint32 v2;
if (!(size >= 1 && readUInt8(hdl, v2)))
return false;
size--;
}
}
}
return (size == 0);
}
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 +346,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;
@ -277,9 +374,9 @@ bool RGNFile::readClassFields(Handle &hdl, SegmentType segmentType,
if (poly && Style::isRaster(poly->type)) if (poly && Style::isRaster(poly->type))
readRasterInfo(hdl, lbl, rs, poly); readRasterInfo(hdl, lbl, rs, poly);
if (point && !Style::isMarinePoint(point->type)) if (point && !Style::isMarinePoint(point->type))
readLabel(hdl, lbl, lblHdl, flags, rs, point); readLabel(hdl, lbl, lblHdl, flags, rs, point);
if (point && Style::isDepthPoint(point->type)) if (point && Style::isDepthPoint(point->type))
readDepthInfo(hdl, flags, rs, point); readDepthInfo(hdl, flags, rs, point);
if (point && Style::isObstructionPoint(point->type)) if (point && Style::isObstructionPoint(point->type))
@ -288,6 +385,13 @@ bool RGNFile::readClassFields(Handle &hdl, SegmentType segmentType,
readBuoyInfo(hdl, flags, rs, point); readBuoyInfo(hdl, flags, rs, point);
if (point && Style::isLight(point->type)) if (point && Style::isLight(point->type))
readLightInfo(hdl, flags, rs, point); readLightInfo(hdl, flags, rs, point);
if (point && Style::isLabelPoint(point->type))
point->flags |= (flags & 0xf)<<20;
if (line && Style::isStyledLine(line->type))
readLineStyle(hdl, flags, rs, line);
if (line && Style::isRecommendedRoute(line->type))
readRecommendedRoute(hdl, flags, rs, line);
return seek(hdl, off + rs); return seek(hdl, off + rs);
} }
@ -597,8 +701,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,10 @@ 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 readLineStyle(Handle &hdl, quint8 flags, quint32 size,
MapData::Poly *line) const;
bool readRecommendedRoute(Handle &hdl, quint8 flags, 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

@ -7,8 +7,8 @@
using namespace IMG; using namespace IMG;
using namespace Util; using namespace Util;
#define PNT(type, color, img, dx, dy) \ #define PNT(type, index, img, dx, dy) \
_points[(type) | (color)<<24] = Point(QImage(img), QPoint(dx, dy)); _points[(type) | (index)<<24] = Point(QImage(img), QPoint(dx, dy));
#define COLORSET(type, name, dx, dy) \ #define COLORSET(type, name, dx, dy) \
PNT(type, 0, ":/marine/" name ".png", dx, dy); \ PNT(type, 0, ":/marine/" name ".png", dx, dy); \
@ -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)
@ -489,28 +490,103 @@ void Style::defaultLineStyle(qreal ratio)
_lines[0x10106] = Line(QImage(":/marine/cable-line.png")); _lines[0x10106] = Line(QImage(":/marine/cable-line.png"));
_lines[0x10107] = Line(QPen(QColor(0xa5, 0x81, 0x40), 3, Qt::SolidLine)); _lines[0x10107] = Line(QPen(QColor(0xa5, 0x81, 0x40), 3, Qt::SolidLine));
_lines[0x10108] = Line(QPen(QColor(0, 0, 0), 1, Qt::SolidLine)); _lines[0x10108] = Line(QPen(QColor(0, 0, 0), 1, Qt::SolidLine));
_lines[0x110108] = Line(QPen(QColor(0, 0, 0), 1, Qt::DashLine));
_lines[0x10301] = Line(QPen(QColor(0x0e, 0x10, 0x87), 1, Qt::SolidLine)); _lines[0x10301] = Line(QPen(QColor(0x0e, 0x10, 0x87), 1, Qt::SolidLine));
_lines[0x10307] = Line(QPen(QColor(0x05, 0x62, 0x0e), 1, Qt::SolidLine)); _lines[0x10307] = Line(QPen(QColor(0x05, 0x62, 0x0e), 1, Qt::SolidLine));
_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(0, 0, 0), 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[0x210404] = Line(QImage(":/marine/fishing-farm-line.png"));
_lines[0x10405] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x210405] = Line(QImage(":/marine/pipeline-area-line.png"));
_lines[0x10406] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x210406] = 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[0x210407] = Line(QImage(":/marine/dumping-ground-line.png"));
_lines[0x10408] = Line(QPen(QColor(0xff, 0x40, 0x40), 1, Qt::DashLine));
_lines[0x210408] = Line(QImage(":/marine/minefield-line.png"));
_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[0x210409] = Line(QPen(QColor(0, 0, 0), 1, Qt::DotLine));
_lines[0x10503] = Line(QImage(":/marine/entry-prohibited-line.png")); _lines[0x1040b] = Line(QPen(QColor(0, 0, 0), 2, Qt::DashLine));
_lines[0x21040b] = Line(QPen(QColor(0, 0, 0), 2, Qt::DashLine));
_lines[0x1040c] = Line(QPen(QColor(0, 0, 0), 2));
_lines[0x21040c] = Line(QPen(QColor(0, 0, 0), 2));
_lines[0x10501] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x210501] = Line(QImage(":/marine/noanchor-line.png"));
_lines[0x10502] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x210502] = Line(QImage(":/marine/nofishing-line.png"));
_lines[0x10503] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x210503] = 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[0x210504] = Line(QImage(":/marine/entry-prohibited-line.png"));
_lines[0x10506] = Line(QImage(":/marine/nature-reserve-line.png")); _lines[0x10505] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x10507] = Line(QImage(":/marine/safety-zone-line.png")); _lines[0x210505] = Line(QImage(":/marine/noanchor-line.png"));
_lines[0x10601] = Line(QPen(QColor(0, 0, 0), 1, Qt::SolidLine)); _lines[0x10506] = Line(QPen(QColor(0x30, 0xa0, 0x1b), 1, Qt::DashLine));
_lines[0x10603] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 2, Qt::DashDotLine)); _lines[0x210506] = Line(QImage(":/marine/nature-reserve-line.png"));
_lines[0x10606] = Line(QImage(":/marine/anchor-line.png")); _lines[0x10507] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x210507] = Line(QImage(":/marine/safety-zone-line.png"));
_lines[0x10508] = Line(QPen(QColor(0xff, 0x40, 0x40), 1, Qt::DashLine));
_lines[0x210508] = Line(QImage(":/marine/minefield-line.png"));
_lines[0x10601] = Line(QPen(QColor(0, 0, 0), 1));
_lines[0x110601] = Line(QPen(QColor(0, 0, 0), 1, Qt::DashLine));
_lines[0x10601 | 1<<24] = Line(QPen(QColor(0, 0x90, 0xfc), 1));
_lines[0x110601 | 1<<24] = Line(QPen(QColor(0, 0x90, 0xfc), 1, Qt::DashLine));
_lines[0x10601 | 2<<24] = Line(QPen(QColor(0x30, 0xa0, 0x1b), 1));
_lines[0x110601 | 2<<24] = Line(QPen(QColor(0x30, 0xa0, 0x1b), 1, Qt::DashLine));
_lines[0x10601 | 3<<24] = Line(QPen(QColor(0xa7, 0xf1, 0xfc), 1));
_lines[0x110601 | 3<<24] = Line(QPen(QColor(0xa7, 0xf1, 0xfc), 1, Qt::DashLine));
_lines[0x10601 | 4<<24] = Line(QPen(QColor(0xff, 0x40, 0x40), 1));
_lines[0x110601 | 4<<24] = Line(QPen(QColor(0xff, 0x40, 0x40), 1, Qt::DashLine));
_lines[0x10601 | 5<<24] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1));
_lines[0x110601 | 5<<24] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x10601 | 6<<24] = Line(QPen(QColor(0xfc, 0xe0, 0x1f), 1));
_lines[0x110601 | 6<<24] = Line(QPen(QColor(0xfc, 0xe0, 0x1f), 1, Qt::DashLine));
_lines[0x10601 | 7<<24] = Line(QPen(QColor(0xfc, 0x79, 0x1e), 1));
_lines[0x110601 | 7<<24] = Line(QPen(QColor(0xfc, 0x79, 0x1e), 1, Qt::DashLine));
_lines[0x10601 | 8<<24] = Line(QPen(QColor(0x40, 0x40, 0x40), 1));
_lines[0x110601 | 8<<24] = Line(QPen(QColor(0x40, 0x40, 0x40), 1, Qt::DashLine));
_lines[0x10601 | 9<<24] = Line(QPen(QColor(0x84, 0xe6, 0xfc), 1));
_lines[0x110601 | 9<<24] = Line(QPen(QColor(0x84, 0xe6, 0xfc), 1, Qt::DashLine));
_lines[0x10601 | 10<<24] = Line(QPen(QColor(0x83, 0x53, 0x15), 1));
_lines[0x110601 | 10<<24] = Line(QPen(QColor(0x83, 0x53, 0x15), 1, Qt::DashLine));
_lines[0x10601 | 11<<24] = Line(QPen(QColor(0xd2, 0xfc, 0xfc), 1));
_lines[0x110601 | 11<<24] = Line(QPen(QColor(0xd2, 0xfc, 0xfc), 1, Qt::DashLine));
_lines[0x10601 | 12<<24] = Line(QPen(QColor(0xc5, 0xf1, 0xc2), 1));
_lines[0x110601 | 12<<24] = Line(QPen(QColor(0xc5, 0xf1, 0xc2), 1, Qt::DashLine));
_lines[0x10601 | 13<<24] = Line(QPen(QColor(0xfc, 0xc6, 0xfc), 1));
_lines[0x110601 | 13<<24] = Line(QPen(QColor(0xfc, 0xc6, 0xfc), 1, Qt::DashLine));
_lines[0x10601 | 14<<24] = Line(QPen(QColor(0xe2, 0xdc, 0xa9), 1));
_lines[0x110601 | 14<<24] = Line(QPen(QColor(0xe2, 0xdc, 0xa9), 1, Qt::DashLine));
_lines[0x10601 | 15<<24] = Line(QPen(QColor(0xcd, 0xcd, 0xcd), 1));
_lines[0x110601 | 15<<24] = Line(QPen(QColor(0xcd, 0xcd, 0xcd), 1, Qt::DashLine));
_lines[0x10602] = Line(QPen(QColor(0xfc, 0xb4, 0xfc), 2));
_lines[0x210602] = Line(QPen(QColor(0xfc, 0xb4, 0xfc), 2));
_lines[0x10603] = Line(QImage(":/marine/international-maritime-boundary.png"));
_lines[0x210603] = Line(QImage(":/marine/international-maritime-boundary.png"));
_lines[0x10604] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1));
_lines[0x210604] = Line(QImage(":/marine/straight-territorial-sea-baseline.png"));
_lines[0x10605] = Line(QImage(":/marine/seaward-limit-of-territorial-sea.png"));
_lines[0x210605] = Line(QImage(":/marine/seaward-limit-of-territorial-sea.png"));
_lines[0x10606] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x210606] = Line(QImage(":/marine/anchor-line.png"));
_lines[0x10608] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
_lines[0x210608] = Line(QImage(":/marine/fishing-line.png"));
_lines[0x1060b] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashDotDotLine));
_lines[0x21060b] = 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[0x21060c] = 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[0x21060d] = Line(QPen(QColor(0xeb, 0x49, 0xeb), 1, Qt::DashLine));
_lines[0x1060e] = Line(QPen(QColor(0xff, 0x40, 0x40), 1, Qt::DashLine));
_lines[0x21060e] = Line(QPen(QColor(0xff, 0x40, 0x40), 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));
_lines[0x210611] = Line(QPen(QColor(0xeb, 0x49, 0xeb), 1, Qt::DashLine));
} }
void Style::defaultPointStyle(qreal ratio) void Style::defaultPointStyle(qreal ratio)
@ -790,6 +866,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));
@ -803,15 +881,35 @@ void Style::defaultPointStyle(qreal ratio)
_points[0x10401] = Point(QImage(":/marine/obstruction.png")); _points[0x10401] = Point(QImage(":/marine/obstruction.png"));
_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[0x10405] = Point(QImage(":/marine/foul.png"));
_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"));
_points[0x10500] = Point(Small, QColor(0, 0, 0));
_points[0x10500 | 1<<20] = Point(Small, QColor(0, 0x90, 0xfc));
_points[0x10500 | 2<<20] = Point(Small, QColor(0x30, 0xa0, 0x1b));
_points[0x10500 | 3<<20] = Point(Small, QColor(0xa7, 0xf1, 0xfc));
_points[0x10500 | 4<<20] = Point(Small, QColor(0xff, 0x40, 0x40));
_points[0x10500 | 5<<20] = Point(Small, QColor(0xe7, 0x28, 0xe7));
_points[0x10500 | 6<<20] = Point(Small, QColor(0xfc, 0xe0, 0x1f));
_points[0x10500 | 7<<20] = Point(Small, QColor(0xfc, 0x79, 0x1e));
_points[0x10500 | 8<<20] = Point(Small, QColor(0x40, 0x40, 0x40));
_points[0x10500 | 9<<20] = Point(Small, QColor(0x84, 0xe6, 0xfc));
_points[0x10500 | 10<<20] = Point(Small, QColor(0x83, 0x53, 0x15));
_points[0x10500 | 11<<20] = Point(Small, QColor(0xd2, 0xfc, 0xfc));
_points[0x10500 | 12<<20] = Point(Small, QColor(0xc5, 0xf1, 0xc2));
_points[0x10500 | 13<<20] = Point(Small, QColor(0xfc, 0xc6, 0xfc));
_points[0x10500 | 14<<20] = Point(Small, QColor(0xe2, 0xdc, 0xa9));
_points[0x10500 | 15<<20] = Point(Small, QColor(0xcd, 0xcd, 0xcd));
_points[0x10701] = Point(QImage(":/marine/anchorage.png")); _points[0x10701] = Point(QImage(":/marine/anchorage.png"));
_points[0x10702] = Point(QImage(":/marine/boarding-place.png")); _points[0x10702] = Point(QImage(":/marine/boarding-place.png"));
_points[0x10703] = Point(QImage(":/marine/yacht-harbor.png")); _points[0x10703] = Point(QImage(":/marine/yacht-harbor.png"));
_points[0x10704] = Point(QImage(":/marine/pile.png")); _points[0x10704] = Point(QImage(":/marine/pile.png"));
_points[0x10705] = Point(QImage(":/marine/anchoring-prohibited.png")); _points[0x10705] = Point(QImage(":/marine/anchoring-prohibited.png"));
_points[0x10708] = Point(QImage(":/marine/radio-call-garmin.png"));
_points[0x1070a] = Point(QImage(":/marine/rescue-station.png")); _points[0x1070a] = Point(QImage(":/marine/rescue-station.png"));
_points[0x1070b] = Point(QImage(":/marine/fishing-harbor.png")); _points[0x1070b] = Point(QImage(":/marine/fishing-harbor.png"));
} }

View File

@ -142,6 +142,8 @@ public:
{return (type >= 0x1400 && type <= 0x153f);} {return (type >= 0x1400 && type <= 0x153f);}
static bool isState(quint32 type) static bool isState(quint32 type)
{return (type == TYPE(0x1e));} {return (type == TYPE(0x1e));}
static bool isMarina(quint32 type)
{return type == 0x10703;}
static bool isRaster(quint32 type) static bool isRaster(quint32 type)
{return (type == 0x10613);} {return (type == 0x10613);}
static bool isDepthPoint(quint32 type) static bool isDepthPoint(quint32 type)
@ -152,12 +154,19 @@ public:
{return (type >= 0x10200 && type < 0x10300);} {return (type >= 0x10200 && type < 0x10300);}
static bool isLight(quint32 type) static bool isLight(quint32 type)
{return (type >= 0x10100 && type < 0x10200);} {return (type >= 0x10100 && type < 0x10200);}
static bool isLabelPoint(quint32 type)
{return type == 0x10500;}
static bool isMarinePoint(quint32 type) static bool isMarinePoint(quint32 type)
{return type >= 0x10100 && type < 0x10a00;} {return type >= 0x10100 && type < 0x10a00;}
static bool isMarina(quint32 type) static bool isStyledLine(quint32 type)
{return type == 0x10703;} {return type >= 0x10400 && type < 0x10700;}
static bool isCartographicLine(quint32 type)
{return type == 0x10601;}
static bool isRecommendedRoute(quint32 type)
{return type == 0x10108;}
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);

View File

@ -8,7 +8,7 @@
#define FLAGS (Qt::AlignCenter | Qt::TextWordWrap | Qt::TextDontClip) #define FLAGS (Qt::AlignCenter | Qt::TextWordWrap | Qt::TextDontClip)
#define MAX_TEXT_WIDTH 8 #define MAX_TEXT_WIDTH 10
#define MIN_BOX_WIDTH 2 #define MIN_BOX_WIDTH 2