MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / setUiLengthUnit

Function setUiLengthUnit

source/MRViewer/MRUnitSettings.cpp:155–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155void setUiLengthUnit( std::optional<LengthUnit> unit, bool setPreferredLeadingZero )
156{
157 // Override the leading zero. Everything except inches enables it.
158 if ( setPreferredLeadingZero )
159 setShowLeadingZero( unit != LengthUnit::inches );
160
161 auto getDependentUnit = getLengthDependentUnit();
162
163 forAllLengthUnits( [&]<typename E>()
164 {
165 auto params = getDefaultUnitParams<E>();
166 params.targetUnit = unit ? std::optional( getDependentUnit.template operator()<E>( *unit ) ) : std::nullopt;
167 setDefaultUnitParams( params );
168 } );
169}
170
171std::optional<LengthUnit> getModelLengthUnit()
172{

Callers 3

loadSettingsMethod · 0.85
resetToDefaultsFunction · 0.85

Calls 4

setShowLeadingZeroFunction · 0.85
getLengthDependentUnitFunction · 0.85
forAllLengthUnitsFunction · 0.85
setDefaultUnitParamsFunction · 0.85

Tested by

no test coverage detected