1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 #include <SketchSolver_ConstraintAngle.h>
4 #include <SketchSolver_Manager.h>
6 #include <GeomAPI_Dir2d.h>
7 #include <GeomAPI_Lin2d.h>
8 #include <GeomAPI_Pnt2d.h>
9 #include <GeomAPI_XY.h>
11 #include <ModelAPI_AttributeInteger.h>
13 #include <SketchPlugin_ConstraintAngle.h>
17 void SketchSolver_ConstraintAngle::getAttributes(
18 double& theValue, std::vector<EntityWrapperPtr>& theAttributes)
20 SketchSolver_Constraint::getAttributes(theValue, theAttributes);
23 myType = myBaseConstraint->integer(SketchPlugin_ConstraintAngle::TYPE_ID())->value();
27 void SketchSolver_ConstraintAngle::adjustConstraint()
29 static const double aTol = 1000. * tolerance;
30 BuilderPtr aBuilder = SketchSolver_Manager::instance()->builder();
32 ConstraintWrapperPtr aConstraint = myStorage->constraint(myBaseConstraint).front();
33 //if (fabs(myAngle - aConstraint->value()) < aTol)
35 myAngle = aConstraint->value();
36 aBuilder->adjustConstraint(aConstraint);
37 myStorage->addConstraint(myBaseConstraint, aConstraint);
39 int aType = myBaseConstraint->integer(SketchPlugin_ConstraintAngle::TYPE_ID())->value();
40 if (aType != myType) {
42 myStorage->setNeedToResolve(true);