From 169b2f0fb653a1e953585f4656c54ecdcc962d17 Mon Sep 17 00:00:00 2001 From: asl Date: Fri, 1 Dec 2017 13:31:05 +0300 Subject: [PATCH] improvement of bathymetry loading --- src/HYDROData/HYDROData_Bathymetry.cxx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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 ) || -- 2.39.2