Marble

RoutingPoint.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2010 Dennis Nienhüser <nienhueser@kde.org>
4//
5
6#ifndef MARBLE_ROUTINGPOINT_H
7#define MARBLE_ROUTINGPOINT_H
8
9#include "marble_export.h"
10
11#include <QtGlobal>
12
13class QTextStream;
14
15namespace Marble
16{
17
18/**
19 * There are many Point classes, but this is mine.
20 */
21class MARBLE_EXPORT RoutingPoint
22{
23public:
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
46private:
47 qreal m_lon;
48
49 qreal m_lonRad;
50
51 qreal m_lat;
52
53 qreal m_latRad;
54};
55
56QTextStream& operator<<( QTextStream& stream, const RoutingPoint &i );
57
58} // namespace Marble
59
60#endif // MARBLE_ROUTINGPOINT_H
There are many Point classes, but this is mine.
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 21 2024 12:00:07 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.