MeshLib C++ Docs
Loading...
Searching...
No Matches
MR::UnitSettings Namespace Reference

Functions

MRVIEWER_API void resetToDefaults ()
 Reset to some sane default.
 
MRVIEWER_API bool getShowLeadingZero ()
 True: 0.1, false: .1.
 
MRVIEWER_API void setShowLeadingZero (bool show)
 
MRVIEWER_API char getThousandsSeparator ()
 
MRVIEWER_API void setThousandsSeparator (char ch)
 
MRVIEWER_API std::optional< LengthUnitgetUiLengthUnit ()
 
MRVIEWER_API void setUiLengthUnit (std::optional< LengthUnit > unit, bool setPreferredLeadingZero)
 
MRVIEWER_API std::optional< LengthUnitgetModelLengthUnit ()
 
MRVIEWER_API void setModelLengthUnit (std::optional< LengthUnit > unit)
 
MRVIEWER_API std::optional< LengthUnitgetActualModelLengthUnit ()
 
MRVIEWER_API DegreesMode getDegreesMode ()
 
MRVIEWER_API void setDegreesMode (DegreesMode mode, bool setPreferredPrecision)
 
MRVIEWER_API int getUiLengthPrecision ()
 
MRVIEWER_API void setUiLengthPrecision (int precision)
 
MRVIEWER_API int getUiAnglePrecision ()
 
MRVIEWER_API void setUiAnglePrecision (int precision)
 
MRVIEWER_API int getUiRatioPrecision ()
 
MRVIEWER_API void setUiRatioPrecision (int precision)
 

Function Documentation

◆ 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

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

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

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)