23#include <QGeoCoordinate>
27#include <QXmlStreamWriter>
29#include "units/Angle.h"
45 QML_VALUE_TYPE(waypoint)
82 explicit Waypoint(
const QJsonObject& geoJSONObject);
131 Q_PROPERTY(
bool isValid READ isValid)
161 Q_PROPERTY(QList<QString> tabularDescription READ tabularDescription)
197 return m_properties.value(QStringLiteral(
"CAT")).toString();
221 return m_properties.value(QStringLiteral(
"COD")).toString();
228 [[nodiscard]]
auto icon() const -> QString;
234 [[nodiscard]] auto isValid() const ->
bool;
240 [[nodiscard]] auto
name() const -> QString
242 return m_properties.value(QStringLiteral(
"NAM")).toString();
249 [[nodiscard]]
auto notes() const -> QString
251 return m_properties.value(QStringLiteral(
"NOT")).toString();
282 [[nodiscard]] auto
type() const -> QString
284 return m_properties.value(QStringLiteral(
"TYP")).toString();
304 m_coordinate = newCoordinate;
313 m_properties.insert(QStringLiteral(
"NAM"), newName);
322 m_properties.insert(QStringLiteral(
"NOT"), newNotes);
375 [[nodiscard]] QJsonObject
toJSON()
const;
384 void toGPX(QXmlStreamWriter& stream)
const;
387 QGeoCoordinate m_coordinate;
388 QMap<QString, QVariant> m_properties;
Waypoint, such as an airfield, a navaid station or a reporting point.
QString icon
Suggested icon for use in GUI.
Waypoint()
Constructs an invalid way point.
auto shortName() const -> QString
Getter method for property with same name.
void setNotes(const QString &newNotes)
Set notes.
QString name
Name of the waypoint.
friend size_t qHash(const GeoMaps::Waypoint &waypoint)
qHash
QString category
Category of the waypoint.
QString type
Type of the waypoint.
Q_INVOKABLE bool operator!=(const GeoMaps::Waypoint &other) const =default
Comparison.
void toGPX(QXmlStreamWriter &stream) const
Serialization to GPX object.
Q_INVOKABLE bool operator==(const GeoMaps::Waypoint &other) const =default
Comparison.
Q_INVOKABLE GeoMaps::Waypoint copy() const
Deep copy.
Units::Angle variation
Magnetic variation at the waypoint.
QString extendedName
Extended name of the waypoint.
QJsonObject toJSON() const
Serialization to GeoJSON object.
QString twoLineTitle
Two-line description of the waypoint name, for use in GUI.
void setName(const QString &newName)
Set name.
auto variation() const -> Units::Angle
Get variation.
auto tabularDescription() const -> QList< QString >
Getter method for property with the same name.
Q_INVOKABLE bool isNear(const GeoMaps::Waypoint &other) const
Check if other waypoint is geographically near *this.
QString ICAOCode
ICAO Code of the waypoint.
auto extendedName() const -> QString
Getter function for property with the same name.
QGeoCoordinate coordinate
Coordinate of the waypoint.
Waypoint(const QJsonObject &geoJSONObject)
Constructs a waypoint from a GeoJSON object.
auto notes() const -> QString
Getter method for property with same name.
auto icon() const -> QString
Getter method for property with the same name.
QString shortName
Short name of the waypoint.
QString notes
Notes attached to the waypoint.
auto coordinate() const -> QGeoCoordinate
Getter function for property with the same name.
void setCoordinate(const QGeoCoordinate &newCoordinate)
Set coordinate.
Conversion between units used in aviation.