X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FSketchSolver_ConstraintAngle.cpp;h=d51be3f9d98adedaf48f54120292bd74c4b568fb;hb=97c06c5cd9fc736f9b5a1dacde369a9d7b5be703;hp=7a6a4ac0f3efc3d059b2862a147de0abaa3b7dc3;hpb=c3aeb6b898054376c1047071ea9fea61abdc9e99;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_ConstraintAngle.cpp b/src/SketchSolver/SketchSolver_ConstraintAngle.cpp index 7a6a4ac0f..d51be3f9d 100644 --- a/src/SketchSolver/SketchSolver_ConstraintAngle.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintAngle.cpp @@ -1,33 +1,40 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D +// Copyright (C) 2014-2019 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 -#include -#include -#include -#include -#include - -#include +#include +#include void SketchSolver_ConstraintAngle::getAttributes( - double& theValue, std::vector& theAttributes) + EntityWrapperPtr& theValue, std::vector& 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; + myStorage->setNeedToResolve(true); + } }