add method restoreFinished and reimplement it in SketchObject

This commit is contained in:
wmayer
2018-12-29 15:27:32 +01:00
parent 6cc2c1147e
commit be5796b2d0
4 changed files with 25 additions and 0 deletions

View File

@@ -6614,6 +6614,21 @@ void SketchObject::onDocumentRestored()
}
}
void SketchObject::restoreFinished()
{
try {
Constraints.acceptGeometry(getCompleteGeometry());
// this may happen when saving a sketch directly in edit mode
// but never performed a recompute before
if (Shape.getValue().IsNull() && hasConflicts() == 0) {
if (this->solve(true) == 0)
Shape.setValue(solvedSketch.toShape());
}
}
catch (...) {
}
}
void SketchObject::getGeoVertexIndex(int VertexId, int &GeoId, PointPos &PosId) const
{
if (VertexId < 0 || VertexId >= int(VertexId2GeoId.size())) {