Marble

RouteSegment.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2011 Dennis Nienhüser <nienhueser@kde.org>
4//
5
6#ifndef MARBLE_ROUTESEGMENT_H
7#define MARBLE_ROUTESEGMENT_H
8
9#include "GeoDataLatLonBox.h"
10#include "GeoDataLineString.h"
11#include "Maneuver.h"
12
13#include <QtGlobal>
14
15namespace Marble
16{
17
18class MARBLE_EXPORT RouteSegment
19{
20public:
21 RouteSegment();
22
23 bool isValid() const;
24
25 qreal distance() const;
26
27 const Maneuver &maneuver() const;
28
29 void setManeuver(const Maneuver &maneuver);
30
31 const GeoDataLineString &path() const;
32
33 void setPath(const GeoDataLineString &path);
34
35 int travelTime() const;
36
37 void setTravelTime(int seconds);
38
39 GeoDataLatLonBox bounds() const;
40
41 const RouteSegment &nextRouteSegment() const;
42
43 void setNextRouteSegment(const RouteSegment *segment);
44
45 qreal distanceTo(const GeoDataCoordinates &point, GeoDataCoordinates &closest, GeoDataCoordinates &interpolated) const;
46
47 qreal minimalDistanceTo(const GeoDataCoordinates &point) const;
48
49 qreal projectedDirection(const GeoDataCoordinates &point) const;
50
51 bool operator==(const RouteSegment &other) const;
52
53 bool operator!=(const RouteSegment &other) const;
54
55private:
56 static qreal distancePointToLine(const GeoDataCoordinates &p, const GeoDataCoordinates &a, const GeoDataCoordinates &b);
57
58 static GeoDataCoordinates projected(const GeoDataCoordinates &p, const GeoDataCoordinates &a, const GeoDataCoordinates &b);
59
60 bool m_valid;
61
62 qreal m_distance;
63
64 Maneuver m_maneuver;
65
66 GeoDataLineString m_path;
67
68 int m_travelTime;
69
70 GeoDataLatLonBox m_bounds;
71
72 const RouteSegment *m_nextRouteSegment;
73};
74
75}
76
77#endif
KIOCORE_EXPORT bool operator!=(const UDSEntry &entry, const UDSEntry &other)
QString path(const QString &relativePath)
bool isValid(QStringView ifopt)
bool operator==(const StyleDelim &l, const StyleDelim &r)
Binds a QML item to a specific geodetic location in screen coordinates.
KOSM_EXPORT double distance(const std::vector< const OSM::Node * > &path, Coordinate coord)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.