KPublicTransport::Vehicle
#include <vehicle.h>
Properties | |
std::vector< KPublicTransport::Feature > | combinedFeatures |
Direction | direction |
std::vector< KPublicTransport::Feature > | features |
QString | name |
float | platformPositionBegin |
float | platformPositionEnd |
QVariantList | sections |
Public Member Functions | |
std::vector< KPublicTransport::Feature > | combinedFeatures () const |
const std::vector< KPublicTransport::Feature > & | features () const |
bool | hasPlatformPositions () const |
bool | hasPlatformSectionNames () const |
bool | isEmpty () const |
float | platformPositionBegin () const |
float | platformPositionEnd () const |
Q_INVOKABLE float | platformPositionForSection (const QString §ionName) const |
const std::vector< VehicleSection > & | sections () const |
void | setFeatures (std::vector< KPublicTransport::Feature > &&features) |
void | setSections (const std::vector< VehicleSection > §ions) |
void | setSections (std::vector< VehicleSection > &§ions) |
std::vector< KPublicTransport::Feature > && | takeFeatures () |
std::vector< VehicleSection > && | takeSections () |
Static Public Member Functions | |
static std::vector< Vehicle > | fromJson (const QJsonArray &array) |
static Vehicle | fromJson (const QJsonObject &obj) |
static Vehicle | merge (const Vehicle &lhs, const Vehicle &rhs) |
static QJsonArray | toJson (const std::vector< Vehicle > &vehicles) |
static QJsonObject | toJson (const Vehicle &vehicle) |
Detailed Description
Information about the vehicle used on a journey.
This is typically only available for trains, and describes their coach layout.
A vehicle object always is tied to a specific Platform object, to which all positions refer to.
- See also
- Platform
Property Documentation
◆ combinedFeatures
|
read |
◆ direction
|
readwrite |
◆ features
|
read |
◆ name
|
readwrite |
◆ platformPositionBegin
|
read |
◆ platformPositionEnd
|
read |
◆ sections
|
read |
Member Function Documentation
◆ combinedFeatures()
|
nodiscard |
Combined vehicle features.
Definition at line 320 of file vehicle.cpp.
◆ features()
|
nodiscard |
Vehicle features.
Definition at line 304 of file vehicle.cpp.
◆ fromJson() [1/2]
|
staticnodiscard |
Deserialize multiple objects from JSON.
Definition at line 289 of file vehicle.cpp.
◆ fromJson() [2/2]
|
staticnodiscard |
Deserialize an object from JSON.
Definition at line 281 of file vehicle.cpp.
◆ hasPlatformPositions()
|
nodiscard |
Checks whether all vehicle sections have platform positions set.
Definition at line 294 of file vehicle.cpp.
◆ hasPlatformSectionNames()
|
nodiscard |
Check whether all vehicle sections have platform section names set.
Definition at line 299 of file vehicle.cpp.
◆ isEmpty()
|
nodiscard |
Returns true
if this object contains no information beyond the default values.
Definition at line 176 of file vehicle.cpp.
◆ merge()
Merge two Vehicle instances.
Definition at line 240 of file vehicle.cpp.
◆ platformPositionBegin()
|
nodiscard |
Definition at line 212 of file vehicle.cpp.
◆ platformPositionEnd()
|
nodiscard |
Definition at line 221 of file vehicle.cpp.
◆ platformPositionForSection()
|
nodiscard |
Returns the center position of the vehicle section named sectionName
in relative platform coordinates.
Useful for centering a view on a selected section for example.
Definition at line 230 of file vehicle.cpp.
◆ sections()
|
nodiscard |
The vehicle sections.
Definition at line 181 of file vehicle.cpp.
◆ setFeatures()
void Vehicle::setFeatures | ( | std::vector< KPublicTransport::Feature > && | features | ) |
Definition at line 314 of file vehicle.cpp.
◆ setSections() [1/2]
void Vehicle::setSections | ( | const std::vector< VehicleSection > & | sections | ) |
Definition at line 198 of file vehicle.cpp.
◆ setSections() [2/2]
void Vehicle::setSections | ( | std::vector< VehicleSection > && | sections | ) |
Sets the vehicle sections.
Definition at line 192 of file vehicle.cpp.
◆ takeFeatures()
|
nodiscard |
Definition at line 309 of file vehicle.cpp.
◆ takeSections()
|
nodiscard |
Moves the vehicle sections out of this object.
Definition at line 186 of file vehicle.cpp.
◆ toJson() [1/2]
|
staticnodiscard |
Serializes multiple vehicle objects to JSON.
Definition at line 276 of file vehicle.cpp.
◆ toJson() [2/2]
|
staticnodiscard |
Serializes one vehicle object to JSON.
Definition at line 264 of file vehicle.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.