]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Update Multi-Translation and Multi-Rotation to work correct with decreasing of copies
authorazv <azv@opencascade.com>
Fri, 24 Apr 2015 04:58:12 +0000 (07:58 +0300)
committerazv <azv@opencascade.com>
Fri, 24 Apr 2015 04:58:12 +0000 (07:58 +0300)
src/SketchSolver/SketchSolver_ConstraintMultiRotation.cpp
src/SketchSolver/SketchSolver_ConstraintMultiTranslation.cpp

index 9dc080f16727553a377175da0d600c7d61ac6f17..b9682f22d0ba2e966f0acb8c7dbac6b607d8e250 100644 (file)
@@ -185,7 +185,10 @@ void SketchSolver_ConstraintMultiRotation::update(ConstraintPtr theConstraint)
   if (!theConstraint || theConstraint == myBaseConstraint) {
     AttributeRefListPtr anInitialRefList = std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(
         myBaseConstraint->attribute(SketchPlugin_Constraint::ENTITY_A()));
-    if (anInitialRefList->size() != myNumberOfObjects) {
+    AttributeDoublePtr aNbCopies = std::dynamic_pointer_cast<ModelAPI_AttributeDouble>(
+        myBaseConstraint->attribute(SketchPlugin_MultiRotation::NUMBER_OF_COPIES_ID()));
+    if (anInitialRefList->size() != myNumberOfObjects ||
+        (size_t)aNbCopies->value() != myNumberOfCopies) {
       remove(myBaseConstraint);
       process();
       return;
index e304a7e04f1fd0194c07d2bbcd5788bd51246326..963012df5cfd85184a4e8d7e0326d277486c9a81 100644 (file)
@@ -183,7 +183,10 @@ void SketchSolver_ConstraintMultiTranslation::update(ConstraintPtr theConstraint
   if (!theConstraint || theConstraint == myBaseConstraint) {
     AttributeRefListPtr anInitialRefList = std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(
         myBaseConstraint->attribute(SketchPlugin_Constraint::ENTITY_A()));
-    if (anInitialRefList->size() != myNumberOfObjects) {
+    AttributeDoublePtr aNbCopies = std::dynamic_pointer_cast<ModelAPI_AttributeDouble>(
+        myBaseConstraint->attribute(SketchPlugin_MultiTranslation::NUMBER_OF_COPIES_ID()));
+    if (anInitialRefList->size() != myNumberOfObjects ||
+        (size_t)aNbCopies->value() != myNumberOfCopies) {
       remove(myBaseConstraint);
       process();
       return;