]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchSolver/SketchSolver_ConstraintAngle.cpp
Salome HOME
Issue #1834: Fix length of lines
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintAngle.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 #include <SketchSolver_ConstraintAngle.h>
4 #include <SketchSolver_Manager.h>
5
6 #include <GeomAPI_Dir2d.h>
7 #include <GeomAPI_Lin2d.h>
8 #include <GeomAPI_Pnt2d.h>
9 #include <GeomAPI_XY.h>
10
11 #include <cmath>
12
13 void SketchSolver_ConstraintAngle::getAttributes(
14     double& theValue, std::vector<EntityWrapperPtr>& theAttributes)
15 {
16   SketchSolver_Constraint::getAttributes(theValue, theAttributes);
17
18   myAngle = theValue;
19 }
20
21
22 void SketchSolver_ConstraintAngle::adjustConstraint()
23 {
24   static const double aTol = 1000. * tolerance;
25   BuilderPtr aBuilder = SketchSolver_Manager::instance()->builder();
26
27   ConstraintWrapperPtr aConstraint = myStorage->constraint(myBaseConstraint).front();
28   //if (fabs(myAngle - aConstraint->value()) < aTol)
29   //  return;
30   myAngle = aConstraint->value();
31   aBuilder->adjustConstraint(aConstraint);
32   myStorage->addConstraint(myBaseConstraint, aConstraint);
33 }