X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FSketchSolver_Storage.cpp;h=895edeb58321c0daf337aff135703098e204791f;hb=d75b1b5c09b57fd8326d846118fa3246a9857492;hp=81714314f264bd8c0b95dbc3d286a9c61752c4c7;hpb=e066abaa17e20d15934c0c83cdd8de07ffd93122;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_Storage.cpp b/src/SketchSolver/SketchSolver_Storage.cpp index 81714314f..895edeb58 100644 --- a/src/SketchSolver/SketchSolver_Storage.cpp +++ b/src/SketchSolver/SketchSolver_Storage.cpp @@ -44,7 +44,8 @@ void SketchSolver_Storage::addConstraint(ConstraintPtr theConstraint, //// theConstraint->data()->attributes(ModelAPI_AttributeRefAttr::typeId()); //// std::list::const_iterator anAttrIt = aRefAttrs.begin(); //// for (; anAttrIt != aRefAttrs.end(); ++anAttrIt) { -//// AttributeRefAttrPtr aRef = std::dynamic_pointer_cast(*anAttrIt); +//// AttributeRefAttrPtr aRef = +//// std::dynamic_pointer_cast(*anAttrIt); //// if (aRef->isObject()) { //// FeaturePtr aFeature = ModelAPI_Feature::feature(aRef->object()); //// if (aFeature) addEntity(aFeature, EntityWrapperPtr()); @@ -54,7 +55,8 @@ void SketchSolver_Storage::addConstraint(ConstraintPtr theConstraint, //// std::list aRefLists = //// theConstraint->data()->attributes(ModelAPI_AttributeRefList::typeId()); //// for (anAttrIt = aRefLists.begin(); anAttrIt != aRefLists.end(); ++anAttrIt) { -//// AttributeRefListPtr aRef = std::dynamic_pointer_cast(*anAttrIt); +//// AttributeRefListPtr aRef = +//// std::dynamic_pointer_cast(*anAttrIt); //// std::list anObj = aRef->list(); //// std::list::iterator anIt = anObj.begin(); //// for (; anIt != anObj.end(); ++anIt) { @@ -198,14 +200,8 @@ void SketchSolver_Storage::removeAttribute(AttributePtr theAttribute) } -bool SketchSolver_Storage::isConsistent() const +bool SketchSolver_Storage::areFeaturesValid() const { - // Check the constraints are valid - std::map::const_iterator - aCIter = myConstraintMap.begin(); - for (; aCIter != myConstraintMap.end(); ++aCIter) - if (!aCIter->first->data() || !aCIter->first->data()->isValid()) - return false; // Check the features are valid std::map::const_iterator aFIter = myFeatureMap.begin(); for (; aFIter != myFeatureMap.end(); aFIter++) @@ -236,10 +232,8 @@ std::set SketchSolver_Storage::getConflictingConstraints(SolverPtr th std::map::const_iterator aConstrIt = myConstraintMap.begin(); for (; aConstrIt != myConstraintMap.end(); ++aConstrIt) { - if (theSolver->isConflicting(aConstrIt->second->id())) { + if (theSolver->isConflicting(aConstrIt->second->id())) aConflicting.insert(aConstrIt->first); - break; - } } return aConflicting; }