0022523: DRAWEXE randomly crashed on smooth navigation in 3D-Viewer
authorkgv <kgv@opencascade.com>
Tue, 27 Mar 2012 07:58:50 +0000 (11:58 +0400)
committerkgv <kgv@opencascade.com>
Thu, 29 Mar 2012 15:22:34 +0000 (19:22 +0400)
Check vector modulus to avoid possible exceptions.

src/NIS/NIS_View.cxx

index 7c4d644..45f8411 100755 (executable)
@@ -550,6 +550,11 @@ void  NIS_View::Select (const NCollection_List<gp_XY> &thePolygon,
 
   // Compute transformation.
   const gp_XYZ anXdir (gp_XYZ(anX, anY, aZ) - anEye.XYZ());
+  if (anXdir.Modulus() <= gp::Resolution())
+  {
+    return;
+  }
+
   const gp_Ax3 anAx3 (anEye, aProj, anXdir);
   gp_Trsf aTrf;
   aTrf.SetTransformation (anAx3);