| 153 | } |
| 154 | |
| 155 | void 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 | |
| 171 | std::optional<LengthUnit> getModelLengthUnit() |
| 172 | { |
no test coverage detected