Salome HOME
IMP: EDF 2680: New options for log files
authorrnc <rnc@opencascade.com>
Wed, 11 Sep 2013 15:01:13 +0000 (15:01 +0000)
committerrnc <rnc@opencascade.com>
Wed, 11 Sep 2013 15:01:13 +0000 (15:01 +0000)
The user can now choose to print the log in a file or in the standard output
The user can choose to keep only log files, keep all working files or keep log files when computation fails only

21 files changed:
doc/salome/gui/GHS3DPLUGIN/images/ghs3d_enforced_meshes.png
doc/salome/gui/GHS3DPLUGIN/images/ghs3d_enforced_vertices.png
doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_advanced.png
doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png
doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc
idl/GHS3DPlugin_Algorithm.idl
src/GHS3DPlugin/GHS3DPluginBuilder.py
src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx
src/GHS3DPlugin/GHS3DPlugin_GHS3D.hxx
src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx
src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx
src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx
src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx
src/GUI/GHS3DPluginGUI_AdvWidget.cxx [new file with mode: 0644]
src/GUI/GHS3DPluginGUI_AdvWidget_QTD.ui [new file with mode: 0644]
src/GUI/GHS3DPluginGUI_Dlg.h [new file with mode: 0644]
src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx
src/GUI/GHS3DPluginGUI_HypothesisCreator.h
src/GUI/GHS3DPlugin_msg_en.ts
src/GUI/GHS3DPlugin_msg_fr.ts
src/GUI/Makefile.am

index 72ed7779bee08389e41d4272a1bdc6651d21e858..c41c62ea467e7da81985bedfe3095811959d8f89 100644 (file)
Binary files a/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_enforced_meshes.png and b/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_enforced_meshes.png differ
index e86a73ed131a806fbf9ba39e2cb12213bac85110..75126ee72d069b571bb0ee3869860c338b9439f5 100644 (file)
Binary files a/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_enforced_vertices.png and b/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_enforced_vertices.png differ
index e99409e914a274836798494e7f542535ba65c4fb..6ad5f894a3f7a2ddda4186bb47ea8741bf12a355 100644 (file)
Binary files a/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_advanced.png and b/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_advanced.png differ
index e71688edaae24fe3806061178a7beaab3aa6c0a2..450a4a12789c16cd8a2054805700804b7b30f5d5 100644 (file)
Binary files a/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png and b/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png differ
index 0930956412b98b84fe51075ae7068aecac2a1f32..bf6e194eaa3079beeae0042f38f3fdb2647a2b6a 100644 (file)
@@ -17,12 +17,12 @@ To get a licence, visit http://www.distene.com/en/corp/eval-distene.html
 - <b>Name</b> - allows to define the name of the hypothesis (GHS3D 
 Parameters by default).
 
-- <b>To mesh holes</b> - if checked, the algorithm will 
+- <b>Mesh holes</b> - if checked, the algorithm will 
 create mesh in the holes inside a solid shape, else only the outermost
 shape will be meshed. Volumic elements created within holes are bound
 to the solid.
 
-- <b>To make groups of domains</b> - if checked, the algorithm will
+- <b>Make groups of domains</b> - if checked, the algorithm will
 create groups of just generated elements corresponding to each mesh
 domain.<br>
 
@@ -46,6 +46,8 @@ but can be time-consuming):
 
 \image html ghs3d_parameters_advanced.png
 
+\subsection memory_settings Memory settings
+
 - <b>Maximum memory size</b> - launches ghs3d software with
 work space limited to the specified amount of RAM, in Mbytes. If this option is
 checked off, the software will be launched with 7O% of the total RAM space.
@@ -54,13 +56,11 @@ checked off, the software will be launched with 7O% of the total RAM space.
 the specified amount of work space, in Mbytes. If this option is checked off, the
 software will be started with 100 Megabytes of working space.
 
+\subsection log Logs and debug
+
 - <b>Working directory</b> - allows defining the folder for input and output
 files of ghs3d software, which are the files starting with "GHS3D_" prefix.
 
-- <b>Keep working files</b> - allows checking input and output files
-of ghs3d software, while usually these files are removed after the
-launch of the mesher.
-
 - <b>Verbose level</b> - to choose verbosity level in the range from
 0 to 10.
 
@@ -73,11 +73,25 @@ launch of the mesher.
   - 10, same as 2 plus the main steps in the computation, quality
   statistics histogram of the skin mesh, quality statistics histogram
   together with the characteristics of the final mesh.
+  
+- <b>Print log in a file</b> - if this option is checked on the log is printed in a 
+file placed in the working directory, otherwise it is printed on the standard output.
+
+- <b>Remove log on success</b> - if this option is checked on the log file is kept only
+if an error occurs during the computation. This option is only available if <b>Print log in a file</b>
+is enabled (there must be a log file to delete it) and <b>Keep all working files</b> is disabled 
+(in this case the log file is always kept). 
+
+- <b>Keep all working files</b> - allows checking input and output files
+of ghs3d software, while usually these files are removed after the
+launch of the mesher. The log file (if any) is also kept if this option is checked.
+
+\subsection advanced_meshing_options Advanced meshing options
 
-- <b>To create new nodes</b> - if this option is checked off, ghs3d
+- <b>Create new nodes</b> - if this option is checked off, ghs3d
 tries to create tetrahedrons using only the nodes of the 2D mesh.
 
-- <b>To remove the initial central point</b> TetMesh-GHS3D adds an internal point 
+- <b>Remove the initial central point</b> TetMesh-GHS3D adds an internal point 
 at the gravity centre of the bounding box to speed up and to simplify 
 the meshing process. However, it is possible to refrain from creating 
 this point by using the command line option -no initial central point. This can be
@@ -91,7 +105,7 @@ Note: when using this option, the speed of the meshing process may
 decrease, and the quality may change.
 Note: the boundary regeneration may fail with this option, in some rare cases.
 
-- <b>To use boundary recovery version</b> - enables using a
+- <b>Use boundary recovery version</b> - enables using a
 boundary recovery module which tries to
 create volume meshes starting from very poor quality surface meshes
 (almost flat triangles on the surface, high density propagation,
@@ -100,7 +114,7 @@ resulting volume mesh will however most likely have a very poor
 quality (poor aspect ratio of elements, tetrahedra with a very small
 positive volume).
 
-- <b>To use FEM correction</b> - Applies finite-element correction by 
+- <b>Use FEM correction</b> - Applies finite-element correction by 
 replacing overconstrained elements where it is possible. At first the process 
 slices the overconstrained edges and at second the overconstrained 
 facets. This ensures that there are no edges with two boundary
index 01be91516465443a50ba5accc6fb3dc2b556dfda..3cefea0e278f7ee85ba5ad1a090ec3108313af8d 100644 (file)
@@ -152,6 +152,16 @@ module GHS3DPlugin
      */
     void SetGradation(in double gradation);
     double GetGradation();
+    /*!
+     * Print log in standard output
+     */
+    void SetStandardOutputLog(in boolean logInStandardOutput);
+    boolean GetStandardOutputLog();
+    /*!
+    * Remove log file on success
+    */
+    void SetRemoveLogOnSuccess(in boolean removeLogOnSuccess);
+    boolean GetRemoveLogOnSuccess();
     /*!
      * To set an enforced vertex
      */
index 08dfb09fcde67d91ac1b1791c03f96241bf280be..ec39a467247fdd6e89a147eb93b5761997ae9e8c 100644 (file)
@@ -126,11 +126,27 @@ class GHS3D_Algorithm(Mesh_Algorithm):
         self.Parameters().SetWorkingDirectory(path)
         pass
 
-    ## To keep working files or remove them. Log file remains in case of errors anyway.
+    ## To keep working files or remove them.
     #  @param toKeep "keep working files" flag value
     def SetKeepFiles(self, toKeep):
         self.Parameters().SetKeepFiles(toKeep)
         pass
+    
+    ## Remove or not the log file (if any) in case of successful computation.
+    #  The log file remains in case of errors anyway. If 
+    #  the "keep working files" flag is set to true, this option
+    #  has no effect.
+    #  @param toRemove "remove log on success" flag value
+    def SetRemoveLogOnSuccess(self, toRemove):
+        self.Parameters().SetRemoveLogOnSuccess(toRemove)
+        pass
+    
+    ## Print the the log in a file. If set to false, the
+    # log is printed on the standard output
+    #  @param toPrintLogInFile "print log in a file" flag value
+    def SetPrintLogInFile(self, toPrintLogInFile):
+        self.Parameters().SetStandardOutputLog(not toPrintLogInFile)
+        pass
 
     ## Set verbosity level [0-10].
     #  @param level verbosity level
index 0ff403ad5a882dd7a3008acd22ce190488dd0e8a..fd0c7bba8c8597e72c993f89d1ef133714b775a6 100644 (file)
@@ -183,6 +183,7 @@ bool GHS3DPlugin_GHS3D::CheckHypothesis ( SMESH_Mesh&         aMesh,
   _hyp = 0;
   _viscousLayersHyp = 0;
   _keepFiles = false;
+  _removeLogOnSuccess = true;
 
   const list <const SMESHDS_Hypothesis * >& hyps =
     GetUsedHypothesis(aMesh, aShape, /*ignoreAuxiliary=*/false);
@@ -195,7 +196,10 @@ bool GHS3DPlugin_GHS3D::CheckHypothesis ( SMESH_Mesh&         aMesh,
       _viscousLayersHyp = dynamic_cast< const StdMeshers_ViscousLayers*> ( *h );
   }
   if ( _hyp )
+  {
     _keepFiles = _hyp->GetKeepFiles();
+    _removeLogOnSuccess = _hyp->GetRemoveLogOnSuccess();
+  }
 
   return true;
 }
@@ -3434,7 +3438,9 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
 
   TCollection_AsciiString cmd( (char*)GHS3DPlugin_Hypothesis::CommandToRun( _hyp ).c_str() );
   cmd += TCollection_AsciiString(" -f ") + aGenericName;  // file to read
-  cmd += TCollection_AsciiString(" 1>" ) + aLogFileName;  // dump into file
+  
+  if ( !_hyp->GetStandardOutputLog() )
+    cmd += TCollection_AsciiString(" 1>" ) + aLogFileName;  // dump into file
   // The output .mesh file does not contain yet the subdomain-info (Ghs3D 4.2)
 //   cmd += TCollection_AsciiString(" --in ") + aGenericName;
 //   cmd += TCollection_AsciiString(" --required_vertices ") + aGenericNameRequired;
@@ -3507,7 +3513,7 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
 
   if ( Ok )
   {
-    if ( !_keepFiles )
+    if ( _removeLogOnSuccess )
       removeFile( aLogFileName );
 
     // if ( _hyp && _hyp->GetToMakeGroupsOfDomains() )
@@ -3528,8 +3534,7 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
   }
 
   if ( !_keepFiles ) {
-    if (! Ok)
-      if(_compute_canceled)
+    if (! Ok && _compute_canceled)
         removeFile( aLogFileName );
     removeFile( aFacesFileName );
     removeFile( aPointsFileName );
@@ -3745,7 +3750,7 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
 
   if ( Ok )
   {
-    if ( !_keepFiles )
+    if ( _removeLogOnSuccess )
       removeFile( aLogFileName );
 
     //if ( !toMakeGroupsOfDomains && _hyp && _hyp->GetToMakeGroupsOfDomains() )
@@ -3766,8 +3771,7 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
 
   if ( !_keepFiles )
   {
-    if (! Ok)
-      if(_compute_canceled)
+    if (! Ok && _compute_canceled)
         removeFile( aLogFileName );
     removeFile( aGMFFileName );
     removeFile( aResultFileName );
index 232c16e7681b233d0b95af43e64810496bd4c245..30ba8b0e5758d58e129166199b0791b6d9e7259a 100644 (file)
@@ -95,6 +95,7 @@ private:
   int  _iShape;
   int  _nbShape;
   bool _keepFiles;
+  bool _removeLogOnSuccess;
   SALOMEDS::Study_var myStudy;
   SMESH_Gen_i* smeshGen_i;
 
index 3ec070f6ef60fbcbddd89a64a890e41d8fbd39a2..1c1c6b970a38295093315f8551091a50f353be8a 100644 (file)
@@ -54,6 +54,7 @@ GHS3DPlugin_Hypothesis::GHS3DPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen
   myToUseFemCorrection(DefaultToUseFEMCorrection()),
   myToRemoveCentralPoint(DefaultToRemoveCentralPoint()),
   myGradation(DefaultGradation()),
+  myLogInStandardOutput(DefaultStandardOutputLog()),
   _enfVertexList(DefaultGHS3DEnforcedVertexList()),
   _enfVertexCoordsSizeList(DefaultGHS3DEnforcedVertexCoordsValues()),
   _enfVertexEntrySizeList(DefaultGHS3DEnforcedVertexEntryValues()),
@@ -384,6 +385,48 @@ double GHS3DPlugin_Hypothesis::GetGradation() const
   return myGradation;
 }
 
+//=======================================================================
+//function : SetStandardOutputLog
+//=======================================================================
+
+void GHS3DPlugin_Hypothesis::SetStandardOutputLog(bool logInStandardOutput)
+{
+  if ( myLogInStandardOutput != logInStandardOutput ) {
+    myLogInStandardOutput = logInStandardOutput;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
+//=======================================================================
+//function : GetStandardOutputLog
+//=======================================================================
+
+bool GHS3DPlugin_Hypothesis::GetStandardOutputLog() const
+{
+  return myLogInStandardOutput;
+}
+
+//=======================================================================
+//function : SetRemoveLogOnSuccess
+//=======================================================================
+
+void GHS3DPlugin_Hypothesis::SetRemoveLogOnSuccess(bool removeLogOnSuccess)
+{
+  if ( myRemoveLogOnSuccess != removeLogOnSuccess ) {
+    myRemoveLogOnSuccess = removeLogOnSuccess;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
+//=======================================================================
+//function : GetRemoveLogOnSuccess
+//=======================================================================
+
+bool GHS3DPlugin_Hypothesis::GetRemoveLogOnSuccess() const
+{
+  return myRemoveLogOnSuccess;
+}
+
 //=======================================================================
 //function : SetEnforcedVertex
 //=======================================================================
@@ -883,6 +926,16 @@ bool   GHS3DPlugin_Hypothesis::DefaultKeepFiles()
   return false;
 }
 
+//=======================================================================
+//function : DefaultRemoveLogOnSuccess
+//=======================================================================
+
+bool   GHS3DPlugin_Hypothesis::DefaultRemoveLogOnSuccess()
+{
+  return false;
+}
+
+
 //=======================================================================
 //function : DefaultVerboseLevel
 //=======================================================================
@@ -937,6 +990,15 @@ double GHS3DPlugin_Hypothesis::DefaultGradation()
   return 1.05;
 }
 
+//=======================================================================
+//function : DefaultStandardOutputLog
+//=======================================================================
+
+bool GHS3DPlugin_Hypothesis::DefaultStandardOutputLog()
+{
+  return false;
+}
+
 // //=======================================================================
 // //function : DefaultID2SizeMap
 // //=======================================================================
index 15ccbc27d1b91ad448b9d99674c0bb1da071fb5c..23983fab3ca359ea39f1798cbdc36083a7736f7d 100644 (file)
@@ -204,6 +204,16 @@ public:
   */
   void SetGradation(double gradation);
   double GetGradation() const ;
+  /*!
+  * Print log in standard output
+  */
+  void SetStandardOutputLog(bool logInStandardOutput);
+  bool GetStandardOutputLog() const ;
+  /*!
+  * Remove log file on success
+  */
+  void SetRemoveLogOnSuccess(bool removeLogOnSuccess);
+  bool GetRemoveLogOnSuccess() const ;
     
   
 //   struct TEnforcedEdge {
@@ -289,6 +299,8 @@ public:
   static bool   DefaultToUseBoundaryRecoveryVersion();
   static bool   DefaultToUseFEMCorrection();
   static bool   DefaultToRemoveCentralPoint();
+  static bool   DefaultStandardOutputLog();
+  static bool   DefaultRemoveLogOnSuccess();
   static double DefaultGradation();
   
   static TGHS3DEnforcedVertex DefaultGHS3DEnforcedVertex() {return TGHS3DEnforcedVertex();}
@@ -337,6 +349,8 @@ private:
   bool   myToUseBoundaryRecoveryVersion;
   bool   myToUseFemCorrection;
   bool   myToRemoveCentralPoint;
+  bool   myLogInStandardOutput;
+  bool   myRemoveLogOnSuccess;
   std::string myTextOption;
   double myGradation;
   
index eb3eeb37ffdedc83009cfc9a652e465b50d2cfb1..3f5bed7e39e39f65114f4aa144fbecd572056496 100644 (file)
@@ -397,6 +397,48 @@ CORBA::Double GHS3DPlugin_Hypothesis_i::GetGradation()
   return this->GetImpl()->GetGradation();
 }
 
+//=======================================================================
+//function : SetStandardOutputLog
+//=======================================================================
+
+void GHS3DPlugin_Hypothesis_i::SetStandardOutputLog(CORBA::Boolean logInStandardOutput)
+{
+  ASSERT(myBaseImpl);
+  this->GetImpl()->SetStandardOutputLog(logInStandardOutput);
+  SMESH::TPythonDump() << _this() << ".SetPrintLogInFile( " << !logInStandardOutput << " )";
+}
+
+//=======================================================================
+//function : GetStandardOutputLog
+//=======================================================================
+
+CORBA::Boolean GHS3DPlugin_Hypothesis_i::GetStandardOutputLog()
+{
+  ASSERT(myBaseImpl);
+  return this->GetImpl()->GetStandardOutputLog();
+}
+
+//=======================================================================
+//function : SetRemoveLogOnSuccess
+//=======================================================================
+
+void GHS3DPlugin_Hypothesis_i::SetRemoveLogOnSuccess(CORBA::Boolean removeLogOnSuccess)
+{
+  ASSERT(myBaseImpl);
+  this->GetImpl()->SetRemoveLogOnSuccess(removeLogOnSuccess);
+  SMESH::TPythonDump() << _this() << ".SetRemoveLogOnSuccess( " << removeLogOnSuccess << " )";
+}
+
+//=======================================================================
+//function : GetRemoveLogOnSuccess
+//=======================================================================
+
+CORBA::Boolean GHS3DPlugin_Hypothesis_i::GetRemoveLogOnSuccess()
+{
+  ASSERT(myBaseImpl);
+  return this->GetImpl()->GetRemoveLogOnSuccess();
+}
+
 //=======================================================================
 //function : SetEnforcedVertex
 //=======================================================================
index 81c12dd4b75f13ed658f1c2d1e6e07a5c16ab489..10aa011efcb4e1b361f6630bbab4a51a304d073d 100644 (file)
@@ -134,12 +134,22 @@ class GHS3DPLUGIN_EXPORT GHS3DPlugin_Hypothesis_i:
   */
   void SetGradation(CORBA::Double gradation);
   CORBA::Double GetGradation();
+  /*!
+  * Print log in standard output
+  */
+  void SetStandardOutputLog(CORBA::Boolean logInStandardOutput);
+  CORBA::Boolean GetStandardOutputLog();
+  /*!
+  * Remove log file on success
+  */
+  void SetRemoveLogOnSuccess(CORBA::Boolean removeLogOnSuccess);
+  CORBA::Boolean GetRemoveLogOnSuccess();
   /*!
    * To set an enforced vertex
    */
   bool p_SetEnforcedVertex(CORBA::Double size, CORBA::Double x = 0, CORBA::Double y = 0, CORBA::Double z = 0,
-                          const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = "",
-                          CORBA::Boolean isCompound = false) 
+                           const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = "",
+                           CORBA::Boolean isCompound = false) 
     throw (SALOME::SALOME_Exception);
   bool SetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size) throw (SALOME::SALOME_Exception);
   bool SetEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName) throw (SALOME::SALOME_Exception);
diff --git a/src/GUI/GHS3DPluginGUI_AdvWidget.cxx b/src/GUI/GHS3DPluginGUI_AdvWidget.cxx
new file mode 100644 (file)
index 0000000..52cf272
--- /dev/null
@@ -0,0 +1,45 @@
+// Copyright (C) 2007-2013  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// ---
+// File    : GHS3DPluginGUI_Dlg.cxx
+// Authors : Renaud NEDELEC (OCC)
+// ---
+//
+
+#include "GHS3DPluginGUI_Dlg.h"
+
+#include <QFileDialog>
+
+#include <iostream>
+
+
+//////////////////////////////////////////
+// GHS3DPluginGUI_AdvWidget
+//////////////////////////////////////////
+
+GHS3DPluginGUI_AdvWidget::GHS3DPluginGUI_AdvWidget( QWidget* parent, Qt::WindowFlags f )
+: QWidget( parent, f )
+{
+  setupUi( this );
+}
+
+GHS3DPluginGUI_AdvWidget::~GHS3DPluginGUI_AdvWidget()
+{
+}
diff --git a/src/GUI/GHS3DPluginGUI_AdvWidget_QTD.ui b/src/GUI/GHS3DPluginGUI_AdvWidget_QTD.ui
new file mode 100644 (file)
index 0000000..35b70cb
--- /dev/null
@@ -0,0 +1,225 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>GHS3DPluginGUI_AdvWidget_QTD</class>
+ <widget class="QWidget" name="GHS3DPluginGUI_AdvWidget_QTD">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>465</width>
+    <height>477</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_2">
+   <property name="leftMargin">
+    <number>0</number>
+   </property>
+   <property name="topMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>0</number>
+   </property>
+   <item>
+    <widget class="QGroupBox" name="memoryGroupBox">
+     <property name="title">
+      <string>Memory settings</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_3">
+      <item row="3" column="4">
+       <widget class="QLabel" name="maxMemoryLabel">
+        <property name="text">
+         <string>MB</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="0">
+       <widget class="QCheckBox" name="initialMemoryCheck">
+        <property name="text">
+         <string>Initial memory size</string>
+        </property>
+       </widget>
+      </item>
+      <item row="3" column="2" colspan="2">
+       <widget class="QSpinBox" name="maxMemorySpin">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>1</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+       </widget>
+      </item>
+      <item row="3" column="0">
+       <widget class="QCheckBox" name="maxMemoryCheck">
+        <property name="text">
+         <string>Max memory size</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="2" colspan="2">
+       <widget class="QSpinBox" name="initialMemorySpin">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>1</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="4">
+       <widget class="QLabel" name="initialMemoryLabel">
+        <property name="text">
+         <string>MB</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="logGroupBox">
+     <property name="title">
+      <string>Logs and debug</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_2">
+      <item row="0" column="0">
+       <layout class="QGridLayout" name="gridLayout">
+        <item row="0" column="0">
+         <widget class="QLabel" name="workingDirectoryLabel">
+          <property name="text">
+           <string>Working directory</string>
+          </property>
+         </widget>
+        </item>
+        <item row="0" column="1">
+         <widget class="QLineEdit" name="workingDirectoryLineEdit"/>
+        </item>
+        <item row="0" column="2">
+         <widget class="QPushButton" name="workingDirectoryPushButton">
+          <property name="text">
+           <string>PushButton</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="0">
+         <widget class="QLabel" name="verboseLevelLabel">
+          <property name="text">
+           <string>Verbose level</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="1">
+         <widget class="QSpinBox" name="verboseLevelSpin"/>
+        </item>
+       </layout>
+      </item>
+      <item row="1" column="0">
+       <layout class="QHBoxLayout" name="horizontalLayout">
+        <item>
+         <widget class="QCheckBox" name="logInFileCheck">
+          <property name="text">
+           <string>Print log in a file</string>
+          </property>
+          <property name="checked">
+           <bool>true</bool>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QCheckBox" name="removeLogOnSuccessCheck">
+          <property name="text">
+           <string>Remove log file on success</string>
+          </property>
+          <property name="checked">
+           <bool>true</bool>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item row="2" column="0">
+       <widget class="QCheckBox" name="keepWorkingFilesCheck">
+        <property name="text">
+         <string>Keep working files</string>
+        </property>
+        <property name="autoExclusive">
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="advancedMeshingGroupBox">
+     <property name="title">
+      <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">
+        <property name="text">
+         <string>Volumic gradation</string>
+        </property>
+       </widget>
+      </item>
+      <item row="7" column="0">
+       <widget class="QLabel" name="textOptionLabel">
+        <property name="text">
+         <string>Option as text</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">
+         <string>Use FEM correction</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QCheckBox" name="boundaryRecoveryCheck">
+        <property name="text">
+         <string>Use boundary recovery version</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>SMESHGUI_SpinBox</class>
+   <extends>QSpinBox</extends>
+   <header>SMESHGUI_SpinBox.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/GUI/GHS3DPluginGUI_Dlg.h b/src/GUI/GHS3DPluginGUI_Dlg.h
new file mode 100644 (file)
index 0000000..f7bfd1c
--- /dev/null
@@ -0,0 +1,43 @@
+// Copyright (C) 2007-2013  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File   : GHS3DPluginGUI_Dlg.h
+// Author : Renaud NEDELEC (OpenCascade)
+
+#ifndef GHS3DPLUGINGUI_H
+#define GHS3DPLUGINGUI_H
+
+//////////////////////////////////////////
+// GHS3DPluginGUI_AdvWidget
+//////////////////////////////////////////
+
+#include "ui_GHS3DPluginGUI_AdvWidget_QTD.h"
+#include "GHS3DPluginGUI_HypothesisCreator.h"
+
+class GHS3DPLUGINGUI_EXPORT GHS3DPluginGUI_AdvWidget : public QWidget, 
+                                            public Ui::GHS3DPluginGUI_AdvWidget_QTD
+{
+  Q_OBJECT
+
+public:
+  GHS3DPluginGUI_AdvWidget( QWidget* = 0, Qt::WindowFlags = 0 );
+  ~GHS3DPluginGUI_AdvWidget();
+};
+
+#endif
\ No newline at end of file
index 25d71010a197c67ed92c0c6b635497dfeedfc158..5f97bafb84cf491082bed6db34618a3591d4f845 100644 (file)
@@ -24,6 +24,7 @@
 //
 #include "GHS3DPluginGUI_HypothesisCreator.h"
 #include "GHS3DPluginGUI_Enums.h"
+#include "GHS3DPluginGUI_Dlg.h"
 
 #include <GeometryGUI.h>
 
@@ -409,71 +410,41 @@ QFrame* GHS3DPluginGUI_HypothesisCreator::buildFrame()
   QGridLayout* anAdvLayout = new QGridLayout( myAdvGroup );
   anAdvLayout->setSpacing( 6 );
   anAdvLayout->setMargin( 11 );
-  
-  myMaximumMemoryCheck = new QCheckBox( tr( "MAX_MEMORY_SIZE" ), myAdvGroup );
-  myMaximumMemorySpin = new QSpinBox( myAdvGroup );
-  myMaximumMemorySpin->setMinimum( 1 );
-  myMaximumMemorySpin->setMaximum( maxAvailableMemory() );
-  myMaximumMemorySpin->setSingleStep( 10 );
-  QLabel* aMegabyteLabel = new QLabel( tr( "MEGABYTE" ), myAdvGroup );
-
-  myInitialMemoryCheck = new QCheckBox( tr( "INIT_MEMORY_SIZE" ), myAdvGroup );
-  myInitialMemorySpin = new QSpinBox( myAdvGroup );
-  myInitialMemorySpin->setMinimum( 1 );
-  myInitialMemorySpin->setMaximum( maxAvailableMemory() );
-  myInitialMemorySpin->setSingleStep( 10 );
-  QLabel* aMegabyteLabel2 = new QLabel( tr( "MEGABYTE" ), myAdvGroup );
-
-  QLabel* aWorkinDirLabel = new QLabel( tr( "WORKING_DIR" ), myAdvGroup );
-  myWorkingDir = new QLineEdit( myAdvGroup );
-  //myWorkingDir->setReadOnly( true );
-  QPushButton* dirBtn = new QPushButton( tr( "SELECT_DIR" ), myAdvGroup );
-  dirBtn->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
-  
-  myKeepFiles = new QCheckBox( tr( "KEEP_WORKING_FILES" ), myAdvGroup );
+  myAdvWidget = new GHS3DPluginGUI_AdvWidget(myAdvGroup);
+  anAdvLayout->addWidget( myAdvWidget);
 
-  QLabel* aVerboseLevelLabel = new QLabel( tr( "VERBOSE_LEVEL" ), myAdvGroup );
-  myVerboseLevelSpin = new QSpinBox( myAdvGroup );
-  myVerboseLevelSpin->setMinimum( 0 );
-  myVerboseLevelSpin->setMaximum( 10 );
-  myVerboseLevelSpin->setSingleStep( 1 );
+  myAdvWidget->maxMemoryCheck->setText(tr( "MAX_MEMORY_SIZE" ));
+  myAdvWidget->initialMemoryCheck->setText(tr( "INIT_MEMORY_SIZE" ));
 
-  myToCreateNewNodesCheck = new QCheckBox( tr( "TO_ADD_NODES" ), myAdvGroup );
+  myAdvWidget->maxMemorySpin ->setMinimum( 1 );
+  myAdvWidget->maxMemorySpin ->setMaximum( maxAvailableMemory() );
+  myAdvWidget->maxMemorySpin ->setSingleStep( 10 );
   
-  myRemoveInitialCentralPointCheck = new QCheckBox( tr( "NO_INITIAL_CENTRAL_POINT" ), myAdvGroup );
+  myAdvWidget->initialMemorySpin->setMinimum( 1 );
+  myAdvWidget->initialMemorySpin->setMaximum( maxAvailableMemory() );
+  myAdvWidget->initialMemorySpin->setSingleStep( 10 );
+
+  myAdvWidget->initialMemoryLabel            ->setText (tr( "MEGABYTE" ));
+  myAdvWidget->maxMemoryLabel                ->setText (tr( "MEGABYTE" ));
   
-  myBoundaryRecoveryCheck = new QCheckBox( tr( "RECOVERY_VERSION" ), myAdvGroup );
+  myAdvWidget->workingDirectoryLabel         ->setText (tr( "WORKING_DIR" ));
+  myAdvWidget->workingDirectoryPushButton    ->setText (tr( "SELECT_DIR" ));
+  myAdvWidget->keepWorkingFilesCheck         ->setText (tr( "KEEP_WORKING_FILES" ));
+  myAdvWidget->verboseLevelLabel             ->setText (tr( "VERBOSE_LEVEL" ));
+  myAdvWidget->removeLogOnSuccessCheck       ->setText (tr( "REMOVE_LOG_ON_SUCCESS" ));
+  myAdvWidget->logInFileCheck                ->setText (tr( "LOG_IN_FILE" ));
   
-  myFEMCorrectionCheck = new QCheckBox( tr( "FEM_CORRECTION" ), myAdvGroup );
+  myAdvWidget->memoryGroupBox                ->setTitle(tr( "MEMORY_GROUP_TITLE" ));
+  myAdvWidget->logGroupBox                   ->setTitle(tr( "LOG_GROUP_TITLE" ));
+  myAdvWidget->advancedMeshingGroupBox       ->setTitle(tr( "ADVANCED_MESHING_GROUP_TITLE" ));
   
-  QLabel* myGradationLabel = new QLabel( tr( "GHS3D_GRADATION" ), myAdvGroup );
-  myGradation = new SMESHGUI_SpinBox(myAdvGroup);
-  myGradation->RangeStepAndValidator(1.05, 5.0, 0.05, "length_precision");
-
-  QLabel* aTextOptionLabel = new QLabel( tr( "TEXT_OPTION" ), myAdvGroup );
-  myTextOption = new QLineEdit( myAdvGroup );
-
-  row = 0;
-  anAdvLayout->addWidget( myMaximumMemoryCheck,             row, 0, 1, 1 );
-  anAdvLayout->addWidget( myMaximumMemorySpin,              row, 1, 1, 1 );
-  anAdvLayout->addWidget( aMegabyteLabel,                   row++, 2, 1, 1 );
-  anAdvLayout->addWidget( myInitialMemoryCheck,             row, 0, 1, 1 );
-  anAdvLayout->addWidget( myInitialMemorySpin,              row, 1, 1, 1 );
-  anAdvLayout->addWidget( aMegabyteLabel2,                  row++, 2, 1, 1 );
-  anAdvLayout->addWidget( aWorkinDirLabel,                  row, 0, 1, 1 );
-  anAdvLayout->addWidget( myWorkingDir,                     row, 1, 1, 2 );
-  anAdvLayout->addWidget( dirBtn,                           row++, 3, 1, 1 );
-  anAdvLayout->addWidget( myKeepFiles,                      row++, 0, 1, 4 );
-  anAdvLayout->addWidget( aVerboseLevelLabel,               row, 0, 1, 1 );
-  anAdvLayout->addWidget( myVerboseLevelSpin,               row++, 1, 1, 2 );
-  anAdvLayout->addWidget( myToCreateNewNodesCheck,          row++, 0, 1, 4 );
-  anAdvLayout->addWidget( myRemoveInitialCentralPointCheck, row++, 0, 1, 4 );
-  anAdvLayout->addWidget( myBoundaryRecoveryCheck,          row++, 0, 1, 4 );
-  anAdvLayout->addWidget( myFEMCorrectionCheck,             row++, 0, 1, 4 );
-  anAdvLayout->addWidget( myGradationLabel,                 row, 0, 1, 1 );
-  anAdvLayout->addWidget( myGradation,                      row++, 1, 1, 2 );
-  anAdvLayout->addWidget( aTextOptionLabel,                 row, 0, 1, 1 );
-  anAdvLayout->addWidget( myTextOption,                     row++, 1, 1, 2 );
+  myAdvWidget->createNewNodesCheck           ->setText (tr( "TO_ADD_NODES" ));
+  myAdvWidget->removeInitialCentralPointCheck->setText (tr( "NO_INITIAL_CENTRAL_POINT" ));
+  myAdvWidget->boundaryRecoveryCheck         ->setText (tr( "RECOVERY_VERSION" ));
+  myAdvWidget->FEMCorrectionCheck            ->setText (tr( "FEM_CORRECTION" ));
+  myAdvWidget->gradationLabel                ->setText (tr( "GHS3D_GRADATION" ));
+  myAdvWidget->gradationSpinBox->RangeStepAndValidator(1.05, 5.0, 0.05, "length_precision");
+  myAdvWidget->textOptionLabel->setText(tr( "TEXT_OPTION" ));
 
   // Enforced vertices parameters
   myEnfGroup = new QWidget();
@@ -646,10 +617,13 @@ QFrame* GHS3DPluginGUI_HypothesisCreator::buildFrame()
 
   // connections
   //connect( myToMeshHolesCheck,      SIGNAL( toggled( bool ) ), this, SLOT( onToMeshHoles(bool)));
-  connect( myMaximumMemoryCheck,    SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
-  connect( myInitialMemoryCheck,    SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
-  connect( myBoundaryRecoveryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
-  connect( dirBtn,                  SIGNAL( clicked() ),       this, SLOT( onDirBtnClicked() ) );
+  connect( myAdvWidget->maxMemoryCheck,             SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
+  connect( myAdvWidget->initialMemoryCheck,         SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
+  connect( myAdvWidget->boundaryRecoveryCheck,      SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
+  connect( myAdvWidget->logInFileCheck,             SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
+  connect( myAdvWidget->keepWorkingFilesCheck,      SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
+  connect( myAdvWidget->workingDirectoryPushButton, SIGNAL( clicked() ),       this, SLOT( onDirBtnClicked() ) );
+  
   connect( myEnforcedTableWidget,   SIGNAL( itemClicked(QTableWidgetItem *)), this, SLOT( synchronizeCoords() ) );
   connect( myEnforcedTableWidget,   SIGNAL( itemChanged(QTableWidgetItem *)), this, SLOT( updateEnforcedVertexValues(QTableWidgetItem *) ) );
   connect( myEnforcedTableWidget,   SIGNAL( itemSelectionChanged() ),         this, SLOT( synchronizeCoords() ) );
@@ -1394,25 +1368,33 @@ void GHS3DPluginGUI_HypothesisCreator::onToMeshHoles(bool isOn)
 
 void GHS3DPluginGUI_HypothesisCreator::onDirBtnClicked()
 {
-  QString dir = SUIT_FileDlg::getExistingDirectory( dlg(), myWorkingDir->text(), QString() );
+  QString dir = SUIT_FileDlg::getExistingDirectory( dlg(), myAdvWidget->workingDirectoryLineEdit->text(), QString() );
   if ( !dir.isEmpty() )
-    myWorkingDir->setText( dir );
+    myAdvWidget->workingDirectoryLineEdit->setText( dir );
 }
 
 void GHS3DPluginGUI_HypothesisCreator::updateWidgets()
 {
   //myToMakeGroupsOfDomains->setEnabled( myToMeshHolesCheck->isChecked() );
-  myMaximumMemorySpin->setEnabled( myMaximumMemoryCheck->isChecked() );
-  myInitialMemoryCheck->setEnabled( !myBoundaryRecoveryCheck->isChecked() );
-  myInitialMemorySpin->setEnabled( myInitialMemoryCheck->isChecked() && !myBoundaryRecoveryCheck->isChecked() );
-  myOptimizationLevelCombo->setEnabled( !myBoundaryRecoveryCheck->isChecked() );
+  myAdvWidget->maxMemorySpin->setEnabled( myAdvWidget->maxMemoryCheck->isChecked() );
+  myAdvWidget->initialMemoryCheck->setEnabled( !myAdvWidget->boundaryRecoveryCheck->isChecked() );
+  myAdvWidget->initialMemorySpin->setEnabled( myAdvWidget->initialMemoryCheck->isChecked() && !myAdvWidget->boundaryRecoveryCheck->isChecked() );
+  myOptimizationLevelCombo->setEnabled( !myAdvWidget->boundaryRecoveryCheck->isChecked() );
+  if ( sender() == myAdvWidget->logInFileCheck ||
+       sender() == myAdvWidget->keepWorkingFilesCheck )
+  {
+    bool logFileRemovable = myAdvWidget->logInFileCheck->isChecked() &&
+                            !myAdvWidget->keepWorkingFilesCheck->isChecked();
+                             
+    myAdvWidget->removeLogOnSuccessCheck->setEnabled( logFileRemovable );
+  }
 }
 
 bool GHS3DPluginGUI_HypothesisCreator::checkParams(QString& msg) const
 {
   MESSAGE("GHS3DPluginGUI_HypothesisCreator::checkParams");
 
-  if ( !QFileInfo( myWorkingDir->text().trimmed() ).isWritable() ) {
+  if ( !QFileInfo( myAdvWidget->workingDirectoryLineEdit->text().trimmed() ).isWritable() ) {
     SUIT_MessageBox::warning( dlg(),
                               tr( "SMESH_WRN_WARNING" ),
                               tr( "GHS3D_PERMISSION_DENIED" ) );
@@ -1432,24 +1414,26 @@ void GHS3DPluginGUI_HypothesisCreator::retrieveParams() const
   if ( myName )
     myName->setText( data.myName );
   
-  myToMeshHolesCheck               ->setChecked    ( data.myToMeshHoles );
-  myToMakeGroupsOfDomains          ->setChecked    ( data.myToMakeGroupsOfDomains );
-  myOptimizationLevelCombo         ->setCurrentIndex( data.myOptimizationLevel );
-  myMaximumMemoryCheck             ->setChecked    ( data.myMaximumMemory > 0 );
-  myMaximumMemorySpin              ->setValue      ( qMax( data.myMaximumMemory,
-                                                           myMaximumMemorySpin->minimum() ));
-  myInitialMemoryCheck             ->setChecked    ( data.myInitialMemory > 0 );
-  myInitialMemorySpin              ->setValue      ( qMax( data.myInitialMemory,
-                                                           myInitialMemorySpin->minimum() ));
-  myWorkingDir                     ->setText       ( data.myWorkingDir );
-  myKeepFiles                      ->setChecked    ( data.myKeepFiles );
-  myVerboseLevelSpin               ->setValue      ( data.myVerboseLevel );
-  myToCreateNewNodesCheck          ->setChecked    ( data.myToCreateNewNodes );
-  myRemoveInitialCentralPointCheck ->setChecked    ( data.myRemoveInitialCentralPoint );
-  myBoundaryRecoveryCheck          ->setChecked    ( data.myBoundaryRecovery );
-  myFEMCorrectionCheck             ->setChecked    ( data.myFEMCorrection );
-  myGradation                      ->setValue      ( data.myGradation );
-  myTextOption                     ->setText       ( data.myTextOption );
+  myToMeshHolesCheck                          ->setChecked    ( data.myToMeshHoles );
+  myToMakeGroupsOfDomains                     ->setChecked    ( data.myToMakeGroupsOfDomains );
+  myOptimizationLevelCombo                    ->setCurrentIndex( data.myOptimizationLevel );
+  myAdvWidget->maxMemoryCheck                 ->setChecked    ( data.myMaximumMemory > 0 );
+  myAdvWidget->maxMemorySpin                  ->setValue      ( qMax( data.myMaximumMemory,
+                                                                      myAdvWidget->maxMemorySpin->minimum() ));
+  myAdvWidget->initialMemoryCheck             ->setChecked    ( data.myInitialMemory > 0 );
+  myAdvWidget->initialMemorySpin              ->setValue      ( qMax( data.myInitialMemory,
+                                                                      myAdvWidget->initialMemorySpin->minimum() ));
+  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 );
 
   TEnfVertexList::const_iterator it;
   int rowCount = 0;
@@ -1692,6 +1676,8 @@ bool GHS3DPluginGUI_HypothesisCreator::readParamsFromHypo( GHS3DHypothesisData&
   h_data.myFEMCorrection              = h->GetFEMCorrection();
   h_data.myGradation                  = h->GetGradation();
   h_data.myTextOption                 = h->GetTextOption();
+  h_data.myLogInStandardOutput        = h->GetStandardOutputLog();
+  h_data.myRemoveLogOnSuccess         = h->GetRemoveLogOnSuccess();
   
   GHS3DPlugin::GHS3DEnforcedVertexList_var vertices = h->GetEnforcedVertices();
   MESSAGE("vertices->length(): " << vertices->length());
@@ -1762,24 +1748,28 @@ bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisD
       h->SetInitialMemory    ( h_data.myInitialMemory     );
     if ( h->GetOptimizationLevel() != h_data.myOptimizationLevel )
       h->SetOptimizationLevel( h_data.myOptimizationLevel );
-    if ( h->GetKeepFiles() != h_data.myKeepFiles )
+    if ( h->GetKeepFiles() != h_data.myKeepFiles         )
       h->SetKeepFiles        ( h_data.myKeepFiles         );
     if ( h->GetWorkingDirectory() != h_data.myWorkingDir )
       h->SetWorkingDirectory ( h_data.myWorkingDir.toLatin1().constData() );
-    if ( h->GetVerboseLevel() != h_data.myVerboseLevel )
-      h->SetVerboseLevel     ( h_data.myVerboseLevel );
+    if ( h->GetVerboseLevel() != h_data.myVerboseLevel   )
+      h->SetVerboseLevel     ( h_data.myVerboseLevel      );
     if ( h->GetToCreateNewNodes() != h_data.myToCreateNewNodes )
-      h->SetToCreateNewNodes( h_data.myToCreateNewNodes );
+      h->SetToCreateNewNodes( h_data.myToCreateNewNodes   );
     if ( h->GetToRemoveCentralPoint() != h_data.myRemoveInitialCentralPoint )
       h->SetToRemoveCentralPoint( h_data.myRemoveInitialCentralPoint );
     if ( h->GetToUseBoundaryRecoveryVersion() != h_data.myBoundaryRecovery )
       h->SetToUseBoundaryRecoveryVersion( h_data.myBoundaryRecovery );
     if ( h->GetFEMCorrection() != h_data.myFEMCorrection )
-      h->SetFEMCorrection( h_data.myFEMCorrection );
-    if ( h->GetGradation() != h_data.myGradation )
-      h->SetGradation     ( h_data.myGradation );
-    if ( h->GetTextOption() != h_data.myTextOption )
+      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->GetStandardOutputLog() != h_data.myLogInStandardOutput   )
+      h->SetStandardOutputLog( h_data.myLogInStandardOutput  );
+     if ( h->GetRemoveLogOnSuccess() != h_data.myRemoveLogOnSuccess   )
+      h->SetRemoveLogOnSuccess( h_data.myRemoveLogOnSuccess  );
     
     // Enforced vertices
     int nbVertex = (int) h_data.myEnforcedVertices.size();
@@ -1868,18 +1858,20 @@ bool GHS3DPluginGUI_HypothesisCreator::readParamsFromWidgets( GHS3DHypothesisDat
   h_data.myName                       = myName ? myName->text() : "";
   h_data.myToMeshHoles                = myToMeshHolesCheck->isChecked();
   h_data.myToMakeGroupsOfDomains      = myToMakeGroupsOfDomains->isChecked();
-  h_data.myMaximumMemory              = myMaximumMemoryCheck->isChecked() ? myMaximumMemorySpin->value() : -1;
-  h_data.myInitialMemory              = myInitialMemoryCheck->isChecked() ? myInitialMemorySpin->value() : -1;
+  h_data.myMaximumMemory              = myAdvWidget->maxMemoryCheck->isChecked() ? myAdvWidget->maxMemorySpin->value() : -1;
+  h_data.myInitialMemory              = myAdvWidget->initialMemoryCheck->isChecked() ? myAdvWidget->initialMemorySpin->value() : -1;
   h_data.myOptimizationLevel          = myOptimizationLevelCombo->currentIndex();
-  h_data.myKeepFiles                  = myKeepFiles->isChecked();
-  h_data.myWorkingDir                 = myWorkingDir->text().trimmed();
-  h_data.myVerboseLevel               = myVerboseLevelSpin->value();
-  h_data.myToCreateNewNodes           = myToCreateNewNodesCheck->isChecked();
-  h_data.myRemoveInitialCentralPoint  = myRemoveInitialCentralPointCheck->isChecked();
-  h_data.myBoundaryRecovery           = myBoundaryRecoveryCheck->isChecked();
-  h_data.myFEMCorrection              = myFEMCorrectionCheck->isChecked();
-  h_data.myGradation                  = myGradation->value();
-  h_data.myTextOption                 = myTextOption->text();
+  h_data.myKeepFiles                  = myAdvWidget->keepWorkingFilesCheck->isChecked();
+  h_data.myWorkingDir                 = myAdvWidget->workingDirectoryLineEdit->text().trimmed();
+  h_data.myVerboseLevel               = myAdvWidget->verboseLevelSpin->value();
+  h_data.myToCreateNewNodes           = myAdvWidget->createNewNodesCheck->isChecked();
+  h_data.myRemoveInitialCentralPoint  = myAdvWidget->removeInitialCentralPointCheck->isChecked();
+  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.myLogInStandardOutput        = !myAdvWidget->logInFileCheck->isChecked();
+  h_data.myRemoveLogOnSuccess         = myAdvWidget->removeLogOnSuccessCheck->isChecked();
   
   // Enforced vertices
   h_data.myEnforcedVertices.clear();
index a9830d904b63f33fc9d3f5cddea6023d39ca0589..29a68d720efd44513692124abe0e8595ab21ac1e 100644 (file)
@@ -61,6 +61,7 @@ class SMESHGUI_SpinBox;
 class StdMeshersGUI_ObjectReferenceParamWdg;
 class LightApp_SelectionMgr;
 class SUIT_SelectionFilter;
+class GHS3DPluginGUI_AdvWidget;
 
 class QTEnfVertex
 {
@@ -140,7 +141,8 @@ typedef std::set< TEnfMesh*, CompareEnfMeshes > TEnfMeshList;
 
 typedef struct
 {
-  bool    myToMeshHoles,myToMakeGroupsOfDomains,myKeepFiles,myToCreateNewNodes,myBoundaryRecovery,myFEMCorrection,myRemoveInitialCentralPoint;
+  bool    myToMeshHoles,myToMakeGroupsOfDomains,myKeepFiles,myToCreateNewNodes,myBoundaryRecovery,myFEMCorrection,myRemoveInitialCentralPoint,
+          myLogInStandardOutput, myRemoveLogOnSuccess;
   int     myMaximumMemory,myInitialMemory,myOptimizationLevel;
   QString myName,myWorkingDir,myTextOption;
   double  myGradation;
@@ -213,20 +215,8 @@ private:
   QCheckBox*          myToMakeGroupsOfDomains;
   QComboBox*          myOptimizationLevelCombo;
 
-  QWidget*            myAdvGroup;
-  QCheckBox*          myMaximumMemoryCheck;
-  QSpinBox*           myMaximumMemorySpin;
-  QCheckBox*          myInitialMemoryCheck;
-  QSpinBox*           myInitialMemorySpin;
-  QLineEdit*          myWorkingDir;
-  QCheckBox*          myKeepFiles;
-  QSpinBox*           myVerboseLevelSpin;
-  QCheckBox*          myToCreateNewNodesCheck;
-  QCheckBox*          myRemoveInitialCentralPointCheck;
-  QCheckBox*          myBoundaryRecoveryCheck;
-  QCheckBox*          myFEMCorrectionCheck;
-  SMESHGUI_SpinBox*   myGradation;
-  QLineEdit*          myTextOption;
+  QWidget*                  myAdvGroup;
+  GHS3DPluginGUI_AdvWidget* myAdvWidget;
   
   QWidget*            myEnfGroup;
   QPixmap             iconVertex, iconCompound;
index b77bcb38ee62f1ec9424b7f7b00105049a96b5e8..a7e3aca0ac9e4b5dea090f655190c10ed84d0ab7 100644 (file)
     </message>
     <message>
         <source>GHS3D_TO_MESH_HOLES</source>
-        <translation>To mesh holes</translation>
+        <translation>Mesh holes</translation>
     </message>
     <message>
         <source>GHS3D_TO_MAKE_DOMAIN_GROUPS</source>
-        <translation>To make groups of domains</translation>
+        <translation>Make groups of domains</translation>
+    </message>
+    <message>
+        <source>ADVANCED_MESHING_GROUP_TITLE</source>
+        <translation>Advanced meshing options</translation>
     </message>
     <message>
         <source>INIT_MEMORY_SIZE</source>
@@ -41,7 +45,7 @@
     </message>
     <message>
         <source>KEEP_WORKING_FILES</source>
-        <translation>To keep working files</translation>
+        <translation>Keep all working files</translation>
     </message>
     <message>
         <source>LEVEL_NONE</source>
         <source>LEVEL_STRONG</source>
         <translation>Strong</translation>
     </message>
+    <message>
+        <source>LOG_IN_FILE</source>
+        <translation>Print log in a file</translation>
+    </message>
+    <message>
+        <source>LOG_GROUP_TITLE</source>
+        <translation>Logs and debug</translation>
+    </message>
     <message>
         <source>MAX_MEMORY_SIZE</source>
         <translation>Maximum memory size</translation>
     </message>
     <message>
         <source>MEGABYTE</source>
-        <translation>Megabytes</translation>
+        <translation>MB</translation>
+    </message>
+    <message>
+        <source>MEMORY_GROUP_TITLE</source>
+        <translation>Memory settings</translation>
     </message>
     <message>
         <source>NO_INITIAL_CENTRAL_POINT</source>
-        <translation>To remove initial central point</translation>
+        <translation>Remove initial central point</translation>
     </message>
     <message>
         <source>RECOVERY_VERSION</source>
-        <translation>To use boundary recovery version</translation>
+        <translation>Use boundary recovery version</translation>
     </message>
     <message>
         <source>FEM_CORRECTION</source>
-        <translation>To use FEM correction</translation>
+        <translation>Use FEM correction</translation>
     </message>
     <message>
         <source>GHS3D_GRADATION</source>
         <translation>Volumic gradation</translation>
     </message>
+    <message>
+        <source>REMOVE_LOG_ON_SUCCESS</source>
+        <translation>Remove log on success</translation>
+    </message>
     <message>
         <source>SELECT_DIR</source>
         <translation>...</translation>
     </message>
     <message>
         <source>TO_ADD_NODES</source>
-        <translation>To create new nodes</translation>
+        <translation>Create new nodes</translation>
     </message>
     <message>
         <source>VERBOSE_LEVEL</source>
index c2291bd7229d86ac0db28eae297d6a3461dffe14..7bb77a86ecc8d27e2c9667275386e1febea6d71d 100755 (executable)
         <source>GHS3D_TO_MESH_HOLES</source>
         <translation>Mailler les trous</translation>
     </message>
+    <message>
+        <source>ADVANCED_MESHING_GROUP_TITLE</source>
+        <translation>Options de maillage avancées</translation>
+    </message>
     <message>
         <source>INIT_MEMORY_SIZE</source>
         <translation>Taille initiale de la mémoire</translation>
     </message>
     <message>
         <source>KEEP_WORKING_FILES</source>
-        <translation>Conserver les fichiers temporaires</translation>
+        <translation>Conserver tous les fichiers temporaires</translation>
     </message>
     <message>
         <source>LEVEL_NONE</source>
         <source>LEVEL_STRONG</source>
         <translation>Fort</translation>
     </message>
+    <message>
+        <source>LOG_IN_FILE</source>
+        <translation>Imprimer le log dans un fichier</translation>
+    </message>
+    <message>
+        <source>LOG_GROUP_TITLE</source>
+        <translation>Logs et debug</translation>
+    </message>
     <message>
         <source>MAX_MEMORY_SIZE</source>
         <translation>Taille maximale de la mémoire</translation>
         <source>MEGABYTE</source>
         <translation>Megabytes</translation>
     </message>
+    <message>
+        <source>MEMORY_GROUP_TITLE</source>
+        <translation>Paramètres mémoire</translation>
+    </message>
     <message>
         <source>NO_INITIAL_CENTRAL_POINT</source>
         <translation>Supprimer le point central initial</translation>
     </message>
     <message>
         <source>FEM_CORRECTION</source>
-        <translation>Utiliser correction FEM</translation>
+        <translation>Utiliser la correction FEM</translation>
     </message>
     <message>
         <source>GHS3D_GRADATION</source>
         <translation>Gradation volumique</translation>
     </message>
+    <message>
+        <source>REMOVE_LOG_ON_SUCCESS</source>
+        <translation>Supprimer le log en cas de succès</translation>
+    </message>
     <message>
         <source>SELECT_DIR</source>
         <translation>...</translation>
index 6d70baa681e94c868d288816e4c3753889845ecc..489fdf77db7b0593cbb8a1220649733ba2159494 100644 (file)
@@ -27,6 +27,7 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 # header files 
 salomeinclude_HEADERS = \
+       GHS3DPluginGUI_Dlg.h    \
        GHS3DPluginGUI_HypothesisCreator.h \
        GHS3DPluginGUI_Enums.h
 
@@ -35,10 +36,17 @@ lib_LTLIBRARIES = libGHS3DPluginGUI.la
 
 dist_libGHS3DPluginGUI_la_SOURCES = \
        GHS3DPluginGUI.cxx \
-       GHS3DPluginGUI_HypothesisCreator.cxx
+       GHS3DPluginGUI_HypothesisCreator.cxx \
+       GHS3DPluginGUI_AdvWidget.cxx
 
 MOC_FILES = \
-       GHS3DPluginGUI_HypothesisCreator_moc.cxx
+       GHS3DPluginGUI_HypothesisCreator_moc.cxx \
+       GHS3DPluginGUI_Dlg_moc.cxx
+
+UIC_FILES =    \
+       ui_GHS3DPluginGUI_AdvWidget_QTD.h 
+
+BUILT_SOURCES = $(UIC_FILES)
 
 nodist_libGHS3DPluginGUI_la_SOURCES= \
        $(MOC_FILES)