mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-30 22:51:16 +01:00
Code cleanup
This commit is contained in:
parent
dcf45475ba
commit
e07e109c7d
@ -302,17 +302,17 @@ void RasterTile::processPolygons(const QList<MapData::Poly> &polygons,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RasterTile::processLines(QList<MapData::Poly> &lines,
|
void RasterTile::processLines(QList<MapData::Poly> &lines,
|
||||||
QList<TextItem*> &textItems, const QImage &arrow, const QImage &waterArrow)
|
QList<TextItem*> &textItems, const QImage (&arrows)[2])
|
||||||
{
|
{
|
||||||
std::stable_sort(lines.begin(), lines.end());
|
std::stable_sort(lines.begin(), lines.end());
|
||||||
|
|
||||||
if (_zoom >= 22)
|
if (_zoom >= 22)
|
||||||
processStreetNames(lines, textItems, arrow, waterArrow);
|
processStreetNames(lines, textItems, arrows);
|
||||||
processShields(lines, textItems);
|
processShields(lines, textItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RasterTile::processStreetNames(const QList<MapData::Poly> &lines,
|
void RasterTile::processStreetNames(const QList<MapData::Poly> &lines,
|
||||||
QList<TextItem*> &textItems, const QImage &arrow, const QImage &waterArrow)
|
QList<TextItem*> &textItems, const QImage (&arrows)[2])
|
||||||
{
|
{
|
||||||
for (int i = 0; i < lines.size(); i++) {
|
for (int i = 0; i < lines.size(); i++) {
|
||||||
const MapData::Poly &poly = lines.at(i);
|
const MapData::Poly &poly = lines.at(i);
|
||||||
@ -327,7 +327,7 @@ void RasterTile::processStreetNames(const QList<MapData::Poly> &lines,
|
|||||||
const QColor *hColor = Style::isContourLine(poly.type) ? 0 : &haloColor;
|
const QColor *hColor = Style::isContourLine(poly.type) ? 0 : &haloColor;
|
||||||
const QImage *img = poly.oneway
|
const QImage *img = poly.oneway
|
||||||
? Style::isWaterLine(poly.type)
|
? Style::isWaterLine(poly.type)
|
||||||
? &waterArrow : &arrow : 0;
|
? &arrows[1] : &arrows[0] : 0;
|
||||||
const QString *label = poly.label.text().isEmpty()
|
const QString *label = poly.label.text().isEmpty()
|
||||||
? 0 : &poly.label.text();
|
? 0 : &poly.label.text();
|
||||||
|
|
||||||
@ -477,9 +477,11 @@ void RasterTile::render()
|
|||||||
QList<MapData::Poly> lines;
|
QList<MapData::Poly> lines;
|
||||||
QList<MapData::Point> points;
|
QList<MapData::Point> points;
|
||||||
QList<TextItem*> textItems;
|
QList<TextItem*> textItems;
|
||||||
QImage arrow = (_ratio >= 2)
|
QImage arrows[2];
|
||||||
|
|
||||||
|
arrows[0] = (_ratio >= 2)
|
||||||
? QImage(":/map/arrow@2x.png") : QImage(":/map/arrow.png");
|
? QImage(":/map/arrow@2x.png") : QImage(":/map/arrow.png");
|
||||||
QImage waterArrow = (_ratio >= 2)
|
arrows[1] = (_ratio >= 2)
|
||||||
? QImage(":/map/water-arrow@2x.png") : QImage(":/map/water-arrow.png");
|
? QImage(":/map/water-arrow@2x.png") : QImage(":/map/water-arrow.png");
|
||||||
|
|
||||||
fetchData(polygons, lines, points);
|
fetchData(polygons, lines, points);
|
||||||
@ -489,7 +491,7 @@ void RasterTile::render()
|
|||||||
|
|
||||||
processPoints(points, textItems);
|
processPoints(points, textItems);
|
||||||
processPolygons(polygons, textItems);
|
processPolygons(polygons, textItems);
|
||||||
processLines(lines, textItems, arrow, waterArrow);
|
processLines(lines, textItems, arrows);
|
||||||
|
|
||||||
_pixmap.setDevicePixelRatio(_ratio);
|
_pixmap.setDevicePixelRatio(_ratio);
|
||||||
_pixmap.fill(Qt::transparent);
|
_pixmap.fill(Qt::transparent);
|
||||||
|
@ -44,14 +44,14 @@ private:
|
|||||||
|
|
||||||
void processPolygons(const QList<MapData::Poly> &polygons,
|
void processPolygons(const QList<MapData::Poly> &polygons,
|
||||||
QList<TextItem *> &textItems);
|
QList<TextItem *> &textItems);
|
||||||
void processLines(QList<MapData::Poly> &lines,
|
void processLines(QList<MapData::Poly> &lines, QList<TextItem*> &textItems,
|
||||||
QList<TextItem*> &textItems, const QImage &arrow, const QImage &waterArrow);
|
const QImage (&arrows)[2]);
|
||||||
void processPoints(QList<MapData::Point> &points,
|
void processPoints(QList<MapData::Point> &points,
|
||||||
QList<TextItem*> &textItems);
|
QList<TextItem*> &textItems);
|
||||||
void processShields(const QList<MapData::Poly> &lines,
|
void processShields(const QList<MapData::Poly> &lines,
|
||||||
QList<TextItem*> &textItems);
|
QList<TextItem*> &textItems);
|
||||||
void processStreetNames(const QList<MapData::Poly> &lines,
|
void processStreetNames(const QList<MapData::Poly> &lines,
|
||||||
QList<TextItem*> &textItems, const QImage &arrow, const QImage &waterArrow);
|
QList<TextItem*> &textItems, const QImage (&arrows)[2]);
|
||||||
|
|
||||||
Projection _proj;
|
Projection _proj;
|
||||||
Transform _transform;
|
Transform _transform;
|
||||||
|
Loading…
Reference in New Issue
Block a user