6 #ifndef SWIFT_MISC_GEO_COORDINATEGEODETIC_H
7 #define SWIFT_MISC_GEO_COORDINATEGEODETIC_H
44 IndexLatitude = CPropertyIndexRef::GlobalIndexICoordinateGeodetic,
46 IndexLatitudeAsString,
47 IndexLongitudeAsString,
49 IndexGeodeticHeightAsString,
92 bool equalNormalVectorDouble(
const std::array<double, 3> &otherVector)
const;
115 virtual bool isNull()
const {
return this->normalVector().isNull(); }
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()))
267 virtual CLatitude latitude()
const override;
270 virtual CLongitude longitude()
const override;
276 virtual QVector3D normalVector()
const override;
279 virtual 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);
342 this->setNormalVector(0, 0, 0);
343 m_geodeticHeight.setNull();
349 if (m_geodeticHeight.isNull()) {
return true; }
355 static CCoordinateGeodetic fromWgs84(
const QString &latitudeWgs84,
const QString &longitudeWgs84,
359 static const CCoordinateGeodetic &
null();
362 QString convertToQString(
bool i18n =
false)
const;
384 struct TString<geo::ICoordinateGeodetic>
386 static QString toQString(
const geo::ICoordinateGeodetic &coord) {
return coord.convertToQString(); }
Non-owning reference to a CPropertyIndex with a subset of its features.
Mix of the most commonly used mixin classes.
Altitude as used in aviation, can be AGL or MSL altitude.
void setNull()
Set to null.
void setNormalVector(double x, double y, double z)
Set normal vector.
CCoordinateGeodetic()
Default constructor (null coordinate)
virtual const aviation::CAltitude & geodeticHeight() const
Height, ellipsoidal or geodetic height (used in GPS)
virtual bool isNull() const
Is null?
void setGeodeticHeight(const aviation::CAltitude &height)
Set height (ellipsoidal or geodetic height)
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.
virtual std::array< double, 3 > normalVectorDouble() const =0
Normal vector with double precision.
ColumnIndex
Properties by index.
QString longitudeAsString() const
Longitude as string.
virtual bool isNull() const
Is null, means vector x, y, z == 0.
ICoordinateGeodetic & operator=(const ICoordinateGeodetic &)=default
Copy assignment operator.
virtual const aviation::CAltitude & geodeticHeight() const =0
Height, ellipsoidal or geodetic height (used in GPS)
QString latitudeAsString() const
Latitude as string.
QString geodeticHeightAsString() const
Height as string.
bool isGeodeticHeightNull() const
Geodetic height null?
virtual CLatitude latitude() const =0
Latitude.
Interface (actually more an abstract class) of coordinates and relative position to something (normal...
const physical_quantities::CLength & getRelativeDistance() const
Get the distance.
void setRelativeDistance(const physical_quantities::CLength &distance)
Set relative distance.
const physical_quantities::CAngle & getRelativeBearing() const
Get the relative bearing.
bool hasValidRelativeDistance() const
Valid distance?
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.
#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 ...