Salome HOME
Issue #19058: Error in sketch projection when changing parameter
[modules/shaper.git] / src / GeomAPI / GeomAPI_Pnt.cpp
index 2dec8f3bb4e712b66186dca3cc81462c23553a8e..d2b943df36e7b3089af3a36846a03fccb27fe4b1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2020  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -85,15 +85,16 @@ bool GeomAPI_Pnt::isEqual(const std::shared_ptr<GeomAPI_Pnt>& theOther) const
   return distance(theOther) < Precision::Confusion();
 }
 
-bool GeomAPI_Pnt::isLess(const std::shared_ptr<GeomAPI_Pnt>& theOther) const
+bool GeomAPI_Pnt::isLess(const std::shared_ptr<GeomAPI_Pnt>& theOther,
+                         const double theTolerance) const
 {
-  if (MY_PNT->X() + Precision::Confusion() < theOther->x())
+  if (MY_PNT->X() + theTolerance < theOther->x())
     return true;
-  else if (MY_PNT->X() < theOther->x() + Precision::Confusion()) {
-    if (MY_PNT->Y() + Precision::Confusion() < theOther->y())
+  else if (MY_PNT->X() < theOther->x() + theTolerance) {
+    if (MY_PNT->Y() + theTolerance < theOther->y())
       return true;
-    else if (MY_PNT->Y() < theOther->y() + Precision::Confusion() &&
-             MY_PNT->Z() + Precision::Confusion() < theOther->z())
+    else if (MY_PNT->Y() < theOther->y() + theTolerance &&
+             MY_PNT->Z() + theTolerance < theOther->z())
       return true;
   }
   return false;