From: asl Date: Fri, 1 Dec 2017 10:31:05 +0000 (+0300) Subject: improvement of bathymetry loading X-Git-Tag: v2.1.1__salome84~7^2~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=169b2f0fb653a1e953585f4656c54ecdcc962d17;p=modules%2Fhydro.git improvement of bathymetry loading --- diff --git a/src/HYDROData/HYDROData_Bathymetry.cxx b/src/HYDROData/HYDROData_Bathymetry.cxx index 5fa2c82e..fcba6fa3 100644 --- a/src/HYDROData/HYDROData_Bathymetry.cxx +++ b/src/HYDROData/HYDROData_Bathymetry.cxx @@ -58,7 +58,7 @@ //#define _DEVDEBUG_ #include "HYDRO_trace.hxx" -const int BLOCK_SIZE = 1000; +const int BLOCK_SIZE = 10000; IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Bathymetry, HYDROData_IAltitudeObject) @@ -714,15 +714,17 @@ bool HYDROData_Bathymetry::importFromXYZFile( QFile& theFile, bool anIsAltitudesInverted = IsAltitudesInverted(); while ( !theFile.atEnd() ) { - QString aLine = theFile.readLine().simplified(); - if ( aLine.isEmpty() ) + std::string aLine = theFile.readLine().simplified().toStdString(); + if ( aLine.empty() ) continue; - QStringList aValues = aLine.split( ' ', QString::SkipEmptyParts ); - if ( aValues.length() < 3 ) + HYDROData_Bathymetry::AltitudePoint aPoint; + if( sscanf( aLine.c_str(), "%lf %lf %lf", &aPoint.X, &aPoint.Y, &aPoint.Z )!=3 ) return false; - HYDROData_Bathymetry::AltitudePoint aPoint; + /*QStringList aValues = aLine.split( ' ', QString::SkipEmptyParts ); + if ( aValues.length() < 3 ) + return false; QString anX = aValues.value( 0 ); QString anY = aValues.value( 1 ); @@ -735,7 +737,7 @@ bool HYDROData_Bathymetry::importFromXYZFile( QFile& theFile, aPoint.Z = aZ.toDouble( &isZOk ); if ( !isXOk || !isYOk || !isZOk ) - return false; + return false;*/ if ( HYDROData_Tool::IsNan( aPoint.X ) || HYDROData_Tool::IsInf( aPoint.X ) || HYDROData_Tool::IsNan( aPoint.Y ) || HYDROData_Tool::IsInf( aPoint.Y ) ||