From: adv Date: Thu, 26 Dec 2013 10:54:39 +0000 (+0000) Subject: Import bathymetry protection (Bug #203). X-Git-Tag: BR_hydro_v_0_7~40 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8eb86379ea34dea4b5bbdf65588fde9868d2c183;p=modules%2Fhydro.git Import bathymetry protection (Bug #203). --- diff --git a/src/HYDROData/HYDROData_Bathymetry.cxx b/src/HYDROData/HYDROData_Bathymetry.cxx index 8d679bd2..ec3ed113 100644 --- a/src/HYDROData/HYDROData_Bathymetry.cxx +++ b/src/HYDROData/HYDROData_Bathymetry.cxx @@ -4,6 +4,8 @@ #include "HYDROData_Tool.h" #include "HYDROData_PolylineXY.h" +#include + #include #include @@ -463,6 +465,11 @@ bool HYDROData_Bathymetry::importFromXYZFile( QFile& theFile, if ( !isXOk || !isYOk || !isZOk ) return false; + if ( boost::math::isnan( aPoint.X() ) || boost::math::isinf( aPoint.X() ) || + boost::math::isnan( aPoint.Y() ) || boost::math::isinf( aPoint.Y() ) || + boost::math::isnan( aPoint.Z() ) || boost::math::isinf( aPoint.Z() ) ) + return false; + // Invert the z value if requested if ( anIsAltitudesInverted ) aPoint.SetZ( -aPoint.Z() );