]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for the issue #2461: crash when changing points on plane creation
authormpv <mpv@opencascade.com>
Mon, 23 Apr 2018 07:58:42 +0000 (10:58 +0300)
committermpv <mpv@opencascade.com>
Mon, 23 Apr 2018 07:58:42 +0000 (10:58 +0300)
src/ConstructionPlugin/ConstructionPlugin_Validators.cpp

index a3bd2bd539eb5efe4821d70451e09bd7e6da32cd..146e3055af468545c0cf0ab585acd1b943e8ca28 100644 (file)
@@ -26,6 +26,7 @@
 #include <GeomAPI_Lin.h>
 #include <GeomAPI_Pln.h>
 #include <GeomAPI_Vertex.h>
+#include <GeomAPI_Pnt.h>
 #include <GeomAlgoAPI_ShapeTools.h>
 
 #include <ModelAPI_AttributeSelection.h>
@@ -212,6 +213,11 @@ bool ConstructionPlugin_ValidatorPlaneThreePoints::isValid(const AttributePtr& t
   std::shared_ptr<GeomAPI_Pnt> aPnt2 = aVertex2->point();
   std::shared_ptr<GeomAPI_Pnt> aPnt3 = aVertex3->point();
 
+  if (aPnt1->isEqual(aPnt2)) {
+    theError = "Selected points are equal";
+    return false;
+  }
+
   std::shared_ptr<GeomAPI_Lin> aLin(new GeomAPI_Lin(aPnt1, aPnt2));
 
   if(aLin->contains(aPnt3)) {