mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-30 22:51:16 +01:00
ENC inland waters style hack
This commit is contained in:
parent
67209c4ad5
commit
015598b951
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#define CATHAF 30
|
#define CATHAF 30
|
||||||
#define CATLMK 35
|
#define CATLMK 35
|
||||||
|
#define CATMOR 40
|
||||||
#define CATREA 56
|
#define CATREA 56
|
||||||
#define CATWRK 71
|
#define CATWRK 71
|
||||||
#define DRVAL1 87
|
#define DRVAL1 87
|
||||||
|
@ -374,7 +374,8 @@ MapData::Attr MapData::pointAttr(const ISO8211::Record &r, uint OBJL)
|
|||||||
label = av.at(1).toString();
|
label = av.at(1).toString();
|
||||||
if ((OBJL == HRBFAC && key == CATHAF)
|
if ((OBJL == HRBFAC && key == CATHAF)
|
||||||
|| (OBJL == LNDMRK && key == CATLMK)
|
|| (OBJL == LNDMRK && key == CATLMK)
|
||||||
|| (OBJL == WRECKS && key == CATWRK))
|
|| (OBJL == WRECKS && key == CATWRK)
|
||||||
|
|| (OBJL == MORFAC && key == CATMOR))
|
||||||
subtype = av.at(1).toString().toUInt();
|
subtype = av.at(1).toString().toUInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,20 +29,24 @@
|
|||||||
#define DYKCON 49
|
#define DYKCON 49
|
||||||
#define FAIRWY 51
|
#define FAIRWY 51
|
||||||
#define FERYRT 53
|
#define FERYRT 53
|
||||||
|
#define GATCON 61
|
||||||
#define HRBFAC 64
|
#define HRBFAC 64
|
||||||
#define LAKARE 69
|
#define LAKARE 69
|
||||||
#define LNDARE 71
|
#define LNDARE 71
|
||||||
#define LNDELV 72
|
#define LNDELV 72
|
||||||
#define LNDMRK 74
|
#define LNDMRK 74
|
||||||
#define LIGHTS 75
|
#define LIGHTS 75
|
||||||
|
#define MORFAC 84
|
||||||
#define NAVLNE 85
|
#define NAVLNE 85
|
||||||
#define OBSTRN 86
|
#define OBSTRN 86
|
||||||
#define OFSPLF 87
|
#define OFSPLF 87
|
||||||
#define PILPNT 90
|
#define PILPNT 90
|
||||||
#define PIPSOL 94
|
#define PIPSOL 94
|
||||||
#define PONTON 95
|
#define PONTON 95
|
||||||
|
#define RAILWY 106
|
||||||
#define RESARE 112
|
#define RESARE 112
|
||||||
#define RIVERS 114
|
#define RIVERS 114
|
||||||
|
#define ROADWY 116
|
||||||
#define SLCONS 122
|
#define SLCONS 122
|
||||||
#define SLOTOP 126
|
#define SLOTOP 126
|
||||||
#define SOUNDG 129
|
#define SOUNDG 129
|
||||||
|
@ -9,6 +9,8 @@ using namespace ENC;
|
|||||||
|
|
||||||
#define ICON_PADDING 2
|
#define ICON_PADDING 2
|
||||||
|
|
||||||
|
#define ECDIS(x) (((x)>TYPE(17000))?((x)-TYPE(17000)):(x))
|
||||||
|
|
||||||
static const QColor haloColor(Qt::white);
|
static const QColor haloColor(Qt::white);
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
@ -82,9 +84,9 @@ void RasterTile::drawPolygons(QPainter *painter)
|
|||||||
for (int n = 0; n < s.drawOrder().size(); n++) {
|
for (int n = 0; n < s.drawOrder().size(); n++) {
|
||||||
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() != s.drawOrder().at(n))
|
if (ECDIS(poly->type()) != s.drawOrder().at(n))
|
||||||
continue;
|
continue;
|
||||||
const Style::Polygon &style = s.polygon(poly->type());
|
const Style::Polygon &style = s.polygon(ECDIS(poly->type()));
|
||||||
|
|
||||||
painter->setPen(style.pen());
|
painter->setPen(style.pen());
|
||||||
painter->setBrush(style.brush());
|
painter->setBrush(style.brush());
|
||||||
@ -101,7 +103,7 @@ void RasterTile::drawLines(QPainter *painter)
|
|||||||
|
|
||||||
for (int i = 0; i < _lines.size(); i++) {
|
for (int i = 0; i < _lines.size(); i++) {
|
||||||
const MapData::Line *line = _lines.at(i);
|
const MapData::Line *line = _lines.at(i);
|
||||||
const Style::Line &style = s.line(line->type());
|
const Style::Line &style = s.line(ECDIS(line->type()));
|
||||||
|
|
||||||
if (!style.img().isNull()) {
|
if (!style.img().isNull()) {
|
||||||
BitmapLine::draw(painter, polyline(line->path()), style.img());
|
BitmapLine::draw(painter, polyline(line->path()), style.img());
|
||||||
@ -127,13 +129,13 @@ void RasterTile::processPoints(QList<TextItem*> &textItems)
|
|||||||
|
|
||||||
for (int i = 0; i < _points.size(); i++) {
|
for (int i = 0; i < _points.size(); i++) {
|
||||||
const MapData::Point *point = _points.at(i);
|
const MapData::Point *point = _points.at(i);
|
||||||
const Style::Point &style = s.point(point->type());
|
const Style::Point &style = s.point(ECDIS(point->type()));
|
||||||
|
|
||||||
const QString *label = point->label().isEmpty() ? 0 : &(point->label());
|
const QString *label = point->label().isEmpty() ? 0 : &(point->label());
|
||||||
const QImage *img = style.img().isNull() ? 0 : &style.img();
|
const QImage *img = style.img().isNull() ? 0 : &style.img();
|
||||||
const QFont *fnt = font(style.textFontSize());
|
const QFont *fnt = font(style.textFontSize());
|
||||||
const QColor *color = &style.textColor();
|
const QColor *color = &style.textColor();
|
||||||
const QColor *hColor = Style::isSounding(point->type())
|
const QColor *hColor = Style::isSounding(ECDIS(point->type()))
|
||||||
? 0 : &haloColor;
|
? 0 : &haloColor;
|
||||||
|
|
||||||
if ((!label || !fnt) && !img)
|
if ((!label || !fnt) && !img)
|
||||||
@ -154,7 +156,7 @@ void RasterTile::processLines(QList<TextItem*> &textItems)
|
|||||||
|
|
||||||
for (int i = 0; i < _lines.size(); i++) {
|
for (int i = 0; i < _lines.size(); i++) {
|
||||||
const MapData::Line *line = _lines.at(i);
|
const MapData::Line *line = _lines.at(i);
|
||||||
const Style::Line &style = s.line(line->type());
|
const Style::Line &style = s.line(ECDIS(line->type()));
|
||||||
|
|
||||||
if (style.img().isNull() && style.pen() == Qt::NoPen)
|
if (style.img().isNull() && style.pen() == Qt::NoPen)
|
||||||
continue;
|
continue;
|
||||||
|
@ -1,7 +1,19 @@
|
|||||||
|
#include <QPainter>
|
||||||
#include "style.h"
|
#include "style.h"
|
||||||
|
|
||||||
using namespace ENC;
|
using namespace ENC;
|
||||||
|
|
||||||
|
static QImage railroad()
|
||||||
|
{
|
||||||
|
QImage img(16, 4, QImage::Format_ARGB32_Premultiplied);
|
||||||
|
img.fill(Qt::black);
|
||||||
|
QPainter p(&img);
|
||||||
|
p.setPen(QPen(Qt::white, 2));
|
||||||
|
p.drawLine(9, 2, 15, 2);
|
||||||
|
|
||||||
|
return img;
|
||||||
|
}
|
||||||
|
|
||||||
void Style::defaultPolygonStyle()
|
void Style::defaultPolygonStyle()
|
||||||
{
|
{
|
||||||
_polygons[TYPE(M_COVR)] = Polygon(QBrush("#ffffff"));
|
_polygons[TYPE(M_COVR)] = Polygon(QBrush("#ffffff"));
|
||||||
@ -76,6 +88,9 @@ void Style::defaultLineStyle()
|
|||||||
_lines[TYPE(SLOTOP)] = Line(QPen(QColor("#797420"), 1, Qt::SolidLine));
|
_lines[TYPE(SLOTOP)] = Line(QPen(QColor("#797420"), 1, Qt::SolidLine));
|
||||||
_lines[TYPE(OBSTRN)] = Line(QPen(QColor("#000000"), 1.5, Qt::DotLine));
|
_lines[TYPE(OBSTRN)] = Line(QPen(QColor("#000000"), 1.5, Qt::DotLine));
|
||||||
_lines[TYPE(FERYRT)] = Line(QImage(":/marine/ferry-line.png"));
|
_lines[TYPE(FERYRT)] = Line(QImage(":/marine/ferry-line.png"));
|
||||||
|
_lines[TYPE(RAILWY)] = Line(railroad());
|
||||||
|
_lines[TYPE(ROADWY)] = Line(QPen(QColor("#000000"), 2, Qt::SolidLine));
|
||||||
|
_lines[TYPE(GATCON)] = Line(QPen(QColor("#000000"), 2, Qt::SolidLine));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Style::defaultPointStyle()
|
void Style::defaultPointStyle()
|
||||||
@ -107,9 +122,13 @@ void Style::defaultPointStyle()
|
|||||||
_points[SUBTYPE(WRECKS, 5)] = Point(QImage(":/marine/wreck-exposed.png"));
|
_points[SUBTYPE(WRECKS, 5)] = Point(QImage(":/marine/wreck-exposed.png"));
|
||||||
_points[TYPE(UWTROC)] = Point(QImage(":/marine/rock-dangerous.png"), Small);
|
_points[TYPE(UWTROC)] = Point(QImage(":/marine/rock-dangerous.png"), Small);
|
||||||
_points[SUBTYPE(HRBFAC, 5)] = Point(QImage(":/marine/yacht-harbor.png"));
|
_points[SUBTYPE(HRBFAC, 5)] = Point(QImage(":/marine/yacht-harbor.png"));
|
||||||
_points[TYPE(PILPNT)] = Point(QImage(":/marine/pile.png"), Small);
|
|
||||||
_points[TYPE(ACHBRT)] = Point(QImage(":/marine/anchorage.png"));
|
_points[TYPE(ACHBRT)] = Point(QImage(":/marine/anchorage.png"));
|
||||||
_points[TYPE(OFSPLF)] = Point(QImage(":/marine/platform.png"));
|
_points[TYPE(OFSPLF)] = Point(QImage(":/marine/platform.png"));
|
||||||
|
_points[TYPE(PILPNT)] = Point(QImage(":/marine/pile.png"), Small);
|
||||||
|
_points[SUBTYPE(MORFAC, 1)] = Point(QImage(":/marine/pile.png"), Small);
|
||||||
|
_points[SUBTYPE(MORFAC, 5)] = Point(QImage(":/marine/pile.png"), Small);
|
||||||
|
_points[SUBTYPE(MORFAC, 7)] = Point(QImage(":/marine/mooring-buoy.png"),
|
||||||
|
Small);
|
||||||
}
|
}
|
||||||
|
|
||||||
Style::Style()
|
Style::Style()
|
||||||
|
Loading…
Reference in New Issue
Block a user