• 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
AlternativeRoutesModel.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_ALTERNATIVEROUTESMODEL_H
12 #define MARBLE_ALTERNATIVEROUTESMODEL_H
13 
14 #include "GeoDataLineString.h"
15 
16 #include <QAbstractListModel>
17 
24 namespace Marble
25 {
26 
27 class AlternativeRoutesModelPrivate;
28 class RouteRequest;
29 class GeoDataDocument;
30 
31 class MARBLE_EXPORT AlternativeRoutesModel : public QAbstractListModel
32 {
33  Q_OBJECT
34 
35 public:
36  enum WritePolicy {
37  Instant,
38  Lazy
39  };
40 
42  explicit AlternativeRoutesModel( QObject *parent = 0 );
43 
45  ~AlternativeRoutesModel();
46 
47  // Model querying
48 
50  int rowCount ( const QModelIndex &parent = QModelIndex() ) const;
51 
53  QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
54 
56  QVariant data ( const QModelIndex &index, int role = Qt::DisplayRole ) const;
57 
58  GeoDataDocument* route( int index );
59 
60  // Model data filling
61 
63  void newRequest( RouteRequest *request );
64 
73  void addRoute( GeoDataDocument* document, WritePolicy policy = Lazy );
74 
76  void clear();
77 
78  GeoDataDocument* currentRoute();
79 
81  static const GeoDataLineString* waypoints( const GeoDataDocument* document );
82 
84  static qreal distance( const GeoDataCoordinates &satellite, const GeoDataCoordinates &lineA, const GeoDataCoordinates &lineB );
85 
87  static QVector<qreal> deviation( const GeoDataDocument* routeA, const GeoDataDocument* routeB );
88 
89 public Q_SLOTS:
90  void setCurrentRoute( int index );
91 
92 Q_SIGNALS:
93  void currentRouteChanged( GeoDataDocument* newRoute );
94  void currentRouteChanged( int index );
95 
96 private Q_SLOTS:
97  void addRestrainedRoutes();
98 
99  void update( GeoDataDocument* route );
100 
101 private:
102  AlternativeRoutesModelPrivate *const d;
103 };
104 
105 } // namespace Marble
106 
107 #endif
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
Marble::AlternativeRoutesModel::WritePolicy
WritePolicy
Definition: AlternativeRoutesModel.h:36
Marble::RouteRequest
Points to be included in a route.
Definition: RouteRequest.h:31
Marble::AlternativeRoutesModel::Instant
Definition: AlternativeRoutesModel.h:37
QObject
MARBLE_EXPORT
#define MARBLE_EXPORT
Definition: marble_export.h:20
QAbstractListModel
GeoDataLineString.h
Marble::GeoDataLineString
A LineString that allows to store a contiguous set of line segments.
Definition: GeoDataLineString.h:75
Marble::AlternativeRoutesModel
Definition: AlternativeRoutesModel.h:31
QVector< qreal >
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:38 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