From: azv Date: Fri, 24 Apr 2015 04:58:12 +0000 (+0300) Subject: Update Multi-Translation and Multi-Rotation to work correct with decreasing of copies X-Git-Tag: V_1.2.0~183^2~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3221beb765b26f1307a1e9e176587066c268f6de;p=modules%2Fshaper.git Update Multi-Translation and Multi-Rotation to work correct with decreasing of copies --- 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;