]> SALOME platform Git repositories - plugins/hybridplugin.git/commitdiff
Salome HOME
23307: [EDF 7315] Improvement of DISTENE meshing plugins
authoreap <eap@opencascade.com>
Tue, 9 Aug 2016 16:51:27 +0000 (19:51 +0300)
committereap <eap@opencascade.com>
Tue, 9 Aug 2016 16:51:27 +0000 (19:51 +0300)
14 files changed:
doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_advanced.png
doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_arguments.png
doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_layers.png
doc/salome/gui/HYBRIDPLUGIN/input/hybrid_hypo.doc
idl/HYBRIDPlugin_Algorithm.idl
src/GUI/CMakeLists.txt
src/GUI/HYBRIDPluginGUI_AdvWidget.cxx
src/GUI/HYBRIDPluginGUI_AdvWidget_QTD.ui
src/GUI/HYBRIDPluginGUI_HypothesisCreator.cxx
src/HYBRIDPlugin/HYBRIDPluginBuilder.py
src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx
src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.hxx
src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.cxx
src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.hxx

index 4775dc8aa76e7bd98049eb7d2755171b868a9bb2..956ade5406a004c9be2fbf6ecd0d63f44e2b9172 100644 (file)
Binary files a/doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_advanced.png and b/doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_advanced.png differ
index 175ab088752f30a082b2db768c4364c1528c57f1..a3a67c07d81b8c9292b11879226229d7e26588eb 100644 (file)
Binary files a/doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_arguments.png and b/doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_arguments.png differ
index 030594df95d6b1859559f86f29d63dae6f27f970..aca9fdc15a53ebc84b68d6ead2e0008d3a15ac7b 100644 (file)
Binary files a/doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_layers.png and b/doc/salome/gui/HYBRIDPLUGIN/images/hybrid_hypothesis_layers.png differ
index c9995ccf505aecff8a45c236c8938d538f5ad5cd..77e5b8ef6d94e0b6dac057fadf6b17abd2f84497 100644 (file)
@@ -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
 
-- <b>Option as text</b> - 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... <br> 
+<b>Add option</b> - 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"
 
index 3125bf28ecf36d89285e7a2b402cfbe79685d520..7f6233a1c2cfdb293cff630c35d6f93462aed736 100644 (file)
@@ -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
index 1fc77ca9032b7f79d6841a9823847e955ef983b7..8e5642c7a550144235670855019d1154e2173ff3 100644 (file)
@@ -50,7 +50,7 @@ SET(_link_LIBRARIES
   ${KERNEL_SALOMELocalTrace}
   ${GEOM_GEOM}
   ${SMESH_SMESH}
-  ${SMESH_GeomSelectionTools}
+  ${SMESH_PluginUtils}
   ${SMESH_StdMeshersGUI}
   ${SMESH_SMESHFiltersSelection}
   ${GUI_suit}
index d7aaa32055159b6981c75cdb4587d38ff790a28f..f9fda8a3a23c5452120183e37eb067cb30b44b74 100644 (file)
@@ -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()
index 056e712fee1e5ad0a65500f38ab8b8fe9ff51c0a..b5a735055dd3c023a7cb66aa4ec0985e373ea003 100644 (file)
       <string>Advanced meshing options</string>
      </property>
      <layout class="QGridLayout" name="gridLayout_4">
-      <item row="7" column="1">
-       <widget class="QLineEdit" name="textOptionLineEdit"/>
-      </item>
-      <item row="6" column="0">
-       <widget class="QLabel" name="gradationLabel">
+      <item row="1" column="0">
+       <widget class="QCheckBox" name="removeInitialCentralPointCheck">
         <property name="text">
-         <string>Volumic gradation</string>
+         <string>Remove initial central point</string>
         </property>
        </widget>
       </item>
-      <item row="7" column="0">
-       <widget class="QLabel" name="textOptionLabel">
+      <item row="6" column="0">
+       <widget class="QLabel" name="gradationLabel">
         <property name="text">
-         <string>Option as text</string>
+         <string>Volumic gradation</string>
         </property>
        </widget>
       </item>
       <item row="6" column="1">
        <widget class="SMESHGUI_SpinBox" name="gradationSpinBox"/>
       </item>
-      <item row="0" column="0">
-       <widget class="QCheckBox" name="createNewNodesCheck">
-        <property name="text">
-         <string>Create new nodes</string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="0">
-       <widget class="QCheckBox" name="removeInitialCentralPointCheck">
-        <property name="text">
-         <string>Remove initial central point</string>
-        </property>
-       </widget>
-      </item>
       <item row="1" column="1">
        <widget class="QCheckBox" name="FEMCorrectionCheck">
         <property name="text">
         </property>
        </widget>
       </item>
+      <item row="0" column="0">
+       <widget class="QCheckBox" name="createNewNodesCheck">
+        <property name="text">
+         <string>Create new nodes</string>
+        </property>
+       </widget>
+      </item>
+      <item row="7" column="0" colspan="2">
+       <widget class="SMESH_AdvOptionsWdg" name="myAdvOptionsTable" native="true"/>
+      </item>
      </layout>
     </widget>
    </item>
  <customwidgets>
   <customwidget>
    <class>SMESHGUI_SpinBox</class>
-   <extends>QSpinBox</extends>
-   <header>SMESHGUI_SpinBox.h</header>
+   <extends>QDoubleSpinBox</extends>
+   <header location="global">SMESHGUI_SpinBox.h</header>
+  </customwidget>
+  <customwidget>
+   <class>SMESH_AdvOptionsWdg</class>
+   <extends>QWidget</extends>
+   <header location="global">SMESH_AdvOptionsWdg.h</header>
+   <container>1</container>
   </customwidget>
  </customwidgets>
  <resources/>
index 1855b12d33303d5d16c5907fe358913163791789..5b50e170870d65503cc957b5db4c251b0f222403 100644 (file)
@@ -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();
   
index d7f1163b74d844eb233e65388191ec57a647a167..1d859f5815c44981df84515bcd5fab76d37a6fcd 100644 (file)
@@ -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
index 22fef3cdeb1be7d906b5535b89ad3cd1e0864f26..8cca352878fa7a0f866088d9980d954aa959cdd5 100644 (file)
@@ -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<bool>(load >> i);
-    if (isOK)
-      myKeepFiles = i;
-    else
-      load.clear(ios::badbit | load.rdstate());
-  }
-
   isOK = static_cast<bool>(load >> i);
   if (isOK)
     myVerboseLevel = (short) i;
index 24708b5abed5e58fe8f87ddc85feec6f126bb2ff..779eee5d5c830cdebd32bb0e2c168faff5bac292 100644 (file)
@@ -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
   */
index aecf89fe68b4bca70f77d2ed521dac9659c8c29e..dbb26c50a845ae3739c86fd3a13b8e5a7fffa47e 100644 (file)
@@ -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() );
 }
 
 //=======================================================================
index b063905b043c43e9f3ae9bcf1544759fc50d7155..7c343525f79d822428949b03a697ac319c2097b9 100644 (file)
@@ -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();
   /*!