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

Compare commits

..

31 Commits

Author SHA1 Message Date
Hosted Weblate
cc8704ff20
Merge branch 'origin/master' into Weblate. 2024-06-18 16:44:37 +00:00
7a9e4171f9 Fix cut-off labels 2024-06-18 18:43:54 +02:00
Hosted Weblate
625451c041
Merge branch 'origin/master' into Weblate. 2024-06-18 16:13:24 +00:00
ef7b863003 Added bridge clearance rendering 2024-06-18 18:12:43 +02:00
c7f76f3009 Added missing dome symbol 2024-06-18 18:12:02 +02:00
ovl-1
7700ded936
Translated using Weblate (Norwegian Bokmål)
Currently translated at 100.0% (480 of 480 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/nb_NO/
2024-06-18 12:09:20 +02:00
99 efi
e8fee5e587
Translated using Weblate (Hungarian)
Currently translated at 100.0% (480 of 480 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/hu/
2024-06-16 15:09:20 +02:00
Hosted Weblate
450b6a3c39
Merge branch 'origin/master' into Weblate. 2024-06-16 07:05:04 +02:00
Hosted Weblate
e49b217b55
Merge branch 'origin/master' into Weblate. 2024-06-15 10:10:54 +00:00
Hosted Weblate
1067ef7352
Merge branch 'origin/master' into Weblate. 2024-06-15 11:34:51 +02:00
Hosted Weblate
80f3f74b47
Merge branch 'origin/master' into Weblate. 2024-06-15 11:29:27 +02:00
Hosted Weblate
e741fab183
Merge branch 'origin/master' into Weblate. 2024-06-12 23:02:46 +02:00
Hosted Weblate
7c434381a3
Merge branch 'origin/master' into Weblate. 2024-06-12 06:49:59 +00:00
Hosted Weblate
22c2204047
Merge branch 'origin/master' into Weblate. 2024-06-12 08:48:22 +02:00
Hosted Weblate
b0af165e53
Merge branch 'origin/master' into Weblate. 2024-06-10 18:37:30 +02:00
Hosted Weblate
0e0dcdd721
Merge branch 'origin/master' into Weblate. 2024-06-09 11:35:44 +00:00
Hosted Weblate
02a7445f86
Merge branch 'origin/master' into Weblate. 2024-06-09 07:37:09 +00:00
Hosted Weblate
55cae2d0cd
Merge branch 'origin/master' into Weblate. 2024-06-09 09:17:16 +02:00
Hosted Weblate
9f5e09a664
Merge branch 'origin/master' into Weblate. 2024-06-07 19:30:26 +02:00
Hosted Weblate
1d90ae460c
Merge branch 'origin/master' into Weblate. 2024-06-06 18:51:41 +02:00
Hosted Weblate
4c97b427fe
Merge branch 'origin/master' into Weblate. 2024-06-05 23:11:26 +00:00
Hosted Weblate
095897d016
Merge branch 'origin/master' into Weblate. 2024-06-05 10:02:02 +02:00
Hosted Weblate
0596c86ea1
Merge branch 'origin/master' into Weblate. 2024-06-05 08:39:49 +02:00
Hosted Weblate
33f6ce2e0e
Merge branch 'origin/master' into Weblate. 2024-06-05 06:36:08 +00:00
Hosted Weblate
5b2ac6cde2
Merge branch 'origin/master' into Weblate. 2024-06-04 21:25:48 +00:00
Hosted Weblate
7ff8002387
Merge branch 'origin/master' into Weblate. 2024-05-31 17:50:42 +00:00
mtriau
515d801e58
Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (479 of 479 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/zh_Hans/
2024-05-31 13:09:20 +02:00
ovl-1
b75d805947
Translated using Weblate (Norwegian Bokmål)
Currently translated at 99.5% (477 of 479 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/nb_NO/
2024-05-31 13:09:19 +02:00
Hosted Weblate
ae27b53eb1
Merge branch 'origin/master' into Weblate. 2024-05-29 17:01:57 +00:00
Hosted Weblate
edae24f443
Merge branch 'origin/master' into Weblate. 2024-05-29 18:58:05 +02:00
99 efi
d1dc4251f0
Translated using Weblate (Hungarian)
Currently translated at 100.0% (479 of 479 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/hu/
2024-05-29 08:09:12 +02:00
9 changed files with 57 additions and 23 deletions

View File

@ -168,6 +168,7 @@
<file alias="deviation-dolphin.png">icons/map/marine/deviation-dolphin.png</file>
<file alias="kelp.png">icons/map/marine/kelp.png</file>
<file alias="eddies.png">icons/map/marine/eddies.png</file>
<file alias="dome.png">icons/map/marine/dome.png</file>
</qresource>
<!-- Mapsforge rendertheme -->

BIN
icons/map/marine/dome.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

View File

@ -1870,7 +1870,7 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="645"/>
<source>Lightening:</source>
<translation type="unfinished"></translation>
<translation>Világosítás:</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="702"/>

View File

@ -1033,7 +1033,7 @@
<message>
<location filename="../src/GUI/gui.cpp" line="1961"/>
<source>DEM tiles download limit exceeded. If you really need data for such a huge area, download the files manually.</source>
<translation type="unfinished"></translation>
<translation>Nedlastingsgrensen for DEM-fliser er overskredet. Hvis du virkelig trenger data for et stort område, last ned filene manuelt.</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="1977"/>
@ -1770,7 +1770,7 @@
<location filename="../src/GUI/optionsdialog.cpp" line="265"/>
<location filename="../src/GUI/optionsdialog.cpp" line="628"/>
<source>px</source>
<translation type="unfinished">px</translation>
<translation>px</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="301"/>
@ -1887,7 +1887,7 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="645"/>
<source>Lightening:</source>
<translation type="unfinished"></translation>
<translation>Bleking:</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="702"/>

View File

@ -26,6 +26,7 @@
#define RESTRN 131
#define TRAFIC 172
#define VALDCO 174
#define VERCLR 181
#define WATLEV 187
#define I_CATACH 17000

View File

@ -1,3 +1,4 @@
#include "GUI/units.h"
#include "objects.h"
#include "attributes.h"
#include "mapdata.h"
@ -288,12 +289,20 @@ MapData::Point::Point(uint type, const Coordinates &c, const QString &label,
}
MapData::Poly::Poly(uint type, const Polygon &path,
const QVector<QByteArray> &params) : _type(type), _path(path)
const QVector<QByteArray> &params, uint HUNI) : _type(type), _path(path)
{
if (type == TYPE(DEPARE) && params.size())
_type = SUBTYPE(DEPARE, depthLevel(params.at(0)));
else if (type == TYPE(TSSLPT) && params.size())
_param = QVariant(params.at(0).toDouble());
else if ((type == TYPE(BRIDGE) || type == TYPE(I_BRIDGE))
&& params.size()) {
double clr = params.at(0).toDouble();
if (clr > 0) {
_label = QString::fromUtf8("\xE2\x86\x95") + UNIT_SPACE
+ QString::number(clr) + UNIT_SPACE + hUnits(HUNI);
}
}
}
MapData::Line::Line(uint type, const QVector<Coordinates> &path,
@ -657,6 +666,9 @@ MapData::Attr MapData::polyAttr(const ISO8211::Record &r, uint OBJL)
if ((OBJL == TSSLPT && key == ORIENT)
|| (OBJL == DEPARE && key == DRVAL1))
params[0] = av.at(1).toByteArray();
if ((OBJL == BRIDGE && key == VERCLR)
|| (OBJL == I_BRIDGE && key == VERCLR))
params[0] = av.at(1).toByteArray();
}
return Attr(subtype, label, params);
@ -689,18 +701,18 @@ MapData::Line *MapData::lineObject(const ISO8211::Record &r,
}
MapData::Poly *MapData::polyObject(const ISO8211::Record &r,
const RecordMap &vc, const RecordMap &ve, uint COMF, uint OBJL)
const RecordMap &vc, const RecordMap &ve, uint COMF, uint OBJL, uint HUNI)
{
Polygon path(polyGeometry(r, vc, ve, COMF));
Attr attr(polyAttr(r, OBJL));
return (path.isEmpty() ? 0 : new Poly(SUBTYPE(OBJL, attr.subtype()), path,
attr.params()));
attr.params(), HUNI));
}
bool MapData::processRecord(const ISO8211::Record &record,
QVector<ISO8211::Record> &fe, RecordMap &vi, RecordMap &vc, RecordMap &ve,
RecordMap &vf, uint &COMF, uint &SOMF)
RecordMap &vf, uint &COMF, uint &SOMF, uint &HUNI)
{
if (record.size() < 2)
return false;
@ -735,6 +747,8 @@ bool MapData::processRecord(const ISO8211::Record &record,
} else if (ba == "DSPM") {
if (!(f.subfield("COMF", &COMF) && f.subfield("SOMF", &SOMF)))
return false;
if (!f.subfield("HUNI", &HUNI))
return false;
}
return true;
@ -746,7 +760,7 @@ MapData::MapData(const QString &path)
QVector<ISO8211::Record> fe;
ISO8211 ddf(path);
ISO8211::Record record;
uint PRIM, OBJL, COMF = 1, SOMF = 1;
uint PRIM, OBJL, COMF = 1, SOMF = 1, HUNI = 1;
Poly *poly;
Line *line;
Point *point;
@ -756,7 +770,7 @@ MapData::MapData(const QString &path)
if (!ddf.readDDR())
return;
while (ddf.readRecord(record))
if (!processRecord(record, fe, vi, vc, ve, vf, COMF, SOMF))
if (!processRecord(record, fe, vi, vc, ve, vf, COMF, SOMF, HUNI))
qWarning("Invalid S-57 record");
for (int i = 0; i < fe.size(); i++) {
@ -793,7 +807,7 @@ MapData::MapData(const QString &path)
warning(f, PRIM);
break;
case PRIM_A:
if ((poly = polyObject(r, vc, ve, COMF, OBJL))) {
if ((poly = polyObject(r, vc, ve, COMF, OBJL, HUNI))) {
rectcBounds(poly->bounds(), min, max);
_areas.Insert(min, max, poly);
} else

View File

@ -13,16 +13,19 @@ class MapData
public:
class Poly {
public:
Poly(uint type, const Polygon &path, const QVector<QByteArray> &params);
Poly(uint type, const Polygon &path, const QVector<QByteArray> &params,
uint HUNI);
RectC bounds() const {return _path.boundingRect();}
const Polygon &path() const {return _path;}
uint type() const {return _type;}
const QString &label() const {return _label;}
const QVariant &param() const {return _param;}
private:
uint _type;
Polygon _path;
QString _label;
QVariant _param;
};
@ -121,11 +124,11 @@ private:
static Line *lineObject(const ISO8211::Record &r, const RecordMap &vc,
const RecordMap &ve, uint COMF, uint OBJL);
static Poly *polyObject(const ISO8211::Record &r, const RecordMap &vc,
const RecordMap &ve, uint COMF,uint OBJL);
const RecordMap &ve, uint COMF, uint OBJL, uint HUNI);
static bool processRecord(const ISO8211::Record &record,
QVector<ISO8211::Record> &fe, RecordMap &vi, RecordMap &vc, RecordMap &ve,
RecordMap &vf, uint &COMF, uint &SOMF);
RecordMap &vf, uint &COMF, uint &SOMF, uint &HUNI);
PolygonTree _areas;
LineTree _lines;

View File

@ -241,19 +241,32 @@ void RasterTile::processPolygons(const QList<MapData::Poly> &polygons,
for (int i = 0; i < polygons.size(); i++) {
const MapData::Poly &poly = polygons.at(i);
uint type = poly.type()>>16;
const QImage *img = 0;
const QString *label = 0;
const QFont *fnt = 0;
const QColor *color = 0, *hColor = 0;
if (!(type == HRBFAC || type == I_TRNBSN
|| poly.type() == SUBTYPE(I_BERTHS, 6)))
continue;
if (!poly.label().isEmpty()) {
const Style::Point &style = _style->point(poly.type());
const QImage *img = style.img().isNull() ? 0 : &style.img();
if (!img)
fnt = _style->font(style.textFontSize());
color = &style.textColor();
hColor = style.haloColor().isValid() ? &style.haloColor() : 0;
label = &poly.label();
}
if (type == HRBFAC || type == I_TRNBSN
|| poly.type() == SUBTYPE(I_BERTHS, 6)) {
const Style::Point &style = _style->point(poly.type());
img = style.img().isNull() ? 0 : &style.img();
}
if ((!label || !fnt) && !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))
label, fnt, img, color, hColor, 0, 0);
if (item->isValid() && _rect.contains(item->boundingRect().toRect())
&& !item->collides(textItems))
textItems.append(item);
else
delete item;
@ -379,8 +392,8 @@ void RasterTile::render()
fetchData(polygons, lines, points);
processPolygons(polygons, textItems);
processPoints(points, textItems, lights);
processPolygons(polygons, textItems);
processLines(lines, textItems);
QPainter painter(&img);

View File

@ -235,6 +235,8 @@ void Style::pointStyle(qreal ratio)
_points[SUBTYPE(LNDMRK, 7)] = Point(QImage(":/marine/pylon.png"), Small);
_points[SUBTYPE(LNDMRK, 9)] = Point(QImage(":/marine/monument.png"), Small,
QPoint(0, -7));
_points[SUBTYPE(LNDMRK, 15)] = Point(QImage(":/marine/dome.png"), Small,
QPoint(0, -5));
_points[SUBTYPE(LNDMRK, 17)] = Point(QImage(":/marine/tower.png"), Small,
QPoint(0, -11));
_points[SUBTYPE(LNDMRK, 18)] = Point(QImage(":/marine/windmill.png"), Small);