File indexing completed on 2024-05-12 03:50:41

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2010 Dennis Nienhüser <nienhueser@kde.org>
0004 //
0005 
0006 #ifndef MARBLE_ROUTINGWAYPOINT_H
0007 #define MARBLE_ROUTINGWAYPOINT_H
0008 
0009 #include "RoutingPoint.h"
0010 #include "marble_export.h"
0011 
0012 #include <QVector>
0013 #include <QString>
0014 
0015 namespace Marble
0016 {
0017 
0018 /**
0019   * Stores one line of gosmore/routino output
0020   */
0021 class MARBLE_EXPORT RoutingWaypoint
0022 {
0023 public:
0024     /** Junction types that affect instructions */
0025     enum JunctionType
0026     {
0027       Roundabout,
0028       Other,
0029       None
0030     };
0031 
0032     /** Constructor */
0033     RoutingWaypoint();
0034 
0035     /** Convenience constructor to initialize members */
0036     RoutingWaypoint( const RoutingPoint &point, JunctionType junctionType, const QString &junctionTypeRaw,
0037                      const QString &roadType, int secondsRemaining, const QString &roadName );
0038 
0039     /** Associated geo point */
0040     RoutingPoint point() const;
0041 
0042     /** Parsed junction type */
0043     JunctionType junctionType() const;
0044 
0045     /** Junction type originally passed */
0046     QString junctionTypeRaw() const;
0047 
0048     /** OSM type of the road */
0049     QString roadType() const;
0050 
0051     /** Estimated seconds remaining until the route destination is reached */
0052     int secondsRemaining() const;
0053 
0054     /** OSM name of the road */
0055     QString roadName() const;
0056 
0057 private:
0058     RoutingPoint m_point;
0059 
0060     JunctionType m_junctionType;
0061 
0062     QString m_junctionTypeRaw;
0063 
0064     QString m_roadType;
0065 
0066     int m_secondsRemaining;
0067 
0068     QString m_roadName;
0069 };
0070 
0071 using RoutingWaypoints = QVector<RoutingWaypoint>;
0072 
0073 } // namespace Marble
0074 
0075 #endif