1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-06-28 12:09:15 +02:00

Use the polygons labels for displaying rather than discarding them

This commit is contained in:
2020-01-22 21:01:05 +01:00
parent ae2ff99be8
commit ce6d6298bb
6 changed files with 93 additions and 12 deletions

View File

@ -118,7 +118,7 @@ bool RGNFile::init(Handle &hdl)
bool RGNFile::polyObjects(const RectC &rect, Handle &hdl, const SubDiv *subdiv,
const Segment &segment, LBLFile *lbl, Handle &lblHdl, NETFile *net,
Handle &netHdl, QList<IMG::Poly> *polys, bool line) const
Handle &netHdl, QList<IMG::Poly> *polys) const
{
if (!seek(hdl, segment.start()))
return false;
@ -172,7 +172,7 @@ bool RGNFile::polyObjects(const RectC &rect, Handle &hdl, const SubDiv *subdiv,
if (!rect.intersects(br))
continue;
if (line && lbl && (labelPtr & 0x3FFFFF)) {
if (lbl && (labelPtr & 0x3FFFFF)) {
if (labelPtr & 0x800000) {
quint32 lblOff;
if (net && net->lblOffset(netHdl, labelPtr & 0x3FFFFF, lblOff)
@ -278,7 +278,7 @@ bool RGNFile::extPolyObjects(const RectC &rect, Handle &hdl,
if (!rect.intersects(br))
continue;
if (line && lbl && (labelPtr & 0x3FFFFF))
if (lbl && (labelPtr & 0x3FFFFF))
poly.label = lbl->label(lblHdl, labelPtr & 0x3FFFFF);
polys->append(poly);
@ -409,12 +409,12 @@ void RGNFile::objects(const RectC &rect, const SubDiv *subdiv,
case Segment::Line:
if (lines)
polyObjects(rect, rgnHdl, subdiv, segment, lbl, lblHdl, net,
netHdl, lines, true);
netHdl, lines);
break;
case Segment::Polygon:
if (polygons)
polyObjects(rect, rgnHdl, subdiv, segment, lbl, lblHdl, net,
netHdl, polygons, false);
netHdl, polygons);
break;
case Segment::RoadReference:
break;

View File

@ -62,7 +62,7 @@ private:
QVector<Segment> segments(Handle &hdl, const SubDiv *subdiv) const;
bool polyObjects(const RectC &rect, Handle &hdl, const SubDiv *subdiv,
const Segment &segment, LBLFile *lbl, Handle &lblHdl, NETFile *net,
Handle &netHdl, QList<IMG::Poly> *polys, bool line) const;
Handle &netHdl, QList<IMG::Poly> *polys) const;
bool pointObjects(const RectC &rect, Handle &hdl, const SubDiv *subdiv,
const Segment &segment, LBLFile *lbl, Handle &lblHdl,
QList<IMG::Point> *points) const;

View File

@ -33,7 +33,7 @@ void Style::defaultPolygonStyle()
Qt::BDiagPattern));
_polygons[TYPE(0x17)] = Style::Polygon(QBrush("#d4ebb8"));
_polygons[TYPE(0x18)] = Style::Polygon(QBrush("#d4ebb8"));
_polygons[TYPE(0x19)] = Style::Polygon(QBrush("#d6d4ce"));
_polygons[TYPE(0x19)] = Style::Polygon(QBrush("#e3edc6"), QPen("#c9d3a5"));
_polygons[TYPE(0x1a)] = Style::Polygon(QBrush("#000000", Qt::Dense6Pattern),
QPen(QColor("#cdccc4"), 1));
_polygons[TYPE(0x1e)] = Style::Polygon(QBrush(QColor("#9ac269"),
@ -980,6 +980,22 @@ bool Style::isContourLine(quint32 type)
|| (type & 0xffff00) == TYPE(0x109));
}
bool Style::isWaterArea(quint32 type)
{
return (type >= TYPE(0x3c) && type <= TYPE(0x44));
}
bool Style::isMilitaryArea(quint32 type)
{
return (type == TYPE(0x04));
}
bool Style::isInfrastructureArea(quint32 type)
{
return ((type >= TYPE(0x07) && type <= TYPE(0xc)) || type == TYPE(0x13)
|| type == TYPE(0x1a) || type == TYPE(0x19));
}
bool Style::isSpot(quint32 type)
{
return (type == TYPE(0x62) || type == TYPE(0x63));

View File

@ -47,6 +47,7 @@ public:
private:
QBrush _brush;
QPen _pen;
QColor _textColor;
};
class Line {
@ -109,6 +110,9 @@ public:
static bool isSpot(quint32 type);
static bool isSummit(quint32 type);
static bool isMajorRoad(quint32 type);
static bool isWaterArea(quint32 type);
static bool isMilitaryArea(quint32 type);
static bool isInfrastructureArea(quint32 type);
static POIClass poiClass(quint32 type);
private: