6 #include <QRegularExpression>
14 using namespace swift::misc::physical_quantities;
16 namespace swift::misc::geo
18 template <
class LATorLON>
25 template <
class LATorLON>
32 template <
class LATorLON>
39 template <
class LATorLON>
47 template <
class LATorLON>
55 template <
class LATorLON>
63 template <
class LATorLON>
67 if (wgs.
isEmpty()) {
return LATorLON(); }
73 latOrLon.parseFromString(wgs);
79 const double valueDegrees = wgs.
toDouble(&isDouble);
102 case 0: deg = cap.
toInt(&ok);
break;
103 case 1: min = cap.
toInt(&ok);
break;
104 case 2: sec = cap.
toDouble(&ok);
break;
118 physical_quantities::CAngle a(deg, min, sec);
122 template <
class LATorLON>
124 : physical_quantities::
CAngle(0.0, swift::misc::physical_quantities::
CAngleUnit::deg())
127 template <
class LATorLON>
129 : physical_quantities::
CAngle(value, unit)
132 template <
class LATorLON>
134 : physical_quantities::
CAngle(angle)
137 template <
class LATorLON>
143 template <
class LATorLON>
146 return static_cast<LATorLON
const *
>(
this);
149 template <
class LATorLON>
150 LATorLON *CEarthAngle<LATorLON>::derived()
152 return static_cast<LATorLON *
>(
this);
155 template <
class LATorLON>
158 return CIcons::GeoPosition;
161 template <
class LATorLON>
167 static const QString vs(
"%1° %2' %3\" %4");
170 static const QString vsf(
"%1° %2' %3.%4\" %5");
IconIndex
Index for each icon, allows to send them via DBus, efficiently store them, etc.
Base class for latitude / longitude.
CIcons::IconIndex toIcon() const
As icon, not implemented by all classes.
QString toWgs84(const QChar pos, const QChar neg, int fractionalDigits=3) const
To WGS84 string.
CEarthAngle()
Default constructor.
QString convertToQString(bool i18n=false) const
Cast as QString.
Physical unit angle (radians, degrees)
Specialized class for angles (degrees, radian).
static CAngleUnit rad()
Radians.
static CAngleUnit deg()
Degrees.
CPhysicalQuantity & operator+=(const CPhysicalQuantity &other)
Plus operator +=.
CPhysicalQuantity & operator-=(const CPhysicalQuantity &other)
Minus operator-=.
CPhysicalQuantity & operator*=(double multiply)
Multiply operator *=.
QString captured(QAnyStringView name) const const
bool hasMatch() const const
bool hasNext() const const
QRegularExpressionMatch next()
QString arg(Args &&... args) const const
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
QString simplified() const const
double toDouble(bool *ok) const const
int toInt(bool *ok, int base) const const
QString trimmed() const const
Value as individual values.
QString fractionalSecAsString(int width=-1) const
Fractional seconds as string.