swift
latitude.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_MISC_GEO_LATITUDE_H
7 #define SWIFT_MISC_GEO_LATITUDE_H
8 
9 #include "misc/geo/earthangle.h"
10 #include "misc/swiftmiscexport.h"
11 
12 namespace swift::misc::geo
13 {
16  public CEarthAngle<CLatitude>,
17  public mixin::MetaType<CLatitude>,
18  public mixin::String<CLatitude>,
19  public mixin::DBusOperators<CLatitude>,
20  public mixin::DataStreamOperators<CLatitude>,
21  public mixin::Index<CLatitude>
22  {
23  public:
26 
30 
31 
32  QString toWgs84(int fractionalDigits = 3) const
33  {
34  return CEarthAngle<CLatitude>::toWgs84('N', 'S', fractionalDigits);
35  }
36 
38  QString convertToQString(bool i18n = false) const
39  {
40  QString s(CEarthAngle::convertToQString(i18n));
41  if (!this->isZeroEpsilonConsidered()) { s.append(this->isNegativeWithEpsilonConsidered() ? " S" : " N"); }
42  return s;
43  }
44 
46  CLatitude() = default;
47 
50 
53  CLatitude(double value, const swift::misc::physical_quantities::CAngleUnit &unit) : CEarthAngle(value, unit) {}
54  };
55 } // namespace swift::misc::geo
56 
57 Q_DECLARE_METATYPE(swift::misc::geo::CLatitude)
58 
59 #endif // SWIFT_MISC_GEO_LATITUDE_H
Base class for latitude / longitude.
Definition: earthangle.h:21
QString toWgs84(const QChar pos, const QChar neg, int fractionalDigits=3) const
To WGS84 string.
Definition: earthangle.cpp:162
QString convertToQString(bool i18n=false) const
Cast as QString.
Definition: earthangle.cpp:138
CLatitude(double value, const swift::misc::physical_quantities::CAngleUnit &unit)
Init by double value.
Definition: latitude.h:53
CLatitude()=default
Default constructor.
QString convertToQString(bool i18n=false) const
Cast as QString.
Definition: latitude.h:38
CLatitude(const swift::misc::physical_quantities::CAngle &angle)
Constructor.
Definition: latitude.h:49
CRTP class template which will generate marshalling operators for a derived class with its own marsha...
Definition: mixindbus.h:39
CRTP class template to generate non-member QDataStream streaming operators.
CRTP class template from which a derived class can inherit property indexing functions.
Definition: mixinindex.h:40
CRTP class template from which a derived class can inherit common methods dealing with the metatype o...
Definition: mixinmetatype.h:29
CRTP class template from which a derived class can inherit string streaming operations.
Definition: mixinstring.h:31
Physical unit angle (radians, degrees)
Definition: angle.h:23
Specialized class for angles (degrees, radian).
Definition: units.h:233
#define SWIFT_MISC_DECLARE_USING_MIXIN_INDEX(DERIVED)
When a derived class and a base class both inherit from mixin::Index, the derived class uses this mac...
Definition: mixinindex.h:151
#define SWIFT_MISC_DECLARE_USING_MIXIN_METATYPE(DERIVED)
When a derived class and a base class both inherit from mixin::MetaType, the derived class uses this ...
#define SWIFT_MISC_DECLARE_USING_MIXIN_STRING(DERIVED)
When a derived class and a base class both inherit from mixin::String, the derived class uses this ma...
Definition: mixinstring.h:110
#define SWIFT_MISC_EXPORT
Export a class or function from the library.