Salome HOME
fix problem of polyline selection
authormpa <mpa@opencascade.com>
Fri, 28 Jun 2013 06:32:32 +0000 (06:32 +0000)
committermpa <mpa@opencascade.com>
Fri, 28 Jun 2013 06:32:32 +0000 (06:32 +0000)
0021950: EDF 2311 SMESH : Polyline selection in SMESH

src/SVTK/SVTK_AreaPicker.cxx

index 28bd23b44c4c1ba390c6d7ea1c2f486eafbaa0ee..12f4d15a27c912c1a463b252df1f9a7fe8118a5f 100644 (file)
@@ -415,13 +415,10 @@ bool SVTK_AreaPicker::isPointInPolygon( const QPoint& thePoint, const QVector<QP
     double del = last_pt.x() * cur_pt.y() - cur_pt.x() * last_pt.y();
     double xy = cur_pt.x() * last_pt.x() + cur_pt.y() * last_pt.y();
 
-    sum +=
-        ( atan(
-            ( last_pt.x() * last_pt.x() + last_pt.y() * last_pt.y() - xy )
-                / del )
-            + atan(
-                ( cur_pt.x() * cur_pt.x() + cur_pt.y() * cur_pt.y() - xy )
-                    / del ) );
+    if ( del )
+      sum +=
+      ( atan( ( last_pt.x() * last_pt.x() + last_pt.y() * last_pt.y() - xy ) / del )
+      + atan( ( cur_pt.x() * cur_pt.x() + cur_pt.y() * cur_pt.y() - xy ) / del ) );
 
     last_pt = cur_pt;
   }