fillAttribute(SketcherPrs_Tools::ANGLE_DIRECT,
aFeature->integer(SketchPlugin_ConstraintAngle::TYPE_ID()));
// fill the value before llines to avoid calculation of angle value by the Angle feature
- fillAttribute(theValue, aFeature->real(SketchPlugin_Constraint::VALUE()));
+ fillAttribute(theValue, aFeature->real(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID()));
fillAttribute(theLine1, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
fillAttribute(theLine2, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
aFeature->execute();
myFlyoutUpdate = false;
}
else if (theID == SketchPlugin_ConstraintAngle::TYPE_ID()) {
- std::shared_ptr<ModelAPI_AttributeDouble> aValueAttr = std::dynamic_pointer_cast<
- ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID()));
double anAngle = calculateAngle();
+ std::shared_ptr<ModelAPI_AttributeDouble> aValueAttr = std::dynamic_pointer_cast<
+ ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_ConstraintAngle::VALUE()));
aValueAttr->setValue(anAngle);
}
else if (theID == SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID()) {
}
double anAngle = anAng->angleDegree();
std::shared_ptr<ModelAPI_AttributeDouble> aValueAttr = std::dynamic_pointer_cast<
- ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_ConstraintAngle::VALUE()));
+ ModelAPI_AttributeDouble>(data()->attribute(VALUE()));
+ std::shared_ptr<ModelAPI_AttributeDouble> anAngleValueAttr = std::dynamic_pointer_cast<
+ ModelAPI_AttributeDouble>(data()->attribute(ANGLE_VALUE_ID()));
if (!aValueAttr->isInitialized())
aValueAttr->setValue(anAngle);
/// an angle value should be corrected by the current angle type
- anAngle = getAngleForType(anAngle);
+ anAngle = getAngleForType(anAngleValueAttr->text().empty() ?
+ anAngle : anAngleValueAttr->value());
boolean(ANGLE_REVERSED_FIRST_LINE_ID())->setValue(anAng->isReversed(0));
boolean(ANGLE_REVERSED_SECOND_LINE_ID())->setValue(anAng->isReversed(1));
return anAngle;
#include <GeomAPI_Pnt2d.h>
#include <GeomAPI_XY.h>
+#include <ModelAPI_AttributeInteger.h>
+
+#include <SketchPlugin_ConstraintAngle.h>
+
#include <cmath>
void SketchSolver_ConstraintAngle::getAttributes(
SketchSolver_Constraint::getAttributes(theValue, theAttributes);
myAngle = theValue;
+ myType = myBaseConstraint->integer(SketchPlugin_ConstraintAngle::TYPE_ID())->value();
}
myAngle = aConstraint->value();
aBuilder->adjustConstraint(aConstraint);
myStorage->addConstraint(myBaseConstraint, aConstraint);
+
+ int aType = myBaseConstraint->integer(SketchPlugin_ConstraintAngle::TYPE_ID())->value();
+ if (aType != myType) {
+ myType = aType;
+ myStorage->setNeedToResolve(true);
+ }
}