Salome HOME
Issue #2079 : Select parent feature for default Constructions. Disable popup menu...
[modules/shaper.git] / src / SketchSolver / SketchSolver_Storage.cpp
index 81714314f264bd8c0b95dbc3d286a9c61752c4c7..895edeb58321c0daf337aff135703098e204791f 100644 (file)
@@ -44,7 +44,8 @@ void SketchSolver_Storage::addConstraint(ConstraintPtr        theConstraint,
 ////        theConstraint->data()->attributes(ModelAPI_AttributeRefAttr::typeId());
 ////    std::list<AttributePtr>::const_iterator anAttrIt = aRefAttrs.begin();
 ////    for (; anAttrIt != aRefAttrs.end(); ++anAttrIt) {
-////      AttributeRefAttrPtr aRef = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(*anAttrIt);
+////      AttributeRefAttrPtr aRef =
+////          std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(*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<AttributePtr> aRefLists =
 ////        theConstraint->data()->attributes(ModelAPI_AttributeRefList::typeId());
 ////    for (anAttrIt = aRefLists.begin(); anAttrIt != aRefLists.end(); ++anAttrIt) {
-////      AttributeRefListPtr aRef = std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(*anAttrIt);
+////      AttributeRefListPtr aRef =
+////          std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(*anAttrIt);
 ////      std::list<ObjectPtr> anObj = aRef->list();
 ////      std::list<ObjectPtr>::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<ConstraintPtr, ConstraintWrapperPtr>::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<FeaturePtr, EntityWrapperPtr>::const_iterator aFIter = myFeatureMap.begin();
   for (; aFIter != myFeatureMap.end(); aFIter++)
@@ -236,10 +232,8 @@ std::set<ObjectPtr> SketchSolver_Storage::getConflictingConstraints(SolverPtr th
   std::map<ConstraintPtr, ConstraintWrapperPtr>::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;
 }