• 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
  • plugins
  • runner
  • openrouteservice
OpenRouteServiceRunner.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 
12 #ifndef MARBLE_OSMOPENROUTESERVICERUNNER_H
13 #define MARBLE_OSMOPENROUTESERVICERUNNER_H
14 
15 #include "RoutingRunner.h"
16 #include "routing/instructions/RoutingInstruction.h"
17 
18 #include <QString>
19 #include <QNetworkAccessManager>
20 #include <QNetworkReply>
21 
22 namespace Marble
23 {
24 
25 class GeoDataCoordinates;
26 
27 class OpenRouteServiceRunner : public RoutingRunner
28 {
29  Q_OBJECT
30 
31  enum PointType {
32  StartPoint,
33  ViaPoint,
34  EndPoint
35  };
36 
37 public:
38  explicit OpenRouteServiceRunner(QObject *parent = 0);
39 
40  ~OpenRouteServiceRunner();
41  // Overriding MarbleAbstractRunner
42  virtual void retrieveRoute( const RouteRequest *request );
43 
44 private Q_SLOTS:
46  void retrieveData( QNetworkReply *reply );
47 
49  void handleError( QNetworkReply::NetworkError );
50 
51  void get();
52 
53 private:
55  static QString xmlHeader();
56 
58  static QString requestHeader( const QString &unit, const QString &routePreference );
59 
61  static QString requestPoint( PointType pointType, const GeoDataCoordinates &coordinates );
62 
64  static QString requestFooter( const QHash<QString, QVariant> &settings );
65 
67  static QString xmlFooter();
68 
69  GeoDataDocument* parse( const QByteArray &input ) const;
70 
71  static RoutingInstruction::TurnType parseTurnType( const QString &text, QString* road );
72 
73  QNetworkAccessManager m_networkAccessManager;
74 
75  QNetworkRequest m_request;
76 
77  QByteArray m_requestData;
78 };
79 
80 }
81 
82 #endif
Marble::OpenRouteServiceRunner::OpenRouteServiceRunner
OpenRouteServiceRunner(QObject *parent=0)
Definition: OpenRouteServiceRunner.cpp:32
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
Marble::GeoDataDocument
A container for Features, Styles and in the future Schemas.
Definition: GeoDataDocument.h:65
RoutingInstruction.h
QByteArray
QNetworkReply
Marble::RoutingInstruction::TurnType
TurnType
Definition: RoutingInstruction.h:32
Marble::RouteRequest
Points to be included in a route.
Definition: RouteRequest.h:31
Marble::OpenRouteServiceRunner::~OpenRouteServiceRunner
~OpenRouteServiceRunner()
Definition: OpenRouteServiceRunner.cpp:40
Marble::OpenRouteServiceRunner
Definition: OpenRouteServiceRunner.h:27
QNetworkRequest
QHash< QString, QVariant >
QObject
RoutingRunner.h
QString
Marble::OpenRouteServiceRunner::retrieveRoute
virtual void retrieveRoute(const RouteRequest *request)
Start a route download orw calculation.
Definition: OpenRouteServiceRunner.cpp:45
QNetworkAccessManager
Marble::RoutingRunner
Definition: RoutingRunner.h:28
QObject::parent
QObject * parent() const
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