Marble

Route.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2011 Dennis Nienhüser <[email protected]>
4 //
5 
6 #ifndef MARBLE_ROUTE_H
7 #define MARBLE_ROUTE_H
8 
9 #include "RouteSegment.h"
10 #include "GeoDataLatLonBox.h"
11 
12 namespace Marble
13 {
14 
15 class MARBLE_EXPORT Route
16 {
17 public:
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 
50 private:
51  void updatePosition() const;
52 
53  GeoDataLatLonBox m_bounds;
54 
55  qreal m_distance;
56 
57  QVector<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
KOSM_EXPORT double distance(const std::vector< const OSM::Node * > &path, Coordinate coord)
Binds a QML item to a specific geodetic location in screen coordinates.
QString path(const QString &relativePath)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Oct 2 2023 03:52:09 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.