2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Jussi Laitinen - jussi.laitinen@ixonos.com
6 Sami Rämö - sami.ramo@ixonos.com
8 Situare is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 version 2 as published by the Free Software Foundation.
12 Situare is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Situare; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
24 #ifndef GEOCOORDINATE_H
25 #define GEOCOORDINATE_H
30 class SceneCoordinate;
33 * @brief Geographic coordinate
35 * @author Jussi Laitinen - jussi.laitinen@ixonos.com
36 * @author Sami Rämö - sami.ramo@ixonos.com
42 * @brief Constructs a null coordinate
47 * @brief Constructs a coordinate with given latitude and longitude values
49 * @param latitude Latitude value
50 * @param longitude Longitude value
52 GeoCoordinate(double latitude, double longitude);
55 * @brief Constructs a coordinate with values converted from the given SceneCoordinate
57 * @param coordinate Scene coordinate
59 GeoCoordinate(const SceneCoordinate &coordinate);
61 /*******************************************************************************
62 * MEMBER FUNCTIONS AND SLOTS
63 ******************************************************************************/
66 * @brief Check if coordinate is (0.0, 0.0)
68 * @returns True if both latitude and longitude are 0.0, otherwise false
73 * @brief Check if coordinate is valid.
75 * Latitude must be -90..90 and longitude must be -180..180 for valid coordinate.
77 * @return true if coordinate is valid, false otherwise
82 * @brief Returns the latitude value
86 double latitude() const;
89 * @brief Returns the longitude value
93 double longitude() const;
96 * @brief Sets the latitude
98 * @param latitude Latitude value
100 void setLatitude(double latitude);
103 * @brief Sets the longitude
105 * @param longitude Longitude value
107 void setLongitude(double longitude);
111 * @brief Convert values from SceneCoordinate
113 * @param coordinate Scene coordinate
115 void convertFrom(const SceneCoordinate &coordinate);
117 /*******************************************************************************
119 ******************************************************************************/
121 double m_latitude; ///< Latitude value
122 double m_longitude; ///< Longitude value
124 /*******************************************************************************
126 ******************************************************************************/
128 friend QDataStream &operator<<(QDataStream &out, const GeoCoordinate &coordinate);
129 friend QDataStream &operator>>(QDataStream &in, GeoCoordinate &coordinate);
132 QDebug operator<<(QDebug dbg, const GeoCoordinate &coordinate);
134 Q_DECLARE_METATYPE(GeoCoordinate)
136 #endif // GEOCOORDINATE_H