swift
Loading...
Searching...
No Matches
swift::misc::geo::CEarthAngle< LATorLON > Class Template Reference

Base class for latitude / longitude. More...

#include <earthangle.h>

Inheritance diagram for swift::misc::geo::CEarthAngle< LATorLON >:
[legend]

Public Member Functions

CEarthAngle & operator+= (const CEarthAngle &latOrLon)
 Plus operator +=.
CEarthAngle & operator-= (const CEarthAngle &latOrLon)
 Minus operator-=.
CEarthAngle & operator*= (double multiply)
 Multiply operator *=.
LATorLON operator+ (const CEarthAngle &latOrLon) const
 Plus operator +.
LATorLON operator- (const CEarthAngle &latOrLon) const
 Minus operator -.
LATorLON operator* (double multiply) const
 Multiply operator *.
CIcons::IconIndex toIcon () const
 As icon, not implemented by all classes.
QString convertToQString (bool i18n=false) const
 Cast as QString.
Public Member Functions inherited from swift::misc::physical_quantities::CAngle
 CAngle ()
 Default constructor.
 CAngle (double value, const CAngleUnit &unit)
 Init by double value.
 CAngle (const QString &unitString)
 CAngle (int degrees, int minutes, double seconds)
 Init as sexagesimal degrees, minutes, seconds The sign of all parameters must be the same, either all positive or all negative.
 CAngle (int degrees, double minutes)
 Init as sexagesimal degrees, minutes The sign of both parameters must be the same, either both positive or both negative.
swift::misc::CIcons::IconIndex toIcon () const
 As icon, not implemented by all classes.
DegMinSecFractionalSec asSexagesimalDegMinSec (bool range180Degrees=false) const
 As individual values.
double piFactor () const
 Value as factor of PI (e.g. 0.5PI).
double sin () const
 Sine of angle.
double cos () const
 Cosine of angle.
double tan () const
 Tangent of angle.
void normalizeToPlusMinus180Degrees ()
 Normalize to +- 180deg, [-179.99, 180.0].
void normalizeTo360Degrees ()
 Normalize to 0-360, [0, 359,99].
CAngle normalizedToPlusMinus180Degrees () const
 As [-179.99, 180.0] normalized angle.
CAngle normalizedTo360Degrees () const
 As [0, 359.99] normalized angle.
Public Member Functions inherited from swift::misc::physical_quantities::CPhysicalQuantity< CAngleUnit, CAngle >
const CAngleUnit & getUnit () const
 Unit.
void setUnit (const CAngleUnit &unit)
 Simply set unit, do no calclulate conversion.
void setUnitBySymbol (const QString &unitName)
 Set unit by string.
QString getUnitSymbol () const
 Unit.
CAngle & switchUnit (const CAngleUnit &newUnit)
 Change unit, and convert value to maintain the same quantity.
CAngle switchedUnit (const CAngleUnit &newUnit) const
 Return copy with switched unit.
bool isNull () const
 Is quantity null?
void setNull ()
 Set null.
double value (CAngleUnit unit) const
 Value in given unit.
void setCurrentUnitValue (double value)
 Set value in current unit.
int valueInteger (CAngleUnit unit) const
 As integer value.
QString valueIntegerAsString (CAngleUnit unit) const
 As integer value.
bool isInteger () const
 Is value an integer.
double valueRounded (CAngleUnit unit, int digits=-1) const
 Rounded value in given unit.
QString valueRoundedAsString (CAngleUnit unit, int digits=-1) const
 Rounded value in given unit.
QString valueRoundedWithUnit (const CAngleUnit &unit, int digits=-1, bool withGroupSeparator=false, bool i18n=false) const
 Value to QString with the given unit, e.g. "5.00m".
void roundToEpsilon ()
 Round current value in current unit to epsilon.
void setValueSameUnit (double value)
 Change value without changing unit.
void addValueSameUnit (double value)
 Add to the value in the current unit.
void substractValueSameUnit (double value)
 Substract from the value in the current unit.
CPhysicalQuantity & operator*= (double multiply)
 Multiply operator *=.
CPhysicalQuantity & operator/= (double divide)
 Divide operator /=.
CAngle operator* (double multiply) const
 Operator *.
CAngle operator/ (double divide) const
 Operator /.
CAngle operator- () const
 Unary operator -.
CPhysicalQuantity & operator+= (const CPhysicalQuantity &other)
 Plus operator +=.
CPhysicalQuantity & operator-= (const CPhysicalQuantity &other)
 Minus operator-=.
bool isZeroEpsilonConsidered () const
 Quantity value <= epsilon.
bool isPositiveWithEpsilonConsidered () const
 Value >= 0 epsilon considered.
bool isNegativeWithEpsilonConsidered () const
 Value <= 0 epsilon considered.
const CAngle & makePositive ()
 Make value always positive.
const CAngle & makeNegative ()
 Make value always negative.
CAngle abs () const
 Absolute value (always >=0).
void marshallToDbus (QDBusArgument &argument) const
 Marshall without begin/endStructure, for when composed within another object.
void unmarshallFromDbus (const QDBusArgument &argument)
 Unmarshall without begin/endStructure, for when composed within another object.
void marshalToDataStream (QDataStream &stream) const
 Marshal a value to a QDataStream.
void unmarshalFromDataStream (QDataStream &stream)
 Unmarshal a value from a QDataStream.
size_t getValueHash () const
 qHash overload, needed for storing value in a QSet.
QJsonObject toJson () const
 Cast to JSON object.
void convertFromJson (const QJsonObject &json)
 Assign from JSON object.
QVariant propertyByIndex (CPropertyIndexRef index) const
 Property by index.
void setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant)
 Set property by index.
int comparePropertyByIndex (CPropertyIndexRef index, const CAngle &pq) const
 Compare for index.
QString convertToQString (bool i18n=false) const
 Cast as QString.
void parseFromString (const QString &value)
 Parse value from string.
Public Member Functions inherited from swift::misc::mixin::Index< CAngle >
CPropertyIndexList apply (const CPropertyIndexVariantMap &indexMap, bool skipEqualValues=false)
 Update by variant map.
void setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant)
 Set property by index.
QVariant propertyByIndex (CPropertyIndexRef index) const
 Property by index.
int comparePropertyByIndex (CPropertyIndexRef index, const CAngle &compareValue) const
 Compare for index.
bool equalsPropertyByIndex (const QVariant &compareValue, CPropertyIndexRef index) const
 Is given variant equal to value of property index?
Public Member Functions inherited from swift::misc::mixin::MetaType< CAngle >
int getMetaTypeId () const
 Returns the Qt meta type ID of this object.
QString getClassName () const
 Class name.
bool isA (int metaTypeId) const
 Returns true if this object is an instance of the class with the given meta type ID, or one of its subclasses.
Public Member Functions inherited from swift::misc::mixin::String< CAngle >
QString toQString (bool i18n=false) const
 Cast as QString.
std::string toStdString (bool i18n=false) const
 To std string.
QString stringForStreaming () const
 String for streaming operators.
Public Member Functions inherited from swift::misc::mixin::Icon< CPhysicalQuantity< CAngleUnit, CAngle > >
CIcons::CIcons::StandardIconUnknown16 toIcon () const
 As icon, not implemented by all classes.

Static Public Member Functions

static LATorLON fromWgs84 (const QString &wgsCoordinate)
 Latitude / Longitude from a WGS string such as.
Static Public Member Functions inherited from swift::misc::physical_quantities::CAngle
static void unifySign (int degrees, int &minutes, double &seconds)
 Minutes and secods will get same sign as degrees.
static void unifySign (int degrees, int &minutes)
 Minutes will get same sign as degrees.
static const double & PI ()
 PI as convenience method.
static double normalizeDegrees180 (double degrees, int roundDigits=-1)
 Normalize: -180< degrees ≤180.
static double normalizeDegrees360 (double degrees, int roundDigits=-1)
 Normalize: 0≤ degrees <360.
Static Public Member Functions inherited from swift::misc::physical_quantities::CPhysicalQuantity< CAngleUnit, CAngle >
static const CAngle & maxValue (const CAngle &pq1, const CAngle &pq2)
 Maximum of 2 quantities.
static const CAngle & minValue (const CAngle &pq1, const CAngle &pq2)
 Minimum of 2 quantities.
static const CAngle & null ()
 NULL PQ.
static CAngle parsedFromString (const QString &value, CPqString::SeparatorMode mode=CPqString::SeparatorBestGuess)
 Parsed from given string.
Static Public Member Functions inherited from swift::misc::mixin::MetaType< CAngle >
static void registerMetadata ()
 Register metadata.

Protected Member Functions

 CEarthAngle ()
 Default constructor.
 CEarthAngle (double value, const swift::misc::physical_quantities::CAngleUnit &unit)
 Init by double value.
 CEarthAngle (const swift::misc::physical_quantities::CAngle &angle)
 Init by CAngle value.
QString toWgs84 (const QChar pos, const QChar neg, int fractionalDigits=3) const
 To WGS84 string.
Protected Member Functions inherited from swift::misc::physical_quantities::CPhysicalQuantity< CAngleUnit, CAngle >
 CPhysicalQuantity (double value, CAngleUnit unit)
 Constructor with double.

Additional Inherited Members

Public Types inherited from swift::misc::physical_quantities::CPhysicalQuantity< CAngleUnit, CAngle >
enum  ColumnIndex
 Index. More...
Public Types inherited from swift::misc::mixin::Index< CAngle >
enum  ColumnIndex
 Base class enums. More...

Detailed Description

template<class LATorLON>
class swift::misc::geo::CEarthAngle< LATorLON >

Base class for latitude / longitude.

Definition at line 20 of file earthangle.h.

Constructor & Destructor Documentation

◆ CEarthAngle() [1/3]

template<class LATorLON>
swift::misc::geo::CEarthAngle< LATorLON >::CEarthAngle ( )
protected

Default constructor.

Definition at line 126 of file earthangle.cpp.

◆ CEarthAngle() [2/3]

template<class LATorLON>
swift::misc::geo::CEarthAngle< LATorLON >::CEarthAngle ( double value,
const swift::misc::physical_quantities::CAngleUnit & unit )
protected

Init by double value.

Definition at line 131 of file earthangle.cpp.

◆ CEarthAngle() [3/3]

template<class LATorLON>
swift::misc::geo::CEarthAngle< LATorLON >::CEarthAngle ( const swift::misc::physical_quantities::CAngle & angle)
protected

Init by CAngle value.

Definition at line 136 of file earthangle.cpp.

Member Function Documentation

◆ convertToQString()

template<class LATorLON>
QString swift::misc::geo::CEarthAngle< LATorLON >::convertToQString ( bool i18n = false) const

Cast as QString.

Definition at line 141 of file earthangle.cpp.

◆ fromWgs84()

template<class LATorLON>
LATorLON swift::misc::geo::CEarthAngle< LATorLON >::fromWgs84 ( const QString & wgsCoordinate)
static

Latitude / Longitude from a WGS string such as.

Parameters
wgsCoordinate50° 2′ 0″ N / 8° 34′ 14″ E
Returns

Definition at line 64 of file earthangle.cpp.

◆ operator*()

template<class LATorLON>
LATorLON swift::misc::geo::CEarthAngle< LATorLON >::operator* ( double multiply) const

Multiply operator *.

Definition at line 56 of file earthangle.cpp.

◆ operator*=()

template<class LATorLON>
CEarthAngle< LATorLON > & swift::misc::geo::CEarthAngle< LATorLON >::operator*= ( double multiply)

Multiply operator *=.

Definition at line 33 of file earthangle.cpp.

◆ operator+()

template<class LATorLON>
LATorLON swift::misc::geo::CEarthAngle< LATorLON >::operator+ ( const CEarthAngle< LATorLON > & latOrLon) const

Plus operator +.

Definition at line 40 of file earthangle.cpp.

◆ operator+=()

template<class LATorLON>
CEarthAngle< LATorLON > & swift::misc::geo::CEarthAngle< LATorLON >::operator+= ( const CEarthAngle< LATorLON > & latOrLon)

Plus operator +=.

Definition at line 19 of file earthangle.cpp.

◆ operator-()

template<class LATorLON>
LATorLON swift::misc::geo::CEarthAngle< LATorLON >::operator- ( const CEarthAngle< LATorLON > & latOrLon) const

Minus operator -.

Definition at line 48 of file earthangle.cpp.

◆ operator-=()

template<class LATorLON>
CEarthAngle< LATorLON > & swift::misc::geo::CEarthAngle< LATorLON >::operator-= ( const CEarthAngle< LATorLON > & latOrLon)

Minus operator-=.

Definition at line 26 of file earthangle.cpp.

◆ toIcon()

template<class LATorLON>
CIcons::IconIndex swift::misc::geo::CEarthAngle< LATorLON >::toIcon ( ) const

As icon, not implemented by all classes.

Definition at line 159 of file earthangle.cpp.

◆ toWgs84()

template<class LATorLON>
QString swift::misc::geo::CEarthAngle< LATorLON >::toWgs84 ( const QChar pos,
const QChar neg,
int fractionalDigits = 3 ) const
protected

To WGS84 string.

Definition at line 165 of file earthangle.cpp.


The documentation for this class was generated from the following files: