swift
Loading...
Searching...
No Matches
longitude.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_LONGITUDE_H
7#define SWIFT_MISC_GEO_LONGITUDE_H
8
11
12namespace swift::misc::geo
13{
16 public CEarthAngle<CLongitude>,
17 public mixin::MetaType<CLongitude>,
18 public mixin::String<CLongitude>,
19 public mixin::DBusOperators<CLongitude>,
20 public mixin::DataStreamOperators<CLatitude>,
21 public mixin::Index<CLongitude>
22 {
23 public:
26
30
31
32 QString toWgs84(int withFragmentSecDigits = 3) const
33 {
34 return CEarthAngle<CLongitude>::toWgs84('E', 'W', withFragmentSecDigits);
35 }
36
38 QString convertToQString(bool i18n = false) const
39 {
41 if (!this->isZeroEpsilonConsidered())
42 {
43 s.append(this->isNegativeWithEpsilonConsidered() ? " W" : " E");
44 }
45 return s;
46 }
47
49 CLongitude() = default;
50
53
57 };
58} // namespace swift::misc::geo
59
60Q_DECLARE_METATYPE(swift::misc::geo::CLongitude)
61
62#endif // SWIFT_MISC_GEO_LONGITUDE_H
QString toWgs84(const QChar pos, const QChar neg, int fractionalDigits=3) const
To WGS84 string.
QString convertToQString(bool i18n=false) const
Cast as QString.
CEarthAngle< CLongitude > base_type
Base type.
Definition longitude.h:25
QString toWgs84(int withFragmentSecDigits=3) const
To WGS84 string.
Definition longitude.h:32
CLongitude()=default
Default constructor.
QString convertToQString(bool i18n=false) const
Cast as QString.
Definition longitude.h:38
CLongitude(const swift::misc::physical_quantities::CAngle &angle)
Constructor.
Definition longitude.h:52
CLongitude(double value, const swift::misc::physical_quantities::CAngleUnit &unit)
Init by double value Longitude measurements range from 0° to (+/–)180°.
Definition longitude.h:56
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...
CRTP class template from which a derived class can inherit string streaming operations.
Definition mixinstring.h:29
Physical unit angle (radians, degrees).
Definition angle.h:23
Specialized class for angles (degrees, radian).
Definition units.h:231
#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:159
#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...
QString & append(QChar ch)
#define SWIFT_MISC_EXPORT
Export a class or function from the library.