mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-04-20 04:09:11 +02:00
Compare commits
4 Commits
b9fb9eece3
...
71a757983f
Author | SHA1 | Date | |
---|---|---|---|
71a757983f | |||
cc7209ad70 | |||
ba49497608 | |||
48404ea43b |
@ -216,8 +216,8 @@ void RasterTile::drawTextItems(QPainter *painter,
|
|||||||
|
|
||||||
static QRectF lightRect(const QPointF &pos, double range)
|
static QRectF lightRect(const QPointF &pos, double range)
|
||||||
{
|
{
|
||||||
return QRectF(pos.x() - range * RANGE_FACTOR, pos.y() - range * RANGE_FACTOR,
|
double r = qMin(range * RANGE_FACTOR, (double)TEXT_EXTENT);
|
||||||
2*range * RANGE_FACTOR, 2*range * RANGE_FACTOR);
|
return QRect(pos.x() - r, pos.y() - r, 2 * r, 2 * r);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RasterTile::drawSectorLights(QPainter *painter,
|
void RasterTile::drawSectorLights(QPainter *painter,
|
||||||
|
@ -26,31 +26,6 @@ using namespace IMG;
|
|||||||
#define AREA(rect) \
|
#define AREA(rect) \
|
||||||
(rect.size().width() * rect.size().height())
|
(rect.size().width() * rect.size().height())
|
||||||
|
|
||||||
struct Sector
|
|
||||||
{
|
|
||||||
Sector(Light::Color color, quint32 start, quint32 end)
|
|
||||||
: color(color), start(start), end(end) {}
|
|
||||||
|
|
||||||
bool operator==(const Sector &other) const
|
|
||||||
{
|
|
||||||
return (color == other.color && start == other.start && end == other.end);
|
|
||||||
}
|
|
||||||
bool operator<(const Sector &other) const
|
|
||||||
{
|
|
||||||
if (color == other.color) {
|
|
||||||
if (start == other.start)
|
|
||||||
return end < other.end;
|
|
||||||
else
|
|
||||||
return start < other.start;
|
|
||||||
} else
|
|
||||||
return color < other.color;
|
|
||||||
}
|
|
||||||
|
|
||||||
Light::Color color;
|
|
||||||
quint32 start;
|
|
||||||
quint32 end;
|
|
||||||
};
|
|
||||||
|
|
||||||
static const QColor textColor(Qt::black);
|
static const QColor textColor(Qt::black);
|
||||||
static const QColor haloColor(Qt::white);
|
static const QColor haloColor(Qt::white);
|
||||||
static const QColor shieldColor(Qt::white);
|
static const QColor shieldColor(Qt::white);
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
#include "style.h"
|
#include "style.h"
|
||||||
|
|
||||||
class QPainter;
|
class QPainter;
|
||||||
class IMGMap;
|
|
||||||
class TextItem;
|
class TextItem;
|
||||||
|
|
||||||
namespace IMG {
|
namespace IMG {
|
||||||
@ -32,23 +31,30 @@ public:
|
|||||||
void render();
|
void render();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef RTree<const MapData::Elevation*, double, 2> DEMTRee;
|
struct Sector
|
||||||
|
|
||||||
struct ElevationCTX
|
|
||||||
{
|
{
|
||||||
ElevationCTX(const DEMTRee &tree, const Coordinates &c, double &ele)
|
Sector(Light::Color color, quint32 start, quint32 end)
|
||||||
: tree(tree), c(c), ele(ele) {}
|
: color(color), start(start), end(end) {}
|
||||||
|
|
||||||
const DEMTRee &tree;
|
bool operator==(const Sector &other) const
|
||||||
const Coordinates &c;
|
|
||||||
double &ele;
|
|
||||||
};
|
|
||||||
struct EdgeCTX
|
|
||||||
{
|
{
|
||||||
EdgeCTX(const Coordinates &c, double &ele) : c(c), ele(ele) {}
|
return (color == other.color && start == other.start
|
||||||
|
&& end == other.end);
|
||||||
|
}
|
||||||
|
bool operator<(const Sector &other) const
|
||||||
|
{
|
||||||
|
if (color == other.color) {
|
||||||
|
if (start == other.start)
|
||||||
|
return end < other.end;
|
||||||
|
else
|
||||||
|
return start < other.start;
|
||||||
|
} else
|
||||||
|
return color < other.color;
|
||||||
|
}
|
||||||
|
|
||||||
const Coordinates &c;
|
Light::Color color;
|
||||||
double &ele;
|
quint32 start;
|
||||||
|
quint32 end;
|
||||||
};
|
};
|
||||||
|
|
||||||
void fetchData(QList<MapData::Poly> &polygons, QList<MapData::Poly> &lines,
|
void fetchData(QList<MapData::Poly> &polygons, QList<MapData::Poly> &lines,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user