mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-02-17 16:20:48 +01:00
Properly encapsulate the ENC-specific text point
This commit is contained in:
parent
8b24aa17e2
commit
981bd33680
@ -2,31 +2,16 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include "common/linec.h"
|
#include "common/linec.h"
|
||||||
#include "map/bitmapline.h"
|
#include "map/bitmapline.h"
|
||||||
#include "map/textpointitem.h"
|
|
||||||
#include "map/textpathitem.h"
|
#include "map/textpathitem.h"
|
||||||
#include "style.h"
|
#include "style.h"
|
||||||
#include "rastertile.h"
|
#include "rastertile.h"
|
||||||
|
|
||||||
using namespace ENC;
|
using namespace ENC;
|
||||||
|
|
||||||
#define ICON_PADDING 2
|
|
||||||
#define TSSLPT_SIZE 0.005 /* ll */
|
#define TSSLPT_SIZE 0.005 /* ll */
|
||||||
#define RDOCAL_SIZE 12 /* px */
|
#define RDOCAL_SIZE 12 /* px */
|
||||||
#define CURENT_SIZE 12 /* px */
|
#define CURENT_SIZE 12 /* px */
|
||||||
|
|
||||||
class PointItem : public TextPointItem
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
PointItem(const QPoint &point, const QString *text, const QFont *font,
|
|
||||||
const QImage *img, const QImage *rimg, const QColor *color,
|
|
||||||
const QColor *haloColor) : TextPointItem(point, text, font, img, color,
|
|
||||||
haloColor, 0, ICON_PADDING), _rimg(rimg) {}
|
|
||||||
~PointItem() {delete _rimg;}
|
|
||||||
|
|
||||||
private:
|
|
||||||
const QImage *_rimg;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef QMap<Coordinates, const MapData::Point*> PointMap;
|
typedef QMap<Coordinates, const MapData::Point*> PointMap;
|
||||||
|
|
||||||
const float C1 = 0.866025f; /* sqrt(3)/2 */
|
const float C1 = 0.866025f; /* sqrt(3)/2 */
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include "map/projection.h"
|
#include "map/projection.h"
|
||||||
#include "map/transform.h"
|
#include "map/transform.h"
|
||||||
|
#include "map/textpointitem.h"
|
||||||
#include "mapdata.h"
|
#include "mapdata.h"
|
||||||
|
|
||||||
class TextItem;
|
class TextItem;
|
||||||
@ -30,6 +31,19 @@ public:
|
|||||||
void render();
|
void render();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
class PointItem : public TextPointItem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PointItem(const QPoint &point, const QString *text, const QFont *font,
|
||||||
|
const QImage *img, const QImage *rimg, const QColor *color,
|
||||||
|
const QColor *haloColor) : TextPointItem(point, text, font, img, color,
|
||||||
|
haloColor, 0, 2), _rimg(rimg) {}
|
||||||
|
~PointItem() {delete _rimg;}
|
||||||
|
|
||||||
|
private:
|
||||||
|
const QImage *_rimg;
|
||||||
|
};
|
||||||
|
|
||||||
QPointF ll2xy(const Coordinates &c) const
|
QPointF ll2xy(const Coordinates &c) const
|
||||||
{return _transform.proj2img(_proj.ll2xy(c));}
|
{return _transform.proj2img(_proj.ll2xy(c));}
|
||||||
QPainterPath painterPath(const Polygon &polygon) const;
|
QPainterPath painterPath(const Polygon &polygon) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user