#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";