Marble

RoutingPoint.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2010 Dennis Nienhüser <[email protected]>
4 //
5 
6 #ifndef MARBLE_ROUTINGPOINT_H
7 #define MARBLE_ROUTINGPOINT_H
8 
9 #include "marble_export.h"
10 
11 #include <QtGlobal>
12 
13 class QTextStream;
14 
15 namespace Marble
16 {
17 
18 /**
19  * There are many Point classes, but this is mine.
20  */
21 class MARBLE_EXPORT RoutingPoint
22 {
23 public:
24  explicit RoutingPoint( qreal lon = 0.0, qreal lat = 0.0 );
25 
26  /** Longitude of the point */
27  qreal lon() const;
28 
29  /** Latitude of the point */
30  qreal lat() const;
31 
32  /**
33  * Calculates the bearing of the line defined by this point
34  * and the given other point.
35  * Code based on https://www.movable-type.co.uk/scripts/latlong.html
36  */
37  qreal bearing( const RoutingPoint &other ) const;
38 
39  /**
40  * Calculates the distance in meter between this point and the
41  * given other point.
42  * Code based on https://www.movable-type.co.uk/scripts/latlong.html
43  */
44  qreal distance( const RoutingPoint &other ) const;
45 
46 private:
47  qreal m_lon;
48 
49  qreal m_lonRad;
50 
51  qreal m_lat;
52 
53  qreal m_latRad;
54 };
55 
56 QTextStream& operator<<( QTextStream& stream, const RoutingPoint &i );
57 
58 } // namespace Marble
59 
60 #endif // MARBLE_ROUTINGPOINT_H
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
There are many Point classes, but this is mine.
Definition: RoutingPoint.h:21
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:28 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.