Unit tests for converting GeoCoordinate to SceneCoordinate
[situare] / src / coordinates / geocoordinate.h
1 /*
2     Situare - A location system for Facebook
3     Copyright (C) 2010  Ixonos Plc. Authors:
4
5         Sami Rämö - sami.ramo@ixonos.com
6
7     Situare is free software; you can redistribute it and/or
8     modify it under the terms of the GNU General Public License
9     version 2 as published by the Free Software Foundation.
10
11     Situare is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with Situare; if not, write to the Free Software
18     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
19     USA.
20 */
21
22
23 #ifndef GEOCOORDINATE_H
24 #define GEOCOORDINATE_H
25
26 #include <QDebug>
27 #include <QMetaType>
28
29 /**
30 * @brief Geographic coordinate
31 *
32 * @author Sami Rämö - sami.ramo@ixonos.com
33 */
34 class GeoCoordinate
35 {
36 public:
37     /**
38     * @brief Constructs a null coordinate
39     */
40     GeoCoordinate();
41
42     /**
43     * @brief Constructs a coordinate with given latitude and longitude values
44     *
45     * @param latitude Latitude value
46     * @param longitude Longitude value
47     */
48     GeoCoordinate(double latitude, double longitude);
49
50     /**
51     * @brief Check if coordinate is (0.0, 0.0)
52     *
53     * @returns True if both latitude and longitude are 0.0, otherwise false
54     */
55     bool isNull() const;
56
57     /**
58     * @brief Returns the latitude value
59     *
60     * @returns latitude
61     */
62     double latitude() const;
63
64     /**
65     * @brief Returns the longitude value
66     *
67     * @returns longitude
68     */
69     double longitude() const;
70
71     /**
72     * @brief Sets the latitude
73     *
74     * @param latitude Latitude value
75     */
76     void setLatitude(double latitude);
77
78     /**
79     * @brief Sets the longitude
80     *
81     * @param longitude Longitude value
82     */
83     void setLongitude(double longitude);
84
85 private:
86     double m_latitude;      ///< Latitude value
87     double m_longitude;     ///< Longitude value
88 };
89
90 QDebug operator<<(QDebug dbg, const GeoCoordinate &c);
91
92 Q_DECLARE_METATYPE(GeoCoordinate)
93
94 #endif // GEOCOORDINATE_H