|
swift
|
Specialized class for angles (degrees, radian). More...
Public Types | |
| using | base_type = CMeasurementUnit |
| Base type. | |
Public Types inherited from swift::misc::mixin::Index< CAngleUnit > | |
| enum | ColumnIndex |
| Base class enums. | |
Public Member Functions | |
| CAngleUnit () | |
| Default constructor, required for Qt Metasystem. | |
| CAngleUnit (std::nullptr_t) | |
| Null constructor. | |
| QString | makeRoundedQStringWithUnit (double value, int digits=-1, bool withGroupSeparator=false, bool i18n=false) const |
| Value rounded with unit, e.g. "5.00m", "30kHz". More... | |
| void | unmarshallFromDbus (const QDBusArgument &argument) |
| Unmarshall without begin/endStructure, for when composed within another object. More... | |
| void | unmarshalFromDataStream (QDataStream &stream) |
| Unmarshal a value from a QDataStream. More... | |
Public Member Functions inherited from swift::misc::physical_quantities::CMeasurementUnit | |
| CMeasurementUnit (const Data &&)=delete | |
| Constructor saves the address of its argument, so forbid rvalues. | |
| QString | convertToQString (bool i18n=false) const |
| Cast as QString. More... | |
| void | marshallToDbus (QDBusArgument &argument) const |
| Marshall without begin/endStructure, for when composed within another object. More... | |
| void | unmarshallFromDbus (const QDBusArgument &) |
| Unmarshall without begin/endStructure, for when composed within another object. More... | |
| void | marshalToDataStream (QDataStream &stream) const |
| Marshal a value to a QDataStream. More... | |
| void | unmarshalFromDataStream (QDataStream &) |
| Unmarshal a value from a QDataStream. More... | |
| QString | getName (bool i18n=false) const |
| Name such as "meter". | |
| QString | getSymbol (bool i18n=false) const |
| Unit name such as "m". | |
| bool | endsStringWithNameOrSymbol (const QString &candidate, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
| Does a string end with name or symbol? E.g. 3meter, 3m, 3deg. | |
| double | roundValue (double value, int digits=-1) const |
| Rounded value. More... | |
| double | roundToEpsilon (double value) const |
| Rounded to the nearest CMeasurementUnit::getEpsilon. More... | |
| virtual QString | makeRoundedQString (double value, int digits=-1, bool withGroupSeparator=false, bool i18n=false) const |
| Rounded string utility method, virtual so units can have specialized formatting. More... | |
| double | getEpsilon () const |
| Threshold for comparions. | |
| int | getDisplayDigits () const |
| Display digits. | |
| double | convertFrom (double value, const CMeasurementUnit &unit) const |
| Convert from other unit to this unit. | |
| bool | isEpsilon (double value) const |
| Is given value <= epsilon? | |
| bool | isNull () const |
| Is unit null? | |
Public Member Functions inherited from swift::misc::mixin::String< CMeasurementUnit > | |
| 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< CMeasurementUnit > | |
| CIcons::IconIndex | toIcon () const |
| As icon, not implemented by all classes. | |
Public Member Functions inherited from swift::misc::mixin::MetaType< CAngleUnit > | |
| int | getMetaTypeId () const |
| Returns the Qt meta type ID of this object. More... | |
| 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::Index< CAngleUnit > | |
| CPropertyIndexList | apply (const CPropertyIndexVariantMap &indexMap, bool skipEqualValues=false) |
| Update by variant map. More... | |
| void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
| Set property by index. | |
| QVariant | propertyByIndex (CPropertyIndexRef index) const |
| Property by index. | |
| int | comparePropertyByIndex (CPropertyIndexRef index, const CAngleUnit &compareValue) const |
| Compare for index. | |
| bool | equalsPropertyByIndex (const QVariant &compareValue, CPropertyIndexRef index) const |
| Is given variant equal to value of property index? | |
Static Public Member Functions | |
| static CAngleUnit | defaultUnit () |
| Default unit. | |
| static CAngleUnit | nullUnit () |
| Null unit. | |
| static CAngleUnit | rad () |
| Radians. | |
| static CAngleUnit | deg () |
| Degrees. | |
| static CAngleUnit | sexagesimalDeg () |
| Sexagesimal degree (degrees, minutes, seconds, decimal seconds) | |
| static CAngleUnit | sexagesimalDegMin () |
| Sexagesimal degree (degrees, minutes, decimal minutes) | |
| static const QList< CAngleUnit > & | allUnits () |
| All units. | |
Static Public Member Functions inherited from swift::misc::physical_quantities::CMeasurementUnit | |
| template<class U > | |
| static U | unitFromSymbol (const QString &symbol, bool strict=true) |
| Unit from symbol. More... | |
| template<class U > | |
| static const QStringList & | allSymbols () |
| All symbols. | |
| template<class U > | |
| static const QStringList & | allSymbolsLowerCase () |
| All symbols case insensitive. | |
| template<class U > | |
| static bool | hasCaseSensitiveSymbols () |
| Are symbols case sensitive? | |
| template<class U > | |
| static bool | isValidUnitSymbol (const QString &symbol) |
| Valid unit symbol? More... | |
| template<class U > | |
| static bool | isValidUnitSymbol (const QString &symbol, Qt::CaseSensitivity caseSensitivity) |
| Valid unit symbol? More... | |
| template<class U > | |
| static bool | containsValidUnitSymbol (const QString &candidate, Qt::CaseSensitivity caseSensitivity=Qt::CaseSensitive) |
| Contains valid unit symbol? More... | |
| template<class U > | |
| static bool | endWithValidUnitSymbol (const QString &candidate, Qt::CaseSensitivity caseSensitivity=Qt::CaseSensitive) |
| Ends with valid unit symbol? More... | |
| static CMeasurementUnit | None () |
| Dimensionless unit. | |
Static Public Member Functions inherited from swift::misc::mixin::MetaType< CAngleUnit > | |
| static void | registerMetadata () |
| Register metadata. | |
Additional Inherited Members | |
Protected Types inherited from swift::misc::physical_quantities::CMeasurementUnit | |
| using | ConverterFunction = double(*)(double) |
| Pointer to function for converting between units. | |
Protected Member Functions inherited from swift::misc::physical_quantities::CMeasurementUnit | |
| CMeasurementUnit (const Data &data) | |
| Constructor. | |
| ~CMeasurementUnit ()=default | |
| Destructor. | |
| CMeasurementUnit (const CMeasurementUnit &)=default | |
| Copy constructor. | |
| CMeasurementUnit & | operator= (const CMeasurementUnit &)=default |
| Copy assignment operator. | |
Static Protected Member Functions inherited from swift::misc::physical_quantities::CMeasurementUnit | |
| template<int N> | |
| static constexpr QLatin1String | constQLatin1 (const char(&str)[N]) |
| Constant-initialize QLatin1String without using strlen. | |
|
virtual |
Value rounded with unit, e.g. "5.00m", "30kHz".
Reimplemented from swift::misc::physical_quantities::CMeasurementUnit.
|
inline |
Unmarshal a value from a QDataStream.
|
inline |