• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • marble
  • routing
  • instructions
RoutingInstruction.h
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2010 Dennis Nienhüser <earthwings@gentoo.org>
9 //
10 
11 #ifndef MARBLE_ROUTINGINSTRUCTION_H
12 #define MARBLE_ROUTINGINSTRUCTION_H
13 
14 #include "RoutingWaypoint.h"
15 #include "RoutingPoint.h"
16 #include "marble_export.h"
17 
18 #include <QTextStream>
19 #include <QVector>
20 #include <QVariant>
21 
22 namespace Marble
23 {
24 
29 class MARBLE_EXPORT RoutingInstruction
30 {
31 public:
32  enum TurnType {
33  Unknown = 0,
34  Continue = 13 ,
35  Merge = 14,
36  Straight = 1,
37  SlightRight = 2,
38  Right = 3,
39  SharpRight = 4,
40  TurnAround = 5 ,
41  SharpLeft = 6,
42  Left = 7,
43  SlightLeft = 8,
44  RoundaboutFirstExit = 9 ,
45  RoundaboutSecondExit = 10 ,
46  RoundaboutThirdExit = 11 ,
47  RoundaboutExit = 12 ,
48  ExitLeft = 15,
49  ExitRight = 16
50  };
51 
53  explicit RoutingInstruction( const RoutingWaypoint &item = RoutingWaypoint() );
54 
59  bool append( const RoutingWaypoint &item, int angle );
60 
62  QString roadName() const;
63 
65  QString roadType() const;
66 
68  int secondsLeft() const;
69 
71  QVector<RoutingWaypoint> points() const;
72 
78  QVector<RoutingPoint> intersectionPoints() const;
79 
81  qreal angleToPredecssor() const;
82 
84  RoutingInstruction* predecessor();
85 
87  const RoutingInstruction* predecessor() const;
88 
90  void setPredecessor( RoutingInstruction* predecessor );
91 
93  RoutingInstruction* successor();
94 
96  const RoutingInstruction* successor() const;
97 
99  void setSuccessor( RoutingInstruction* successor );
100 
102  qreal distance() const;
103 
105  qreal distanceFromStart() const;
106 
108  qreal distanceToEnd() const;
109 
110  TurnType turnType() const;
111 
113  QString nextRoadInstruction() const;
114 
116  QString nextDistanceInstruction() const;
117 
119  QString totalDurationRemaining() const;
120 
122  QString instructionText() const;
123 
124  static QString generateRoadInstruction( TurnType turnType, const QString &roadName );
125 
126 protected:
127  int roundaboutExitNumber() const;
128 
129 private:
130  void calculateAngle();
131 
132  void calculateTurnType();
133 
134  QVector<RoutingWaypoint> m_points;
135 
136  QVector<RoutingPoint> m_intersectionPoints;
137 
138  QString m_roadName;
139 
140  QString m_roadType;
141 
142  int m_secondsLeft;
143 
144  qreal m_angleToPredecessor;
145 
146  TurnType m_turnType;
147 
148  int m_roundaboutExit;
149 
150  RoutingInstruction* m_predecessor;
151 
152  RoutingInstruction* m_successor;
153 };
154 
155 QTextStream& operator<<( QTextStream& stream, const RoutingInstruction &i );
156 
157 typedef QVector<RoutingInstruction> RoutingInstructions;
158 
159 } // namespace Marble
160 
161 Q_DECLARE_METATYPE( Marble::RoutingInstruction::TurnType )
162 
163 #endif // MARBLE_ROUTINGINSTRUCTION_H
Marble::RoutingInstruction
Stores data related to one instruction: Road name, angle to predecessor, associated waypoints etc...
Definition: RoutingInstruction.h:29
angle
double angle(double vec1[3], double vec2[3])
Definition: sgp4ext.cpp:164
RoutingWaypoint.h
Marble::RoutingInstructions
QVector< RoutingInstruction > RoutingInstructions
Definition: RoutingInstruction.h:157
Marble::RoutingInstruction::TurnType
TurnType
Definition: RoutingInstruction.h:32
QTextStream
RoutingPoint.h
MARBLE_EXPORT
#define MARBLE_EXPORT
Definition: marble_export.h:20
QString
QVector
marble_export.h
Marble::operator<<
QTextStream & operator<<(QTextStream &stream, const RoutingInstruction &i)
Definition: RoutingInstruction.cpp:461
Marble::RoutingWaypoint
Stores one line of gosmore/routino output.
Definition: RoutingWaypoint.h:25
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal