Correction of implementation of 0022170 ([CEA 704] Redirect NETGEN outup in a log file) to avoid patching of "netgen" product.

This commit is contained in:
akl 2013-06-03 10:48:54 +00:00
parent 28e6f61a7e
commit c5e023e735

View File

@ -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 );
}