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

Dashed misc/cartographic lines

This commit is contained in:
Martin Tůma 2025-05-18 21:42:57 +02:00
parent b2a123a731
commit 7f491330b1
4 changed files with 30 additions and 5 deletions

View File

@ -34,7 +34,8 @@ public:
enum Flags { enum Flags {
OneWay = 1, OneWay = 1,
Invert = 2, Invert = 2,
Direction = 4 Direction = 4,
Dashed = 8
}; };
/* QPointF insted of Coordinates for performance reasons (no need to /* QPointF insted of Coordinates for performance reasons (no need to

View File

@ -188,9 +188,12 @@ void RasterTile::drawPolygons(QPainter *painter,
static quint32 lineType(quint32 type, quint32 flags) static quint32 lineType(quint32 type, quint32 flags)
{ {
if (Style::isMiscLine(type)) if (Style::isMiscLine(type)) {
return type | (flags & 0xFF000000); if (flags & MapData::Poly::Dashed)
else if (flags & MapData::Poly::Direction) return type | (flags & 0xFF000000) | 1<<20;
else
return type | (flags & 0xFF000000);
} else if (flags & MapData::Poly::Direction)
return type | 1<<20; return type | 1<<20;
else else
return type; return type;

View File

@ -255,14 +255,19 @@ bool RGNFile::readLineInfo(Handle &hdl, quint8 flags, quint32 size,
if (!readUInt8(hdl, val)) if (!readUInt8(hdl, val))
return false; return false;
if (val & 3)
line->flags |= MapData::Poly::Dashed;
if ((val >> 3) & 3) if ((val >> 3) & 3)
line->flags |= MapData::Poly::Direction; line->flags |= MapData::Poly::Direction;
if ((val >> 3) & 2) if ((val >> 3) & 2)
line->flags |= MapData::Poly::Invert; line->flags |= MapData::Poly::Invert;
return true; return true;
} else } else {
if ((flags >> 4) & 3)
line->flags |= MapData::Poly::Dashed;
return (!size); return (!size);
}
} }
bool RGNFile::readClassFields(Handle &hdl, SegmentType segmentType, bool RGNFile::readClassFields(Handle &hdl, SegmentType segmentType,

View File

@ -530,21 +530,37 @@ void Style::defaultLineStyle(qreal ratio)
_lines[0x110508] = Line(QImage(":/marine/minefield-line.png")); _lines[0x110508] = Line(QImage(":/marine/minefield-line.png"));
_lines[0x10601] = Line(QPen(QColor(0, 0, 0), 1)); _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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[0x10602] = Line(QPen(QColor(0xfc, 0xb4, 0xfc), 2));
_lines[0x10603] = Line(QImage(":/marine/international-maritime-boundary.png")); _lines[0x10603] = Line(QImage(":/marine/international-maritime-boundary.png"));
_lines[0x110603] = Line(QImage(":/marine/international-maritime-boundary.png")); _lines[0x110603] = Line(QImage(":/marine/international-maritime-boundary.png"));