1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-04-20 12:19:11 +02:00

Compare commits

...

2 Commits

Author SHA1 Message Date
67b91f62a0 Radar reflectors (RADRFL) 2024-12-18 13:58:49 +01:00
0ab6e02e6c RCTLPT areas and TSSLPT/RCTLPT points 2024-12-18 12:41:05 +01:00
7 changed files with 51 additions and 17 deletions

View File

@ -206,6 +206,7 @@
<file alias="kelp.png">icons/map/marine/kelp.png</file> <file alias="kelp.png">icons/map/marine/kelp.png</file>
<file alias="eddies.png">icons/map/marine/eddies.png</file> <file alias="eddies.png">icons/map/marine/eddies.png</file>
<file alias="dome.png">icons/map/marine/dome.png</file> <file alias="dome.png">icons/map/marine/dome.png</file>
<file alias="radar-reflector.png">icons/map/marine/radar-reflector.png</file>
</qresource> </qresource>
<!-- Patterns (Mapsforge) --> <!-- Patterns (Mapsforge) -->

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

View File

@ -63,16 +63,17 @@ static QMap<uint,uint> orderMapInit()
map.insert(TYPE(PILPNT), 34); map.insert(TYPE(PILPNT), 34);
map.insert(TYPE(ACHBRT), 35); map.insert(TYPE(ACHBRT), 35);
map.insert(TYPE(I_ACHBRT), 35); map.insert(TYPE(I_ACHBRT), 35);
map.insert(TYPE(CRANES), 36); map.insert(TYPE(RADRFL), 36);
map.insert(TYPE(I_CRANES), 36); map.insert(TYPE(CRANES), 37);
map.insert(TYPE(I_WTWGAG), 37); map.insert(TYPE(I_CRANES), 37);
map.insert(TYPE(PYLONS), 38); map.insert(TYPE(I_WTWGAG), 38);
map.insert(TYPE(SLCONS), 39); map.insert(TYPE(PYLONS), 39);
map.insert(TYPE(LNDMRK), 40); map.insert(TYPE(SLCONS), 40);
map.insert(TYPE(SILTNK), 41); map.insert(TYPE(LNDMRK), 41);
map.insert(TYPE(LNDELV), 42); map.insert(TYPE(SILTNK), 42);
map.insert(TYPE(SMCFAC), 43); map.insert(TYPE(LNDELV), 43);
map.insert(TYPE(BUISGL), 44); map.insert(TYPE(SMCFAC), 44);
map.insert(TYPE(BUISGL), 45);
map.insert(TYPE(I_DISMAR), 0xFFFFFFFE); map.insert(TYPE(I_DISMAR), 0xFFFFFFFE);
map.insert(TYPE(SOUNDG), 0xFFFFFFFF); map.insert(TYPE(SOUNDG), 0xFFFFFFFF);
@ -285,7 +286,8 @@ MapData::Point::Point(uint type, const Coordinates &c, const QString &label,
else else
_label += "\n(" + QString::fromLatin1(params.at(0)) _label += "\n(" + QString::fromLatin1(params.at(0))
+ "\xE2\x80\x89m)"; + "\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, MapData::Poly::Poly(uint type, const Polygon &path, const QString &label,
@ -293,7 +295,7 @@ MapData::Poly::Poly(uint type, const Polygon &path, const QString &label,
{ {
if (type == TYPE(DEPARE) && params.size()) if (type == TYPE(DEPARE) && params.size())
_type = SUBTYPE(DEPARE, depthLevel(params.at(0))); _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()); _param = QVariant(params.at(0).toDouble());
else if ((type == TYPE(BRIDGE) || type == TYPE(I_BRIDGE)) else if ((type == TYPE(BRIDGE) || type == TYPE(I_BRIDGE))
&& params.size()) { && params.size()) {
@ -595,7 +597,9 @@ MapData::Attr MapData::pointAttr(const ISO8211::Record &r, uint OBJL)
|| (OBJL == RDOCAL && key == ORIENT) || (OBJL == RDOCAL && key == ORIENT)
|| (OBJL == I_RDOCAL && key == ORIENT) || (OBJL == I_RDOCAL && key == ORIENT)
|| (OBJL == CURENT && 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(); params[0] = av.at(1).toByteArray();
if ((OBJL == I_RDOCAL && key == COMCHA) if ((OBJL == I_RDOCAL && key == COMCHA)
|| (OBJL == RDOCAL && key == COMCHA) || (OBJL == RDOCAL && key == COMCHA)
@ -668,6 +672,7 @@ MapData::Attr MapData::polyAttr(const ISO8211::Record &r, uint OBJL)
} }
if ((OBJL == TSSLPT && key == ORIENT) if ((OBJL == TSSLPT && key == ORIENT)
|| (OBJL == RCTLPT && key == ORIENT)
|| (OBJL == DEPARE && key == DRVAL1)) || (OBJL == DEPARE && key == DRVAL1))
params[0] = av.at(1).toByteArray(); params[0] = av.at(1).toByteArray();
if ((OBJL == BRIDGE && key == VERCLR) if ((OBJL == BRIDGE && key == VERCLR)

View File

@ -67,6 +67,7 @@
#define PONTON 95 #define PONTON 95
#define PRCARE 96 #define PRCARE 96
#define PYLONS 98 #define PYLONS 98
#define RADRFL 101
#define RADSTA 102 #define RADSTA 102
#define RTPBCN 103 #define RTPBCN 103
#define RDOCAL 104 #define RDOCAL 104
@ -74,6 +75,7 @@
#define RAILWY 106 #define RAILWY 106
#define RCRTCL 108 #define RCRTCL 108
#define RECTRC 109 #define RECTRC 109
#define RCTLPT 110
#define RSCSTA 111 #define RSCSTA 111
#define RESARE 112 #define RESARE 112
#define RIVERS 114 #define RIVERS 114

View File

@ -150,19 +150,42 @@ QPolygonF RasterTile::tsslptArrow(const QPointF &p, qreal angle) const
return polygon; 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, void RasterTile::drawArrows(QPainter *painter,
const QList<MapData::Poly> &polygons) const QList<MapData::Poly> &polygons)
{ {
for (int i = 0; i < polygons.size(); i++) { for (int i = 0; i < polygons.size(); i++) {
const MapData::Poly &poly = polygons.at(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()), QPolygonF polygon(tsslptArrow(centroid(poly.path().first()),
deg2rad(poly.param().toDouble()))); deg2rad(poly.param().toDouble())));
drawArrow(painter, polygon, poly.type());
}
}
}
painter->setPen(QPen(tsslptPen, 1)); void RasterTile::drawArrows(QPainter *painter,
painter->setBrush(QBrush(tsslptBrush)); const QList<MapData::Point> &points)
painter->drawPolygon(polygon); {
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); drawPolygons(&painter, polygons);
drawLines(&painter, lines); drawLines(&painter, lines);
drawArrows(&painter, polygons); drawArrows(&painter, polygons);
drawArrows(&painter, points);
drawTextItems(&painter, lights); drawTextItems(&painter, lights);
drawTextItems(&painter, textItems); drawTextItems(&painter, textItems);

View File

@ -52,6 +52,7 @@ private:
void drawBitmapPath(QPainter *painter, const QImage &img, void drawBitmapPath(QPainter *painter, const QImage &img,
const Polygon &polygon); const Polygon &polygon);
void drawArrows(QPainter *painter, const QList<MapData::Poly> &polygons); void drawArrows(QPainter *painter, const QList<MapData::Poly> &polygons);
void drawArrows(QPainter *painter, const QList<MapData::Point> &points);
void drawPolygons(QPainter *painter, const QList<MapData::Poly> &polygons); void drawPolygons(QPainter *painter, const QList<MapData::Poly> &polygons);
void drawLines(QPainter *painter, const QList<MapData::Line> &lines); void drawLines(QPainter *painter, const QList<MapData::Line> &lines);
void drawTextItems(QPainter *painter, const QList<TextItem*> &textItems); void drawTextItems(QPainter *painter, const QList<TextItem*> &textItems);

View File

@ -335,6 +335,7 @@ void Style::pointStyle(qreal ratio)
_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"));
_points[TYPE(SEAARE)].setHaloColor(QColor()); _points[TYPE(SEAARE)].setHaloColor(QColor());
_points[TYPE(RADRFL)] = Point(QImage(":/marine/radar-reflector.png"));
_points[SUBTYPE(SMCFAC, 7)] = Point(svg2img(":/POI/restaurant-11.svg", _points[SUBTYPE(SMCFAC, 7)] = Point(svg2img(":/POI/restaurant-11.svg",
ratio), Small); ratio), Small);