Marble

RouteSegment.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_ROUTESEGMENT_H
7 #define MARBLE_ROUTESEGMENT_H
8 
9 #include "Maneuver.h"
10 #include "GeoDataLineString.h"
11 #include "GeoDataLatLonBox.h"
12 
13 #include <QtGlobal>
14 
15 namespace Marble
16 {
17 
18 class MARBLE_EXPORT RouteSegment
19 {
20 public:
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 
55 private:
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 
78 #endif
bool operator==(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
KOSM_EXPORT double distance(const std::vector< const OSM::Node * > &path, Coordinate coord)
bool operator!=(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
Binds a QML item to a specific geodetic location in screen coordinates.
QString path(const QString &relativePath)
bool isValid(QStringView ifopt)
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.