Marble::RoutingInstruction

Search for usage in LXR

#include <RoutingInstruction.h>

Public Types

enum  TurnType {
  Unknown = 0, Continue = 13, Merge = 14, Straight = 1,
  SlightRight = 2, Right = 3, SharpRight = 4, TurnAround = 5,
  SharpLeft = 6, Left = 7, SlightLeft = 8, RoundaboutFirstExit = 9,
  RoundaboutSecondExit = 10, RoundaboutThirdExit = 11, RoundaboutExit = 12, ExitLeft = 15,
  ExitRight = 16
}
 

Public Member Functions

 RoutingInstruction (const RoutingWaypoint &item=RoutingWaypoint())
 
qreal angleToPredecssor () const
 
bool append (const RoutingWaypoint &item, int angle)
 
qreal distance () const
 
qreal distanceFromStart () const
 
qreal distanceToEnd () const
 
QString instructionText () const
 
QVector< RoutingPointintersectionPoints () const
 
QString nextDistanceInstruction () const
 
QString nextRoadInstruction () const
 
QVector< RoutingWaypointpoints () const
 
RoutingInstructionpredecessor ()
 
const RoutingInstructionpredecessor () const
 
QString roadName () const
 
QString roadType () const
 
int secondsLeft () const
 
void setPredecessor (RoutingInstruction *predecessor)
 
void setSuccessor (RoutingInstruction *successor)
 
RoutingInstructionsuccessor ()
 
const RoutingInstructionsuccessor () const
 
QString totalDurationRemaining () const
 
TurnType turnType () const
 

Static Public Member Functions

static QString generateRoadInstruction (TurnType turnType, const QString &roadName)
 

Protected Member Functions

int roundaboutExitNumber () const
 

Detailed Description

Stores data related to one instruction: Road name, angle to predecessor, associated waypoints etc.

Can be streamed directly to a QTextStream.

Definition at line 25 of file RoutingInstruction.h.

Constructor & Destructor Documentation

Marble::RoutingInstruction::RoutingInstruction ( const RoutingWaypoint item = RoutingWaypoint())
explicit

Constructor.

Definition at line 17 of file RoutingInstruction.cpp.

Member Function Documentation

qreal Marble::RoutingInstruction::angleToPredecssor ( ) const

The angle between the two turn roads, in radians.

Definition at line 177 of file RoutingInstruction.cpp.

bool Marble::RoutingInstruction::append ( const RoutingWaypoint item,
int  angle 
)

Append data of the given item, returns true if item's street name matches instructions street name.

Definition at line 26 of file RoutingInstruction.cpp.

qreal Marble::RoutingInstruction::distance ( ) const

The accumulated distance of all waypoints belonging to this instruction.

Definition at line 214 of file RoutingInstruction.cpp.

qreal Marble::RoutingInstruction::distanceFromStart ( ) const

The distance from the route start.

Definition at line 224 of file RoutingInstruction.cpp.

qreal Marble::RoutingInstruction::distanceToEnd ( ) const

The distance to the route end.

Includes the own distance

Definition at line 235 of file RoutingInstruction.cpp.

QString Marble::RoutingInstruction::instructionText ( ) const

Formats the instruction for a human reader.

Definition at line 346 of file RoutingInstruction.cpp.

QVector< RoutingPoint > Marble::RoutingInstruction::intersectionPoints ( ) const

Contains the intersection point and points near it on the previous and current road.

Near is taken as that waypoint with the largest different to the intersection point that does not exceed 50 meter.

Definition at line 172 of file RoutingInstruction.cpp.

QString Marble::RoutingInstruction::nextDistanceInstruction ( ) const

Formats the instruction (distance to next instruction) for a human reader.

Definition at line 287 of file RoutingInstruction.cpp.

QString Marble::RoutingInstruction::nextRoadInstruction ( ) const

Formats the instruction (road name) for a human reader.

Definition at line 246 of file RoutingInstruction.cpp.

QVector< RoutingWaypoint > Marble::RoutingInstruction::points ( ) const

Waypoints from the last instruction to this instruction.

Definition at line 167 of file RoutingInstruction.cpp.

RoutingInstruction * Marble::RoutingInstruction::predecessor ( )

Previous turn road.

Will be 0 for the first one (route start)

Definition at line 182 of file RoutingInstruction.cpp.

const RoutingInstruction * Marble::RoutingInstruction::predecessor ( ) const

Const overload for predecessor.

Definition at line 187 of file RoutingInstruction.cpp.

QString Marble::RoutingInstruction::roadName ( ) const

Name of the road to turn into.

Definition at line 63 of file RoutingInstruction.cpp.

QString Marble::RoutingInstruction::roadType ( ) const

OSM type of the road to turn into.

Definition at line 68 of file RoutingInstruction.cpp.

int Marble::RoutingInstruction::secondsLeft ( ) const

Estimated number of seconds to the route destination.

Definition at line 73 of file RoutingInstruction.cpp.

void Marble::RoutingInstruction::setPredecessor ( RoutingInstruction predecessor)

Change the predecessor.

Definition at line 192 of file RoutingInstruction.cpp.

void Marble::RoutingInstruction::setSuccessor ( RoutingInstruction successor)

Change the successor.

Definition at line 209 of file RoutingInstruction.cpp.

RoutingInstruction * Marble::RoutingInstruction::successor ( )

Next turn road.

Will be 0 for the last one (destination)

Definition at line 199 of file RoutingInstruction.cpp.

const RoutingInstruction * Marble::RoutingInstruction::successor ( ) const

Const overload for successor.

Definition at line 204 of file RoutingInstruction.cpp.

QString Marble::RoutingInstruction::totalDurationRemaining ( ) const

Formats the instruction (duration to destination) for a human reader.

Definition at line 326 of file RoutingInstruction.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Oct 21 2021 23:23:23 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.