double nuiRange::GetUnitValue() const { NGL_ASSERT(IsValid()); const double v = ConvertToUnit(GetValue()); NGL_ASSERT(finite(v)); return v; }
//---------------------------------------- double CUnit::ConvertToUnit(const double fromValue, double defaultValue /* = CTools::m_defaultValueDOUBLE */) { double out = defaultValue; if (isDefaultValue(fromValue)) { if (!isDefaultValue(defaultValue)) { out = ConvertToUnit(defaultValue); } return out; } CUnit unit = this->BaseUnit(); unit.SetConversionTo(*this); out = unit.Convert(fromValue); return out; }