Sketcher: SketchObject - Add ability to diagnose constraint redundancy before addition

======================================================================================

It preserves the SketchObject properties. Therefore it does not trigger any property update, redraws, ...
This commit is contained in:
Abdullah Tahiri
2022-05-08 11:27:40 +02:00
committed by abdullahtahiriyo
parent ad6576d385
commit b0492010d0
2 changed files with 21 additions and 0 deletions

View File

@@ -694,6 +694,24 @@ int SketchObject::setUpSketch()
Constraints.touch();
return lastDoF;
}
int SketchObject::diagnoseAdditionalConstraints(std::vector<Sketcher::Constraint *> additionalconstraints)
{
auto objectconstraints = Constraints.getValues();
std::vector<Sketcher::Constraint *> allconstraints;
allconstraints.reserve(objectconstraints.size()+additionalconstraints.size());
std::copy(objectconstraints.begin(), objectconstraints.end(), back_inserter(allconstraints));
std::copy(additionalconstraints.begin(), additionalconstraints.end(), back_inserter(allconstraints));
lastDoF = solvedSketch.setUpSketch(getCompleteGeometry(), allconstraints,
getExternalGeometryCount());
retrieveSolverDiagnostics();
return lastDoF;
}