KPublicTransport::PathSection

Search for usage in LXR

#include <path.h>

Public Types

enum  Maneuver { Move , Stairs , Elevator , Escalator }
 

Properties

QString description
 
int direction
 
int distance
 
QPointF endPoint
 
int floorLevelChange
 
bool hasStartFloorLevel
 
QString iconName
 
Maneuver maneuver
 
QPolygonF path
 
int startFloorLevel
 
QPointF startPoint
 

Public Member Functions

int direction () const
 
int distance () const
 
QPointF endPoint () const
 
bool hasStartFloorLevel () const
 
QString iconName () const
 
QPointF startPoint () const
 

Static Public Member Functions

static std::vector< PathSectionfromJson (const QJsonArray &array)
 
static PathSection fromJson (const QJsonObject &obj)
 
static Q_INVOKABLE QString maneuverIconName (KPublicTransport::PathSection::Maneuver maneuver)
 
static QJsonObject toJson (const PathSection &section)
 
static QJsonArray toJson (const std::vector< PathSection > &sections)
 

Detailed Description

A section of a Path.

A path section consists of a poly-line of geo-coordinates to follow, an initial maneuver instructions as well as additional properties for this part of the path, such as the floor level.

Definition at line 24 of file path.h.

Member Enumeration Documentation

◆ Maneuver

Maneuver associated with a path section.

Enumerator
Move 

Move/drive with the default mode of transport for this path.

Stairs 

Walk up or down stairs.

Elevator 

Take an elevator.

Escalator 

Take an escalator.

Definition at line 56 of file path.h.

Property Documentation

◆ description

QString KPublicTransport::PathSection::description
readwrite

Human-readable description of this path segment.

Definition at line 30 of file path.h.

◆ direction

int KPublicTransport::PathSection::direction
read

The overall direction of this section in degree.

Definition at line 42 of file path.h.

◆ distance

int KPublicTransport::PathSection::distance
read

The length of this path section in meters.

Definition at line 40 of file path.h.

◆ endPoint

QPointF KPublicTransport::PathSection::endPoint
read

Last point on the path of this section.

Definition at line 37 of file path.h.

◆ floorLevelChange

int KPublicTransport::PathSection::floorLevelChange
readwrite

Floor level change during this path section.

Negative values indicate going down, positive values indicate going up

Definition at line 52 of file path.h.

◆ hasStartFloorLevel

bool KPublicTransport::PathSection::hasStartFloorLevel
read

Indicates an absolute start floor level is known.

Definition at line 47 of file path.h.

◆ iconName

QString KPublicTransport::PathSection::iconName
read

An icon representing the maneuver.

Can be a qrc: URL or XDG icon name.

Definition at line 69 of file path.h.

◆ maneuver

Maneuver KPublicTransport::PathSection::maneuver
readwrite

Movement maneuver for this path section.

Definition at line 64 of file path.h.

◆ path

QPolygonF KPublicTransport::PathSection::path
readwrite

The geo coordinate poly-line followed by this path section.

Definition at line 28 of file path.h.

◆ startFloorLevel

int KPublicTransport::PathSection::startFloorLevel
readwrite

Absolute floor level at the beginning of this path, if known.

Definition at line 45 of file path.h.

◆ startPoint

QPointF KPublicTransport::PathSection::startPoint
read

First point on the path of this section.

Definition at line 35 of file path.h.

Member Function Documentation

◆ direction()

int PathSection::direction ( ) const
nodiscard

The overall direction of this section in degree.

Returns
0-359 for valid results, -1 for sections with no direction (e.g. points).

Definition at line 52 of file path.cpp.

◆ distance()

int PathSection::distance ( ) const
nodiscard

Length of this path section in meters.

Definition at line 38 of file path.cpp.

◆ endPoint()

QPointF PathSection::endPoint ( ) const
nodiscard

Last point on the path of this section.

Definition at line 72 of file path.cpp.

◆ fromJson() [1/2]

std::vector< PathSection > PathSection::fromJson ( const QJsonArray & array)
staticnodiscard

Deserialize a vector of path sections from JSON.

Definition at line 128 of file path.cpp.

◆ fromJson() [2/2]

PathSection PathSection::fromJson ( const QJsonObject & obj)
staticnodiscard

Deserialize an object from JSON.

Definition at line 121 of file path.cpp.

◆ hasStartFloorLevel()

bool PathSection::hasStartFloorLevel ( ) const
nodiscard

Definition at line 62 of file path.cpp.

◆ iconName()

QString PathSection::iconName ( ) const
nodiscard

Definition at line 93 of file path.cpp.

◆ maneuverIconName()

QString PathSection::maneuverIconName ( KPublicTransport::PathSection::Maneuver maneuver)
staticnodiscard

An icon representing maneuver.

Can be a qrc: URL or XDG icon name.

Definition at line 77 of file path.cpp.

◆ startPoint()

QPointF PathSection::startPoint ( ) const
nodiscard

First point on the path of this section.

Definition at line 67 of file path.cpp.

◆ toJson() [1/2]

QJsonObject PathSection::toJson ( const PathSection & section)
staticnodiscard

Serializes one path section section to JSON.

Definition at line 98 of file path.cpp.

◆ toJson() [2/2]

QJsonArray PathSection::toJson ( const std::vector< PathSection > & sections)
staticnodiscard

Serializes a vector of path sections to JSON.

Definition at line 116 of file path.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:57:19 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.