MeshLib
 
Loading...
Searching...
No Matches
MRUnitSettings.h
Go to the documentation of this file.
1#pragma once
2
3#include "exports.h"
4#include "MRUnits.h"
5
6// This abstracts away the UI measurement unit configuration. Internally this uses `setDefaultUnitParams()`.
7
9{
10
11// Common:
12
13// True: `0.1`, false: `.1`.
14[[nodiscard]] MRVIEWER_API bool getShowLeadingZero();
15MRVIEWER_API void setShowLeadingZero( bool show );
16
17// Can be '\0' to indicate no separator.
18// `fractional == true` means to the right of the fractional point, if any.
19[[nodiscard]] MRVIEWER_API char getThousandsSeparator( bool fractional );
20void setThousandsSeparator( char ch, bool fractional );
21
22// Length:
23
24// In addition to length, this also controls the units for speed, area, volume, etc.
25// This can be null to indicate "no unit".
26[[nodiscard]] MRVIEWER_API std::optional<LengthUnit> getUiLengthUnit();
27MRVIEWER_API void setUiLengthUnit( std::optional<LengthUnit> unit );
28
29// Angle:
30
31[[nodiscard]] MRVIEWER_API DegreesMode getDegreesMode();
32// This also calls `setUiAnglePrecision()` to set a default precision depending on the mode.
33MRVIEWER_API void setDegreesMode( DegreesMode mode );
34
35// Precision:
36
37// Whether this means total number of digits or the number of digits after the decimal point depends
38// on another setting (`getDefaultUnitParams().style`) that's currently not exposed in this file.
39[[nodiscard]] MRVIEWER_API int getUiLengthPrecision();
40MRVIEWER_API void setUiLengthPrecision( int precision );
41
42[[nodiscard]] MRVIEWER_API int getUiAnglePrecision();
43MRVIEWER_API void setUiAnglePrecision( int precision );
44
45}
Definition MRUnitSettings.h:9
MRVIEWER_API void setUiLengthUnit(std::optional< LengthUnit > unit)
MRVIEWER_API void setUiAnglePrecision(int precision)
MRVIEWER_API DegreesMode getDegreesMode()
MRVIEWER_API void setShowLeadingZero(bool show)
MRVIEWER_API std::optional< LengthUnit > getUiLengthUnit()
MRVIEWER_API char getThousandsSeparator(bool fractional)
MRVIEWER_API void setUiLengthPrecision(int precision)
void setThousandsSeparator(char ch, bool fractional)
MRVIEWER_API void setDegreesMode(DegreesMode mode)
MRVIEWER_API bool getShowLeadingZero()
MRVIEWER_API int getUiAnglePrecision()
MRVIEWER_API int getUiLengthPrecision()
DegreesMode
Definition MRUnits.h:249