+
+bool SketchSolver_ConstraintMulti::isUsed(FeaturePtr theFeature) const
+{
+ return theFeature && (myFeatures.find(theFeature) != myFeatures.end() ||
+ SketchSolver_Constraint::isUsed(theFeature));
+}
+
+bool SketchSolver_ConstraintMulti::isUsed(AttributePtr theAttribute) const
+{
+ AttributePtr anAttribute = theAttribute;
+ AttributeRefAttrPtr aRefAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(anAttribute);
+ if (aRefAttr) {
+ if (aRefAttr->isObject())
+ return isUsed(ModelAPI_Feature::feature(aRefAttr->object()));
+ else
+ anAttribute = aRefAttr->attr();
+ }
+ if (!anAttribute)
+ return false;
+
+ FeaturePtr anOwner = ModelAPI_Feature::feature(anAttribute->owner());
+ return myFeatures.find(anOwner) != myFeatures.end();
+}