1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-06 23:03:22 +02:00
GPXSee/src/map/ellipsoid.h

41 lines
898 B
C
Raw Normal View History

#ifndef ELLIPSOID_H
#define ELLIPSOID_H
2018-01-08 23:47:45 +01:00
#include <cmath>
#include <QString>
#include <QMap>
2018-01-08 23:47:45 +01:00
#include <QDebug>
class Ellipsoid
{
public:
2018-01-08 23:47:45 +01:00
Ellipsoid() : _radius(NAN), _flattening(NAN) {}
Ellipsoid(double radius, double flattening)
: _radius(radius), _flattening(flattening) {}
2018-01-08 23:47:45 +01:00
Ellipsoid(int id);
double radius() const {return _radius;}
double flattening() const {return _flattening;}
2018-01-08 23:47:45 +01:00
bool isNull() const
{return (std::isnan(_radius) && std::isnan(_flattening));}
static bool loadList(const QString &path);
static const QString &errorString() {return _errorString;}
static int errorLine() {return _errorLine;}
private:
2018-01-09 23:19:35 +01:00
static void error(const QString &str);
double _radius;
double _flattening;
static QMap<int, Ellipsoid> _ellipsoids;
static QString _errorString;
static int _errorLine;
};
2018-01-08 23:47:45 +01:00
QDebug operator<<(QDebug dbg, const Ellipsoid &ellipsoid);
#endif // ELLIPSOID_H