Esempio n. 1
0
double nuiRange::GetUnitValue() const
{
  NGL_ASSERT(IsValid());
  const double v = ConvertToUnit(GetValue());
  NGL_ASSERT(finite(v));
  return v;
}
Esempio n. 2
0
//----------------------------------------
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;
}