1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-27 21:24:47 +01:00

Compare commits

..

4 Commits

Author SHA1 Message Date
2234245e81 Extend obstruction info 2022-04-03 21:20:21 +02:00
681de81b1c Version++ 2022-04-03 18:52:33 +02:00
a5ae41f8ad Added pile symbol 2022-04-03 18:51:15 +02:00
576a063dcb Added support for depth points 2022-04-03 18:21:26 +02:00
8 changed files with 59 additions and 4 deletions

View File

@ -1,4 +1,4 @@
version: 10.5.{build}
version: 10.6.{build}
configuration:
- Release

View File

@ -3,7 +3,7 @@ unix:!macx {
} else {
TARGET = GPXSee
}
VERSION = 10.5
VERSION = 10.6
QT += core \
gui \

View File

@ -155,6 +155,7 @@
<file alias="church.png">icons/IMG/marine/church.png</file>
<file alias="triangulation-point.png">icons/IMG/marine/triangulation-point.png</file>
<file alias="yacht-harbor.png">icons/IMG/marine/yacht-harbor.png</file>
<file alias="pile.png">icons/IMG/marine/pile.png</file>
</qresource>
<!-- Mapsforge rendertheme -->

BIN
icons/IMG/marine/pile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

View File

@ -37,7 +37,7 @@ Unicode true
; The name of the installer
Name "GPXSee"
; Program version
!define VERSION "10.5"
!define VERSION "10.6"
; The file to write
OutFile "GPXSee-${VERSION}_x64.exe"

View File

@ -27,6 +27,11 @@ static quint64 pointId(const QPoint &pos, quint32 type, quint32 labelPtr)
return id;
}
static double d2m(quint32 val, quint32 flags)
{
return (flags & 1) ? val / 10.0 : val;
}
RGNFile::~RGNFile()
{
delete _huffmanTable;
@ -81,7 +86,48 @@ bool RGNFile::readClassFields(Handle &hdl, SegmentType segmentType,
bottom)));
}
if (point && (flags & 1) && lbl) {
if (point && Style::isDepthPoint(point->type)) {
quint32 depth = 0;
quint32 units = (flags >> 3) & 3;
if (rs == 0) {
depth = flags & 0x3f;
units = (flags >> 5) & 2;
} else if (rs == 1) {
quint32 val;
if (!readUInt8(hdl, val))
return false;
depth = val | ((quint32)flags & 7) << 8;
} else if (rs < 4) {
quint32 val;
Q_ASSERT(!(flags & 4));
if (!readVUInt32(hdl, rs, val))
return false;
depth = val | ((quint32)flags & 3) << (rs * 8);
}
if (depth)
point->label = QString::number(d2m(depth, units));
}
if (point && Style::isObstructionPoint(point->type) && rs) {
quint32 val, rb = rs;
quint32 units = (flags >> 3) & 3;
if ((flags & 7) == 7) {
if (!readUInt8(hdl, val))
return false;
rb--;
}
if (!readVUInt32(hdl, rb, val))
return false;
point->label = QString::number(d2m(val, units));
}
if (point && !Style::isMarinePoint(point->type) && (flags & 1) && lbl) {
point->label = lbl->label(lblHdl, this, hdl, rs);
point->classLabel = true;
}

View File

@ -519,6 +519,7 @@ void Style::defaultPointStyle()
_points[0x10215] = Point(QImage(":/IMG/beacon.png"));
_points[0x10306] = Point(QImage(":/IMG/church.png"));
_points[0x1030a] = Point(QImage(":/IMG/triangulation-point.png"));
_points[0x10400] = Point(QImage(":/IMG/obstruction.png"));
_points[0x10401] = Point(QImage(":/IMG/obstruction.png"));
_points[0x10402] = Point(QImage(":/IMG/wreck.png"));
_points[0x10403] = Point(QImage(":/IMG/wreck-exposed.png"));
@ -527,6 +528,7 @@ void Style::defaultPointStyle()
_points[0x1040c] = Point(QImage(":/IMG/rock-exposed.png"));
_points[0x10701] = Point(QImage(":/IMG/anchorage.png"));
_points[0x10703] = Point(QImage(":/IMG/yacht-harbor.png"));
_points[0x10704] = Point(QImage(":/IMG/pile.png"));
_points[0x10705] = Point(QImage(":/IMG/anchoring-prohibited.png"));
}

View File

@ -119,6 +119,12 @@ public:
{return (type == TYPE(0x1e));}
static bool isRaster(quint32 type)
{return (type == 0x10613);}
static bool isDepthPoint(quint32 type)
{return (type == 0x10301);}
static bool isObstructionPoint(quint32 type)
{return (type >= 0x10400 && type <= 0x10401);}
static bool isMarinePoint(quint32 type)
{return type >= 0x10100 && type < 0x10a00;}
private:
struct Section {