From bec129ca65149f16eb2de2774c05620df92ef561 Mon Sep 17 00:00:00 2001 From: azv Date: Thu, 9 Jun 2016 15:20:46 +0300 Subject: [PATCH] PlaneGCS: conflicting constraints after abort --- src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp index 40c524e94..a3f832e6e 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp @@ -242,6 +242,11 @@ bool PlaneGCSSolver_Storage::remove(ConstraintWrapperPtr theConstraint) bool PlaneGCSSolver_Storage::remove(EntityWrapperPtr theEntity) { + // do not remove entity, if it is used by constraints or other entities + if ((theEntity->baseFeature() && isUsed(theEntity->baseFeature())) || + (theEntity->baseAttribute() && isUsed(theEntity->baseAttribute()))) + return false; + bool isFullyRemoved = SketchSolver_Storage::remove(theEntity); if (isFullyRemoved) { if (theEntity->type() == ENTITY_ARC) { -- 2.39.2