Salome HOME
merge from BR_pluginMGCleaner tag mergeto_v7_main_17jun13
authorcvw <cvw>
Mon, 17 Jun 2013 14:56:45 +0000 (14:56 +0000)
committercvw <cvw>
Mon, 17 Jun 2013 14:56:45 +0000 (14:56 +0000)
15 files changed:
src/Tools/YamsPlug/YamsPlugDialog.ui
src/Tools/YamsPlug/doc/Generics_params.rst
src/Tools/YamsPlug/doc/Makefile.am
src/Tools/YamsPlug/doc/Mandatory_params.rst
src/Tools/YamsPlug/doc/editHypo.rst
src/Tools/YamsPlug/doc/files/YamsWhitePaper_3.2.pdf [new file with mode: 0644]
src/Tools/YamsPlug/doc/images/Advanced.png
src/Tools/YamsPlug/doc/images/AppelYams.png
src/Tools/YamsPlug/doc/images/Generic.png
src/Tools/YamsPlug/doc/images/Simple.png
src/Tools/YamsPlug/doc/index.rst
src/Tools/YamsPlug/doc/lct.rst
src/Tools/YamsPlug/monViewText.py
src/Tools/YamsPlug/monYamsPlugDialog.py
src/Tools/YamsPlug/yamsplug_plugin.py

index 72ae1e07bd46ac3925e57ba629999a38e75f2a8a..1afc115ac8ee389743ae1f2057a3549882f4049d 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>927</width>
-    <height>700</height>
+    <width>800</width>
+    <height>500</height>
    </rect>
   </property>
   <property name="windowTitle">
   <layout class="QGridLayout" name="gridLayout">
    <item row="2" column="0">
     <layout class="QHBoxLayout" name="horizontalLayout">
+         <item>
+      <spacer name="horizontalSpacer_xx">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeType">
+        <enum>QSizePolicy::Minimum</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>10</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+         </item>
      <item>
       <widget class="QPushButton" name="PB_OK">
        <property name="text">
        <property name="orientation">
         <enum>Qt::Horizontal</enum>
        </property>
-       <property name="sizeType">
-        <enum>QSizePolicy::Minimum</enum>
-       </property>
        <property name="sizeHint" stdset="0">
         <size>
-         <width>60</width>
+         <width>30</width>
          <height>20</height>
         </size>
        </property>
       </spacer>
      </item>
      <item>
-      <widget class="QPushButton" name="PB_Save">
+      <widget class="QPushButton" name="PB_SaveHyp">
        <property name="text">
-        <string>Save Params</string>
+        <string>Save</string>
        </property>
+        <property name="iconSize">
+         <size>
+          <width>18</width>
+          <height>18</height>
+         </size>
+        </property>
       </widget>
      </item>
      <item>
-      <widget class="QPushButton" name="PB_Load">
+      <widget class="QPushButton" name="PB_LoadHyp">
        <property name="text">
-        <string>Load Params</string>
+        <string>Load</string>
        </property>
+        <property name="iconSize">
+         <size>
+          <width>18</width>
+          <height>18</height>
+         </size>
+        </property>
       </widget>
      </item>
      <item>
       <widget class="QPushButton" name="PB_Default">
        <property name="text">
-        <string>Default Params</string>
+        <string>Default</string>
        </property>
       </widget>
      </item>
        </property>
        <property name="sizeHint" stdset="0">
         <size>
-         <width>338</width>
-         <height>25</height>
+         <width>30</width>
+         <height>20</height>
         </size>
        </property>
       </spacer>
        </property>
       </widget>
      </item>
+         <item>
+      <spacer name="horizontalSpacer_xx">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeType">
+        <enum>QSizePolicy::Minimum</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>10</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+         </item>
     </layout>
    </item>
    <item row="1" column="0">
       <widget class="QGroupBox" name="GBOptim">
        <property name="geometry">
         <rect>
-         <x>20</x>
-         <y>190</y>
-         <width>871</width>
-         <height>311</height>
+         <x>10</x>
+         <y>140</y>
+         <width>750</width>
+         <height>270</height>
         </rect>
        </property>
        <property name="title">
         <string>Optimisation</string>
        </property>
-       <widget class="QGroupBox" name="mesRB">
-        <property name="geometry">
-         <rect>
-          <x>20</x>
-          <y>30</y>
-          <width>611</width>
-          <height>261</height>
-         </rect>
-        </property>
-        <widget class="QRadioButton" name="RB_0">
-         <property name="geometry">
-          <rect>
-           <x>17</x>
-           <y>25</y>
-           <width>585</width>
-           <height>23</height>
-          </rect>
-         </property>
-         <property name="toolTip">
-          <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;table style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
-&lt;tr&gt;
-&lt;td style=&quot;border: none;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Quality improvement&lt;/span&gt; is done by point smoothing and edge swapping&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
-         </property>
-         <property name="text">
-          <string>Quality improvement Only (0)</string>
-         </property>
-         <property name="checked">
-          <bool>true</bool>
-         </property>
-        </widget>
-        <widget class="QRadioButton" name="RB_G">
-         <property name="geometry">
-          <rect>
-           <x>17</x>
-           <y>54</y>
-           <width>585</width>
-           <height>23</height>
-          </rect>
-         </property>
-         <property name="toolTip">
-          <string>the given surface triangulation is enriched (no coarsening at all) in such away that the distance 
+
+        <layout class="QHBoxLayout" name="RBLayoutopt">
+
+         <item>
+      <spacer name="horizontalSpacer_xx">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeType">
+        <enum>QSizePolicy::Minimum</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>30</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+         </item>
+
+         <item>
+        <layout class="QVBoxLayout" name="monRBLayout">
+         <item>
+          <widget class="QRadioButton" name="RB_0">
+           <property name="toolTip">
+            <string>Quality improvement is done by point smoothing and edge swapping.</string>
+           </property>
+           <property name="text">
+            <string>Quality improvement Only (0)</string>
+           </property>
+           <property name="checked">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QRadioButton" name="RB_G">
+           <property name="toolTip">
+            <string>The given surface triangulation is enriched (no coarsening at all) in such away that the distance 
 between the elements in the final mesh and those of the initial one is bounded by auser specified tolerance value. 
 One should use this option, to enrich the mesh where purely
 geometrical features may be insuficiently fine, i.e. the resulting mesh will be least as fine as the input.
 Mesh and the geometric features will be refined if needed as specified by the other program parameters.
 The meshes obtained with those settings may not be suitable for computation.</string>
-         </property>
-         <property name="text">
-          <string>Pure Geometry Enrichment (G)</string>
-         </property>
-         <property name="checked">
-          <bool>false</bool>
-         </property>
-        </widget>
-        <widget class="QRadioButton" name="RB_U">
-         <property name="geometry">
-          <rect>
-           <x>17</x>
-           <y>83</y>
-           <width>585</width>
-           <height>23</height>
-          </rect>
-         </property>
-         <property name="toolTip">
-          <string>a uniform subdivision of the given surface triangulation is performed : 
+           </property>
+           <property name="text">
+            <string>Pure Geometry Enrichment (G)</string>
+           </property>
+           <property name="checked">
+            <bool>false</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QRadioButton" name="RB_U">
+           <property name="toolTip">
+            <string>An uniform subdivision of the given surface triangulation is performed : 
 each triangle of the given surface triangulation is considered at and
 is divided into identical triangles.</string>
-         </property>
-         <property name="text">
-          <string>Uniform Subdivision(U)</string>
-         </property>
-         <property name="checked">
-          <bool>false</bool>
-         </property>
-        </widget>
-        <widget class="QRadioButton" name="RB_S">
-         <property name="geometry">
-          <rect>
-           <x>17</x>
-           <y>112</y>
-           <width>585</width>
-           <height>23</height>
-          </rect>
-         </property>
-         <property name="toolTip">
-          <string>a surface sandpapering without shrinkage of the given surface
+           </property>
+           <property name="text">
+            <string>Uniform Subdivision (U)</string>
+           </property>
+           <property name="checked">
+            <bool>false</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QRadioButton" name="RB_S">
+           <property name="toolTip">
+            <string>A surface sandpapering without shrinkage of the given surface
 triangulation is performed, i.e., the high curvature variations of the
 given surface will be smoothed out without shrinking the volume in
 doing so. If ridges are defined, they will be kept as they are in the
 resulting mesh.
-This option modifies the goemetry.</string>
-         </property>
-         <property name="text">
-          <string>Sand Papering (S)</string>
-         </property>
-         <property name="checked">
-          <bool>false</bool>
-         </property>
-        </widget>
-        <widget class="QRadioButton" name="RB__2">
-         <property name="geometry">
-          <rect>
-           <x>17</x>
-           <y>141</y>
-           <width>585</width>
-           <height>23</height>
-          </rect>
-         </property>
-         <property name="toolTip">
-          <string>The given surface triangulation is modified in such a way that the distance between 
+This option modifies the geometry.</string>
+           </property>
+           <property name="text">
+            <string>Sandpapering (S)</string>
+           </property>
+           <property name="checked">
+            <bool>false</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QRadioButton" name="RB__2">
+           <property name="toolTip">
+            <string>The given surface triangulation is modified in such a way that the distance between 
 the elements in the final mesh and those of the initial one is bounded by a user specfied tolerance value.
 One should use this option, to coarsen when a purely geometrical mesh is needed. (a mesh that keeps
 and obeys its geometric features only.) The meshes obtained with this option are usually not suitable
 for computation because anisotropic elements may be generated</string>
-         </property>
-         <property name="text">
-          <string>Geometrical Mesh : Coarsening(-2)</string>
-         </property>
-        </widget>
-        <widget class="QRadioButton" name="RB_2">
-         <property name="geometry">
-          <rect>
-           <x>17</x>
-           <y>170</y>
-           <width>585</width>
-           <height>23</height>
-          </rect>
-         </property>
-         <property name="toolTip">
-          <string>The given surface triangulation is modified in such a way that the distance between 
+           </property>
+           <property name="text">
+            <string>Geometrical Mesh : Coarsening (-2)</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QRadioButton" name="RB_2">
+           <property name="toolTip">
+            <string>The given surface triangulation is modified in such a way that the distance between 
 the elements in the final mesh and those of the initial one is bounded by a user specfied tolerance value.
 One should use this option, to coarsen and enrich when a purely geometrical mesh is needed. (a mesh that keeps
 and obeys its geometric features only.) The meshes obtained with this setting are usually not suitable
 for computation because anisotropic elements may be generated</string>
-         </property>
-         <property name="text">
-          <string>Geometrical Mesh : Coarsening and Enrichment (2)</string>
-         </property>
-        </widget>
-        <widget class="QRadioButton" name="RB__1">
-         <property name="geometry">
-          <rect>
-           <x>17</x>
-           <y>199</y>
-           <width>585</width>
-           <height>23</height>
-          </rect>
-         </property>
-         <property name="toolTip">
-          <string>The given surface triangulation is modfied in accordance to a size map. 
+           </property>
+           <property name="text">
+            <string>Geometrical Mesh : Coarsening and Enrichment (2)</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QRadioButton" name="RB__1">
+           <property name="toolTip">
+            <string>The given surface triangulation is modified in accordance to a size map. 
 The latter can be either the intrinsic size map (computed automatically
 and based on the surface properties, i.e. the local curvatures),
 or on a given size map (which is then combined to the intrinsic size map). 
 One should use this option to coarsen  the mesh, when a regular mesh 
 for computation purposes is desired, i.e. a mesh with good aspect ratios or 
 good quality elements.</string>
-         </property>
-         <property name="text">
-          <string>Mesh for finite element computation : Coarsening (-1)</string>
-         </property>
-        </widget>
-        <widget class="QRadioButton" name="RB_1">
-         <property name="geometry">
-          <rect>
-           <x>17</x>
-           <y>228</y>
-           <width>585</width>
-           <height>22</height>
-          </rect>
-         </property>
-         <property name="toolTip">
-          <string>The given surface triangulation is modfied in accordance to a size map. 
+           </property>
+           <property name="text">
+            <string>Mesh for finite element computation : Coarsening (-1)</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QRadioButton" name="RB_1">
+           <property name="toolTip">
+            <string>The given surface triangulation is modified in accordance to a size map. 
 The latter can be either the intrinsic size map (computed automatically
 and based on the surface properties, i.e. the local curvatures),
 or on a given size map (which is then combined to the intrinsic size map). 
 One should use this option to coarsen  and enrich the mesh, when a regular mesh 
 for computation purposes is desired, i.e. a mesh with good aspect ratios or 
 good quality elements</string>
-         </property>
-         <property name="text">
-          <string>Mesh for finite element computation : Coarsening and Enrichment  (1)</string>
-         </property>
-        </widget>
-       </widget>
+           </property>
+           <property name="text">
+            <string>Mesh for finite element computation : Coarsening and Enrichment  (1)</string>
+           </property>
+          </widget>
+         </item>
+
+        </layout>
+
+       </item>
+
+      </layout>
+
       </widget>
-      <widget class="QGroupBox" name="groupBox">
+      <widget class="QGroupBox" name="GBUnit">
        <property name="geometry">
         <rect>
          <x>10</x>
-         <y>20</y>
-         <width>871</width>
-         <height>161</height>
+         <y>420</y>
+         <width>750</width>
+         <height>70</height>
         </rect>
        </property>
-       <property name="font">
-        <font>
-         <pointsize>10</pointsize>
-        </font>
+       <property name="toolTip">
+        <string>This parameter enables the user to bound the maximal chordal deviation allowed,
+that is the maximal distance allowed between the detected curve and the plane P
+of the corresponding mesh face.
+In other words, it avoids having faces too far away from the curve they should represent.</string>
        </property>
        <property name="title">
-        <string>Original Mesh</string>
+        <string>Chordal deviation Tolerance</string>
        </property>
-       <widget class="QWidget" name="layoutWidget">
+       <widget class="QLineEdit" name="SP_Tolerance">
         <property name="geometry">
          <rect>
-          <x>10</x>
+          <x>40</x>
           <y>30</y>
-          <width>861</width>
-          <height>101</height>
+          <width>110</width>
+          <height>24</height>
          </rect>
         </property>
-        <layout class="QGridLayout" name="gridLayout_2">
-         <item row="0" column="1">
-          <widget class="QLabel" name="label_7">
-           <property name="font">
-            <font>
-             <pointsize>10</pointsize>
-             <strikeout>false</strikeout>
-            </font>
-           </property>
-           <property name="frameShape">
-            <enum>QFrame::Box</enum>
-           </property>
-           <property name="text">
-            <string>Smesh mesh</string>
-           </property>
-           <property name="wordWrap">
-            <bool>false</bool>
-           </property>
-           <property name="margin">
-            <number>0</number>
-           </property>
-          </widget>
-         </item>
-         <item row="0" column="2">
-          <widget class="QPushButton" name="PB_MeshSmesh">
-           <property name="text">
-            <string/>
-           </property>
-           <property name="icon">
-            <iconset>
-             <normaloff>../../../../../../../../SalomeSrc/SMESH_V6_main/src/Tools/YamsPlug/open.png</normaloff>../../../../../../../../SalomeSrc/SMESH_V6_main/src/Tools/YamsPlug/open.png</iconset>
-           </property>
-           <property name="iconSize">
-            <size>
-             <width>18</width>
-             <height>18</height>
-            </size>
-           </property>
-           <property name="checkable">
-            <bool>false</bool>
-           </property>
-          </widget>
-         </item>
-         <item row="0" column="3">
-          <widget class="QLineEdit" name="LE_MeshSmesh">
-           <property name="font">
-            <font>
-             <pointsize>10</pointsize>
-            </font>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="0">
-          <widget class="QLabel" name="label_8">
-           <property name="text">
-            <string>or</string>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="1" colspan="2">
-          <widget class="QPushButton" name="PB_MeshFile">
-           <property name="font">
-            <font>
-             <pointsize>10</pointsize>
-            </font>
-           </property>
-           <property name="text">
-            <string>Mesh File (GMF format)</string>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="3">
-          <widget class="QLineEdit" name="LE_MeshFile">
-           <property name="font">
-            <font>
-             <pointsize>10</pointsize>
-            </font>
-           </property>
-          </widget>
-         </item>
-        </layout>
+        <property name="toolTip">
+         <string>If the Units parameter is relative, epsilon max correspond to (per thousand) s*Tolerance/1000, where s is the size of the bounding box of the domain.
+If the Units parameter is absolute, the tolerance parameter is expressed in model units:
+  if P=2 and point coordinates are given in millimeters, the maximal chordal deviation is 2 mm.</string>
+        </property>
+       </widget>
+       <widget class="QRadioButton" name="RB_Absolute">
+        <property name="geometry">
+         <rect>
+          <x>220</x>
+          <y>30</y>
+          <width>120</width>
+          <height>24</height>
+         </rect>
+        </property>
+        <property name="toolTip">
+         <string>Values are expressed in the model units.</string>
+        </property>
+        <property name="text">
+         <string>Absolute units</string>
+        </property>
+        <property name="checked">
+         <bool>false</bool>
+        </property>
+       </widget>
+       <widget class="QRadioButton" name="RB_Relative">
+        <property name="geometry">
+         <rect>
+          <x>350</x>
+          <y>30</y>
+          <width>120</width>
+          <height>24</height>
+         </rect>
+        </property>
+        <property name="toolTip">
+         <string>Values are relative (per thousand) to the bounding box size.</string>
+        </property>
+        <property name="text">
+         <string>Relative units</string>
+        </property>
+        <property name="checked">
+         <bool>true</bool>
+        </property>
        </widget>
       </widget>
-      <widget class="QDoubleSpinBox" name="SP_Tolerance">
+      <widget class="QGroupBox" name="groupBox">
        <property name="geometry">
         <rect>
-         <x>430</x>
-         <y>540</y>
-         <width>81</width>
-         <height>31</height>
+         <x>10</x>
+         <y>10</y>
+         <width>750</width>
+         <height>120</height>
         </rect>
        </property>
        <property name="font">
         <font>
-         <stylestrategy>PreferDefault</stylestrategy>
+         <pointsize>10</pointsize>
         </font>
        </property>
-       <property name="mouseTracking">
-        <bool>true</bool>
-       </property>
-       <property name="toolTip">
-        <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If the Units parameter is relative, epsilon max corresponds to 0.001x s x tolerance parameter where s is the size of the bounding box of the domain.&lt;/p&gt;&lt;p&gt;If the Units parameter (P) is absolute, the tolerance parameter is expressed in model units :&lt;/p&gt;&lt;p&gt;if P=2 and point coordinates are given in millimetre, it means that the maximal chordal deviation is 2 mm &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-       </property>
-       <property name="decimals">
-        <number>0</number>
-       </property>
-       <property name="minimum">
-        <double>1.000000000000000</double>
-       </property>
-       <property name="maximum">
-        <double>1000.000000000000000</double>
-       </property>
-       <property name="singleStep">
-        <double>1.000000000000000</double>
-       </property>
-       <property name="value">
-        <double>10.000000000000000</double>
-       </property>
-      </widget>
-      <widget class="QWidget" name="layoutWidget">
-       <property name="geometry">
-        <rect>
-         <x>30</x>
-         <y>500</y>
-         <width>801</width>
-         <height>37</height>
-        </rect>
-       </property>
-       <layout class="QHBoxLayout" name="horizontalLayout_2">
-        <item>
-         <widget class="QGroupBox" name="GBUnit">
-          <property name="toolTip">
-           <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;table border=&quot;0&quot; style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
-&lt;tr&gt;
-&lt;td style=&quot;border: none;&quot;&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
-          </property>
-          <property name="title">
-           <string>Units </string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QGroupBox" name="GBTolerance_2">
-          <property name="toolTip">
-           <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;table border=&quot;0&quot; style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
-&lt;tr&gt;
-&lt;td style=&quot;border: none;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Set chordal deviation tolerance:&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;This parameter enables the user to bound the maximal chordal deviation allowed,&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;that is, the maximal distance allowed between the detected curve and the plane P&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;of the corresponding mesh face.&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;In other words, it avoids having faces too far away from the curve &lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;they represent (or should represent).&lt;/p&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
-          </property>
-          <property name="title">
-           <string>Chordal deviation Tolerance</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </widget>
-      <widget class="QWidget" name="layoutWidget">
-       <property name="geometry">
-        <rect>
-         <x>60</x>
-         <y>540</y>
-         <width>230</width>
-         <height>31</height>
-        </rect>
-       </property>
-       <layout class="QHBoxLayout" name="horizontalLayout_5">
-        <item>
-         <widget class="QRadioButton" name="RB_Absolute">
-          <property name="toolTip">
-           <string>Values are expressed in the model units.</string>
-          </property>
-          <property name="text">
-           <string>Absolute</string>
-          </property>
-          <property name="checked">
-           <bool>false</bool>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QRadioButton" name="RB_Relative">
-          <property name="toolTip">
-           <string>Values are relative to the bounding box size.</string>
-          </property>
-          <property name="text">
-           <string>Relative</string>
-          </property>
-          <property name="checked">
-           <bool>true</bool>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </widget>
-      <widget class="QLabel" name="label_11">
-       <property name="geometry">
-        <rect>
-         <x>520</x>
-         <y>540</y>
-         <width>301</width>
-         <height>51</height>
-        </rect>
-       </property>
-       <property name="text">
-        <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;0/00 if relative&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Mesh unit if absolute&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       <property name="title">
+        <string>Original Mesh</string>
        </property>
+       <widget class="QPushButton" name="PB_MeshFile">
+        <property name="geometry">
+         <rect>
+          <x>40</x>
+          <y>70</y>
+          <width>190</width>
+          <height>31</height>
+         </rect>
+        </property>
+        <property name="font">
+         <font>
+          <pointsize>10</pointsize>
+         </font>
+        </property>
+        <property name="text">
+         <string>Mesh File GMF format</string>
+        </property>
+        <property name="iconSize">
+         <size>
+          <width>18</width>
+          <height>18</height>
+         </size>
+        </property>
+       </widget>
+       <widget class="QLineEdit" name="LE_MeshFile">
+        <property name="geometry">
+         <rect>
+          <x>240</x>
+          <y>70</y>
+          <width>481</width>
+          <height>31</height>
+         </rect>
+        </property>
+        <property name="font">
+         <font>
+          <pointsize>10</pointsize>
+         </font>
+        </property>
+       </widget>
+       <widget class="QPushButton" name="PB_MeshSmesh">
+        <property name="geometry">
+         <rect>
+          <x>40</x>
+          <y>30</y>
+          <width>190</width>
+          <height>31</height>
+         </rect>
+        </property>
+        <property name="text">
+         <string>Mesh Object Browser</string>
+        </property>
+        <property name="iconSize">
+         <size>
+          <width>18</width>
+          <height>18</height>
+         </size>
+        </property>
+        <property name="checkable">
+         <bool>false</bool>
+        </property>
+       </widget>
+       <widget class="QLineEdit" name="LE_MeshSmesh">
+        <property name="geometry">
+         <rect>
+          <x>240</x>
+          <y>30</y>
+          <width>481</width>
+          <height>31</height>
+         </rect>
+        </property>
+        <property name="font">
+         <font>
+          <pointsize>10</pointsize>
+         </font>
+        </property>
+       </widget>
+       <widget class="QLabel" name="label_8">
+        <property name="geometry">
+         <rect>
+          <x>10</x>
+          <y>80</y>
+          <width>31</width>
+          <height>18</height>
+         </rect>
+        </property>
+        <property name="text">
+         <string>or</string>
+        </property>
+       </widget>
       </widget>
-      <zorder>layoutWidget</zorder>
-      <zorder>layoutWidget</zorder>
       <zorder>groupBox</zorder>
       <zorder>GBOptim</zorder>
-      <zorder>SP_Tolerance</zorder>
-      <zorder>label_11</zorder>
      </widget>
      <widget class="QWidget" name="advanced">
       <attribute name="title">
-       <string>Advanced  Remeshing Options</string>
+       <string>Advanced Remeshing Options</string>
       </attribute>
-      <widget class="QGroupBox" name="groupBox_2">
+      <widget class="QGroupBox" name="groupBox_5">
        <property name="geometry">
         <rect>
          <x>10</x>
          <y>10</y>
-         <width>761</width>
-         <height>71</height>
+         <width>750</width>
+         <height>120</height>
         </rect>
        </property>
        <property name="title">
-        <string>You can disable :</string>
+        <string>You can set/unset</string>
        </property>
        <widget class="QCheckBox" name="CB_Ridge">
         <property name="geometry">
          <rect>
-          <x>100</x>
+          <x>30</x>
           <y>20</y>
           <width>271</width>
-          <height>23</height>
+          <height>25</height>
          </rect>
         </property>
         <property name="toolTip">
-         <string>if not set (ridge detection disabled), Yams will not try to detect any new ridge edge by its own mechanism : 
+         <string>If not set (ridge detection disabled), Yams will not try to detect any new ridge edge by its own mechanism : 
 it will consider as ridge only the ridges given in the mesh. 
-All non-ridge edges that would have been detected as ridge by the Ridge angle paramaeter 
+All non-ridge edges that would have been detected as ridge by the ridge angle parameter 
 (see below)  will be considered as part of the same continuous patch.
 This option should not be checked when all the known ridges of the mesh are given and
 when all other possible ridges are not geometric ridges to take into account.</string>
@@ -613,10 +543,10 @@ when all other possible ridges are not geometric ridges to take into account.</s
        <widget class="QCheckBox" name="CB_Point">
         <property name="geometry">
          <rect>
-          <x>100</x>
-          <y>40</y>
+          <x>30</x>
+          <y>50</y>
           <width>271</width>
-          <height>23</height>
+          <height>25</height>
          </rect>
         </property>
         <property name="toolTip">
@@ -631,127 +561,159 @@ or add vertices (refines) to change the mesh.</string>
          <bool>true</bool>
         </property>
        </widget>
+
+       <widget class="QCheckBox" name="CB_SplitEdge">
+        <property name="geometry">
+         <rect>
+          <x>30</x>
+          <y>80</y>
+          <width>271</width>
+          <height>25</height>
+         </rect>
+        </property>
+        <property name="toolTip">
+         <string>If set, Yams creates new vertices placed on the curved surface and adds them to elements. 
+It means one extra vertex on edge (P2 or quadratic triangles).
+New created vertices are saved in the .mesh file under keyword section 'Vertices'</string>
+        </property>
+        <property name="text">
+         <string>split edge</string>
+        </property>
+        <property name="checked">
+         <bool>false</bool>
+        </property>
+       </widget>
+
+
       </widget>
       <widget class="QGroupBox" name="groupBox_5">
        <property name="geometry">
         <rect>
          <x>10</x>
-         <y>90</y>
-         <width>841</width>
-         <height>391</height>
+         <y>140</y>
+         <width>750</width>
+         <height>270</height>
         </rect>
        </property>
        <property name="title">
-        <string>You can control </string>
+        <string>You can control</string>
        </property>
+##1
        <widget class="QDoubleSpinBox" name="SP_Geomapp">
         <property name="geometry">
          <rect>
-          <x>10</x>
+          <x>30</x>
           <y>30</y>
-          <width>91</width>
-          <height>23</height>
+          <width>100</width>
+          <height>25</height>
          </rect>
         </property>
         <property name="maximum">
-         <double>0.890000000000000</double>
+         <double>0.89</double>
         </property>
         <property name="singleStep">
-         <double>0.010000000000000</double>
+         <double>0.01</double>
         </property>
         <property name="value">
-         <double>0.040000000000000</double>
+         <double>0.04</double>
         </property>
        </widget>
        <widget class="QLabel" name="label_2">
         <property name="geometry">
          <rect>
-          <x>120</x>
-          <y>20</y>
-          <width>731</width>
-          <height>61</height>
+          <x>140</x>
+          <y>30</y>
+          <width>630</width>
+          <height>30</height>
          </rect>
         </property>
         <property name="toolTip">
          <string>This field (as well as tolerance) enables the user to control the accuracy of the
 piecewise linear approximation of the surface. This parameter enables the user to
-control the maximal angle allowed between two adjacent faces. It can be used to 
+control the maximal angle allowed between two adjacent faces. It can be used to
 bound the maximal deviation of the mesh faces from the tangent planes at mesh vertices. 
 In other words, it avoids having sharp angles between faces representing a smooth curve.
 This parameter enables the user to specify the maximal chordal deviation &quot;max relatively to the curvature.
 Following that criterion:
-- if the chordal deviation epsilon  is smaller than epsilon max *r, it is acceptable to remove the considered point;
+- if the chordal deviation epsilon is smaller than epsilon max*r, it is acceptable to remove the considered point;
 - if the chordal deviation epsilon is greater than epsiolon max*r, the considered mesh face should be redefined 
-by adding a point on the curve.
+     by adding a point on the curve.
 One can see that the smaller the radius r, the harder it is to satisfy this criterion:  
 epsilon max is a real value corresponding to a percentage, the ratio between the chordal deviation to 
 the local curvature. This field is used only for optimisation style -O values of  -1, 0 and 1.
 The default value for &quot;max is set to 0:04 which leads to angles of less than 33 degrees between two adjacent
-faces .</string>
+faces.</string>
         </property>
         <property name="text">
-         <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;table border=&quot;0&quot; style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
-&lt;tr&gt;
-&lt;td style=&quot;border: none;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif';&quot;&gt;Geometrical approximation :  Maximum angle (1-cos(angle)) allowed &lt;/span&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif';&quot;&gt;between a face and a curve &lt;/span&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:8pt;&quot;&gt;(not separated by a ridge).&lt;/span&gt;&lt;span style=&quot; font-family:'Sans Serif';&quot;&gt;)&lt;/span&gt;&lt;/p&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         <string>Geometrical approximation:
+Maximum angle allowed between a face and a curve (not separated by a ridge).</string>
+        </property>
+       </widget>
+##2
+       <widget class="QDoubleSpinBox" name="SP_Ridge">
+        <property name="geometry">
+         <rect>
+          <x>30</x>
+          <y>70</y>
+          <width>100</width>
+          <height>25</height>
+         </rect>
+        </property>
+        <property name="maximum">
+         <double>90.</double>
+        </property>
+        <property name="value">
+         <double>45.</double>
         </property>
        </widget>
        <widget class="QLabel" name="label_4">
         <property name="geometry">
          <rect>
-          <x>120</x>
-          <y>80</y>
-          <width>691</width>
-          <height>71</height>
+          <x>140</x>
+          <y>70</y>
+          <width>630</width>
+          <height>30</height>
          </rect>
         </property>
         <property name="text">
-         <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;table border=&quot;0&quot; style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
-&lt;tr&gt;
-&lt;td style=&quot;border: none;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif';&quot;&gt;Ridge angle:&lt;/span&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif';&quot;&gt;if the angle between the normal vectors of two adjacent faces&lt;/span&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif';&quot;&gt;exceeds this value, the edge common to the faces is a ridge&lt;/span&gt;&lt;/p&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         <string>If the angle between the normal vectors of two adjacent faces exceeds this value,
+the edge common to the faces is a ridge.</string>
         </property>
        </widget>
-       <widget class="QDoubleSpinBox" name="SP_Ridge">
+##3
+       <widget class="QDoubleSpinBox" name="SP_MaxSize">
         <property name="geometry">
          <rect>
-          <x>10</x>
-          <y>100</y>
-          <width>91</width>
-          <height>23</height>
+          <x>30</x>
+          <y>110</y>
+          <width>100</width>
+          <height>25</height>
          </rect>
         </property>
+        <property name="minimum">
+         <double>0.01</double>
+        </property>
         <property name="maximum">
-         <double>90.000000000000000</double>
+         <double>100.</double>
+        </property>
+        <property name="singleStep">
+         <double>0.1</double>
         </property>
         <property name="value">
-         <double>45.000000000000000</double>
+         <double>100.</double>
         </property>
        </widget>
        <widget class="QLabel" name="label_5">
         <property name="geometry">
          <rect>
-          <x>120</x>
-          <y>160</y>
-          <width>681</width>
-          <height>61</height>
+          <x>140</x>
+          <y>110</y>
+          <width>630</width>
+          <height>30</height>
          </rect>
         </property>
         <property name="toolTip">
-         <string>This parameter allows the user to prescribe  a maximal size hmax
+         <string>This parameter allows the user to prescribe a maximal size hmax
 for the mesh elements i.e., the lengths of the edges with respect to the specified
  size map. The corresponding values are either relative or absolute depending on the choosen parameter.
 The default values are automatically set based on the surface geometry (curvature dependent) and its
@@ -760,97 +722,44 @@ Please note that, as it is not strictly possible to obey the given or computed s
 size  may be slightly bigger than the prescribed ones.</string>
         </property>
         <property name="text">
-         <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;table border=&quot;0&quot; style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
-&lt;tr&gt;
-&lt;td style=&quot;border: none;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Maximal size allowed around vertices:&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;the lengths of the edges with respect to the specified size map.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
-        </property>
-       </widget>
-       <widget class="QLabel" name="label_3">
-        <property name="geometry">
-         <rect>
-          <x>120</x>
-          <y>290</y>
-          <width>691</width>
-          <height>91</height>
-         </rect>
-        </property>
-        <property name="toolTip">
-         <string>This parameter enables the user to control the element size variation in the triangulation.
-Yams will avoid getting two adjacent edges which sizes differ by a factor bigger than this parameter. 
-To avoid rapid size variations, a size correction procedure is applied to the size map. 
-In other words: if two adjacent edges are respectively e1 and e2 long 
-if  e2 &gt; parameter * e1 then e02 the new size for the second edge will be set to  parameter* e1.
-This procedure is de-activated if yams computes a mesh for finite element with only coarsening.
-The default value is 1.3, which is the usual value set for computational meshes.</string>
-        </property>
-        <property name="text">
-         <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;table border=&quot;0&quot; style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
-&lt;tr&gt;
-&lt;td style=&quot;border: none;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Mesh Gradation ie the element size variation in the triangulation:&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Yams will avoid having two adjacent edges which sizes &lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;vary more than the given gradation.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
-        </property>
-       </widget>
-       <widget class="QDoubleSpinBox" name="SP_Gradation">
-        <property name="geometry">
-         <rect>
-          <x>10</x>
-          <y>300</y>
-          <width>91</width>
-          <height>23</height>
-         </rect>
-        </property>
-        <property name="singleStep">
-         <double>0.010000000000000</double>
-        </property>
-        <property name="value">
-         <double>1.300000000000000</double>
+         <string>Maximal size allowed around vertices,
+the lengths of the edges with respect to the specified size map.</string>
         </property>
        </widget>
-       <widget class="QDoubleSpinBox" name="SP_MaxSize">
+##4
+       <widget class="QDoubleSpinBox" name="SP_MinSize">
         <property name="geometry">
          <rect>
-          <x>10</x>
-          <y>170</y>
-          <width>91</width>
-          <height>23</height>
+          <x>30</x>
+          <y>150</y>
+          <width>100</width>
+          <height>25</height>
          </rect>
         </property>
         <property name="minimum">
-         <double>0.010000000000000</double>
+         <double>0.</double>
         </property>
         <property name="maximum">
-         <double>100.000000000000000</double>
+         <double>100.</double>
         </property>
         <property name="singleStep">
-         <double>0.100000000000000</double>
+         <double>0.1</double>
         </property>
         <property name="value">
-         <double>100.000000000000000</double>
+         <double>5.</double>
         </property>
        </widget>
        <widget class="QLabel" name="label_9">
         <property name="geometry">
          <rect>
-          <x>120</x>
-          <y>230</y>
-          <width>661</width>
-          <height>51</height>
+          <x>140</x>
+          <y>150</y>
+          <width>630</width>
+          <height>30</height>
          </rect>
         </property>
         <property name="toolTip">
-         <string>This parameter allows the user to prescribe  a maximal size hmax
+         <string>This parameter allows the user to prescribe a maximal size hmax
 for the mesh elements i.e., the lengths of the edges with respect to the specified
  size map. The corresponding values are either relative or absolute depending on the choosen parameter.
 The default values are automatically set based on the surface geometry (curvature dependent) and its
@@ -859,73 +768,50 @@ Please note that, as it is not strictly possible to obey the given or computed s
 size  may be slightly bigger than the prescribed ones.</string>
         </property>
         <property name="text">
-         <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;table border=&quot;0&quot; style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
-&lt;tr&gt;
-&lt;td style=&quot;border: none;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Minimal size allowed around vertices:&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;the lengths of the edges with respect to the specified size map.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         <string>Minimal size allowed around vertices,
+the lengths of the edges with respect to the specified size map.</string>
         </property>
        </widget>
-       <widget class="QDoubleSpinBox" name="SP_MinSize">
+##5
+       <widget class="QDoubleSpinBox" name="SP_Gradation">
         <property name="geometry">
          <rect>
-          <x>10</x>
-          <y>230</y>
-          <width>91</width>
-          <height>23</height>
+          <x>30</x>
+          <y>190</y>
+          <width>100</width>
+          <height>25</height>
          </rect>
         </property>
-        <property name="minimum">
-         <double>0.000000000000000</double>
-        </property>
-        <property name="maximum">
-         <double>100.000000000000000</double>
-        </property>
         <property name="singleStep">
-         <double>0.100000000000000</double>
+         <double>0.01</double>
         </property>
         <property name="value">
-         <double>5.000000000000000</double>
+         <double>1.3</double>
+        </property>
+       </widget>
+       <widget class="QLabel" name="label_3">
+        <property name="geometry">
+         <rect>
+          <x>140</x>
+          <y>190</y>
+          <width>630</width>
+          <height>30</height>
+         </rect>
+        </property>
+        <property name="toolTip">
+         <string>This parameter enables the user to control the element size variation in the triangulation.
+Yams will avoid getting two adjacent edges which sizes differ by a factor bigger than this parameter. 
+To avoid rapid size variations, a size correction procedure is applied to the size map. 
+In other words: if two adjacent edges are respectively e1 and e2 long 
+if  e2 &gt; parameter * e1 then e02 the new size for the second edge will be set to  parameter* e1.
+This procedure is de-activated if yams computes a mesh for finite element with only coarsening.
+The default value is 1.3, which is the usual value set for computational meshes.</string>
+        </property>
+        <property name="text">
+         <string>Mesh Gradation: the element size variation in the triangulation.
+Yams will avoid having two adjacent edges which sizes vary more than the given gradation.</string>
         </property>
        </widget>
-      </widget>
-      <widget class="QGroupBox" name="groupBox_3">
-       <property name="geometry">
-        <rect>
-         <x>20</x>
-         <y>490</y>
-         <width>751</width>
-         <height>31</height>
-        </rect>
-       </property>
-       <property name="title">
-        <string>You can enable :</string>
-       </property>
-      </widget>
-      <widget class="QCheckBox" name="CB_SplitEdge">
-       <property name="geometry">
-        <rect>
-         <x>70</x>
-         <y>530</y>
-         <width>271</width>
-         <height>23</height>
-        </rect>
-       </property>
-       <property name="toolTip">
-        <string>if set, Yams creates new vertices placed on the curved surface and adds them to elements. 
-It means one extra vertex on edge (P2 or quadratic triangles).
-New created vertices  are saved in the .mesh file under keyword section Vertices</string>
-       </property>
-       <property name="text">
-        <string>split edge</string>
-       </property>
-       <property name="checked">
-        <bool>false</bool>
-       </property>
       </widget>
      </widget>
      <widget class="QWidget" name="generic">
@@ -936,101 +822,80 @@ New created vertices  are saved in the .mesh file under keyword section Vertices
        <property name="geometry">
         <rect>
          <x>10</x>
-         <y>30</y>
-         <width>741</width>
-         <height>131</height>
+         <y>10</y>
+         <width>750</width>
+         <height>130</height>
         </rect>
        </property>
        <property name="title">
         <string>Yams Generic Options</string>
        </property>
-       <widget class="QWidget" name="layoutWidget">
+       
+          <widget class="QSpinBox" name="SP_Verbosity">
         <property name="geometry">
          <rect>
-          <x>40</x>
+          <x>20</x>
           <y>30</y>
-          <width>441</width>
-          <height>34</height>
+          <width>100</width>
+          <height>25</height>
          </rect>
         </property>
-        <layout class="QHBoxLayout" name="horizontalLayout_3">
-         <item>
-          <widget class="QLabel" name="label">
-           <property name="text">
-            <string>Verbosity Level</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer name="horizontalSpacer_2">
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>28</width>
-             <height>20</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QSpinBox" name="SP_Verbosity">
            <property name="maximum">
             <number>10</number>
            </property>
            <property name="value">
-            <number>7</number>
+            <number>3</number>
            </property>
           </widget>
-         </item>
-        </layout>
-       </widget>
-       <widget class="QWidget" name="layoutWidget_2">
+       
+          <widget class="QLabel" name="label">
         <property name="geometry">
          <rect>
-          <x>40</x>
-          <y>70</y>
-          <width>441</width>
-          <height>34</height>
+          <x>130</x>
+          <y>30</y>
+          <width>600</width>
+          <height>30</height>
          </rect>
         </property>
-        <layout class="QHBoxLayout" name="horizontalLayout_4">
-         <item>
-          <widget class="QLabel" name="label_6">
-           <property name="minimumSize">
-            <size>
-             <width>225</width>
-             <height>25</height>
-            </size>
-           </property>
+        <property name="toolTip">
+         <string>sets the verbosity level.
+From 0 (no detail) to 10 (very detailed).
+Default is 3.</string>
+        </property>
            <property name="text">
-            <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;table border=&quot;0&quot; style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
-&lt;tr&gt;
-&lt;td style=&quot;border: none;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Memory size (in Mbytes)&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
+            <string>Verbosity level</string>
            </property>
           </widget>
-         </item>
-         <item>
-          <spacer name="horizontalSpacer_3">
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
+       
+          <widget class="QSpinBox" name="SP_Memory">
+        <property name="geometry">
+         <rect>
+          <x>20</x>
+          <y>70</y>
+          <width>100</width>
+          <height>25</height>
+         </rect>
+        </property>
+           <property name="maximum">
+            <number>100000</number>
            </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>28</width>
-             <height>20</height>
-            </size>
+           <property name="value">
+            <number>0</number>
+           </property>
+          </widget>
+       
+          <widget class="QLabel" name="label_6">
+       <property name="geometry">
+         <rect>
+          <x>130</x>
+          <y>70</y>
+          <width>600</width>
+          <height>30</height>
+         </rect>
+        </property>
+           <property name="text">
+            <string>Memory size (in Mbytes)</string>
            </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QSpinBox" name="SP_Memory">
            <property name="toolTip">
             <string>The program requires roughly about 370 bytes per point. It is thus possible to estimate a priori 
 the required memory size to complete a job. As an example of memory space needed, a mesh 
@@ -1041,33 +906,25 @@ The memory needed for mesh modification is allocated dynamically at the beginnin
 memory allowed, it will stop inserting points and, if possible, the current mesh will be saved as it is, 
 valid and conformal, provided the input mesh was valid and conformal.
 Specify the memory if:
-- the automatically allocated memory reveals insufficient when the user asked to enrich the given mesh;
+- the automatically allocated memory reveals insufficient when the user asked to enrich the given mesh.
 - you want to limit the amount of memory used by the program.
 If the input mesh size requires more memory than requested or if the allocated memory (user defined or not)
 exceeds the machine capabilities, the tool will stop because of insufficient memory.</string>
            </property>
-           <property name="maximum">
-            <number>100000</number>
-           </property>
-           <property name="value">
-            <number>0</number>
-           </property>
           </widget>
-         </item>
-        </layout>
-       </widget>
+        
       </widget>
       <widget class="QGroupBox" name="groupBox_6">
        <property name="geometry">
         <rect>
          <x>10</x>
-         <y>230</y>
-         <width>741</width>
-         <height>141</height>
+         <y>150</y>
+         <width>750</width>
+         <height>170</height>
         </rect>
        </property>
        <property name="title">
-        <string>Plug-In Generic Options</string>
+        <string>Plug-in Generic Options</string>
        </property>
        <widget class="QLabel" name="label_10">
         <property name="geometry">
@@ -1079,7 +936,7 @@ exceeds the machine capabilities, the tool will stop because of insufficient mem
          </rect>
         </property>
         <property name="text">
-         <string>File used to save Yams Params :</string>
+         <string>File used to save Yams hypothesis parameters :</string>
         </property>
        </widget>
        <widget class="QPushButton" name="PB_ParamsFileExplorer">
@@ -1094,10 +951,6 @@ exceeds the machine capabilities, the tool will stop because of insufficient mem
         <property name="text">
          <string/>
         </property>
-        <property name="icon">
-         <iconset>
-          <normaloff>../../../../../../../../SalomeSrc/SMESH_V6_main/src/Tools/YamsPlug/open.png</normaloff>../../../../../../../../SalomeSrc/SMESH_V6_main/src/Tools/YamsPlug/open.png</iconset>
-        </property>
        </widget>
        <widget class="QLineEdit" name="LE_ParamsFile">
         <property name="geometry">
@@ -1109,6 +962,47 @@ exceeds the machine capabilities, the tool will stop because of insufficient mem
          </rect>
         </property>
        </widget>
+       
+      <widget class="QPushButton" name="PB_Save">
+        <property name="geometry">
+         <rect>
+          <x>20</x>
+          <y>110</y>
+          <width>70</width>
+          <height>31</height>
+         </rect>
+        </property>
+       <property name="text">
+        <string>Save</string>
+       </property>
+        <property name="iconSize">
+         <size>
+          <width>18</width>
+          <height>18</height>
+         </size>
+        </property>
+      </widget>
+
+      <widget class="QPushButton" name="PB_Load">
+        <property name="geometry">
+         <rect>
+          <x>120</x>
+          <y>110</y>
+          <width>70</width>
+          <height>31</height>
+         </rect>
+        </property>
+       <property name="text">
+        <string>Load</string>
+       </property>
+        <property name="iconSize">
+         <size>
+          <width>18</width>
+          <height>18</height>
+         </size>
+        </property>
+      </widget>
+       
       </widget>
      </widget>
     </widget>
index 32b31b1acd439f2e8ad82d597b645361b0871b12..046e688c91ff570d9b4ff84fbbf50716f4fb91e4 100644 (file)
@@ -15,7 +15,7 @@ You usually don't have to set this parameter but you can choose to limit the amo
     
 - **File** 
 
-You can change the file used to store the remeshing hypothesis. see paragraph :ref:`hypothesis-label` for further informations.
+You can change the file used to store remeshing hypotheses. see paragraph :ref:`hypothesis-label` for further informations.
 
 .. image:: images/Generic.png
    :align: center
index d32f6589d1c229db3da82e05c741f2487820f1aa..2841defc71ac18984d9908a447c202d0efe55fbc 100644 (file)
@@ -12,7 +12,7 @@ RSTFILES = lct.rst \
           Generics_params.rst \
           Advanced_params.rst
 
-EXTRA_DIST += $(RSTFILES) images
+EXTRA_DIST += $(RSTFILES) images files
 
 # You can set these variables from the command line.
 SPHINXOPTS    =
index c752c692bbe6e3762bc53ba0df0b76805cfed42b..f657c1d92221d9e3c95db325156b4d5f76a05b75 100644 (file)
@@ -61,7 +61,7 @@ This is the main remeshing Option.  Yams always does quality improvement. It is
 
    - **Mesh for finite element computation : Coarsening** 
 
-     The given surface triangulation is modfied in accordance to a size map. The latter is the intrinsic size map (computed automatically and based on the surface properties, i.e. the local curvatures). One should use this option to coarsen  the mesh, when a regular mesh  for computation purposes is desired, i.e. a mesh with good aspect ratios or good quality elements.
+     The given surface triangulation is modified in accordance to a size map. The latter is the intrinsic size map (computed automatically and based on the surface properties, i.e. the local curvatures). One should use this option to coarsen  the mesh, when a regular mesh  for computation purposes is desired, i.e. a mesh with good aspect ratios or good quality elements.
 
      It is equivalent to Yams's batch option -1.
 
index 414d8ad0da7facd967f452e1eee03f6e6908fd4e..75b8eb76ad778cb6bd0f6cb5431626bf3e815437 100644 (file)
@@ -4,17 +4,23 @@
 How to save Yams Parameters 
 ===========================
 
-As Yams hypothesis are not meshing hypothesis for Salome (but hypothesis for yams), parameters
-are stored in a special file. Default file is $HOME/.yams.dat. It is strongly recommended that you
-change this name if you want to preserve the way you obtain a mesh : This file is never cleaned.
-All sets of parameters are logged in it.
+Yams hypothesis is not meshing hypothesis for Salome, but hypothesis for yams.
+The current set of parameters is automatically written in the salome study object browser when you run computation.
 
+Theses parameters could also be stored in a special file.
+Default file is $HOME/.yams.dat.
+This ASCII file is appended, and never cleaned.
 
-- To save the current setting, click on "Save Params" pushbutton. 
-- A set of parameters is automatically written in the .yams.dat file when you run computation.  
-- Restoring the default settings can be done by pushing "Default Params". 
-- "Loading Params" will reload the last set of parameters
+In frame "Plug-in Generic Options":
 
+- To save the current setting in this file, click on "Save" pushbutton.
+- To load the last set of parameters saved, click on "Load" pushbutton.
+
+At the bottom of the dialog window:
+  
+- To save a current setting in the study object browser, click on "Save" pushbutton.
+- To load a current setting from the study object browser, click on "Load" pushbutton.
+- To load the default setting, click on "Default" pushbutton. .
 
 
 **example of .yams.dat**
@@ -22,39 +28,25 @@ All sets of parameters are logged in it.
 
 .. code-block:: python
 
-   # Save intermediate params
-   # Params for mesh :
-   Optimisation ='Quality improvement Only (0)'
-   Units ='Relative'
-   Chordal_Tolerance_Deviation=1.0
-   Ridge_Detection=True
-   Split_Edge=False
-   Point_Smoothing=True
-   Geometrical_Approximation=0.04
-   Ridge_Angle=45.0
-   Maximum_Size=-2.0
-   Minimum_Size=-2.0
-   Mesh_Gradation=1.3
-   Verbosity=3
-   Memory=0
-   
-   
-   
-   # Params for Hypothese : monHypo_Yams_0
+   # YAMS hypothesis parameters
    # Params for mesh : Mesh_1
-   Optimisation ='Quality improvement Only (0)'
-   Units ='Relative'
-   Chordal_Tolerance_Deviation=1.0
-   Ridge_Detection=True
-   Split_Edge=False
-   Point_Smoothing=True
-   Geometrical_Approximation=0.04
-   Ridge_Angle=45.0
-   Maximum_Size=-2.0
-   Minimum_Size=-2.0
-   Mesh_Gradation=1.3
+   # Date : 23/05/13 14:23:18
+   # Command : yams -v 3 -O 0 -Drelative,tolerance=0.100000,maxsize=0.010000,minsize=0.000000 /tmp/ForYams_1.mesh
+   Optimisation=Quality improvement Only (0)
+   Units=Relative
+   ChordalToleranceDeviation=0.1
+   RidgeDetection=True
+   SplitEdge=False
+   PointSmoothing=True
+   GeometricalApproximation=0.04
+   RidgeAngle=45.0
+   MaximumSize=0.01
+   MinimumSize=0.0
+   MeshGradation=1.3
    Verbosity=3
    Memory=0
+   
+
 
 
 
diff --git a/src/Tools/YamsPlug/doc/files/YamsWhitePaper_3.2.pdf b/src/Tools/YamsPlug/doc/files/YamsWhitePaper_3.2.pdf
new file mode 100644 (file)
index 0000000..f445bba
Binary files /dev/null and b/src/Tools/YamsPlug/doc/files/YamsWhitePaper_3.2.pdf differ
index bd91a1733ac43414722f3cc759219b5f97785634..eb8ee0fb0f8cb28f4a23cb8afc8f21fde0221d7d 100644 (file)
Binary files a/src/Tools/YamsPlug/doc/images/Advanced.png and b/src/Tools/YamsPlug/doc/images/Advanced.png differ
index a18b9ef65155f737a1a9bf28daf5a6cea23dfad8..d3f6fddc6c1e5e5a099093ad494818449e65118f 100644 (file)
Binary files a/src/Tools/YamsPlug/doc/images/AppelYams.png and b/src/Tools/YamsPlug/doc/images/AppelYams.png differ
index fb37ab42c8c26db0c200802be88b2e38a7d2f110..eaabb4c92c223c0d5460ae3645625ffc5ec3025d 100644 (file)
Binary files a/src/Tools/YamsPlug/doc/images/Generic.png and b/src/Tools/YamsPlug/doc/images/Generic.png differ
index 98cf1b9b9f77f7dcb7091154551fa05daa5a8a6e..63f61b4215e234cf03c48d852a6fa3d258f93ec3 100644 (file)
Binary files a/src/Tools/YamsPlug/doc/images/Simple.png and b/src/Tools/YamsPlug/doc/images/Simple.png differ
index 86404463837868ea79cccd0bcf17b8fa4e3c57aa..45442f9aec195a92fbf8259903eff19e67193089 100644 (file)
@@ -11,6 +11,8 @@ Mesh module for remeshing 2D Surface.
 Yams plug-in uses Distene commercial software Yams, which is an **automatic surface remeshing tool**.
 This plug_in offers only the most common functionnalities of the tool.
 
+.. note::
+  for a complete documentation, see :download:`Yams whitepaper <files/YamsWhitePaper_3.2.pdf>`.
 
 Contents:
 
@@ -19,8 +21,8 @@ Contents:
   
    lct.rst
    Mandatory_params.rst
-   Generics_params.rst
    Advanced_params.rst
+   Generics_params.rst
    editHypo.rst
    
    
index 6f3bc515bdf1361bf95ecbe67522be727b295a60..c264926025001748ebd83aa0bf45ad02f200d34a 100644 (file)
@@ -1,7 +1,7 @@
 Running Yams Plug-in 
 =====================
 
-Yamms plug-in can be invoked via SMESH Plugin item in Mesh menu bar 
+Yams plug-in can be invoked via SMESH Plugin item in Mesh menu bar 
 
 .. image:: images/AppelYams.png
    :align: center
index a613f5d6b893708d76e3dc7cff40155ed988c898..ce291033bc4186568c9ee5b1a289d33a889f448a 100644 (file)
@@ -1,4 +1,4 @@
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 # Copyright (C) 2007-2013  EDF R&D
 #
 # This library is free software; you can redistribute it and/or
@@ -28,45 +28,59 @@ from PyQt4.QtCore import *
 
 # Import des panels
 
-# ------------------------------- #
 from ViewText import Ui_ViewExe
-class MonViewText(Ui_ViewExe,QDialog):
-# ------------------------------- #
+
+class MonViewText(Ui_ViewExe, QDialog):
     """
     Classe permettant la visualisation de texte
     """
-    def __init__(self,parent,txt):
+    def __init__(self, parent, txt):
         QDialog.__init__(self,parent)
-        self.pere=parent
         self.setupUi(self)
-        self.resize( QSize(600,600).expandedTo(self.minimumSizeHint()) )
-        self.connect( self.PB_Ok,SIGNAL("clicked()"), self, SLOT("close()") )
+        self.resize( QSize(1000,600).expandedTo(self.minimumSizeHint()) )
+        #self.connect( self.PB_Ok,SIGNAL("clicked()"), self, SLOT("close()") )
+        self.connect( self.PB_Ok,SIGNAL("clicked()"), self.theClose )
         self.connect( self.PB_Save,SIGNAL("clicked()"), self.saveFile )
         self.monExe=QProcess(self)
 
-
         self.connect(self.monExe, SIGNAL("readyReadStandardOutput()"), self.readFromStdOut )
         self.connect(self.monExe, SIGNAL("readyReadStandardError()"), self.readFromStdErr )
-        self.connect(self.monExe, SIGNAL("finished(int  )"), self.exeFinished )
       
         # Je n arrive pas a utiliser le setEnvironment du QProcess
         # fonctionne hors Salome mais pas dans Salome ???
-        LICENCE=os.environ['DISTENE_LICENCE_FILE_FOR_YAMS']
-        txt='export DISTENE_LICENSE_FILE='+LICENCE+';'+ txt
+        cmds=''
+        try :
+          LICENCE_FILE=os.environ["DISTENE_LICENCE_FILE_FOR_YAMS"]
+        except:
+          LICENCE_FILE=''
+        try :
+          PATH=os.environ["DISTENE_PATH_FOR_YAMS"]
+        except:
+          PATH=''
+        if LICENCE_FILE != '': 
+          cmds+='source '+LICENCE_FILE+'\n'
+        else:
+          cmds+="# $DISTENE_LICENCE_FILE_FOR_YAMS NOT SET\n"
+        if PATH != '': 
+          cmds+='export PATH='+PATH+':$PATH\n'
+        else:
+          cmds+="# $DISTENE_PATH_FOR_YAMS NOT SET\n"
+        #cmds+='env\n'
+        cmds+='rm -f '+self.parent().fichierOut+'\n'
+        cmds+=txt+'\n'
+        cmds+='echo END_OF_Yams\n'
         pid=self.monExe.pid()
-        nomFichier='/tmp/yam_'+str(pid)+'.py'
+        nomFichier='/tmp/Yams_'+str(pid)+'.sh'
         f=open(nomFichier,'w')
-        f.write(txt)
+        f.write(cmds)
         f.close()
 
         maBidouille='sh  ' + nomFichier
         self.monExe.start(maBidouille)
         self.monExe.closeWriteChannel()
+        self.enregistreResultatsDone=False
         self.show()
 
-    def exeFinished(self):
-        self.pere.enregistreResultat()
-        
     def saveFile(self):
         #recuperation du nom du fichier
         savedir=os.environ['HOME']
@@ -84,8 +98,19 @@ class MonViewText(Ui_ViewExe,QDialog):
 
     def readFromStdErr(self):
         a=self.monExe.readAllStandardError()
-        self.TB_Exe.append(QString.fromUtf8(a.data(),len(a))) ;
+        self.TB_Exe.append(QString.fromUtf8(a.data(),len(a)))
 
     def readFromStdOut(self) :
         a=self.monExe.readAllStandardOutput()
-        self.TB_Exe.append(QString.fromUtf8(a.data(),len(a))) ;
+        aa=QString.fromUtf8(a.data(),len(a))
+        self.TB_Exe.append(aa)
+        if "END_OF_Yams" in aa:
+          self.parent().enregistreResultat()
+          self.enregistreResultatsDone=True
+          #self.theClose()
+    
+    def theClose(self):
+      if not self.enregistreResultatsDone:
+        self.parent().enregistreResultat()
+        self.enregistreResultatsDone=True
+      self.close()
index 1e9c32fc966e03a5881149460b451c3c4b509141..6e6088c11fc9cc86b7f575dcac512bc86764747d 100644 (file)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# Copyright (C) 2007-2013   EDF R&D
+# Copyright (C) 2007-2013  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
@@ -17,6 +17,7 @@
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # Modules Python
 # Modules Eficas
 
@@ -31,275 +32,463 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
   """
   """
   def __init__(self):
-        QWidget.__init__(self)
-        self.setupUi(self)
-        self.connecterSignaux()
-        self.fichierIn=""
-        self.fichierOut=""
-        self.MeshIn="" 
-        self.num=1
-
-#      Ces parametres ne sont pas remis à rien par le clean
-        self.paramsFile= os.path.abspath(os.path.join(os.environ['HOME'],'.yams.dat'))
-        self.LE_ParamsFile.setText(self.paramsFile)
-        self.LE_MeshFile.setText("")
-        self.LE_MeshSmesh.setText("")
+    QWidget.__init__(self)
+    self.setupUi(self)
+    self.connecterSignaux()
+    self.fichierIn=""
+    self.fichierOut=""
+    self.MeshIn=""
+    self.commande=""
+    self.num=1
+    self.__selectedMesh=None
+
+    # complex whith QResources: not used
+    # The icon are supposed to be located in the $SMESH_ROOT_DIR/share/salome/resources/smesh folder,
+    # other solution could be in the same folder than this python module file:
+    # iconfolder=os.path.dirname(os.path.abspath(__file__))
+
+    self.iconfolder=os.environ["SMESH_ROOT_DIR"]+"/share/salome/resources/smesh"
+    #print "monYamsPlugDialog iconfolder",iconfolder
+    icon = QIcon()
+    icon.addFile(os.path.join(self.iconfolder,"select1.png"))
+    self.PB_LoadHyp.setIcon(icon)
+    self.PB_LoadHyp.setToolTip("hypothesis from Salome Object Browser")
+    self.PB_SaveHyp.setIcon(icon)
+    self.PB_SaveHyp.setToolTip("hypothesis to Salome Object Browser")
+    self.PB_MeshSmesh.setIcon(icon)
+    self.PB_MeshSmesh.setToolTip("source mesh from Salome Object Browser")
+    icon = QIcon()
+    icon.addFile(os.path.join(self.iconfolder,"open.png"))
+    self.PB_ParamsFileExplorer.setIcon(icon)
+    self.PB_Load.setIcon(icon)
+    self.PB_Load.setToolTip("hypothesis from file")
+    self.PB_Save.setIcon(icon)
+    self.PB_Save.setToolTip("hypothesis to file")
+    self.PB_MeshFile.setIcon(icon)
+    self.PB_MeshFile.setToolTip("source mesh from a file in disk")
+
+    #Ces parametres ne sont pas remis à rien par le clean
+    self.paramsFile= os.path.abspath(os.path.join(os.environ["HOME"],".yams.dat"))
+    self.LE_ParamsFile.setText(self.paramsFile)
+    self.LE_MeshFile.setText("")
+    self.LE_MeshSmesh.setText("")
+    
+    v1=QDoubleValidator(self)
+    v1.setBottom(0.)
+    #v1.setTop(1000.) #per thousand... only if relative
+    v1.setDecimals(2)
+    self.SP_Tolerance.setValidator(v1)
+    self.SP_Tolerance.titleForWarning="Chordal Tolerance"
+    
+    self.resize(800, 600)
+    self.clean()
 
   def connecterSignaux(self) :
-        self.connect(self.PB_Cancel,SIGNAL("clicked()"),self.PBCancelPressed)
-        self.connect(self.PB_Default,SIGNAL("clicked()"),self.clean)
-        self.connect(self.PB_Help,SIGNAL("clicked()"),self.PBHelpPressed)
-        self.connect(self.PB_Load,SIGNAL("clicked()"),self.PBLoadPressed)
-        self.connect(self.PB_OK,SIGNAL("clicked()"),self.PBOKPressed)
-        self.connect(self.PB_Save,SIGNAL("clicked()"),self.PBSavePressed)
-        self.connect(self.PB_MeshFile,SIGNAL("clicked()"),self.PBMeshFilePressed)
-        self.connect(self.PB_MeshSmesh,SIGNAL("clicked()"),self.PBMeshSmeshPressed)
-        self.connect(self.PB_ParamsFileExplorer,SIGNAL("clicked()"),self.setParamsFileName)
-        self.connect(self.LE_MeshFile,SIGNAL("returnPressed()"),self.meshFileNameChanged)
-        self.connect(self.LE_ParamsFile,SIGNAL("returnPressed()"),self.paramsFileNameChanged)
-
+    self.connect(self.PB_Cancel,SIGNAL("clicked()"),self.PBCancelPressed)
+    self.connect(self.PB_Default,SIGNAL("clicked()"),self.clean)
+    self.connect(self.PB_Help,SIGNAL("clicked()"),self.PBHelpPressed)
+    self.connect(self.PB_OK,SIGNAL("clicked()"),self.PBOKPressed)
+    
+    self.connect(self.PB_Load,SIGNAL("clicked()"),self.PBLoadPressed)
+    self.connect(self.PB_Save,SIGNAL("clicked()"),self.PBSavePressed)
+    self.connect(self.PB_LoadHyp,SIGNAL("clicked()"),self.PBLoadHypPressed)
+    self.connect(self.PB_SaveHyp,SIGNAL("clicked()"),self.PBSaveHypPressed)
+    
+    self.connect(self.PB_MeshFile,SIGNAL("clicked()"),self.PBMeshFilePressed)
+    self.connect(self.PB_MeshSmesh,SIGNAL("clicked()"),self.PBMeshSmeshPressed)
+    self.connect(self.LE_MeshSmesh,SIGNAL("returnPressed()"),self.meshSmeshNameChanged)
+    self.connect(self.PB_ParamsFileExplorer,SIGNAL("clicked()"),self.setParamsFileName)
+    self.connect(self.LE_MeshFile,SIGNAL("returnPressed()"),self.meshFileNameChanged)
+    self.connect(self.LE_ParamsFile,SIGNAL("returnPressed()"),self.paramsFileNameChanged)
 
   def PBHelpPressed(self):
-        try :
-          maDoc=os.environ['DISTENE_YAMS_DOC_PDF']
-        except Exception:
-          QMessageBox.warning( self, "Help unavailable", str(maDoc) + " not found")
-        command="xdg-open "+maDoc+";"
-       subprocess.call(command, shell=True)
-
+    try :
+      mydir=os.environ["SMESH_ROOT_DIR"]
+    except Exception:
+      QMessageBox.warning(self, "Help", "Help unavailable $SMESH_ROOT_DIR not found")
+      return
+    maDoc=mydir+"/share/doc/salome/gui/SMESH/yams/_downloads/YamsWhitePaper_3.2.pdf"
+    command="xdg-open "+maDoc+";"
+    subprocess.call(command, shell=True)
 
   def PBOKPressed(self):
-        if not(self.PrepareLigneCommande()) : return
-        self.PBSavePressed(NomHypo=True)
-        maFenetre=MonViewText(self,self.commande)
+    if not(self.PrepareLigneCommande()):
+      #warning done yet
+      #QMessageBox.warning(self, "Compute", "Command not found")
+      return
+    maFenetre=MonViewText(self,self.commande)
 
   def enregistreResultat(self):
-        if not(os.path.isfile(self.fichierOut)) : return
-        import smesh
-        import SMESH
-        import salome
-        from salome.kernel import studyedit
-
-        maStudy=studyedit.getActiveStudy()
-        smesh.SetCurrentStudy(maStudy)
-        (outputMesh, status) = smesh.CreateMeshesFromGMF(self.fichierOut)
-        meshname = 'yams'+str(self.num)
-        smesh.SetName(outputMesh.GetMesh(), meshname)
-        outputMesh.Compute()
-
-
-        self.editor = studyedit.getStudyEditor()    # 
-        moduleEntry=self.editor.findOrCreateComponent("SMESH","SMESH")
-        HypReMeshEntry = self.editor.findOrCreateItem( moduleEntry, name = 'HypoForRemesh',
-                                           comment = 'HypoForRemshing')
-        monStudyBuilder=maStudy.NewBuilder();
-        monStudyBuilder.NewCommand();
-        newStudyIter=monStudyBuilder.NewObject(HypReMeshEntry)
-        aNameAttrib=monStudyBuilder.FindOrCreateAttribute(newStudyIter,"AttributeName")
-        hypoName = 'monHypo_Yams_'+str(self.num)
-        aNameAttrib.SetValue(hypoName)
-        aCommentAttrib=monStudyBuilder.FindOrCreateAttribute(newStudyIter,"AttributeComment")
-        aCommentAttrib.SetValue(str(self.commande))
-        
-        SOMesh=maStudy.FindObjectByName(meshname ,"SMESH")[0]
-        newLink=monStudyBuilder.NewObject(SOMesh)
-        monStudyBuilder.Addreference(newLink, newStudyIter);
-        if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(0)
-        self.num+=1
-        return True
+    import smesh
+    import SMESH
+    import salome
+    from salome.kernel import studyedit
+
+    if not os.path.isfile(self.fichierOut):
+      QMessageBox.warning(self, "Compute", "Result file "+self.fichierOut+" not found")
+
+    maStudy=studyedit.getActiveStudy()
+    smesh.SetCurrentStudy(maStudy)
+    (outputMesh, status) = smesh.CreateMeshesFromGMF(self.fichierOut)
+    name=str(self.LE_MeshSmesh.text())
+    initialMeshFile=None
+    initialMeshObject=None
+    if name=="":
+      a=str(self.fichierIn)
+      name=os.path.basename(os.path.splitext(a)[0])
+      initialMeshFile=a
+    else:
+      initialMeshObject=maStudy.FindObjectByName(name ,"SMESH")[0]
+
+    meshname = name+"_YAMS_"+str(self.num)
+    smesh.SetName(outputMesh.GetMesh(), meshname)
+    outputMesh.Compute() #no algorithms message for "Mesh_x" has been computed with warnings: -  global 1D algorithm is missing
+
+    self.editor = studyedit.getStudyEditor()    # 
+    moduleEntry=self.editor.findOrCreateComponent("SMESH","SMESH")
+    HypReMeshEntry = self.editor.findOrCreateItem(
+        moduleEntry, name = "Plugins Hypotheses", icon="mesh_tree_hypo.png") #, comment = "HypoForRemeshing" )
+
+    monStudyBuilder=maStudy.NewBuilder()
+    monStudyBuilder.NewCommand()
+    newStudyIter=monStudyBuilder.NewObject(HypReMeshEntry)
+    self.editor.setAttributeValue(newStudyIter, "AttributeName", "YAMS Parameters_"+str(self.num))
+    self.editor.setAttributeValue(newStudyIter, "AttributeComment", self.getResumeData(separator=" ; "))
+    
+    SOMesh=maStudy.FindObjectByName(meshname ,"SMESH")[0]
+    
+    if initialMeshFile!=None:
+      newStudyFileName=monStudyBuilder.NewObject(SOMesh)
+      self.editor.setAttributeValue(newStudyFileName, "AttributeName", "meshFile")
+      self.editor.setAttributeValue(newStudyFileName, "AttributeExternalFileDef", initialMeshFile)
+      self.editor.setAttributeValue(newStudyFileName, "AttributeComment", initialMeshFile)
+
+    if initialMeshObject!=None:
+      newLink=monStudyBuilder.NewObject(SOMesh)
+      monStudyBuilder.Addreference(newLink, initialMeshObject)
+
+    newLink=monStudyBuilder.NewObject(SOMesh)
+    monStudyBuilder.Addreference(newLink, newStudyIter)
+
+    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(0)
+    self.num+=1
+    return True
 
   def PBSavePressed(self,NomHypo=False):
-        if NomHypo : text = '# Params for Hypothese : monHypo_Yams_'+str(self.num - 1)+"\n"
-        else :       text = '# Save intermediate params \n' 
-        text += "# Params for mesh : " +  self.LE_MeshSmesh.text() +'\n'
-        for RB in self.GBOptim.findChildren(QRadioButton,):
-            if RB.isChecked()==True:
-               text+="Optimisation ='"+RB.text()+"'\n"
-               break
-        for RB in self.GBUnit.findChildren(QRadioButton,):
-            if RB.isChecked()==True:
-               text+="Units ='"+RB.text()+"'\n"
-        text+='Chordal_Tolerance_Deviation='+str(self.SP_Tolerance.value())+'\n'
-
-        text+='Ridge_Detection=' + str(self.CB_Ridge.isChecked())+'\n'
-        text+='Split_Edge='      + str(self.CB_SplitEdge.isChecked())+'\n'
-        text+='Point_Smoothing=' + str(self.CB_Point.isChecked())+'\n'
-        text+='Geometrical_Approximation='+ str(self.SP_Geomapp.value())  +'\n'
-        text+='Ridge_Angle='              + str(self.SP_Ridge.value())    +'\n'
-        text+='Maximum_Size='             + str(self.SP_MaxSize.value())  +'\n'
-        text+='Minimum_Size='             + str(self.SP_MaxSize.value())  +'\n'
-        text+='Mesh_Gradation='           + str(self.SP_Gradation.value())+'\n'
-
-        text+='Verbosity='                + str(self.SP_Verbosity.value())+'\n'
-        text+='Memory='                   + str(self.SP_Memory.value())+'\n'
-        text+='\n\n'
-
-        try :
-           f=open(self.paramsFile,'a')
-        except :
-           QMessageBox.warning( self, "File", "Unable to open "+self.paramsFile)
-           return
-        try :
-           f.write(text)
-        except :
-           QMessageBox.warning( self, "File", "Unable to write "+self.paramsFile)
-           return
-        f.close()
+    from datetime import datetime
+    if not(self.PrepareLigneCommande()): return
+    text = "# YAMS hypothesis parameters\n" 
+    text += "# Params for mesh : " +  self.LE_MeshSmesh.text() +"\n"
+    text += datetime.now().strftime("# Date : %d/%m/%y %H:%M:%S\n")
+    text += "# Command : "+self.commande+"\n"
+    text += self.getResumeData(separator="\n")
+    text += "\n\n"
+
+    try:
+      f=open(self.paramsFile,"a")
+    except:
+      QMessageBox.warning(self, "File", "Unable to open "+self.paramsFile)
+      return
+    try:
+      f.write(text)
+    except:
+      QMessageBox.warning(self, "File", "Unable to write "+self.paramsFile)
+      return
+    f.close()
+
+  def PBSaveHypPressed(self):
+    """save hypothesis in Object Browser"""
+    #QMessageBox.warning(self, "save Object Browser YAMS Hypothesis", "TODO")
+    
+    import smesh
+    import SMESH
+    import salome
+    from salome.kernel import studyedit
+
+    maStudy=studyedit.getActiveStudy()
+    smesh.SetCurrentStudy(maStudy)
+    
+    self.editor = studyedit.getStudyEditor()
+    moduleEntry=self.editor.findOrCreateComponent("SMESH","SMESH")
+    HypReMeshEntry = self.editor.findOrCreateItem(
+        moduleEntry, name = "Plugins Hypotheses", icon="mesh_tree_hypo.png") #, comment = "HypoForRemeshing" )
+    
+    monStudyBuilder=maStudy.NewBuilder()
+    monStudyBuilder.NewCommand()
+    newStudyIter=monStudyBuilder.NewObject(HypReMeshEntry)
+    self.editor.setAttributeValue(newStudyIter, "AttributeName", "YAMS Parameters_"+str(self.num))
+    self.editor.setAttributeValue(newStudyIter, "AttributeComment", self.getResumeData(separator=" ; "))
+    
+    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(0)
+    self.num+=1
+    return True
+
+  def SP_toStr(self, widget):
+    """only for a QLineEdit widget"""
+    #cr, pos=widget.validator().validate(res, 0) #n.b. "1,3" is acceptable !locale!
+    try:
+      val=float(widget.text())
+    except:
+      QMessageBox.warning(self, widget.titleForWarning, "float value is incorrect: '"+widget.text()+"'")
+      res=str(widget.validator().bottom())
+      widget.setProperty("text", res)
+      return res
+    valtest=widget.validator().bottom()
+    if valtest!=None:
+      if val<valtest:
+        QMessageBox.warning(self, widget.titleForWarning, "float value is under minimum: "+str(val)+" < "+str(valtest))
+        res=str(valtest)
+        widget.setProperty("text", res)
+        return res
+    valtest=widget.validator().top()
+    if valtest!=None:
+      if val>valtest:
+        QMessageBox.warning(self, widget.titleForWarning, "float value is over maximum: "+str(val)+" > "+str(valtest))
+        res=str(valtest)
+        widget.setProperty("text", res)
+        return res    
+    return str(val)
+
+  def getResumeData(self, separator="\n"):
+    text=""
+    for RB in self.GBOptim.findChildren(QRadioButton,):
+      if RB.isChecked()==True:
+        text+="Optimisation="+RB.text()+separator
+        break
+    if self.RB_Absolute.isChecked():
+      text+="Units=absolute"+separator
+    else:
+      text+="Units=relative"+separator
+    v=self.SP_toStr(self.SP_Tolerance)
+    text+="ChordalToleranceDeviation="+v+separator
+    text+="RidgeDetection="+str(self.CB_Ridge.isChecked())+separator
+    text+="SplitEdge="+str(self.CB_SplitEdge.isChecked())+separator
+    text+="PointSmoothing="+str(self.CB_Point.isChecked())+separator
+    text+="GeometricalApproximation="+str(self.SP_Geomapp.value())+separator
+    text+="RidgeAngle="+str(self.SP_Ridge.value())+separator
+    text+="MaximumSize="+str(self.SP_MaxSize.value())+separator
+    text+="MinimumSize="+str(self.SP_MinSize.value())+separator
+    text+="MeshGradation="+str(self.SP_Gradation.value())+separator
+    text+="Verbosity="+str(self.SP_Verbosity.value())+separator
+    text+="Memory="+str(self.SP_Memory.value())+separator
+    return str(text)
+
+  def loadResumeData(self, hypothesis, separator="\n"):
+    text=str(hypothesis)
+    self.clean()
+    for slig in reversed(text.split(separator)):
+      lig=slig.strip()
+      #print "load ResumeData",lig
+      if lig=="": continue #skip blanck lines
+      if lig[0]=="#": break
+      try:
+        tit,value=lig.split("=")
+        if tit=="Optimisation":
+          for RB in self.GBUnit.findChildren(QRadioButton,):
+            RB.setChecked(False)
+          for RB in self.GBUnit.findChildren(QRadioButton,):
+            if RB.text()==value :
+              RB.setChecked(True)
+              break
+        if tit=="Units":
+          if value=="absolute":
+            self.RB_Absolute.setChecked(True)
+            self.RB_Relative.setChecked(False)
+          else:
+            self.RB_Absolute.setChecked(False)
+            self.RB_Relative.setChecked(True)
+        if tit=="ChordalToleranceDeviation": self.SP_Tolerance.setProperty("text", float(value))
+        if tit=="RidgeDetection": self.CB_Ridge.setChecked(value=="True")
+        if tit=="SplitEdge": self.CB_SplitEdge.setChecked(value=="True")
+        if tit=="PointSmoothing": self.CB_Point.setChecked(value=="True")
+        if tit=="GeometricalApproximation": self.SP_Geomapp.setProperty("value", float(value))
+        if tit=="RidgeAngle": self.SP_Ridge.setProperty("value", float(value))
+        if tit=="MaximumSize": self.SP_MaxSize.setProperty("value", float(value))
+        if tit=="MinimumSize": self.SP_MinSize.setProperty("value", float(value))
+        if tit=="MeshGradation": self.SP_Gradation.setProperty("value", float(value))
+        if tit=="Verbosity": self.SP_Verbosity.setProperty("value", int(float(value)))
+        if tit=="Memory": self.SP_Memory.setProperty("value", float(value))
+      except:
+        QMessageBox.warning(self, "load YAMS Hypothesis", "Problem on '"+lig+"'")
 
   def PBLoadPressed(self):
-        try :
-           f=open(self.paramsFile,'r')
-        except :
-           QMessageBox.warning( self, "File", "Unable to open "+self.paramsFile)
-           return
-        try :
-           text=f.read()
-        except :
-           QMessageBox.warning( self, "File", "Unable to read "+self.paramsFile)
-           return
-        f.close()
-        d={}
-        exec text in d
-        for RB in self.GBOptim.findChildren(QRadioButton,):
-            if d['Optimisation']== RB.text():
-               RB.setChecked(True)
-               break
-        for RB in self.GBUnit.findChildren(QRadioButton,):
-            if d['Units']== RB.text():
-               RB.setChecked(True)
-               break
-        self.SP_Tolerance.setValue(d['Chordal_Tolerance_Deviation'])
-
-        self.CB_Ridge.setChecked(d['Ridge_Detection'])
-        self.CB_Point.setChecked(d['Point_Smoothing'])
-        self.CB_SplitEdge.setChecked(d['Split_Edge'])
-        self.SP_Geomapp.setValue(d['Geometrical_Approximation'])
-        self.SP_Ridge.setValue(d['Ridge_Angle'])
-        self.SP_MaxSize.setValue(d['Maximum_Size'])
-        self.SP_MinSize.setValue(d['Minimum_Size'])
-        self.SP_Gradation.setValue(d['Mesh_Gradation'])
-
-        self.SP_Verbosity.setValue(d['Verbosity'])
-        self.SP_Memory.setValue(d['Memory'])
-
-
+    """load last hypothesis saved in tail of file"""
+    try:
+      f=open(self.paramsFile,"r")
+    except:
+      QMessageBox.warning(self, "File", "Unable to open "+self.paramsFile)
+      return
+    try:
+      text=f.read()
+    except:
+      QMessageBox.warning(self, "File", "Unable to read "+self.paramsFile)
+      return
+    f.close()
+    self.loadResumeData(text, separator="\n")
+
+  def PBLoadHypPressed(self):
+    """load hypothesis saved in Object Browser"""
+    #QMessageBox.warning(self, "load Object Browser YAMS hypothesis", "TODO")
+    import salome
+    from salome.kernel import studyedit
+    from salome.smesh.smeshstudytools import SMeshStudyTools
+    from salome.gui import helper as guihelper
+    from omniORB import CORBA
+
+    mySObject, myEntry = guihelper.getSObjectSelected()
+    if CORBA.is_nil(mySObject) or mySObject==None:
+      QMessageBox.critical(self, "Hypothese", "select an Object Browser YAMS hypothesis")
+      return
+    
+    text=mySObject.GetComment()
+    
+    #a verification
+    if "Optimisation=" not in text:
+      QMessageBox.critical(self, "Load Hypothese", "Object Browser selection not a YAMS Hypothesis")
+      return
+    self.loadResumeData(text, separator=" ; ")
+    return
+    
   def PBCancelPressed(self):
-        self.close()
+    self.close()
 
   def PBMeshFilePressed(self):
-       fd = QFileDialog(self, "select an existing Mesh file", self.LE_MeshFile.text(), "Mesh-Files (*.mesh);;All Files (*)")
-       if fd.exec_():
-          infile = fd.selectedFiles()[0]
-          self.LE_MeshFile.setText(infile)
-          self.fichierIn=infile.toLatin1()
+    fd = QFileDialog(self, "select an existing Mesh file", self.LE_MeshFile.text(), "Mesh-Files (*.mesh);;All Files (*)")
+    if fd.exec_():
+      infile = fd.selectedFiles()[0]
+      self.LE_MeshFile.setText(infile)
+      self.fichierIn=infile.toLatin1()
+      self.MeshIn=""
+      self.LE_MeshSmesh.setText("")
 
   def setParamsFileName(self):
-       fd = QFileDialog(self, "select a file", self.LE_ParamsFile.text(), "dat Files (*.dat);;All Files (*)")
-       if fd.exec_():
-          infile = fd.selectedFiles()[0]
-          self.LE_ParamsFile.setText(infile)
-          self.paramsFile=infile.toLatin1()
-
+    fd = QFileDialog(self, "select a file", self.LE_ParamsFile.text(), "dat Files (*.dat);;All Files (*)")
+    if fd.exec_():
+      infile = fd.selectedFiles()[0]
+      self.LE_ParamsFile.setText(infile)
+      self.paramsFile=infile.toLatin1()
 
   def meshFileNameChanged(self):
-      self.fichierIn=self.LE_MeshFile.text()
-      if os.path.exists(self.fichierIn): return
-      QMessageBox.warning( self, "Unknown File", "File doesn't exist")
+    self.fichierIn=str(self.LE_MeshFile.text())
+    #print "meshFileNameChanged", self.fichierIn
+    if os.path.exists(self.fichierIn): 
+      self.__selectedMesh=None
+      self.MeshIn=""
+      self.LE_MeshSmesh.setText("")
+      return
+    QMessageBox.warning(self, "Mesh file", "File doesn't exist")
+
+  def meshSmeshNameChanged(self):
+    """only change by GUI mouse selection, otherwise clear"""
+    self.__selectedMesh = None
+    self.MeshIn=""
+    self.LE_MeshSmesh.setText("")
+    self.fichierIn=""
+    return
 
   def paramsFileNameChanged(self):
-      self.paramsFile=self.LE_ParamsFile.text()
+    self.paramsFile=self.LE_ParamsFile.text()
 
   def PBMeshSmeshPressed(self):
-      import salome
-      import smesh
-      from salome.kernel import studyedit
-      from salome.smesh.smeshstudytools import SMeshStudyTools
-      from salome.gui import helper as guihelper
-      from omniORB import CORBA
-
-      mySObject, myEntry = guihelper.getSObjectSelected()
-      if CORBA.is_nil(mySObject) or mySObject==None:
-         QMessageBox.critical(self, "Mesh", "select an input mesh")
-         return
-      self.smeshStudyTool = SMeshStudyTools()
+    import salome
+    import smesh
+    from salome.kernel import studyedit
+    from salome.smesh.smeshstudytools import SMeshStudyTools
+    from salome.gui import helper as guihelper
+    from omniORB import CORBA
+
+    mySObject, myEntry = guihelper.getSObjectSelected()
+    if CORBA.is_nil(mySObject) or mySObject==None:
+      QMessageBox.critical(self, "Mesh", "select an input mesh")
+      return
+    self.smeshStudyTool = SMeshStudyTools()
+    try:
       self.__selectedMesh = self.smeshStudyTool.getMeshObjectFromSObject(mySObject)
-      if CORBA.is_nil(self.__selectedMesh):
-         QMessageBox.critical(self, "Mesh", "select an input mesh")
-         return
-      myName = mySObject.GetName()
-      self.MeshIn=myName
-      self.LE_MeshSmesh.setText(myName)
+    except:
+      QMessageBox.critical(self, "Mesh", "select an input mesh")
+      return
+    if CORBA.is_nil(self.__selectedMesh):
+      QMessageBox.critical(self, "Mesh", "select an input mesh")
+      return
+    myName = mySObject.GetName()
+    #print "MeshSmeshNameChanged", myName
+    self.MeshIn=myName
+    self.LE_MeshSmesh.setText(myName)
+    self.LE_MeshFile.setText("")
+    self.fichierIn=""
 
   def prepareFichier(self):
-      self.fichierIn="/tmp/PourYam_"+str(self.num)+".mesh"
-      import SMESH
-      self.__selectedMesh.ExportGMF(self.__selectedMesh,self.fichierIn, True)
+    self.fichierIn="/tmp/ForYams_"+str(self.num)+".mesh"
+    import SMESH
+    self.__selectedMesh.ExportGMF(self.__selectedMesh, self.fichierIn, True)
 
   def PrepareLigneCommande(self):
-      self.commande="yams "
-      verbosity=str(self.SP_Verbosity.value())
-      self.commande+="-v "+verbosity
-      for obj in self.mesRB.children():
-          try :
-           if obj.isChecked():
-              self.style=obj.objectName().remove(0,3)
-              self.style.replace("_","-")
-              break
-          except :
-              pass
-      self.commande+=" -O "+self.style.toLatin1()
-      if self.fichierIn=="" and self.MeshIn=="" :
-         QMessageBox.critical(self, "Mesh", "select an input mesh")
-         return False
-      if self.MeshIn!="" : self.prepareFichier()
-      if not (os.path.isfile(self.fichierIn)):
-         QMessageBox.critical(self, "File", "unable to read GMF Mesh in "+str(self.fichierIn))
-         return False
-
-      deb=os.path.splitext(self.fichierIn)
-      self.fichierOut=deb[0]+'.d.meshb'
-
-      if self.RB_Absolute.isChecked()==True :
-         self.commande+=' -Dabsolute'
-      else :
-         self.commande+=' -Drelative'
-      self.commande+=',tolerance=%f'%self.SP_Tolerance.value()
-      if self.CB_Ridge.isChecked()==False : self.commande+=',-nr'
-      if self.CB_Point.isChecked()==False : self.commande+=',-ns'
-      if self.SP_Geomapp.value()!=0.04 : self.commande+=',geomapp=%f'%self.SP_Geomapp.value()
-      if self.SP_Ridge.value()!=45.0 : self.commande+=',ridge=%f'%self.SP_Ridge.value()
-      if self.SP_MaxSize.value()!=100 : self.commande+=',maxsize=%f'%self.SP_MaxSize.value()
-      if self.SP_MinSize.value()!=5 : self.commande+=',minsize=%f'%self.SP_MinSize.value()
-      if self.SP_Gradation.value()!=1.3 : self.commande+=',gradation=%f'%self.SP_MaxSize.value()
-      if self.CB_SplitEdge.isChecked()==True : self.commande+=',splitedge=1'
-
-      if self.SP_Verbosity.value()!=3 : self.commande+=' -v %d'%self.SP_Verbosity.value()
-      if self.SP_Memory.value()!=0 : self.commande+=' -m %d'%self.SP_Memory.value()
-
-      self.commande+=" "+self.fichierIn
-      return True
+    if self.fichierIn=="" and self.MeshIn=="":
+      QMessageBox.critical(self, "Mesh", "select an input mesh")
+      return False
+    if self.__selectedMesh!=None: self.prepareFichier()
+    if not (os.path.isfile(self.fichierIn)):
+      QMessageBox.critical(self, "File", "unable to read GMF Mesh in "+str(self.fichierIn))
+      return False
+    
+    self.commande="yams"
+    verbosity=str(self.SP_Verbosity.value())
+    self.commande+=" -v "+verbosity
+    for obj in self.GBOptim.findChildren(QRadioButton,):
+      try:
+        if obj.isChecked():
+          self.style=obj.objectName().remove(0,3)
+          self.style.replace("_","-")
+          break
+      except:
+        pass
+    self.commande+=" -O "+self.style.toLatin1()
+
+    deb=os.path.splitext(self.fichierIn)
+    self.fichierOut=deb[0] + ".d.meshb"
+
+    if self.RB_Absolute.isChecked()==True :
+        self.commande+=" -Dabsolute"
+    else :
+        self.commande+=" -Drelative"
+    
+    v=self.SP_toStr(self.SP_Tolerance)
+    self.commande+=",tolerance="+v
+    if self.CB_Ridge.isChecked()==False : self.commande+=",-nr"
+    if self.CB_Point.isChecked()==False : self.commande+=",-ns"
+    if self.SP_Geomapp.value()!=0.04 : self.commande+=",geomapp=%f"%self.SP_Geomapp.value()
+    if self.SP_Ridge.value()!=45.0 : self.commande+=",ridge=%f"%self.SP_Ridge.value()
+    if self.SP_MaxSize.value()!=100 : self.commande+=",maxsize=%f"%self.SP_MaxSize.value()
+    if self.SP_MinSize.value()!=5 : self.commande+=",minsize=%f"%self.SP_MinSize.value()
+    if self.SP_Gradation.value()!=1.3 : self.commande+=",gradation=%f"%self.SP_MaxSize.value()
+    if self.CB_SplitEdge.isChecked()==True : self.commande+=",splitedge=1"
+
+    if self.SP_Verbosity.value()!=3 : self.commande+=" -v %d"%self.SP_Verbosity.value()
+    if self.SP_Memory.value()!=0 : self.commande+=" -m %d"%self.SP_Memory.value()
+
+    self.commande+=" "+self.fichierIn
+    return True
 
   def clean(self):
-        self.RB_0.setChecked(True)
-        self.RB_G.setChecked(False)
-        self.RB_U.setChecked(False)
-        self.RB_S.setChecked(False)
-        self.RB_2.setChecked(False)
-        self.RB_1.setChecked(False)
-        self.RB_Absolute.setChecked(False)
-        self.RB_Relative.setChecked(True)
-        self.SP_Tolerance.setProperty("value", 0.1)
-        self.SP_Geomapp.setProperty("value", 0.04)
-        self.SP_Ridge.setProperty("value", 45.0)
-        self.SP_Gradation.setProperty("value", 1.3)
-        self.CB_Ridge.setChecked(True)
-        self.CB_Point.setChecked(True)
-        self.CB_SplitEdge.setChecked(False)
-        self.SP_MaxSize.setProperty("value", -2.0)
-        self.SP_MinSize.setProperty("value", -2.0)
-        self.SP_Verbosity.setProperty("value", 3)
-        self.SP_Memory.setProperty("value", 0)
-
+    self.RB_0.setChecked(True)
+    self.RB_G.setChecked(False)
+    self.RB_U.setChecked(False)
+    self.RB_S.setChecked(False)
+    self.RB_2.setChecked(False)
+    self.RB_1.setChecked(False)
+    self.RB_Absolute.setChecked(False)
+    self.RB_Relative.setChecked(True)
+    self.SP_Tolerance.setProperty("text", "10.")
+    self.SP_Geomapp.setProperty("value", 0.04)
+    self.SP_Ridge.setProperty("value", 45.0)
+    self.SP_Gradation.setProperty("value", 1.3)
+    self.CB_Ridge.setChecked(True)
+    self.CB_Point.setChecked(True)
+    self.CB_SplitEdge.setChecked(False)
+    self.SP_MaxSize.setProperty("value", -2.0)
+    self.SP_MinSize.setProperty("value", -2.0)
+    self.SP_Verbosity.setProperty("value", 3)
+    self.SP_Memory.setProperty("value", 0)
 
 __dialog=None
 def getDialog():
@@ -314,3 +503,23 @@ def getDialog():
     #   __dialog.clean()
     return __dialog
 
+#
+# ==============================================================================
+# Basic use cases and unit test functions
+# ==============================================================================
+#
+def TEST_MonYamsPlugDialog():
+  #print "TEST_YamsMonPlugDialog"
+  import sys
+  from PyQt4.QtGui import QApplication
+  from PyQt4.QtCore import QObject, SIGNAL, SLOT
+  app = QApplication(sys.argv)
+  QObject.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()"))
+
+  dlg=MonYamsPlugDialog()
+  dlg.show()
+  sys.exit(app.exec_())
+
+if __name__ == "__main__":
+  TEST_MonYamsPlugDialog()
+  pass
index cc7a7c130f52f6a145a7371ce11909baeeba46f8..f61ed050f9225cff5fc8008d22243c83baf2d227 100644 (file)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 # Copyright (C) 2006-2013  EDF R&D
 #
 # This library is free software; you can redistribute it and/or
@@ -34,11 +35,12 @@ def YamsLct(context):
   from PyQt4.QtGui import QFileDialog
   from PyQt4.QtGui import QMessageBox
   
+  #prior test to avoid unnecessary user GUI work with ending crash
   try :
       os.environ['DISTENE_LICENCE_FILE_FOR_YAMS']
   except:
-      QMessageBox.warning(None,"Products","Distene's products are not installed")
+      QMessageBox.warning(None,"Products","Distene's product Yams is not installed.\nrequired environment variable:\nDISTENE_LICENCE_FILE_FOR_YAMS='/.../dlim8.var.sh'")
       return
   import monYamsPlugDialog
-  window=monYamsPlugDialog.getDialog() 
+  window=monYamsPlugDialog.getDialog()
   window.show()