+
+void SketchSolver_ConstraintMulti::notify(const FeaturePtr& theFeature,
+ PlaneGCSSolver_Update*)
+{
+ if (myOriginalFeatures.find(theFeature) == myOriginalFeatures.end() &&
+ myCopiedFeatures.find(theFeature) == myCopiedFeatures.end())
+ return; // the feature is not used by constraint => nothing to update
+
+ if (myIsProcessingNotify)
+ return; // "notify" is already processing
+
+ // do not adjust "multi"-constraint if the number of objects is changed,
+ // wait until the constraint is updated (issue #2425: changing number of copies by parameter)
+ if (myNumberOfCopies + 1 == myBaseConstraint->integer(nameNbObjects())->value()) {
+ myIsProcessingNotify = true;
+
+ // update derivative object
+ updateLocal();
+ myAdjusted = false;
+ adjustConstraint();
+
+ myIsProcessingNotify = false;
+ }
+}
+
+void SketchSolver_ConstraintMulti::blockEvents(bool isBlocked)
+{
+ myIsEventsBlocked = isBlocked;
+
+ std::set<FeaturePtr>::iterator anIt = myOriginalFeatures.begin();
+ for (; anIt != myOriginalFeatures.end(); ++anIt)
+ (*anIt)->data()->blockSendAttributeUpdated(isBlocked);
+ for (anIt = myCopiedFeatures.begin(); anIt != myCopiedFeatures.end(); ++anIt)
+ (*anIt)->data()->blockSendAttributeUpdated(isBlocked);
+
+ SketchSolver_Constraint::blockEvents(isBlocked);
+}