From: eap Date: Tue, 9 Aug 2016 16:51:27 +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=16542d83ddd1354d638f49aa4b965da2291d3b26;p=plugins%2Fhybridplugin.git 23307: [EDF 7315] Improvement of DISTENE meshing plugins --- diff --git a/doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_advanced.png b/doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_advanced.png index 4775dc8..956ade5 100644 Binary files a/doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_advanced.png and b/doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_advanced.png differ diff --git a/doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_arguments.png b/doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_arguments.png index 175ab08..a3a67c0 100644 Binary files a/doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_arguments.png and b/doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_arguments.png differ diff --git a/doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_layers.png b/doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_layers.png index 030594d..aca9fdc 100644 Binary files a/doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_layers.png and b/doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_layers.png differ diff --git a/doc/salome/gui/HYBRIDPLUGIN/input/hybrid_hypo.doc b/doc/salome/gui/HYBRIDPLUGIN/input/hybrid_hypo.doc index c9995cc..77e5b8e 100644 --- a/doc/salome/gui/HYBRIDPLUGIN/input/hybrid_hypo.doc +++ b/doc/salome/gui/HYBRIDPLUGIN/input/hybrid_hypo.doc @@ -239,8 +239,11 @@ launch of the mesher. The log file (if any) is also kept if this option is check \subsection advanced_meshing_options Advanced meshing options -- Option as text - allows to input in the command line any text -for hybrid argument from "mg-hybrid.exe help", and future advanced options... +- A table allows to input in the command line any text +for hybrid argument from "mg-hybrid.exe help", and future 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 hybrid_top "Back to top" diff --git a/idl/HYBRIDPlugin_Algorithm.idl b/idl/HYBRIDPlugin_Algorithm.idl index 3125bf2..7f6233a 100644 --- a/idl/HYBRIDPlugin_Algorithm.idl +++ b/idl/HYBRIDPlugin_Algorithm.idl @@ -208,7 +208,9 @@ module HYBRIDPlugin /*! * To set hiden/undocumented/advanced options */ - void SetTextOption(in string option); + void SetAdvancedOption( in string optAndVals ); + string GetAdvancedOption(); + void SetTextOption(in string option); // obsolete string GetTextOption(); /*! * To define the volumic gradation diff --git a/src/GUI/CMakeLists.txt b/src/GUI/CMakeLists.txt index 1fc77ca..8e5642c 100644 --- a/src/GUI/CMakeLists.txt +++ b/src/GUI/CMakeLists.txt @@ -50,7 +50,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/HYBRIDPluginGUI_AdvWidget.cxx b/src/GUI/HYBRIDPluginGUI_AdvWidget.cxx index d7aaa32..f9fda8a 100644 --- a/src/GUI/HYBRIDPluginGUI_AdvWidget.cxx +++ b/src/GUI/HYBRIDPluginGUI_AdvWidget.cxx @@ -38,6 +38,7 @@ HYBRIDPluginGUI_AdvWidget::HYBRIDPluginGUI_AdvWidget( QWidget* parent, Qt::Windo : QWidget( parent, f ) { setupUi( this ); + myAdvOptionsTable->layout()->setMargin( 0 ); } HYBRIDPluginGUI_AdvWidget::~HYBRIDPluginGUI_AdvWidget() diff --git a/src/GUI/HYBRIDPluginGUI_AdvWidget_QTD.ui b/src/GUI/HYBRIDPluginGUI_AdvWidget_QTD.ui index 056e712..b5a7350 100644 --- a/src/GUI/HYBRIDPluginGUI_AdvWidget_QTD.ui +++ b/src/GUI/HYBRIDPluginGUI_AdvWidget_QTD.ui @@ -160,40 +160,23 @@ Advanced meshing options - - - - - + + - Volumic gradation + Remove initial central point - - + + - Option as text + Volumic gradation - - - - Create new nodes - - - - - - - Remove initial central point - - - @@ -208,6 +191,16 @@ + + + + Create new nodes + + + + + + @@ -216,8 +209,14 @@ SMESHGUI_SpinBox - QSpinBox -
SMESHGUI_SpinBox.h
+ QDoubleSpinBox +
SMESHGUI_SpinBox.h
+
+ + SMESH_AdvOptionsWdg + QWidget +
SMESH_AdvOptionsWdg.h
+ 1
diff --git a/src/GUI/HYBRIDPluginGUI_HypothesisCreator.cxx b/src/GUI/HYBRIDPluginGUI_HypothesisCreator.cxx index 1855b12..5b50e17 100644 --- a/src/GUI/HYBRIDPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/HYBRIDPluginGUI_HypothesisCreator.cxx @@ -505,7 +505,6 @@ QFrame* HYBRIDPluginGUI_HypothesisCreator::buildFrame() myAdvWidget->FEMCorrectionCheck ->setText (tr( "FEM_CORRECTION" )); myAdvWidget->gradationLabel ->setText (tr( "HYBRID_GRADATION" )); myAdvWidget->gradationSpinBox->RangeStepAndValidator(1.05, 5.0, 0.05, "length_precision"); - myAdvWidget->textOptionLabel->setText(tr( "TEXT_OPTION" )); // Enforced vertices parameters myEnfGroup = new QWidget(); @@ -1533,17 +1532,17 @@ void HYBRIDPluginGUI_HypothesisCreator::retrieveParams() const myBoundaryLayersProgressionSpin -> setValue( data.myBoundaryLayersProgression ); myMultinormalsAngleSpin -> setValue( data.myMultinormalsAngle ); - myAdvWidget->workingDirectoryLineEdit ->setText ( data.myWorkingDir ); - myAdvWidget->keepWorkingFilesCheck ->setChecked ( data.myKeepFiles ); - myAdvWidget->verboseLevelSpin ->setValue ( data.myVerboseLevel ); - myAdvWidget->createNewNodesCheck ->setChecked ( data.myToCreateNewNodes ); - myAdvWidget->removeInitialCentralPointCheck ->setChecked ( data.myRemoveInitialCentralPoint ); - myAdvWidget->boundaryRecoveryCheck ->setChecked ( data.myBoundaryRecovery ); - myAdvWidget->FEMCorrectionCheck ->setChecked ( data.myFEMCorrection ); - myAdvWidget->gradationSpinBox ->setValue ( data.myGradation ); - myAdvWidget->textOptionLineEdit ->setText ( data.myTextOption ); - myAdvWidget->logInFileCheck ->setChecked ( !data.myLogInStandardOutput ); - myAdvWidget->removeLogOnSuccessCheck ->setChecked ( data.myRemoveLogOnSuccess ); + myAdvWidget->workingDirectoryLineEdit ->setText ( data.myWorkingDir ); + myAdvWidget->keepWorkingFilesCheck ->setChecked( data.myKeepFiles ); + myAdvWidget->verboseLevelSpin ->setValue ( data.myVerboseLevel ); + myAdvWidget->createNewNodesCheck ->setChecked( data.myToCreateNewNodes ); + myAdvWidget->removeInitialCentralPointCheck ->setChecked( data.myRemoveInitialCentralPoint ); + myAdvWidget->boundaryRecoveryCheck ->setChecked( data.myBoundaryRecovery ); + myAdvWidget->FEMCorrectionCheck ->setChecked( data.myFEMCorrection ); + myAdvWidget->gradationSpinBox ->setValue ( data.myGradation ); + myAdvWidget->myAdvOptionsTable ->SetCustomOptions( data.myTextOption ); + myAdvWidget->logInFileCheck ->setChecked( !data.myLogInStandardOutput ); + myAdvWidget->removeLogOnSuccessCheck ->setChecked( data.myRemoveLogOnSuccess ); TEnfVertexList::const_iterator it; int rowCount = 0; @@ -1797,7 +1796,7 @@ bool HYBRIDPluginGUI_HypothesisCreator::readParamsFromHypo( HYBRIDHypothesisData 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(); @@ -1910,7 +1909,7 @@ bool HYBRIDPluginGUI_HypothesisCreator::storeParamsToHypo( const HYBRIDHypothesi if ( h->GetGradation() != h_data.myGradation ) h->SetGradation ( h_data.myGradation ); if ( h->GetTextOption() != h_data.myTextOption ) - h->SetTextOption ( h_data.myTextOption.toLatin1().constData() ); + h->SetAdvancedOption ( h_data.myTextOption.toLatin1().constData() ); if ( h->GetStandardOutputLog() != h_data.myLogInStandardOutput ) h->SetStandardOutputLog ( h_data.myLogInStandardOutput ); if ( h->GetRemoveLogOnSuccess() != h_data.myRemoveLogOnSuccess ) @@ -2027,7 +2026,7 @@ bool HYBRIDPluginGUI_HypothesisCreator::readParamsFromWidgets( HYBRIDHypothesisD 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->myAdvOptionsTable->GetCustomOptions(); h_data.myLogInStandardOutput = !myAdvWidget->logInFileCheck->isChecked(); h_data.myRemoveLogOnSuccess = myAdvWidget->removeLogOnSuccessCheck->isChecked(); diff --git a/src/HYBRIDPlugin/HYBRIDPluginBuilder.py b/src/HYBRIDPlugin/HYBRIDPluginBuilder.py index d7f1163..1d859f5 100644 --- a/src/HYBRIDPlugin/HYBRIDPluginBuilder.py +++ b/src/HYBRIDPlugin/HYBRIDPluginBuilder.py @@ -348,9 +348,17 @@ class HYBRID_Algorithm(Mesh_Algorithm): pass ## Sets command line option as text. + # + # OBSOLETE. Use SetAdvancedOption() # @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 HYBRID_Algorithm class diff --git a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx index 22fef3c..8cca352 100644 --- a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx +++ b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx @@ -559,10 +559,10 @@ bool HYBRIDPlugin_Hypothesis::GetToRemoveCentralPoint() const } //======================================================================= -//function : SetTextOption +//function : SetAdvancedOption //======================================================================= -void HYBRIDPlugin_Hypothesis::SetTextOption(const std::string& option) +void HYBRIDPlugin_Hypothesis::SetAdvancedOption(const std::string& option) { if ( myTextOption != option ) { myTextOption = option; @@ -571,10 +571,10 @@ void HYBRIDPlugin_Hypothesis::SetTextOption(const std::string& option) } //======================================================================= -//function : GetTextOption +//function : GetAdvancedOption //======================================================================= -std::string HYBRIDPlugin_Hypothesis::GetTextOption() const +std::string HYBRIDPlugin_Hypothesis::GetAdvancedOption() const { return myTextOption; } @@ -1484,14 +1484,6 @@ std::istream & HYBRIDPlugin_Hypothesis::LoadFrom(std::istream & load) else load.clear(ios::badbit | load.rdstate()); - if ( !myWorkingDirectory.empty() ) { - isOK = static_cast(load >> i); - if (isOK) - myKeepFiles = i; - else - load.clear(ios::badbit | load.rdstate()); - } - isOK = static_cast(load >> i); if (isOK) myVerboseLevel = (short) i; diff --git a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.hxx b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.hxx index 24708b5..779eee5 100644 --- a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.hxx +++ b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.hxx @@ -258,8 +258,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/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.cxx b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.cxx index aecf89f..dbb26c5 100644 --- a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.cxx +++ b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.cxx @@ -398,8 +398,8 @@ CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetToRemoveCentralPoint() void HYBRIDPlugin_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 << "' )"; } //======================================================================= @@ -408,7 +408,27 @@ void HYBRIDPlugin_Hypothesis_i::SetTextOption(const char* option) char* HYBRIDPlugin_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 HYBRIDPlugin_Hypothesis_i::SetAdvancedOption(const char* theOptAndVals ) +{ + if ( theOptAndVals && GetImpl()->GetAdvancedOption() != theOptAndVals ) + { + GetImpl()->SetAdvancedOption( theOptAndVals ); + SMESH::TPythonDump() << _this() << ".SetAdvancedOption( '" << theOptAndVals << "' )"; + } +} + +//======================================================================= +//function : GetAdvancedOption +//======================================================================= +char* HYBRIDPlugin_Hypothesis_i::GetAdvancedOption() +{ + return CORBA::string_dup( GetImpl()->GetAdvancedOption().c_str() ); } //======================================================================= diff --git a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.hxx b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.hxx index b063905..7c34352 100644 --- a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.hxx +++ b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.hxx @@ -137,6 +137,8 @@ class HYBRIDPLUGIN_EXPORT HYBRIDPlugin_Hypothesis_i: /*! * To set hiden/undocumented/advanced options */ + void SetAdvancedOption(const char* theOptAndVals ); + char* GetAdvancedOption(); void SetTextOption(const char* option); char* GetTextOption(); /*!