File indexing completed on 2024-05-05 04:22:10
0001 // SPDX-FileCopyrightText: 2018-2019 The KPhotoAlbum Development Team 0002 // SPDX-FileCopyrightText: 2021 Johannes Zarl-Zierl <johannes@zarl-zierl.at> 0003 // SPDX-FileCopyrightText: 2022 Johannes Zarl-Zierl <johannes@zarl-zierl.at> 0004 // 0005 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0006 0007 #ifndef GEOCOORDINATES_H 0008 #define GEOCOORDINATES_H 0009 0010 #include <QString> 0011 0012 namespace Marble 0013 { 0014 class GeoDataLatLonBox; 0015 } 0016 namespace Map 0017 { 0018 0019 class GeoCoordinates 0020 { 0021 0022 public: 0023 bool hasCoordinates() const; 0024 double lon() const; 0025 double lat() const; 0026 double alt() const; 0027 bool hasAltitude() const; 0028 void setLatLon(const double lat, const double lon); 0029 void setAlt(const double alt); 0030 0031 struct LatLonBox { 0032 LatLonBox() = default; 0033 LatLonBox(double north, double south, double east, double west); 0034 explicit LatLonBox(const Marble::GeoDataLatLonBox &box); 0035 bool isNull() const; 0036 operator QString() const; 0037 bool contains(const GeoCoordinates &point) const; 0038 double north = 0; 0039 double south = 0; 0040 double east = 0; 0041 double west = 0; 0042 }; 0043 0044 operator QString() const; 0045 0046 private: // Variables 0047 double m_lat = 0; 0048 double m_lon = 0; 0049 double m_alt = 0; 0050 bool m_hasCoordinates = false; 0051 bool m_hasAlt = false; 0052 }; 0053 0054 } 0055 0056 #endif // GEOCOORDINATES_H 0057 0058 // vi:expandtab:tabstop=4 shiftwidth=4: