#ifndef RASTERTILE_H #define RASTERTILE_H #include #include "mapdata.h" class QPainter; class TextItem; class Style; class RasterTile { public: RasterTile(const Style *style, int zoom, const QRect &rect, const QString &key, const QList &polygons, const QList &lines, QList &points) : _style(style), _zoom(zoom), _xy(rect.topLeft()), _key(key), _img(rect.size(), QImage::Format_ARGB32_Premultiplied), _polygons(polygons), _lines(lines), _points(points) {} const QString &key() const {return _key;} const QPoint &xy() const {return _xy;} const QImage &img() const {return _img;} void render(); private: void drawPolygons(QPainter *painter); void drawLines(QPainter *painter); void drawTextItems(QPainter *painter, const QList &textItems); void processPolygons(QList &textItems); void processLines(QList &textItems); void processPoints(QList &textItems); void processShields(const QRect &tileRect, QList &textItems); void processStreetNames(const QRect &tileRect, QList &textItems); const Style *_style; int _zoom; QPoint _xy; QString _key; QImage _img; QList _polygons; QList _lines; QList _points; }; #endif // RASTERTILE_H