Marble

Route.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_ROUTE_H
7#define MARBLE_ROUTE_H
8
9#include "GeoDataLatLonBox.h"
10#include "RouteSegment.h"
11
12namespace Marble
13{
14
15class MARBLE_EXPORT Route
16{
17public:
18 Route();
19
20 void addRouteSegment(const RouteSegment &segment);
21
22 GeoDataLatLonBox bounds() const;
23
24 qreal distance() const;
25
26 const RouteSegment &at(int index) const;
27
28 int indexOf(const RouteSegment &segment) const;
29
30 int size() const;
31
32 const GeoDataLineString &path() const;
33
34 int travelTime() const;
35
36 const GeoDataLineString &turnPoints() const;
37
38 const GeoDataLineString &waypoints() const;
39
40 void setPosition(const GeoDataCoordinates &position);
41
42 GeoDataCoordinates position() const;
43
44 const RouteSegment &currentSegment() const;
45
46 GeoDataCoordinates currentWaypoint() const;
47
48 GeoDataCoordinates positionOnRoute() const;
49
50private:
51 void updatePosition() const;
52
53 GeoDataLatLonBox m_bounds;
54
55 qreal m_distance;
56
57 QList<RouteSegment> m_segments;
58
59 GeoDataLineString m_path;
60
61 GeoDataLineString m_turnPoints;
62
63 GeoDataLineString m_waypoints;
64
65 int m_travelTime;
66
67 mutable bool m_positionDirty;
68
69 mutable int m_closestSegmentIndex;
70
71 mutable GeoDataCoordinates m_positionOnRoute;
72
73 mutable GeoDataCoordinates m_currentWaypoint;
74
75 GeoDataCoordinates m_position;
76};
77
78}
79
80#endif
QString path(const QString &relativePath)
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.