• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • Marble
  • RoutingModel
Public Types | Public Slots | Signals | Public Member Functions | Properties | List of all members
Marble::RoutingModel Class Reference

#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

enum Marble::RoutingModel::RoutingModelRoles
Enumerator
CoordinateRole 
TurnTypeIconRole 
LongitudeRole 
LatitudeRole 

Definition at line 41 of file RoutingModel.h.

Constructor & Destructor Documentation

Marble::RoutingModel::RoutingModel ( RouteRequest *  request,
MarbleModel *  model,
QObject *  parent = 0 
)
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.

void Marble::RoutingModel::currentRouteChanged ( )
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

void Marble::RoutingModel::deviatedFromRoute ( bool  deviated)
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.

void Marble::RoutingModel::positionChanged ( )
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.

bool Marble::RoutingModel::setCurrentRoute ( GeoDataDocument *  document)
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.

void Marble::RoutingModel::updatePosition ( GeoDataCoordinates  location,
qreal   
)
slot

Definition at line 389 of file RoutingModel.cpp.

Property Documentation

bool Marble::RoutingModel::deviatedFromRoute
read

Definition at line 38 of file RoutingModel.h.


The documentation for this class was generated from the following files:
  • RoutingModel.h
  • RoutingModel.cpp
This file is part of the KDE documentation.
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.

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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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