Salome HOME
Copyright update 2020
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintAngle.cpp
index f4207163b241f406bbe39f35116326f883fbaf44..d49897fa010b2060ad587face98c8c009bfa8df8 100644 (file)
@@ -1,41 +1,37 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+// Copyright (C) 2014-2020  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 #include <SketchSolver_ConstraintAngle.h>
-#include <SketchSolver_Manager.h>
-
-#include <GeomAPI_Dir2d.h>
-#include <GeomAPI_Lin2d.h>
-#include <GeomAPI_Pnt2d.h>
-#include <GeomAPI_XY.h>
 
 #include <ModelAPI_AttributeInteger.h>
-
 #include <SketchPlugin_ConstraintAngle.h>
 
-#include <cmath>
-
 void SketchSolver_ConstraintAngle::getAttributes(
-    double& theValue, std::vector<EntityWrapperPtr>& theAttributes)
+    EntityWrapperPtr& theValue, std::vector<EntityWrapperPtr>& theAttributes)
 {
   SketchSolver_Constraint::getAttributes(theValue, theAttributes);
-
-  myAngle = theValue;
   myType = myBaseConstraint->integer(SketchPlugin_ConstraintAngle::TYPE_ID())->value();
 }
 
 
 void SketchSolver_ConstraintAngle::adjustConstraint()
 {
-  static const double aTol = 1000. * tolerance;
-  BuilderPtr aBuilder = SketchSolver_Manager::instance()->builder();
-
-  ConstraintWrapperPtr aConstraint = myStorage->constraint(myBaseConstraint).front();
-  //if (fabs(myAngle - aConstraint->value()) < aTol)
-  //  return;
-  myAngle = aConstraint->value();
-  aBuilder->adjustConstraint(aConstraint);
-  myStorage->addConstraint(myBaseConstraint, aConstraint);
-
   int aType = myBaseConstraint->integer(SketchPlugin_ConstraintAngle::TYPE_ID())->value();
   if (aType != myType) {
     myType = aType;