1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +01:00

Some more ENC style improvements

This commit is contained in:
Martin Tůma 2022-12-04 23:09:59 +01:00
parent 9b90cf5783
commit 7900e88907
6 changed files with 28 additions and 20 deletions

View File

@ -177,6 +177,7 @@
<file alias="fence-line.png">icons/map/marine/fence-line.png</file> <file alias="fence-line.png">icons/map/marine/fence-line.png</file>
<file alias="crane.png">icons/map/marine/crane.png</file> <file alias="crane.png">icons/map/marine/crane.png</file>
<file alias="distance-mark.png">icons/map/marine/distance-mark.png</file> <file alias="distance-mark.png">icons/map/marine/distance-mark.png</file>
<file alias="distance-mark-land.png">icons/map/marine/distance-mark-land.png</file>
<file alias="conveyor-line.png">icons/map/marine/conveyor-line.png</file> <file alias="conveyor-line.png">icons/map/marine/conveyor-line.png</file>
<file alias="pipeline-overhead.png">icons/map/marine/pipeline-overhead.png</file> <file alias="pipeline-overhead.png">icons/map/marine/pipeline-overhead.png</file>
<file alias="coast-guard.png">icons/map/marine/coast-guard.png</file> <file alias="coast-guard.png">icons/map/marine/coast-guard.png</file>
@ -189,6 +190,7 @@
<file alias="entry-prohibited-line.png">icons/map/marine/entry-prohibited-line.png</file> <file alias="entry-prohibited-line.png">icons/map/marine/entry-prohibited-line.png</file>
<file alias="cable-area-line.png">icons/map/marine/cable-area-line.png</file> <file alias="cable-area-line.png">icons/map/marine/cable-area-line.png</file>
<file alias="pipeline-area-line.png">icons/map/marine/pipeline-area-line.png</file> <file alias="pipeline-area-line.png">icons/map/marine/pipeline-area-line.png</file>
<file alias="windmotor.png">icons/map/marine/windmotor.png</file>
</qresource> </qresource>
<!-- Mapsforge rendertheme --> <!-- Mapsforge rendertheme -->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

View File

@ -208,6 +208,26 @@ void RasterTile::processPoints(QList<TextItem*> &textItems)
std::sort(_points.begin(), _points.end(), pointLess); std::sort(_points.begin(), _points.end(), pointLess);
for (int i = 0; i < _polygons.size(); i++) {
const MapData::Poly *poly = _polygons.at(i);
uint type = poly->type()>>16;
if (!(type == HRBFAC || type == I_TRNBSN))
continue;
const Style::Point &style = s.point(poly->type());
const QImage *img = style.img().isNull() ? 0 : &style.img();
if (!img)
continue;
TextPointItem *item = new TextPointItem(
ll2xy(centroid(poly->path().first())).toPoint(),
0, 0, img, 0, 0, 0, 0);
if (item->isValid() && !item->collides(textItems))
textItems.append(item);
else
delete item;
}
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(point->type());
@ -229,25 +249,6 @@ void RasterTile::processPoints(QList<TextItem*> &textItems)
else else
delete item; delete item;
} }
for (int i = 0; i < _polygons.size(); i++) {
const MapData::Poly *poly = _polygons.at(i);
if (poly->type()>>16 == HRBFAC) {
const Style::Point &style = s.point(poly->type());
const QImage *img = style.img().isNull() ? 0 : &style.img();
if (!img)
continue;
TextPointItem *item = new TextPointItem(
ll2xy(centroid(poly->path().first())).toPoint(), 0, 0,
&style.img(), 0, 0, 0, 0);
if (item->isValid() && !item->collides(textItems))
textItems.append(item);
else
delete item;
}
}
} }
void RasterTile::processLines(QList<TextItem*> &textItems) void RasterTile::processLines(QList<TextItem*> &textItems)

View File

@ -94,7 +94,7 @@ void Style::defaultPolygonStyle()
Qt::Dense7Pattern)); Qt::Dense7Pattern));
_polygons[TYPE(I_LOKBSN)] = Polygon(QBrush(QColor("#333333"), _polygons[TYPE(I_LOKBSN)] = Polygon(QBrush(QColor("#333333"),
Qt::Dense7Pattern)); Qt::Dense7Pattern));
_polygons[TYPE(TUNNEL)] = Polygon(Qt::NoBrush, QPen(QColor("#a3a3a3"), 1, _polygons[TYPE(TUNNEL)] = Polygon(Qt::NoBrush, QPen(QColor("#a58140"), 1.5,
Qt::DashLine)); Qt::DashLine));
_polygons[TYPE(CBLARE)] = Polygon(QImage(":/marine/cable-area-line.png")); _polygons[TYPE(CBLARE)] = Polygon(QImage(":/marine/cable-area-line.png"));
_polygons[TYPE(PIPARE)] = Polygon(QImage(":/marine/pipeline-area-line.png")); _polygons[TYPE(PIPARE)] = Polygon(QImage(":/marine/pipeline-area-line.png"));
@ -190,6 +190,7 @@ void Style::defaultPointStyle()
_points[SUBTYPE(LNDMRK, 9)] = Point(QImage(":/marine/monument.png")); _points[SUBTYPE(LNDMRK, 9)] = Point(QImage(":/marine/monument.png"));
_points[SUBTYPE(LNDMRK, 20)] = Point(QImage(":/marine/church.png")); _points[SUBTYPE(LNDMRK, 20)] = Point(QImage(":/marine/church.png"));
_points[SUBTYPE(LNDMRK, 17)] = Point(QImage(":/marine/tower.png")); _points[SUBTYPE(LNDMRK, 17)] = Point(QImage(":/marine/tower.png"));
_points[SUBTYPE(LNDMRK, 19)] = Point(QImage(":/marine/windmotor.png"));
_points[TYPE(LNDELV)] = Point(QImage(":/marine/triangulation-point.png")); _points[TYPE(LNDELV)] = Point(QImage(":/marine/triangulation-point.png"));
_points[TYPE(OBSTRN)] = Point(QImage(":/marine/obstruction.png"), Small); _points[TYPE(OBSTRN)] = Point(QImage(":/marine/obstruction.png"), Small);
_points[SUBTYPE(WRECKS, 1)] = Point(QImage(":/marine/wreck.png"), Small); _points[SUBTYPE(WRECKS, 1)] = Point(QImage(":/marine/wreck.png"), Small);
@ -224,6 +225,10 @@ void Style::defaultPointStyle()
_points[SUBTYPE(I_DISMAR, 1)] = Point(QImage(":/marine/distance-mark.png")); _points[SUBTYPE(I_DISMAR, 1)] = Point(QImage(":/marine/distance-mark.png"));
_points[SUBTYPE(I_DISMAR, 1)].setTextColor(QColor("#ffffff")); _points[SUBTYPE(I_DISMAR, 1)].setTextColor(QColor("#ffffff"));
_points[SUBTYPE(I_DISMAR, 1)].setTextFontSize(Small); _points[SUBTYPE(I_DISMAR, 1)].setTextFontSize(Small);
_points[SUBTYPE(I_DISMAR, 2)] = Point(QImage(":/marine/distance-mark-land.png"));
_points[SUBTYPE(I_DISMAR, 2)].setTextFontSize(Small);
_points[SUBTYPE(I_DISMAR, 3)] = Point(QImage(":/marine/distance-mark-land.png"));
_points[SUBTYPE(I_DISMAR, 3)].setTextFontSize(Small);
_points[TYPE(CGUSTA)] = Point(QImage(":/marine/coast-guard.png")); _points[TYPE(CGUSTA)] = Point(QImage(":/marine/coast-guard.png"));
_points[TYPE(RDOSTA)] = Point(QImage(":/marine/radio.png")); _points[TYPE(RDOSTA)] = Point(QImage(":/marine/radio.png"));
_points[TYPE(RADSTA)] = Point(QImage(":/marine/radar.png")); _points[TYPE(RADSTA)] = Point(QImage(":/marine/radar.png"));