File indexing completed on 2025-01-26 04:25:02
0001 // 0002 // Created by gabridc on 5/6/21. 0003 // 0004 0005 #pragma once 0006 #include <QObject> 0007 #include <QString> 0008 0009 #include "imagetools_export.h" 0010 0011 /** 0012 * @brief A class for representing the GPS coordinates and information of a city. 0013 */ 0014 class IMAGETOOLS_EXPORT City : public QObject 0015 { 0016 Q_OBJECT 0017 0018 public: 0019 explicit City(const QString &cityID, const QString &name, const QString &continent, const QString &country, const double &latitude, const double &longitude, QObject *parent = nullptr); 0020 0021 explicit City(QObject *parent = nullptr); 0022 0023 bool match(double latitude, double longitude); 0024 0025 int operator==(City c) 0026 { 0027 if(m_cityID == c.m_cityID) 0028 return 1; 0029 else 0030 return 0; 0031 } 0032 0033 QString id() const; 0034 QString name() const; 0035 QString country() const; 0036 QString continent() const; 0037 0038 bool isValid() const; 0039 0040 private: 0041 QString m_cityID; 0042 QString m_name; 0043 QString m_continent; 0044 QString m_country; 0045 double m_latitude; 0046 double m_longitude; 0047 };