Sketcher: Fixed radian/degree mix-up for Angle constraint.
This commit is contained in:
parent
0c449d7e8f
commit
acfe41706c
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#include <Base/Writer.h>
|
#include <Base/Writer.h>
|
||||||
#include <Base/Reader.h>
|
#include <Base/Reader.h>
|
||||||
|
#include <Base/Tools.h>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
|
||||||
#include "Constraint.h"
|
#include "Constraint.h"
|
||||||
|
@ -145,6 +146,7 @@ double Constraint::getPresentationValue() const
|
||||||
else
|
else
|
||||||
return Value;
|
return Value;
|
||||||
case Angle:
|
case Angle:
|
||||||
|
return Base::toDegrees<double>(Value);
|
||||||
case SnellsLaw:
|
case SnellsLaw:
|
||||||
return Value;
|
return Value;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -135,7 +135,7 @@ public:
|
||||||
name = QString::fromLatin1("%1 (%2)").arg(name).arg(Base::Quantity(constraint->getPresentationValue(),Base::Unit::Length).getUserString());
|
name = QString::fromLatin1("%1 (%2)").arg(name).arg(Base::Quantity(constraint->getPresentationValue(),Base::Unit::Length).getUserString());
|
||||||
break;
|
break;
|
||||||
case Sketcher::Angle:
|
case Sketcher::Angle:
|
||||||
name = QString::fromLatin1("%1 (%2)").arg(name).arg(Base::Quantity(Base::toDegrees<double>(constraint->getPresentationValue()),Base::Unit::Angle).getUserString());
|
name = QString::fromLatin1("%1 (%2)").arg(name).arg(Base::Quantity(constraint->getPresentationValue(),Base::Unit::Angle).getUserString());
|
||||||
break;
|
break;
|
||||||
case Sketcher::SnellsLaw: {
|
case Sketcher::SnellsLaw: {
|
||||||
double v = constraint->getPresentationValue();
|
double v = constraint->getPresentationValue();
|
||||||
|
|
|
@ -3824,7 +3824,7 @@ Restart:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
SoDatumLabel *asciiText = dynamic_cast<SoDatumLabel *>(sep->getChild(CONSTRAINT_SEPARATOR_INDEX_MATERIAL_OR_DATUMLABEL));
|
SoDatumLabel *asciiText = dynamic_cast<SoDatumLabel *>(sep->getChild(CONSTRAINT_SEPARATOR_INDEX_MATERIAL_OR_DATUMLABEL));
|
||||||
asciiText->string = SbString(Base::Quantity(Base::toDegrees<double>(Constr->getPresentationValue()),Base::Unit::Angle).getUserString().toUtf8().constData());
|
asciiText->string = SbString(Base::Quantity(Constr->getPresentationValue(),Base::Unit::Angle).getUserString().toUtf8().constData());
|
||||||
asciiText->datumtype = SoDatumLabel::ANGLE;
|
asciiText->datumtype = SoDatumLabel::ANGLE;
|
||||||
asciiText->param1 = Constr->LabelDistance;
|
asciiText->param1 = Constr->LabelDistance;
|
||||||
asciiText->param2 = startangle;
|
asciiText->param2 = startangle;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user