6#include <QRegularExpression>
14using namespace swift::misc::physical_quantities;
16namespace 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>
76 latOrLon.parseFromString(wgs);
82 const double valueDegrees = wgs.
toDouble(&isDouble);
105 case 0: deg = cap.
toInt(&ok);
break;
106 case 1: min = cap.
toInt(&ok);
break;
107 case 2: sec = cap.
toDouble(&ok);
break;
125 template <
class LATorLON>
130 template <
class LATorLON>
135 template <
class LATorLON>
137 : physical_quantities::
CAngle(angle)
140 template <
class LATorLON>
146 template <
class LATorLON>
147 LATorLON
const *CEarthAngle<LATorLON>::derived()
const
149 return static_cast<LATorLON
const *
>(
this);
152 template <
class LATorLON>
153 LATorLON *CEarthAngle<LATorLON>::derived()
155 return static_cast<LATorLON *
>(
this);
158 template <
class LATorLON>
161 return CIcons::GeoPosition;
164 template <
class LATorLON>
170 static const QString vs(
"%1° %2' %3\" %4");
171 if (fractionalDigits < 1)
176 static const QString vsf(
"%1° %2' %3.%4\" %5");
static CAngleUnit rad()
Radians.
static CAngleUnit deg()
Degrees.
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 & operator*=(double multiply)
Multiply operator *=.
CEarthAngle & operator+=(const CEarthAngle &latOrLon)
Plus operator +=.
static LATorLON fromWgs84(const QString &wgsCoordinate)
Latitude / Longitude from a WGS string such as.
LATorLON operator+(const CEarthAngle &latOrLon) const
Plus operator +.
CEarthAngle()
Default constructor.
QString convertToQString(bool i18n=false) const
Cast as QString.
LATorLON operator*(double multiply) const
Multiply operator *.
CEarthAngle & operator-=(const CEarthAngle &latOrLon)
Minus operator-=.
Physical unit angle (radians, degrees).
CAngle()
Default constructor.
DegMinSecFractionalSec asSexagesimalDegMinSec(bool range180Degrees=false) const
As individual values.
Specialized class for angles (degrees, radian).
static CAngleUnit deg()
Degrees.
CPhysicalQuantity & operator+=(const CPhysicalQuantity &other)
CPhysicalQuantity & operator-=(const CPhysicalQuantity &other)
double value(CAngleUnit unit) const
CPhysicalQuantity & operator*=(double multiply)
QString valueRoundedWithUnit(const CAngleUnit &unit, int digits=-1, bool withGroupSeparator=false, bool i18n=false) const
Free functions in swift::misc.
QRegularExpressionMatchIterator globalMatch(QStringView subjectView, qsizetype offset, QRegularExpression::MatchType matchType, QRegularExpression::MatchOptions matchOptions) const const
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.