6#ifndef SWIFT_MISC_GEO_COORDINATEGEODETIC_H
7#define SWIFT_MISC_GEO_COORDINATEGEODETIC_H
44 IndexLatitude = CPropertyIndexRef::GlobalIndexICoordinateGeodetic,
46 IndexLatitudeAsString,
47 IndexLongitudeAsString,
49 IndexGeodeticHeightAsString,
134 QString convertToQString(
bool i18n =
false)
const;
138 bool isNaNVector()
const;
139 bool isNaNVectorDouble()
const;
140 bool isInfVector()
const;
141 bool isInfVectorDouble()
const;
142 bool isValidVectorRange()
const;
143 static bool isValidVector(
const std::array<double, 3> &v);
153 calculateGreatCircleDistance(
const ICoordinateGeodetic &coordinate1,
const ICoordinateGeodetic &coordinate2);
157 const ICoordinateGeodetic &coordinate2);
160 SWIFT_MISC_EXPORT double calculateEuclideanDistance(
const ICoordinateGeodetic &coordinate1,
161 const ICoordinateGeodetic &coordinate2);
164 SWIFT_MISC_EXPORT double calculateEuclideanDistanceSquared(
const ICoordinateGeodetic &coordinate1,
165 const ICoordinateGeodetic &coordinate2);
175 IndexRelativeDistance = CPropertyIndexRef::GlobalIndexICoordinateWithRelativePosition,
215 QString convertToQString(
bool i18n =
false)
const;
239 : m_x(static_cast<double>(normal.x())), m_y(static_cast<double>(normal.y())),
240 m_z(static_cast<double>(normal.z()))
279 std::array<double, 3> normalVectorDouble()
const override;
294 void setLatitude(
const CLatitude &latitude);
297 void setLatitudeFromWgs84(
const QString &wgs);
300 void setLongitude(
const CLongitude &longitude);
303 void setLongitudeFromWgs84(
const QString &wgs);
309 void setLatLongFromWgs84(
const QString &latitude,
const QString &longitude);
315 void setGeodeticHeightToNull();
320 m_x =
static_cast<double>(normal.
x());
321 m_y =
static_cast<double>(normal.
y());
322 m_z =
static_cast<double>(normal.
z());
334 void setNormalVector(
const std::array<double, 3> &normalVector);
343 m_geodeticHeight.setNull();
349 if (m_geodeticHeight.isNull())
362 static const CCoordinateGeodetic &null();
365 QString convertToQString(
bool i18n =
false)
const;
387 struct TString<geo::ICoordinateGeodetic>
389 static QString toQString(
const geo::ICoordinateGeodetic &coord) {
return coord.convertToQString(); }
Non-owning reference to a CPropertyIndex with a subset of its features.
Altitude as used in aviation, can be AGL or MSL altitude.
void setNull()
Set to null.
bool isNull() const
Is null?
void setNormalVector(double x, double y, double z)
Set normal vector.
CCoordinateGeodetic()=default
Default constructor (null coordinate).
void setGeodeticHeight(const aviation::CAltitude &height)
Set height (ellipsoidal or geodetic height).
const aviation::CAltitude & geodeticHeight() const
Height, ellipsoidal or geodetic height (used in GPS).
void setNormalVector(const QVector3D &normal)
Set normal vector.
CCoordinateGeodetic(const QVector3D &normal)
Constructor by normal vector.
Geodetic coordinate, a position in 3D space relative to the reference geoid.
ICoordinateGeodetic()=default
Ctor.
virtual QVector3D normalVector() const =0
Normal vector.
bool hasMSLGeodeticHeight() const
Geodetic height not null and aviation::CAltitude::MeanSeaLevel.
ICoordinateGeodetic(const ICoordinateGeodetic &)=default
Copy constructor.
virtual CLongitude longitude() const =0
Longitude.
bool equalNormalVectorDouble(const std::array< double, 3 > &otherVector) const
Is equal? Epsilon considered.
virtual const aviation::CAltitude & geodeticHeight() const =0
Height, ellipsoidal or geodetic height (used in GPS).
virtual ~ICoordinateGeodetic()=default
Destructor.
ColumnIndex
Properties by index.
QString longitudeAsString() const
Longitude as string.
virtual bool isNull() const
Is null, means vector x, y, z == 0.
virtual std::array< double, 3 > normalVectorDouble() const =0
Normal vector with double precision.
QString latitudeAsString() const
Latitude as string.
QString geodeticHeightAsString() const
Height as string.
bool isGeodeticHeightNull() const
Geodetic height null?
ICoordinateGeodetic & operator=(const ICoordinateGeodetic &)=default
Copy assignment operator.
virtual CLatitude latitude() const =0
Latitude.
Interface (actually more an abstract class) of coordinates and relative position to something (normal...
void setRelativeDistance(const physical_quantities::CLength &distance)
Set relative distance.
static bool canHandleIndex(CPropertyIndexRef index)
Can given index be handled?
const physical_quantities::CLength & getRelativeDistance() const
Get the distance.
physical_quantities::CAngle m_relativeBearing
temporary stored value
physical_quantities::CLength m_relativeDistance
temporary stored value
ColumnIndex
Properties by index.
bool hasValidRelativeDistance() const
Valid distance?
const physical_quantities::CAngle & getRelativeBearing() const
Get the relative bearing.
ICoordinateWithRelativePosition()=default
Constructor.
bool hasValidRelativeBearing() const
Valid bearing?
void setRelativeBearing(const physical_quantities::CAngle &angle)
Set bearing to own plane.
static bool epsilonZeroLimits(double v)
Epsilon safe zero.
Physical unit angle (radians, degrees).
Physical unit length (length).
Specialized class for distance units (meter, foot, nautical miles).
Free functions in swift::misc.
Stringification traits class.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.
#define SWIFT_DECLARE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template declaration of mixins for a CValueObject subclass to be placed near the top of the ...