This abstracts away the UI measurement unit configuration. Internally this uses setDefaultUnitParams().
More...
This abstracts away the UI measurement unit configuration. Internally this uses setDefaultUnitParams().
◆ getActualModelLengthUnit()
| MRVIEWER_API std::optional< LengthUnit > MR::UnitSettings::getActualModelLengthUnit |
( |
| ) |
|
|
nodiscard |
Returns the units in which the coordinates are stored in the memory of MeshLib-based application; it is computes as getModelLengthUnit().or_else( getUiLengthUnit() ); this function is important for serialization in the formats with known length units
◆ getDegreesMode()
| MRVIEWER_API DegreesMode MR::UnitSettings::getDegreesMode |
( |
| ) |
|
|
nodiscard |
◆ getModelLengthUnit()
| MRVIEWER_API std::optional< LengthUnit > MR::UnitSettings::getModelLengthUnit |
( |
| ) |
|
|
nodiscard |
Set "sourceUnit" for Length based dimensions, which reflects on scaling input data to match "targetUnit" Length based dimensions: length, speed, area, volume, etc This can be null to indicate "no unit".
◆ getShowLeadingZero()
| MRVIEWER_API bool MR::UnitSettings::getShowLeadingZero |
( |
| ) |
|
|
nodiscard |
Common:
True: 0.1, false: .1.
◆ getThousandsSeparator()
| MRVIEWER_API char MR::UnitSettings::getThousandsSeparator |
( |
| ) |
|
|
nodiscard |
Can be '\0' to indicate no separator. fractional == true means to the right of the fractional point, if any.
◆ getUiAnglePrecision()
| MRVIEWER_API int MR::UnitSettings::getUiAnglePrecision |
( |
| ) |
|
|
nodiscard |
◆ getUiLengthPrecision()
| MRVIEWER_API int MR::UnitSettings::getUiLengthPrecision |
( |
| ) |
|
|
nodiscard |
Precision:
Whether this means total number of digits or the number of digits after the decimal point depends on another setting (getDefaultUnitParams().style) that's currently not exposed in this file.
◆ getUiLengthUnit()
| MRVIEWER_API std::optional< LengthUnit > MR::UnitSettings::getUiLengthUnit |
( |
| ) |
|
|
nodiscard |
Length:
Set "targetUnit" for Length based dimensions, which reflects on UI suffix Length based dimensions: length, speed, area, volume, etc This can be null to indicate "no unit". If setPreferredLeadingZero == true, will call setShowLeadingZero() to match this unit (currently inches = false, everything else = true).
◆ getUiRatioPrecision()
| MRVIEWER_API int MR::UnitSettings::getUiRatioPrecision |
( |
| ) |
|
|
nodiscard |
◆ resetToDefaults()
| MRVIEWER_API void MR::UnitSettings::resetToDefaults |
( |
| ) |
|
Reset to some sane default.
◆ setDegreesMode()
| MRVIEWER_API void MR::UnitSettings::setDegreesMode |
( |
DegreesMode | mode, |
|
|
bool | setPreferredPrecision ) |
◆ setModelLengthUnit()
| MRVIEWER_API void MR::UnitSettings::setModelLengthUnit |
( |
std::optional< LengthUnit > | unit | ) |
|
◆ setShowLeadingZero()
| MRVIEWER_API void MR::UnitSettings::setShowLeadingZero |
( |
bool | show | ) |
|
◆ setThousandsSeparator()
| MRVIEWER_API void MR::UnitSettings::setThousandsSeparator |
( |
char | ch | ) |
|
◆ setUiAnglePrecision()
| MRVIEWER_API void MR::UnitSettings::setUiAnglePrecision |
( |
int | precision | ) |
|
◆ setUiLengthPrecision()
| MRVIEWER_API void MR::UnitSettings::setUiLengthPrecision |
( |
int | precision | ) |
|
◆ setUiLengthUnit()
| MRVIEWER_API void MR::UnitSettings::setUiLengthUnit |
( |
std::optional< LengthUnit > | unit, |
|
|
bool | setPreferredLeadingZero ) |
◆ setUiRatioPrecision()
| MRVIEWER_API void MR::UnitSettings::setUiRatioPrecision |
( |
int | precision | ) |
|