Re-factored the source to use the new coordinate classes
[situare] / src / coordinates / geocoordinate.cpp
index 63179e5..54cd63e 100644 (file)
@@ -43,7 +43,7 @@ GeoCoordinate::GeoCoordinate(double latitude, double longitude) :
     qDebug() << __PRETTY_FUNCTION__;
 }
 
-GeoCoordinate::GeoCoordinate(SceneCoordinate &coordinate)
+GeoCoordinate::GeoCoordinate(const SceneCoordinate &coordinate)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
@@ -120,6 +120,18 @@ void GeoCoordinate::setLongitude(double longitude)
     m_longitude = longitude;
 }
 
+QDataStream &operator<<(QDataStream &out, const GeoCoordinate &coordinate)
+{
+    out << coordinate.m_latitude << coordinate.m_longitude;
+    return out;
+}
+
+QDataStream &operator>>(QDataStream &in, GeoCoordinate &coordinate)
+{
+    in >> coordinate.m_latitude >> coordinate.m_longitude;
+    return in;
+}
+
 QDebug operator<<(QDebug dbg, const GeoCoordinate &coordinate)
 {
     dbg.nospace() << "(" << coordinate.latitude() << ", " << coordinate.longitude() << ")";