Salome HOME
Radius dimension does not change the circle (issue #1399)
authorazv <azv@opencascade.com>
Thu, 21 Apr 2016 12:28:33 +0000 (15:28 +0300)
committerazv <azv@opencascade.com>
Thu, 21 Apr 2016 12:28:33 +0000 (15:28 +0300)
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ConstraintWrapper.cpp
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ConstraintWrapper.h
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.cpp

index 8419b9a2ed20e33d9357db8580a60f77df230d38..3ee9d559a75d5fdde2493ecddc5e84908be36fb6 100644 (file)
@@ -35,15 +35,6 @@ SketchSolver_ConstraintType SolveSpaceSolver_ConstraintWrapper::type() const
   return ConstraintType::fromSolveSpace(mySlvsConstraint.type);
 }
 
-void SolveSpaceSolver_ConstraintWrapper::setValue(const double& theValue)
-{
-  double aValue = theValue;
-  if (type() == CONSTRAINT_RADIUS)
-    aValue *= 2.0; // NOTE: SolveSpace uses constraint DIAMETER
-
-  SketchSolver_IConstraintWrapper::setValue(aValue);
-}
-
 bool SolveSpaceSolver_ConstraintWrapper::isUsed(FeaturePtr theFeature) const
 {
   std::list<EntityWrapperPtr>::const_iterator anIt = myConstrained.begin();
index b7ff4999202920082b9e08324ce09d92ca7d6468..e5c1deb6b4eccac9d01e86363040d46d52ba7320 100644 (file)
@@ -39,9 +39,6 @@ public:
   /// \brief Return type of current entity
   virtual SketchSolver_ConstraintType type() const;
 
-  /// \brief Assign numeric parameter of constraint
-  virtual void setValue(const double& theValue);
-
   /// \brief Verify the feature is used in the constraint
   virtual bool isUsed(FeaturePtr theFeature) const;
   /// \brief Verify the attribute is used in the constraint
index efbe1ad2de25721e7d63ef7a0544a995c2fb0ac7..e7b72775d3adbaa1a09a8fb8a8fa42287eeefef7 100644 (file)
@@ -59,8 +59,9 @@ bool SolveSpaceSolver_Storage::update(ConstraintWrapperPtr theConstraint)
     aSlvsConstr = aConstraint->constraint();
 
   // update value of constraint if exist
-  if (fabs(aSlvsConstr.valA - theConstraint->value()) > tolerance) {
-    aSlvsConstr.valA = theConstraint->value();
+  double aCoeff = aSlvsConstr.type == SLVS_C_DIAMETER ? 2.0 : 1.0;
+  if (fabs(aSlvsConstr.valA - theConstraint->value() * aCoeff) > tolerance) {
+    aSlvsConstr.valA = theConstraint->value() * aCoeff;
     isUpdated = true;
   }