From bfdb8f5d4e6869fae43eaba67f3f7941ca88df99 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sat, 26 Jul 2008 14:22:50 +0000
Subject: [PATCH] parFromPoint returns numeric_limit::max() if failed

---
 Geo/GEdge.h     | 1 +
 Geo/OCCEdge.cpp | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Geo/GEdge.h b/Geo/GEdge.h
index a3ce996bca..ee7e6b7302 100644
--- a/Geo/GEdge.h
+++ b/Geo/GEdge.h
@@ -53,6 +53,7 @@ class GEdge : public GEntity {
   virtual std::list<GFace*> faces() const { return l_faces; }
 
   // get the parameter location for a point in space on the edge
+  // (returns std::numeric_limits<double>::max() if failed)
   virtual double parFromPoint(const SPoint3 &) const = 0;
 
   // get the point for the given parameter location
diff --git a/Geo/OCCEdge.cpp b/Geo/OCCEdge.cpp
index 8d8dd92d55..2fead05040 100644
--- a/Geo/OCCEdge.cpp
+++ b/Geo/OCCEdge.cpp
@@ -3,6 +3,7 @@
 // See the LICENSE.txt file for license information. Please report all
 // bugs and problems to <gmsh@geuz.org>.
 
+#include <limits>
 #include "GModel.h"
 #include "Message.h"
 #include "OCCEdge.h"
@@ -130,7 +131,7 @@ SVector3 OCCEdge::firstDer(double par) const
 double OCCEdge::parFromPoint(const SPoint3 &pt) const
 {
   Msg::Error("parFromPoint not implemented for OCCEdge");
-  return 0.;
+  return std::numeric_limits<double>::max();
 }
 
 GEntity::GeomType OCCEdge::geomType() const
-- 
GitLab