]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Updates for stability of application
authormpv <mikhail.ponikarov@opencascade.com>
Mon, 26 May 2014 09:36:17 +0000 (13:36 +0400)
committermpv <mikhail.ponikarov@opencascade.com>
Mon, 26 May 2014 09:36:17 +0000 (13:36 +0400)
src/Model/Model_Document.cpp
src/SketchSolver/SketchSolver_ConstraintManager.cpp

index 6f3b4a7a94578322bbdc20b04a396b9202b4b904..76b72fe0c12b3bcd0e4a5ea26890c25911fff28e 100644 (file)
@@ -577,7 +577,7 @@ boost::shared_ptr<ModelAPI_Feature> Model_Document::objectByFeature(
   for(int a = 0; a < size(theFeature->getGroup()); a++) {
     boost::shared_ptr<Model_Object> anObj = 
       boost::dynamic_pointer_cast<Model_Object>(feature(theFeature->getGroup(), a));
-    if (anObj) {
+    if (anObj && anObj->featureRef() == theFeature) {
       return anObj;
     }
   }
index 7edc1da33916837a0db8b89b4b5f1d4b01bcf661..80a1b4872bf50f42743b81cdbb70be7f3e0d8b97 100644 (file)
@@ -771,8 +771,11 @@ void SketchSolver_ConstraintManager::SketchSolver_ConstraintGroup::mergeGroups(
 
   std::map<boost::shared_ptr<ModelAPI_Attribute>, Slvs_hEntity>::const_iterator
     aSPEntMapIter = theGroup.myEntityMap.begin();
-  for ( ; aSPEntMapIter != theGroup.myEntityMap.end(); aSPEntMapIter++)
-    myEntityMap[aSPEntMapIter->first] = anEntityMap.find(aSPEntMapIter->second)->second;
+  for ( ; aSPEntMapIter != theGroup.myEntityMap.end(); aSPEntMapIter++) {
+    std::map<Slvs_hEntity, Slvs_hEntity>::iterator aFind = anEntityMap.find(aSPEntMapIter->second);
+    if (aFind != anEntityMap.end())
+      myEntityMap[aSPEntMapIter->first] = aFind->second;
+  }
 
   // Add temporary constraints
   std::list<Slvs_hConstraint>::const_iterator aTempConstrIter = theGroup.myTempConstraints.begin();