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();
/// \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
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;
}