make constraint validation consistent to evaluation

This commit is contained in:
wmayer
2018-10-16 23:21:40 +02:00
parent 058211148f
commit 170913fbb4
2 changed files with 9 additions and 6 deletions

View File

@@ -5792,8 +5792,9 @@ bool SketchObject::evaluateConstraints() const
return false;
}
if(constraints.size()>0){
if (!Constraints.scanGeometry(geometry)) return false;
if (!constraints.empty()) {
if (!Constraints.scanGeometry(geometry))
return false;
}
return true;
@@ -5802,7 +5803,7 @@ bool SketchObject::evaluateConstraints() const
void SketchObject::validateConstraints()
{
std::vector<Part::Geometry *> geometry = getCompleteGeometry();
const std::vector<Sketcher::Constraint *>& constraints = Constraints.getValues();
const std::vector<Sketcher::Constraint *>& constraints = Constraints.getValuesForce();
std::vector<Sketcher::Constraint *> newConstraints;
std::vector<Sketcher::Constraint *>::const_iterator it;
@@ -5816,6 +5817,9 @@ void SketchObject::validateConstraints()
Constraints.setValues(newConstraints);
acceptGeometry();
}
else if (!Constraints.scanGeometry(geometry)) {
Constraints.acceptGeometry(geometry);
}
}
std::string SketchObject::validateExpression(const App::ObjectIdentifier &path, boost::shared_ptr<const App::Expression> expr)