This commit is contained in:
jfa 2021-12-20 17:08:59 +03:00
parent 67d70c9621
commit a16cda24fd
8 changed files with 38 additions and 20 deletions

View File

@ -586,9 +586,9 @@ module SMESH
in double theTolerance ); in double theTolerance );
MG_ADAPT CreateMG_ADAPT(); MG_ADAPT CreateMG_ADAPT();
SMESHHOMARD::HOMARD_Gen CreateHOMARD_ADAPT(); SMESHHOMARD::HOMARD_Gen CreateHOMARD_ADAPT() raises ( SALOME::SALOME_Exception );
//MG_ADAPT_OBJECT Adaptation(in string adaptType); //MG_ADAPT_OBJECT Adaptation(in string adaptType);
SALOME::GenericObj Adaptation(in string adaptType); SALOME::GenericObj Adaptation(in string adaptType) raises ( SALOME::SALOME_Exception );
MG_ADAPT CreateAdaptationHypothesis(); MG_ADAPT CreateAdaptationHypothesis();
}; };

View File

@ -288,9 +288,9 @@ SET(_ts_RESOURCES
SMESH_msg_en.ts SMESH_msg_en.ts
SMESH_msg_fr.ts SMESH_msg_fr.ts
SMESH_msg_ja.ts SMESH_msg_ja.ts
HOMARD_msg_en.ts SMESHGUI_Homard_msg_en.ts
HOMARD_msg_fr.ts SMESHGUI_Homard_msg_fr.ts
HOMARD_msg_ja.ts SMESHGUI_Homard_msg_ja.ts
) )
# --- rules --- # --- rules ---

View File

@ -3023,10 +3023,19 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
break; break;
EmitSignalDeactivateDialog(); EmitSignalDeactivateDialog();
SALOME::GenericObj_wrap< SMESHHOMARD::HOMARD_Gen > homardGen = SALOME::GenericObj_wrap< SMESHHOMARD::HOMARD_Gen > homardGen;
GetSMESHGen()->CreateHOMARD_ADAPT(); try {
SMESHGUI_HomardAdaptDlg *aDlg = new SMESHGUI_HomardAdaptDlg(homardGen); homardGen = GetSMESHGen()->CreateHOMARD_ADAPT();
aDlg->show(); }
catch ( const SALOME::SALOME_Exception& S_ex ) {
SUIT_MessageBox::critical(SMESHGUI::desktop(),
QObject::tr("SMESH_ERROR"),
QObject::tr(S_ex.details.text.in()));
}
if (!homardGen->_is_nil()) {
SMESHGUI_HomardAdaptDlg *aDlg = new SMESHGUI_HomardAdaptDlg(homardGen);
aDlg->show();
}
break; break;
} }
// Adaptation - end // Adaptation - end

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.0" language="en_GB"> <TS version="2.0" language="en_US">
<context> <context>
<name>@default</name> <name>@default</name>
<message> <message>

View File

@ -18,7 +18,8 @@
// //
#include "MG_ADAPT_i.hxx" #include "MG_ADAPT_i.hxx"
#include "SMESH_Homard_i.hxx"
#include CORBA_SERVER_HEADER(SMESH_Homard)
#include "MG_ADAPT.hxx" #include "MG_ADAPT.hxx"
#include "SMESH_File.hxx" #include "SMESH_File.hxx"
@ -126,11 +127,8 @@ SALOME::GenericObj_ptr SMESH_Gen_i::Adaptation( const char* adaptationType)
return anObj._retn(); return anObj._retn();
} }
#endif #endif
if (!strcmp(adaptationType, "Uniform")) if (!strcmp(adaptationType, "Uniform")) {
{ return CreateHOMARD_ADAPT();
SMESHHOMARD_I::HOMARD_Gen_i* homard_adapt = new SMESHHOMARD_I::HOMARD_Gen_i();
SMESHHOMARD::HOMARD_Gen_var anObj = homard_adapt->_this();
return anObj._retn();
} }
return SMESH::MG_ADAPT_OBJECT_ptr(); return SMESH::MG_ADAPT_OBJECT_ptr();
} }

View File

@ -65,6 +65,15 @@ using namespace std;
SMESHHOMARD::HOMARD_Gen_ptr SMESH_Gen_i::CreateHOMARD_ADAPT() SMESHHOMARD::HOMARD_Gen_ptr SMESH_Gen_i::CreateHOMARD_ADAPT()
{ {
if (getenv("HOMARD_ROOT_DIR") == NULL) {
THROW_SALOME_CORBA_EXCEPTION("HOMARD_ROOT_DIR is not defined", SALOME::INTERNAL_ERROR);
}
else {
std::string homard_exec = getenv("HOMARD_ROOT_DIR");
homard_exec += "/bin/salome/homard";
if (!SMESH_File(homard_exec).exists())
THROW_SALOME_CORBA_EXCEPTION("HOMARD module is not built", SALOME::INTERNAL_ERROR);
}
SMESHHOMARD_I::HOMARD_Gen_i* aHomardGen = new SMESHHOMARD_I::HOMARD_Gen_i(); SMESHHOMARD_I::HOMARD_Gen_i* aHomardGen = new SMESHHOMARD_I::HOMARD_Gen_i();
SMESHHOMARD::HOMARD_Gen_var anObj = aHomardGen->_this(); SMESHHOMARD::HOMARD_Gen_var anObj = aHomardGen->_this();
return anObj._retn(); return anObj._retn();
@ -1841,10 +1850,12 @@ CORBA::Long HOMARD_Gen_i::Compute()
void HOMARD_Gen_i::CleanCase() void HOMARD_Gen_i::CleanCase()
{ {
// Delete log file, if required // Delete log file, if required
MESSAGE("myIteration1->GetLogFile() = " << myIteration1->GetLogFile()); if (!myIteration1->_is_nil()) {
if (_LogInFile && _RemoveLogOnSuccess) { MESSAGE("myIteration1->GetLogFile() = " << myIteration1->GetLogFile());
// Remove log file on success if (_LogInFile && _RemoveLogOnSuccess) {
SMESH_File(myIteration1->GetLogFile(), false).remove(); // Remove log file on success
SMESH_File(myIteration1->GetLogFile(), false).remove();
}
} }
// Delete all boundaries // Delete all boundaries