From dc7f6af55d1c6840d2ae72384a3f5c9dc7a21336 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 24 Aug 2023 16:47:40 +0200 Subject: [PATCH] check that we have an exact match (whole string) --- Polyhedron/demo/Polyhedron/Scene_plane_item.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Scene_plane_item.cpp b/Polyhedron/demo/Polyhedron/Scene_plane_item.cpp index ba455ac0cc2..f2175e4271b 100644 --- a/Polyhedron/demo/Polyhedron/Scene_plane_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_plane_item.cpp @@ -329,13 +329,13 @@ void Scene_plane_item::setPlaneOrientation() if(!ok) return; - match = rx.match(eq); // AF: exact? - // does_match = rx.exactMatch(eq); - if(! match.hasMatch()) + match = rx.match(eq); + does_match = match.hasMatch() && match.capturedLength(0) == eq.size(); + if(!does_match) { QMessageBox::warning(CGAL::Three::Three::mainWindow(),"Error","The input must be of the form a*x+b*y+c*z+d=0"); } - }while(! match.hasMatch()); + }while(!does_match); double a(match.captured(1).toDouble()), b(match.captured(2).toDouble()), c(match.captured(3).toDouble()), d(match.captured(4).toDouble()); Kernel_epic::Point_3 sure_point(0,0,0);