SphereCalculus.h 1.33 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
#ifndef SphereCalculus_H
#define SphereCalculus_H

#include <QObject>
#include <QGeoCoordinate>
#include <QPointF>
#include <QLineF>

#include "QGCGeo.h"

// Abstract class providing methods to do calculations on objects located on a sphere (e.g. earth)
class SphereCalculus : public QObject
{
    Q_OBJECT
public:
    SphereCalculus(QObject *parent = nullptr);
    SphereCalculus(const SphereCalculus &other, QObject *parent = nullptr);
    SphereCalculus &operator=(const SphereCalculus &other);

    typedef QPair<QGeoCoordinate, QGeoCoordinate> Line;


    enum JoinPolygonError { NotSimplePolygon1, PolygonJoined, NotSimplePolygon2, Disjoint, PathSizeLow};
    enum IntersectionType { NoIntersection, EdgeIntersection, InteriorIntersection, Error};
    enum DijkstraError    { NoPathFound, PathFound, NotSimplePolygon};

    // Property setters
    void setEpsilonMeter(double epsilon);

    // Property getters
    double epsilonMeter() const;

    // Member Methodes
34 35


36 37
    DijkstraError           dijkstraPath        (const QList<QGeoCoordinate> &polygon, const QGeoCoordinate& start,
                                                    const QGeoCoordinate& end, QList<QGeoCoordinate>& dijkstraPath);
38

39 40 41 42 43 44 45 46



signals:

public slots:

private:
47

48 49 50 51 52 53

    double _epsilonMeter; // The accuracy used for distance calculations (unit: m).

};

#endif // SphereCalculus_H