Sketcher: Move autoremoveredundants method from SketchAnalyser to SketchObject

This commit is contained in:
Abdullah Tahiri
2018-08-18 02:47:04 +02:00
committed by wmayer
parent c1d6ccb0d8
commit 716d53b86e
4 changed files with 20 additions and 22 deletions

View File

@@ -6354,10 +6354,19 @@ void SketchObject::makeMissingEquality(bool onebyone)
analyser->makeMissingEquality(onebyone);
}
void SketchObject::autoRemoveRedundants(bool updategeo)
int SketchObject::autoRemoveRedundants(bool updategeo)
{
if(analyser)
analyser->autoRemoveRedundants(updategeo);
auto redundants = getLastRedundant();
if(redundants.size() == 0)
return 0;
for(size_t i=0;i<redundants.size();i++) // getLastRedundant is base 1, while delConstraints is base 0
redundants[i]--;
delConstraints(redundants,updategeo);
return redundants.size();
}
// Python Sketcher feature ---------------------------------------------------------