marble
#include <RoutingModel.h>
Inherits QAbstractListModel.
Public Types | |
enum | RoutingModelRoles { CoordinateRole = Qt::UserRole + 3, TurnTypeIconRole, LongitudeRole, LatitudeRole } |
Public Slots | |
bool | setCurrentRoute (GeoDataDocument *document) |
void | updatePosition (GeoDataCoordinates, qreal) |
Signals | |
void | currentRouteChanged () |
void | deviatedFromRoute (bool deviated) |
void | positionChanged () |
Public Member Functions | |
RoutingModel (RouteRequest *request, MarbleModel *model, QObject *parent=0) | |
~RoutingModel () | |
void | clear () |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
bool | deviatedFromRoute () const |
void | exportGpx (QIODevice *device) const |
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
int | rightNeighbor (const GeoDataCoordinates &position, RouteRequest const *const route) const |
const Route & | route () const |
int | rowCount (const QModelIndex &parent=QModelIndex()) const |
Properties | |
bool | deviatedFromRoute |
Detailed Description
Definition at line 34 of file RoutingModel.h.
Member Enumeration Documentation
Enumerator | |
---|---|
CoordinateRole | |
TurnTypeIconRole | |
LongitudeRole | |
LatitudeRole |
Definition at line 41 of file RoutingModel.h.
Constructor & Destructor Documentation
|
explicit |
Constructor.
Definition at line 131 of file RoutingModel.cpp.
Marble::RoutingModel::~RoutingModel | ( | ) |
Destructor.
Definition at line 153 of file RoutingModel.cpp.
Member Function Documentation
void Marble::RoutingModel::clear | ( | ) |
Clear any data held in the model.
Definition at line 325 of file RoutingModel.cpp.
|
signal |
A different route was loaded.
QVariant Marble::RoutingModel::data | ( | const QModelIndex & | index, |
int | role = Qt::DisplayRole |
||
) | const |
Overload of QAbstractListModel.
Definition at line 172 of file RoutingModel.cpp.
bool Marble::RoutingModel::deviatedFromRoute | ( | ) | const |
returns whether the gps location is on route
|
signal |
void Marble::RoutingModel::exportGpx | ( | QIODevice * | device | ) | const |
Export waypoints and instructions in gpx format.
Definition at line 292 of file RoutingModel.cpp.
QVariant Marble::RoutingModel::headerData | ( | int | section, |
Qt::Orientation | orientation, | ||
int | role = Qt::DisplayRole |
||
) | const |
Overload of QAbstractListModel.
Definition at line 163 of file RoutingModel.cpp.
|
signal |
emits a signal regarding information about total time( seconds ) and distance( metres ) remaining to reach destination
int Marble::RoutingModel::rightNeighbor | ( | const GeoDataCoordinates & | position, |
RouteRequest const *const | route | ||
) | const |
Maps points from the provided route request to waypoints in the model according to their global minimal distance.
Returns the right neighbor (next route request item along the waypoints) of the provided position. Provided route must not be null.
- Returns
- -1 If the provided route is empty, the index of the right neighbor along the waypoints otherwise (result is a valid RouteRequest index in that case)
Definition at line 333 of file RoutingModel.cpp.
const Route & Marble::RoutingModel::route | ( | ) | const |
Definition at line 416 of file RoutingModel.cpp.
int Marble::RoutingModel::rowCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
Overload of QAbstractListModel.
Definition at line 158 of file RoutingModel.cpp.
|
slot |
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.
Definition at line 231 of file RoutingModel.cpp.
|
slot |
Definition at line 389 of file RoutingModel.cpp.
Property Documentation
|
read |
Definition at line 38 of file RoutingModel.h.
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:57 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.