Sketcher: Changed return type of Constraint::getPresentationValue() to Quantity, to be able to include unit.

This commit is contained in:
Eivind Kvedalen
2016-06-14 01:13:33 +02:00
committed by wmayer
parent 171fce7b19
commit 7afcb4beda
4 changed files with 12 additions and 19 deletions

View File

@@ -133,20 +133,20 @@ double Constraint::getValue() const
return Value;
}
double Constraint::getPresentationValue() const
Quantity Constraint::getPresentationValue() const
{
switch (Type) {
case Distance:
case Radius:
return Value;
return Quantity(Value, Unit::Length);
case DistanceX:
case DistanceY:
if (FirstPos == Sketcher::none || Second != Sketcher::Constraint::GeoUndef)
return Value;
return Quantity(Value, Unit::Length);
else
return Value;
return Quantity(Value, Unit::Length);
case Angle:
return Base::toDegrees<double>(Value);
return Quantity(toDegrees<double>(Value), Unit::Angle);
case SnellsLaw:
return Value;
default: