diff --git a/src/map/ENC/mapdata.cpp b/src/map/ENC/mapdata.cpp index a850b6e5..66cf373f 100644 --- a/src/map/ENC/mapdata.cpp +++ b/src/map/ENC/mapdata.cpp @@ -285,7 +285,8 @@ MapData::Point::Point(uint type, const Coordinates &c, const QString &label, else _label += "\n(" + QString::fromLatin1(params.at(0)) + "\xE2\x80\x89m)"; - } + } else if ((type == TYPE(TSSLPT) || type == TYPE(RCTLPT)) && params.size()) + _param = QVariant(params.at(0).toDouble()); } MapData::Poly::Poly(uint type, const Polygon &path, const QString &label, @@ -293,7 +294,7 @@ MapData::Poly::Poly(uint type, const Polygon &path, const QString &label, { if (type == TYPE(DEPARE) && params.size()) _type = SUBTYPE(DEPARE, depthLevel(params.at(0))); - else if (type == TYPE(TSSLPT) && params.size()) + else if ((type == TYPE(TSSLPT) || type == TYPE(RCTLPT)) && params.size()) _param = QVariant(params.at(0).toDouble()); else if ((type == TYPE(BRIDGE) || type == TYPE(I_BRIDGE)) && params.size()) { @@ -595,7 +596,9 @@ MapData::Attr MapData::pointAttr(const ISO8211::Record &r, uint OBJL) || (OBJL == RDOCAL && key == ORIENT) || (OBJL == I_RDOCAL && key == ORIENT) || (OBJL == CURENT && key == ORIENT) - || (OBJL == LNDELV && key == ELEVAT)) + || (OBJL == LNDELV && key == ELEVAT) + || (OBJL == TSSLPT && key == ORIENT) + || (OBJL == RCTLPT && key == ORIENT)) params[0] = av.at(1).toByteArray(); if ((OBJL == I_RDOCAL && key == COMCHA) || (OBJL == RDOCAL && key == COMCHA) @@ -668,6 +671,7 @@ MapData::Attr MapData::polyAttr(const ISO8211::Record &r, uint OBJL) } if ((OBJL == TSSLPT && key == ORIENT) + || (OBJL == RCTLPT && key == ORIENT) || (OBJL == DEPARE && key == DRVAL1)) params[0] = av.at(1).toByteArray(); if ((OBJL == BRIDGE && key == VERCLR) diff --git a/src/map/ENC/objects.h b/src/map/ENC/objects.h index d1a5c413..652797c2 100644 --- a/src/map/ENC/objects.h +++ b/src/map/ENC/objects.h @@ -74,6 +74,7 @@ #define RAILWY 106 #define RCRTCL 108 #define RECTRC 109 +#define RCTLPT 110 #define RSCSTA 111 #define RESARE 112 #define RIVERS 114 diff --git a/src/map/ENC/rastertile.cpp b/src/map/ENC/rastertile.cpp index dcba0978..491072d5 100644 --- a/src/map/ENC/rastertile.cpp +++ b/src/map/ENC/rastertile.cpp @@ -150,19 +150,42 @@ QPolygonF RasterTile::tsslptArrow(const QPointF &p, qreal angle) const return polygon; } +static void drawArrow(QPainter *painter, const QPolygonF &polygon, uint type) +{ + if (type>>16 == RCTLPT) { + painter->setPen(QPen(tsslptPen, 1, Qt::DashLine)); + painter->setBrush(Qt::NoBrush); + } else { + painter->setPen(QPen(tsslptPen, 1)); + painter->setBrush(QBrush(tsslptBrush)); + } + painter->drawPolygon(polygon); +} + void RasterTile::drawArrows(QPainter *painter, const QList &polygons) { for (int i = 0; i < polygons.size(); i++) { const MapData::Poly &poly = polygons.at(i); - if (poly.type()>>16 == TSSLPT) { + if (poly.type()>>16 == TSSLPT || poly.type()>>16 == RCTLPT) { QPolygonF polygon(tsslptArrow(centroid(poly.path().first()), deg2rad(poly.param().toDouble()))); + drawArrow(painter, polygon, poly.type()); + } + } +} - painter->setPen(QPen(tsslptPen, 1)); - painter->setBrush(QBrush(tsslptBrush)); - painter->drawPolygon(polygon); +void RasterTile::drawArrows(QPainter *painter, + const QList &points) +{ + for (int i = 0; i < points.size(); i++) { + const MapData::Point &point = points.at(i); + + if (point.type()>>16 == TSSLPT || point.type()>>16 == RCTLPT) { + QPolygonF polygon(tsslptArrow(ll2xy(point.pos()), + deg2rad(point.param().toDouble()))); + drawArrow(painter, polygon, point.type()); } } } @@ -400,6 +423,7 @@ void RasterTile::render() drawPolygons(&painter, polygons); drawLines(&painter, lines); drawArrows(&painter, polygons); + drawArrows(&painter, points); drawTextItems(&painter, lights); drawTextItems(&painter, textItems); diff --git a/src/map/ENC/rastertile.h b/src/map/ENC/rastertile.h index 65333f54..e253646d 100644 --- a/src/map/ENC/rastertile.h +++ b/src/map/ENC/rastertile.h @@ -52,6 +52,7 @@ private: void drawBitmapPath(QPainter *painter, const QImage &img, const Polygon &polygon); void drawArrows(QPainter *painter, const QList &polygons); + void drawArrows(QPainter *painter, const QList &points); void drawPolygons(QPainter *painter, const QList &polygons); void drawLines(QPainter *painter, const QList &lines); void drawTextItems(QPainter *painter, const QList &textItems);