From 3221beb765b26f1307a1e9e176587066c268f6de Mon Sep 17 00:00:00 2001 From: azv Date: Fri, 24 Apr 2015 07:58:12 +0300 Subject: [PATCH] Update Multi-Translation and Multi-Rotation to work correct with decreasing of copies --- src/SketchSolver/SketchSolver_ConstraintMultiRotation.cpp | 5 ++++- src/SketchSolver/SketchSolver_ConstraintMultiTranslation.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/SketchSolver/SketchSolver_ConstraintMultiRotation.cpp b/src/SketchSolver/SketchSolver_ConstraintMultiRotation.cpp index 9dc080f16..b9682f22d 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMultiRotation.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMultiRotation.cpp @@ -185,7 +185,10 @@ void SketchSolver_ConstraintMultiRotation::update(ConstraintPtr theConstraint) if (!theConstraint || theConstraint == myBaseConstraint) { AttributeRefListPtr anInitialRefList = std::dynamic_pointer_cast( myBaseConstraint->attribute(SketchPlugin_Constraint::ENTITY_A())); - if (anInitialRefList->size() != myNumberOfObjects) { + AttributeDoublePtr aNbCopies = std::dynamic_pointer_cast( + myBaseConstraint->attribute(SketchPlugin_MultiRotation::NUMBER_OF_COPIES_ID())); + if (anInitialRefList->size() != myNumberOfObjects || + (size_t)aNbCopies->value() != myNumberOfCopies) { remove(myBaseConstraint); process(); return; diff --git a/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.cpp b/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.cpp index e304a7e04..963012df5 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.cpp @@ -183,7 +183,10 @@ void SketchSolver_ConstraintMultiTranslation::update(ConstraintPtr theConstraint if (!theConstraint || theConstraint == myBaseConstraint) { AttributeRefListPtr anInitialRefList = std::dynamic_pointer_cast( myBaseConstraint->attribute(SketchPlugin_Constraint::ENTITY_A())); - if (anInitialRefList->size() != myNumberOfObjects) { + AttributeDoublePtr aNbCopies = std::dynamic_pointer_cast( + myBaseConstraint->attribute(SketchPlugin_MultiTranslation::NUMBER_OF_COPIES_ID())); + if (anInitialRefList->size() != myNumberOfObjects || + (size_t)aNbCopies->value() != myNumberOfCopies) { remove(myBaseConstraint); process(); return; -- 2.39.2