marble
#include <AlternativeRoutesModel.h>
Inherits QAbstractListModel.
Public Types | |
| enum | WritePolicy { Instant, Lazy } |
Public Slots | |
| void | setCurrentRoute (int index) |
Signals | |
| void | currentRouteChanged (GeoDataDocument *newRoute) |
| void | currentRouteChanged (int index) |
Public Member Functions | |
| AlternativeRoutesModel (QObject *parent=0) | |
| ~AlternativeRoutesModel () | |
| void | addRoute (GeoDataDocument *document, WritePolicy policy=Lazy) |
| void | clear () |
| GeoDataDocument * | currentRoute () |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
| void | newRequest (RouteRequest *request) |
| GeoDataDocument * | route (int index) |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const |
Static Public Member Functions | |
| static QVector< qreal > | deviation (const GeoDataDocument *routeA, const GeoDataDocument *routeB) |
| static qreal | distance (const GeoDataCoordinates &satellite, const GeoDataCoordinates &lineA, const GeoDataCoordinates &lineB) |
| static GeoDataLineString * | waypoints (const GeoDataDocument *document) |
Detailed Description
Definition at line 31 of file AlternativeRoutesModel.h.
Member Enumeration Documentation
| Enumerator | |
|---|---|
| Instant | |
| Lazy | |
Definition at line 36 of file AlternativeRoutesModel.h.
Constructor & Destructor Documentation
|
explicit |
Constructor.
Definition at line 298 of file AlternativeRoutesModel.cpp.
| Marble::AlternativeRoutesModel::~AlternativeRoutesModel | ( | ) |
Destructor.
Definition at line 305 of file AlternativeRoutesModel.cpp.
Member Function Documentation
| void Marble::AlternativeRoutesModel::addRoute | ( | GeoDataDocument * | document, |
| WritePolicy | policy = Lazy |
||
| ) |
Old data in the model is discarded, the parsed content of the provided document is used as the new model data and a model reset is done.
- Parameters
-
document The route to add policy In lazy mode (default), a short amount of time is waited for other addRoute() calls before adding the route to the model. Otherwise, the model is changed immediately.
Definition at line 367 of file AlternativeRoutesModel.cpp.
| void Marble::AlternativeRoutesModel::clear | ( | ) |
Remove all alternative routes from the model.
Definition at line 457 of file AlternativeRoutesModel.cpp.
| GeoDataDocument * Marble::AlternativeRoutesModel::currentRoute | ( | ) |
Definition at line 447 of file AlternativeRoutesModel.cpp.
|
signal |
|
signal |
| QVariant Marble::AlternativeRoutesModel::data | ( | const QModelIndex & | index, |
| int | role = Qt::DisplayRole |
||
| ) | const |
Overload of QAbstractListModel.
Definition at line 320 of file AlternativeRoutesModel.cpp.
|
static |
Returns the minimal distance of each waypoint of routeA to routeB.
Definition at line 413 of file AlternativeRoutesModel.cpp.
|
static |
Returns the distance between the given point and the given great circle path.
Definition at line 408 of file AlternativeRoutesModel.cpp.
| QVariant Marble::AlternativeRoutesModel::headerData | ( | int | section, |
| Qt::Orientation | orientation, | ||
| int | role = Qt::DisplayRole |
||
| ) | const |
Overload of QAbstractListModel.
Definition at line 315 of file AlternativeRoutesModel.cpp.
| void Marble::AlternativeRoutesModel::newRequest | ( | RouteRequest * | request | ) |
Invalidate the current alternative routes and prepare for new ones to arrive.
Definition at line 340 of file AlternativeRoutesModel.cpp.
| GeoDataDocument * Marble::AlternativeRoutesModel::route | ( | int | index | ) |
Definition at line 331 of file AlternativeRoutesModel.cpp.
| int Marble::AlternativeRoutesModel::rowCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
Overload of QAbstractListModel.
Definition at line 310 of file AlternativeRoutesModel.cpp.
|
slot |
Definition at line 438 of file AlternativeRoutesModel.cpp.
|
static |
Returns the waypoints contained in the route as a linestring.
Definition at line 433 of file AlternativeRoutesModel.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:55 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.
KDE API Reference