mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-06-07 02:33:03 +02:00
Compare commits
2 Commits
93fc190748
...
f588bad785
Author | SHA1 | Date | |
---|---|---|---|
f588bad785 | |||
8ba97e65f5 |
@ -196,7 +196,7 @@ static quint32 lineType(quint32 type, quint32 flags)
|
||||
} else if (Style::isRecommendedRoute(type))
|
||||
return (flags & MapData::Poly::Dashed) ? type | 1<<20 : type;
|
||||
else if (flags & MapData::Poly::Direction)
|
||||
return type | 1<<20;
|
||||
return type | 2<<20;
|
||||
else
|
||||
return type;
|
||||
}
|
||||
|
@ -273,16 +273,70 @@ bool RGNFile::readLineStyle(Handle &hdl, quint8 flags, quint32 size,
|
||||
bool RGNFile::readRecommendedRoute(Handle &hdl, quint8 flags, quint32 size,
|
||||
MapData::Poly *line) const
|
||||
{
|
||||
Q_UNUSED(flags);
|
||||
quint32 val;
|
||||
quint32 f2;
|
||||
|
||||
if (!(size >= 1 && readUInt8(hdl, val)))
|
||||
if (!(size >= 1 && readUInt8(hdl, f2)))
|
||||
return false;
|
||||
size--;
|
||||
|
||||
if (val & 2)
|
||||
line->flags |= MapData::Poly::Dashed;
|
||||
if ((flags >> 5) == 7) {
|
||||
quint32 f3;
|
||||
if (!(size >= 1 && readUInt8(hdl, f3)))
|
||||
return false;
|
||||
size--;
|
||||
|
||||
return true;
|
||||
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,
|
||||
|
@ -500,35 +500,38 @@ void Style::defaultLineStyle(qreal ratio)
|
||||
_lines[0x10402] = Line(QImage(":/marine/pipeline.png"));
|
||||
_lines[0x10403] = Line(QPen(QColor(0, 0, 0), 2, Qt::DotLine));
|
||||
_lines[0x10404] = Line(QPen(QColor(0, 0, 0), 1, Qt::DashLine));
|
||||
_lines[0x110404] = Line(QImage(":/marine/fishing-farm-line.png"));
|
||||
_lines[0x210404] = 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[0x210405] = 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[0x210406] = Line(QImage(":/marine/cable-area-line.png"));
|
||||
_lines[0x10407] = Line(QPen(QColor(0xa3, 0xa3, 0xa3), 1, Qt::DashLine));
|
||||
_lines[0x110407] = Line(QImage(":/marine/dumping-ground-line.png"));
|
||||
_lines[0x210407] = Line(QImage(":/marine/dumping-ground-line.png"));
|
||||
_lines[0x10408] = Line(QPen(QColor(0xff, 0x40, 0x40), 1, Qt::DashLine));
|
||||
_lines[0x110408] = Line(QImage(":/marine/minefield-line.png"));
|
||||
_lines[0x210408] = Line(QImage(":/marine/minefield-line.png"));
|
||||
_lines[0x10409] = Line(QPen(QColor(0, 0, 0), 1, Qt::DotLine));
|
||||
_lines[0x210409] = Line(QPen(QColor(0, 0, 0), 1, Qt::DotLine));
|
||||
_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[0x110501] = Line(QImage(":/marine/noanchor-line.png"));
|
||||
_lines[0x210501] = 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[0x210502] = 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[0x210503] = Line(QImage(":/marine/entry-prohibited-line.png"));
|
||||
_lines[0x10504] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
|
||||
_lines[0x110504] = Line(QImage(":/marine/entry-prohibited-line.png"));
|
||||
_lines[0x210504] = Line(QImage(":/marine/entry-prohibited-line.png"));
|
||||
_lines[0x10505] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
|
||||
_lines[0x110505] = Line(QImage(":/marine/noanchor-line.png"));
|
||||
_lines[0x210505] = Line(QImage(":/marine/noanchor-line.png"));
|
||||
_lines[0x10506] = Line(QPen(QColor(0x30, 0xa0, 0x1b), 1, Qt::DashLine));
|
||||
_lines[0x110506] = Line(QImage(":/marine/nature-reserve-line.png"));
|
||||
_lines[0x210506] = Line(QImage(":/marine/nature-reserve-line.png"));
|
||||
_lines[0x10507] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine));
|
||||
_lines[0x110507] = Line(QImage(":/marine/safety-zone-line.png"));
|
||||
_lines[0x210507] = 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[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));
|
||||
@ -563,23 +566,27 @@ void Style::defaultLineStyle(qreal ratio)
|
||||
_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[0x110603] = 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[0x110604] = Line(QImage(":/marine/straight-territorial-sea-baseline.png"));
|
||||
_lines[0x210604] = Line(QImage(":/marine/straight-territorial-sea-baseline.png"));
|
||||
_lines[0x10605] = Line(QImage(":/marine/seaward-limit-of-territorial-sea.png"));
|
||||
_lines[0x110605] = 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[0x110606] = Line(QImage(":/marine/anchor-line.png"));
|
||||
_lines[0x210606] = 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[0x210608] = Line(QImage(":/marine/fishing-line.png"));
|
||||
_lines[0x1060b] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashDotDotLine));
|
||||
_lines[0x11060b] = 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[0x21060c] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::SolidLine));
|
||||
_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[0x11060e] = 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[0x210611] = Line(QPen(QColor(0xeb, 0x49, 0xeb), 1, Qt::DashLine));
|
||||
}
|
||||
|
||||
void Style::defaultPointStyle(qreal ratio)
|
||||
|
Loading…
x
Reference in New Issue
Block a user