+// ============================================================================
+// Function: updateRelatedConstraints
+// Class: SketchSolver_ConstraintGroup
+// Purpose: emit the signal to update constraints
+// ============================================================================
+void SketchSolver_ConstraintGroup::updateRelatedConstraints(
+ boost::shared_ptr<ModelAPI_Attribute> theEntity) const
+{
+ std::map<boost::shared_ptr<SketchPlugin_Constraint>, Slvs_hConstraint>::const_iterator
+ aConstrIter = myConstraintMap.begin();
+ for ( ; aConstrIter != myConstraintMap.end(); aConstrIter++)
+ {
+ std::list< boost::shared_ptr<ModelAPI_Attribute> > anAttributes =
+ aConstrIter->first->data()->attributes(std::string());
+
+ std::list< boost::shared_ptr<ModelAPI_Attribute> >::iterator
+ anAttrIter = anAttributes.begin();
+ for ( ; anAttrIter != anAttributes.end(); anAttrIter++)
+ {
+ bool isUpd = (*anAttrIter == theEntity);
+ boost::shared_ptr<ModelAPI_AttributeRefAttr> aRefAttr =
+ boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(*anAttrIter);
+ if (aRefAttr && !aRefAttr->isObject() && aRefAttr->attr() == theEntity)
+ isUpd = true;
+
+ if (isUpd)
+ {
+ static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
+ ModelAPI_EventCreator::get()->sendUpdated(aConstrIter->first, anEvent);
+ break;
+ }
+ }
+ }
+}
+
+void SketchSolver_ConstraintGroup::updateRelatedConstraints(
+ boost::shared_ptr<ModelAPI_Feature> theFeature) const
+{
+ std::map<boost::shared_ptr<SketchPlugin_Constraint>, Slvs_hConstraint>::const_iterator
+ aConstrIter = myConstraintMap.begin();
+ for ( ; aConstrIter != myConstraintMap.end(); aConstrIter++)
+ {
+ std::list< boost::shared_ptr<ModelAPI_Attribute> > anAttributes =
+ aConstrIter->first->data()->attributes(std::string());
+
+ std::list< boost::shared_ptr<ModelAPI_Attribute> >::iterator
+ anAttrIter = anAttributes.begin();
+ for ( ; anAttrIter != anAttributes.end(); anAttrIter++)
+ {
+ boost::shared_ptr<ModelAPI_AttributeRefAttr> aRefAttr =
+ boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(*anAttrIter);
+ if (aRefAttr && aRefAttr->isObject() && aRefAttr->object() == theFeature)
+ {
+ static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
+ ModelAPI_EventCreator::get()->sendUpdated(aConstrIter->first, anEvent);
+ break;
+ }
+ }
+ }
+}
+