#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <NCollection_DoubleMap.hxx>
#include <HYDROData_LCM_FaceClassifier.h>
+#include <QDir>
#include <stdexcept>
*/
bool HYDROData_LandCoverMap::ExportTelemac( const QString& theFileName,
double theDeflection,
- const Handle(HYDROData_StricklerTable)& theTable ) const
+ const Handle(HYDROData_StricklerTable)& theTable,
+ QString& statMessage) const
{
TopoDS_Shape aLandCoverMapShape = GetShape();
TopTools_ListOfShape aListOfFaces;
QFile aFile( theFileName );
if( !aFile.open( QFile::WriteOnly | QFile::Text ) )
- return false;
+ {
+ QString homeFilePath = QDir::home().absoluteFilePath( theFileName );
+ aFile.setFileName(homeFilePath);
+ if (aFile.open( QFile::WriteOnly | QFile::Text ) )
+ statMessage = "Telemac file have been exported to the home directory: " + homeFilePath;
+ else
+ return false;
+ }
+ else
+ {
+ QString absFilePath = QDir::current().absoluteFilePath( theFileName );
+ statMessage = "Telemac file have been exported to the current directory: " + absFilePath;
+ }
QTextStream aStream( &aFile );
aStream << "# nodes\n";
C1.push_back(theTable->Get( *it, DefValue ));
double Val;
if (UseMax)
- Val = *(std::max_element(std::begin(C1), std::end(C1)));
+ Val = *(std::max_element( C1.begin(), C1.end() ) );
else
- Val = *(std::min_element(std::begin(C1), std::end(C1)));
+ Val = *(std::min_element( C1.begin(), C1.end() ) );
theCoeffs[i] = Val;
}
}