mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-06-03 16:53:02 +02:00
Recommended routes style
This commit is contained in:
parent
744cfde08f
commit
93fc190748
@ -193,7 +193,9 @@ static quint32 lineType(quint32 type, quint32 flags)
|
|||||||
return type | (flags & 0xFF000000) | 1<<20;
|
return type | (flags & 0xFF000000) | 1<<20;
|
||||||
else
|
else
|
||||||
return type | (flags & 0xFF000000);
|
return type | (flags & 0xFF000000);
|
||||||
} else if (flags & MapData::Poly::Direction)
|
} 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 | 1<<20;
|
||||||
else
|
else
|
||||||
return type;
|
return type;
|
||||||
|
@ -244,7 +244,7 @@ bool RGNFile::readLabel(Handle &hdl, LBLFile *lbl, Handle &lblHdl,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RGNFile::readLineInfo(Handle &hdl, quint8 flags, quint32 size,
|
bool RGNFile::readLineStyle(Handle &hdl, quint8 flags, quint32 size,
|
||||||
MapData::Poly *line) const
|
MapData::Poly *line) const
|
||||||
{
|
{
|
||||||
line->flags |= (flags & 0xf)<<24;
|
line->flags |= (flags & 0xf)<<24;
|
||||||
@ -270,6 +270,21 @@ bool RGNFile::readLineInfo(Handle &hdl, quint8 flags, quint32 size,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool RGNFile::readRecommendedRoute(Handle &hdl, quint8 flags, quint32 size,
|
||||||
|
MapData::Poly *line) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(flags);
|
||||||
|
quint32 val;
|
||||||
|
|
||||||
|
if (!(size >= 1 && readUInt8(hdl, val)))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (val & 2)
|
||||||
|
line->flags |= MapData::Poly::Dashed;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
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
|
||||||
{
|
{
|
||||||
@ -320,7 +335,9 @@ bool RGNFile::readClassFields(Handle &hdl, SegmentType segmentType,
|
|||||||
point->flags |= (flags & 0xf)<<20;
|
point->flags |= (flags & 0xf)<<20;
|
||||||
|
|
||||||
if (line && Style::isStyledLine(line->type))
|
if (line && Style::isStyledLine(line->type))
|
||||||
readLineInfo(hdl, flags, rs, line);
|
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);
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,9 @@ 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, quint8 flags, quint32 size,
|
bool readLineStyle(Handle &hdl, quint8 flags, quint32 size,
|
||||||
|
MapData::Poly *line) const;
|
||||||
|
bool readRecommendedRoute(Handle &hdl, quint8 flags, quint32 size,
|
||||||
MapData::Poly *line) const;
|
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;
|
||||||
|
@ -490,6 +490,7 @@ 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));
|
||||||
|
@ -162,6 +162,8 @@ public:
|
|||||||
{return type >= 0x10400 && type < 0x10700;}
|
{return type >= 0x10400 && type < 0x10700;}
|
||||||
static bool isCartographicLine(quint32 type)
|
static bool isCartographicLine(quint32 type)
|
||||||
{return type == 0x10601;}
|
{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));}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user