Salome HOME
Issue #2971: Naming issue in a group when loading a dump file
[modules/shaper.git] / src / ModelGeomAlgo / ModelGeomAlgo_Shape.cpp
index 207e4f3aa807ce4c1b861cd4f76df85927b0a26c..c65543ab81ff80b371cec879cf20f5b21842bdf3 100644 (file)
@@ -77,8 +77,11 @@ namespace ModelGeomAlgo_Shape
     std::list<GeomShapePtr> aSubs = theShape->subShapes(theType);
     for (std::list<GeomShapePtr>::const_iterator aSubIt = aSubs.begin();
          aSubIt != aSubs.end(); ++aSubIt) {
+      double aTol = (*aSubIt)->tolerance();
+      if (theTolerance > aTol)
+        aTol = theTolerance;
       GeomPointPtr aMiddlePoint = (*aSubIt)->middlePoint();
-      if (aMiddlePoint && aMiddlePoint->distance(thePoint) < theTolerance)
+      if (aMiddlePoint && aMiddlePoint->distance(thePoint) < aTol)
         aFoundSubs.push_back(*aSubIt);
     }
     return aFoundSubs;