MeshLib C++ Docs
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
12MRVIEWER_API void resetToDefaults();
13
14// Common:
15
17[[nodiscard]] MRVIEWER_API bool getShowLeadingZero();
18MRVIEWER_API void setShowLeadingZero( bool show );
19
22[[nodiscard]] MRVIEWER_API char getThousandsSeparator();
23MRVIEWER_API void setThousandsSeparator( char ch );
24
25// Length:
26
31[[nodiscard]] MRVIEWER_API std::optional<LengthUnit> getUiLengthUnit();
32MRVIEWER_API void setUiLengthUnit( std::optional<LengthUnit> unit, bool setPreferredLeadingZero );
33
37[[nodiscard]] MRVIEWER_API std::optional<LengthUnit> getModelLengthUnit();
38MRVIEWER_API void setModelLengthUnit( std::optional<LengthUnit> unit );
39
43[[nodiscard]] MRVIEWER_API std::optional<LengthUnit> getActualModelLengthUnit();
44
45// Angle:
46
47[[nodiscard]] MRVIEWER_API DegreesMode getDegreesMode();
48MRVIEWER_API void setDegreesMode( DegreesMode mode, bool setPreferredPrecision );
49
50// Precision:
51
54[[nodiscard]] MRVIEWER_API int getUiLengthPrecision();
55MRVIEWER_API void setUiLengthPrecision( int precision );
56
57[[nodiscard]] MRVIEWER_API int getUiAnglePrecision();
58MRVIEWER_API void setUiAnglePrecision( int precision );
59
60[[nodiscard]] MRVIEWER_API int getUiRatioPrecision();
61MRVIEWER_API void setUiRatioPrecision( int precision );
62
63} // namespace MR::UnitSettings
Definition MRUnitSettings.h:9
MRVIEWER_API char getThousandsSeparator()
MRVIEWER_API void setThousandsSeparator(char ch)
MRVIEWER_API void setDegreesMode(DegreesMode mode, bool setPreferredPrecision)
MRVIEWER_API int getUiRatioPrecision()
MRVIEWER_API void setUiAnglePrecision(int precision)
MRVIEWER_API DegreesMode getDegreesMode()
MRVIEWER_API void setShowLeadingZero(bool show)
MRVIEWER_API void setUiRatioPrecision(int precision)
MRVIEWER_API std::optional< LengthUnit > getUiLengthUnit()
MRVIEWER_API std::optional< LengthUnit > getActualModelLengthUnit()
MRVIEWER_API void setUiLengthPrecision(int precision)
MRVIEWER_API bool getShowLeadingZero()
True: 0.1, false: .1.
MRVIEWER_API void setModelLengthUnit(std::optional< LengthUnit > unit)
MRVIEWER_API void setUiLengthUnit(std::optional< LengthUnit > unit, bool setPreferredLeadingZero)
MRVIEWER_API void resetToDefaults()
Reset to some sane default.
MRVIEWER_API std::optional< LengthUnit > getModelLengthUnit()
MRVIEWER_API int getUiAnglePrecision()
MRVIEWER_API int getUiLengthPrecision()
DegreesMode
Definition MRUnits.h:50