From: eap Date: Tue, 9 Aug 2016 16:46:06 +0000 (+0300) Subject: 23307: [EDF 7315] Improvement of DISTENE meshing plugins X-Git-Tag: V8_1_0b1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=769628d98ce89e7510f830056025b60aed895bd3;p=plugins%2Fghs3dplugin.git 23307: [EDF 7315] Improvement of DISTENE meshing plugins --- diff --git a/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_enforced_meshes.png b/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_enforced_meshes.png index b612ced..29a98b4 100644 Binary files a/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_enforced_meshes.png and b/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_enforced_meshes.png differ diff --git a/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_enforced_vertices.png b/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_enforced_vertices.png index 2b85f9f..9c5cf77 100644 Binary files a/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_enforced_vertices.png and b/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_enforced_vertices.png differ diff --git a/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_advanced.png b/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_advanced.png index 81439d7..4372e3c 100644 Binary files a/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_advanced.png and b/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_advanced.png differ diff --git a/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png b/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png index 08feab4..8963bd0 100644 Binary files a/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png and b/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png differ diff --git a/doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc b/doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc index 8aa1470..9e29026 100644 --- a/doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc +++ b/doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc @@ -128,8 +128,11 @@ By default, the FEM correction is not used. - Volumic gradation - Defines the volumic ratio between 2 consecutive elements. WARNING: Changing the default value of this parameter may dramatically decrease the quality of the resulting mesh. -- Option as text - allows to input in the command line any text -for MG-Tetra, for example, advanced options. +- A table at the page bottom allows to input in the command line any text +for MG-Tetra, for example, advanced options.
+Add option - adds a line to the table where you can type an option and its value as text. +A check box in the first column activates/deactivates the option of the current row. A deactivated option will be erased upon pressing \a Ok. + \ref ghs3d_top "Back to top" diff --git a/idl/GHS3DPlugin_Algorithm.idl b/idl/GHS3DPlugin_Algorithm.idl index 3f127d7..f18b3ac 100644 --- a/idl/GHS3DPlugin_Algorithm.idl +++ b/idl/GHS3DPlugin_Algorithm.idl @@ -145,7 +145,9 @@ module GHS3DPlugin /*! * To set hiden/undocumented/advanced options */ - void SetTextOption(in string option); + void SetAdvancedOption(in string option); + string GetAdvancedOption(); + void SetTextOption(in string option); // obsolete string GetTextOption(); /*! * To define the volumic gradation diff --git a/src/GHS3DPlugin/GHS3DPluginBuilder.py b/src/GHS3DPlugin/GHS3DPluginBuilder.py index d0b9624..2d1a630 100644 --- a/src/GHS3DPlugin/GHS3DPluginBuilder.py +++ b/src/GHS3DPlugin/GHS3DPluginBuilder.py @@ -260,7 +260,13 @@ class GHS3D_Algorithm(Mesh_Algorithm): ## Sets command line option as text. # @param option command line option def SetTextOption(self, option): - self.Parameters().SetTextOption(option) + self.Parameters().SetAdvancedOption(option) + pass + + ## Sets command line option as text. + # @param option command line option + def SetAdvancedOption(self, option): + self.Parameters().SetAdvancedOption(option) pass pass # end of GHS3D_Algorithm class diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx index 59d38c6..5f3e70d 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx @@ -345,10 +345,10 @@ bool GHS3DPlugin_Hypothesis::GetToRemoveCentralPoint() const } //======================================================================= -//function : SetTextOption +//function : SetAdvancedOption //======================================================================= -void GHS3DPlugin_Hypothesis::SetTextOption(const std::string& option) +void GHS3DPlugin_Hypothesis::SetAdvancedOption(const std::string& option) { if ( myTextOption != option ) { myTextOption = option; @@ -357,10 +357,10 @@ void GHS3DPlugin_Hypothesis::SetTextOption(const std::string& option) } //======================================================================= -//function : GetTextOption +//function : GetAdvancedOption //======================================================================= -std::string GHS3DPlugin_Hypothesis::GetTextOption() const +std::string GHS3DPlugin_Hypothesis::GetAdvancedOption() const { return myTextOption; } diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx index 58b2986..06c26ff 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx @@ -197,8 +197,8 @@ public: /*! * To set hiden/undocumented/advanced options */ - void SetTextOption(const std::string& option); - std::string GetTextOption() const; + void SetAdvancedOption(const std::string& option); + std::string GetAdvancedOption() const; /*! * To define the volumic gradation */ diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx index 8ea2391..dd3239f 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx @@ -360,8 +360,8 @@ CORBA::Boolean GHS3DPlugin_Hypothesis_i::GetToRemoveCentralPoint() void GHS3DPlugin_Hypothesis_i::SetTextOption(const char* option) { ASSERT(myBaseImpl); - this->GetImpl()->SetTextOption(option); - SMESH::TPythonDump() << _this() << ".SetTextOption( '" << option << "' )"; + this->GetImpl()->SetAdvancedOption(option); + SMESH::TPythonDump() << _this() << ".SetAdvancedOption( '" << option << "' )"; } //======================================================================= @@ -371,7 +371,28 @@ void GHS3DPlugin_Hypothesis_i::SetTextOption(const char* option) char* GHS3DPlugin_Hypothesis_i::GetTextOption() { ASSERT(myBaseImpl); - return CORBA::string_dup( this->GetImpl()->GetTextOption().c_str() ); + return CORBA::string_dup( this->GetImpl()->GetAdvancedOption().c_str() ); +} + +//======================================================================= +//function : SetAdvancedOption +//======================================================================= + +void GHS3DPlugin_Hypothesis_i::SetAdvancedOption(const char* option) +{ + ASSERT(myBaseImpl); + this->GetImpl()->SetAdvancedOption(option); + SMESH::TPythonDump() << _this() << ".SetAdvancedOption( '" << option << "' )"; +} + +//======================================================================= +//function : GetAdvancedOption +//======================================================================= + +char* GHS3DPlugin_Hypothesis_i::GetAdvancedOption() +{ + ASSERT(myBaseImpl); + return CORBA::string_dup( this->GetImpl()->GetAdvancedOption().c_str() ); } //======================================================================= diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx index 8c33eda..d48a49d 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx @@ -127,7 +127,9 @@ class GHS3DPLUGIN_EXPORT GHS3DPlugin_Hypothesis_i: /*! * To set hiden/undocumented/advanced options */ - void SetTextOption(const char* option); + void SetAdvancedOption(const char* option); + char* GetAdvancedOption(); + void SetTextOption(const char* option); // obsolete char* GetTextOption(); /*! * To define the volumic gradation diff --git a/src/GUI/CMakeLists.txt b/src/GUI/CMakeLists.txt index abc4373..fc83f9e 100644 --- a/src/GUI/CMakeLists.txt +++ b/src/GUI/CMakeLists.txt @@ -49,7 +49,7 @@ SET(_link_LIBRARIES ${KERNEL_SALOMELocalTrace} ${GEOM_GEOM} ${SMESH_SMESH} - ${SMESH_GeomSelectionTools} + ${SMESH_PluginUtils} ${SMESH_StdMeshersGUI} ${SMESH_SMESHFiltersSelection} ${GUI_suit} diff --git a/src/GUI/GHS3DPluginGUI_AdvWidget.cxx b/src/GUI/GHS3DPluginGUI_AdvWidget.cxx index 84af0a8..6b4de5c 100644 --- a/src/GUI/GHS3DPluginGUI_AdvWidget.cxx +++ b/src/GUI/GHS3DPluginGUI_AdvWidget.cxx @@ -38,6 +38,7 @@ GHS3DPluginGUI_AdvWidget::GHS3DPluginGUI_AdvWidget( QWidget* parent, Qt::WindowF : QWidget( parent, f ) { setupUi( this ); + advOptionTable->layout()->setMargin( 0 ); } GHS3DPluginGUI_AdvWidget::~GHS3DPluginGUI_AdvWidget() diff --git a/src/GUI/GHS3DPluginGUI_AdvWidget_QTD.ui b/src/GUI/GHS3DPluginGUI_AdvWidget_QTD.ui index 5754262..6d1ab70 100644 --- a/src/GUI/GHS3DPluginGUI_AdvWidget_QTD.ui +++ b/src/GUI/GHS3DPluginGUI_AdvWidget_QTD.ui @@ -65,7 +65,7 @@ 0 - + 999999999 @@ -78,7 +78,7 @@ 0 - + 999999999 @@ -166,44 +166,34 @@ Advanced meshing options - - - - - + + - Volumic gradation + Use FEM correction - - + + - Option as text + Remove initial central point - - - - Create new nodes - - - - - + + - Remove initial central point + Volumic gradation - - + + - Use FEM correction + Create new nodes @@ -214,6 +204,9 @@ + + + @@ -222,13 +215,19 @@ SMESHGUI_SpinBox - QSpinBox -
SMESHGUI_SpinBox.h
+ QDoubleSpinBox +
SMESHGUI_SpinBox.h
SalomeApp_IntSpinBox - QSpinBox -
SalomeApp_IntSpinBox.h
+ QLineEdit +
SalomeApp_IntSpinBox.h
+
+ + SMESH_AdvOptionsWdg + QWidget +
SMESH_AdvOptionsWdg.h
+ 1
diff --git a/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx b/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx index ac5b1ca..f66769e 100644 --- a/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx @@ -68,42 +68,6 @@ #include -namespace { - -#ifdef WIN32 -#include -#else -#include -#endif - - long maxAvailableMemory() - { -#ifdef WIN32 - // See http://msdn.microsoft.com/en-us/library/aa366589.aspx - MEMORYSTATUSEX statex; - statex.dwLength = sizeof (statex); - long err = GlobalMemoryStatusEx (&statex); - if (err != 0) { - long totMB = - statex.ullTotalPhys / 1024 / 1024 + - statex.ullTotalPageFile / 1024 / 1024 + - statex.ullTotalVirtual / 1024 / 1024; - return (long) ( 0.7 * totMB ); - } -#else - struct sysinfo si; - long err = sysinfo( &si ); - if ( err == 0 ) { - long totMB = - si.totalram * si.mem_unit / 1024 / 1024 + - si.totalswap * si.mem_unit / 1024 / 1024 ; - return (long) ( 0.7 * totMB ); - } -#endif - return 0; - } -} - // // BEGIN EnforcedVertexTableWidgetDelegate // @@ -442,7 +406,6 @@ QFrame* GHS3DPluginGUI_HypothesisCreator::buildFrame() myAdvWidget->FEMCorrectionCheck ->setText (tr( "FEM_CORRECTION" )); myAdvWidget->gradationLabel ->setText (tr( "GHS3D_GRADATION" )); myAdvWidget->gradationSpinBox->RangeStepAndValidator(0.0, 5.0, 0.05, "length_precision"); - myAdvWidget->textOptionLabel->setText(tr( "TEXT_OPTION" )); // Enforced vertices parameters myEnfGroup = new QWidget(); @@ -1443,7 +1406,7 @@ void GHS3DPluginGUI_HypothesisCreator::retrieveParams() const myAdvWidget->boundaryRecoveryCheck ->setChecked ( data.myBoundaryRecovery ); myAdvWidget->FEMCorrectionCheck ->setChecked ( data.myFEMCorrection ); myAdvWidget->gradationSpinBox ->setValue ( data.myGradation ); - myAdvWidget->textOptionLineEdit ->setText ( data.myTextOption ); + myAdvWidget->advOptionTable ->SetCustomOptions( data.myTextOption ); myAdvWidget->logInFileCheck ->setChecked ( !data.myLogInStandardOutput ); myAdvWidget->removeLogOnSuccessCheck ->setChecked ( data.myRemoveLogOnSuccess ); @@ -1687,14 +1650,14 @@ bool GHS3DPluginGUI_HypothesisCreator::readParamsFromHypo( GHS3DHypothesisData& h_data.myBoundaryRecovery = h->GetToUseBoundaryRecoveryVersion(); h_data.myFEMCorrection = h->GetFEMCorrection(); h_data.myGradation = h->GetGradation(); - h_data.myTextOption = h->GetTextOption(); + h_data.myTextOption = h->GetAdvancedOption(); h_data.myLogInStandardOutput = h->GetStandardOutputLog(); h_data.myRemoveLogOnSuccess = h->GetRemoveLogOnSuccess(); GHS3DPlugin::GHS3DEnforcedVertexList_var vertices = h->GetEnforcedVertices(); MESSAGE("vertices->length(): " << vertices->length()); h_data.myEnforcedVertices.clear(); - for (int i=0 ; ilength() ; i++) { + for (CORBA::ULong i=0 ; ilength() ; i++) { TEnfVertex* myVertex = new TEnfVertex(); myVertex->name = CORBA::string_dup(vertices[i].name.in()); myVertex->geomEntry = CORBA::string_dup(vertices[i].geomEntry.in()); @@ -1702,7 +1665,7 @@ bool GHS3DPluginGUI_HypothesisCreator::readParamsFromHypo( GHS3DHypothesisData& myVertex->size = vertices[i].size; myVertex->isCompound = vertices[i].isCompound; if (vertices[i].coords.length()) { - for (int c = 0; c < vertices[i].coords.length() ; c++) + for (CORBA::ULong c = 0; c < vertices[i].coords.length() ; c++) myVertex->coords.push_back(vertices[i].coords[c]); MESSAGE("Add enforced vertex ("<< myVertex->coords.at(0) << ","<< myVertex->coords.at(1) << ","<< myVertex->coords.at(2) << ") ="<< myVertex->size); } @@ -1712,7 +1675,7 @@ bool GHS3DPluginGUI_HypothesisCreator::readParamsFromHypo( GHS3DHypothesisData& GHS3DPlugin::GHS3DEnforcedMeshList_var enfMeshes = h->GetEnforcedMeshes(); MESSAGE("enfMeshes->length(): " << enfMeshes->length()); h_data.myEnforcedMeshes.clear(); - for (int i=0 ; ilength() ; i++) { + for (CORBA::ULong i=0 ; ilength() ; i++) { TEnfMesh* myEnfMesh = new TEnfMesh(); myEnfMesh->name = CORBA::string_dup(enfMeshes[i].name.in()); myEnfMesh->entry = CORBA::string_dup(enfMeshes[i].entry.in()); @@ -1776,8 +1739,8 @@ bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisD h->SetFEMCorrection ( h_data.myFEMCorrection ); if ( h->GetGradation() != h_data.myGradation ) h->SetGradation ( h_data.myGradation ); - if ( h->GetTextOption() != h_data.myTextOption ) - h->SetTextOption ( h_data.myTextOption.toLatin1().constData() ); + if ( h->GetAdvancedOption() != h_data.myTextOption ) + h->SetAdvancedOption ( h_data.myTextOption.toLatin1().constData() ); if ( h->GetStandardOutputLog() != h_data.myLogInStandardOutput ) h->SetStandardOutputLog( h_data.myLogInStandardOutput ); if ( h->GetRemoveLogOnSuccess() != h_data.myRemoveLogOnSuccess ) @@ -1881,7 +1844,7 @@ bool GHS3DPluginGUI_HypothesisCreator::readParamsFromWidgets( GHS3DHypothesisDat h_data.myBoundaryRecovery = myAdvWidget->boundaryRecoveryCheck->isChecked(); h_data.myFEMCorrection = myAdvWidget->FEMCorrectionCheck->isChecked(); h_data.myGradation = myAdvWidget->gradationSpinBox->value(); - h_data.myTextOption = myAdvWidget->textOptionLineEdit->text(); + h_data.myTextOption = myAdvWidget->advOptionTable->GetCustomOptions(); h_data.myLogInStandardOutput = !myAdvWidget->logInFileCheck->isChecked(); h_data.myRemoveLogOnSuccess = myAdvWidget->removeLogOnSuccessCheck->isChecked();