-
-bool SketchSolver_Constraint::isUsed(FeaturePtr theFeature) const
-{
- const std::list<ConstraintWrapperPtr>& aCList = myStorage->constraint(myBaseConstraint);
- std::list<ConstraintWrapperPtr>::const_iterator aCIt = aCList.begin();
- for (; aCIt != aCList.end(); ++aCIt)
- if ((*aCIt)->isUsed(theFeature))
- return true;
-
- std::list<AttributePtr> anAttrList = theFeature->data()->attributes(GeomDataAPI_Point2D::typeId());
- std::list<AttributePtr>::const_iterator anAttrIt = anAttrList.begin();
- for (; anAttrIt != anAttrList.end(); ++ anAttrIt)
- if (isUsed(*anAttrIt))
- return true;
-
- return false;
-}
-
-bool SketchSolver_Constraint::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();
- }
-
- const std::list<ConstraintWrapperPtr>& aCList = myStorage->constraint(myBaseConstraint);
- std::list<ConstraintWrapperPtr>::const_iterator aCIt = aCList.begin();
- for (; aCIt != aCList.end(); ++aCIt)
- if ((*aCIt)->isUsed(theAttribute))
- return true;
- return false;
-}