2017-04-03 20:29:35 +02:00
|
|
|
#ifndef ELLIPSOID_H
|
|
|
|
#define ELLIPSOID_H
|
|
|
|
|
2018-01-08 23:47:45 +01:00
|
|
|
#include <cmath>
|
2017-04-17 18:03:04 +02:00
|
|
|
#include <QString>
|
|
|
|
#include <QMap>
|
2018-01-08 23:47:45 +01:00
|
|
|
#include <QDebug>
|
2017-04-17 18:03:04 +02:00
|
|
|
|
2017-04-03 20:29:35 +02:00
|
|
|
class Ellipsoid
|
|
|
|
{
|
|
|
|
public:
|
2018-01-08 23:47:45 +01:00
|
|
|
Ellipsoid() : _radius(NAN), _flattening(NAN) {}
|
2017-04-17 18:03:04 +02:00
|
|
|
Ellipsoid(double radius, double flattening)
|
|
|
|
: _radius(radius), _flattening(flattening) {}
|
2018-01-08 23:47:45 +01:00
|
|
|
Ellipsoid(int id);
|
2017-04-03 20:29:35 +02:00
|
|
|
|
|
|
|
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));}
|
2017-04-17 18:03:04 +02:00
|
|
|
|
|
|
|
static bool loadList(const QString &path);
|
|
|
|
static const QString &errorString() {return _errorString;}
|
|
|
|
static int errorLine() {return _errorLine;}
|
|
|
|
|
2017-04-03 20:29:35 +02:00
|
|
|
private:
|
|
|
|
double _radius;
|
|
|
|
double _flattening;
|
2017-04-17 18:03:04 +02:00
|
|
|
|
|
|
|
static QMap<int, Ellipsoid> _ellipsoids;
|
|
|
|
static QString _errorString;
|
|
|
|
static int _errorLine;
|
2017-04-03 20:29:35 +02:00
|
|
|
};
|
|
|
|
|
2018-01-08 23:47:45 +01:00
|
|
|
QDebug operator<<(QDebug dbg, const Ellipsoid &ellipsoid);
|
|
|
|
|
2017-04-03 20:29:35 +02:00
|
|
|
#endif // ELLIPSOID_H
|