1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-14 19:04:23 +02:00

Added coordinates checking to file parsers

Refactoring
This commit is contained in:
2016-10-24 00:21:40 +02:00
parent 375ef20592
commit 27194d3d36
28 changed files with 288 additions and 221 deletions

View File

@ -1,22 +1,28 @@
#include <QPainter>
#include "config.h"
#include "ll.h"
#include "rd.h"
#include "wgs84.h"
#include "tile.h"
#include "misc.h"
#include "scaleitem.h"
#define BORDER_WIDTH 1
#define SCALE_WIDTH 132
#define SCALE_HEIGHT 5
#define SEGMENTS 3
#define PADDING 4
#define SCALE_WIDTH 132
#define SCALE_HEIGHT 5
#define SEGMENTS 3
#define PADDING 4
static qreal zoom2resolution(int zoom, qreal y)
{
return (WGS84_RADIUS * 2 * M_PI / Tile::size()
* cos(2 * atan(exp(deg2rad(y))) - M_PI/2)) / pow(2.0, zoom);
}
ScaleItem::ScaleItem(QGraphicsItem *parent) : QGraphicsItem(parent)
{
_units = Metric;
_zoom = ZOOM_MIN;
_zoom = 0;
_lat = 0;
#ifndef Q_OS_MAC