• 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
RoutingModel.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_ROUTINGMODEL_H
12 #define MARBLE_ROUTINGMODEL_H
13 
14 #include "marble_export.h"
15 #include "GeoDataLineString.h"
16 #include "Route.h"
17 
18 #include <QAbstractListModel>
19 #include <QTime>
20 
27 namespace Marble
28 {
29 
30 class RoutingModelPrivate;
31 class RouteRequest;
32 class GeoDataDocument;
33 class MarbleModel;
34 class MARBLE_EXPORT RoutingModel : public QAbstractListModel
35 {
36  Q_OBJECT
37 
38  Q_PROPERTY( bool deviatedFromRoute READ deviatedFromRoute NOTIFY deviatedFromRoute )
39 
40 public:
41  enum RoutingModelRoles {
42  CoordinateRole = Qt::UserRole + 3,
43  TurnTypeIconRole,
44  LongitudeRole,
45  LatitudeRole
46  };
47 
49  explicit RoutingModel( RouteRequest* request, MarbleModel *model, QObject *parent = 0 );
50 
52  ~RoutingModel();
53 
54  // Model querying
55 
57  int rowCount ( const QModelIndex &parent = QModelIndex() ) const;
58 
60  QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
61 
63  QVariant data ( const QModelIndex &index, int role = Qt::DisplayRole ) const;
64 
65 #if QT_VERSION >= 0x050000
66 
67  QHash<int, QByteArray> roleNames() const;
68 #endif
69 
70  // Model data filling
71 
75  void exportGpx( QIODevice *device ) const;
76 
80  void clear();
81 
91  int rightNeighbor( const GeoDataCoordinates &position, RouteRequest const *const route ) const;
92 
96  bool deviatedFromRoute() const;
97 
98  const Route & route() const;
99 
100 public Q_SLOTS:
105  bool setCurrentRoute( GeoDataDocument* document );
106 
107  void updatePosition( GeoDataCoordinates, qreal );
108 
109 Q_SIGNALS:
113  void positionChanged();
114  void deviatedFromRoute( bool deviated );
115 
117  void currentRouteChanged();
118 
119 private:
120  RoutingModelPrivate *const d;
121 };
122 
123 } // namespace Marble
124 
125 #endif
QIODevice
QModelIndex
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
Route.h
Marble::RouteRequest
Points to be included in a route.
Definition: RouteRequest.h:31
QHash
QObject
MARBLE_EXPORT
#define MARBLE_EXPORT
Definition: marble_export.h:20
QAbstractListModel
GeoDataLineString.h
Marble::RoutingModel
Definition: RoutingModel.h:34
Marble::MarbleModel
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:97
marble_export.h
Marble::Route
Definition: Route.h:20
Marble::RoutingModel::TurnTypeIconRole
Definition: RoutingModel.h:43
Marble::RoutingModel::RoutingModelRoles
RoutingModelRoles
Definition: RoutingModel.h:41
Marble::RoutingModel::LongitudeRole
Definition: RoutingModel.h:44
QVariant
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