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 );
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);
SALOME::GenericObj Adaptation(in string adaptType);
SALOME::GenericObj Adaptation(in string adaptType) raises ( SALOME::SALOME_Exception );
MG_ADAPT CreateAdaptationHypothesis();
};

View File

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

View File

@ -3023,10 +3023,19 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
break;
EmitSignalDeactivateDialog();
SALOME::GenericObj_wrap< SMESHHOMARD::HOMARD_Gen > homardGen =
GetSMESHGen()->CreateHOMARD_ADAPT();
SMESHGUI_HomardAdaptDlg *aDlg = new SMESHGUI_HomardAdaptDlg(homardGen);
aDlg->show();
SALOME::GenericObj_wrap< SMESHHOMARD::HOMARD_Gen > homardGen;
try {
homardGen = GetSMESHGen()->CreateHOMARD_ADAPT();
}
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;
}
// Adaptation - end

View File

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

View File

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

View File

@ -65,6 +65,15 @@ using namespace std;
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::HOMARD_Gen_var anObj = aHomardGen->_this();
return anObj._retn();
@ -1841,10 +1850,12 @@ CORBA::Long HOMARD_Gen_i::Compute()
void HOMARD_Gen_i::CleanCase()
{
// Delete log file, if required
MESSAGE("myIteration1->GetLogFile() = " << myIteration1->GetLogFile());
if (_LogInFile && _RemoveLogOnSuccess) {
// Remove log file on success
SMESH_File(myIteration1->GetLogFile(), false).remove();
if (!myIteration1->_is_nil()) {
MESSAGE("myIteration1->GetLogFile() = " << myIteration1->GetLogFile());
if (_LogInFile && _RemoveLogOnSuccess) {
// Remove log file on success
SMESH_File(myIteration1->GetLogFile(), false).remove();
}
}
// Delete all boundaries