Salome HOME
Using test for testing number of sub-shapes.
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintMulti.cpp
index bd0a82ad3206962483ae6a6bffa4b5d5fe5b5fa8..a86ab8b5fbd51731f26d30fdade40e31a67a402d 100644 (file)
@@ -38,7 +38,7 @@ void SketchSolver_ConstraintMulti::getEntities(std::list<EntityWrapperPtr>& theE
   std::list<ObjectPtr> anObjectList = aRefList->list();
   std::list<ObjectPtr>::iterator anObjIt = anObjectList.begin();
   // execute for the feature is not called yet
-  if ((myNumberOfCopies + 1) * myNumberOfObjects != aRefList->size()) 
+  if ((myNumberOfCopies + 1) * myNumberOfObjects != aRefList->size())
     myNumberOfCopies = aRefList->size() / myNumberOfObjects - 1;
 
   while (anObjIt != anObjectList.end()) {
@@ -47,7 +47,7 @@ void SketchSolver_ConstraintMulti::getEntities(std::list<EntityWrapperPtr>& theE
       continue;
 
     // the entity is not created, so it is a copy in "multi" constraint, force its creation
-    if (!myStorage->update(aFeature)) 
+    if (!myStorage->update(aFeature))
       myStorage->update(aFeature, myGroupID, true);
     theEntities.push_back(myStorage->entity(aFeature));
     myFeatures.insert(aFeature);
@@ -79,7 +79,7 @@ void SketchSolver_ConstraintMulti::update(bool isForce)
   AttributeIntegerPtr aNbObjects = myBaseConstraint->integer(nameNbObjects());
   if (!anInitialRefList || !aNbObjects)
     return; // the "Multi" constraint is in queue to remove
-  bool isUpdated = 
+  bool isUpdated =
     anInitialRefList->size() != myNumberOfObjects || aNbObjects->value()-1 != myNumberOfCopies;
   if (!isUpdated) {
     // additional check that the features and their copies are changed
@@ -161,8 +161,9 @@ void SketchSolver_ConstraintMulti::adjustConstraint()
         continue;
       anEntity = myStorage->entity(aFeature);
 
+      bool aWasBlocked = false;
       if (!anEntity || !myStorage->isEventsBlocked())
-        aFeature->data()->blockSendAttributeUpdated(true);
+        aWasBlocked = aFeature->data()->blockSendAttributeUpdated(true);
 
       std::list<AttributePtr> aPoints;
       if (aFeature->getKind() == SketchPlugin_Arc::ID()) {
@@ -203,7 +204,7 @@ void SketchSolver_ConstraintMulti::adjustConstraint()
       }
 
       if (!anEntity || !myStorage->isEventsBlocked())
-        aFeature->data()->blockSendAttributeUpdated(false);
+        aFeature->data()->blockSendAttributeUpdated(aWasBlocked);
     }
   }