From: akl Date: Mon, 3 Jun 2013 10:48:54 +0000 (+0000) Subject: Correction of implementation of 0022170 ([CEA 704] Redirect NETGEN outup in a log... X-Git-Tag: V7_3_0a1~47 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c5e023e735b1fbc77ff16e56b6b71311aeb6cc74;p=plugins%2Fnetgenplugin.git Correction of implementation of 0022170 ([CEA 704] Redirect NETGEN outup in a log file) to avoid patching of "netgen" product. --- diff --git a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx index 63f6c3c..b71aa80 100644 --- a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx @@ -3468,8 +3468,10 @@ SMESH_Mesh& NETGENPlugin_Internals::getMesh() const NETGENPlugin_NetgenLibWrapper::NETGENPlugin_NetgenLibWrapper() { + Ng_Init(); myOutputFile = getOutputFileName(); - Ng_Init( myOutputFile.c_str() ); + netgen::mycout = new ofstream ( myOutputFile.c_str() ); + cout << "NOTE: netgen output was redirected to file " << myOutputFile << endl; _ngMesh = Ng_NewMesh(); } @@ -3534,6 +3536,11 @@ void NETGENPlugin_NetgenLibWrapper::RemoveOutputFile() aFiles->length(1); std::string aFileName = SALOMEDS_Tool::GetNameFromPath( myOutputFile ) + ".out"; aFiles[0] = aFileName.c_str(); + if ( netgen::mycout) + { + delete netgen::mycout; + netgen::mycout = 0; + } SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.c_str(), aFiles.in(), true ); }