Salome HOME
Merge multi-study removal branch. Before_python3_27062017
authorrnv <rnv@opencascade.com>
Fri, 9 Jun 2017 10:57:57 +0000 (13:57 +0300)
committerrnv <rnv@opencascade.com>
Fri, 9 Jun 2017 10:57:57 +0000 (13:57 +0300)
36 files changed:
CMakeLists.txt
doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_advanced.png
doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_enforced_vertices.png
doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_hyperpatch.png [new file with mode: 0644]
doc/salome/gui/BLSURFPLUGIN/input/blsurf_hypo.doc
doc/salome/gui/BLSURFPLUGIN/static/footer.html
doc/salome/tui/static/footer.html
idl/BLSURFPlugin_Algorithm.idl
resources/BLSURFPlugin.xml
src/BLSURFPlugin/BLSURFPluginBuilder.py
src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx
src/BLSURFPlugin/BLSURFPlugin_BLSURF.hxx
src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.cxx
src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.hxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx
src/BLSURFPlugin/BLSURFPlugin_i.cxx
src/GUI/BLSURFPluginGUI.cxx
src/GUI/BLSURFPluginGUI_AdvWidget.cxx
src/GUI/BLSURFPluginGUI_AdvWidget_QTD.ui
src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx
src/GUI/BLSURFPluginGUI_HypothesisCreator.h
src/GUI/BLSURFPluginGUI_TreeWidget.cxx [new file with mode: 0644]
src/GUI/BLSURFPluginGUI_TreeWidget.h [new file with mode: 0644]
src/GUI/BLSURFPlugin_images.ts
src/GUI/BLSURFPlugin_msg_en.ts
src/GUI/BLSURFPlugin_msg_fr.ts
src/GUI/BLSURFPlugin_msg_ja.ts
src/GUI/CMakeLists.txt
tests/CMakeLists.txt
tests/test_cadsurf_multithread.py [new file with mode: 0644]
tests/test_enforced_vertex.py
tests/test_precad_intersections.py
tests/test_quadrangles_gradation.py

index bbb4d19e3b3e078461f280b9f94624b2c2342068..4e21fc0b296290a54e1f8d25a9f562b224a30abd 100755 (executable)
@@ -31,7 +31,7 @@ ENDIF(WIN32)
 STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
 
 SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 1)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 3)
 SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
 SET(${PROJECT_NAME_UC}_VERSION
   ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
index cb8d6577768ed05bbbc2249c073d8342a8ca7d21..9c966797338639be4acdf6567b80698390449059 100644 (file)
Binary files a/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_advanced.png and b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_advanced.png differ
index 8fa29543e6694bbe0455cd304320e1283056324e..1dbdd01c584baf08ca64c70fdea164fbba94c61a 100644 (file)
Binary files a/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_enforced_vertices.png and b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_enforced_vertices.png differ
diff --git a/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_hyperpatch.png b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_hyperpatch.png
new file mode 100644 (file)
index 0000000..49904b9
Binary files /dev/null and b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_hyperpatch.png differ
index 21b80db51ae91eaca7251143a6656eaba6df008f..ec7d33c7e5249a68324a7ac0001e1f645ba99f47 100644 (file)
@@ -122,6 +122,9 @@ mesh features are then removed only if it does not lead to surface intersections
 deactivated by setting this parameter to 0, giving priority to the tiny edge or bad surface element
 removal.
 
+  - <b>use deprecated patch mesher</b> - This option reproduces the mesher behaviour of previous MG-CADSurf versions
+(MeshGems before 2.3, i.e. before SALOME 8.2). This has proved useful on some particular cases such as very small 
+local size on a vertex situated on a border curve.
 
 - <b>CAD preprocessor</b> options. The CAD preprocessor (formerly known as PreCAD) has two main goals:
 
@@ -260,6 +263,14 @@ used by default, but this can be modified by the parameter
 interpolate two values, a linear interpolation is used by default, but
 this can be modified by \ref blsurf_hinterpol_flag "hinterpol flag". 
 
+<b>Note:</b> on some particular configurations, the mesher behaviour is
+not the same as before (SALOME versions before 8.2 i.e. MeshGems before 2.3).
+For a small local size defined on a point situated on a border curve,
+the previous mesher behaviour may be prefered: 
+see "use deprecated patch mesher"
+on advanced tag.
+
+
 \ref blsurf_local_size "Back to \"Local size\""\n
 \ref blsurf_top "Back to top"
 
@@ -330,22 +341,22 @@ shape. The distance is the geodesic distance (i.e. calculated by following the s
 \image html blsurf_parameters_enforced_vertices.png
 
 It is possible to define some enforced vertices to MG-CADSurf algorithm.
-An enforced vertex is defined on a Face or a Compound by
+An enforced vertex is defined by
 
 - selecting an existing Vertex or Compound,
 
-- or creating a new vertex given its coordinates.
+- or by its coordinates.
 
 The enforced vertex is the projection of a point defined by its
-(x,y,z) coordinates on the selected face.
+(x,y,z) coordinates on the closest face found by the application.
 
-- It is possible to define several enforced vertices on a face or a group of faces.
+- It is possible to define several enforced vertices.
 
 - If the projected point is on the boundary or outside of the face, it will be ignored.
 
-- If a group name is specified : If the group exists, the enforced nodes will be added in the existing group, if the group does not exist it will be created.
+- If a group name is specified : if the group exists, the enforced nodes will be added in the existing group, if the group does not exist it will be created.
 
-All the internal vertices of the faces can be considered as enforced vertices if the corresponding checkbox is checked.
+All the internal vertices of faces can be considered as enforced vertices if the corresponding checkbox is checked.
 A group can optionnaly be defined on those enforced vertices.
 
 \sa Sample TUI Script of the \ref tui_blsurf "creation of a MG-CADSurf hypothesis", including enforced vertices.
@@ -393,6 +404,27 @@ List of source and target vertices to define a transformation are optional.
 
 \sa Sample TUI Script of the definition of MG-CADSurf periodicity \ref tui_blsurf_periodicity_preCAD "using preCAD".
 
+\section blsurf_hyperpatch Hyper-patch
+
+\image html blsurf_parameters_hyperpatch.png
+
+Hyper-patch tab page allows defining faces that will be meshes together as
+  part of a global hyper-patch.
+
+- <b>Hyper-patch IDs</b> table - shows IDs of faces of defined hyper-patches.
+
+- <b>Face selection</b> - activates selection of faces in the VTK Viewer.
+
+- <b>Group selection</b> - activates selection of faces and groups of
+  faces in the Object Browser.
+
+- \b IDs - allows typing IDs of faces composing a hyper-patch and
+  shows IDs of faces selected in the Viewer or the Object Browser.
+
+- \b Add - adds a new row to the table and moves \b IDs there.
+
+- \b Remove - removes selected hyper-patches from the table.
+
 \ref blsurf_top "Back to top"
 
 For more information on MeshGems-CADSurf, you can read its documentation at $MESHGEMS_ROOT_DIR/Docs/mg-cadsurf_user_manual.pdf
index de6db6a6c6d55ea90befc28cce87b52271f01395..b52879b324cd1a20463b652cf748696954337439 100755 (executable)
@@ -4,7 +4,7 @@
   <ul>
     $navpath
     <li class="footer">
-      Copyright &copy; 2007-2016  CEA/DEN, EDF R&amp;D<br>
+      Copyright &copy; 2007-2017  CEA/DEN, EDF R&amp;D<br>
     </li>
   </ul>
 </div>
index de6db6a6c6d55ea90befc28cce87b52271f01395..b52879b324cd1a20463b652cf748696954337439 100755 (executable)
@@ -4,7 +4,7 @@
   <ul>
     $navpath
     <li class="footer">
-      Copyright &copy; 2007-2016  CEA/DEN, EDF R&amp;D<br>
+      Copyright &copy; 2007-2017  CEA/DEN, EDF R&amp;D<br>
     </li>
   </ul>
 </div>
index d7f9c11d15af114446c658525b61b1d118795bff..671fd60ffd2e7b6178641046211cc8341289fbb9 100644 (file)
@@ -119,6 +119,10 @@ module BLSURFPlugin
   };
   
   typedef sequence<TPreCadPeriodicity> TPeriodicityList;
+
+  // Hyper-patches
+  typedef sequence<long> THyperPatch;
+  typedef sequence<THyperPatch> THyperPatchList;
   
   /*!
    * BLSURFPlugin_BLSURF: interface of BLSURF algorithm
@@ -339,6 +343,15 @@ module BLSURFPlugin
     void SetJacobianRectification( in boolean allowRectification );
     boolean GetJacobianRectification();
 
+    /*!
+     * Set use_deprecated_patch_mesher parameter (compatibility with older versions of Meshgems)
+     *
+     * the use_deprecated_patch_mesher parameter allows to keep the same behaviour than
+     * in salome < 8.3 (meshgems 2.1.11 instead of meshgems >= 2.4.5)
+     */
+    void SetUseDeprecatedPatchMesher( in boolean useDeprecatedPatchMesher );
+    boolean GetUseDeprecatedPatchMesher();
+
     /*!
      * Set max_number_of_points_per_patch parameter
      * 
@@ -349,6 +362,15 @@ module BLSURFPlugin
     void SetMaxNumberOfPointsPerPatch( in long nb ) raises (SALOME::SALOME_Exception);
     long GetMaxNumberOfPointsPerPatch();
 
+
+    /*!
+     * Set max_number_of_threads parameter
+     *
+     * Set the maximum of threads to use for multithreading mesh computation.
+     */
+    void SetMaxNumberOfThreads( in long nb ) raises (SALOME::SALOME_Exception);
+    long GetMaxNumberOfThreads();
+
     /*!
      * Set respect_geometry parameter
      *
@@ -431,16 +453,16 @@ module BLSURFPlugin
     string GetTags();
 
     /*!
-     * To merges edges.
+     * Set hyper-patches
      */
-    void SetPreCADMergeEdges(in boolean toMergeEdges);
-    boolean GetPreCADMergeEdges();
+    void SetHyperPatches(in THyperPatchList hpl);
+    THyperPatchList GetHyperPatches();
 
     /*!
-     * To remove tiny UV edges edges.
+     * To merges edges.
      */
-    void SetPreCADRemoveTinyUVEdges(in boolean toRemoveTinyUVEdges);
-    boolean GetPreCADRemoveTinyUVEdges();
+    void SetPreCADMergeEdges(in boolean toMergeEdges);
+    boolean GetPreCADMergeEdges();
 
     /*!
      * To remove duplicate CAD faces.
@@ -579,6 +601,7 @@ module BLSURFPlugin
    /*!
     * Set/get/unset an enforced vertex on geom face
     */
+    // OBSOLETE
     boolean SetEnforcedVertex(in GEOM::GEOM_Object theFace, in double x, in double y, in double z) raises (SALOME::SALOME_Exception);
     boolean SetEnforcedVertexNamed(in GEOM::GEOM_Object theFace, in double x, in double y, in double z, in TEnfName theVertexName) raises (SALOME::SALOME_Exception);
     boolean SetEnforcedVertexGeom(in GEOM::GEOM_Object theFace, in GEOM::GEOM_Object theVertex) raises (SALOME::SALOME_Exception);
@@ -586,17 +609,27 @@ module BLSURFPlugin
     boolean SetEnforcedVertexNamedWithGroup(in GEOM::GEOM_Object theFace, in double x, in double y, in double z, in TEnfName theVertexName, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
     boolean SetEnforcedVertexGeomWithGroup(in GEOM::GEOM_Object theFace, in GEOM::GEOM_Object theVertex, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
 
-    
     TEnfVertexList GetEnforcedVertices(in GEOM::GEOM_Object theFace) raises (SALOME::SALOME_Exception);
-    
     boolean UnsetEnforcedVertex(in GEOM::GEOM_Object theFace, in double x, in double y, in double z) raises (SALOME::SALOME_Exception);
     boolean UnsetEnforcedVertexGeom(in GEOM::GEOM_Object theFace, in GEOM::GEOM_Object theVertex) raises (SALOME::SALOME_Exception);
     boolean UnsetEnforcedVertices(in GEOM::GEOM_Object theFace) raises (SALOME::SALOME_Exception);
     
-   /*!
-    * Set/get/unset an enforced vertex on geom face given by entry
-    */
-    boolean SetEnforcedVertexEntry(in TEntry theFaceEntry, in double x, in double y, in double z, 
+    // NEW - no face
+    boolean AddEnforcedVertex(in double x, in double y, in double z) raises (SALOME::SALOME_Exception);
+    boolean AddEnforcedVertexNamed(in double x, in double y, in double z, in TEnfName theVertexName) raises (SALOME::SALOME_Exception);
+    boolean AddEnforcedVertexGeom(in GEOM::GEOM_Object theVertex) raises (SALOME::SALOME_Exception);
+    boolean AddEnforcedVertexWithGroup(in double x, in double y, in double z, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
+    boolean AddEnforcedVertexNamedWithGroup(in double x, in double y, in double z, in TEnfName theVertexName, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
+    boolean AddEnforcedVertexGeomWithGroup(in GEOM::GEOM_Object theVertex, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
+
+    boolean RemoveEnforcedVertex(in double x, in double y, in double z) raises (SALOME::SALOME_Exception);
+    boolean RemoveEnforcedVertexGeom(in GEOM::GEOM_Object theVertex) raises (SALOME::SALOME_Exception);
+    boolean RemoveEnforcedVertices() raises (SALOME::SALOME_Exception);
+
+    /*!
+     * Set/get/unset an enforced vertex on geom face given by entry
+     */
+    boolean SetEnforcedVertexEntry(in TEntry theFaceEntry, in double x, in double y, in double z,
                                    in TEnfName theVertexName, in TEntry theVertexEntry, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
 
     TEnfVertexList GetEnforcedVerticesEntry(in TEntry theFaceEntry) raises (SALOME::SALOME_Exception);
index 5fd562f1cfa1f1afce26ec534976c079ee33b34e..7ba53d018c049ce0000c46673c1c61e810b2c9dd 100644 (file)
@@ -31,6 +31,7 @@
                server-lib="BLSURFEngine"
                gui-lib="BLSURFPluginGUI">
   <hypotheses>
+
     <hypothesis type="MG-CADSurf Parameters"
                label-id="MG-CADSurf Parameters"
                icon-id="mesh_hypo_BLSURF.png"
           UnsetEnforcedVertex,
           UnsetEnforcedVertexGeom,
           UnsetEnforcedVertices,
+          AddEnforcedVertex,
+          AddEnforcedVertexNamed,
+          AddEnforcedVertexGeom,
+          AddEnforcedVertexWithGroup,
+          AddEnforcedVertexNamedWithGroup,
+          AddEnforcedVertexGeomWithGroup,
+          RemoveEnforcedVertex,
+          RemoveEnforcedVertexGeom,
+          RemoveEnforcedVertices,
+          AddPreCadFacesPeriodicity
+        </accumulative-methods>
+      </python-wrap>
+    </hypothesis>
+
+    <hypothesis type="MG-CADSurf Parameters_NOGEOM"
+               label-id="MG-CADSurf Parameters"
+               icon-id="mesh_hypo_BLSURF.png"
+               dim="2">
+      <python-wrap>
+        <accumulative-methods>
+          SetOptionValue,
+          SetPreCADOptionValue,
+          UnsetOption,
+          UnsetPreCADOption,
+          AddOption,
+          AddPreCADOption,
+          SetSizeMap,
+          SetConstantSizeMap,
+          UnsetSizeMap,
+          SetAttractor,
+          UnsetAttractor,
+          SetAttractorGeom,
+          UnsetAttractorGeom,
+          SetEnforcedVertex,
+          SetEnforcedVertexNamed,
+          SetEnforcedVertexGeom,
+          SetEnforcedVertexWithGroup,
+          SetEnforcedVertexNamedWithGroup,
+          SetEnforcedVertexGeomWithGroup,
+          UnsetEnforcedVertex,
+          UnsetEnforcedVertexGeom,
+          UnsetEnforcedVertices,
+          AddEnforcedVertex,
+          AddEnforcedVertexNamed,
+          AddEnforcedVertexGeom,
+          AddEnforcedVertexWithGroup,
+          AddEnforcedVertexNamedWithGroup,
+          AddEnforcedVertexGeomWithGroup,
+          RemoveEnforcedVertex,
+          RemoveEnforcedVertexGeom,
+          RemoveEnforcedVertices,
           AddPreCadFacesPeriodicity
         </accumulative-methods>
       </python-wrap>
       </python-wrap>
     </algorithm>
 
+    <algorithm type="MG-CADSurf_NOGEOM"
+               label-id="MG-CADSurf"
+               icon-id="mesh_algo_BLSURF.png"
+               opt-hypos="MG-CADSurf Parameters_NOGEOM"
+               output="TRIA,QUAD"
+               need-geom="never"
+               dim="2">
+      <python-wrap>
+        <algo>MG-CADSurf_NOGEOM=Triangle(algo=smeshBuilder.MG_CADSurf)</algo>
+        <hypo>MG-CADSurf Parameters_NOGEOM=Parameters()</hypo>
+      </python-wrap>
+    </algorithm>
+
   </algorithms>
 </meshers-group>
 
index a1833a5001bf3fccee93f6179258b6a969a24937..4548fa314698a9d019fc9cb19dd95c144cf1d3ce 100644 (file)
@@ -22,6 +22,7 @@
 # Python API for the MG-CADSurf meshing plug-in module.
 
 from salome.smesh.smesh_algorithm import Mesh_Algorithm
+import GEOM
 
 LIBRARY = "libBLSURFEngine.so"
 
@@ -86,7 +87,11 @@ class BLSURF_Algorithm(Mesh_Algorithm):
     Mesh_Algorithm.__init__(self)
     if noBLSURFPlugin:
       print "Warning: BLSURFPlugin module unavailable"
-    self.Create(mesh, geom, BLSURF, LIBRARY)
+    if mesh.GetMesh().HasShapeToMesh():
+      self.Create(mesh, geom, self.algoType, LIBRARY)
+    else:
+      self.Create(mesh, geom, self.algoType+"_NOGEOM", LIBRARY)
+      mesh.smeshpyD.SetName( self.algo, self.algoType )
     self.params=None
     self.geompyD = mesh.geompyD
     #self.SetPhysicalMesh() - PAL19680
@@ -229,6 +234,14 @@ class BLSURF_Algorithm(Mesh_Algorithm):
   def SetJacobianRectification( self, allowRectification ):
     self.Parameters().SetJacobianRectification( allowRectification )
 
+  ## Set use_deprecated_patch_mesher parameter (compatibility with older versions of Meshgems)
+  #  
+  # the use_deprecated_patch_mesher parameter allows to keep the same behaviour than
+  # in salome < 8.3 (meshgems 2.1.11 instead of meshgems >= 2.4.5)
+  #  
+  def SetUseDeprecatedPatchMesher( self, useDeprecatedPatchMesher ):
+    self.Parameters().SetUseDeprecatedPatchMesher( useDeprecatedPatchMesher )
+
   ## Set respect_geometry parameter
   #  
   #  This patch independent option can be deactivated to allow MeshGems-CADSurf
@@ -246,6 +259,13 @@ class BLSURF_Algorithm(Mesh_Algorithm):
   def SetMaxNumberOfPointsPerPatch( self, nb ):
     self.Parameters().SetMaxNumberOfPointsPerPatch( nb )
 
+  ## Set max_number_of_threads parameter
+  #
+  #  Set the maximum of threads to use for multithreading mesh computation
+  #
+  def SetMaxNumberOfThreads( self, nb ):
+    self.Parameters().SetMaxNumberOfThreads( nb )
+
   ## Set respect_geometry parameter
   #  
   #  This patch independent option can be deactivated to allow MeshGems-CADSurf
@@ -346,12 +366,6 @@ class BLSURF_Algorithm(Mesh_Algorithm):
     self.Parameters().SetPreCADMergeEdges(toMergeEdges)
     pass
 
-  ## To remove tiny UV edges.
-  #  @param toRemoveTinyUVEdges "remove_tiny_uv_edges" flag value
-  def SetPreCADRemoveTinyUVEdges(self, toRemoveTinyUVEdges=False):
-    self.Parameters().SetPreCADRemoveTinyUVEdges(toRemoveTinyUVEdges)
-    pass
-
   ## To remove duplicate CAD Faces
   #  @param toRemoveDuplicateCADFaces "remove_duplicate_cad_faces" flag value
   def SetPreCADRemoveDuplicateCADFaces(self, toRemoveDuplicateCADFaces=False):
@@ -495,6 +509,42 @@ class BLSURF_Algorithm(Mesh_Algorithm):
       return self.Parameters().SetEnforcedVertexGeomWithGroup(theFace, theVertex,groupName)
     pass
 
+  ## Set an enforced vertex on a face given the coordinates of a point.
+  #  The face if found by the application.
+  #  @param x            : x coordinate
+  #  @param y            : y coordinate
+  #  @param z            : z coordinate
+  #  @param vertexName   : name of the enforced vertex
+  #  @param groupName    : name of the group
+  def AddEnforcedVertex(self, x, y, z, vertexName = "", groupName = ""):
+    from salome.smesh.smeshBuilder import AssureGeomPublished
+    if vertexName == "":
+      if groupName == "":
+        return self.Parameters().AddEnforcedVertex(x, y, z)
+      else:
+        return self.Parameters().AddEnforcedVertexWithGroup(x, y, z, groupName)
+      pass
+    else:
+      if groupName == "":
+        return self.Parameters().AddEnforcedVertexNamed(x, y, z, vertexName)
+      else:
+        return self.Parameters().AddEnforcedVertexNamedWithGroup( x, y, z, vertexName, groupName)
+      pass
+    pass
+
+  ## To set an enforced vertex on a face given a GEOM vertex, group or compound.
+  #  The face if found by the application.
+  #  @param theVertex    : GEOM vertex (or group, compound).
+  #  @param groupName    : name of the group
+  def AddEnforcedVertexGeom(self, theVertex, groupName = ""):
+    from salome.smesh.smeshBuilder import AssureGeomPublished
+    AssureGeomPublished( self.mesh, theVertex )
+    if groupName == "":
+      return self.Parameters().AddEnforcedVertexGeom(theVertex)
+    else:
+      return self.Parameters().AddEnforcedVertexGeomWithGroup(theVertex,groupName)
+    pass
+
   ## To remove an enforced vertex on a given GEOM face (or group, compound) given the coordinates.
   #  @param theFace      : GEOM face (or group, compound) on which to remove the enforced vertex
   #  @param x            : x coordinate
@@ -612,8 +662,13 @@ class BLSURF_Algorithm(Mesh_Algorithm):
   #  @return hypothesis object
   def Parameters(self):
     if not self.params:
-      self.params = self.Hypothesis("MG-CADSurf Parameters", [],
-                                    LIBRARY, UseExisting=0)
+      hypType = "MG-CADSurf Parameters"
+      hasGeom = self.mesh.GetMesh().HasShapeToMesh()
+      if hasGeom:
+        self.params = self.Hypothesis(hypType, [], LIBRARY, UseExisting=0)
+      else:
+        self.params = self.Hypothesis(hypType + "_NOGEOM", [], LIBRARY, UseExisting=0)
+        self.mesh.smeshpyD.SetName( self.params, hypType )
       pass
     return self.params
 
@@ -659,6 +714,37 @@ class BLSURF_Algorithm(Mesh_Algorithm):
         self.Parameters().AddPreCadEdgesPeriodicity(theEdge1, theEdge2)
     pass
 
+  #-----------------------------------------
+  # Hyper-Patches
+  #-----------------------------------------
+  
+  ## Defines hyper-patches. A hyper-patch is a set of adjacent faces meshed as a whole,
+  #  ignoring edges between them
+  #  @param hyperPatchList : list of hyper-patches. A hyper-patch is defined as a list of
+  #         faces or groups of faces. A face can be identified either as a GEOM object or
+  #         a face ID (returned e.g. by geompy.GetSubShapeID( mainShape, subShape )).
+  #         
+  #  Example: cadsurf.SetHyperPatches([[ Face_1, Group_2 ],[ 13, 23 ]])
+  def SetHyperPatches(self, hyperPatchList):
+    hpl = []
+    for patch in hyperPatchList:
+      ids = []
+      for face in patch:
+        if isinstance( face, int ):
+          ids.append( face )
+        elif isinstance( face, GEOM._objref_GEOM_Object):
+          faces = self.mesh.geompyD.SubShapeAll( face, self.mesh.geompyD.ShapeType["FACE"] )
+          for f in faces:
+            ids.append( self.mesh.geompyD.GetSubShapeID( self.mesh.geom, f ))
+        else:
+          raise TypeError, \
+            "Face of hyper-patch should be either ID or GEOM_Object, not %s" % type(face)
+        pass
+      hpl.append( ids )
+      pass
+    self.Parameters().SetHyperPatches( hpl )
+    return
+
   #=====================
   # Obsolete methods
   #=====================
index 434b73268c19ebb78fa8d9da1a9f6dbe4cb7e09b..cf6f1f65304e5c00d9ad8255d77f70ee8be3d78b 100644 (file)
@@ -61,17 +61,19 @@ extern "C"{
 // OPENCASCADE includes
 #include <BRepBuilderAPI_MakeFace.hxx>
 #include <BRepBuilderAPI_MakePolygon.hxx>
-//#include <BRepBuilderAPI_MakeVertex.hxx>
+#include <BRepBuilderAPI_MakeWire.hxx>
 #include <BRepGProp.hxx>
 #include <BRepTools.hxx>
 #include <BRep_Builder.hxx>
 #include <BRep_Tool.hxx>
 #include <GProp_GProps.hxx>
 #include <Geom2d_Curve.hxx>
+#include <Geom2d_Line.hxx>
 #include <GeomAPI_ProjectPointOnCurve.hxx>
 #include <GeomAPI_ProjectPointOnSurf.hxx>
 #include <Geom_Curve.hxx>
 #include <Geom_Surface.hxx>
+#include <NCollection_DataMap.hxx>
 #include <NCollection_Map.hxx>
 #include <Standard_ErrorHandler.hxx>
 #include <TopExp.hxx>
@@ -226,6 +228,7 @@ TopTools_IndexedMapOfShape FacesWithEnforcedVertices;
 std::map< int, BLSURFPlugin_Hypothesis::TEnfVertexCoordsList > FaceId2EnforcedVertexCoords;
 std::map< BLSURFPlugin_Hypothesis::TEnfVertexCoords, BLSURFPlugin_Hypothesis::TEnfVertexCoords > EnfVertexCoords2ProjVertex;
 std::map< BLSURFPlugin_Hypothesis::TEnfVertexCoords, BLSURFPlugin_Hypothesis::TEnfVertexList > EnfVertexCoords2EnfVertexList;
+SMESH_MesherHelper* theHelper;
 
 bool HasSizeMapOnFace=false;
 bool HasSizeMapOnEdge=false;
@@ -238,19 +241,21 @@ bool HasSizeMapOnVertex=false;
  */
 //=============================================================================
 
-BLSURFPlugin_BLSURF::BLSURFPlugin_BLSURF(int hypId, SMESH_Gen* gen)
+BLSURFPlugin_BLSURF::BLSURFPlugin_BLSURF(int        hypId,
+                                         SMESH_Gen* gen,
+                                         bool       theHasGEOM)
   : SMESH_2D_Algo(hypId, gen)
 {
-  MESSAGE("BLSURFPlugin_BLSURF::BLSURFPlugin_BLSURF");
-
-  _name = "MG-CADSurf";//"BLSURF";
+  _name = theHasGEOM ? "MG-CADSurf" : "MG-CADSurf_NOGEOM";//"BLSURF";
   _shapeType = (1 << TopAbs_FACE); // 1 bit /shape type
-  _compatibleHypothesis.push_back(BLSURFPlugin_Hypothesis::GetHypType());
-  _compatibleHypothesis.push_back(StdMeshers_ViscousLayers2D::GetHypType());
+  _compatibleHypothesis.push_back(BLSURFPlugin_Hypothesis::GetHypType(theHasGEOM));
+  if ( theHasGEOM )
+    _compatibleHypothesis.push_back(StdMeshers_ViscousLayers2D::GetHypType());
   _requireDiscreteBoundary = false;
   _onlyUnaryInput = false;
   _hypothesis = NULL;
   _supportSubmeshes = true;
+  _requireShape = theHasGEOM;
 
   /* Initialize the Python interpreter */
   assert(Py_IsInitialized());
@@ -294,7 +299,6 @@ BLSURFPlugin_BLSURF::BLSURFPlugin_BLSURF(int hypId, SMESH_Gen* gen)
 
 BLSURFPlugin_BLSURF::~BLSURFPlugin_BLSURF()
 {
-  MESSAGE("BLSURFPlugin_BLSURF::~BLSURFPlugin_BLSURF");
 }
 
 
@@ -327,7 +331,8 @@ bool BLSURFPlugin_BLSURF::CheckHypothesis
   {
     theHyp = *itl;
     string hypName = theHyp->GetName();
-    if ( hypName == BLSURFPlugin_Hypothesis::GetHypType() )
+    if ( hypName == BLSURFPlugin_Hypothesis::GetHypType(true) ||
+         hypName == BLSURFPlugin_Hypothesis::GetHypType(false) )
     {
       _hypothesis = static_cast<const BLSURFPlugin_Hypothesis*> (theHyp);
       ASSERT(_hypothesis);
@@ -397,40 +402,99 @@ typedef struct {
         gp_XY uv;
         gp_XYZ xyz;
 } projectionPoint;
+
 /////////////////////////////////////////////////////////
-projectionPoint getProjectionPoint(const TopoDS_Face& face, const gp_Pnt& point)
+
+projectionPoint getProjectionPoint(TopoDS_Face& theFace, const gp_Pnt& thePoint)
 {
   projectionPoint myPoint;
-  Handle(Geom_Surface) surface = BRep_Tool::Surface(face);
-  GeomAPI_ProjectPointOnSurf projector( point, surface );
-  if ( !projector.IsDone() || projector.NbPoints()==0 )
-    throw "getProjectionPoint: Can't project";
-
-  Quantity_Parameter u,v;
-  projector.LowerDistanceParameters(u,v);
-  myPoint.uv = gp_XY(u,v);
-  gp_Pnt aPnt = projector.NearestPoint();
-  myPoint.xyz = gp_XYZ(aPnt.X(),aPnt.Y(),aPnt.Z());
-  //return gp_XY(u,v);
-  return myPoint;
-}
-/////////////////////////////////////////////////////////
 
-/////////////////////////////////////////////////////////
-double getT(const TopoDS_Edge& edge, const gp_Pnt& point)
-{
-  Standard_Real f,l;
-  Handle(Geom_Curve) curve = BRep_Tool::Curve(edge, f,l);
-  GeomAPI_ProjectPointOnCurve projector( point, curve);
-  if ( projector.NbPoints() == 0 )
-    throw;
-  return projector.LowerDistanceParameter();
+  if ( theFace.IsNull() )
+  {
+    TopoDS_Shape foundFace, myShape = theHelper->GetSubShape();
+    TopTools_MapOfShape checkedFaces;
+    std::map< double, std::pair< TopoDS_Face, gp_Pnt2d > > dist2face;
+
+    for ( TopExp_Explorer exp ( myShape, TopAbs_FACE ); exp.More(); exp.Next())
+    {
+      const TopoDS_Face& face = TopoDS::Face( exp.Current() );
+      if ( !checkedFaces.Add( face )) continue;
+
+      // check distance to face
+      Handle(ShapeAnalysis_Surface) surface = theHelper->GetSurface( face );
+      gp_Pnt2d uv = surface->ValueOfUV( thePoint, Precision::Confusion());
+      double distance = surface->Gap();
+      if ( distance > Precision::Confusion() )
+      {
+        // the face is far, store for future analysis
+        dist2face.insert( std::make_pair( distance, std::make_pair( face, uv )));
+      }
+      else
+      {
+        // check location on the face
+        BRepClass_FaceClassifier FC( face, uv, BRep_Tool::Tolerance( face ));
+        if ( FC.State() == TopAbs_IN )
+        {
+          if ( !foundFace.IsNull() )
+            return myPoint; // thePoint seems to be TopAbs_ON
+          foundFace   = face;
+          myPoint.uv  = uv.XY();
+          myPoint.xyz = surface->Value( uv ).XYZ();
+          // break;
+        }
+        if ( FC.State() == TopAbs_ON )
+          return myPoint;
+      }
+    }
+    if ( foundFace.IsNull() )
+    {
+      // find the closest face
+      std::map< double, std::pair< TopoDS_Face, gp_Pnt2d > >::iterator d2f = dist2face.begin();
+      for ( ; d2f != dist2face.end(); ++d2f )
+      {
+        const TopoDS_Face& face = d2f->second.first;
+        const gp_Pnt2d &     uv = d2f->second.second;
+        BRepClass_FaceClassifier FC( face, uv, Precision::Confusion());
+        if ( FC.State() == TopAbs_IN )
+        {
+          foundFace   = face;
+          myPoint.uv  = uv.XY();
+          myPoint.xyz = theHelper->GetSurface( face )->Value( uv ).XYZ();
+          break;
+        }
+      }
+    }
+    // set the resultShape
+    // if ( foundFace.IsNull() )
+    //   throw SMESH_ComputeError(COMPERR_BAD_PARMETERS,
+    //                            "getProjectionPoint: can't find a face by a vertex");
+    theFace = TopoDS::Face( foundFace );
+  }
+  else
+  {
+    Handle(Geom_Surface) surface = BRep_Tool::Surface( theFace );
+    GeomAPI_ProjectPointOnSurf projector( thePoint, surface );
+    if ( !projector.IsDone() || projector.NbPoints()==0 )
+      throw SMESH_ComputeError(COMPERR_BAD_PARMETERS,
+                               "getProjectionPoint: can't project a vertex to a face");
+
+    Quantity_Parameter u,v;
+    projector.LowerDistanceParameters(u,v);
+    myPoint.uv = gp_XY(u,v);
+    gp_Pnt aPnt = projector.NearestPoint();
+    myPoint.xyz = gp_XYZ(aPnt.X(),aPnt.Y(),aPnt.Z());
+
+    BRepClass_FaceClassifier FC( theFace, myPoint.uv, Precision::Confusion());
+    if ( FC.State() != TopAbs_IN )
+      theFace.Nullify();
+  }
+
+  return myPoint;
 }
 
 /////////////////////////////////////////////////////////
 TopoDS_Shape BLSURFPlugin_BLSURF::entryToShape(std::string entry)
 {
-  MESSAGE("BLSURFPlugin_BLSURF::entryToShape "<<entry );
   GEOM::GEOM_Object_var aGeomObj;
   TopoDS_Shape S = TopoDS_Shape();
   SALOMEDS::SObject_var aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID( entry.c_str() );
@@ -447,16 +511,11 @@ TopoDS_Shape BLSURFPlugin_BLSURF::entryToShape(std::string entry)
 void _createEnforcedVertexOnFace(TopoDS_Face faceShape, gp_Pnt aPnt, BLSURFPlugin_Hypothesis::TEnfVertex *enfVertex)
 {
   BLSURFPlugin_Hypothesis::TEnfVertexCoords enf_coords, coords, s_coords;
-  enf_coords.clear();
-  coords.clear();
-  s_coords.clear();
 
-  // Get the (u,v) values of the enforced vertex on the face
+  // Find the face and get the (u,v) values of the enforced vertex on the face
   projectionPoint myPoint = getProjectionPoint(faceShape,aPnt);
-
-  MESSAGE("Enforced Vertex: " << aPnt.X() << ", " << aPnt.Y() << ", " << aPnt.Z());
-  MESSAGE("Projected Vertex: " << myPoint.xyz.X() << ", " << myPoint.xyz.Y() << ", " << myPoint.xyz.Z());
-  MESSAGE("Parametric coordinates: " << myPoint.uv.X() << ", " << myPoint.uv.Y() );
+  if ( faceShape.IsNull() )
+    return;
 
   enf_coords.push_back(aPnt.X());
   enf_coords.push_back(aPnt.Y());
@@ -473,10 +532,7 @@ void _createEnforcedVertexOnFace(TopoDS_Face faceShape, gp_Pnt aPnt, BLSURFPlugi
   s_coords.push_back(myPoint.xyz.Z());
 
   // Save pair projected vertex / enf vertex
-  MESSAGE("Storing pair projected vertex / enf vertex:");
-  MESSAGE("("<< myPoint.xyz.X() << ", " << myPoint.xyz.Y() << ", " << myPoint.xyz.Z() <<") / (" << aPnt.X() << ", " << aPnt.Y() << ", " << aPnt.Z()<<")");
   EnfVertexCoords2ProjVertex[s_coords] = enf_coords;
-  MESSAGE("Group name is: \"" << enfVertex->grpName << "\"");
   pair<BLSURFPlugin_Hypothesis::TEnfVertexList::iterator,bool> ret;
   BLSURFPlugin_Hypothesis::TEnfVertexList::iterator it;
   ret = EnfVertexCoords2EnfVertexList[s_coords].insert(enfVertex);
@@ -502,26 +558,18 @@ void _createEnforcedVertexOnFace(TopoDS_Face faceShape, gp_Pnt aPnt, BLSURFPlugi
         sameAttractor = true;
 
   if (FaceId2EnforcedVertexCoords.find(key) != FaceId2EnforcedVertexCoords.end()) {
-    MESSAGE("Map of enf. vertex has key " << key)
-    MESSAGE("Enf. vertex list size is: " << FaceId2EnforcedVertexCoords[key].size())
     if (! sameAttractor)
       FaceId2EnforcedVertexCoords[key].insert(coords); // there should be no redondant coords here (see std::set management)
-    else
-      MESSAGE("An attractor node is already defined: I don't add the enforced vertex");
-    MESSAGE("New Enf. vertex list size is: " << FaceId2EnforcedVertexCoords[key].size())
   }
   else {
-    MESSAGE("Map of enf. vertex has not key " << key << ": creating it")
     if (! sameAttractor) {
       BLSURFPlugin_Hypothesis::TEnfVertexCoordsList ens;
       ens.insert(coords);
       FaceId2EnforcedVertexCoords[key] = ens;
     }
-    else
-      MESSAGE("An attractor node is already defined: I don't add the enforced vertex");
   }
 }
-
+  
 /////////////////////////////////////////////////////////
 void BLSURFPlugin_BLSURF::createEnforcedVertexOnFace(TopoDS_Shape faceShape, BLSURFPlugin_Hypothesis::TEnfVertexList enfVertexList)
 {
@@ -542,18 +590,22 @@ void BLSURFPlugin_BLSURF::createEnforcedVertexOnFace(TopoDS_Shape faceShape, BLS
     if (enfVertex->geomEntry != "") {
       TopoDS_Shape GeomShape = entryToShape(enfVertex->geomEntry);
       TopAbs_ShapeEnum GeomType  = GeomShape.ShapeType();
-       if (GeomType == TopAbs_VERTEX){
-         aPnt = BRep_Tool::Pnt(TopoDS::Vertex(GeomShape));
+       if (GeomType == TopAbs_VERTEX)
+       {
+         enfVertex->vertex = TopoDS::Vertex( GeomShape );
+         aPnt = BRep_Tool::Pnt( enfVertex->vertex );
          _createEnforcedVertexOnFace( TopoDS::Face(faceShape),  aPnt, enfVertex);
        }
        // Group Management
-       if (GeomType == TopAbs_COMPOUND){
-         for (TopoDS_Iterator it (GeomShape); it.More(); it.Next()){
-           if (it.Value().ShapeType() == TopAbs_VERTEX){
-             aPnt = BRep_Tool::Pnt(TopoDS::Vertex(it.Value()));
+       if (GeomType == TopAbs_COMPOUND)
+       {
+         for (TopoDS_Iterator it (GeomShape); it.More(); it.Next())
+           if (it.Value().ShapeType() == TopAbs_VERTEX)
+           {
+             enfVertex->vertex = TopoDS::Vertex( it.Value() );
+             aPnt = BRep_Tool::Pnt( enfVertex->vertex );
              _createEnforcedVertexOnFace( TopoDS::Face(faceShape),  aPnt, enfVertex);
            }
-         }
        }
     }
   }
@@ -562,7 +614,6 @@ void BLSURFPlugin_BLSURF::createEnforcedVertexOnFace(TopoDS_Shape faceShape, BLS
 /////////////////////////////////////////////////////////
 void createAttractorOnFace(TopoDS_Shape GeomShape, std::string AttractorFunction, double defaultSize)
 {
-  MESSAGE("Attractor function: "<< AttractorFunction);
   double xa, ya, za; // Coordinates of attractor point
   double a, b;       // Attractor parameter
   double d = 0.;
@@ -610,7 +661,6 @@ void createAttractorOnFace(TopoDS_Shape GeomShape, std::string AttractorFunction
   pos2 = AttractorFunction.find(sep, pos1+1);
   if (pos2!=string::npos) {
     string createNodeStr = AttractorFunction.substr(pos1+1, pos2-pos1-1);
-    MESSAGE("createNode: " << createNodeStr);
     createNode = (AttractorFunction.substr(pos1+1, pos2-pos1-1) == "True");
     pos1=pos2;
   }
@@ -645,8 +695,6 @@ void createAttractorOnFace(TopoDS_Shape GeomShape, std::string AttractorFunction
   // of r-d where r is the distance to (u0,v0)
   attractorFunctionStream << "*exp(-(0.5*(sqrt((u-"<<u0<<")**2+(v-"<<v0<<")**2)-"<<d<<"+abs(sqrt((u-"<<u0<<")**2+(v-"<<v0<<")**2)-"<<d<<"))/(" << b << "))**2)";
 
-  MESSAGE("Python function for attractor:" << std::endl << attractorFunctionStream.str());
-
   int key;
   if (! FacesWithSizeMap.Contains(TopoDS::Face(GeomShape))) {
     key = FacesWithSizeMap.Add(TopoDS::Face(GeomShape));
@@ -656,7 +704,6 @@ void createAttractorOnFace(TopoDS_Shape GeomShape, std::string AttractorFunction
   }
   FaceId2SizeMap[key] =attractorFunctionStream.str();
   if (createNode) {
-    MESSAGE("Creating node on ("<<x0<<","<<y0<<","<<z0<<")");
     FaceId2AttractorCoords[key] = coords;
   }
 //   // Test for new attractors
@@ -667,42 +714,30 @@ void createAttractorOnFace(TopoDS_Shape GeomShape, std::string AttractorFunction
 //   myAttractor.SetType(1);
 //   FaceId2ClassAttractor[key] = myAttractor;
 //   if(FaceId2ClassAttractor[key].GetFace().IsNull()){
-//     MESSAGE("face nulle ");
-//   }
-//   else
-//     MESSAGE("face OK");
-//
-//   if (FaceId2ClassAttractor[key].GetAttractorShape().IsNull()){
-//     MESSAGE("pas de point");
 //   }
-//   else
-//     MESSAGE("point OK");
 }
 
 // One sub-shape to get ids from
-BLSURFPlugin_BLSURF::TListOfIDs _getSubShapeIDsInMainShape(TopoDS_Shape theMainShape, TopoDS_Shape theSubShape,
-    TopAbs_ShapeEnum theShapeType)
+BLSURFPlugin_BLSURF::TListOfIDs _getSubShapeIDsInMainShape(const TopoDS_Shape& theMainShape,
+                                                           const TopoDS_Shape& theSubShape,
+                                                           TopAbs_ShapeEnum    theShapeType)
 {
   BLSURFPlugin_BLSURF::TListOfIDs face_ids;
+
+  TopTools_MapOfShape subShapes;
   TopTools_IndexedMapOfShape anIndices;
-  anIndices.Clear();
   TopExp::MapShapes(theMainShape, theShapeType, anIndices);
 
-//  Standard_Boolean result = BRepTools::Write(theMainShape,"main_shape.brep");
-
   for (TopExp_Explorer face_iter(theSubShape,theShapeType);face_iter.More();face_iter.Next())
+  {
+    if ( subShapes.Add( face_iter.Current() )) // issue 23416
     {
-      int face_id = anIndices.FindIndex(face_iter.Current());
-      if (face_id == 0)
-        throw SALOME_Exception ( SMESH_Comment("Sub_shape not found in main_shape"));
-      face_ids.push_back(face_id);
-//      std::ostringstream o;
-//      o << "face_" << face_id << ".brep";
-//      std::string face_name = o.str();
-//      const TopoDS_Face& face = TopoDS::Face(face_iter.Current());
-//      Standard_Boolean result = BRepTools::Write(face,face_name.c_str());
+      int face_id = anIndices.FindIndex( face_iter.Current() );
+      if ( face_id == 0 )
+        throw SALOME_Exception( "Periodicity: sub_shape not found in main_shape");
+      face_ids.push_back( face_id );
     }
-
+  }
   return face_ids;
 }
 
@@ -716,7 +751,7 @@ BLSURFPlugin_BLSURF::TListOfIDs _getSubShapeIDsInMainShape(SMESH_Mesh*      theM
   {
     int face_id = theMesh->GetMeshDS()->ShapeToIndex(face_iter.Current());
     if (face_id == 0)
-      throw SALOME_Exception ( SMESH_Comment("Sub_shape not found in main_shape"));
+      throw SALOME_Exception ( "Periodicity: sub_shape not found in main_shape");
     face_ids.push_back(face_id);
   }
 
@@ -726,37 +761,34 @@ BLSURFPlugin_BLSURF::TListOfIDs _getSubShapeIDsInMainShape(SMESH_Mesh*      theM
 void BLSURFPlugin_BLSURF::addCoordsFromVertices(const std::vector<std::string> &theVerticesEntries, std::vector<double> &theVerticesCoords)
 {
   for (std::vector<std::string>::const_iterator it = theVerticesEntries.begin(); it != theVerticesEntries.end(); it++)
-    {
-      BLSURFPlugin_Hypothesis::TEntry theVertexEntry = *it;
-      MESSAGE("Vertex entry " << theVertexEntry);
-      addCoordsFromVertex(theVertexEntry, theVerticesCoords);
-    }
+  {
+    BLSURFPlugin_Hypothesis::TEntry theVertexEntry = *it;
+    addCoordsFromVertex(theVertexEntry, theVerticesCoords);
+  }
 }
 
 
 void BLSURFPlugin_BLSURF::addCoordsFromVertex(BLSURFPlugin_Hypothesis::TEntry theVertexEntry, std::vector<double> &theVerticesCoords)
 {
   if (theVertexEntry!="")
-    {
-      TopoDS_Shape aShape = entryToShape(theVertexEntry);
+  {
+    TopoDS_Shape aShape = entryToShape(theVertexEntry);
 
-      gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
-      double theX, theY, theZ;
-      theX = aPnt.X();
-      theY = aPnt.Y();
-      theZ = aPnt.Z();
+    gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
+    double theX, theY, theZ;
+    theX = aPnt.X();
+    theY = aPnt.Y();
+    theZ = aPnt.Z();
 
-      theVerticesCoords.push_back(theX);
-      theVerticesCoords.push_back(theY);
-      theVerticesCoords.push_back(theZ);
-    }
+    theVerticesCoords.push_back(theX);
+    theVerticesCoords.push_back(theY);
+    theVerticesCoords.push_back(theZ);
+  }
 }
 
 /////////////////////////////////////////////////////////
 void BLSURFPlugin_BLSURF::createPreCadFacesPeriodicity(TopoDS_Shape theGeomShape, const BLSURFPlugin_Hypothesis::TPreCadPeriodicity &preCadPeriodicity)
 {
-  MESSAGE("BLSURFPlugin_BLSURF::createPreCadFacesPeriodicity");
-
   TopoDS_Shape geomShape1 = entryToShape(preCadPeriodicity.shape1Entry);
   TopoDS_Shape geomShape2 = entryToShape(preCadPeriodicity.shape2Entry);
 
@@ -767,26 +799,15 @@ void BLSURFPlugin_BLSURF::createPreCadFacesPeriodicity(TopoDS_Shape theGeomShape
   preCadFacesPeriodicityIDs.shape1IDs = theFace1_ids;
   preCadFacesPeriodicityIDs.shape2IDs = theFace2_ids;
 
-  MESSAGE("preCadPeriodicity.theSourceVerticesEntries.size(): " << preCadPeriodicity.theSourceVerticesEntries.size());
-  MESSAGE("preCadPeriodicity.theTargetVerticesEntries.size(): " << preCadPeriodicity.theTargetVerticesEntries.size());
-
   addCoordsFromVertices(preCadPeriodicity.theSourceVerticesEntries, preCadFacesPeriodicityIDs.theSourceVerticesCoords);
   addCoordsFromVertices(preCadPeriodicity.theTargetVerticesEntries, preCadFacesPeriodicityIDs.theTargetVerticesCoords);
 
-  MESSAGE("preCadFacesPeriodicityIDs.theSourceVerticesCoords.size(): " << preCadFacesPeriodicityIDs.theSourceVerticesCoords.size());
-  MESSAGE("preCadFacesPeriodicityIDs.theTargetVerticesCoords.size(): " << preCadFacesPeriodicityIDs.theTargetVerticesCoords.size());
-
   _preCadFacesIDsPeriodicityVector.push_back(preCadFacesPeriodicityIDs);
-  MESSAGE("_preCadFacesIDsPeriodicityVector.size() = " << _preCadFacesIDsPeriodicityVector.size());
-  MESSAGE("BLSURFPlugin_BLSURF::createPreCadFacesPeriodicity END");
-
 }
 
 /////////////////////////////////////////////////////////
 void BLSURFPlugin_BLSURF::createPreCadEdgesPeriodicity(TopoDS_Shape theGeomShape, const BLSURFPlugin_Hypothesis::TPreCadPeriodicity &preCadPeriodicity)
 {
-  MESSAGE("BLSURFPlugin_BLSURF::createPreCadEdgesPeriodicity");
-
   TopoDS_Shape geomShape1 = entryToShape(preCadPeriodicity.shape1Entry);
   TopoDS_Shape geomShape2 = entryToShape(preCadPeriodicity.shape2Entry);
 
@@ -801,9 +822,6 @@ void BLSURFPlugin_BLSURF::createPreCadEdgesPeriodicity(TopoDS_Shape theGeomShape
   addCoordsFromVertices(preCadPeriodicity.theTargetVerticesEntries, preCadEdgesPeriodicityIDs.theTargetVerticesCoords);
 
   _preCadEdgesIDsPeriodicityVector.push_back(preCadEdgesPeriodicityIDs);
-  MESSAGE("_preCadEdgesIDsPeriodicityVector.size() = " << _preCadEdgesIDsPeriodicityVector.size());
-  MESSAGE("BLSURFPlugin_BLSURF::createPreCadEdgesPeriodicity END");
-
 }
 
 
@@ -811,11 +829,25 @@ void BLSURFPlugin_BLSURF::createPreCadEdgesPeriodicity(TopoDS_Shape theGeomShape
 
 void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
                                         cadsurf_session_t *            css,
-                                        const TopoDS_Shape&            theGeomShape
-                                        )
+                                        const TopoDS_Shape&            theGeomShape)
 {
   // rnc : Bug 1457
   // Clear map so that it is not stored in the algorithm with old enforced vertices in it
+  FacesWithSizeMap.Clear();
+  FaceId2SizeMap.clear();
+  EdgesWithSizeMap.Clear();
+  EdgeId2SizeMap.clear();
+  VerticesWithSizeMap.Clear();
+  VertexId2SizeMap.clear();
+  FaceId2PythonSmp.clear();
+  EdgeId2PythonSmp.clear();
+  VertexId2PythonSmp.clear();
+  FaceId2AttractorCoords.clear();
+  FaceId2ClassAttractor.clear();
+  FaceIndex2ClassAttractor.clear();
+  FacesWithEnforcedVertices.Clear();
+  FaceId2EnforcedVertexCoords.clear();
+  EnfVertexCoords2ProjVertex.clear();
   EnfVertexCoords2EnfVertexList.clear();
 
   double diagonal               = SMESH_Mesh::GetShapeDiagonalSize( theGeomShape );
@@ -852,14 +884,13 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
 
   // PreCAD
   //int _precadMergeEdges         = BLSURFPlugin_Hypothesis::GetDefaultPreCADMergeEdges();
-  int _precadRemoveTinyUVEdges  = BLSURFPlugin_Hypothesis::GetDefaultPreCADRemoveTinyUVEdges();
   //int _precadRemoveDuplicateCADFaces = BLSURFPlugin_Hypothesis::GetDefaultPreCADRemoveDuplicateCADFaces();
   //int _precadProcess3DTopology  = BLSURFPlugin_Hypothesis::GetDefaultPreCADProcess3DTopology();
   //int _precadDiscardInput       = BLSURFPlugin_Hypothesis::GetDefaultPreCADDiscardInput();
 
+  const BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector preCadFacesPeriodicityVector = BLSURFPlugin_Hypothesis::GetPreCadFacesPeriodicityVector(hyp);
 
   if (hyp) {
-    MESSAGE("BLSURFPlugin_BLSURF::SetParameters");
     _physicalMesh  = (int) hyp->GetPhysicalMesh();
     _geometricMesh = (int) hyp->GetGeometricMesh();
     if (hyp->GetPhySize() > 0) {
@@ -909,30 +940,35 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
     //_topology      = (int) hyp->GetTopology();
     // PreCAD
     //_precadMergeEdges        = hyp->GetPreCADMergeEdges();
-    _precadRemoveTinyUVEdges = hyp->GetPreCADRemoveTinyUVEdges();
     //_precadRemoveDuplicateCADFaces = hyp->GetPreCADRemoveDuplicateCADFaces();
     //_precadProcess3DTopology = hyp->GetPreCADProcess3DTopology();
     //_precadDiscardInput      = hyp->GetPreCADDiscardInput();
 
     const BLSURFPlugin_Hypothesis::TOptionValues& opts = hyp->GetOptionValues();
     BLSURFPlugin_Hypothesis::TOptionValues::const_iterator opIt;
-    for ( opIt = opts.begin(); opIt != opts.end(); ++opIt )
+    for ( opIt = opts.begin(); opIt != opts.end(); ++opIt ){
+      MESSAGE("OptionValue: " << opIt->first.c_str() << ", value: " << opIt->second.c_str());
       if ( !opIt->second.empty() ) {
-        MESSAGE("cadsurf_set_param(): " << opIt->first << " = " << opIt->second);
-        set_param(css, opIt->first.c_str(), opIt->second.c_str());
+               // With MeshGems 2.4-5, there are issues with periodicity and multithread
+               // => As a temporary workaround, we enforce to use only one thread if periodicity is used.
+        if (opIt->first == "max_number_of_threads" && opIt->second != "1" && ! preCadFacesPeriodicityVector.empty()){
+          std::cout << "INFO: Disabling multithread to avoid periodicity issues" << std::endl;
+          set_param(css, opIt->first.c_str(), "1");
+        }
+        else
+          set_param(css, opIt->first.c_str(), opIt->second.c_str());
       }
+    }
 
     const BLSURFPlugin_Hypothesis::TOptionValues& custom_opts = hyp->GetCustomOptionValues();
     for ( opIt = custom_opts.begin(); opIt != custom_opts.end(); ++opIt )
       if ( !opIt->second.empty() ) {
-        MESSAGE("cadsurf_set_param(): " << opIt->first << " = " << opIt->second);
         set_param(css, opIt->first.c_str(), opIt->second.c_str());
      }
 
     const BLSURFPlugin_Hypothesis::TOptionValues& preCADopts = hyp->GetPreCADOptionValues();
     for ( opIt = preCADopts.begin(); opIt != preCADopts.end(); ++opIt )
       if ( !opIt->second.empty() ) {
-        MESSAGE("cadsurf_set_param(): " << opIt->first << " = " << opIt->second);
         set_param(css, opIt->first.c_str(), opIt->second.c_str());
       }
   }
@@ -943,7 +979,6 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
   }
   // PreProcessor (formerly PreCAD) -- commented params are preCADoptions (since 0023307)
   //set_param(css, "merge_edges",            _precadMergeEdges ? "yes" : "no");
-  set_param(css, "remove_tiny_uv_edges",   _precadRemoveTinyUVEdges ? "yes" : "no");
   //set_param(css, "remove_duplicate_cad_faces", _precadRemoveDuplicateCADFaces ? "yes" : "no");
   //set_param(css, "process_3d_topology",    _precadProcess3DTopology ? "1" : "0");
   //set_param(css, "discard_input_topology", _precadDiscardInput ? "1" : "0");
@@ -1041,22 +1076,20 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
    if ( _verb > 0 )
      std::cout << "_smp_phy_size = " << _smp_phy_size << std::endl;
 
-   if (_physicalMesh == BLSURFPlugin_Hypothesis::PhysicalLocalSize){
+   if (_physicalMesh == BLSURFPlugin_Hypothesis::PhysicalLocalSize)
+   {
     TopoDS_Shape GeomShape;
     TopoDS_Shape AttShape;
     TopAbs_ShapeEnum GeomType;
     //
     // Standard Size Maps
     //
-    MESSAGE("Setting a Size Map");
     const BLSURFPlugin_Hypothesis::TSizeMap sizeMaps = BLSURFPlugin_Hypothesis::GetSizeMapEntries(hyp);
     BLSURFPlugin_Hypothesis::TSizeMap::const_iterator smIt = sizeMaps.begin();
     for ( ; smIt != sizeMaps.end(); ++smIt ) {
       if ( !smIt->second.empty() ) {
-        MESSAGE("cadsurf_set_sizeMap(): " << smIt->first << " = " << smIt->second);
         GeomShape = entryToShape(smIt->first);
         GeomType  = GeomShape.ShapeType();
-        MESSAGE("Geomtype is " << GeomType);
         int key = -1;
         // Group Management
         if (GeomType == TopAbs_COMPOUND) {
@@ -1069,7 +1102,6 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
               }
               else {
                 key = FacesWithSizeMap.FindIndex(TopoDS::Face(it.Value()));
-//                 MESSAGE("Face with key " << key << " already in map");
               }
               FaceId2SizeMap[key] = smIt->second;
             }
@@ -1082,7 +1114,6 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
               }
               else {
                 key = EdgesWithSizeMap.FindIndex(TopoDS::Edge(it.Value()));
-//                 MESSAGE("Edge with key " << key << " already in map");
               }
               EdgeId2SizeMap[key] = smIt->second;
             }
@@ -1096,9 +1127,7 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
               }
               else {
                 key = VerticesWithSizeMap.FindIndex(TopoDS::Vertex(it.Value()));
-                MESSAGE("Group of vertices with key " << key << " already in map");
               }
-              MESSAGE("Group of vertices with key " << key << " has a size map: " << smIt->second);
               VertexId2SizeMap[key] = smIt->second;
             }
           }
@@ -1111,7 +1140,6 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
           }
           else {
             key = FacesWithSizeMap.FindIndex(TopoDS::Face(GeomShape));
-//             MESSAGE("Face with key " << key << " already in map");
           }
           FaceId2SizeMap[key] = smIt->second;
         }
@@ -1124,7 +1152,6 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
           }
           else {
             key = EdgesWithSizeMap.FindIndex(TopoDS::Edge(GeomShape));
-//             MESSAGE("Edge with key " << key << " already in map");
           }
           EdgeId2SizeMap[key] = smIt->second;
         }
@@ -1138,9 +1165,7 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
           }
           else {
             key = VerticesWithSizeMap.FindIndex(TopoDS::Vertex(GeomShape));
-             MESSAGE("Vertex with key " << key << " already in map");
           }
-          MESSAGE("Vertex with key " << key << " has a size map: " << smIt->second);
           VertexId2SizeMap[key] = smIt->second;
         }
       }
@@ -1150,13 +1175,11 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
     // Attractors
     //
     // TODO appeler le constructeur des attracteurs directement ici
-    MESSAGE("Setting Attractors");
 //     if ( !_phySizeRel ) {
       const BLSURFPlugin_Hypothesis::TSizeMap attractors = BLSURFPlugin_Hypothesis::GetAttractorEntries(hyp);
       BLSURFPlugin_Hypothesis::TSizeMap::const_iterator atIt = attractors.begin();
       for ( ; atIt != attractors.end(); ++atIt ) {
         if ( !atIt->second.empty() ) {
-          MESSAGE("cadsurf_set_attractor(): " << atIt->first << " = " << atIt->second);
           GeomShape = entryToShape(atIt->first);
           GeomType  = GeomShape.ShapeType();
           // Group Management
@@ -1189,8 +1212,6 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
         }
       }
 //     }
-//     else
-//       MESSAGE("Impossible to create the attractors when the physical size is relative");
 
     // Class Attractors
     // temporary commented out for testing
@@ -1209,7 +1230,6 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
     BLSURFPlugin_Hypothesis::TAttractorMap::const_iterator AtIt = class_attractors.begin();
     for ( ; AtIt != class_attractors.end(); ++AtIt ) {
       if ( !AtIt->second->Empty() ) {
-       // MESSAGE("cadsurf_set_attractor(): " << AtIt->first << " = " << AtIt->second);
         GeomShape = entryToShape(AtIt->first);
         if ( !SMESH_MesherHelper::IsSubShape( GeomShape, theGeomShape ))
           continue;
@@ -1248,15 +1268,18 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
     //
     // Enforced Vertices
     //
-    MESSAGE("Setting Enforced Vertices");
     const BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap entryEnfVertexListMap = BLSURFPlugin_Hypothesis::GetAllEnforcedVerticesByFace(hyp);
     BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap::const_iterator enfIt = entryEnfVertexListMap.begin();
     for ( ; enfIt != entryEnfVertexListMap.end(); ++enfIt ) {
       if ( !enfIt->second.empty() ) {
         GeomShape = entryToShape(enfIt->first);
-        GeomType  = GeomShape.ShapeType();
+        if ( GeomShape.IsNull() )
+        {
+          createEnforcedVertexOnFace( GeomShape, enfIt->second );
+        }
         // Group Management
-        if (GeomType == TopAbs_COMPOUND){
+        else if ( GeomShape.ShapeType() == TopAbs_COMPOUND)
+        {
           for (TopoDS_Iterator it (GeomShape); it.More(); it.Next()){
             if (it.Value().ShapeType() == TopAbs_FACE){
               HasSizeMapOnFace = true;
@@ -1264,8 +1287,8 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
             }
           }
         }
-
-        if (GeomType == TopAbs_FACE){
+        else if ( GeomShape.ShapeType() == TopAbs_FACE)
+        {
           HasSizeMapOnFace = true;
           createEnforcedVertexOnFace(GeomShape, enfIt->second);
         }
@@ -1276,11 +1299,9 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
     bool useInternalVertexAllFaces = BLSURFPlugin_Hypothesis::GetInternalEnforcedVertexAllFaces(hyp);
     if (useInternalVertexAllFaces) {
       std::string grpName = BLSURFPlugin_Hypothesis::GetInternalEnforcedVertexAllFacesGroup(hyp);
-      MESSAGE("Setting Internal Enforced Vertices");
       gp_Pnt aPnt;
       TopExp_Explorer exp (theGeomShape, TopAbs_FACE);
       for (; exp.More(); exp.Next()){
-        MESSAGE("Iterating shapes. Shape type is " << exp.Current().ShapeType());
         TopExp_Explorer exp_face (exp.Current(), TopAbs_VERTEX, TopAbs_EDGE);
         for (; exp_face.More(); exp_face.Next())
         {
@@ -1288,7 +1309,6 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
           // Check if current coords is already in enfVertexList
           // If coords not in enfVertexList, add new enfVertex
           aPnt = BRep_Tool::Pnt(TopoDS::Vertex(exp_face.Current()));
-          MESSAGE("Found vertex on face at " << aPnt.X() <<", "<<aPnt.Y()<<", "<<aPnt.Z());
           BLSURFPlugin_Hypothesis::TEnfVertex* enfVertex = new BLSURFPlugin_Hypothesis::TEnfVertex();
           enfVertex->coords.push_back(aPnt.X());
           enfVertex->coords.push_back(aPnt.Y());
@@ -1304,15 +1324,12 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
       }
     }
 
-    MESSAGE("Setting Size Map on FACES ");
     cadsurf_set_sizemap_iso_cad_face(css, size_on_surface, &_smp_phy_size);
 
     if (HasSizeMapOnEdge){
-      MESSAGE("Setting Size Map on EDGES ");
       cadsurf_set_sizemap_iso_cad_edge(css, size_on_edge, &_smp_phy_size);
     }
     if (HasSizeMapOnVertex){
-      MESSAGE("Setting Size Map on VERTICES ");
       cadsurf_set_sizemap_iso_cad_point(css, size_on_vertex, &_smp_phy_size);
     }
   }
@@ -1323,24 +1340,15 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
    _preCadFacesIDsPeriodicityVector.clear();
    _preCadEdgesIDsPeriodicityVector.clear();
 
-  MESSAGE("SetParameters preCadFacesPeriodicityVector");
-  const BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector preCadFacesPeriodicityVector = BLSURFPlugin_Hypothesis::GetPreCadFacesPeriodicityVector(hyp);
-
   for (std::size_t i = 0; i<preCadFacesPeriodicityVector.size(); i++){
-    MESSAGE("SetParameters preCadFacesPeriodicityVector[" << i << "]");
     createPreCadFacesPeriodicity(theGeomShape, preCadFacesPeriodicityVector[i]);
   }
-  MESSAGE("_preCadFacesIDsPeriodicityVector.size() = " << _preCadFacesIDsPeriodicityVector.size());
 
-  MESSAGE("SetParameters preCadEdgesPeriodicityVector");
   const BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector preCadEdgesPeriodicityVector = BLSURFPlugin_Hypothesis::GetPreCadEdgesPeriodicityVector(hyp);
 
   for (std::size_t i = 0; i<preCadEdgesPeriodicityVector.size(); i++){
-    MESSAGE("SetParameters preCadEdgesPeriodicityVector[" << i << "]");
     createPreCadEdgesPeriodicity(theGeomShape, preCadEdgesPeriodicityVector[i]);
   }
-  MESSAGE("_preCadEdgesIDsPeriodicityVector.size() = " << _preCadEdgesIDsPeriodicityVector.size());
-
 }
 
 //================================================================================
@@ -1380,17 +1388,17 @@ namespace
   /*!
    * \brief Class correctly terminating usage of MG-CADSurf library at destruction
    */
-  class BLSURF_Cleaner
+  struct BLSURF_Cleaner
   {
-    context_t *       _ctx;
+    context_t *        _ctx;
     cadsurf_session_t* _css;
-    cad_t *           _cad;
-    dcad_t *          _dcad;
-  public:
-    BLSURF_Cleaner(context_t *       ctx,
-                   cadsurf_session_t* css,
-                   cad_t *           cad,
-                   dcad_t *          dcad)
+    cad_t *            _cad;
+    dcad_t *           _dcad;
+
+    BLSURF_Cleaner(context_t *        ctx,
+                   cadsurf_session_t* css=0,
+                   cad_t *            cad=0,
+                   dcad_t *           dcad=0)
       : _ctx ( ctx  ),
         _css ( css  ),
         _cad ( cad  ),
@@ -1568,12 +1576,17 @@ namespace
     const TopoDS_Face& makeProxyFace( SMESH_ProxyMesh::Ptr& viscousMesh,
                                       const TopoDS_Face&    origFace)
     {
-      // get data of nodes on inner boundary of viscous layers
       SMESH_Mesh* origMesh = viscousMesh->GetMesh();
+
+      SMESH_MesherHelper helper( *origMesh );
+      helper.SetSubShape( origFace );
+      const bool hasSeam = helper.HasRealSeam();
+
+      // get data of nodes on inner boundary of viscous layers
       TError err;
       TSideVector wireVec = StdMeshers_FaceSide::GetFaceWires(origFace, *origMesh,
                                                               /*skipMediumNodes = */true,
-                                                              err, viscousMesh );
+                                                              err, &helper, viscousMesh );
       if ( err && err->IsKO() )
         throw *err.get(); // it should be caught at SMESH_subMesh
 
@@ -1582,27 +1595,34 @@ namespace
       std::vector<TopoDS_Vertex>        tmpVertex;
 
       // create a proxy FACE
-      TopoDS_Shape origFaceCopy = origFace.EmptyCopied();
-      BRepBuilderAPI_MakeFace newFace( TopoDS::Face( origFaceCopy ));
+      TopoDS_Face origFaceCopy = TopoDS::Face( origFace.EmptyCopied() );
+      BRepBuilderAPI_MakeFace newFace( origFaceCopy );
+      bool hasPCurves = false;
       for ( size_t iW = 0; iW != wireVec.size(); ++iW )
       {
         StdMeshers_FaceSidePtr& wireData = wireVec[iW];
-        const UVPtStructVec& wirePoints = wireData->GetUVPtStruct();
+        const UVPtStructVec&  wirePoints = wireData->GetUVPtStruct();
         if ( wirePoints.size() < 3 )
           continue;
 
-        BRepBuilderAPI_MakePolygon wire;
+        BRepBuilderAPI_MakePolygon polygon;
         const size_t i0 = tmpVertex.size();
         for ( size_t iN = 0; iN < wirePoints.size(); ++iN )
         {
-          wire.Add( SMESH_TNodeXYZ( wirePoints[ iN ].node ));
+          polygon.Add( SMESH_TNodeXYZ( wirePoints[ iN ].node ));
           origNodes.push_back( wirePoints[ iN ].node );
-          tmpVertex.push_back( wire.LastVertex() );
+          tmpVertex.push_back( polygon.LastVertex() );
+
+          // check presence of a pcurve
+          checkPCurve( polygon, origFaceCopy, hasPCurves, &wirePoints[ iN-1 ] );
         }
-        tmpVertex[ i0 ] = wire.FirstVertex(); // wire.LastVertex()==NULL for 1 vertex in wire
-        wire.Close();
-        if ( !wire.IsDone() )
+        tmpVertex[ i0 ] = polygon.FirstVertex(); // polygon.LastVertex()==NULL for 1 vertex in wire
+        polygon.Close();
+        if ( !polygon.IsDone() )
           throw SALOME_Exception("BLSURFPlugin_BLSURF: BRepBuilderAPI_MakePolygon failed");
+        TopoDS_Wire wire = polygon;
+        if ( hasSeam )
+          wire = updateSeam( wire, origNodes );
         newFace.Add( wire );
       }
       _proxyFace = newFace;
@@ -1616,9 +1636,6 @@ namespace
 
       ShapeToMesh( auxCompoundToMesh );
 
-      //TopExp_Explorer fExp( auxCompoundToMesh, TopAbs_FACE );
-      //_proxyFace = TopoDS::Face( fExp.Current() );
-
 
       // Make input mesh for MG-CADSurf: segments on EDGE's of newFace
 
@@ -1630,8 +1647,8 @@ namespace
         GetSubMesh( tmpVertex[i] )->ComputeStateEngine( SMESH_subMesh::COMPUTE );
         if ( const SMDS_MeshNode* tmpN = SMESH_Algo::VertexNode( tmpVertex[i], tmpMeshDS ))
           _tmp2origNN.insert( _tmp2origNN.end(), make_pair( tmpN, origNodes[i] ));
-        else
-          throw SALOME_Exception("BLSURFPlugin_BLSURF: a proxy vertex not meshed");
+        // else -- it can be a seam vertex replaced by updateSeam()
+        //   throw SALOME_Exception("BLSURFPlugin_BLSURF: a proxy vertex not meshed");
       }
 
       // make segments
@@ -1650,6 +1667,69 @@ namespace
       return _proxyFace;
     }
 
+    //--------------------------------------------------------------------------------
+    /*!
+     * \brief Add pcurve to the last edge of a wire
+     */
+    //--------------------------------------------------------------------------------
+
+    void checkPCurve( BRepBuilderAPI_MakePolygon& wire,
+                      const TopoDS_Face&          face,
+                      bool &                      hasPCurves,
+                      const uvPtStruct *          wirePoints )
+    {
+      if ( hasPCurves )
+        return;
+      TopoDS_Edge edge = wire.Edge();
+      if ( edge.IsNull() ) return;
+      double f,l;
+      if ( BRep_Tool::CurveOnSurface(edge, face, f, l))
+      {
+        hasPCurves = true;
+        return;
+      }
+      gp_XY p1 = wirePoints[ 0 ].UV(), p2 = wirePoints[ 1 ].UV();
+      Handle(Geom2d_Line) pcurve = new Geom2d_Line( p1, gp_Dir2d( p2 - p1 ));
+      BRep_Builder().UpdateEdge( edge, Handle(Geom_Curve)(), Precision::Confusion() );
+      BRep_Builder().UpdateEdge( edge, pcurve, face, Precision::Confusion() );
+      BRep_Builder().Range( edge, 0, ( p2 - p1 ).Modulus() );
+      // cout << "n1 = mesh.AddNode( " << p1.X()*10 << ", " << p1.Y() << ", 0 )" << endl
+      //      << "n2 = mesh.AddNode( " << p2.X()*10 << ", " << p2.Y() << ", 0 )" << endl
+      //      << "mesh.AddEdge( [ n1, n2 ] )" << endl;
+    }
+
+    //--------------------------------------------------------------------------------
+    /*!
+     * \brief Replace coincident EDGEs with reversed copies.
+     */
+    //--------------------------------------------------------------------------------
+
+    TopoDS_Wire updateSeam( const TopoDS_Wire&                       wire,
+                            const std::vector<const SMDS_MeshNode*>& nodesOfVertices )
+    {
+      BRepBuilderAPI_MakeWire newWire;
+
+      typedef NCollection_DataMap<SMESH_TLink, TopoDS_Edge, SMESH_TLink > TSeg2EdgeMap;
+      TSeg2EdgeMap seg2EdgeMap;
+
+      TopoDS_Iterator edgeIt( wire );
+      for ( int iSeg = 1; edgeIt.More(); edgeIt.Next(), ++iSeg )
+      {
+        SMESH_TLink link( nodesOfVertices[ iSeg-1 ], nodesOfVertices[ iSeg ]);
+        TopoDS_Edge edge( TopoDS::Edge( edgeIt.Value() ));
+
+        TopoDS_Edge* edgeInMap = seg2EdgeMap.Bound( link, edge );
+        bool            isSeam = ( *edgeInMap != edge );
+        if ( isSeam )
+        {
+          edgeInMap->Reverse();
+          edge = *edgeInMap;
+        }
+        newWire.Add( edge );
+      }
+      return newWire;
+    }
+
     //--------------------------------------------------------------------------------
     /*!
      * \brief Fill in the origMesh with faces computed by MG-CADSurf in this tmp mesh
@@ -1726,10 +1806,8 @@ status_t interrupt_cb(integer *interrupt_status, void *user_data);
  */
 //=============================================================================
 
-bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) {
-
-  MESSAGE("BLSURFPlugin_BLSURF::Compute");
-
+bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
+{
   // Fix problem with locales
   Kernel_Utils::Localizer aLocalizer;
 
@@ -1797,12 +1875,12 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
   /* create a distene context (generic object) */
   status_t status = STATUS_ERROR;
 
-  myMesh = &aMesh;
   SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
-  SMESH_MesherHelper helper( aMesh );
+  SMESH_MesherHelper helper( aMesh ), helperWithShape( aMesh );
+  myHelper = theHelper = & helperWithShape;
   // do not call helper.IsQuadraticSubMesh() because sub-meshes
   // may be cleaned and helper.myTLinkNodeMap gets invalid in such a case
-  bool haveQuadraticSubMesh = SMESH_MesherHelper( aMesh ).IsQuadraticSubMesh( aShape );
+  bool haveQuadraticSubMesh = helperWithShape.IsQuadraticSubMesh( aShape );
   bool quadraticSubMeshAndViscousLayer = false;
   bool needMerge = false;
   typedef set< SMESHDS_SubMesh*, ShapeTypeCompare > TSubMeshSet;
@@ -1811,6 +1889,9 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
 
   TopTools_IndexedMapOfShape pmap, emap, fmap;
 
+  TopTools_IndexedDataMapOfShapeListOfShape e2ffmap;
+  TopExp::MapShapesAndAncestors( aShape, TopAbs_EDGE, TopAbs_FACE, e2ffmap );
+
   // Issue 0019864. On DebianSarge, FE signals do not obey to OSD::SetSignal(false)
 #ifndef WIN32
   feclearexcept( FE_ALL_EXCEPT );
@@ -1835,14 +1916,8 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
   cad_t *c     = cad_new(ctx);
   dcad_t *dcad = dcad_new(c);
 
-  FacesWithSizeMap.Clear();
-  FaceId2SizeMap.clear();
-  FaceId2ClassAttractor.clear();
-  FaceIndex2ClassAttractor.clear();
-  EdgesWithSizeMap.Clear();
-  EdgeId2SizeMap.clear();
-  VerticesWithSizeMap.Clear();
-  VertexId2SizeMap.clear();
+  // To enable multithreading
+  cad_set_thread_safety(c, 1);
 
   /* Now fill the CAD object with data from your CAD
    * environement. This is the most complex part of a successfull
@@ -1856,11 +1931,7 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
   // an object that correctly deletes all cadsurf objects at destruction
   BLSURF_Cleaner cleaner( ctx,css,c,dcad );
 
-  MESSAGE("BEGIN SetParameters");
   SetParameters(_hypothesis, css, aShape);
-  MESSAGE("END SetParameters");
-
-  MESSAGE("_preCadFacesIDsPeriodicityVector.size() = " << _preCadFacesIDsPeriodicityVector.size());
 
   haveQuadraticSubMesh = haveQuadraticSubMesh || (_hypothesis != NULL && _hypothesis->GetQuadraticMesh());
   helper.SetIsQuadratic( haveQuadraticSubMesh );
@@ -1912,10 +1983,6 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
       f.Orientation(TopAbs_FORWARD);
 
     iface = fmap.Add(f);
-//    std::string aFileName = "fmap_face_";
-//    aFileName.append(val_to_string(iface));
-//    aFileName.append(".brep");
-//    BRepTools::Write(f,aFileName.c_str());
 
     surfaces.push_back(BRep_Tool::Surface(f));
 
@@ -1933,7 +2000,8 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
 
     /* by default a face has no tag (color).
        The following call sets it to the same value as the Geom module ID : */
-    const int faceTag = meshDS->ShapeToIndex(f);
+    int faceTag = meshDS->ShapeToIndex(f);
+    faceTag = BLSURFPlugin_Hypothesis::GetHyperPatchTag( faceTag, _hypothesis );
     cad_face_set_tag(fce, faceTag);
 
     /* Set face orientation (optional if you want a well oriented output mesh)*/
@@ -1950,8 +2018,8 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
       faceKey = FacesWithSizeMap.FindIndex(f);
 
 
-      if (FaceId2SizeMap.find(faceKey)!=FaceId2SizeMap.end()) {
-        MESSAGE("A size map is defined on face :"<<faceKey);
+      if (FaceId2SizeMap.find(faceKey)!=FaceId2SizeMap.end())
+      {
         theSizeMapStr = FaceId2SizeMap[faceKey];
         // check if function ends with "return"
         if (theSizeMapStr.find(bad_end) == (theSizeMapStr.size()-bad_end.size()-1))
@@ -1972,23 +2040,16 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
       std::map<int,std::vector<double> >::iterator attractor_iter = FaceId2AttractorCoords.begin();
 
       for (; attractor_iter != FaceId2AttractorCoords.end(); ++attractor_iter) {
-        if (attractor_iter->first == faceKey) {
-          MESSAGE("Face indice: " << iface);
-          MESSAGE("Adding attractor");
-
+        if (attractor_iter->first == faceKey)
+        {
           double xyzCoords[3]  = {attractor_iter->second[2],
                                   attractor_iter->second[3],
                                   attractor_iter->second[4]};
 
-          MESSAGE("Check position of vertex =(" << xyzCoords[0] << "," << xyzCoords[1] << "," << xyzCoords[2] << ")");
           gp_Pnt P(xyzCoords[0],xyzCoords[1],xyzCoords[2]);
           BRepClass_FaceClassifier scl(f,P,1e-7);
-          // OCC 6.3sp6 : scl.Perform() is bugged. The function was rewritten
-          // BRepClass_FaceClassifierPerform(&scl,f,P,1e-7);
-          // OCC 6.5.2: scl.Perform() is not bugged anymore
           scl.Perform(f, P, 1e-7);
           TopAbs_State result = scl.State();
-          MESSAGE("Position of point on face: "<<result);
           if ( result == TopAbs_OUT )
             MESSAGE("Point is out of face: node is not created");
           if ( result == TopAbs_UNKNOWN )
@@ -1998,10 +2059,8 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
           if ( result == TopAbs_IN )
           {
             // Point is inside face and not on border
-            MESSAGE("Point is in face: node is created");
             double uvCoords[2] = {attractor_iter->second[0],attractor_iter->second[1]};
             ienf++;
-            MESSAGE("Add cad point on (u,v)=(" << uvCoords[0] << "," << uvCoords[1] << ") with id = " << ienf);
             cad_point_t* point_p = cad_point_new(fce, ienf, uvCoords);
             cad_point_set_tag(point_p, ienf);
           }
@@ -2014,8 +2073,6 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
       // -----------------
       TId2ClsAttractorVec::iterator clAttractor_iter = FaceId2ClassAttractor.find(faceKey);
       if (clAttractor_iter != FaceId2ClassAttractor.end()){
-        MESSAGE("Face indice: " << iface);
-        MESSAGE("Adding attractor");
         std::vector< BLSURFPlugin_Attractor* > & attVec = clAttractor_iter->second;
         for ( size_t i = 0; i < attVec.size(); ++i )
           if ( !attVec[i]->IsMapBuilt() ) {
@@ -2027,83 +2084,44 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
       }
     } // if (HasSizeMapOnFace && !use_precad)
 
-      // ------------------
-      // Enforced Vertices
-      // ------------------
+    // ------------------
+    // Enforced Vertices
+    // ------------------
     faceKey = FacesWithEnforcedVertices.FindIndex(f);
     std::map<int,BLSURFPlugin_Hypothesis::TEnfVertexCoordsList >::const_iterator evmIt = FaceId2EnforcedVertexCoords.find(faceKey);
-    if (evmIt != FaceId2EnforcedVertexCoords.end()) {
-      MESSAGE("Some enforced vertices are defined");
-      BLSURFPlugin_Hypothesis::TEnfVertexCoordsList evl;
-      MESSAGE("Face indice: " << iface);
-      MESSAGE("Adding enforced vertices");
-      evl = evmIt->second;
-      MESSAGE("Number of vertices to add: "<< evl.size());
+    if (evmIt != FaceId2EnforcedVertexCoords.end())
+    {
+      BLSURFPlugin_Hypothesis::TEnfVertexCoordsList evl = evmIt->second;
       BLSURFPlugin_Hypothesis::TEnfVertexCoordsList::const_iterator evlIt = evl.begin();
-      for (; evlIt != evl.end(); ++evlIt) {
+      for (; evlIt != evl.end(); ++evlIt)
+      {
+        double uvCoords[2] = { evlIt->at(0), evlIt->at(1) };
+        ienf++;
+        cad_point_t* point_p = cad_point_new(fce, ienf, uvCoords);
+        int tag = 0;
         BLSURFPlugin_Hypothesis::TEnfVertexCoords xyzCoords;
         xyzCoords.push_back(evlIt->at(2));
         xyzCoords.push_back(evlIt->at(3));
         xyzCoords.push_back(evlIt->at(4));
-        MESSAGE("Check position of vertex =(" << xyzCoords[0] << "," << xyzCoords[1] << "," << xyzCoords[2] << ")");
-        gp_Pnt P(xyzCoords[0],xyzCoords[1],xyzCoords[2]);
-        BRepClass_FaceClassifier scl(f,P,1e-7);
-        // OCC 6.3sp6 : scl.Perform() is bugged. The function was rewritten
-        // BRepClass_FaceClassifierPerform(&scl,f,P,1e-7);
-        // OCC 6.5.2: scl.Perform() is not bugged anymore
-        scl.Perform(f, P, 1e-7);
-        TopAbs_State result = scl.State();
-        MESSAGE("Position of point on face: "<<result);
-        if ( result == TopAbs_OUT ) {
-          MESSAGE("Point is out of face: node is not created");
-          if (EnfVertexCoords2ProjVertex.find(xyzCoords) != EnfVertexCoords2ProjVertex.end()) {
-            EnfVertexCoords2ProjVertex.erase(xyzCoords);
-            // isssue 22783. Do not erase as this point can be IN other face of a group
-            //EnfVertexCoords2EnfVertexList.erase(xyzCoords);
-          }
-        }
-        if ( result == TopAbs_UNKNOWN ) {
-          MESSAGE("Point position on face is unknown: node is not created");
-          if (EnfVertexCoords2ProjVertex.find(xyzCoords) != EnfVertexCoords2ProjVertex.end()) {
-            EnfVertexCoords2ProjVertex.erase(xyzCoords);
-            //EnfVertexCoords2EnfVertexList.erase(xyzCoords);
-          }
-        }
-        if ( result == TopAbs_ON ) {
-          MESSAGE("Point is on border of face: node is not created");
-          if (EnfVertexCoords2ProjVertex.find(xyzCoords) != EnfVertexCoords2ProjVertex.end()) {
-            EnfVertexCoords2ProjVertex.erase(xyzCoords);
-            //EnfVertexCoords2EnfVertexList.erase(xyzCoords);
-          }
-        }
-        if ( result == TopAbs_IN )
+        std::map< BLSURFPlugin_Hypothesis::TEnfVertexCoords, BLSURFPlugin_Hypothesis::TEnfVertexList >::const_iterator enfCoordsIt = EnfVertexCoords2EnfVertexList.find(xyzCoords);
+        if (enfCoordsIt != EnfVertexCoords2EnfVertexList.end() &&
+            !enfCoordsIt->second.empty() )
         {
-          // Point is inside face and not on border
-          MESSAGE("Point is in face: node is created");
-          double uvCoords[2]   = {evlIt->at(0),evlIt->at(1)};
-          ienf++;
-          MESSAGE("Add cad point on (u,v)=(" << uvCoords[0] << "," << uvCoords[1] << ") with id = " << ienf);
-          cad_point_t* point_p = cad_point_new(fce, ienf, uvCoords);
-          int tag = 0;
-          std::map< BLSURFPlugin_Hypothesis::TEnfVertexCoords, BLSURFPlugin_Hypothesis::TEnfVertexList >::const_iterator enfCoordsIt = EnfVertexCoords2EnfVertexList.find(xyzCoords);
-          if (enfCoordsIt != EnfVertexCoords2EnfVertexList.end() &&
-              !enfCoordsIt->second.empty() )
+          // to merge nodes of an INTERNAL vertex belonging to several faces
+          TopoDS_Vertex     v = (*enfCoordsIt->second.begin() )->vertex;
+          if ( v.IsNull() ) v = (*enfCoordsIt->second.rbegin())->vertex;
+          if ( !v.IsNull() && meshDS->ShapeToIndex( v ) > 0 )
           {
-            // to merge nodes of an INTERNAL vertex belonging to several faces
-            TopoDS_Vertex     v = (*enfCoordsIt->second.begin())->vertex;
-            if ( v.IsNull() ) v = (*enfCoordsIt->second.rbegin())->vertex;
-            if ( !v.IsNull() ) {
-              tag = pmap.Add( v );
-              SMESH_subMesh* vSM = aMesh.GetSubMesh( v );
-              vSM->ComputeStateEngine( SMESH_subMesh::COMPUTE );
-              mergeSubmeshes.insert( vSM->GetSubMeshDS() );
-              // //if ( tag != pmap.Extent() )
-              // needMerge = true;
-            }
+            tag = pmap.Add( v );
+            SMESH_subMesh* vSM = aMesh.GetSubMesh( v );
+            vSM->ComputeStateEngine( SMESH_subMesh::COMPUTE );
+            mergeSubmeshes.insert( vSM->GetSubMeshDS() );
+            // //if ( tag != pmap.Extent() )
+            // needMerge = true;
           }
-          if ( tag == 0 ) tag = ienf;
-          cad_point_set_tag(point_p, tag);
         }
+        if ( tag == 0 ) tag = ienf;
+        cad_point_set_tag(point_p, tag);
       }
       FaceId2EnforcedVertexCoords.erase(faceKey);
 
@@ -2121,18 +2139,13 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
       if (ic <= 0)
         ic = emap.Add(e);
 
-//      std::string aFileName = "fmap_edge_";
-//      aFileName.append(val_to_string(ic));
-//      aFileName.append(".brep");
-//      BRepTools::Write(e,aFileName.c_str());
-
       double tmin,tmax;
       curves.push_back(BRep_Tool::CurveOnSurface(e, f, tmin, tmax));
 
       if (HasSizeMapOnEdge){
         edgeKey = EdgesWithSizeMap.FindIndex(e);
-        if (EdgeId2SizeMap.find(edgeKey)!=EdgeId2SizeMap.end()) {
-          MESSAGE("Sizemap defined on edge with index " << edgeKey);
+        if (EdgeId2SizeMap.find(edgeKey)!=EdgeId2SizeMap.end())
+        {
           theSizeMapStr = EdgeId2SizeMap[edgeKey];
           if (theSizeMapStr.find(bad_end) == (theSizeMapStr.size()-bad_end.size()-1))
             continue;
@@ -2192,7 +2205,26 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
 
       /* by default an edge has no tag (color).
          The following call sets it to the same value as the edge_id : */
-      cad_edge_set_tag(edg, ic);
+      // IMP23368. Do not set tag to an EDGE shared by FACEs of a hyper-patch
+      bool isInHyperPatch = false;
+      {
+        std::set< int > faceTags, faceIDs;
+        TopTools_ListIteratorOfListOfShape fIt( e2ffmap.FindFromKey( e ));
+        for ( ; fIt.More(); fIt.Next() )
+        {
+          int faceTag = meshDS->ShapeToIndex( fIt.Value() );
+          if ( !faceIDs.insert( faceTag ).second )
+            continue; // a face encounters twice for a seam edge
+          int hpTag   = BLSURFPlugin_Hypothesis::GetHyperPatchTag( faceTag, _hypothesis );
+          if ( !faceTags.insert( hpTag ).second )
+          {
+            isInHyperPatch = true;
+            break;
+          }
+        }
+      }
+      if ( !isInHyperPatch )
+        cad_edge_set_tag(edg, ic);
 
       /* by default, an edge does not necessalry appear in the resulting mesh,
          unless the following property is set :
@@ -2268,7 +2300,6 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
           vertexKey = VerticesWithSizeMap.FindIndex(v);
           if (VertexId2SizeMap.find(vertexKey)!=VertexId2SizeMap.end()){
             theSizeMapStr = VertexId2SizeMap[vertexKey];
-            //MESSAGE("VertexId2SizeMap[faceKey]: " << VertexId2SizeMap[vertexKey]);
             if (theSizeMapStr.find(bad_end) == (theSizeMapStr.size()-bad_end.size()-1))
               continue;
             // Expr To Python function, verification is performed at validation in GUI
@@ -2344,10 +2375,8 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
   // PERIODICITY       //
   ///////////////////////
 
-  MESSAGE("BEFORE PERIODICITY");
-  MESSAGE("_preCadFacesIDsPeriodicityVector.size() = " << _preCadFacesIDsPeriodicityVector.size());
-  if (! _preCadFacesIDsPeriodicityVector.empty()) {
-    MESSAGE("INTO PRECAD FACES PERIODICITY");
+  if (! _preCadFacesIDsPeriodicityVector.empty())
+  {
     for (std::size_t i=0; i < _preCadFacesIDsPeriodicityVector.size(); i++){
       std::vector<int> theFace1_ids = _preCadFacesIDsPeriodicityVector[i].shape1IDs;
       std::vector<int> theFace2_ids = _preCadFacesIDsPeriodicityVector[i].shape2IDs;
@@ -2361,47 +2390,39 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
       for (std::size_t j=0; j < theFace2_ids.size(); j++)
         o << theFace2_ids[j] << ", ";
       o << "]";
-      MESSAGE(o.str());
-      MESSAGE("theFace1_ids.size(): " << theFace1_ids.size());
-      MESSAGE("theFace2_ids.size(): " << theFace2_ids.size());
+      // if ( _hypothesis->GetVerbosity() > _hypothesis->GetDefaultVerbosity() )
+      //   cout << o.str() << endl;
       if (_preCadFacesIDsPeriodicityVector[i].theSourceVerticesCoords.empty())
-        {
-          // If no source points, call peridoicity without transformation function
-          MESSAGE("periodicity without transformation function");
-          meshgems_cad_periodicity_transformation_t periodicity_transformation = NULL;
-          status = cad_add_face_multiple_periodicity_with_transformation_function(c, theFace1_ids_c, theFace1_ids.size(),
-              theFace2_ids_c, theFace2_ids.size(), periodicity_transformation, NULL);
-          if(status != STATUS_OK)
-            cout << "cad_add_face_multiple_periodicity_with_transformation_function failed with error code " << status << "\n";
-        }
+      {
+        // If no source points, call periodicity without transformation function
+        meshgems_cad_periodicity_transformation_t periodicity_transformation = NULL;
+        status = cad_add_face_multiple_periodicity_with_transformation_function(c, theFace1_ids_c, theFace1_ids.size(),
+                                                                                theFace2_ids_c, theFace2_ids.size(), periodicity_transformation, NULL);
+        if(status != STATUS_OK)
+          cout << "cad_add_face_multiple_periodicity_with_transformation_function failed with error code " << status << "\n";
+      }
       else
-        {
-          // get the transformation vertices
-          MESSAGE("periodicity with transformation vertices");
-          double* theSourceVerticesCoords_c = &_preCadFacesIDsPeriodicityVector[i].theSourceVerticesCoords[0];
-          double* theTargetVerticesCoords_c = &_preCadFacesIDsPeriodicityVector[i].theTargetVerticesCoords[0];
-          int nbSourceVertices = _preCadFacesIDsPeriodicityVector[i].theSourceVerticesCoords.size()/3;
-          int nbTargetVertices = _preCadFacesIDsPeriodicityVector[i].theTargetVerticesCoords.size()/3;
-
-          MESSAGE("nbSourceVertices: " << nbSourceVertices << ", nbTargetVertices: " << nbTargetVertices);
-
-          status = cad_add_face_multiple_periodicity_with_transformation_function_by_points(c, theFace1_ids_c, theFace1_ids.size(),
-              theFace2_ids_c, theFace2_ids.size(), theSourceVerticesCoords_c, nbSourceVertices, theTargetVerticesCoords_c, nbTargetVertices);
-          if(status != STATUS_OK)
-            cout << "cad_add_face_multiple_periodicity_with_transformation_function_by_points failed with error code " << status << "\n";
-        }
+      {
+        // get the transformation vertices
+        double* theSourceVerticesCoords_c = &_preCadFacesIDsPeriodicityVector[i].theSourceVerticesCoords[0];
+        double* theTargetVerticesCoords_c = &_preCadFacesIDsPeriodicityVector[i].theTargetVerticesCoords[0];
+        int nbSourceVertices = _preCadFacesIDsPeriodicityVector[i].theSourceVerticesCoords.size()/3;
+        int nbTargetVertices = _preCadFacesIDsPeriodicityVector[i].theTargetVerticesCoords.size()/3;
+
+        status = cad_add_face_multiple_periodicity_with_transformation_function_by_points(c, theFace1_ids_c, theFace1_ids.size(),
+                                                                                          theFace2_ids_c, theFace2_ids.size(), theSourceVerticesCoords_c, nbSourceVertices, theTargetVerticesCoords_c, nbTargetVertices);
+        if(status != STATUS_OK)
+          cout << "cad_add_face_multiple_periodicity_with_transformation_function_by_points failed with error code " << status << "\n";
+      }
     }
-
-    MESSAGE("END PRECAD FACES PERIODICITY");
   }
 
-  MESSAGE("_preCadEdgesIDsPeriodicityVector.size() = " << _preCadEdgesIDsPeriodicityVector.size());
-  if (! _preCadEdgesIDsPeriodicityVector.empty()) {
-    MESSAGE("INTO PRECAD EDGES PERIODICITY");
+  if (! _preCadEdgesIDsPeriodicityVector.empty())
+  {
     for (std::size_t i=0; i < _preCadEdgesIDsPeriodicityVector.size(); i++){
       std::vector<int> theEdge1_ids = _preCadEdgesIDsPeriodicityVector[i].shape1IDs;
       std::vector<int> theEdge2_ids = _preCadEdgesIDsPeriodicityVector[i].shape2IDs;
-      // Use the address of the first element of the vector to initialise the array
+      // Use the address of the first element of the vector to initialize the array
       int* theEdge1_ids_c = &theEdge1_ids[0];
       int* theEdge2_ids_c = &theEdge2_ids[0];
 
@@ -2413,41 +2434,32 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
       for (std::size_t j=0; j < theEdge2_ids.size(); j++)
         o << theEdge2_ids[j] << ", ";
       o << "]";
-      MESSAGE(o.str());
-      MESSAGE("theEdge1_ids.size(): " << theEdge1_ids.size());
-      MESSAGE("theEdge2_ids.size(): " << theEdge2_ids.size());
+      // if ( _hypothesis->GetVerbosity() > _hypothesis->GetDefaultVerbosity() )
+      //   cout << o.str() << endl;
 
       if (_preCadEdgesIDsPeriodicityVector[i].theSourceVerticesCoords.empty())
-        {
-          // If no source points, call peridoicity without transformation function
-          MESSAGE("periodicity without transformation function");
-          meshgems_cad_periodicity_transformation_t periodicity_transformation = NULL;
-          status = cad_add_edge_multiple_periodicity_with_transformation_function(c, theEdge1_ids_c, theEdge1_ids.size(),
-              theEdge2_ids_c, theEdge2_ids.size(), periodicity_transformation, NULL);
-          if(status != STATUS_OK)
-            cout << "cad_add_edge_multiple_periodicity_with_transformation_function failed with error code " << status << "\n";
-        }
+      {
+        // If no source points, call periodicity without transformation function
+        meshgems_cad_periodicity_transformation_t periodicity_transformation = NULL;
+        status = cad_add_edge_multiple_periodicity_with_transformation_function(c, theEdge1_ids_c, theEdge1_ids.size(),
+                                                                                theEdge2_ids_c, theEdge2_ids.size(), periodicity_transformation, NULL);
+        if(status != STATUS_OK)
+          cout << "cad_add_edge_multiple_periodicity_with_transformation_function failed with error code " << status << "\n";
+      }
       else
-        {
-          // get the transformation vertices
-          MESSAGE("periodicity with transformation vertices");
-          double* theSourceVerticesCoords_c = &_preCadEdgesIDsPeriodicityVector[i].theSourceVerticesCoords[0];
-          double* theTargetVerticesCoords_c = &_preCadEdgesIDsPeriodicityVector[i].theTargetVerticesCoords[0];
-          int nbSourceVertices = _preCadEdgesIDsPeriodicityVector[i].theSourceVerticesCoords.size()/3;
-          int nbTargetVertices = _preCadEdgesIDsPeriodicityVector[i].theTargetVerticesCoords.size()/3;
-
-          MESSAGE("nbSourceVertices: " << nbSourceVertices << ", nbTargetVertices: " << nbTargetVertices);
-
-          status = cad_add_edge_multiple_periodicity_with_transformation_function_by_points(c, theEdge1_ids_c, theEdge1_ids.size(),
-              theEdge2_ids_c, theEdge2_ids.size(), theSourceVerticesCoords_c, nbSourceVertices, theTargetVerticesCoords_c, nbTargetVertices);
-          if(status != STATUS_OK)
-            cout << "cad_add_edge_multiple_periodicity_with_transformation_function_by_points failed with error code " << status << "\n";
-          else
-            MESSAGE("cad_add_edge_multiple_periodicity_with_transformation_function_by_points succeeded.\n");
-        }
+      {
+        // get the transformation vertices
+        double* theSourceVerticesCoords_c = &_preCadEdgesIDsPeriodicityVector[i].theSourceVerticesCoords[0];
+        double* theTargetVerticesCoords_c = &_preCadEdgesIDsPeriodicityVector[i].theTargetVerticesCoords[0];
+        int nbSourceVertices = _preCadEdgesIDsPeriodicityVector[i].theSourceVerticesCoords.size()/3;
+        int nbTargetVertices = _preCadEdgesIDsPeriodicityVector[i].theTargetVerticesCoords.size()/3;
+
+        status = cad_add_edge_multiple_periodicity_with_transformation_function_by_points(c, theEdge1_ids_c, theEdge1_ids.size(),
+                                                                                          theEdge2_ids_c, theEdge2_ids.size(), theSourceVerticesCoords_c, nbSourceVertices, theTargetVerticesCoords_c, nbTargetVertices);
+        if(status != STATUS_OK)
+          cout << "cad_add_edge_multiple_periodicity_with_transformation_function_by_points failed with error code " << status << "\n";
+      }
     }
-
-    MESSAGE("END PRECAD EDGES PERIODICITY");
   }
 
   
@@ -2553,8 +2565,8 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
     projVertex.push_back((double)xyz[1]);
     projVertex.push_back((double)xyz[2]);
     std::map< BLSURFPlugin_Hypothesis::TEnfVertexCoords, BLSURFPlugin_Hypothesis::TEnfVertexList >::const_iterator enfCoordsIt = EnfVertexCoords2EnfVertexList.find(projVertex);
-    if (enfCoordsIt != EnfVertexCoords2EnfVertexList.end()) {
-      MESSAGE("Found enforced vertex @ " << xyz[0] << ", " << xyz[1] << ", " << xyz[2]);
+    if (enfCoordsIt != EnfVertexCoords2EnfVertexList.end())
+    {
       BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator enfListIt = enfCoordsIt->second.begin();
       BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
       for (; enfListIt != enfCoordsIt->second.end(); ++enfListIt) {
@@ -2562,25 +2574,17 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
         if (currentEnfVertex->grpName != "") {
           bool groupDone = false;
           SMESH_Mesh::GroupIteratorPtr grIt = aMesh.GetGroups();
-          MESSAGE("currentEnfVertex->grpName: " << currentEnfVertex->grpName);
-          MESSAGE("Parsing the groups of the mesh");
           while (grIt->more()) {
             SMESH_Group * group = grIt->next();
             if ( !group ) continue;
-            MESSAGE("Group: " << group->GetName());
             SMESHDS_GroupBase* groupDS = group->GetGroupDS();
             if ( !groupDS ) continue;
-            MESSAGE("group->SMDSGroup().GetType(): " << (groupDS->GetType()));
-            MESSAGE("group->SMDSGroup().GetType()==SMDSAbs_Node: " << (groupDS->GetType()==SMDSAbs_Node));
-            MESSAGE("currentEnfVertex->grpName.compare(group->GetStoreName())==0: " << (currentEnfVertex->grpName.compare(group->GetName())==0));
             if ( groupDS->GetType()==SMDSAbs_Node && currentEnfVertex->grpName.compare(group->GetName())==0) {
               SMESHDS_Group* aGroupDS = static_cast<SMESHDS_Group*>( groupDS );
               aGroupDS->SMDSGroup().Add(nodes[iv]);
-              MESSAGE("Node ID: " << nodes[iv]->GetID());
               // How can I inform the hypothesis ?
               //                 _hypothesis->AddEnfVertexNodeID(currentEnfVertex->grpName,nodes[iv]->GetID());
               groupDone = true;
-              MESSAGE("Successfully added enforced vertex to existing group " << currentEnfVertex->grpName);
               break;
             }
           }
@@ -2591,7 +2595,6 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
             aGroup->SetName( currentEnfVertex->grpName.c_str() );
             SMESHDS_Group* aGroupDS = static_cast<SMESHDS_Group*>( aGroup->GetGroupDS() );
             aGroupDS->SMDSGroup().Add(nodes[iv]);
-            MESSAGE("Successfully created enforced vertex group " << currentEnfVertex->grpName);
             groupDone = true;
           }
           if (!groupDone)
@@ -2827,8 +2830,17 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
     SMESH_subMesh* sm = aMesh.GetSubMesh( f );
     if ( !sm->GetSubMeshDS() || sm->GetSubMeshDS()->NbElements() == 0 )
     {
-      sm->GetComputeError().reset( new SMESH_ComputeError( err, _comment, this ));
-      badFaceFound = true;
+      int faceTag = sm->GetId();
+      if ( faceTag != BLSURFPlugin_Hypothesis::GetHyperPatchTag( faceTag, _hypothesis ))
+      {
+        // triangles are assigned to the first face of hyper-patch
+        sm->SetIsAlwaysComputed( true );
+      }
+      else
+      {
+        sm->GetComputeError().reset( new SMESH_ComputeError( err, _comment, this ));
+        badFaceFound = true;
+      }
     }
   }
   if ( err == COMPERR_WARNING )
@@ -2857,10 +2869,169 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
     FacesWithEnforcedVertices.Statistics(std::cout);
   */
 
-  MESSAGE("END OF BLSURFPlugin_BLSURF::Compute()");
   return ( status == STATUS_OK && !quadraticSubMeshAndViscousLayer );
 }
 
+//================================================================================
+/*!
+ * \brief Compute a mesh basing on discrete CAD description
+ */
+//================================================================================
+
+bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelper)
+{
+  if ( aMesh.NbFaces() == 0 )
+    return error( COMPERR_BAD_INPUT_MESH, "2D elements are missing" );
+
+  context_t *ctx = context_new();
+  if (!ctx) return error("Pb in context_new()");
+
+  BLSURF_Cleaner cleaner( ctx );
+
+  message_cb_user_data mcud;
+  mcud._error     = & this->SMESH_Algo::_comment;
+  mcud._progress  = & this->SMESH_Algo::_progress;
+  mcud._verbosity =
+    _hypothesis ? _hypothesis->GetVerbosity() : BLSURFPlugin_Hypothesis::GetDefaultVerbosity();
+  meshgems_status_t ret = context_set_message_callback(ctx, message_cb, &mcud);
+  if (ret != STATUS_OK) return error("Pb. in context_set_message_callback() ");
+
+  cadsurf_session_t * css = cadsurf_session_new(ctx);
+  if(!css) return error( "Pb. in cadsurf_session_new() " );
+  cleaner._css = css;
+
+
+  // Fill an input mesh
+
+  mesh_t * msh = meshgems_mesh_new_in_memory( ctx );
+  if ( !msh ) return error("Pb. in meshgems_mesh_new_in_memory()"); 
+
+  // mark nodes used by 2D elements
+  SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
+  SMDS_NodeIteratorPtr nodeIt = meshDS->nodesIterator();
+  while ( nodeIt->more() )
+  {
+    const SMDS_MeshNode* n = nodeIt->next();
+    n->setIsMarked( n->NbInverseElements( SMDSAbs_Face ));
+  }
+  meshgems_mesh_set_vertex_count( msh, meshDS->NbNodes() );
+
+  // set node coordinates
+  if ( meshDS->NbNodes() != meshDS->MaxNodeID() )
+  {
+    meshDS->compactMesh();
+  }
+  SMESH_TNodeXYZ nXYZ;
+  nodeIt = meshDS->nodesIterator();
+  meshgems_integer i;
+  for ( i = 1; nodeIt->more(); ++i )
+  {
+    nXYZ.Set( nodeIt->next() );
+    meshgems_mesh_set_vertex_coordinates( msh, i, nXYZ._xyz );
+  }
+
+  // set nodes of faces
+  meshgems_mesh_set_triangle_count  ( msh, meshDS->GetMeshInfo().NbTriangles() );
+  meshgems_mesh_set_quadrangle_count( msh, meshDS->GetMeshInfo().NbQuadrangles() );
+  meshgems_integer nodeIDs[4];
+  meshgems_integer iT = 1, iQ = 1;
+  SMDS_FaceIteratorPtr faceIt = meshDS->facesIterator();
+  while ( faceIt->more() )
+  {
+    const SMDS_MeshElement* face = faceIt->next();
+    meshgems_integer nbNodes = face->NbCornerNodes();
+    if ( nbNodes > 4 || face->IsPoly() ) continue;
+
+    for ( i = 0; i < nbNodes; ++i )
+      nodeIDs[i] = face->GetNode( i )->GetID();
+    if ( nbNodes == 3 )
+      meshgems_mesh_set_triangle_vertices  ( msh, iT++, nodeIDs );
+    else
+      meshgems_mesh_set_quadrangle_vertices( msh, iQ++, nodeIDs );
+  }
+
+  ret = cadsurf_set_mesh(css, msh);
+  if ( ret != STATUS_OK ) return error("Pb in cadsurf_set_mesh()");
+
+
+  // Compute the mesh
+
+  SetParameters(_hypothesis, css, aMesh.GetShapeToMesh() );
+
+  ret = cadsurf_compute_mesh(css);
+  if ( ret != STATUS_OK ) return false;
+
+  mesh_t *omsh = 0;
+  cadsurf_get_mesh(css, &omsh);
+  if ( !omsh ) return error( "Pb. in cadsurf_get_mesh()" );
+
+
+  // Update SALOME mesh
+
+  // remove quadrangles and triangles
+  for ( faceIt = meshDS->facesIterator(); faceIt->more();  )
+  {
+    const SMDS_MeshElement* face = faceIt->next();
+    if ( !face->IsPoly() )
+      meshDS->RemoveFreeElement( face, /*sm=*/0, /*fromGroups=*/true );
+  }
+  // remove edges that bound the just removed faces
+  for ( SMDS_EdgeIteratorPtr edgeIt = meshDS->edgesIterator(); edgeIt->more(); )
+  {
+    const SMDS_MeshElement* edge = edgeIt->next();
+    const SMDS_MeshNode* n0 = edge->GetNode(0);
+    const SMDS_MeshNode* n1 = edge->GetNode(1);
+    if ( n0->isMarked() &&
+         n1->isMarked() &&
+         n0->NbInverseElements( SMDSAbs_Volume ) == 0 &&
+         n1->NbInverseElements( SMDSAbs_Volume ) == 0 )
+      meshDS->RemoveFreeElement( edge, /*sm=*/0, /*fromGroups=*/true );
+  }
+  // remove nodes that just became free
+  for ( nodeIt = meshDS->nodesIterator(); nodeIt->more(); )
+  {
+    const SMDS_MeshNode* n = nodeIt->next();
+    if ( n->isMarked() && n->NbInverseElements() == 0 )
+      meshDS->RemoveFreeNode( n, /*sm=*/0, /*fromGroups=*/true );
+  }
+
+  // add nodes
+  meshgems_integer nbvtx = 0, nodeID;
+  meshgems_mesh_get_vertex_count( omsh, &nbvtx );
+  meshgems_real xyz[3];
+  for ( i = 1; i <= nbvtx; ++i )
+  {
+    meshgems_mesh_get_vertex_coordinates( omsh, i, xyz );
+    SMDS_MeshNode* n = meshDS->AddNode( xyz[0], xyz[1], xyz[2] );
+    nodeID = n->GetID();
+    meshgems_mesh_set_vertex_tag( omsh, i, &nodeID ); // save mapping of IDs in MG and SALOME meshes
+  }
+
+  // add triangles
+  meshgems_integer nbtri = 0;
+  meshgems_mesh_get_triangle_count( omsh, &nbtri );
+  const SMDS_MeshNode* nodes[3];
+  for ( i = 1; i <= nbtri; ++i )
+  {
+    meshgems_mesh_get_triangle_vertices( omsh, i, nodeIDs );
+    for ( int j = 0; j < 3; ++j )
+    {
+      meshgems_mesh_get_vertex_tag( omsh, nodeIDs[j], &nodeID );
+      nodes[j] = meshDS->FindNode( nodeID );
+    }
+    meshDS->AddFace( nodes[0], nodes[1], nodes[2] );
+  }
+
+  cadsurf_regain_mesh(css, omsh);
+
+  // as we don't assign the new triangles to a shape (the pseudo-shape),
+  // we mark the shape as always computed to avoid the error messages
+  // that no elements assigned to the shape
+  aMesh.GetSubMesh( aHelper->GetSubShape() )->SetIsAlwaysComputed( true );
+
+  return true;
+}
+
 //================================================================================
 /*!
  * \brief Terminates computation
@@ -2878,7 +3049,10 @@ void BLSURFPlugin_BLSURF::CancelCompute()
  */
 //=============================================================================
 
-void BLSURFPlugin_BLSURF::Set_NodeOnEdge(SMESHDS_Mesh* meshDS, const SMDS_MeshNode* node, const TopoDS_Shape& ed) {
+void BLSURFPlugin_BLSURF::Set_NodeOnEdge(SMESHDS_Mesh*        meshDS,
+                                         const SMDS_MeshNode* node,
+                                         const TopoDS_Shape&  ed)
+{
   const TopoDS_Edge edge = TopoDS::Edge(ed);
 
   gp_Pnt pnt(node->X(), node->Y(), node->Z());
@@ -3015,7 +3189,7 @@ status_t size_on_surface(integer face_id, real *uv, real *size, void *user_data)
     if ( pyresult != NULL) {
       result = PyFloat_AsDouble(pyresult);
       Py_DECREF(pyresult);
-//       *size = result;
+      //       *size = result;
     }
     else{
       fflush(stderr);
@@ -3033,10 +3207,8 @@ status_t size_on_surface(integer face_id, real *uv, real *size, void *user_data)
     *size = result;
     PyGILState_Release(gstate);
   }
-  else if (( f2attVec = FaceIndex2ClassAttractor.find(face_id)) != FaceIndex2ClassAttractor.end() && !f2attVec->second.empty()){
-//    MESSAGE("attractor used on face :"<<face_id)
-    // MESSAGE("List of attractor is not empty")
-    // MESSAGE("Attractor empty : "<< FaceIndex2ClassAttractor[face_id]->Empty())
+  else if (( f2attVec = FaceIndex2ClassAttractor.find(face_id)) != FaceIndex2ClassAttractor.end() && !f2attVec->second.empty())
+  {
     real result = 0;
     result = 1e100;
     std::vector< BLSURFPlugin_Attractor* > & attVec = f2attVec->second;
@@ -3049,10 +3221,9 @@ status_t size_on_surface(integer face_id, real *uv, real *size, void *user_data)
     *size = result;
   }
   else {
-    // MESSAGE("List of attractor is empty !!!")
     *size = *((real*)user_data);
   }
-//   std::cout << "Size_on_surface sur la face " << face_id << " donne une size de: " << *size << std::endl;
+  //   std::cout << "Size_on_surface sur la face " << face_id << " donne une size de: " << *size << std::endl;
   return STATUS_OK;
 }
 
@@ -3210,7 +3381,6 @@ bool BLSURFPlugin_BLSURF::Evaluate(SMESH_Mesh&         aMesh,
     //0020968: EDF1545 SMESH: Problem in the creation of a mesh group on geometry
     // GetDefaultPhySize() sometimes leads to computation failure
     _phySize = aMesh.GetShapeDiagonalSize() / _gen->GetBoundaryBoxSegmentation();
-    MESSAGE("BLSURFPlugin_BLSURF::SetParameters using defaults");
   }
 
   bool IsQuadratic = _quadraticMesh;
index e87d33e948395b7daeac601ab9e7e7eea754e1cc..14ff95fb913d5a945f314f86b4293ed9750e7953 100644 (file)
@@ -75,7 +75,7 @@ class TopoDS_Shape;
 
 class BLSURFPlugin_BLSURF: public SMESH_2D_Algo {
   public:
-    BLSURFPlugin_BLSURF(int hypId, SMESH_Gen* gen);
+    BLSURFPlugin_BLSURF(int hypId, SMESH_Gen* gen, bool theHasGEOM);
 
     virtual ~BLSURFPlugin_BLSURF();
 
@@ -86,6 +86,7 @@ class BLSURFPlugin_BLSURF: public SMESH_2D_Algo {
     void SetParameters(const BLSURFPlugin_Hypothesis* hyp, cadsurf_session_t *css, const TopoDS_Shape& shape);
 
     virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape);
+    virtual bool Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelper);
 
     virtual void CancelCompute();
     bool computeCanceled() { return _compute_canceled; }
@@ -157,7 +158,7 @@ class BLSURFPlugin_BLSURF: public SMESH_2D_Algo {
   private:
       PyObject *          main_mod;
       PyObject *          main_dict;
-      SMESH_Mesh*         myMesh;
+      SMESH_MesherHelper* myHelper;
 
       volatile bool _compute_canceled;
 };
index b2235158cf9a5857c43d3132af9d5f8b07b063ea..ea8a9f9d56b4ee638468191b16f81dd86097c679 100644 (file)
 //=============================================================================
 
 BLSURFPlugin_BLSURF_i::BLSURFPlugin_BLSURF_i( PortableServer::POA_ptr thePOA,
-                                              ::SMESH_Gen*            theGenImpl )
+                                              ::SMESH_Gen*            theGenImpl,
+                                              bool                    theHasGEOM )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA ), 
        SMESH_Algo_i( thePOA ),
        SMESH_2D_Algo_i( thePOA )
 {
-  MESSAGE( "BLSURFPlugin_BLSURF_i::BLSURFPlugin_BLSURF_i" );
   myBaseImpl = new ::BLSURFPlugin_BLSURF( theGenImpl->GetANewId(),
-                                          theGenImpl );
+                                          theGenImpl,
+                                          theHasGEOM);
 }
 
 //=============================================================================
@@ -58,7 +59,6 @@ BLSURFPlugin_BLSURF_i::BLSURFPlugin_BLSURF_i( PortableServer::POA_ptr thePOA,
 
 BLSURFPlugin_BLSURF_i::~BLSURFPlugin_BLSURF_i()
 {
-  MESSAGE( "BLSURFPlugin_BLSURF_i::~BLSURFPlugin_BLSURF_i" );
 }
 
 //=============================================================================
@@ -71,6 +71,5 @@ BLSURFPlugin_BLSURF_i::~BLSURFPlugin_BLSURF_i()
 
 ::BLSURFPlugin_BLSURF* BLSURFPlugin_BLSURF_i::GetImpl()
 {
-  MESSAGE( "BLSURFPlugin_BLSURF_i::GetImpl" );
   return ( ::BLSURFPlugin_BLSURF* )myBaseImpl;
 }
index 3d382ee6cd0e09705c25633de36e26069d50725c..8c1d5707dd4e18d00ecd3c525f1a103dbc79cb17 100644 (file)
@@ -41,7 +41,8 @@ class BLSURFPlugin_BLSURF_i:
 public:
   // Constructor
   BLSURFPlugin_BLSURF_i( PortableServer::POA_ptr thePOA,
-                         ::SMESH_Gen*            theGenImpl );
+                         ::SMESH_Gen*            theGenImpl,
+                         bool                    theHasGEOM);
   // Destructor
   virtual ~BLSURFPlugin_BLSURF_i();
  
index 12d12bfdfbecbf082ca6bc31fcb0672cda5cbc77..0d8d9f99d4b92cc2af2570a375bdfa87f42c845e 100644 (file)
@@ -49,8 +49,8 @@ namespace
 }
 
 //=============================================================================
-BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen) :
-  SMESH_Hypothesis(hypId, gen),
+BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen, bool hasgeom) :
+  SMESH_Hypothesis(hypId, gen), 
   _physicalMesh(GetDefaultPhysicalMesh()),
   _geometricMesh(GetDefaultGeometricMesh()),
   _phySize(GetDefaultPhySize()),
@@ -81,7 +81,6 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen) :
   _verb(GetDefaultVerbosity()),
   _topology(GetDefaultTopology()),
   _preCADMergeEdges(GetDefaultPreCADMergeEdges()),
-  _preCADRemoveTinyUVEdges(GetDefaultPreCADRemoveTinyUVEdges()),
   _preCADRemoveDuplicateCADFaces(GetDefaultPreCADRemoveDuplicateCADFaces()),
   _preCADProcess3DTopology(GetDefaultPreCADProcess3DTopology()),
   _preCADDiscardInput(GetDefaultPreCADDiscardInput()),
@@ -100,7 +99,7 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen) :
   _preCadEdgesPeriodicityVector(GetDefaultPreCadEdgesPeriodicityVector()),
   _GMFFileName(GetDefaultGMFFile())
 {
-  _name = GetHypType();
+  _name = GetHypType(hasgeom);
   _param_algo_dim = 2;
   
 //   _GMFFileMode = false; // GMF ascii mode
@@ -116,11 +115,14 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen) :
                                             // "optimise_tiny_edges",                      // default = 0
                                             // "remove_duplicate_cad_faces",               // default = 1
                                             "tiny_edge_avoid_surface_intersections",    // default = 1
+                                            "debug",                                    // default = 0 
+                                            "use_deprecated_patch_mesher",              // default 0
                                             // "tiny_edge_respect_geometry",               // default = 0
                                             "" // mark of end
       };
 
   const char* intOptionNames[] = {          "max_number_of_points_per_patch",           // default = 100000
+                                            "max_number_of_threads",                    // default = 4
                                             "" // mark of end
       };
   const char* doubleOptionNames[] = {       // "surface_intersections_processing_max_cost",// default = 15
@@ -140,9 +142,11 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen) :
                                             "merge_edges",                              // default =  = 1
                                             "remove_duplicate_cad_faces",               // default = 1
                                             // "create_tag_on_collision",                  // default = 1
-                                            "debug",                                    // default = 0 
                                             "process_3d_topology",                      // default = 1
                                             // "remove_tiny_edges",                        // default = 0
+                                            // remove_tiny_uv_edges option is not documented
+                                            // but it is useful that the user can change it to disable all preprocessing options
+                                            "remove_tiny_uv_edges",                        // default = 1
                                             "" // mark of end
       };
   const char* preCADintOptionNames[] = {    // "manifold_geometry",                        // default = 0
@@ -165,7 +169,7 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen) :
     _option2value[boolOptionNames[i++]].clear();
   }
   i = 0;
-  while (preCADboolOptionNames[i][0])
+  while (preCADboolOptionNames[i][0] && hasgeom)
   {
     _boolOptions.insert( preCADboolOptionNames[i] );
     _preCADoption2value[preCADboolOptionNames[i++]].clear();
@@ -175,7 +179,7 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen) :
     _option2value[intOptionNames[i++]].clear();
   
   i = 0;
-  while (preCADintOptionNames[i][0])
+  while (preCADintOptionNames[i][0] && hasgeom)
     _preCADoption2value[preCADintOptionNames[i++]].clear();
 
   i = 0;
@@ -184,7 +188,7 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen) :
     _option2value[doubleOptionNames[i++]].clear();
   }
   i = 0;
-  while (preCADdoubleOptionNames[i][0]) {
+  while (preCADdoubleOptionNames[i][0] && hasgeom) {
     _preCADdoubleOptions.insert(preCADdoubleOptionNames[i]);
     _preCADoption2value[preCADdoubleOptionNames[i++]].clear();
   }
@@ -194,7 +198,7 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen) :
     _option2value[charOptionNames[i++]].clear();
   }
   i = 0;
-  while (preCADcharOptionNames[i][0]) {
+  while (preCADcharOptionNames[i][0] && hasgeom) {
     _preCADcharOptions.insert(preCADcharOptionNames[i]);
     _preCADoption2value[preCADcharOptionNames[i++]].clear();
   }
@@ -204,19 +208,26 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen) :
   _defaultOptionValues["enforce_cad_edge_sizes"                 ] = "no";
   _defaultOptionValues["jacobian_rectification_respect_geometry"] = "yes";
   _defaultOptionValues["max_number_of_points_per_patch"         ] = "0";
+  _defaultOptionValues["max_number_of_threads"                  ] = "4";
   _defaultOptionValues["rectify_jacobian"                       ] = "yes";
+  _defaultOptionValues["use_deprecated_patch_mesher"            ] = "yes";
   _defaultOptionValues["respect_geometry"                       ] = "yes";
   _defaultOptionValues["tiny_edge_avoid_surface_intersections"  ] = "yes";
-  _defaultOptionValues["process_3d_topology"                    ] = "no";
-  _defaultOptionValues["closed_geometry"                        ] = "no";
+  _defaultOptionValues["use_deprecated_patch_mesher"            ] = "no";
   _defaultOptionValues["debug"                                  ] = "no";
-  _defaultOptionValues["discard_input_topology"                 ] = "no";
-  _defaultOptionValues["merge_edges"                            ] = "no";
-  _defaultOptionValues["periodic_tolerance"                     ] = "1e-5*D";
-  _defaultOptionValues["remove_duplicate_cad_faces"             ] = "no";
-  _defaultOptionValues["required_entities"                      ] = "respect";
-  _defaultOptionValues["sewing_tolerance"                       ] = "5e-4*D";
-  _defaultOptionValues["tags"                                   ] = "respect";
+  if ( hasgeom )
+  {
+    _defaultOptionValues["closed_geometry"                        ] = "no";
+    _defaultOptionValues["discard_input_topology"                 ] = "no";
+    _defaultOptionValues["merge_edges"                            ] = "no";
+    _defaultOptionValues["periodic_tolerance"                     ] = "1e-5*D";
+    _defaultOptionValues["process_3d_topology"                    ] = "no";
+    _defaultOptionValues["remove_duplicate_cad_faces"             ] = "no";
+    _defaultOptionValues["remove_tiny_uv_edges"                   ] = "no";
+    _defaultOptionValues["required_entities"                      ] = "respect";
+    _defaultOptionValues["sewing_tolerance"                       ] = "5e-4*D";
+    _defaultOptionValues["tags"                                   ] = "respect";
+  }
 
 #ifdef _DEBUG_
   // check validity of option names of _defaultOptionValues
@@ -225,7 +236,7 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen) :
     ASSERT( _option2value.count( n2v->first ) || _preCADoption2value.count( n2v->first ));
   ASSERT( _option2value.size() + _preCADoption2value.size() == _defaultOptionValues.size() );
 #endif
-      
+
   _sizeMap.clear();
   _attractors.clear();
   _faceEntryEnfVertexListMap.clear();
@@ -244,7 +255,6 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen) :
 
 TopoDS_Shape BLSURFPlugin_Hypothesis::entryToShape(std::string entry)
 {
-  MESSAGE("BLSURFPlugin_Hypothesis::entryToShape "<<entry );
   GEOM::GEOM_Object_var aGeomObj;
   
   TopoDS_Shape S = TopoDS_Shape();
@@ -288,7 +298,6 @@ void BLSURFPlugin_Hypothesis::SetPhySize(double theVal, bool isRelative) {
     _phySizeRel = isRelative;
     if (theVal == 0) {
       _phySize = GetMaxSize();
-      MESSAGE("Warning: nul physical size is not allowed");
     }
     else
       _phySize = theVal;
@@ -530,6 +539,21 @@ bool BLSURFPlugin_Hypothesis::GetJacobianRectification()
 }
 //=============================================================================
 
+void BLSURFPlugin_Hypothesis::SetUseDeprecatedPatchMesher( bool useDeprecatedPatchMesher )
+{
+  if ( GetUseDeprecatedPatchMesher() != useDeprecatedPatchMesher )
+  {
+    SetOptionValue( "use_deprecated_patch_mesher", useDeprecatedPatchMesher ? "yes" : "no" );
+    NotifySubMeshesHypothesisModification();
+  }
+}
+//=============================================================================
+bool BLSURFPlugin_Hypothesis::GetUseDeprecatedPatchMesher()
+{
+  return ToBool( GetOptionValue("use_deprecated_patch_mesher", GET_DEFAULT()));
+}
+//=============================================================================
+
 void BLSURFPlugin_Hypothesis::SetMaxNumberOfPointsPerPatch( int nb )
   throw (std::invalid_argument)
 {
@@ -549,6 +573,25 @@ int BLSURFPlugin_Hypothesis::GetMaxNumberOfPointsPerPatch()
 }
 //=============================================================================
 
+void BLSURFPlugin_Hypothesis::SetMaxNumberOfThreads( int nb )
+  throw (std::invalid_argument)
+{
+  if ( nb < 0 )
+    throw std::invalid_argument( SMESH_Comment("Invalid number of threads: ") << nb );
+
+  if ( GetMaxNumberOfThreads() != nb )
+  {
+    SetOptionValue("max_number_of_threads", SMESH_Comment( nb ));
+    NotifySubMeshesHypothesisModification();
+  }
+}
+//=============================================================================
+int BLSURFPlugin_Hypothesis::GetMaxNumberOfThreads()
+{
+  return ToInt( GetOptionValue("max_number_of_threads", GET_DEFAULT()));
+}
+//=============================================================================
+
 void BLSURFPlugin_Hypothesis::SetRespectGeometry( bool toRespect )
 {
   if ( GetRespectGeometry() != toRespect )
@@ -684,20 +727,83 @@ std::string BLSURFPlugin_Hypothesis::GetTags()
   return GetPreCADOptionValue("tags", GET_DEFAULT());
 }
 //=============================================================================
-void BLSURFPlugin_Hypothesis::SetPreCADMergeEdges(bool theVal)
+void BLSURFPlugin_Hypothesis::SetHyperPatches(const THyperPatchList& hpl)
 {
-  if (theVal != ToBool( GetPreCADOptionValue("merge_edges", GET_DEFAULT()))) {
-    _preCADMergeEdges = theVal;
-    SetPreCADOptionValue("merge_edges", theVal ? "yes" : "no" );
+  if ( hpl != _hyperPatchList )
+  {
+    // join patches sharing tags
+    _hyperPatchList.clear();
+    for ( size_t i = 0; i < hpl.size(); ++i )
+    {
+      const THyperPatchTags& tags = hpl[i];
+      if ( tags.size() < 2 ) continue;
+
+      std::set<int> iPatches;
+      if ( !_hyperPatchList.empty() )
+      {
+        THyperPatchTags::iterator t = tags.begin();
+        for ( ; t != tags.end(); ++t )
+        {
+          int iPatch = -1;
+          GetHyperPatchTag( *t, this, &iPatch );
+          if ( iPatch >= 0 )
+            iPatches.insert( iPatch );
+        }
+      }
+
+      if ( iPatches.empty() )
+      {
+        _hyperPatchList.push_back( tags );
+      }
+      else
+      {
+        std::set<int>::iterator iPatch = iPatches.begin();
+        THyperPatchTags&     mainPatch = _hyperPatchList[ *iPatch ];
+        mainPatch.insert( tags.begin(), tags.end() );
+
+        for ( ++iPatch; iPatch != iPatches.end(); ++iPatch )
+        {
+          mainPatch.insert( _hyperPatchList[ *iPatch ].begin(), _hyperPatchList[ *iPatch ].end() );
+          _hyperPatchList[ *iPatch ].clear();
+        }
+        if ( iPatches.size() > 1 )
+          for ( int j = _hyperPatchList.size()-1; j > 0; --j )
+            if ( _hyperPatchList[j].empty() )
+              _hyperPatchList.erase( _hyperPatchList.begin() + j );
+      }
+    }
     NotifySubMeshesHypothesisModification();
   }
 }
+//=============================================================================
+/*!
+ * \brief Return a tag of a face taking into account the hyper-patches. Optionally
+ *        return an index of a patch including the face
+ */
+//================================================================================
 
+int BLSURFPlugin_Hypothesis::GetHyperPatchTag( const int                      faceTag,
+                                               const BLSURFPlugin_Hypothesis* hyp,
+                                               int*                           iPatch)
+{
+  if ( hyp )
+  {
+    const THyperPatchList& hpl = hyp->_hyperPatchList;
+    for ( size_t i = 0; i < hpl.size(); ++i )
+      if ( hpl[i].count( faceTag ))
+      {
+        if ( iPatch ) *iPatch = i;
+        return *( hpl[i].begin() );
+      }
+  }
+  return faceTag;
+}
 //=============================================================================
-void BLSURFPlugin_Hypothesis::SetPreCADRemoveTinyUVEdges(bool theVal)
+void BLSURFPlugin_Hypothesis::SetPreCADMergeEdges(bool theVal)
 {
-  if (theVal != _preCADRemoveTinyUVEdges) {
-    _preCADRemoveTinyUVEdges = theVal;
+  if (theVal != ToBool( GetPreCADOptionValue("merge_edges", GET_DEFAULT()))) {
+    _preCADMergeEdges = theVal;
+    SetPreCADOptionValue("merge_edges", theVal ? "yes" : "no" );
     NotifySubMeshesHypothesisModification();
   }
 }
@@ -736,7 +842,7 @@ void BLSURFPlugin_Hypothesis::SetPreCADDiscardInput(bool theVal)
 // Return true if any PreCAD option is activated
 bool BLSURFPlugin_Hypothesis::HasPreCADOptions(const BLSURFPlugin_Hypothesis* hyp)
 {
-  if ( !hyp )
+  if ( !hyp || hyp->_name == GetHypType(/*hasgeom=*/false))
   {
     return false;
   }
@@ -753,6 +859,7 @@ bool BLSURFPlugin_Hypothesis::HasPreCADOptions(const BLSURFPlugin_Hypothesis* hy
            !hyp->_facesPeriodicityVector.empty()                                         ||
            !hyp->_edgesPeriodicityVector.empty()                                         ||
            !hyp->_verticesPeriodicityVector.empty()                                      ||
+           !hyp->GetHyperPatches().empty()                                               ||
            hyp->GetTopology() != FromCAD );
 }
 
@@ -1226,7 +1333,6 @@ void BLSURFPlugin_Hypothesis::ClearEntry(const std::string& entry,
            ++it_clAt;
        }
        while ( it_clAt != _classAttractors.end() );
-       MESSAGE("_classAttractors.size() = "<<_classAttractors.size())
        NotifySubMeshesHypothesisModification();
      }
      else
@@ -1253,7 +1359,6 @@ void BLSURFPlugin_Hypothesis::ClearSizeMaps() {
 //                                                        bool toEnforceInternalVertices,
 //                                                        TEnfGroupName theGroupName) {
 
-//  MESSAGE("BLSURFPlugin_Hypothesis::SetInternalEnforcedVertex("<< theFaceEntry << ", "
 //      << toEnforceInternalVertices << ", " << theGroupName << ")");
   
 //  TFaceEntryInternalVerticesList::iterator it = _faceEntryInternalVerticesList.find(theFaceEntry);
@@ -1276,15 +1381,14 @@ void BLSURFPlugin_Hypothesis::ClearSizeMaps() {
 //=======================================================================
 //function : SetEnforcedVertex
 //=======================================================================
-bool BLSURFPlugin_Hypothesis::SetEnforcedVertex(TEntry theFaceEntry, TEnfName theVertexName, TEntry theVertexEntry,
-                                                TEnfGroupName theGroupName, double x, double y, double z) {
-
-  MESSAGE("BLSURFPlugin_Hypothesis::SetEnforcedVertex("<< theFaceEntry << ", "
-      << x << ", " << y << ", " << z << ", " << theVertexName << ", " << theVertexEntry << ", " << theGroupName << ")");
-
+bool BLSURFPlugin_Hypothesis::SetEnforcedVertex(TEntry        theFaceEntry,
+                                                TEnfName      theVertexName,
+                                                TEntry        theVertexEntry,
+                                                TEnfGroupName theGroupName,
+                                                double x, double y, double z)
+{
   SetPhysicalMesh(PhysicalLocalSize);
 
-  //  TEnfVertexList::iterator it;
   bool toNotify = false;
   bool toCreate = true;
 
@@ -1301,27 +1405,23 @@ bool BLSURFPlugin_Hypothesis::SetEnforcedVertex(TEntry theFaceEntry, TEnfName th
   newEnfVertex->grpName = theGroupName;
   newEnfVertex->faceEntries.clear();
   newEnfVertex->faceEntries.insert(theFaceEntry);
-  
-  
+
+
   // update _enfVertexList
   TEnfVertexList::iterator it = _enfVertexList.find(newEnfVertex);
   if (it != _enfVertexList.end()) {
     toCreate = false;
     oldEnVertex = (*it);
-    MESSAGE("Enforced Vertex was found => Update");
     if (oldEnVertex->name != theVertexName) {
-      MESSAGE("Update name from \"" << oldEnVertex->name << "\" to \"" << theVertexName << "\"");
       oldEnVertex->name = theVertexName;
       toNotify = true;
     }
     if (oldEnVertex->grpName != theGroupName) {
-      MESSAGE("Update group name from \"" << oldEnVertex->grpName << "\" to \"" << theGroupName << "\"");
       oldEnVertex->grpName = theGroupName;
       toNotify = true;
     }
     TEntryList::iterator it_faceEntries = oldEnVertex->faceEntries.find(theFaceEntry);
     if (it_faceEntries == oldEnVertex->faceEntries.end()) {
-      MESSAGE("Update face list by adding \"" << theFaceEntry << "\"");
       oldEnVertex->faceEntries.insert(theFaceEntry);
       _faceEntryEnfVertexListMap[theFaceEntry].insert(oldEnVertex);
       toNotify = true;
@@ -1344,7 +1444,6 @@ bool BLSURFPlugin_Hypothesis::SetEnforcedVertex(TEntry theFaceEntry, TEnfName th
 //   //////// CREATE ////////////
   if (toCreate) {
     toNotify = true;
-    MESSAGE("Creating new enforced vertex");
     _faceEntryEnfVertexListMap[theFaceEntry].insert(newEnfVertex);
     _enfVertexList.insert(newEnfVertex);
     if (theVertexEntry == "") {
@@ -1360,7 +1459,6 @@ bool BLSURFPlugin_Hypothesis::SetEnforcedVertex(TEntry theFaceEntry, TEnfName th
   if (toNotify)
     NotifySubMeshesHypothesisModification();
 
-  MESSAGE("BLSURFPlugin_Hypothesis::SetEnforcedVertex END");
   return toNotify;
 }
 
@@ -1474,7 +1572,6 @@ bool BLSURFPlugin_Hypothesis::ClearEnforcedVertex(const TEntry& theFaceEntry, do
   TEnfVertexEntryEnfVertexMap::iterator it_enfVertexEntry = _enfVertexEntryEnfVertexMap.find(theVertexEntry);
   if (it_enfVertexEntry != _enfVertexEntryEnfVertexMap.end()) {
     // Success
-    MESSAGE("Found enforced vertex with geom entry " << theVertexEntry);
     oldEnfVertex = it_enfVertexEntry->second;
 
     _enfVertexEntryEnfVertexMap.erase(it_enfVertexEntry);
@@ -1496,7 +1593,6 @@ bool BLSURFPlugin_Hypothesis::ClearEnforcedVertex(const TEntry& theFaceEntry, do
     TCoordsEnfVertexMap::iterator it_coords_enf = _coordsEnfVertexMap.find(coords);
     if (it_coords_enf != _coordsEnfVertexMap.end()) {
       // Success
-      MESSAGE("Found enforced vertex with coords " << x << ", " << y << ", " << z);
       oldEnfVertex = it_coords_enf->second;
 
       _coordsEnfVertexMap.erase(it_coords_enf);
@@ -1519,8 +1615,6 @@ bool BLSURFPlugin_Hypothesis::ClearEnforcedVertex(const TEntry& theFaceEntry, do
     }
   }
 
-  MESSAGE("Remove enf vertex from _enfVertexList");
-
   // update _enfVertexList
   TEnfVertexList::iterator it = _enfVertexList.find(oldEnfVertex);
   if (it != _enfVertexList.end()) {
@@ -1529,7 +1623,6 @@ bool BLSURFPlugin_Hypothesis::ClearEnforcedVertex(const TEntry& theFaceEntry, do
       _enfVertexList.erase(it);
       toNotify = true;
     }
-    MESSAGE("Done");
   }
 
   // update _faceEntryEnfVertexListMap
@@ -1537,9 +1630,7 @@ bool BLSURFPlugin_Hypothesis::ClearEnforcedVertex(const TEntry& theFaceEntry, do
   currentEnfVertexList.erase(oldEnfVertex);
 
   if (currentEnfVertexList.size() == 0) {
-    MESSAGE("Remove _faceEntryEnfVertexListMap[" << theFaceEntry <<"]");
     _faceEntryEnfVertexListMap.erase(theFaceEntry);
-    MESSAGE("Done");
   }
 
   if (toNotify)
@@ -1574,7 +1665,6 @@ bool BLSURFPlugin_Hypothesis::ClearEnforcedVertices(const TEntry& theFaceEntry)
           _enfVertexList.erase(it);
           toNotify = true;
         }
-        MESSAGE("Done");
       }
     }
     _faceEntryCoordsListMap.erase(it_entry_coords);
@@ -1598,7 +1688,6 @@ bool BLSURFPlugin_Hypothesis::ClearEnforcedVertices(const TEntry& theFaceEntry)
           _enfVertexList.erase(it);
           toNotify = true;
         }
-        MESSAGE("Done");
       }
     }
     _faceEntryEnfVertexEntryListMap.erase(it_entry_entry);
@@ -1777,7 +1866,7 @@ void BLSURFPlugin_Hypothesis::ClearPreCadPeriodicityVectors() {
 //function : AddPreCadFacesPeriodicity
 //=======================================================================
 void BLSURFPlugin_Hypothesis::AddPreCadFacesPeriodicity(TEntry theFace1Entry, TEntry theFace2Entry,
-    std::vector<std::string> &theSourceVerticesEntries, std::vector<std::string> &theTargetVerticesEntries) {
+                                                        std::vector<std::string> &theSourceVerticesEntries, std::vector<std::string> &theTargetVerticesEntries) {
 
   TPreCadPeriodicity preCadFacesPeriodicity;
   preCadFacesPeriodicity.shape1Entry = theFace1Entry;
@@ -1808,44 +1897,45 @@ void BLSURFPlugin_Hypothesis::AddPreCadEdgesPeriodicity(TEntry theEdge1Entry, TE
 }
 
 //=============================================================================
-std::ostream & BLSURFPlugin_Hypothesis::SaveTo(std::ostream & save) {
-   // We must keep at least the same number of arguments when increasing the SALOME version
-   // When MG-CADSurf becomes CADMESH, some parameters were fused into a single one. Thus the same
-   // parameter can be written several times to keep the old global number of parameters.
+std::ostream & BLSURFPlugin_Hypothesis::SaveTo(std::ostream & save)
+{
+  // We must keep at least the same number of arguments when increasing the SALOME version
+  // When MG-CADSurf becomes CADMESH, some parameters were fused into a single one. Thus the same
+  // parameter can be written several times to keep the old global number of parameters.
+
+  // Treat old options which are now in the advanced options
+  TOptionValues::iterator op_val;
+  int _decimesh = -1;
+  int _preCADRemoveNanoEdges = -1;
+  double _preCADEpsNano = -1.0;
+  op_val = _option2value.find("respect_geometry");
+  if (op_val != _option2value.end()) {
+    std::string value = op_val->second;
+    if (!value.empty())
+      _decimesh = value.compare("1") == 0 ? 1 : 0;
+  }
+  op_val = _preCADoption2value.find("remove_tiny_edges");
+  if (op_val != _preCADoption2value.end()) {
+    std::string value = op_val->second;
+    if (!value.empty())
+      _preCADRemoveNanoEdges = value.compare("1") == 0 ? 1 : 0;
+  }
+  op_val = _preCADoption2value.find("tiny_edge_length");
+  if (op_val != _preCADoption2value.end()) {
+    std::string value = op_val->second;
+    if (!value.empty())
+      _preCADEpsNano = strtod(value.c_str(), NULL);
+  }
 
-   // Treat old options which are now in the advanced options
-   TOptionValues::iterator op_val;
-   int _decimesh = -1;
-   int _preCADRemoveNanoEdges = -1;
-   double _preCADEpsNano = -1.0;
-   op_val = _option2value.find("respect_geometry");
-   if (op_val != _option2value.end()) {
-     std::string value = op_val->second;
-     if (!value.empty())
-       _decimesh = value.compare("1") == 0 ? 1 : 0;
-   }
-   op_val = _preCADoption2value.find("remove_tiny_edges");
-   if (op_val != _preCADoption2value.end()) {
-     std::string value = op_val->second;
-     if (!value.empty())
-       _preCADRemoveNanoEdges = value.compare("1") == 0 ? 1 : 0;
-   }
-   op_val = _preCADoption2value.find("tiny_edge_length");
-   if (op_val != _preCADoption2value.end()) {
-     std::string value = op_val->second;
-     if (!value.empty())
-       _preCADEpsNano = strtod(value.c_str(), NULL);
-   }
-   
   save << " " << (int) _topology << " " << (int) _physicalMesh << " " << (int) _geometricMesh << " " << _phySize << " "
-      << _angleMesh << " " << _gradation << " " << (int) _quadAllowed << " " << _decimesh;
+       << _angleMesh << " " << _gradation << " " << (int) _quadAllowed << " " << _decimesh;
   save << " " << _minSize << " " << _maxSize << " " << _angleMesh << " " << _minSize << " " << _maxSize << " " << _verb;
   save << " " << (int) _preCADMergeEdges << " " << _preCADRemoveNanoEdges << " " << (int) _preCADDiscardInput << " " << _preCADEpsNano ;
   save << " " << (int) _enforcedInternalVerticesAllFaces;
   save << " " << (int) _phySizeRel << " " << (int) _minSizeRel << " " << (int) _maxSizeRel << " " << _chordalError ;
   save << " " << (int) _anisotropic << " " << _anisotropicRatio << " " << (int) _removeTinyEdges << " " << _tinyEdgeLength ;
   save << " " << (int) _badElementRemoval << " " << _badElementAspectRatio << " " << (int) _optimizeMesh << " " << (int) _quadraticMesh ;
-  save << " " << (int) _preCADProcess3DTopology << " " << (int) _preCADRemoveDuplicateCADFaces << " " << (int) _preCADRemoveTinyUVEdges;
+  save << " " << (int) _preCADProcess3DTopology << " " << (int) _preCADRemoveDuplicateCADFaces;
   save << " " << (int)_optimiseTinyEdges << " " << _tinyEdgeOptimisationLength;
   save << " " << (int)_correctSurfaceIntersec << " " << _corrSurfaceIntersCost;
   save << " " << (int)_useGradation << " " << (int)_useVolumeGradation << " " << _volumeGradation;
@@ -1918,7 +2008,6 @@ std::ostream & BLSURFPlugin_Hypothesis::SaveTo(std::ostream & save) {
     }
     save << " " << "__NEW_ATTRACTORS_END__";
     test << " " << "__NEW_ATTRACTORS_END__";
-    MESSAGE(" Attractor hypothesis saved as "<<test.str())
   }
 
   TEnfVertexList::const_iterator it_enf = _enfVertexList.begin();
@@ -1955,7 +2044,10 @@ std::ostream & BLSURFPlugin_Hypothesis::SaveTo(std::ostream & save) {
         save << " " << "__BEGIN_FACELIST__";
       }
       for (; faceEntriesIt != enfVertex->faceEntries.end(); ++faceEntriesIt)
-        save << " " << (*faceEntriesIt);
+        if ( faceEntriesIt->empty() )
+          save << " _no_face_";
+        else
+          save << " " << (*faceEntriesIt);
       if (hasFaces)
         save << " " << "__END_FACELIST__";
       save << " " << "__END_VERTEX__";
@@ -1972,6 +2064,17 @@ std::ostream & BLSURFPlugin_Hypothesis::SaveTo(std::ostream & save) {
   SaveEdgesPeriodicity(save);
   SaveVerticesPeriodicity(save);
 
+  // HYPER-PATCHES
+  save << " " << _hyperPatchList.size() << " ";
+  for ( size_t i = 0; i < _hyperPatchList.size(); ++i )
+  {
+    THyperPatchTags& patch = _hyperPatchList[i];
+    save << patch.size() << " ";
+    THyperPatchTags::iterator tag = patch.begin();
+    for ( ; tag != patch.end(); ++tag )
+      save << *tag << " ";
+  }
+
   return save;
 }
 
@@ -1979,7 +2082,6 @@ void BLSURFPlugin_Hypothesis::SaveFacesPeriodicity(std::ostream & save){
 
   TFacesPeriodicityVector::const_iterator it_faces_periodicity = _facesPeriodicityVector.begin();
   if (it_faces_periodicity != _facesPeriodicityVector.end()) {
-    MESSAGE("__FACES_PERIODICITY_BEGIN__");
     save << " " << "__FACES_PERIODICITY_BEGIN__";
     for (; it_faces_periodicity != _facesPeriodicityVector.end(); ++it_faces_periodicity) {
       TFacesPeriodicity periodicity_i = (*it_faces_periodicity);
@@ -1993,7 +2095,6 @@ void BLSURFPlugin_Hypothesis::SaveFacesPeriodicity(std::ostream & save){
       save << " " << "__END_PERIODICITY_DESCRIPTION__";
     }
     save << " " << "__FACES_PERIODICITY_END__";
-    MESSAGE("__FACES_PERIODICITY_END__");
   }
 }
 
@@ -2002,7 +2103,6 @@ void BLSURFPlugin_Hypothesis::SaveEdgesPeriodicity(std::ostream & save){
   TEdgesPeriodicityVector::const_iterator it_edges_periodicity = _edgesPeriodicityVector.begin();
   if (it_edges_periodicity != _edgesPeriodicityVector.end()) {
     save << " " << "__EDGES_PERIODICITY_BEGIN__";
-    MESSAGE("__EDGES_PERIODICITY_BEGIN__");
     for (; it_edges_periodicity != _edgesPeriodicityVector.end(); ++it_edges_periodicity) {
       TEdgePeriodicity periodicity_i = (*it_edges_periodicity);
       save << " " << "__BEGIN_PERIODICITY_DESCRIPTION__";
@@ -2028,7 +2128,6 @@ void BLSURFPlugin_Hypothesis::SaveEdgesPeriodicity(std::ostream & save){
       save << " " << "__END_PERIODICITY_DESCRIPTION__";
     }
     save << " " << "__EDGES_PERIODICITY_END__";
-    MESSAGE("__EDGES_PERIODICITY_END__");
   }
 }
 
@@ -2036,7 +2135,6 @@ void BLSURFPlugin_Hypothesis::SaveVerticesPeriodicity(std::ostream & save){
 
   TVerticesPeriodicityVector::const_iterator it_vertices_periodicity = _verticesPeriodicityVector.begin();
   if (it_vertices_periodicity != _verticesPeriodicityVector.end()) {
-    MESSAGE("__VERTICES_PERIODICITY_BEGIN__");
     save << " " << "__VERTICES_PERIODICITY_BEGIN__";
     for (; it_vertices_periodicity != _verticesPeriodicityVector.end(); ++it_vertices_periodicity) {
       TVertexPeriodicity periodicity_i = (*it_vertices_periodicity);
@@ -2056,7 +2154,6 @@ void BLSURFPlugin_Hypothesis::SaveVerticesPeriodicity(std::ostream & save){
       save << " " << "__END_PERIODICITY_DESCRIPTION__";
     }
     save << " " << "__VERTICES_PERIODICITY_END__";
-    MESSAGE("__VERTICES_PERIODICITY_END__");
   }
 }
 
@@ -2113,7 +2210,8 @@ void BLSURFPlugin_Hypothesis::SavePreCADPeriodicity(std::ostream & save, const c
 }
 
 //=============================================================================
-std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) {
+std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load)
+{
   bool isOK = true;
   int i;
   double val;
@@ -2381,12 +2479,6 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) {
       else
         load.clear(std::ios::badbit | load.rdstate());
 
-      isOK = static_cast<bool>(load >> i);
-      if (isOK)
-        _preCADRemoveTinyUVEdges = (bool) i;
-      else
-        load.clear(std::ios::badbit | load.rdstate());
-
       isOK = static_cast<bool>(load >> i);
       if (isOK)
         _optimiseTinyEdges = (bool) i;
@@ -2733,7 +2825,6 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) {
       isOK = static_cast<bool>(load >> attParams[0]>>attParams[1]>>attParams[2]>>attParams[3]); //>>step);
     }
     if (isOK) {
-      MESSAGE(" LOADING ATTRACTOR HYPOTHESIS ")
       const TopoDS_Shape attractorShape = BLSURFPlugin_Hypothesis::entryToShape(newAtShapeEntry);
       const TopoDS_Face faceShape = TopoDS::Face(BLSURFPlugin_Hypothesis::entryToShape(newAtFaceEntry));
       BLSURFPlugin_Attractor* attractor = new BLSURFPlugin_Attractor(faceShape, attractorShape, newAtShapeEntry);//, step);
@@ -2768,17 +2859,17 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) {
 // __ENFORCED_VERTICES_BEGIN__ 
 // __BEGIN_VERTEX__  => no name, no entry
 // __BEGIN_GROUP__ mon groupe __END_GROUP__
-// __BEGIN_COORDS__ 10 10 10 __END_COORDS__ 
-// __BEGIN_FACELIST__ 0:1:1:1:1 __END_FACELIST__ 
-// __END_VERTEX__ 
+// __BEGIN_COORDS__ 10 10 10 __END_COORDS__
+// __BEGIN_FACELIST__ 0:1:1:1:1 __END_FACELIST__
+// __END_VERTEX__
 // __BEGIN_VERTEX__ => no coords
-// __BEGIN_NAME__ mes points __END_NAME__ 
+// __BEGIN_NAME__ mes points __END_NAME__
 // __BEGIN_ENTRY__ 0:1:1:4 __END_ENTRY__
 // __BEGIN_GROUP__ mon groupe __END_GROUP__
 // __BEGIN_FACELIST__ 0:1:1:1:3 __END_FACELIST__
-// __END_VERTEX__ 
+// __END_VERTEX__
 // __ENFORCED_VERTICES_END__
-// 
+//
 
   std::string enfSeparator;
   std::string enfName;
@@ -2787,29 +2878,28 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) {
   TEntryList enfFaceEntryList;
   double enfCoords[3];
   bool hasCoords = false;
-  
+
   _faceEntryEnfVertexListMap.clear();
   _enfVertexList.clear();
   _faceEntryCoordsListMap.clear();
   _coordsEnfVertexMap.clear();
   _faceEntryEnfVertexEntryListMap.clear();
   _enfVertexEntryEnfVertexMap.clear();
-  
-  
-  while (isOK && hasEnforcedVertex) {
+
+
+  while (isOK && hasEnforcedVertex)
+  {
     isOK = static_cast<bool>(load >> enfSeparator); // __BEGIN_VERTEX__
     TEnfVertex *enfVertex = new TEnfVertex();
-//     MESSAGE("enfSeparator: " <<enfSeparator);
     if (enfSeparator == "__ENFORCED_VERTICES_END__")
       break; // __ENFORCED_VERTICES_END__
     if (enfSeparator != "__BEGIN_VERTEX__")
       throw std::exception();
-    
+
     while (isOK) {
       isOK = static_cast<bool>(load >> enfSeparator);
-      MESSAGE("enfSeparator: " <<enfSeparator);
       if (enfSeparator == "__END_VERTEX__") {
-        
+
         enfVertex->name = enfName;
         enfVertex->geomEntry = enfGeomEntry;
         enfVertex->grpName = enfGroup;
@@ -2817,9 +2907,9 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) {
         if (hasCoords)
           enfVertex->coords.assign(enfCoords,enfCoords+3);
         enfVertex->faceEntries = enfFaceEntryList;
-        
+
         _enfVertexList.insert(enfVertex);
-        
+
         if (enfVertex->coords.size()) {
           _coordsEnfVertexMap[enfVertex->coords] = enfVertex;
           for (TEntryList::const_iterator it = enfVertex->faceEntries.begin() ; it != enfVertex->faceEntries.end(); ++it) {
@@ -2834,7 +2924,7 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) {
             _faceEntryEnfVertexListMap[(*it)].insert(enfVertex);
           }
         }
-        
+
         enfName.clear();
         enfGeomEntry.clear();
         enfGroup.clear();
@@ -2842,7 +2932,7 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) {
         hasCoords = false;
         break; // __END_VERTEX__
       }
-        
+
       if (enfSeparator == "__BEGIN_NAME__") {  // __BEGIN_NAME__
         while (isOK && (enfSeparator != "__END_NAME__")) {
           isOK = static_cast<bool>(load >> enfSeparator);
@@ -2852,17 +2942,15 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) {
             enfName += enfSeparator;
           }
         }
-        MESSAGE("enfName: " <<enfName);
       }
-        
+
       if (enfSeparator == "__BEGIN_ENTRY__") {  // __BEGIN_ENTRY__
         isOK = static_cast<bool>(load >> enfGeomEntry);
         isOK = static_cast<bool>(load >> enfSeparator); // __END_ENTRY__
         if (enfSeparator != "__END_ENTRY__")
           throw std::exception();
-        MESSAGE("enfGeomEntry: " <<enfGeomEntry);
       }
-        
+
       if (enfSeparator == "__BEGIN_GROUP__") {  // __BEGIN_GROUP__
         while (isOK && (enfSeparator != "__END_GROUP__")) {
           isOK = static_cast<bool>(load >> enfSeparator);
@@ -2872,33 +2960,31 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) {
             enfGroup += enfSeparator;
           }
         }
-        MESSAGE("enfGroup: " <<enfGroup);
       }
-        
+
       if (enfSeparator == "__BEGIN_COORDS__") {  // __BEGIN_COORDS__
         hasCoords = true;
         isOK = static_cast<bool>(load >> enfCoords[0] >> enfCoords[1] >> enfCoords[2]);
         isOK = static_cast<bool>(load >> enfSeparator); // __END_COORDS__
         if (enfSeparator != "__END_COORDS__")
           throw std::exception();
-        MESSAGE("enfCoords: " << enfCoords[0] <<","<< enfCoords[1] <<","<< enfCoords[2]);
-      } 
-        
+      }
+
       if (enfSeparator == "__BEGIN_FACELIST__") {  // __BEGIN_FACELIST__
         while (isOK && (enfSeparator != "__END_FACELIST__")) {
           isOK = static_cast<bool>(load >> enfSeparator);
           if (enfSeparator != "__END_FACELIST__") {
             enfFaceEntryList.insert(enfSeparator);
-            MESSAGE(enfSeparator << " was inserted into enfFaceEntryList");
           }
         }
-      } 
+      }
     }
   }
 
   // PERIODICITY
 
-  if (hasPreCADFacesPeriodicity){
+  if (hasPreCADFacesPeriodicity)
+  {
     LoadPreCADPeriodicity(load, "FACES");
 
     isOK = static_cast<bool>(load >> option_or_sm);
@@ -2914,7 +3000,8 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) {
     }
   }
 
-  if (hasPreCADEdgesPeriodicity){
+  if (hasPreCADEdgesPeriodicity)
+  {
     LoadPreCADPeriodicity(load, "EDGES");
 
     isOK = static_cast<bool>(load >> option_or_sm);
@@ -2928,8 +3015,9 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) {
     }
   }
 
-  if (hasFacesPeriodicity){
-      LoadFacesPeriodicity(load);
+  if (hasFacesPeriodicity)
+  {
+    LoadFacesPeriodicity(load);
 
     isOK = static_cast<bool>(load >> option_or_sm);
     if (isOK) {
@@ -2940,8 +3028,9 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) {
     }
   }
 
-  if (hasEdgesPeriodicity){
-      LoadEdgesPeriodicity(load);
+  if (hasEdgesPeriodicity)
+  {
+    LoadEdgesPeriodicity(load);
 
     isOK = static_cast<bool>(load >> option_or_sm);
     if (isOK)
@@ -2950,7 +3039,38 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) {
   }
 
   if (hasVerticesPeriodicity)
-      LoadVerticesPeriodicity(load);
+    LoadVerticesPeriodicity(load);
+
+  // HYPER-PATCHES
+  if ( !option_or_sm.empty() && option_or_sm[0] == '_' )
+    isOK = static_cast<bool>(load >> option_or_sm);
+  if ( isOK && !option_or_sm.empty() )
+  {
+    int nbPatches = atoi( option_or_sm.c_str() );
+    if ( nbPatches >= 0 )
+    {
+      _hyperPatchList.resize( nbPatches );
+      for ( int iP = 0; iP < nbPatches && isOK; ++iP )
+      {
+        isOK = static_cast<bool>(load >> i) && i >= 2;
+        if ( !isOK ) break;
+        int nbTags = i;
+        for ( int iT = 0; iT < nbTags; ++iT )
+        {
+          if (( isOK = static_cast<bool>(load >> i)))
+            _hyperPatchList[ iP ].insert( i );
+          else
+            break;
+        }
+      }
+      if ( !isOK ) // remove invalid patches
+      {
+        for ( i = nbPatches - 1; i >= 0; i-- )
+          if ( _hyperPatchList[i].size() < 2 )
+            _hyperPatchList.resize( i );
+      }
+    }
+  }
 
   return load;
 }
@@ -2967,18 +3087,15 @@ void BLSURFPlugin_Hypothesis::LoadFacesPeriodicity(std::istream & load){
 
   while (isOK) {
     isOK = static_cast<bool>(load >> periodicitySeparator); // __BEGIN_PERIODICITY_DESCRIPTION__
-    MESSAGE("periodicitySeparator 1: " <<periodicitySeparator);
     TFacesPeriodicity *periodicity_i = new TFacesPeriodicity();
     if (periodicitySeparator == "__FACES_PERIODICITY_END__")
       break; // __FACES_PERIODICITY_END__
     if (periodicitySeparator != "__BEGIN_PERIODICITY_DESCRIPTION__"){
-      MESSAGE("//" << periodicitySeparator << "//");
       throw std::exception();
     }
 
     while (isOK) {
       isOK = static_cast<bool>(load >> periodicitySeparator);
-      MESSAGE("periodicitySeparator 2: " <<periodicitySeparator);
       if (periodicitySeparator == "__END_PERIODICITY_DESCRIPTION__") {
 
         periodicity_i->first = shape1Entry;
@@ -2994,7 +3111,6 @@ void BLSURFPlugin_Hypothesis::LoadFacesPeriodicity(std::istream & load){
         isOK = static_cast<bool>(load >> periodicitySeparator); // __END_ENTRY1__
         if (periodicitySeparator != "__END_ENTRY1__")
           throw std::exception();
-        MESSAGE("shape1Entry: " <<shape1Entry);
       }
 
       if (periodicitySeparator == "__BEGIN_ENTRY2__") {  // __BEGIN_ENTRY2__
@@ -3002,7 +3118,6 @@ void BLSURFPlugin_Hypothesis::LoadFacesPeriodicity(std::istream & load){
         isOK = static_cast<bool>(load >> periodicitySeparator); // __END_ENTRY2__
         if (periodicitySeparator != "__END_ENTRY2__")
           throw std::exception();
-        MESSAGE("shape2Entry: " <<shape2Entry);
       }
     }
   }
@@ -3024,18 +3139,15 @@ void BLSURFPlugin_Hypothesis::LoadEdgesPeriodicity(std::istream & load){
 
   while (isOK) {
     isOK = static_cast<bool>(load >> periodicitySeparator); // __BEGIN_PERIODICITY_DESCRIPTION__
-    MESSAGE("periodicitySeparator 1: " <<periodicitySeparator);
     TEdgePeriodicity *periodicity_i = new TEdgePeriodicity();
     if (periodicitySeparator == "__EDGES_PERIODICITY_END__")
       break; // __EDGES_PERIODICITY_END__
     if (periodicitySeparator != "__BEGIN_PERIODICITY_DESCRIPTION__"){
-      MESSAGE("//" << periodicitySeparator << "//");
       throw std::exception();
     }
 
     while (isOK) {
       isOK = static_cast<bool>(load >> periodicitySeparator);
-      MESSAGE("periodicitySeparator 2: " <<periodicitySeparator);
       if (periodicitySeparator == "__END_PERIODICITY_DESCRIPTION__") {
 
         periodicity_i->theFace1Entry = theFace1Entry;
@@ -3051,13 +3163,10 @@ void BLSURFPlugin_Hypothesis::LoadEdgesPeriodicity(std::istream & load){
 
       if (periodicitySeparator == "__BEGIN_FACE1__") {  // __BEGIN_FACE1__
         isOK = static_cast<bool>(load >> theFace1Entry);
-        MESSAGE("//" << theFace1Entry << "//");
         isOK = static_cast<bool>(load >> periodicitySeparator); // __END_FACE1__
         if (periodicitySeparator != "__END_FACE1__"){
-          MESSAGE("//" << periodicitySeparator << "//");
           throw std::exception();
         }
-        MESSAGE("theFace1Entry: " <<theFace1Entry);
       }
 
       if (periodicitySeparator == "__BEGIN_EDGE1__") {  // __BEGIN_EDGE1__
@@ -3065,7 +3174,6 @@ void BLSURFPlugin_Hypothesis::LoadEdgesPeriodicity(std::istream & load){
         isOK = static_cast<bool>(load >> periodicitySeparator); // __END_EDGE1__
         if (periodicitySeparator != "__END_EDGE1__")
           throw std::exception();
-        MESSAGE("theEdge1Entry: " <<theEdge1Entry);
       }
 
       if (periodicitySeparator == "__BEGIN_FACE2__") {  // __BEGIN_FACE2__
@@ -3073,7 +3181,6 @@ void BLSURFPlugin_Hypothesis::LoadEdgesPeriodicity(std::istream & load){
         isOK = static_cast<bool>(load >> periodicitySeparator); // __END_FACE2__
         if (periodicitySeparator != "__END_FACE2__")
           throw std::exception();
-        MESSAGE("theFace2Entry: " <<theFace2Entry);
       }
 
       if (periodicitySeparator == "__BEGIN_EDGE2__") {  // __BEGIN_EDGE2__
@@ -3081,7 +3188,6 @@ void BLSURFPlugin_Hypothesis::LoadEdgesPeriodicity(std::istream & load){
         isOK = static_cast<bool>(load >> periodicitySeparator); // __END_EDGE2__
         if (periodicitySeparator != "__END_EDGE2__")
           throw std::exception();
-        MESSAGE("theEdge2Entry: " <<theEdge2Entry);
       }
 
       if (periodicitySeparator == "__BEGIN_EDGE_ORIENTATION__") {  // __BEGIN_EDGE_ORIENTATION__
@@ -3089,14 +3195,13 @@ void BLSURFPlugin_Hypothesis::LoadEdgesPeriodicity(std::istream & load){
         isOK = static_cast<bool>(load >> periodicitySeparator); // __END_EDGE_ORIENTATION__
         if (periodicitySeparator != "__END_EDGE_ORIENTATION__")
           throw std::exception();
-        MESSAGE("edge_orientation: " <<edge_orientation);
       }
     }
   }
 }
 
-void BLSURFPlugin_Hypothesis::LoadVerticesPeriodicity(std::istream & load){
-
+void BLSURFPlugin_Hypothesis::LoadVerticesPeriodicity(std::istream & load)
+{
   bool isOK = true;
 
   std::string periodicitySeparator;
@@ -3109,18 +3214,15 @@ void BLSURFPlugin_Hypothesis::LoadVerticesPeriodicity(std::istream & load){
 
   while (isOK) {
     isOK = static_cast<bool>(load >> periodicitySeparator); // __BEGIN_PERIODICITY_DESCRIPTION__
-    MESSAGE("periodicitySeparator 1: " <<periodicitySeparator);
     TVertexPeriodicity *periodicity_i = new TVertexPeriodicity();
     if (periodicitySeparator == "__VERTICES_PERIODICITY_END__")
       break; // __VERTICES_PERIODICITY_END__
     if (periodicitySeparator != "__BEGIN_PERIODICITY_DESCRIPTION__"){
-      MESSAGE("//" << periodicitySeparator << "//");
       throw std::exception();
     }
 
     while (isOK) {
       isOK = static_cast<bool>(load >> periodicitySeparator);
-      MESSAGE("periodicitySeparator 2: " <<periodicitySeparator);
       if (periodicitySeparator == "__END_PERIODICITY_DESCRIPTION__") {
 
         periodicity_i->theEdge1Entry = theEdge1Entry;
@@ -3138,7 +3240,6 @@ void BLSURFPlugin_Hypothesis::LoadVerticesPeriodicity(std::istream & load){
         isOK = static_cast<bool>(load >> periodicitySeparator); // __END_EDGE1__
         if (periodicitySeparator != "__END_EDGE1__")
           throw std::exception();
-        MESSAGE("theEdge1Entry: " <<theEdge1Entry);
       }
 
       if (periodicitySeparator == "__BEGIN_VERTEX1__") {  // __BEGIN_VERTEX1__
@@ -3146,7 +3247,6 @@ void BLSURFPlugin_Hypothesis::LoadVerticesPeriodicity(std::istream & load){
         isOK = static_cast<bool>(load >> periodicitySeparator); // __END_VERTEX1__
         if (periodicitySeparator != "__END_VERTEX1__")
           throw std::exception();
-        MESSAGE("theVertex1Entry: " <<theVertex1Entry);
       }
 
       if (periodicitySeparator == "__BEGIN_EDGE2__") {  // __BEGIN_EDGE2__
@@ -3154,7 +3254,6 @@ void BLSURFPlugin_Hypothesis::LoadVerticesPeriodicity(std::istream & load){
         isOK = static_cast<bool>(load >> periodicitySeparator); // __END_EDGE2__
         if (periodicitySeparator != "__END_EDGE2__")
           throw std::exception();
-        MESSAGE("theEdge2Entry: " <<theEdge2Entry);
       }
 
       if (periodicitySeparator == "__BEGIN_VERTEX2__") {  // __BEGIN_VERTEX2__
@@ -3162,7 +3261,6 @@ void BLSURFPlugin_Hypothesis::LoadVerticesPeriodicity(std::istream & load){
         isOK = static_cast<bool>(load >> periodicitySeparator); // __END_VERTEX2__
         if (periodicitySeparator != "__END_VERTEX2__")
           throw std::exception();
-        MESSAGE("theVertex2Entry: " <<theVertex2Entry);
       }
     }
   }
@@ -3189,35 +3287,27 @@ void BLSURFPlugin_Hypothesis::LoadPreCADPeriodicity(std::istream & load, const c
 
   while (isOK) {
     isOK = static_cast<bool>(load >> periodicitySeparator); // __BEGIN_PERIODICITY_DESCRIPTION__
-    MESSAGE("periodicitySeparator 1: " <<periodicitySeparator);
     TPreCadPeriodicity *periodicity_i = new TPreCadPeriodicity();
-//     MESSAGE("periodicitySeparator: " <<periodicitySeparator);
     std::string endSeparator = "__PRECAD_" + std::string(shapeType) + "_PERIODICITY_END__";
     if (periodicitySeparator == endSeparator)
       break; // __PRECAD_FACES_PERIODICITY_END__
     if (periodicitySeparator != "__BEGIN_PERIODICITY_DESCRIPTION__"){
-      MESSAGE("//" << endSeparator << "//");
-      MESSAGE("//" << periodicitySeparator << "//");
       throw std::exception();
     }
 
     while (isOK) {
       isOK = static_cast<bool>(load >> periodicitySeparator);
-      MESSAGE("periodicitySeparator 2: " <<periodicitySeparator);
       if (periodicitySeparator == "__END_PERIODICITY_DESCRIPTION__") {
 
         periodicity_i->shape1Entry = shape1Entry;
         periodicity_i->shape2Entry = shape2Entry;
 
-        MESSAGE("theSourceVerticesEntries.size(): " << theSourceVerticesEntries.size());
-        MESSAGE("theTargetVerticesEntries.size(): " << theTargetVerticesEntries.size());
-
         if (hasSourceVertices)
           periodicity_i->theSourceVerticesEntries = theSourceVerticesEntries;
         if (hasTargetVertices)
           periodicity_i->theTargetVerticesEntries = theTargetVerticesEntries;
 
-        if ( shapeType  &&  strcmp( shapeType, "FACES" ))
+        if ( shapeType  &&  strcmp( shapeType, "FACES" ) == 0 )
           _preCadFacesPeriodicityVector.push_back(*periodicity_i);
         else
           _preCadEdgesPeriodicityVector.push_back(*periodicity_i);
@@ -3234,7 +3324,6 @@ void BLSURFPlugin_Hypothesis::LoadPreCADPeriodicity(std::istream & load, const c
         isOK = static_cast<bool>(load >> periodicitySeparator); // __END_ENTRY1__
         if (periodicitySeparator != "__END_ENTRY1__")
           throw std::exception();
-        MESSAGE("shape1Entry: " <<shape1Entry);
       }
 
       if (periodicitySeparator == "__BEGIN_ENTRY2__") {  // __BEGIN_ENTRY2__
@@ -3242,7 +3331,6 @@ void BLSURFPlugin_Hypothesis::LoadPreCADPeriodicity(std::istream & load, const c
         isOK = static_cast<bool>(load >> periodicitySeparator); // __END_ENTRY2__
         if (periodicitySeparator != "__END_ENTRY2__")
           throw std::exception();
-        MESSAGE("shape2Entry: " <<shape2Entry);
       }
 
       if (periodicitySeparator == "__BEGIN_SOURCE_VERTICES_LIST__") {  // __BEGIN_SOURCE_VERTICES_LIST__
@@ -3251,7 +3339,6 @@ void BLSURFPlugin_Hypothesis::LoadPreCADPeriodicity(std::istream & load, const c
           isOK = static_cast<bool>(load >> periodicitySeparator);
           if (periodicitySeparator != "__END_SOURCE_VERTICES_LIST__") {
             theSourceVerticesEntries.push_back(periodicitySeparator);
-            MESSAGE("theSourceVerticesEntries: " <<periodicitySeparator);
           }
         }
       }
@@ -3262,7 +3349,6 @@ void BLSURFPlugin_Hypothesis::LoadPreCADPeriodicity(std::istream & load, const c
           isOK = static_cast<bool>(load >> periodicitySeparator);
           if (periodicitySeparator != "__END_TARGET_VERTICES_LIST__") {
             theTargetVerticesEntries.push_back(periodicitySeparator);
-            MESSAGE("theTargetVerticesEntries: " <<periodicitySeparator);
           }
         }
       }
index 1d8c200aa747922b1b61259a28a4f384936bdb2e..4153e56b2e31c72b579061d2e65a7ea325c80aa8 100644 (file)
@@ -43,7 +43,7 @@
 class BLSURFPlugin_Hypothesis: public SMESH_Hypothesis
 {
 public:
-  BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen);
+  BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen, bool hasgeom);
 
   enum Topology {
     FromCAD,
@@ -64,8 +64,9 @@ public:
     GeometricalLocalSize
   };
 
-  static const char* GetHypType() { return "MG-CADSurf Parameters"; }
-  
+  static const char* GetHypType(bool hasgeom)
+  { return hasgeom ? "MG-CADSurf Parameters" : "MG-CADSurf Parameters_NOGEOM"; }
+
   TopoDS_Shape entryToShape(std::string entry);
 
   void SetPhysicalMesh(PhysicalMesh thePhysicalMesh);
@@ -156,12 +157,18 @@ public:
   void SetJacobianRectificationRespectGeometry( bool allowRectification );
   bool GetJacobianRectificationRespectGeometry();
     
+  void SetUseDeprecatedPatchMesher( bool useDeprecatedPatchMesher );
+  bool GetUseDeprecatedPatchMesher();
+
   void SetJacobianRectification( bool allowRectification );
   bool GetJacobianRectification();
 
   void SetMaxNumberOfPointsPerPatch( int nb ) throw (std::invalid_argument);
   int  GetMaxNumberOfPointsPerPatch();
 
+  void SetMaxNumberOfThreads( int nb ) throw (std::invalid_argument);
+  int  GetMaxNumberOfThreads();
+
   void SetRespectGeometry( bool toRespect );
   bool GetRespectGeometry();
 
@@ -186,12 +193,17 @@ public:
   void SetTags( const std::string& howToTreat ) throw (std::invalid_argument);
   std::string GetTags();
 
+  // Hyper-patches
+  typedef std::set< int > THyperPatchTags;
+  typedef std::vector< THyperPatchTags > THyperPatchList;
+
+  void SetHyperPatches(const THyperPatchList& hpl);
+  const THyperPatchList& GetHyperPatches() const { return _hyperPatchList; }
+  static int GetHyperPatchTag( int faceTag, const BLSURFPlugin_Hypothesis* hyp, int* iPatch=0 );
+
   void SetPreCADMergeEdges(bool theVal);
   bool GetPreCADMergeEdges() const { return _preCADMergeEdges; }
 
-  void SetPreCADRemoveTinyUVEdges(bool theVal);
-  bool GetPreCADRemoveTinyUVEdges() const { return _preCADRemoveTinyUVEdges; }
-
   void SetPreCADRemoveDuplicateCADFaces(bool theVal);
   bool GetPreCADRemoveDuplicateCADFaces() const { return _preCADRemoveDuplicateCADFaces; }
 
@@ -231,7 +243,7 @@ public:
  */
   
   typedef std::multimap< std::string, BLSURFPlugin_Attractor* > TAttractorMap;
-  typedef std::map< std::string, std::vector<double> > TParamsMap; //TODO à finir 
+  typedef std::map< std::string, std::vector<double> > TParamsMap; //TODO ?? finir 
   
   void SetClassAttractorEntry(const std::string& entry, const std::string& att_entry, double StartSize, double EndSize, double ActionRadius, double ConstantRadius);
   std::string  GetClassAttractorEntry(const std::string& entry);
@@ -437,7 +449,6 @@ public:
   static Topology        GetDefaultTopology() { return FromCAD; }
   // PreCAD
   static bool            GetDefaultPreCADMergeEdges() { return false; }
-  static bool            GetDefaultPreCADRemoveTinyUVEdges() { return false; }
   static bool            GetDefaultPreCADRemoveDuplicateCADFaces() { return false; }
   static bool            GetDefaultPreCADProcess3DTopology() { return false; }
   static bool            GetDefaultPreCADDiscardInput() { return false; }
@@ -575,7 +586,6 @@ private:
   Topology        _topology;
   
   bool            _preCADMergeEdges;
-  bool            _preCADRemoveTinyUVEdges;
   bool            _preCADRemoveDuplicateCADFaces;
   bool            _preCADProcess3DTopology;
   bool            _preCADDiscardInput;
@@ -614,6 +624,8 @@ private:
   TEdgesPeriodicityVector _edgesPeriodicityVector;
   TVerticesPeriodicityVector _verticesPeriodicityVector;
 
+  THyperPatchList _hyperPatchList;
+
   // Called by SaveTo to store content of _preCadFacesPeriodicityVector and _preCadEdgesPeriodicityVector
   void SavePreCADPeriodicity(std::ostream & save, const char* shapeType);
 
index 8939ad53a26933ce7f3ec0635587b1ac20ef75e4..a9d96cf7d19fb1258e48ebabcd74d70ba9699fc1 100644 (file)
@@ -47,10 +47,14 @@ using namespace std;
  */
 //=============================================================================
 BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA,
-    ::SMESH_Gen* theGenImpl) :
-  SALOME::GenericObj_i(thePOA), SMESH_Hypothesis_i(thePOA) {
-  MESSAGE( "BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i" );
-  myBaseImpl = new ::BLSURFPlugin_Hypothesis(theGenImpl->GetANewId(), theGenImpl);
+                                                     ::SMESH_Gen*            theGenImpl,
+                                                     bool                    theHasGEOM) :
+  SALOME::GenericObj_i(thePOA), SMESH_Hypothesis_i(thePOA)
+{
+  myBaseImpl = new ::BLSURFPlugin_Hypothesis(theGenImpl->GetANewId(),
+                                             
+                                             theGenImpl,
+                                             theHasGEOM);
 }
 
 //=============================================================================
@@ -60,8 +64,8 @@ BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr the
  *  Destructor
  */
 //=============================================================================
-BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i() {
-  MESSAGE( "BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i" );
+BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i()
+{
 }
 
 //=============================================================================
@@ -74,8 +78,8 @@ BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i() {
  */
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetPhysicalMesh(CORBA::Long theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhysicalMesh");
+void BLSURFPlugin_Hypothesis_i::SetPhysicalMesh(CORBA::Long theValue)
+{
   ASSERT(myBaseImpl);
   this->GetImpl()->SetPhysicalMesh((::BLSURFPlugin_Hypothesis::PhysicalMesh) theValue);
   SMESH::TPythonDump() << _this() << ".SetPhysicalMesh( " << theValue << " )";
@@ -88,8 +92,8 @@ void BLSURFPlugin_Hypothesis_i::SetPhysicalMesh(CORBA::Long theValue) {
  *  Get PhysicalMesh
  */
 //=============================================================================
-CORBA::Long BLSURFPlugin_Hypothesis_i::GetPhysicalMesh() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhysicalMesh");
+CORBA::Long BLSURFPlugin_Hypothesis_i::GetPhysicalMesh()
+{
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetPhysicalMesh();
 }
@@ -102,8 +106,8 @@ CORBA::Long BLSURFPlugin_Hypothesis_i::GetPhysicalMesh() {
  */
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetGeometricMesh(CORBA::Long theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGeometricMesh");
+void BLSURFPlugin_Hypothesis_i::SetGeometricMesh(CORBA::Long theValue)
+{
   ASSERT(myBaseImpl);
   this->GetImpl()->SetGeometricMesh((::BLSURFPlugin_Hypothesis::GeometricMesh) theValue);
   SMESH::TPythonDump() << _this() << ".SetGeometricMesh( " << theValue << " )";
@@ -116,8 +120,8 @@ void BLSURFPlugin_Hypothesis_i::SetGeometricMesh(CORBA::Long theValue) {
  *  Get GeometricMesh
  */
 //=============================================================================
-CORBA::Long BLSURFPlugin_Hypothesis_i::GetGeometricMesh() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGeometricMesh");
+CORBA::Long BLSURFPlugin_Hypothesis_i::GetGeometricMesh()
+{
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetGeometricMesh();
 }
@@ -129,8 +133,8 @@ CORBA::Long BLSURFPlugin_Hypothesis_i::GetGeometricMesh() {
  *  Set PhySize
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetPhySize(CORBA::Double theValue) {
-//   MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhySize");
+void BLSURFPlugin_Hypothesis_i::SetPhySize(CORBA::Double theValue)
+{
   ASSERT(myBaseImpl);
   this->GetImpl()->SetPhySize(theValue, false);
   SMESH::TPythonDump() << _this() << ".SetPhySize( " << theValue << " )";
@@ -143,8 +147,8 @@ void BLSURFPlugin_Hypothesis_i::SetPhySize(CORBA::Double theValue) {
  *  Set Relative PhySize
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetPhySizeRel(CORBA::Double theValue) {
-//   MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhySizeRel");
+void BLSURFPlugin_Hypothesis_i::SetPhySizeRel(CORBA::Double theValue)
+{
   ASSERT(myBaseImpl);
   this->GetImpl()->SetPhySize(theValue, true);
   SMESH::TPythonDump() << _this() << ".SetPhySizeRel( " << theValue << " )";
@@ -157,8 +161,8 @@ void BLSURFPlugin_Hypothesis_i::SetPhySizeRel(CORBA::Double theValue) {
  *  Get PhySize
  */
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhySize() {
-//   MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhySize");
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhySize()
+{
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetPhySize();
 }
@@ -170,15 +174,15 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhySize() {
  *  Returns True if PhySize is relative
  */
 //=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsPhySizeRel() {
-//   MESSAGE("BLSURFPlugin_Hypothesis_i::IsPhySizeRel");
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsPhySizeRel()
+{
   ASSERT(myBaseImpl);
   return this->GetImpl()->IsPhySizeRel();
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetMinSize(CORBA::Double theMinSize) {
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetMinSize(CORBA::Double theMinSize)
+{
   if (IsMinSizeRel() || GetMinSize() != theMinSize ) {
     this->GetImpl()->SetMinSize(theMinSize, false);
     SMESH::TPythonDump() << _this() << ".SetMinSize( " << theMinSize << " )";
@@ -186,8 +190,8 @@ void BLSURFPlugin_Hypothesis_i::SetMinSize(CORBA::Double theMinSize) {
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetMinSizeRel(CORBA::Double theMinSize) {
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetMinSizeRel(CORBA::Double theMinSize)
+{
   if ( !IsMinSizeRel() || (GetMinSize() != theMinSize) ) {
     this->GetImpl()->SetMinSize(theMinSize, true);
     SMESH::TPythonDump() << _this() << ".SetMinSizeRel( " << theMinSize << " )";
@@ -195,21 +199,20 @@ void BLSURFPlugin_Hypothesis_i::SetMinSizeRel(CORBA::Double theMinSize) {
 }
 
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetMinSize() {
-  ASSERT(myBaseImpl);
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetMinSize()
+{
   return this->GetImpl()->GetMinSize();
 }
 
 //=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsMinSizeRel() {
-//   MESSAGE("BLSURFPlugin_Hypothesis_i::IsMinSizeRel");
-  ASSERT(myBaseImpl);
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsMinSizeRel()
+{
   return this->GetImpl()->IsMinSizeRel();
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetMaxSize(CORBA::Double theMaxSize) {
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetMaxSize(CORBA::Double theMaxSize)
+{
   if (IsMaxSizeRel() || GetMaxSize() != theMaxSize) {
     this->GetImpl()->SetMaxSize(theMaxSize, false);
     SMESH::TPythonDump() << _this() << ".SetMaxSize( " << theMaxSize << " )";
@@ -217,8 +220,8 @@ void BLSURFPlugin_Hypothesis_i::SetMaxSize(CORBA::Double theMaxSize) {
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetMaxSizeRel(CORBA::Double theMaxSize) {
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetMaxSizeRel(CORBA::Double theMaxSize)
+{
   if ( !IsMaxSizeRel() || (GetMaxSize() != theMaxSize) ) {
     this->GetImpl()->SetMaxSize(theMaxSize, true);
     SMESH::TPythonDump() << _this() << ".SetMaxSizeRel( " << theMaxSize << " )";
@@ -226,15 +229,14 @@ void BLSURFPlugin_Hypothesis_i::SetMaxSizeRel(CORBA::Double theMaxSize) {
 }
 
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetMaxSize() {
-  ASSERT(myBaseImpl);
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetMaxSize()
+{
   return this->GetImpl()->GetMaxSize();
 }
 
 //=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsMaxSizeRel() {
-//   MESSAGE("BLSURFPlugin_Hypothesis_i::IsMaxSizeRel");
-  ASSERT(myBaseImpl);
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsMaxSizeRel()
+{
   return this->GetImpl()->IsMaxSizeRel();
 }
 
@@ -246,9 +248,8 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsMaxSizeRel() {
  *  Set true or false
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetUseGradation(CORBA::Boolean theValue) {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::SetUseGradation");
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetUseGradation(CORBA::Boolean theValue)
+{
   if ( GetImpl()->GetUseGradation() != bool( theValue ))
   {
     this->GetImpl()->SetUseGradation(theValue);
@@ -264,9 +265,8 @@ void BLSURFPlugin_Hypothesis_i::SetUseGradation(CORBA::Boolean theValue) {
  *  Get true or false
  */
 //=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetUseGradation() {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::GetUseGradation");
-  ASSERT(myBaseImpl);
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetUseGradation()
+{
   return this->GetImpl()->GetUseGradation();
 }
 
@@ -277,9 +277,8 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetUseGradation() {
  *  Set Gradation
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetGradation(CORBA::Double theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGradation");
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetGradation(CORBA::Double theValue)
+{
   this->GetImpl()->SetGradation(theValue);
 
   if ( theValue < 0 )
@@ -295,9 +294,8 @@ void BLSURFPlugin_Hypothesis_i::SetGradation(CORBA::Double theValue) {
  *  Get Gradation
  */
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetGradation() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGradation");
-  ASSERT(myBaseImpl);
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetGradation()
+{
   return this->GetImpl()->GetGradation();
 }
 
@@ -308,9 +306,8 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetGradation() {
  *  Set true or false
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetUseVolumeGradation(CORBA::Boolean theValue) {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::SetUseVolumeGradation");
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetUseVolumeGradation(CORBA::Boolean theValue)
+{
   if ( GetImpl()->GetUseVolumeGradation() != bool( theValue ))
   {
     this->GetImpl()->SetUseVolumeGradation(theValue);
@@ -326,9 +323,8 @@ void BLSURFPlugin_Hypothesis_i::SetUseVolumeGradation(CORBA::Boolean theValue) {
  *  Get true or false
  */
 //=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetUseVolumeGradation() {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::GetUseVolumeGradation");
-  ASSERT(myBaseImpl);
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetUseVolumeGradation()
+{
   return this->GetImpl()->GetUseVolumeGradation();
 }
 
@@ -339,9 +335,8 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetUseVolumeGradation() {
  *  Set VolumeGradation
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetVolumeGradation(CORBA::Double theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetVolumeGradation");
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetVolumeGradation(CORBA::Double theValue)
+{
   this->GetImpl()->SetVolumeGradation(theValue);
   if ( theValue < 0 )
     SetUseVolumeGradation( false );
@@ -356,9 +351,8 @@ void BLSURFPlugin_Hypothesis_i::SetVolumeGradation(CORBA::Double theValue) {
  *  Get VolumeGradation
  */
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetVolumeGradation() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetVolumeGradation");
-  ASSERT(myBaseImpl);
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetVolumeGradation()
+{
   return this->GetImpl()->GetVolumeGradation();
 }
 
@@ -369,9 +363,8 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetVolumeGradation() {
  *  Set true or false
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetQuadAllowed(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetQuadAllowed");
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetQuadAllowed(CORBA::Boolean theValue)
+{
   this->GetImpl()->SetQuadAllowed(theValue);
   std::string theValueStr = theValue ? "True" : "False";
   SMESH::TPythonDump() << _this() << ".SetQuadAllowed( " << theValueStr.c_str() << " )";
@@ -384,9 +377,8 @@ void BLSURFPlugin_Hypothesis_i::SetQuadAllowed(CORBA::Boolean theValue) {
  *  Get true or false
  */
 //=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadAllowed() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetQuadAllowed");
-  ASSERT(myBaseImpl);
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadAllowed()
+{
   return this->GetImpl()->GetQuadAllowed();
 }
 
@@ -397,9 +389,8 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadAllowed() {
  *  Set AngleMesh
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetAngleMesh(CORBA::Double theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAngleMesh");
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetAngleMesh(CORBA::Double theValue)
+{
   this->GetImpl()->SetAngleMesh(theValue);
   SMESH::TPythonDump() << _this() << ".SetAngleMesh( " << theValue << " )";
 }
@@ -411,9 +402,8 @@ void BLSURFPlugin_Hypothesis_i::SetAngleMesh(CORBA::Double theValue) {
  *  Get AngleMesh
  */
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMesh() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAngleMesh");
-  ASSERT(myBaseImpl);
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMesh()
+{
   return this->GetImpl()->GetAngleMesh();
 }
 
@@ -424,9 +414,8 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMesh() {
  *  Set Chordal Error
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetChordalError(CORBA::Double theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetChordalError");
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetChordalError(CORBA::Double theValue)
+{
   this->GetImpl()->SetChordalError(theValue);
   SMESH::TPythonDump() << _this() << ".SetChordalError( " << theValue << " )";
 }
@@ -438,9 +427,8 @@ void BLSURFPlugin_Hypothesis_i::SetChordalError(CORBA::Double theValue) {
  *  Get Chordal Error
  */
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetChordalError() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetChordalError");
-  ASSERT(myBaseImpl);
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetChordalError()
+{
   return this->GetImpl()->GetChordalError();
 }
 
@@ -451,9 +439,8 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetChordalError() {
  *  Set true or false
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetAnisotropic(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAnisotropic");
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetAnisotropic(CORBA::Boolean theValue)
+{
   this->GetImpl()->SetAnisotropic(theValue);
   std::string theValueStr = theValue ? "True" : "False";
   SMESH::TPythonDump() << _this() << ".SetAnisotropic( " << theValueStr.c_str() << " )";
@@ -466,9 +453,8 @@ void BLSURFPlugin_Hypothesis_i::SetAnisotropic(CORBA::Boolean theValue) {
  *  Get true or false
  */
 //=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetAnisotropic() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAnisotropic");
-  ASSERT(myBaseImpl);
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetAnisotropic()
+{
   return this->GetImpl()->GetAnisotropic();
 }
 
@@ -479,9 +465,8 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetAnisotropic() {
  *  Set Anisotropic Ratio
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio(CORBA::Double theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio");
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio(CORBA::Double theValue)
+{
   this->GetImpl()->SetAnisotropicRatio(theValue);
   SMESH::TPythonDump() << _this() << ".SetAnisotropicRatio( " << theValue << " )";
 }
@@ -493,9 +478,8 @@ void BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio(CORBA::Double theValue) {
  *  Get Anisotropic Ratio
  */
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio");
-  ASSERT(myBaseImpl);
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio()
+{
   return this->GetImpl()->GetAnisotropicRatio();
 }
 
@@ -508,7 +492,6 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetRemoveTinyEdges(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetRemoveTinyEdges");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetRemoveTinyEdges(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -523,7 +506,6 @@ void BLSURFPlugin_Hypothesis_i::SetRemoveTinyEdges(CORBA::Boolean theValue) {
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetRemoveTinyEdges() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetRemoveTinyEdges");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetRemoveTinyEdges();
 }
@@ -536,7 +518,6 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetRemoveTinyEdges() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetTinyEdgeLength(CORBA::Double theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetTinyEdgeLength");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetTinyEdgeLength(theValue);
   SMESH::TPythonDump() << _this() << ".SetTinyEdgeLength( " << theValue << " )";
@@ -550,7 +531,6 @@ void BLSURFPlugin_Hypothesis_i::SetTinyEdgeLength(CORBA::Double theValue) {
  */
 //=============================================================================
 CORBA::Double BLSURFPlugin_Hypothesis_i::GetTinyEdgeLength() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetTinyEdgeLength");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetTinyEdgeLength();
 }
@@ -563,7 +543,6 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetTinyEdgeLength() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetOptimiseTinyEdges(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetOptimiseTinyEdges");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetOptimiseTinyEdges(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -578,7 +557,6 @@ void BLSURFPlugin_Hypothesis_i::SetOptimiseTinyEdges(CORBA::Boolean theValue) {
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetOptimiseTinyEdges() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetOptimiseTinyEdges");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetOptimiseTinyEdges();
 }
@@ -591,7 +569,6 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetOptimiseTinyEdges() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetTinyEdgeOptimisationLength(CORBA::Double theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetTinyEdgeOptimisationLength");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetTinyEdgeOptimisationLength(theValue);
   SMESH::TPythonDump() << _this() << ".SetTinyEdgeOptimisationLength( " << theValue << " )";
@@ -605,7 +582,6 @@ void BLSURFPlugin_Hypothesis_i::SetTinyEdgeOptimisationLength(CORBA::Double theV
  */
 //=============================================================================
 CORBA::Double BLSURFPlugin_Hypothesis_i::GetTinyEdgeOptimisationLength() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetTinyEdgeOptimisationLength");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetTinyEdgeOptimisationLength();
 }
@@ -618,7 +594,6 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetTinyEdgeOptimisationLength() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetCorrectSurfaceIntersection(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetCorrectSurfaceIntersection");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetCorrectSurfaceIntersection(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -633,7 +608,6 @@ void BLSURFPlugin_Hypothesis_i::SetCorrectSurfaceIntersection(CORBA::Boolean the
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetCorrectSurfaceIntersection() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetCorrectSurfaceIntersection");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetCorrectSurfaceIntersection();
 }
@@ -646,7 +620,6 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetCorrectSurfaceIntersection() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetCorrectSurfaceIntersectionMaxCost(CORBA::Double theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetCorrectSurfaceIntersectionMaxCost");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetCorrectSurfaceIntersectionMaxCost(theValue);
   SMESH::TPythonDump() << _this() << ".SetCorrectSurfaceIntersectionMaxCost( " << theValue << " )";
@@ -660,7 +633,6 @@ void BLSURFPlugin_Hypothesis_i::SetCorrectSurfaceIntersectionMaxCost(CORBA::Doub
  */
 //=============================================================================
 CORBA::Double BLSURFPlugin_Hypothesis_i::GetCorrectSurfaceIntersectionMaxCost() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetCorrectSurfaceIntersectionMaxCost");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetCorrectSurfaceIntersectionMaxCost();
 }
@@ -673,7 +645,6 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetCorrectSurfaceIntersectionMaxCost()
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetBadElementRemoval(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetBadElementRemoval");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetBadElementRemoval(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -688,7 +659,6 @@ void BLSURFPlugin_Hypothesis_i::SetBadElementRemoval(CORBA::Boolean theValue) {
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetBadElementRemoval() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetBadElementRemoval");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetBadElementRemoval();
 }
@@ -701,7 +671,6 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetBadElementRemoval() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetBadElementAspectRatio(CORBA::Double theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetBadElementAspectRatio");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetBadElementAspectRatio(theValue);
   SMESH::TPythonDump() << _this() << ".SetBadElementAspectRatio( " << theValue << " )";
@@ -715,7 +684,6 @@ void BLSURFPlugin_Hypothesis_i::SetBadElementAspectRatio(CORBA::Double theValue)
  */
 //=============================================================================
 CORBA::Double BLSURFPlugin_Hypothesis_i::GetBadElementAspectRatio() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetBadElementAspectRatio");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetBadElementAspectRatio();
 }
@@ -728,7 +696,6 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetBadElementAspectRatio() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetOptimizeMesh(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetOptimizeMesh");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetOptimizeMesh(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -743,7 +710,6 @@ void BLSURFPlugin_Hypothesis_i::SetOptimizeMesh(CORBA::Boolean theValue) {
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetOptimizeMesh() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetOptimizeMesh");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetOptimizeMesh();
 }
@@ -756,7 +722,6 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetOptimizeMesh() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetQuadraticMesh(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetQuadraticMesh");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetQuadraticMesh(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -771,7 +736,6 @@ void BLSURFPlugin_Hypothesis_i::SetQuadraticMesh(CORBA::Boolean theValue) {
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadraticMesh() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetQuadraticMesh");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetQuadraticMesh();
 }
@@ -788,7 +752,6 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadraticMesh() {
 
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetTopology(CORBA::Long theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetTopology");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetTopology((::BLSURFPlugin_Hypothesis::Topology) theValue);
   SMESH::TPythonDump() << _this() << ".SetTopology( " << theValue << " )";
@@ -802,7 +765,6 @@ void BLSURFPlugin_Hypothesis_i::SetTopology(CORBA::Long theValue) {
  */
 //=============================================================================
 CORBA::Long BLSURFPlugin_Hypothesis_i::GetTopology() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetTopology");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetTopology();
 }
@@ -869,6 +831,21 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetJacobianRectification()
 }
 //=============================================================================
 
+void BLSURFPlugin_Hypothesis_i::SetUseDeprecatedPatchMesher( CORBA::Boolean useDeprecatedPatchMesher )
+{
+  if ( GetUseDeprecatedPatchMesher() != useDeprecatedPatchMesher )
+  {
+    this->GetImpl()->SetUseDeprecatedPatchMesher(useDeprecatedPatchMesher);
+    SMESH::TPythonDump() << _this() << ".SetUseDeprecatedPatchMesher( " << useDeprecatedPatchMesher << " )";
+  }
+}
+//=============================================================================
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetUseDeprecatedPatchMesher()
+{
+  return this->GetImpl()->GetUseDeprecatedPatchMesher();
+}
+//=============================================================================
+
 void BLSURFPlugin_Hypothesis_i::SetMaxNumberOfPointsPerPatch( CORBA::Long nb ) throw (SALOME::SALOME_Exception)
 {
   if ( GetMaxNumberOfPointsPerPatch() != nb )
@@ -891,6 +868,28 @@ CORBA::Long BLSURFPlugin_Hypothesis_i::GetMaxNumberOfPointsPerPatch()
 }
 //=============================================================================
 
+void BLSURFPlugin_Hypothesis_i::SetMaxNumberOfThreads( CORBA::Long nb ) throw (SALOME::SALOME_Exception)
+{
+  if ( GetMaxNumberOfThreads() != nb )
+  {
+    try {
+      this->GetImpl()->SetMaxNumberOfThreads(nb);
+
+    } catch (const std::invalid_argument& ex) {
+      THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+    } catch (SALOME_Exception& ex) {
+      THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+    }
+    SMESH::TPythonDump() << _this() << ".SetMaxNumberOfThreads( " << nb << " )";
+  }
+}
+//=============================================================================
+CORBA::Long BLSURFPlugin_Hypothesis_i::GetMaxNumberOfThreads()
+{
+  return this->GetImpl()->GetMaxNumberOfThreads();
+}
+//=============================================================================
+
 void BLSURFPlugin_Hypothesis_i::SetRespectGeometry( CORBA::Boolean toRespect )
 {
   if ( GetRespectGeometry() != toRespect )
@@ -1059,6 +1058,51 @@ char* BLSURFPlugin_Hypothesis_i::GetTags()
   return CORBA::string_dup( this->GetImpl()->GetTags().c_str() );
 }
 
+//=============================================================================
+void BLSURFPlugin_Hypothesis_i::SetHyperPatches(const BLSURFPlugin::THyperPatchList& hpl)
+{
+  ::BLSURFPlugin_Hypothesis::THyperPatchList patchList( hpl.length() );
+  SMESH_Comment hplDump;
+  hplDump << "[";
+  for ( size_t i = 0; i < patchList.size(); ++i )
+  {
+    hplDump << "[ ";
+    BLSURFPlugin::THyperPatch tags = hpl[ i ];
+    for ( CORBA::ULong j = 0; j < tags.length(); ++j )
+    {
+      patchList[ i ].insert( tags[ j ]);
+      hplDump << tags[ j ] << ( j+1 < tags.length() ? ", " : " ]" );
+    }
+    hplDump << ( i+1 < patchList.size() ? "," : "]");
+  }
+  if ( GetImpl()->GetHyperPatches() != patchList )
+  {
+    GetImpl()->SetHyperPatches( patchList );
+    SMESH::TPythonDump() << _this() << ".SetHyperPatches( " << hplDump << " )";
+  }
+}
+
+//=============================================================================
+BLSURFPlugin::THyperPatchList* BLSURFPlugin_Hypothesis_i::GetHyperPatches()
+{
+  const ::BLSURFPlugin_Hypothesis::THyperPatchList& hpl = GetImpl()->GetHyperPatches();
+  BLSURFPlugin::THyperPatchList* resHpl = new BLSURFPlugin::THyperPatchList();
+  resHpl->length( hpl.size() );
+
+  ::BLSURFPlugin_Hypothesis::THyperPatchList::const_iterator hpIt = hpl.begin();
+  for ( int i = 0; hpIt != hpl.end(); ++hpIt, ++i )
+  {
+    const ::BLSURFPlugin_Hypothesis::THyperPatchTags& hp = *hpIt;
+    BLSURFPlugin::THyperPatch& resHp = (*resHpl)[ i ];
+    resHp.length( hp.size() );
+
+    ::BLSURFPlugin_Hypothesis::THyperPatchTags::const_iterator tag = hp.begin();
+    for ( int j = 0; tag != hp.end(); ++tag, ++j )
+      resHp[ j ] = *tag;
+  }
+  return resHpl;
+}
+
 //=============================================================================
 /*!
  *  BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges
@@ -1067,7 +1111,6 @@ char* BLSURFPlugin_Hypothesis_i::GetTags()
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetPreCADMergeEdges(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -1082,39 +1125,10 @@ void BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges(CORBA::Boolean theValue) {
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetPreCADMergeEdges();
 }
 
-//=============================================================================
-/*!
- *  BLSURFPlugin_Hypothesis_i::SetPreCADRemoveTinyUVEdges
- *
- *  Set true or false
- */
-//=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveTinyUVEdges(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADRemoveTinyUVEdges");
-  ASSERT(myBaseImpl);
-  this->GetImpl()->SetPreCADRemoveTinyUVEdges(theValue);
-  std::string theValueStr = theValue ? "True" : "False";
-  SMESH::TPythonDump() << _this() << ".SetPreCADRemoveTinyUVEdges( " << theValueStr.c_str() << " )";
-}
-
-//=============================================================================
-/*!
- *  BLSURFPlugin_Hypothesis_i::GetPreCADRemoveTinyUVEdges
- *
- *  Get true or false
- */
-//=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveTinyUVEdges() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADRemoveTinyUVEdges");
-  ASSERT(myBaseImpl);
-  return this->GetImpl()->GetPreCADRemoveTinyUVEdges();
-}
-
 //=============================================================================
 /*!
  *  BLSURFPlugin_Hypothesis_i::SetPreCADRemoveDuplicateCADFaces
@@ -1123,7 +1137,6 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveTinyUVEdges() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveDuplicateCADFaces(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADRemoveDuplicateCADFaces");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetPreCADRemoveDuplicateCADFaces(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -1138,7 +1151,6 @@ void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveDuplicateCADFaces(CORBA::Boolean
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveDuplicateCADFaces() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADRemoveDuplicateCADFaces");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetPreCADRemoveDuplicateCADFaces();
 }
@@ -1151,7 +1163,6 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveDuplicateCADFaces() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetPreCADProcess3DTopology(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADProcess3DTopology");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetPreCADProcess3DTopology(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -1166,7 +1177,6 @@ void BLSURFPlugin_Hypothesis_i::SetPreCADProcess3DTopology(CORBA::Boolean theVal
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADProcess3DTopology() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADProcess3DTopology");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetPreCADProcess3DTopology();
 }
@@ -1179,7 +1189,6 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADProcess3DTopology() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetPreCADDiscardInput(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -1194,7 +1203,6 @@ void BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput(CORBA::Boolean theValue) {
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetPreCADDiscardInput();
 }
@@ -1221,9 +1229,15 @@ void BLSURFPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const cha
     else if ( name == "max_number_of_points_per_patch" )
       SetMaxNumberOfPointsPerPatch( GetImpl()->ToInt( optionValue ));
 
+    else if ( name == "max_number_of_threads" )
+      SetMaxNumberOfThreads( GetImpl()->ToInt( optionValue ));
+
     else if ( name == "rectify_jacobian" )
       SetJacobianRectification( GetImpl()->ToBool( optionValue ));
 
+    else if ( name == "use_deprecated_patch_mesher" )
+      SetUseDeprecatedPatchMesher( GetImpl()->ToBool( optionValue ));
+
     else if ( name == "respect_geometry" )
       SetRespectGeometry( GetImpl()->ToBool( optionValue ));
 
@@ -1352,9 +1366,6 @@ void BLSURFPlugin_Hypothesis_i::SetPreCADOptionValue(const char* optionName, con
     else if ( name == "tiny_edge_optimisation_length" )
       SetTinyEdgeOptimisationLength( GetImpl()->ToDbl( optionValue ));
 
-    else if ( name == "remove_tiny_uv_edges" )
-      SetPreCADRemoveTinyUVEdges( GetImpl()->ToBool( optionValue ));
-
     else if ( name == "process_3d_topology" )
       SetPreCADProcess3DTopology( GetImpl()->ToBool( optionValue ));
 
@@ -1507,7 +1518,7 @@ BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetAdvancedOptionValues()
 //=============================================================================
 
 void BLSURFPlugin_Hypothesis_i::SetOptionValues(const BLSURFPlugin::string_array& options)
-    throw (SALOME::SALOME_Exception) {
+  throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
   for (CORBA::ULong i = 0; i < options.length(); ++i) {
     string name_value_type = options[i].in();
@@ -1535,7 +1546,7 @@ void BLSURFPlugin_Hypothesis_i::SetOptionValues(const BLSURFPlugin::string_array
 //=============================================================================
 
 void BLSURFPlugin_Hypothesis_i::SetPreCADOptionValues(const BLSURFPlugin::string_array& options)
-    throw (SALOME::SALOME_Exception) {
+  throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
   for ( CORBA::ULong i = 0; i < options.length(); ++i) {
     string name_value_type = options[i].in();
@@ -1663,9 +1674,8 @@ char* BLSURFPlugin_Hypothesis_i::GetPreCADOption(const char* optionName)
 //=============================================================================
 
 void BLSURFPlugin_Hypothesis_i::SetSizeMapEntry(const char* entry, const char* sizeMap)
-    throw (SALOME::SALOME_Exception) {
+  throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
-  MESSAGE("ENGINE : SETSIZEMAP START ENTRY : " << entry);
   if ( !entry || !entry[0] )
     THROW_SALOME_CORBA_EXCEPTION( "SetSizeMapEntry(): empty geom entry", SALOME::BAD_PARAM );
   bool valueChanged = false;
@@ -1683,7 +1693,6 @@ void BLSURFPlugin_Hypothesis_i::SetSizeMapEntry(const char* entry, const char* s
   } catch (SALOME_Exception& ex) {
     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
-  MESSAGE("ENGINE : SETSIZEMAP END ENTRY : " << entry);
   if (valueChanged)
     SMESH::TPythonDump() << _this() << ".SetSizeMap(" << entry << ", '" << sizeMap << "' )";
 }
@@ -1693,7 +1702,6 @@ void BLSURFPlugin_Hypothesis_i::SetSizeMapEntry(const char* entry, const char* s
 void BLSURFPlugin_Hypothesis_i::SetConstantSizeMapEntry(const char* entry, GEOM::shape_type shapeType, CORBA::Double sizeMap)
   throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
-  MESSAGE("ENGINE : SETSIZEMAP START ENTRY : " << entry);
   bool valueChanged = false;
   std::ostringstream sizeMapFunction;
   switch (shapeType) {
@@ -1716,7 +1724,6 @@ void BLSURFPlugin_Hypothesis_i::SetConstantSizeMapEntry(const char* entry, GEOM:
   } catch (SALOME_Exception& ex) {
     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
-  MESSAGE("ENGINE : SETSIZEMAP END ENTRY : " << entry);
   if (valueChanged)
     SMESH::TPythonDump() << _this() << ".SetConstantSizeMap(" << entry << ", '" << sizeMap << "' )";
 }
@@ -1724,9 +1731,8 @@ void BLSURFPlugin_Hypothesis_i::SetConstantSizeMapEntry(const char* entry, GEOM:
 //=============================================================================
 
 void BLSURFPlugin_Hypothesis_i::SetAttractorEntry(const char* entry, const char* attractor)
-    throw (SALOME::SALOME_Exception) {
+  throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
-  MESSAGE("ENGINE : SETATTRACTOR START ENTRY : " << entry);
   bool valueChanged = false;
   try {
     valueChanged = ( this->GetImpl()->GetAttractorEntry(entry) != attractor );
@@ -1746,18 +1752,16 @@ void BLSURFPlugin_Hypothesis_i::SetAttractorEntry(const char* entry, const char*
   } catch (SALOME_Exception& ex) {
     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
-  MESSAGE("ENGINE : SETATTRACTOR END ENTRY : " << entry);
   if (valueChanged)
     SMESH::TPythonDump() << _this() << ".SetAttractor(" << entry << ", '" << attractor << "' )";
 }
 
 //=============================================================================
 
-void BLSURFPlugin_Hypothesis_i::SetClassAttractorEntry(const char* entry, const char* att_entry, CORBA::Double StartSize, CORBA::Double EndSize, CORBA::Double ActionRadius, CORBA::Double ConstantRadius) //TODO à finir
+void BLSURFPlugin_Hypothesis_i::SetClassAttractorEntry(const char* entry, const char* att_entry, CORBA::Double StartSize, CORBA::Double EndSize, CORBA::Double ActionRadius, CORBA::Double ConstantRadius) //TODO ?? finir
   throw (SALOME::SALOME_Exception)
 {
   ASSERT(myBaseImpl);
-  MESSAGE("ENGINE : SETATTRACTOR START ENTRY : " << entry);
   //bool valueChanged = false;
   try {
     this->GetImpl()->SetClassAttractorEntry(entry, att_entry, StartSize, EndSize, ActionRadius, ConstantRadius);
@@ -1772,7 +1776,6 @@ void BLSURFPlugin_Hypothesis_i::SetClassAttractorEntry(const char* entry, const
   } catch (SALOME_Exception& ex) {
     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
-  MESSAGE("ENGINE : SETATTRACTOR END ENTRY : " << entry);
   //if ( valueChanged )
   SMESH::TPythonDump() << _this() << ".SetAttractorGeom( "
                        << entry << ", " << att_entry << ", "<<StartSize<<", "<<EndSize<<", "<<ActionRadius<<", "<<ConstantRadius<<" )";
@@ -1818,7 +1821,7 @@ char* BLSURFPlugin_Hypothesis_i::GetAttractorEntry(const char* entry) throw (SAL
 
 // //=============================================================================
 // 
-// // TODO coder cette fonction (utilisée pour savoir si la valeur a changé
+// // TODO coder cette fonction (utilis??e pour savoir si la valeur a chang??
 // // A finir pour le dump
 // char* BLSURFPlugin_Hypothesis_i::GetClassAttractorEntry(const char* entry)
 //   throw (SALOME::SALOME_Exception)
@@ -1908,7 +1911,6 @@ BLSURFPlugin::TAttParamsMap* BLSURFPlugin_Hypothesis_i::GetAttractorParams()
     double startSize, endSize, infDist, constDist;
     if ( !atIt->second->Empty() ) {
       attEntry = atIt->second->GetAttractorEntry();
-      MESSAGE("GetAttractorParams : attEntry ="<<attEntry)
       std::vector<double> params = atIt->second->GetParameters();
       startSize = params[0];
       endSize = params[1];
@@ -1921,8 +1923,6 @@ BLSURFPlugin::TAttParamsMap* BLSURFPlugin_Hypothesis_i::GetAttractorParams()
     result[i].endSize = endSize;
     result[i].infDist = infDist;
     result[i].constDist = constDist;
-    MESSAGE("GetAttractorParams : result[i].attEntry ="<<result[i].attEntry)
-    MESSAGE("GetAttractorParams : result[i].faceEntry ="<<result[i].faceEntry)
   }
   return result._retn();
 }
@@ -1930,7 +1930,7 @@ BLSURFPlugin::TAttParamsMap* BLSURFPlugin_Hypothesis_i::GetAttractorParams()
 //=============================================================================
 
 void BLSURFPlugin_Hypothesis_i::SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps)
-    throw (SALOME::SALOME_Exception) {
+  throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
   for ( CORBA::ULong i = 0; i < sizeMaps.length(); ++i) {
     string entry_sizemap = sizeMaps[i].in();
@@ -1962,8 +1962,6 @@ void BLSURFPlugin_Hypothesis_i::SetSizeMap(const GEOM::GEOM_Object_ptr GeomObj,
   ASSERT(myBaseImpl);
   string entry;
   entry = GeomObj->GetStudyEntry();
-  MESSAGE("IDL : GetName : " << GeomObj->GetName());
-  MESSAGE("IDL : SETSIZEMAP ( "<< entry << " , " << sizeMap << ")");
   SetSizeMapEntry(entry.c_str(), sizeMap);
 }
 
@@ -1975,8 +1973,6 @@ void BLSURFPlugin_Hypothesis_i::SetConstantSizeMap(const GEOM::GEOM_Object_ptr G
   GEOM::shape_type shapeType = GeomObj->GetShapeType();
   if (shapeType == GEOM::COMPOUND)
     shapeType = GeomObj->GetMaxShapeType();
-  MESSAGE("IDL : GetName : " << GeomObj->GetName());
-  MESSAGE("IDL : SETSIZEMAP ( "<< entry << " , " << sizeMap << ")");
   SetConstantSizeMapEntry(entry.c_str(), shapeType, sizeMap);
 }
 
@@ -1985,8 +1981,6 @@ void BLSURFPlugin_Hypothesis_i::UnsetSizeMap(const GEOM::GEOM_Object_ptr GeomObj
   ASSERT(myBaseImpl);
   string entry;
   entry = GeomObj->GetStudyEntry();
-  MESSAGE("IDL : GetName : " << GeomObj->GetName());
-  MESSAGE("IDL : UNSETSIZEMAP ( "<< entry << ")");
   UnsetEntry(entry.c_str());
   SMESH::TPythonDump() << _this() << ".UnsetSizeMap( " << entry.c_str() << " )";
 }
@@ -1995,8 +1989,6 @@ void BLSURFPlugin_Hypothesis_i::SetAttractor(GEOM::GEOM_Object_ptr GeomObj, cons
   ASSERT(myBaseImpl);
   string entry;
   entry = GeomObj->GetStudyEntry();
-  MESSAGE("IDL : GetName : " << GeomObj->GetName());
-  MESSAGE("IDL : SETATTRACTOR ( "<< entry << " , " << attractor << ")");
   SetAttractorEntry(entry.c_str(), attractor);
 }
 
@@ -2004,8 +1996,6 @@ void BLSURFPlugin_Hypothesis_i::UnsetAttractor(GEOM::GEOM_Object_ptr GeomObj) {
   ASSERT(myBaseImpl);
   string entry;
   entry = GeomObj->GetStudyEntry();
-  MESSAGE("IDL : GetName : " << GeomObj->GetName());
-  MESSAGE("IDL : UNSETATTRACTOR ( "<< entry << ")");
   UnsetEntry(entry.c_str());
   SMESH::TPythonDump() << _this() << ".UnsetAttractor( " << entry.c_str() << " )";
 }
@@ -2050,8 +2040,6 @@ void BLSURFPlugin_Hypothesis_i::SetAttractorGeom(GEOM::GEOM_Object_ptr theFace,
   
   TopoDS_Face FaceShape = TopoDS::Face(SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( theFace ));
   TopoDS_Shape AttractorShape = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( theAttractor );
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : SETATTRACTOR () ");//<< entry << " , " << att_entry << ")");
   SetClassAttractorEntry( theFaceEntry.c_str(), theAttEntry.c_str(), StartSize, EndSize, ActionRadius, ConstantRadius);
 }
 
@@ -2076,8 +2064,6 @@ void BLSURFPlugin_Hypothesis_i::UnsetAttractorGeom(GEOM::GEOM_Object_ptr theFace
        !theAttrEntry.in() || !theAttrEntry.in()[0] )
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
   
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : UNSETATTRACTOR ( "<< theFaceEntry << ")");
   GetImpl()->ClearEntry( theFaceEntry.in(), theAttrEntry.in() );
   SMESH::TPythonDump() << _this() << ".UnsetAttractorGeom( "
                        << theFace << ", " << theAttractor << " )";
@@ -2093,30 +2079,30 @@ void BLSURFPlugin_Hypothesis_i::UnsetAttractorEntry(const char* faceEntry,
 
 
 /*
- void BLSURFPlugin_Hypothesis_i::SetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap)
- {}
 void BLSURFPlugin_Hypothesis_i::SetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap)
 {}
 
- void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj)
- {}
 void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj)
 {}
 
- void BLSURFPlugin_Hypothesis_i::SetCustomSizeMapEntry(const char* entry,const char* sizeMap )  throw (SALOME::SALOME_Exception)
- {}
 void BLSURFPlugin_Hypothesis_i::SetCustomSizeMapEntry(const char* entry,const char* sizeMap )  throw (SALOME::SALOME_Exception)
 {}
 
- char* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntry(const char* entry)  throw (SALOME::SALOME_Exception)
- {}
 char* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntry(const char* entry)  throw (SALOME::SALOME_Exception)
 {}
 
- void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMapEntry(const char* entry)
- {
- ASSERT(myBaseImpl);
- this->GetImpl()->UnsetCustomSizeMap(entry);
- SMESH::TPythonDump() << _this() << ".UnsetCustomSizeMap( " << entry << " )";
- }
 void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMapEntry(const char* entry)
 {
 ASSERT(myBaseImpl);
 this->GetImpl()->UnsetCustomSizeMap(entry);
 SMESH::TPythonDump() << _this() << ".UnsetCustomSizeMap( " << entry << " )";
 }
 
 
- BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntries()
- {}
 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntries()
 {}
 
- */
+*/
 
 // ///////////////////////
 // // ENFORCED VERTICES //
@@ -2129,28 +2115,24 @@ void BLSURFPlugin_Hypothesis_i::UnsetAttractorEntry(const char* faceEntry,
  *
  */
 BLSURFPlugin::TFaceEntryEnfVertexListMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByFace() {
-  MESSAGE("IDL: GetAllEnforcedVerticesByFace()");
   ASSERT(myBaseImpl);
 
   BLSURFPlugin::TFaceEntryEnfVertexListMap_var resultMap = new BLSURFPlugin::TFaceEntryEnfVertexListMap();
 
   const ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap faceEntryEnfVertexListMap =
-      this->GetImpl()->_GetAllEnforcedVerticesByFace();
+    this->GetImpl()->_GetAllEnforcedVerticesByFace();
   resultMap->length(faceEntryEnfVertexListMap.size());
-  MESSAGE("Face entry to Enforced Vertex map size is " << resultMap->length());
 
   ::BLSURFPlugin_Hypothesis::TEnfVertexList _enfVertexList;
   ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap::const_iterator it_entry = faceEntryEnfVertexListMap.begin();
   for (int i = 0; it_entry != faceEntryEnfVertexListMap.end(); ++it_entry, ++i) {
     BLSURFPlugin::TFaceEntryEnfVertexListMapElement_var mapElement =
-        new BLSURFPlugin::TFaceEntryEnfVertexListMapElement();
+      new BLSURFPlugin::TFaceEntryEnfVertexListMapElement();
     mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
-    MESSAGE("Face Entry: " << mapElement->faceEntry);
 
     _enfVertexList = it_entry->second;
     BLSURFPlugin::TEnfVertexList_var enfVertexList = new BLSURFPlugin::TEnfVertexList();
     enfVertexList->length(_enfVertexList.size());
-    MESSAGE("Number of enf vertex: " << enfVertexList->length());
 
     ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator it_enfVertex = _enfVertexList.begin();
     ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
@@ -2187,10 +2169,9 @@ BLSURFPlugin::TFaceEntryEnfVertexListMap* BLSURFPlugin_Hypothesis_i::GetAllEnfor
       msg << "Enforced vertex: \n"
           << "Name: " << enfVertex->name << "\n";
       if (coords->length())
-          msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
+        msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
       msg << "Geom entry: " << enfVertex->geomEntry << "\n"
           << "Group Name: " << enfVertex->grpName;
-      MESSAGE(msg.str());
 
       enfVertexList[j] = enfVertex;
     }
@@ -2208,17 +2189,14 @@ BLSURFPlugin::TFaceEntryEnfVertexListMap* BLSURFPlugin_Hypothesis_i::GetAllEnfor
  *
  */
 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVertices() {
-  MESSAGE("IDL: GetAllEnforcedVertices()");
   ASSERT(myBaseImpl);
   BLSURFPlugin::TEnfVertexList_var resultMap = new BLSURFPlugin::TEnfVertexList();
   const ::BLSURFPlugin_Hypothesis::TEnfVertexList enfVertexList = this->GetImpl()->_GetAllEnforcedVertices();
   resultMap->length(enfVertexList.size());
-  MESSAGE("Enforced Vertex map size is " << resultMap->length());
 
   ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator evlIt = enfVertexList.begin();
   ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
   for (int i = 0; evlIt != enfVertexList.end(); ++evlIt, ++i) {
-    MESSAGE("Enforced Vertex #" << i);
     currentEnfVertex = (*evlIt);
     BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
     // Name
@@ -2245,10 +2223,9 @@ BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVertices(
     msg << "Enforced vertex: \n"
         << "Name: " << enfVertex->name << "\n";
     if (coords->length())
-        msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
+      msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
     msg << "Geom entry: " << enfVertex->geomEntry << "\n"
         << "Group Name: " << enfVertex->grpName;
-    MESSAGE(msg.str());
 
     resultMap[i] = enfVertex;
   }
@@ -2263,26 +2240,22 @@ BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVertices(
  *
  */
 BLSURFPlugin::TFaceEntryCoordsListMap* BLSURFPlugin_Hypothesis_i::GetAllCoordsByFace() {
-  MESSAGE("IDL: GetAllCoordsByFace()");
   ASSERT(myBaseImpl);
 
   BLSURFPlugin::TFaceEntryCoordsListMap_var resultMap = new BLSURFPlugin::TFaceEntryCoordsListMap();
 
   const ::BLSURFPlugin_Hypothesis::TFaceEntryCoordsListMap entryCoordsListMap = this->GetImpl()->_GetAllCoordsByFace();
   resultMap->length(entryCoordsListMap.size());
-  MESSAGE("Enforced Vertex map size is " << resultMap->length());
 
   ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList _coordsList;
   ::BLSURFPlugin_Hypothesis::TFaceEntryCoordsListMap::const_iterator it_entry = entryCoordsListMap.begin();
   for (int i = 0; it_entry != entryCoordsListMap.end(); ++it_entry, ++i) {
     BLSURFPlugin::TFaceEntryCoordsListMapElement_var mapElement = new BLSURFPlugin::TFaceEntryCoordsListMapElement();
     mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
-    MESSAGE("Face Entry: " << mapElement->faceEntry);
 
     _coordsList = it_entry->second;
     BLSURFPlugin::TEnfVertexCoordsList_var coordsList = new BLSURFPlugin::TEnfVertexCoordsList();
     coordsList->length(_coordsList.size());
-    MESSAGE("Number of coords: " << coordsList->length());
 
     ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList::const_iterator it_coords = _coordsList.begin();
     for (int j = 0; it_coords != _coordsList.end(); ++it_coords, ++j) {
@@ -2291,7 +2264,6 @@ BLSURFPlugin::TFaceEntryCoordsListMap* BLSURFPlugin_Hypothesis_i::GetAllCoordsBy
       for (CORBA::ULong i=0;i<coords->length();i++)
         coords[i] = (*it_coords)[i];
       coordsList[j] = coords;
-      MESSAGE("Coords #" << j << ": " << coords[0] << ", " << coords[1] << ", " << coords[2]);
     }
     mapElement->coordsList = coordsList;
 
@@ -2306,19 +2278,16 @@ BLSURFPlugin::TFaceEntryCoordsListMap* BLSURFPlugin_Hypothesis_i::GetAllCoordsBy
  * They are the coords of the "manual" enforced vertices.
  */
 BLSURFPlugin::TCoordsEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByCoords() {
-  MESSAGE("IDL: GetAllEnforcedVerticesByCoords()");
   ASSERT(myBaseImpl);
 
   BLSURFPlugin::TCoordsEnfVertexMap_var resultMap = new BLSURFPlugin::TCoordsEnfVertexMap();
   const ::BLSURFPlugin_Hypothesis::TCoordsEnfVertexMap coordsEnfVertexMap =
-      this->GetImpl()->_GetAllEnforcedVerticesByCoords();
+    this->GetImpl()->_GetAllEnforcedVerticesByCoords();
   resultMap->length(coordsEnfVertexMap.size());
-  MESSAGE("Enforced Vertex map size is " << resultMap->length());
 
   ::BLSURFPlugin_Hypothesis::TCoordsEnfVertexMap::const_iterator it_coords = coordsEnfVertexMap.begin();
   ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
   for (int i = 0; it_coords != coordsEnfVertexMap.end(); ++it_coords, ++i) {
-    MESSAGE("Enforced Vertex #" << i);
     currentEnfVertex = (it_coords->second);
     BLSURFPlugin::TCoordsEnfVertexElement_var mapElement = new BLSURFPlugin::TCoordsEnfVertexElement();
     BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
@@ -2326,7 +2295,6 @@ BLSURFPlugin::TCoordsEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVert
     for (CORBA::ULong ind=0;ind<coords->length();ind++)
       coords[ind] = it_coords->first[ind];
     mapElement->coords = coords;
-    MESSAGE("Coords: " << mapElement->coords[0] << ", " << mapElement->coords[1] << ", " << mapElement->coords[2]);
 
     BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
     // Name
@@ -2354,10 +2322,9 @@ BLSURFPlugin::TCoordsEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVert
     msg << "Enforced vertex: \n"
         << "Name: " << enfVertex->name << "\n";
     if (coords->length())
-        msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
+      msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
     msg << "Geom entry: " << enfVertex->geomEntry << "\n"
         << "Group Name: " << enfVertex->grpName;
-    MESSAGE(msg.str());
 
     resultMap[i] = mapElement;
   }
@@ -2371,34 +2338,29 @@ BLSURFPlugin::TCoordsEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVert
  *
  */
 BLSURFPlugin::TFaceEntryEnfVertexEntryListMap* BLSURFPlugin_Hypothesis_i::GetAllEnfVertexEntriesByFace() {
-  MESSAGE("IDL: GetAllEnfVertexEntriesByFace()");
   ASSERT(myBaseImpl);
 
   BLSURFPlugin::TFaceEntryEnfVertexEntryListMap_var resultMap = new BLSURFPlugin::TFaceEntryEnfVertexEntryListMap();
 
   const ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexEntryListMap entryEnfVertexEntryListMap =
-      this->GetImpl()->_GetAllEnfVertexEntriesByFace();
+    this->GetImpl()->_GetAllEnfVertexEntriesByFace();
   resultMap->length(entryEnfVertexEntryListMap.size());
-  MESSAGE("Enforced Vertex map size is " << resultMap->length());
 
   ::BLSURFPlugin_Hypothesis::TEntryList _enfVertexEntryList;
   ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexEntryListMap::const_iterator it_entry =
       entryEnfVertexEntryListMap.begin();
   for (int i = 0; it_entry != entryEnfVertexEntryListMap.end(); ++it_entry, ++i) {
     BLSURFPlugin::TFaceEntryEnfVertexEntryListMapElement_var mapElement =
-        new BLSURFPlugin::TFaceEntryEnfVertexEntryListMapElement();
+      new BLSURFPlugin::TFaceEntryEnfVertexEntryListMapElement();
     mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
-    MESSAGE("Face Entry: " << mapElement->faceEntry);
 
     _enfVertexEntryList = it_entry->second;
     BLSURFPlugin::TEntryList_var enfVertexEntryList = new BLSURFPlugin::TEntryList();
     enfVertexEntryList->length(_enfVertexEntryList.size());
-    MESSAGE("Number of enf vertex entries: " << enfVertexEntryList->length());
 
     ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_enfVertexEntry = _enfVertexEntryList.begin();
     for (int j = 0; it_enfVertexEntry != _enfVertexEntryList.end(); ++it_enfVertexEntry, ++j) {
       enfVertexEntryList[j] = CORBA::string_dup((*it_enfVertexEntry).c_str());
-      MESSAGE("Enf Vertex Entry #" << j << ": " << enfVertexEntryList[j]);
     }
     mapElement->enfVertexEntryList = enfVertexEntryList;
 
@@ -2413,23 +2375,19 @@ BLSURFPlugin::TFaceEntryEnfVertexEntryListMap* BLSURFPlugin_Hypothesis_i::GetAll
  * They are the geom entries of the enforced vertices defined with geom shape (vertex, compound, group).
  */
 BLSURFPlugin::TEnfVertexEntryEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByEnfVertexEntry() {
-  MESSAGE("IDL: GetAllEnforcedVerticesByEnfVertexEntry()");
   ASSERT(myBaseImpl);
 
   BLSURFPlugin::TEnfVertexEntryEnfVertexMap_var resultMap = new BLSURFPlugin::TEnfVertexEntryEnfVertexMap();
   const ::BLSURFPlugin_Hypothesis::TEnfVertexEntryEnfVertexMap enfVertexEntryEnfVertexMap =
-      this->GetImpl()->_GetAllEnforcedVerticesByEnfVertexEntry();
+    this->GetImpl()->_GetAllEnforcedVerticesByEnfVertexEntry();
   resultMap->length(enfVertexEntryEnfVertexMap.size());
-  MESSAGE("Enforced Vertex map size is " << resultMap->length());
 
   ::BLSURFPlugin_Hypothesis::TEnfVertexEntryEnfVertexMap::const_iterator it_enfVertexEntry = enfVertexEntryEnfVertexMap.begin();
   ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
   for (int i = 0; it_enfVertexEntry != enfVertexEntryEnfVertexMap.end(); ++it_enfVertexEntry, ++i) {
-    MESSAGE("Enforced Vertex #" << i);
     currentEnfVertex = it_enfVertexEntry->second;
     BLSURFPlugin::TEnfVertexEntryEnfVertexElement_var mapElement = new BLSURFPlugin::TEnfVertexEntryEnfVertexElement();
     mapElement->enfVertexEntry = CORBA::string_dup(it_enfVertexEntry->first.c_str());;
-    MESSAGE("Enf Vertex Entry #" << i << ": " << mapElement->enfVertexEntry);
 
     BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
     // Name
@@ -2456,10 +2414,9 @@ BLSURFPlugin::TEnfVertexEntryEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnfo
     msg << "Enforced vertex: \n"
         << "Name: " << enfVertex->name << "\n";
     if (coords->length())
-        msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
+      msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
     msg << "Geom entry: " << enfVertex->geomEntry << "\n"
         << "Group Name: " << enfVertex->grpName;
-    MESSAGE(msg.str());
 
     mapElement->enfVertex = enfVertex;
     resultMap[i] = mapElement;
@@ -2477,14 +2434,13 @@ void BLSURFPlugin_Hypothesis_i::ClearAllEnforcedVertices() {
 }
 
 /*!
- * Set/get/unset an enforced vertex on face
+ * Set/get/unset an enforced vertex on face - OBSOLETE
  */
 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
-    CORBA::Double z) throw (SALOME::SALOME_Exception) {
+                                                  CORBA::Double z) throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
 
@@ -2504,8 +2460,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace,
   }
   if (theFaceEntry.empty())
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : SetEnforcedVertex( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ")");
   try {
     return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z);
   } catch (SALOME_Exception& ex) {
@@ -2517,11 +2471,10 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace,
  * Set/get/unset an enforced vertex with name on face
  */
 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
-    CORBA::Double z, const char* theVertexName) throw (SALOME::SALOME_Exception) {
+                                                       CORBA::Double z, const char* theVertexName) throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
 
@@ -2542,8 +2495,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr the
   if (theFaceEntry.empty())
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
   
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : SetEnforcedVertexNamed( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theVertexName << ")");
   try {
     return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, theVertexName);
   } catch (SALOME_Exception& ex) {
@@ -2555,16 +2506,14 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr the
  * Set/get/unset an enforced vertex with geom object on face
  */
 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
-    throw (SALOME::SALOME_Exception) {
+  throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
 
   if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
   }
 
@@ -2610,9 +2559,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theF
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
 
   string theVertexName = theVertex->GetName();
-  MESSAGE("IDL : theFace->GetName : " << theFace->GetName());
-  MESSAGE("IDL : theVertex->GetName : " << theVertexName);
-  MESSAGE("IDL : SetEnforcedVertexGeom( "<< theFaceEntry << ", " << theVertexEntry<< ")");
   try {
     return SetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexName.c_str(), theVertexEntry.c_str());
   } catch (SALOME_Exception& ex) {
@@ -2624,12 +2570,11 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theF
  * Set an enforced vertex with group name on face
  */
 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
- throw (SALOME::SALOME_Exception)
 throw (SALOME::SALOME_Exception)
 {
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
 
@@ -2649,8 +2594,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr
   }
   if (theFaceEntry.empty())
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : SetEnforcedVertexWithGroup( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theGroupName << ")");
   try {
     return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, "", "", theGroupName);
   } catch (SALOME_Exception& ex) {
@@ -2663,12 +2606,11 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr
  */
 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, 
                                                                 const char* theVertexName, const char* theGroupName)
- throw (SALOME::SALOME_Exception)
 throw (SALOME::SALOME_Exception)
 {
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
 
@@ -2688,8 +2630,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Objec
   }
   if (theFaceEntry.empty())
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : SetEnforcedVertexNamedWithGroup( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theVertexName << ", " << theGroupName << ")");
   try {
     return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, theVertexName, "", theGroupName);
   } catch (SALOME_Exception& ex) {
@@ -2701,17 +2641,15 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Objec
  * Set an enforced vertex with geom entry and group name on face
  */
 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
- throw (SALOME::SALOME_Exception)
 throw (SALOME::SALOME_Exception)
 {
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
 
   if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
   }
 
@@ -2748,9 +2686,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
 
   string theVertexName = theVertex->GetName();
-  MESSAGE("IDL : theFace->GetName : " << theFace->GetName());
-  MESSAGE("IDL : theVertex->GetName : " << theVertexName);
-  MESSAGE("IDL : SetEnforcedVertexGeomWithGroup( "<< theFaceEntry << ", " << theVertexEntry<< ", " << theGroupName<< ")");
   try {
     return SetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexName.c_str(), theVertexEntry.c_str(), theGroupName);
   } catch (SALOME_Exception& ex) {
@@ -2767,7 +2702,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object
 //  ASSERT(myBaseImpl);
 
 //  if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-//    MESSAGE("theFace shape type is not FACE or COMPOUND");
 //    THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
 //  }
 
@@ -2788,8 +2722,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object
 //  if (theFaceEntry.empty())
 //    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
 
-//  MESSAGE("IDL : GetName : " << theFace->GetName());
-//  MESSAGE("IDL : GetInternalEnforcedVertexEntry ( "<< theFaceEntry << ")");
 //  try {
 //    return GetInternalEnforcedVertexEntry(theFaceEntry.c_str());
 //  } catch (SALOME_Exception& ex) {
@@ -2801,11 +2733,10 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object
  * Get the list of all enforced vertices
  */
 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVertices(GEOM::GEOM_Object_ptr theFace)
-    throw (SALOME::SALOME_Exception) {
+  throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
 
@@ -2826,8 +2757,6 @@ BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVertices(GEO
   if (theFaceEntry.empty())
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
 
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : GetEnforcedVerticesEntry ( "<< theFaceEntry << ")");
   try {
     return GetEnforcedVerticesEntry(theFaceEntry.c_str());
   } catch (SALOME_Exception& ex) {
@@ -2836,11 +2765,10 @@ BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVertices(GEO
 }
 
 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
-    CORBA::Double z) throw (SALOME::SALOME_Exception) {
+                                                    CORBA::Double z) throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
 
@@ -2860,8 +2788,6 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFac
   }
   if (theFaceEntry.empty())
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : UnsetEnforcedVertex ( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ")");
 
   try {
     return UnsetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z);
@@ -2871,15 +2797,13 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFac
 }
 
 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
-    throw (SALOME::SALOME_Exception) {
+  throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
   if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
   }
 
@@ -2924,7 +2848,6 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr th
   if (theVertexEntry.empty())
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
   
-  MESSAGE("IDL : UnsetEnforcedVertexGeom ( "<< theFaceEntry << ", " << theVertexEntry << ")");
 
   try {
     return UnsetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexEntry.c_str());
@@ -2937,7 +2860,6 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theF
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
 
@@ -2958,8 +2880,6 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theF
   if (theFaceEntry.empty())
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
   
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : UnsetEnforcedVertices ( "<< theFaceEntry << ")");
 
   try {
     return UnsetEnforcedVerticesEntry(theFaceEntry.c_str());
@@ -2969,13 +2889,197 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theF
 }
 
 /*!
- * Set/get/unset an enforced vertex on geom object given by entry
+ * Set/get/unset an enforced vertex on face - NEW (no face)
+ */
+bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception)
+{
+  ASSERT(myBaseImpl);
+
+  try {
+    return SetEnforcedVertexEntry("", x, y, z);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+/*!
+ * Set/get/unset an enforced vertex with name on face
+ */
+bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName) throw (SALOME::SALOME_Exception)
+{
+  try {
+    return SetEnforcedVertexEntry("", x, y, z, theVertexName);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+/*!
+ * Set/get/unset an enforced vertex with geom object on face
+ */
+bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex)
+  throw (SALOME::SALOME_Exception)
+{
+  if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
+    THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
+  }
+  string theVertexEntry = theVertex->GetStudyEntry();
+  
+  GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+  SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
+  string aName;
+  
+  if (theVertexEntry.empty()) {
+    if (theVertex->GetShapeType() == GEOM::VERTEX)
+      aName = "Vertex_";
+    if (theVertex->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theVertex->GetEntry();
+    SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy( NULL, theVertex, aName.c_str());
+    if (!theSVertex->_is_nil())
+      theVertexEntry = theSVertex->GetID();
+  }
+  if (theVertexEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+
+  string theVertexName = theVertex->GetName();
+  try {
+    return SetEnforcedVertexEntry("", 0, 0, 0, theVertexName.c_str(), theVertexEntry.c_str());
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+/*!
+ * Set an enforced vertex with group name on face
+ */
+bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
+  throw (SALOME::SALOME_Exception)
+{
+  ASSERT(myBaseImpl);
+
+  try {
+    return SetEnforcedVertexEntry("", x, y, z, "", "", theGroupName);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+/*!
+ * Set an enforced vertex with name and group name on face
  */
-bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y,
-    CORBA::Double z, const char* theVertexName, const char* theVertexEntry, const char* theGroupName)
-    throw (SALOME::SALOME_Exception) {
+bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, 
+                                                                const char* theVertexName, const char* theGroupName)
+  throw (SALOME::SALOME_Exception)
+{
   ASSERT(myBaseImpl);
-  MESSAGE("IDL : SetEnforcedVertexEntry(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theVertexName << "\", \"" << theVertexEntry << "\", \"" << theGroupName << "\")");
+
+  try {
+    return SetEnforcedVertexEntry("", x, y, z, theVertexName, "", theGroupName);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+/*!
+ * Set an enforced vertex with geom entry and group name on face
+ */
+bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
+  throw (SALOME::SALOME_Exception)
+{
+  if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
+    THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
+  }
+
+  string theVertexEntry = theVertex->GetStudyEntry();
+  
+  GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+  SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
+  string aName;
+  
+  if (theVertexEntry.empty()) {
+    if (theVertex->GetShapeType() == GEOM::VERTEX)
+      aName = "Vertex_";
+    if (theVertex->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theVertex->GetEntry();
+    SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy( NULL, theVertex, aName.c_str());
+    if (!theSVertex->_is_nil())
+      theVertexEntry = theSVertex->GetID();
+  }
+  if (theVertexEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+
+  string theVertexName = theVertex->GetName();
+  try {
+    return SetEnforcedVertexEntry("", 0, 0, 0, theVertexName.c_str(), theVertexEntry.c_str(), theGroupName);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+bool BLSURFPlugin_Hypothesis_i::RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception)
+{
+  try {
+    return UnsetEnforcedVertexEntry("", x, y, z);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+bool BLSURFPlugin_Hypothesis_i::RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex)
+  throw (SALOME::SALOME_Exception)
+{
+  if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
+    THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
+  }
+  std::string theVertexEntry = theVertex->GetStudyEntry();
+  
+  GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+  SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
+  string aName;
+  
+  if (theVertexEntry.empty()) {
+    if (theVertex->GetShapeType() == GEOM::VERTEX)
+      aName = "Vertex_";
+    if (theVertex->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theVertex->GetEntry();
+    SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy( NULL, theVertex, aName.c_str());
+    if (!theSVertex->_is_nil())
+      theVertexEntry = theSVertex->GetID();
+  }
+  if (theVertexEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+  
+  try {
+    return UnsetEnforcedVertexEntry("", 0, 0, 0, theVertexEntry.c_str());
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+bool BLSURFPlugin_Hypothesis_i::RemoveEnforcedVertices() throw (SALOME::SALOME_Exception)
+{
+  try {
+    return UnsetEnforcedVerticesEntry("");
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+/*!
+ * Set/get/unset an enforced vertex on geom object given by entry
+ */
+bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntry(const char* theFaceEntry,
+                                                       CORBA::Double x,
+                                                       CORBA::Double y,
+                                                       CORBA::Double z,
+                                                       const char* theVertexName,
+                                                       const char* theVertexEntry,
+                                                       const char* theGroupName)
+  throw (SALOME::SALOME_Exception)
+{
   bool newValue = false;
   if (string(theVertexEntry).empty()) {
     try {
@@ -2986,37 +3090,29 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntry(const char* theFaceEntry,
       coords.push_back(y);
       coords.push_back(z);
       if (coordsList.find(coords) == coordsList.end()) {
-        MESSAGE("Coords not found: add it in coordsList");
         newValue = true;
       } else {
-        MESSAGE("Coords already found, compare names");
         ::BLSURFPlugin_Hypothesis::TEnfVertex *enfVertex = this->GetImpl()->GetEnfVertex(coords);
         if ((enfVertex->name != theVertexName) || (enfVertex->grpName != theGroupName)) {
-          MESSAGE("The names are different: update");
-          //          this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z);
           newValue = true;
         }
-        else {
-          MESSAGE("The names are identical");
-        }
       }
     } catch (const std::invalid_argument& ex) {
       // no enforced vertex for entry
-      MESSAGE("Face entry not found : add it to the list");
       newValue = true;
     }
     if (newValue) {
       if (string(theVertexName).empty()) {
         if (string(theGroupName).empty())
-          SMESH::TPythonDump() << _this() << ".SetEnforcedVertex(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ")";
+          SMESH::TPythonDump() << _this() << ".AddEnforcedVertex(" << x << ", " << y << ", " << z << ")";
         else
-          SMESH::TPythonDump() << _this() << ".SetEnforcedVertexWithGroup(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theGroupName << "\")";
+          SMESH::TPythonDump() << _this() << ".AddEnforcedVertexWithGroup(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theGroupName << "\")";
       }
       else {
         if (string(theGroupName).empty())
-          SMESH::TPythonDump() << _this() << ".SetEnforcedVertexNamed(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theVertexName << "\")";
+          SMESH::TPythonDump() << _this() << ".AddEnforcedVertexNamed(" << x << ", " << y << ", " << z << ", \"" << theVertexName << "\")";
         else
-          SMESH::TPythonDump() << _this() << ".SetEnforcedVertexNamedWithGroup(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \""
+          SMESH::TPythonDump() << _this() << ".AddEnforcedVertexNamedWithGroup(" << x << ", " << y << ", " << z << ", \""
                                << theVertexName << "\", \"" << theGroupName << "\")";
       }
     }
@@ -3025,63 +3121,39 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntry(const char* theFaceEntry,
       ::BLSURFPlugin_Hypothesis::TEntryList enfVertexEntryList = this->GetImpl()->GetEnfVertexEntryList(theFaceEntry);
       ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it = enfVertexEntryList.find(theVertexEntry);
       if ( it == enfVertexEntryList.end()) {
-        MESSAGE("Geom entry not found: add it in enfVertexEntryList");
         newValue = true;
       }
       else {
-        MESSAGE("Geom entry already found, compare names");
         ::BLSURFPlugin_Hypothesis::TEnfVertex *enfVertex = this->GetImpl()->GetEnfVertex((*it));
         if ((enfVertex->name != theVertexName) || (enfVertex->grpName != theGroupName)) {
-          MESSAGE("The names are different: update");
-//          this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z);
           newValue = true;
         }
-        else {
-          MESSAGE("The names are identical");
-        }
       }
     } catch (const std::invalid_argument& ex) {
       // no enforced vertex for entry
-      MESSAGE("Face entry not found : add it to the list");
       newValue = true;
     }
     if (newValue) {
       if (string(theGroupName).empty())
-        SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGeom(" << theFaceEntry << ", " << theVertexEntry << ")";
+        SMESH::TPythonDump() << _this() << ".AddEnforcedVertexGeom(" << theVertexEntry << ")";
       else
-        SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGeomWithGroup(" << theFaceEntry << ", " << theVertexEntry << ", \"" << theGroupName << "\")";
+        SMESH::TPythonDump() << _this() << ".AddEnforcedVertexGeomWithGroup(" << theVertexEntry << ", \"" << theGroupName << "\")";
     }
   }
 
   if (newValue)
     this->GetImpl()->SetEnforcedVertex(theFaceEntry, theVertexName, theVertexEntry, theGroupName, x, y, z);
 
-  MESSAGE("IDL : SetEnforcedVertexEntry END");
   return newValue;
 }
 
-//Enable internal enforced vertices on specific face if requested by user
-//CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexEntry(const char* theFaceEntry)
-//    throw (SALOME::SALOME_Exception) {
-//  ASSERT(myBaseImpl);
-//  try {
-//    return this->GetImpl()->GetInternalEnforcedVertex(theFaceEntry);
-//  } catch (const std::exception& ex) {
-//    std::cout << "Exception: " << ex.what() << std::endl;
-//    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
-//  }
-//}
-  
 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntry(const char* entry)
-    throw (SALOME::SALOME_Exception) {
-  ASSERT(myBaseImpl);
-  MESSAGE("ENGINE : GetEnforcedVerticesEntry START ENTRY : " << entry);
-
+  throw (SALOME::SALOME_Exception)
+{
   try {
     BLSURFPlugin::TEnfVertexList_var vertexList = new BLSURFPlugin::TEnfVertexList();
     ::BLSURFPlugin_Hypothesis::TEnfVertexList _vList = this->GetImpl()->GetEnfVertexList(entry);
     vertexList->length(_vList.size());
-    MESSAGE("Number of enforced vertices: " << vertexList->length());
     ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator evlIt = _vList.begin();
     for (int i = 0; evlIt != _vList.end(); ++evlIt, ++i) {
       ::BLSURFPlugin_Hypothesis::TEnfVertex *_enfVertex = (*evlIt);
@@ -3110,7 +3182,6 @@ BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntr
 
       vertexList[i] = enfVertex;
     }
-    MESSAGE("ENGINE : GetEnforcedVerticesEntry END ENTRY : " << entry);
     return vertexList._retn();
   } catch (const std::invalid_argument& ex) {
     SALOME::ExceptionStruct ExDescription;
@@ -3125,20 +3196,19 @@ BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntr
   }
 }
 
-bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y,
-    CORBA::Double z, const char* theVertexEntry) throw (SALOME::SALOME_Exception) {
+bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexEntry) throw (SALOME::SALOME_Exception)
+{
   ASSERT(myBaseImpl);
-  MESSAGE("IDL : UnsetEnforcedVertexEntry(" << theFaceEntry << "," << x << "," << y << "," << z << ", " << theVertexEntry << ")");
 
   bool res = false;
   try {
     res = this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z, theVertexEntry);
 
     if (string(theVertexEntry).empty())
-      SMESH::TPythonDump() << "isDone = " << _this() << ".UnsetEnforcedVertex(" << theFaceEntry << ", " << x << ", " << y << ", " << z
-          << ")";
+      SMESH::TPythonDump() << "isDone = " << _this() << ".RemoveEnforcedVertex(" << x << ", " << y << ", " << z
+                           << ")";
     else
-      SMESH::TPythonDump() << "isDone = " << _this() << ".UnsetEnforcedVertexGeom(" << theFaceEntry << ", " << theVertexEntry << ")";
+      SMESH::TPythonDump() << "isDone = " << _this() << ".RemoveEnforcedVertexGeom(" << theVertexEntry << ")";
 
   } catch (const std::invalid_argument& ex) {
     return false;
@@ -3147,44 +3217,21 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntry(const char* theFaceEntr
     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
 
-  MESSAGE("ENGINE : UnsetEnforcedVertexEntry END ENTRY : " << theFaceEntry);
   return res;
 }
-
-//bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntryWithPoint(const char* theFaceEntry, const char* theVertexEntry,
-//    CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception) {
-//  MESSAGE("IDL : UnsetEnforcedVertexEntryWithPoint START theFaceEntry=" << theFaceEntry << ", theVertexEntry=" << theVertexEntry);
-//
-//  bool ret = false;
-//
-//  try {
-//    ret = _unsetEnfVertex(theFaceEntry, x, y, z);
-//  } catch (SALOME_Exception& ex) {
-//    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
-//  }
-//
-//  if (ret)
-//    SMESH::TPythonDump() << _this() << ".UnsetEnforcedVertexWithPoint(" << theFaceEntry << ", " << theVertexEntry
-//        << ")";
-//
-//  MESSAGE("IDL : UnsetEnforcedVertexEntryWithPoint END ENTRY : " << theFaceEntry);
-//  return ret;
-//}
-
-bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception) {
+bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception)
+{
   ASSERT(myBaseImpl);
-  MESSAGE("IDL : UnsetEnforcedVerticesEntry(" << theFaceEntry << ")");
 
   try {
     this->GetImpl()->ClearEnforcedVertices(theFaceEntry);
-    SMESH::TPythonDump() << _this() << ".UnsetEnforcedVertices(" << theFaceEntry << ")";
+    SMESH::TPythonDump() << _this() << ".RemoveEnforcedVertices()";
   } catch (const std::invalid_argument& ex) {
     return false;
   } catch (const std::exception& ex) {
     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
 
-  MESSAGE("IDL : UnsetEnforcedVerticesEntry END ENTRY : " << theFaceEntry);
   return true;
 }
 
@@ -3195,8 +3242,8 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVerticesEntry(const char* theFaceEn
  *  Set true or false
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces(CORBA::Boolean theValue) {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces");
+void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces(CORBA::Boolean theValue)
+{
   ASSERT(myBaseImpl);
   this->GetImpl()->SetInternalEnforcedVertexAllFaces(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -3210,8 +3257,8 @@ void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces(CORBA::Boolean
  *  Get true or false
  */
 //=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces() {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces");
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces()
+{
   ASSERT(myBaseImpl);
   return this->GetImpl()->_GetInternalEnforcedVertexAllFaces();
 }
@@ -3223,8 +3270,8 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces() {
  *  Set group name
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup(const char*  groupName) {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup");
+void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup(const char*  groupName)
+{
   ASSERT(myBaseImpl);
   this->GetImpl()->SetInternalEnforcedVertexAllFacesGroup(groupName);
   SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexAllFacesGroup( \"" << groupName << "\" )";
@@ -3237,8 +3284,8 @@ void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup(const cha
  *  Get group name
  */
 //=============================================================================
-char* BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup() {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup");
+char* BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup()
+{
   ASSERT(myBaseImpl);
   return CORBA::string_dup(this->GetImpl()->_GetInternalEnforcedVertexAllFacesGroup().c_str());
 }
@@ -3246,124 +3293,115 @@ char* BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup() {
 /*
  * Enable internal enforced vertices on specific face if requested by user
  *
-void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices)
+ void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices)
  throw (SALOME::SALOME_Exception)
-{
-  MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFace");
-  try {
-    SetInternalEnforcedVertexWithGroup(theFace, toEnforceInternalVertices);
-  } catch (SALOME_Exception& ex) {
-    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
-  }
-}
+ {
+ try {
+ SetInternalEnforcedVertexWithGroup(theFace, toEnforceInternalVertices);
+ } catch (SALOME_Exception& ex) {
+ THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+ }
+ }
 
-void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName)
+ void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName)
  throw (SALOME::SALOME_Exception)
-{
-  MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFaceWithGroup");
-
-  if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
-    THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
-  }
-
-  string theFaceEntry = theFace->GetStudyEntry();
-
-  if (theFaceEntry.empty()) {
-    GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-    string aName;
-    if (theFace->GetShapeType() == GEOM::FACE)
-      aName = "Face_";
-    if (theFace->GetShapeType() == GEOM::COMPOUND)
-      aName = "Compound_";
-    aName += theFace->GetEntry();
-    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
-    if (!theSFace->_is_nil())
-      theFaceEntry = theSFace->GetID();
-  }
-  if (theFaceEntry.empty())
-    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
-
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : GetInternalEnforcedVertexEntry ( "<< theFaceEntry << ")");
-  try {
-    SetInternalEnforcedVertexEntry(theFaceEntry.c_str(), toEnforceInternalVertices, theGroupName);
-  } catch (SALOME_Exception& ex) {
-    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
-  }
-}
+ {
 
-void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName)
-    throw (SALOME::SALOME_Exception)
-{
-  MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFaceEntry");
-  ASSERT(myBaseImpl);
-  try {
-    this->GetImpl()->SetInternalEnforcedVertex(theFaceEntry, toEnforceInternalVertices, theGroupName);
-    std::string theValueStr = toEnforceInternalVertices ? "True" : "False";
-    if (string(theGroupName).empty())
-      SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertex( " << theFaceEntry << ", " << theValueStr.c_str() << " )";
-    else
-      SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexWithGroup( " << theFaceEntry << ", " << theValueStr.c_str() << ", \"" << theGroupName << "\" )";
-  } catch (const std::exception& ex) {
-    std::cout << "Exception: " << ex.what() << std::endl;
-    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
-  }
-}
+ if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
+ THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
+ }
 
-*/
+ string theFaceEntry = theFace->GetStudyEntry();
+
+ if (theFaceEntry.empty()) {
+ GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+ SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
+ string aName;
+ if (theFace->GetShapeType() == GEOM::FACE)
+ aName = "Face_";
+ if (theFace->GetShapeType() == GEOM::COMPOUND)
+ aName = "Compound_";
+ aName += theFace->GetEntry();
+ SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
+ if (!theSFace->_is_nil())
+ theFaceEntry = theSFace->GetID();
+ }
+ if (theFaceEntry.empty())
+ THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
 
-/* TODO GROUPS
- char* BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z)
- throw (SALOME::SALOME_Exception)
- {
- ASSERT(myBaseImpl);
- MESSAGE("ENGINE : GetEnforcedVertexGroupName START ");
  try {
- return CORBA::string_dup( this->GetImpl()->GetEnforcedVertexGroupName(x, y, z).c_str());
- }
- catch (const std::invalid_argument& ex) {
- SALOME::ExceptionStruct ExDescription;
- ExDescription.text = ex.what();
- ExDescription.type = SALOME::BAD_PARAM;
- ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(entry)";
- ExDescription.lineNumber = 1146;
- throw SALOME::SALOME_Exception(ExDescription);
- }
- catch (SALOME_Exception& ex) {
+ SetInternalEnforcedVertexEntry(theFaceEntry.c_str(), toEnforceInternalVertices, theGroupName);
+ } catch (SALOME_Exception& ex) {
  THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
  }
- MESSAGE("ENGINE : GetEnforcedVertexGroupName END ");
- return 0;
  }
 
-
- void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* groupName)
+ void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName)
  throw (SALOME::SALOME_Exception)
  {
  ASSERT(myBaseImpl);
- MESSAGE("ENGINE : SetEnforcedVertexGroupName START ");
  try {
- this->GetImpl()->SetEnforcedVertexGroupName(x, y, z, groupName);
- }
- catch (const std::invalid_argument& ex) {
- SALOME::ExceptionStruct ExDescription;
- ExDescription.text = ex.what();
- ExDescription.type = SALOME::BAD_PARAM;
- ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetEnforcedVertexGroupName(x,y,z)";
- ExDescription.lineNumber = 1170;
- throw SALOME::SALOME_Exception(ExDescription);
- }
- catch (SALOME_Exception& ex) {
+ this->GetImpl()->SetInternalEnforcedVertex(theFaceEntry, toEnforceInternalVertices, theGroupName);
+ std::string theValueStr = toEnforceInternalVertices ? "True" : "False";
+ if (string(theGroupName).empty())
+ SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertex( " << theFaceEntry << ", " << theValueStr.c_str() << " )";
+ else
+ SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexWithGroup( " << theFaceEntry << ", " << theValueStr.c_str() << ", \"" << theGroupName << "\" )";
+ } catch (const std::exception& ex) {
+ std::cout << "Exception: " << ex.what() << std::endl;
  THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
  }
+ }
 
- SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGroupName("
- << x << ", " << y << ", " << z << ", '" << groupName << "' )";
+*/
 
- MESSAGE("ENGINE : SetEnforcedVertexGroupName END ");
- }
- */
+/* TODO GROUPS
+   char* BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z)
+   throw (SALOME::SALOME_Exception)
+   {
+   ASSERT(myBaseImpl);
+   try {
+   return CORBA::string_dup( this->GetImpl()->GetEnforcedVertexGroupName(x, y, z).c_str());
+   }
+   catch (const std::invalid_argument& ex) {
+   SALOME::ExceptionStruct ExDescription;
+   ExDescription.text = ex.what();
+   ExDescription.type = SALOME::BAD_PARAM;
+   ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(entry)";
+   ExDescription.lineNumber = 1146;
+   throw SALOME::SALOME_Exception(ExDescription);
+   }
+   catch (SALOME_Exception& ex) {
+   THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+   }
+   return 0;
+   }
+
+
+   void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* groupName)
+   throw (SALOME::SALOME_Exception)
+   {
+   ASSERT(myBaseImpl);
+   try {
+   this->GetImpl()->SetEnforcedVertexGroupName(x, y, z, groupName);
+   }
+   catch (const std::invalid_argument& ex) {
+   SALOME::ExceptionStruct ExDescription;
+   ExDescription.text = ex.what();
+   ExDescription.type = SALOME::BAD_PARAM;
+   ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetEnforcedVertexGroupName(x,y,z)";
+   ExDescription.lineNumber = 1170;
+   throw SALOME::SALOME_Exception(ExDescription);
+   }
+   catch (SALOME_Exception& ex) {
+   THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+   }
+
+   SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGroupName("
+   << x << ", " << y << ", " << z << ", '" << groupName << "' )";
+
+   }
+*/
 ///////////////////////
 
 ///////////////////////
@@ -3373,7 +3411,6 @@ void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexEntry(const char* theFa
 
 std::string BLSURFPlugin_Hypothesis_i::ShapeTypeToString(GEOM::shape_type theShapeType)
 {
-//enum shape_type { COMPOUND, COMPSOLID, SOLID, SHELL, FACE, WIRE, EDGE, VERTEX, SHAPE /*, __max_shape_type=0xffffffff */ };
   std::map<GEOM::shape_type, std::string> MapShapeTypeToString;
   MapShapeTypeToString[GEOM::COMPOUND] = std::string("COMPOUND");
   MapShapeTypeToString[GEOM::COMPSOLID] = std::string("COMPSOLID");
@@ -3394,18 +3431,17 @@ void BLSURFPlugin_Hypothesis_i::CheckShapeTypes(GEOM::GEOM_Object_ptr shape, std
   bool ok = false;
   std::stringstream typesTxt;
   for (std::size_t i=0; i<theShapeTypes.size(); i++)
-    {
-      GEOM::shape_type theShapeType = theShapeTypes[i];
-      if (shape->GetShapeType() == theShapeType)
-        ok = true;
-      typesTxt << ShapeTypeToString(theShapeType);
-      if (i < theShapeTypes.size()-1 )
-        typesTxt << ", ";
-    }
+  {
+    GEOM::shape_type theShapeType = theShapeTypes[i];
+    if (shape->GetShapeType() == theShapeType)
+      ok = true;
+    typesTxt << ShapeTypeToString(theShapeType);
+    if (i < theShapeTypes.size()-1 )
+      typesTxt << ", ";
+  }
   if (!ok){
     std::stringstream msg;
-    msg << "shape shape type is not in" << typesTxt.str();
-    MESSAGE(msg.str());
+    msg << "shape type is not in" << typesTxt.str();
     THROW_SALOME_CORBA_EXCEPTION(msg.str().c_str(), SALOME::BAD_PARAM);
   }
 }
@@ -3416,7 +3452,6 @@ void BLSURFPlugin_Hypothesis_i::CheckShapeType(GEOM::GEOM_Object_ptr shape, GEOM
   if (shape->GetShapeType() != theShapeType) {
     std::stringstream msg;
     msg << "shape shape type is not " << ShapeTypeToString(theShapeType);
-    MESSAGE(msg.str());
     THROW_SALOME_CORBA_EXCEPTION(msg.str().c_str(), SALOME::BAD_PARAM);
   }
 }
@@ -3449,26 +3484,26 @@ std::string BLSURFPlugin_Hypothesis_i::FormatVerticesEntries(vector<string> &the
   std::stringstream listEntriesTxt;
 
   if (!theSourceVerticesEntries.empty())
+  {
+    listEntriesTxt << ", [" ;
+    size_t i =0;
+    for (std::vector<std::string>::const_iterator it = theSourceVerticesEntries.begin(); it != theSourceVerticesEntries.end(); it++, i++)
     {
-      listEntriesTxt << ", [" ;
-      size_t i =0;
-      for (std::vector<std::string>::const_iterator it = theSourceVerticesEntries.begin(); it != theSourceVerticesEntries.end(); it++, i++)
-        {
-          if (i>0)
-            listEntriesTxt << ", ";
-          listEntriesTxt << *it;
-        }
+      if (i>0)
+        listEntriesTxt << ", ";
+      listEntriesTxt << *it;
+    }
 
-      listEntriesTxt << "], [" ;
-      i =0;
-      for (std::vector<std::string>::const_iterator it = theTargetVerticesEntries.begin(); it != theTargetVerticesEntries.end(); it++, i++)
-        {
-          if (i>0)
-            listEntriesTxt << ", ";
-          listEntriesTxt << *it;
-        }
-      listEntriesTxt << "]" ;
+    listEntriesTxt << "], [" ;
+    i =0;
+    for (std::vector<std::string>::const_iterator it = theTargetVerticesEntries.begin(); it != theTargetVerticesEntries.end(); it++, i++)
+    {
+      if (i>0)
+        listEntriesTxt << ", ";
+      listEntriesTxt << *it;
     }
+    listEntriesTxt << "]" ;
+  }
   return listEntriesTxt.str();
 }
 
@@ -3483,66 +3518,61 @@ void BLSURFPlugin_Hypothesis_i::ClearPreCadPeriodicityVectors() {
 
 BLSURFPlugin::TPeriodicityList* BLSURFPlugin_Hypothesis_i::GetPreCadFacesPeriodicityVector()
 {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCadFacesPeriodicityVector");
   const ::BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector preCadPeriodicityVector =
-      this->GetImpl()->_GetPreCadFacesPeriodicityVector();
+    this->GetImpl()->_GetPreCadFacesPeriodicityVector();
 
   BLSURFPlugin::TPeriodicityList_var periodicityList = PreCadVectorToSequence(preCadPeriodicityVector);
 
-  MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCadFacesPeriodicityVector end");
   return periodicityList._retn();
 }
 
 BLSURFPlugin::TPeriodicityList* BLSURFPlugin_Hypothesis_i::GetPreCadEdgesPeriodicityVector()
 {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCadEdgesPeriodicityVector");
   const ::BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector preCadPeriodicityVector =
-      this->GetImpl()->_GetPreCadEdgesPeriodicityVector();
+    this->GetImpl()->_GetPreCadEdgesPeriodicityVector();
 
   BLSURFPlugin::TPeriodicityList_var periodicityList = PreCadVectorToSequence(preCadPeriodicityVector);
 
-  MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCadEdgesPeriodicityVector end");
   return periodicityList._retn();
 }
 
 // convert a vector preCadPeriodicityVector into TPeriodicityList Corba sequence
 BLSURFPlugin::TPeriodicityList* BLSURFPlugin_Hypothesis_i::PreCadVectorToSequence(const ::BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector& preCadPeriodicityVector)
 {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::PreCadVectorToSequence");
   BLSURFPlugin::TPeriodicityList_var periodicityList = new BLSURFPlugin::TPeriodicityList();
 
-    periodicityList->length(preCadPeriodicityVector.size());
+  periodicityList->length(preCadPeriodicityVector.size());
 
-    for (size_t i = 0; i<preCadPeriodicityVector.size(); i++)
-      {
-        ::BLSURFPlugin_Hypothesis::TPreCadPeriodicity preCadPeriodicityVector_i = preCadPeriodicityVector[i];
+  for (size_t i = 0; i<preCadPeriodicityVector.size(); i++)
+  {
+    ::BLSURFPlugin_Hypothesis::TPreCadPeriodicity preCadPeriodicityVector_i = preCadPeriodicityVector[i];
 
-        BLSURFPlugin::TPreCadPeriodicity_var myPreCadPeriodicity = new BLSURFPlugin::TPreCadPeriodicity();
-        myPreCadPeriodicity->shape1Entry = CORBA::string_dup(preCadPeriodicityVector_i.shape1Entry.c_str());
-        myPreCadPeriodicity->shape2Entry = CORBA::string_dup(preCadPeriodicityVector_i.shape2Entry.c_str());
+    BLSURFPlugin::TPreCadPeriodicity_var myPreCadPeriodicity = new BLSURFPlugin::TPreCadPeriodicity();
+    myPreCadPeriodicity->shape1Entry = CORBA::string_dup(preCadPeriodicityVector_i.shape1Entry.c_str());
+    myPreCadPeriodicity->shape2Entry = CORBA::string_dup(preCadPeriodicityVector_i.shape2Entry.c_str());
 
-        BLSURFPlugin::TEntryList_var sourceVertices = new BLSURFPlugin::TEntryList();
-        if (! preCadPeriodicityVector_i.theSourceVerticesEntries.empty())
-          {
-            sourceVertices->length(preCadPeriodicityVector_i.theSourceVerticesEntries.size());
-            for (size_t j=0; j<preCadPeriodicityVector_i.theSourceVerticesEntries.size(); j++)
-              sourceVertices[j]=CORBA::string_dup(preCadPeriodicityVector_i.theSourceVerticesEntries[j].c_str());
-          }
+    BLSURFPlugin::TEntryList_var sourceVertices = new BLSURFPlugin::TEntryList();
+    if (! preCadPeriodicityVector_i.theSourceVerticesEntries.empty())
+    {
+      sourceVertices->length(preCadPeriodicityVector_i.theSourceVerticesEntries.size());
+      for (size_t j=0; j<preCadPeriodicityVector_i.theSourceVerticesEntries.size(); j++)
+        sourceVertices[j]=CORBA::string_dup(preCadPeriodicityVector_i.theSourceVerticesEntries[j].c_str());
+    }
 
-        myPreCadPeriodicity->theSourceVerticesEntries = sourceVertices;
+    myPreCadPeriodicity->theSourceVerticesEntries = sourceVertices;
 
-        BLSURFPlugin::TEntryList_var targetVertices = new BLSURFPlugin::TEntryList();
-        if (! preCadPeriodicityVector_i.theTargetVerticesEntries.empty())
-           {
-            targetVertices->length(preCadPeriodicityVector_i.theTargetVerticesEntries.size());
-             for (size_t j=0; j<preCadPeriodicityVector_i.theTargetVerticesEntries.size(); j++)
-               targetVertices[j]=CORBA::string_dup(preCadPeriodicityVector_i.theTargetVerticesEntries[j].c_str());
-           }
+    BLSURFPlugin::TEntryList_var targetVertices = new BLSURFPlugin::TEntryList();
+    if (! preCadPeriodicityVector_i.theTargetVerticesEntries.empty())
+    {
+      targetVertices->length(preCadPeriodicityVector_i.theTargetVerticesEntries.size());
+      for (size_t j=0; j<preCadPeriodicityVector_i.theTargetVerticesEntries.size(); j++)
+        targetVertices[j]=CORBA::string_dup(preCadPeriodicityVector_i.theTargetVerticesEntries[j].c_str());
+    }
 
-        myPreCadPeriodicity->theTargetVerticesEntries = targetVertices;
+    myPreCadPeriodicity->theTargetVerticesEntries = targetVertices;
 
-        periodicityList[i] = myPreCadPeriodicity;
-      }
+    periodicityList[i] = myPreCadPeriodicity;
+  }
 
 
   return periodicityList._retn();
@@ -3550,7 +3580,7 @@ BLSURFPlugin::TPeriodicityList* BLSURFPlugin_Hypothesis_i::PreCadVectorToSequenc
 
 
 void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicity(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2)
-throw (SALOME::SALOME_Exception)
+  throw (SALOME::SALOME_Exception)
 {
   ASSERT(myBaseImpl);
   const GEOM::ListOfGO theSourceVertices;
@@ -3560,11 +3590,10 @@ throw (SALOME::SALOME_Exception)
 
 
 void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2,
-    const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
-throw (SALOME::SALOME_Exception)
+                                                                      const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
+  throw (SALOME::SALOME_Exception)
 {
   ASSERT(myBaseImpl);
-  MESSAGE("BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicityWithVertices");
 
   size_t theLength = theSourceVertices.length();
   if (theLength != theTargetVertices.length())
@@ -3588,27 +3617,24 @@ throw (SALOME::SALOME_Exception)
   GEOM::GEOM_Object_ptr theVtx_i;
   string theEntry_i;
   for (size_t ind = 0; ind < theLength; ind++) {
-      theVtx_i = theSourceVertices[ind];
-      theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix3);
-      theSourceVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
+    theVtx_i = theSourceVertices[ind];
+    theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix3);
+    theSourceVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
   }
 
   string prefix4 = "Target_vertex_";
   BLSURFPlugin::TEntryList_var theTargetVerticesEntries = new BLSURFPlugin::TEntryList();
   theTargetVerticesEntries->length(theLength);
   for (size_t ind = 0; ind < theLength; ind++) {
-      theVtx_i = theTargetVertices[ind];
-      theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix4);
-      theTargetVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
+    theVtx_i = theTargetVertices[ind];
+    theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix4);
+    theTargetVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
   }
 
   string theFace2Name = theFace2->GetName();
-  MESSAGE("IDL : theFace1->GetName : " << theFace1->GetName());
-  MESSAGE("IDL : theFace2->GetName : " << theFace2->GetName());
-  MESSAGE("IDL : AddPreCadFacesPeriodicity( "<< theFace1Entry << ", " << theFace2Entry <<  ")");
   try {
-      AddPreCadFacesPeriodicityEntry(theFace1Entry.c_str(), theFace2Entry.c_str(),
-          theSourceVerticesEntries, theTargetVerticesEntries);
+    AddPreCadFacesPeriodicityEntry(theFace1Entry.c_str(), theFace2Entry.c_str(),
+                                   theSourceVerticesEntries, theTargetVerticesEntries);
   } catch (SALOME_Exception& ex) {
     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
@@ -3616,8 +3642,8 @@ throw (SALOME::SALOME_Exception)
 
 
 void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicityEntry(const char* theFace1Entry, const char* theFace2Entry,
-    const BLSURFPlugin::TEntryList& theSourceVerticesEntriesCorba, const BLSURFPlugin::TEntryList& theTargetVerticesEntriesCorba)
-    throw (SALOME::SALOME_Exception)
+                                                               const BLSURFPlugin::TEntryList& theSourceVerticesEntriesCorba, const BLSURFPlugin::TEntryList& theTargetVerticesEntriesCorba)
+  throw (SALOME::SALOME_Exception)
 {
 
   ASSERT(myBaseImpl);
@@ -3625,31 +3651,29 @@ void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicityEntry(const char* theFa
   // Convert BLSURFPlugin::TEntryList to vector<string>
   vector<string> theSourceVerticesEntries, theTargetVerticesEntries;
   for (size_t ind = 0; ind < theSourceVerticesEntriesCorba.length(); ind++) {
-      theSourceVerticesEntries.push_back(theSourceVerticesEntriesCorba[ind].in());
-      theTargetVerticesEntries.push_back(theTargetVerticesEntriesCorba[ind].in());
+    theSourceVerticesEntries.push_back(theSourceVerticesEntriesCorba[ind].in());
+    theTargetVerticesEntries.push_back(theTargetVerticesEntriesCorba[ind].in());
   }
 
   string listEntriesTxt = FormatVerticesEntries(theSourceVerticesEntries, theTargetVerticesEntries);
 
-  MESSAGE("IDL : AddPreCadFacesPeriodicityEntry(" << theFace1Entry << ", " << theFace2Entry << listEntriesTxt.c_str() << ")");
 
   this->GetImpl()->AddPreCadFacesPeriodicity(theFace1Entry, theFace2Entry,
-      theSourceVerticesEntries, theTargetVerticesEntries);
+                                             theSourceVerticesEntries, theTargetVerticesEntries);
 
   SMESH::TPythonDump pd;
   if (!theSourceVerticesEntries.empty())
-    {
-      pd << _this() << ".AddPreCadFacesPeriodicityWithVertices(" << theFace1Entry << ", " << theFace2Entry;
-      pd << listEntriesTxt.c_str();
-      pd << ")";
-    }
+  {
+    pd << _this() << ".AddPreCadFacesPeriodicityWithVertices(" << theFace1Entry << ", " << theFace2Entry;
+    pd << listEntriesTxt.c_str();
+    pd << ")";
+  }
   else
     pd << _this() << ".AddPreCadFacesPeriodicity(" << theFace1Entry << ", " << theFace2Entry << ")";
-  MESSAGE("IDL : AddPreCadFacesPeriodicityEntry END");
 }
 
 void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicity(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2)
-      throw (SALOME::SALOME_Exception)
+  throw (SALOME::SALOME_Exception)
 {
   ASSERT(myBaseImpl);
   const GEOM::ListOfGO theSourceVertices;
@@ -3658,10 +3682,9 @@ void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicity(GEOM::GEOM_Object_ptr
 }
 
 void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2,
-    const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
-      throw (SALOME::SALOME_Exception)
+                                                                      const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
+  throw (SALOME::SALOME_Exception)
 {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityWithVertices");
   ASSERT(myBaseImpl);
 
   size_t theLength = theSourceVertices.length();
@@ -3686,27 +3709,24 @@ void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityWithVertices(GEOM::GEOM
   GEOM::GEOM_Object_ptr theVtx_i;
   string theEntry_i;
   for (size_t ind = 0; ind < theLength; ind++) {
-      theVtx_i = theSourceVertices[ind];
-      theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix3);
-      theSourceVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
+    theVtx_i = theSourceVertices[ind];
+    theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix3);
+    theSourceVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
   }
 
   string prefix4 = "Target_vertex_";
   BLSURFPlugin::TEntryList_var theTargetVerticesEntries = new BLSURFPlugin::TEntryList();
   theTargetVerticesEntries->length(theLength);
   for (size_t ind = 0; ind < theLength; ind++) {
-      theVtx_i = theTargetVertices[ind];
-      theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix4);
-      theTargetVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
+    theVtx_i = theTargetVertices[ind];
+    theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix4);
+    theTargetVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
   }
 
   string theEdge2Name = theEdge2->GetName();
-  MESSAGE("IDL : theEdge1->GetName : " << theEdge1->GetName());
-  MESSAGE("IDL : theEdge2->GetName : " << theEdge2->GetName());
-  MESSAGE("IDL : AddPreCadEdgesPeriodicity( "<< theEdge1Entry << ", " << theEdge2Entry << ")");
   try {
-      AddPreCadEdgesPeriodicityEntry(theEdge1Entry.c_str(), theEdge2Entry.c_str(),
-          theSourceVerticesEntries, theTargetVerticesEntries);
+    AddPreCadEdgesPeriodicityEntry(theEdge1Entry.c_str(), theEdge2Entry.c_str(),
+                                   theSourceVerticesEntries, theTargetVerticesEntries);
   } catch (SALOME_Exception& ex) {
     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
@@ -3714,8 +3734,8 @@ void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityWithVertices(GEOM::GEOM
 
 
 void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityEntry(const char* theEdge1Entry, const char* theEdge2Entry,
-    const BLSURFPlugin::TEntryList& theSourceVerticesEntriesCorba, const BLSURFPlugin::TEntryList& theTargetVerticesEntriesCorba)
-    throw (SALOME::SALOME_Exception)
+                                                               const BLSURFPlugin::TEntryList& theSourceVerticesEntriesCorba, const BLSURFPlugin::TEntryList& theTargetVerticesEntriesCorba)
+  throw (SALOME::SALOME_Exception)
 {
 
   ASSERT(myBaseImpl);
@@ -3723,27 +3743,25 @@ void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityEntry(const char* theEd
   // Convert BLSURFPlugin::TEntryList to vector<string>
   vector<string> theSourceVerticesEntries, theTargetVerticesEntries;
   for (size_t ind = 0; ind < theSourceVerticesEntriesCorba.length(); ind++) {
-      theSourceVerticesEntries.push_back(theSourceVerticesEntriesCorba[ind].in());
-      theTargetVerticesEntries.push_back(theTargetVerticesEntriesCorba[ind].in());
+    theSourceVerticesEntries.push_back(theSourceVerticesEntriesCorba[ind].in());
+    theTargetVerticesEntries.push_back(theTargetVerticesEntriesCorba[ind].in());
   }
 
   string listEntriesTxt = FormatVerticesEntries(theSourceVerticesEntries, theTargetVerticesEntries);
 
-  MESSAGE("IDL : AddPreCadEdgesPeriodicityEntry(" << theEdge1Entry << ", " << theEdge2Entry << listEntriesTxt.c_str() << ")");
   this->GetImpl()->AddPreCadEdgesPeriodicity(theEdge1Entry, theEdge2Entry,
-      theSourceVerticesEntries, theTargetVerticesEntries);
+                                             theSourceVerticesEntries, theTargetVerticesEntries);
 
   SMESH::TPythonDump pd;
   if (!theSourceVerticesEntries.empty())
-    {
-      pd << _this() << ".AddPreCadEdgesPeriodicityWithVertices(" << theEdge1Entry << ", " << theEdge2Entry;
-      pd << listEntriesTxt.c_str();
-      pd << ")";
-    }
+  {
+    pd << _this() << ".AddPreCadEdgesPeriodicityWithVertices(" << theEdge1Entry << ", " << theEdge2Entry;
+    pd << listEntriesTxt.c_str();
+    pd << ")";
+  }
   else
     pd << _this() << ".AddPreCadEdgesPeriodicity(" << theEdge1Entry << ", " << theEdge2Entry << ")";
 
-  MESSAGE("IDL : AddPreCadEdgesPeriodicityEntry END");
 }
 
 
@@ -3758,11 +3776,10 @@ void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityEntry(const char* theEd
 // void BLSURFPlugin_Hypothesis_i::SetGMFFile(const char* theFileName, CORBA::Boolean isBinary) {
 void BLSURFPlugin_Hypothesis_i::SetGMFFile(const char* theFileName) {
   ASSERT(myBaseImpl);
-  MESSAGE("IDL : SetGMFFile(" << theFileName << ")");
   bool valueChanged/*, modeChanged*/ = false;
   try {
     valueChanged = (this->GetImpl()->GetGMFFile() != theFileName);
-//     modeChanged = (this->GetImpl()->GetGMFFileMode() != isBinary);
+    //     modeChanged = (this->GetImpl()->GetGMFFileMode() != isBinary);
     if (valueChanged)// or (!valueChanged && modeChanged))
       this->GetImpl()->SetGMFFile(theFileName);// ,isBinary);
   } catch (const std::exception& ex) {
@@ -3770,7 +3787,6 @@ void BLSURFPlugin_Hypothesis_i::SetGMFFile(const char* theFileName) {
   }
   if (valueChanged)// or (!valueChanged && modeChanged))
     SMESH::TPythonDump() << _this() << ".SetGMFFile(\"" << theFileName << "\")"; //", " << isBinary << ")";
-  MESSAGE("IDL : SetGMFFile END ");
 }
 
 //================================================================================
@@ -3783,7 +3799,6 @@ void BLSURFPlugin_Hypothesis_i::SetGMFFile(const char* theFileName) {
 //================================================================================  
 char* BLSURFPlugin_Hypothesis_i::GetGMFFile() {
   ASSERT(myBaseImpl);
-//   MESSAGE("IDL : GetGMFFile()");
   return CORBA::string_dup(this->GetImpl()->GetGMFFile().c_str());
 }
 
@@ -3797,7 +3812,6 @@ char* BLSURFPlugin_Hypothesis_i::GetGMFFile() {
 // //================================================================================  
 // CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetGMFFileMode() {
 //   ASSERT(myBaseImpl);
-//   MESSAGE("IDL : GetGMFFileMode()");
 //   return this->GetImpl()->GetGMFFileMode();
 // }
 
@@ -3809,7 +3823,6 @@ char* BLSURFPlugin_Hypothesis_i::GetGMFFile() {
  */
 //=============================================================================
 ::BLSURFPlugin_Hypothesis* BLSURFPlugin_Hypothesis_i::GetImpl() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetImpl");
   return (::BLSURFPlugin_Hypothesis*) myBaseImpl;
 }
 
@@ -3873,7 +3886,7 @@ void BLSURFPlugin_Hypothesis_i::SetDecimesh(CORBA::Boolean theValue) {
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetDecimesh() {
   std::string theValueStr = this->GetOptionValue("respect_geometry");
   if (theValueStr.empty() || theValueStr == "respect")
-      return true;
+    return true;
   return false;
 }
 void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveNanoEdges(CORBA::Boolean theValue) {
@@ -3883,7 +3896,7 @@ void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveNanoEdges(CORBA::Boolean theValue
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveNanoEdges() {
   std::string theValueStr = this->GetPreCADOption("remove_tiny_edges");
   if (theValueStr == "1")
-      return true;
+    return true;
   return false;
 }
 void BLSURFPlugin_Hypothesis_i::SetPreCADEpsNano(CORBA::Double theValue) {
index 3e19cd4273d6e17c9e67a3fb2013dc536572d33f..020299e3531a8491cf1af1cab4b11ff55f7b8c21 100644 (file)
@@ -37,11 +37,15 @@ class GEOM_Object;
 
 // BLSURFPlugin parameters hypothesis
 
-class BLSURFPlugin_Hypothesis_i: public virtual POA_BLSURFPlugin::BLSURFPlugin_Hypothesis,
-    public virtual SMESH_Hypothesis_i {
+class BLSURFPlugin_Hypothesis_i:
+  public virtual POA_BLSURFPlugin::BLSURFPlugin_Hypothesis,
+  public virtual SMESH_Hypothesis_i
+{
 public:
   // Constructor
-  BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA, ::SMESH_Gen* theGenImpl);
+  BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA,
+                            ::SMESH_Gen*            theGenImpl,
+                            bool                    theHasGEOM);
   // Destructor
   virtual ~BLSURFPlugin_Hypothesis_i();
 
@@ -133,12 +137,18 @@ public:
   void SetJacobianRectificationRespectGeometry( CORBA::Boolean allowRectification );
   CORBA::Boolean GetJacobianRectificationRespectGeometry();
 
+  void SetUseDeprecatedPatchMesher( CORBA::Boolean useDeprecatedPatchMesher );
+  CORBA::Boolean GetUseDeprecatedPatchMesher();
+
   void SetJacobianRectification( CORBA::Boolean allowRectification );
   CORBA::Boolean GetJacobianRectification();
 
   void SetMaxNumberOfPointsPerPatch( CORBA::Long nb ) throw (SALOME::SALOME_Exception);
   CORBA::Long GetMaxNumberOfPointsPerPatch();
 
+  void SetMaxNumberOfThreads( CORBA::Long nb ) throw (SALOME::SALOME_Exception);
+  CORBA::Long GetMaxNumberOfThreads();
+
   void SetRespectGeometry( CORBA::Boolean toRespect );
   CORBA::Boolean GetRespectGeometry();
 
@@ -163,12 +173,12 @@ public:
   void SetTags( const char* howToTreat ) throw (SALOME::SALOME_Exception);
   char* GetTags();
 
+  void SetHyperPatches(const BLSURFPlugin::THyperPatchList& hpl);
+  BLSURFPlugin::THyperPatchList* GetHyperPatches();
+
   void SetPreCADMergeEdges(CORBA::Boolean theValue);
   CORBA::Boolean GetPreCADMergeEdges();
 
-  void SetPreCADRemoveTinyUVEdges(CORBA::Boolean theValue);
-  CORBA::Boolean GetPreCADRemoveTinyUVEdges();
-
   void SetPreCADRemoveDuplicateCADFaces(CORBA::Boolean theValue);
   CORBA::Boolean GetPreCADRemoveDuplicateCADFaces();
 
@@ -276,6 +286,7 @@ public:
   /*!
    * Set/get/unset an enforced vertex on geom object
    */
+  // OBSOLETE
   bool SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z)
       throw (SALOME::SALOME_Exception);
   bool SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName)
@@ -297,6 +308,26 @@ public:
       throw (SALOME::SALOME_Exception);
   bool UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
 
+  // NEW - no face
+  bool AddEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z)
+      throw (SALOME::SALOME_Exception);
+  bool AddEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName)
+      throw (SALOME::SALOME_Exception);
+  bool AddEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex)
+      throw (SALOME::SALOME_Exception);
+  bool AddEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
+      throw (SALOME::SALOME_Exception);
+  bool AddEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName, const char* theGroupName)
+      throw (SALOME::SALOME_Exception);
+  bool AddEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
+      throw (SALOME::SALOME_Exception);
+
+  bool RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z)
+      throw (SALOME::SALOME_Exception);
+  bool RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex)
+      throw (SALOME::SALOME_Exception);
+  bool RemoveEnforcedVertices() throw (SALOME::SALOME_Exception);
+
   /*!
    * Set/get/unset an enforced vertex on geom object given by entry
    */
index f357ebdc421e5ee3d1a1ba1feddc06cc37ce8dca..9d0296c996a1033271546fc8e03f2f846f325a82 100644 (file)
 #include "BLSURFPlugin_BLSURF_i.hxx"
 #include "BLSURFPlugin_Hypothesis_i.hxx"
 
-template <class T> class BLSURFPlugin_Creator_i:public HypothesisCreator_i<T>
+template <class T, bool NOGEOM>
+class BLSURFPlugin_Creator_i : public GenericHypothesisCreator_i
 {
+  // Create a hypothesis
+  virtual SMESH_Hypothesis_i* Create(PortableServer::POA_ptr thePOA,
+                                     ::SMESH_Gen*            theGenImpl)
+  {
+    return new T (thePOA, theGenImpl, !NOGEOM);
+  }
+
   // as we have 'module BLSURFPlugin' in BLSURFPlugin_Algorithm.idl
   virtual std::string GetModuleName() { return "BLSURFPlugin"; }
 };
@@ -54,19 +62,20 @@ extern "C"
   BLSURFPLUGIN_EXPORT
   GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName)
   {
-    MESSAGE("GetHypothesisCreator " << aHypName);
-
     GenericHypothesisCreator_i* aCreator = 0;
 
     // Algorithms
     if (strcmp(aHypName, "BLSURF") == 0 ||
         strcmp(aHypName, "MG-CADSurf") == 0 )
-      aCreator = new BLSURFPlugin_Creator_i<BLSURFPlugin_BLSURF_i>;
+      aCreator = new BLSURFPlugin_Creator_i<BLSURFPlugin_BLSURF_i,false>;
+    else if (strcmp(aHypName, "MG-CADSurf_NOGEOM") == 0 )
+      aCreator = new BLSURFPlugin_Creator_i<BLSURFPlugin_BLSURF_i,true>;
     // Hypotheses
     else if (strcmp(aHypName, "BLSURF_Parameters") == 0 ||
              strcmp(aHypName, "MG-CADSurf Parameters") == 0 )
-      aCreator = new BLSURFPlugin_Creator_i<BLSURFPlugin_Hypothesis_i>;
-    else ;
+      aCreator = new BLSURFPlugin_Creator_i<BLSURFPlugin_Hypothesis_i,false>;
+    else if (strcmp(aHypName, "MG-CADSurf Parameters_NOGEOM") == 0 )
+      aCreator = new BLSURFPlugin_Creator_i<BLSURFPlugin_Hypothesis_i,true>;
 
     return aCreator;
   }
index d2152d5eb05d6dc6f5dae71defd911452196735a..67a6bd832804d5e559e46a515dd024b88120680a 100755 (executable)
@@ -43,8 +43,9 @@ extern "C"
   SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& aHypType )
   {
     SMESHGUI_GenericHypothesisCreator* aCreator = NULL;
-    if( aHypType=="BLSURF_Parameters" ||
-        aHypType=="MG-CADSurf Parameters")
+    if ( aHypType == "BLSURF_Parameters" ||
+         aHypType == "MG-CADSurf Parameters" ||
+         aHypType == "MG-CADSurf Parameters_NOGEOM")
       aCreator =  new BLSURFPluginGUI_HypothesisCreator( aHypType );
     return aCreator;
   }
index 8bd1296b22004d62d9bea7758fb9e918f7294fe4..7816edaee8afa70c51a7b28a35c5db4fe30cbed8 100644 (file)
@@ -67,10 +67,11 @@ BLSURFPluginGUI_AdvWidget::~BLSURFPluginGUI_AdvWidget()
 void BLSURFPluginGUI_AdvWidget::onChooseGMFFile()
 {
   QString fileName = QFileDialog::getSaveFileName(0, tr("BLSURF_GMF_FILE_DIALOG"), myGMFFileName->text(), tr("BLSURF_GMF_FILE_FORMAT"));
-  std::cout << "fileName: " << fileName.toStdString() << std::endl;
-  if (!fileName.endsWith(".mesh") && !fileName.endsWith(".meshb"))
-    fileName.append(".mesh");
-  myGMFFileName->setText(fileName);
+  if ( !fileName.isEmpty() ) {
+    if (!fileName.endsWith(".mesh") && !fileName.endsWith(".meshb"))
+      fileName.append(".mesh");
+    myGMFFileName->setText(fileName);
+  }
 }
 
 void BLSURFPluginGUI_AdvWidget::AddOption( int iTable, const char* option )
@@ -107,6 +108,7 @@ void BLSURFPluginGUI_AdvWidget::AddOption( int iTable, const char* option )
     if ( !option )
     {
       myOptionTable->scrollToItem( row );
+      myOptionTable->setCurrentItem( row );
       myOptionTable->editItem( row, NAME_COL );
     }
   }
index c2f05dfc7a3c2c254b63de496563d92223ee89fd..43f0876d49dd56f4bdd36d8edeba245d21bea33c 100644 (file)
   </property>
   <layout class="QGridLayout" name="gridLayout">
    <item row="0" column="0" colspan="3">
-    <widget class="QTreeWidget" name="myOptionTable">
+    <widget class="BLSURFPluginGUI_TreeWidget" name="myOptionTable">
      <property name="editTriggers">
-      <set>QAbstractItemView::DoubleClicked</set>
+      <set>QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed</set>
+     </property>
+     <property name="tabKeyNavigation">
+      <bool>true</bool>
      </property>
      <column>
       <property name="text">
    </item>
   </layout>
  </widget>
+ <customwidgets>
+  <customwidget>
+   <class>BLSURFPluginGUI_TreeWidget</class>
+   <extends>QTreeWidget</extends>
+   <header location="global">BLSURFPluginGUI_TreeWidget.h</header>
+  </customwidget>
+ </customwidgets>
  <tabstops>
   <tabstop>addBtn</tabstop>
   <tabstop>myVerbosity</tabstop>
index d28d03610a91dec34ba3698a8c71777a45498eab..a4d182e1492bd6c185224d7e04ac42bc5991b1b0 100644 (file)
 //
 #include "BLSURFPluginGUI_HypothesisCreator.h"
 #include "BLSURFPluginGUI_Dlg.h"
+#include "BLSURFPlugin_Hypothesis.hxx"
 
-#include "GeometryGUI.h"
+#include <GeometryGUI.h>
 
-#include <SMESHGUI_Utils.h>
-#include <SMESHGUI_HypothesesUtils.h>
 #include <SMESHGUI_Dialog.h>
-#include "SMESHGUI_SpinBox.h"
-#include "SMESH_NumberFilter.hxx"
+#include <SMESHGUI_HypothesesUtils.h>
+#include <SMESHGUI_IdValidator.h>
+#include <SMESHGUI_SpinBox.h>
+#include <SMESHGUI_Utils.h>
+#include <SMESH_Gen_i.hxx>
+#include <SMESH_NumberFilter.hxx>
+#include <StdMeshersGUI_SubShapeSelectorWdg.h>
 
-#include <SUIT_Session.h>
+#include <LightApp_SelectionMgr.h>
+#include <SALOME_ListIO.hxx>
 #include <SUIT_MessageBox.h>
 #include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SalomeApp_Application.h>
 #include <SalomeApp_Tools.h>
 
 #include <QApplication>
 #include <QCheckBox>
 #include <QComboBox>
 #include <QFrame>
-#include <QHBoxLayout>
-#include <QHeaderView>
 #include <QGridLayout>
 #include <QGroupBox>
+#include <QHBoxLayout>
+#include <QHeaderView>
 #include <QLabel>
 #include <QLineEdit>
 #include <QMenu>
+#include <QModelIndexList>
 #include <QObject>
 #include <QPushButton>
 #include <QRadioButton>
 #include <QSpinBox>
-#include <QTableWidget>
-#include <QTabWidget>
-#include <QVBoxLayout>
 #include <QSplitter>
-
-#include <QStandardItemModel>
 #include <QStandardItem>
+#include <QStandardItemModel>
+#include <QTabWidget>
+#include <QTableWidget>
 #include <QTreeWidget>
 #include <QTreeWidgetItem>
-#include <QModelIndexList>
-
-#include <LightApp_SelectionMgr.h>
-#include <SalomeApp_Application.h>
-#include <SALOME_ListIO.hxx>
-#include "SALOME_LifeCycleCORBA.hxx"
+#include <QVBoxLayout>
 
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Iterator.hxx>
-#include <SMESH_Gen_i.hxx>
-#include <boost/shared_ptr.hpp>
-#include <boost/algorithm/string.hpp>
-#include <structmember.h>
-#include <stdexcept>
-#include <algorithm>
+
+#include <structmember.h> // Python
 
 using namespace std;
 
@@ -88,6 +85,7 @@ enum {
   SMP_TAB,
   ENF_TAB,
   PERIODICITY_TAB,
+  HYPERPATCH_TAB,
   SMP_NAME_COLUMN =0,
   SMP_SIZEMAP_COLUMN,
   SMP_ENTRY_COLUMN,
@@ -163,7 +161,7 @@ enum {
 // Enforced vertices inputs
 enum {
   ENF_VER_FACE = 0,
-  ENF_VER_VERTEX,
+  ENF_VER_VERTEX = 0,
   ENF_VER_X_COORD,
   ENF_VER_Y_COORD,
   ENF_VER_Z_COORD,
@@ -443,7 +441,6 @@ bool EnforcedTreeWidgetDelegate::vertexExists(QAbstractItemModel *model,
 BLSURFPluginGUI_HypothesisCreator::BLSURFPluginGUI_HypothesisCreator( const QString& theHypType )
   : SMESHGUI_GenericHypothesisCreator( theHypType )
 {
-  MESSAGE("BLSURFPluginGUI_HypothesisCreator::BLSURFPluginGUI_HypothesisCreator");
   this->mySMPMap.clear();
 
   GeomToolSelected = NULL;
@@ -517,7 +514,6 @@ void BLSURFPluginGUI_HypothesisCreator::avoidSimultaneousSelection(ListOfWidgets
 
 bool BLSURFPluginGUI_HypothesisCreator::checkParams(QString& msg) const
 {
-  MESSAGE("BLSURFPluginGUI_HypothesisCreator::checkParams");
   bool ok = true;
 
   BLSURFPlugin::BLSURFPlugin_Hypothesis_var h =
@@ -589,19 +585,12 @@ bool BLSURFPluginGUI_HypothesisCreator::checkParams(QString& msg) const
     {
       QString entry   = mySizeMapTable->topLevelItem( row )->data(SMP_ENTRY_COLUMN, Qt::EditRole).toString();
       QString sizeMap = mySizeMapTable->topLevelItem( row )->data(SMP_SIZEMAP_COLUMN, Qt::EditRole).toString();
-      MESSAGE("entry ="<<entry.toStdString())
       if ( !sizeMap.isEmpty() ) {
         if (that->sizeMapValidationFromRow(row))
         {
           try {
-            MESSAGE("entry ="<<entry.toStdString())
-            MESSAGE("sizeMap ="<<sizeMap.toStdString())
-            
             e = entry.toStdString();
             s = that->mySMPMap[entry].toStdString();
-            MESSAGE("row = "<<row)
-            MESSAGE("e = "<<e)
-            MESSAGE("s = "<<s)
             h->SetSizeMapEntry( e.c_str(), s.c_str() );
           }
           catch ( const SALOME::SALOME_Exception& ex )
@@ -657,12 +646,8 @@ bool BLSURFPluginGUI_HypothesisCreator::checkParams(QString& msg) const
 
 QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
 {
-  MESSAGE("BLSURFPluginGUI_HypothesisCreator::buildFrame");
-
   QFrame* fr = new QFrame( 0 );
- // fr-> setMinimumSize(600,400);
   QVBoxLayout* lay = new QVBoxLayout( fr );
- // lay->setSizeConstraint(QLayout::SetDefaultConstraint);
   lay->setMargin( 5 );
   lay->setSpacing( 0 );
 
@@ -683,6 +668,9 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   if( isCreation() )
     myName = new QLineEdit( myStdGroup );
   myStdWidget = new BLSURFPluginGUI_StdWidget(myStdGroup);
+  if ( !hasGeom() ) {
+    myStdWidget->myPhysicalMesh->removeItem( PhysicalLocalSize );
+  }
   
   int row = 0;
   if( isCreation() ) {
@@ -691,14 +679,11 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   }
   aStdLayout->addWidget( myStdWidget,                                   row++, 0, 1, 4 );
   
-  //int maxrow = row;
   row = 0;
   if( isCreation() )
     row = 1;
-//   row = max(row,maxrow)+1;
   aStdLayout->setRowStretch(row,1);
   aStdLayout->setColumnStretch(1,1);
-  //maxrow = row;
 
   
   // advanced parameters
@@ -707,14 +692,12 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   anAdvLayout->setSpacing( 6 );
   anAdvLayout->setMargin( 11 );  
   myAdvWidget = new BLSURFPluginGUI_AdvWidget(myAdvGroup);
-  //myAdvWidget->addBtn->setMenu( new QMenu() );
   anAdvLayout->addWidget( myAdvWidget );
 
 
   // Size Maps parameters
 
-  mySmpGroup = new QWidget();
-//   mySmpGroup->setMinimumWidth(500);
+  mySmpGroup = new QWidget( dlg() );
 
   //Layout
   QGridLayout* anSmpLayout = new QGridLayout(mySmpGroup);
@@ -845,13 +828,8 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   smpTab->setCurrentIndex( SMP_STD_TAB ); 
 
   // Enforced vertices parameters
-  myEnfGroup = new QWidget();
+  myEnfGroup = new QWidget( dlg() );
   QGridLayout* anEnfLayout = new QGridLayout(myEnfGroup);
-//
-//   myEnforcedVertexWidget = new DlgBlSurfHyp_Enforced(myEnfGroup);
-//   anEnfLayout->addWidget(myEnforcedVertexWidget);
-//   MESSAGE("Creating DlgBlSurfHyp_Enforced widget instance");
-//   myEnforcedVertexWidget = new DlgBlSurfHyp_Enforced();
 
   myEnforcedTreeWidget = new QTreeWidget(myEnfGroup);
   myEnforcedTreeWidget->setColumnCount( ENF_VER_NB_COLUMNS );
@@ -880,22 +858,22 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   myEnforcedTreeWidget->hideColumn(ENF_VER_ENTRY_COLUMN);
   myEnforcedTreeWidget->setItemDelegate(new EnforcedTreeWidgetDelegate());
   
-// FACE AND VERTEX SELECTION
+  // FACE AND VERTEX SELECTION
   TColStd_MapOfInteger shapeTypes1, shapeTypes2;
   shapeTypes1.Add( TopAbs_FACE );
   shapeTypes1.Add( TopAbs_COMPOUND );
   shapeTypes2.Add( TopAbs_VERTEX );
   shapeTypes2.Add( TopAbs_COMPOUND );
 
-  SMESH_NumberFilter* faceFilter = new SMESH_NumberFilter("GEOM", TopAbs_FACE, 0, shapeTypes1);
-  myEnfFaceWdg = new StdMeshersGUI_ObjectReferenceParamWdg( faceFilter, 0, /*multiSel=*/true);
-  myEnfFaceWdg->SetDefaultText(tr("BLS_SEL_FACES"), "QLineEdit { color: grey }");
+  // SMESH_NumberFilter* faceFilter = new SMESH_NumberFilter("GEOM", TopAbs_FACE, 0, shapeTypes1);
+  // myEnfFaceWdg = new StdMeshersGUI_ObjectReferenceParamWdg( faceFilter, 0, /*multiSel=*/true);
+  // myEnfFaceWdg->SetDefaultText(tr("BLS_SEL_FACES"), "QLineEdit { color: grey }");
 
   SMESH_NumberFilter* vertexFilter = new SMESH_NumberFilter("GEOM", TopAbs_SHAPE, 1, shapeTypes2);
   myEnfVertexWdg = new StdMeshersGUI_ObjectReferenceParamWdg( vertexFilter, 0, /*multiSel=*/true);
   myEnfVertexWdg->SetDefaultText(tr("BLS_SEL_VERTICES"), "QLineEdit { color: grey }");
 
-  myEnfVertexWdg->AvoidSimultaneousSelection(myEnfFaceWdg);
+  //myEnfVertexWdg->AvoidSimultaneousSelection(myEnfFaceWdg);
 
   QLabel* myXCoordLabel = new QLabel( tr( "BLSURF_ENF_VER_X_LABEL" ), myEnfGroup );
   myXCoord = new SMESHGUI_SpinBox(myEnfGroup);
@@ -920,13 +898,10 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   QLabel* myInternalEnforcedVerticesAllFacesGroupLabel = new QLabel( tr( "BLSURF_ENF_VER_GROUP_LABEL" ), myEnfGroup );
   myInternalEnforcedVerticesAllFacesGroup = new QLineEdit(myEnfGroup);
 
-//   myGlobalGroupName = new QCheckBox(tr("BLSURF_ENF_VER_GROUPS"), myEnfGroup);
-//   myGlobalGroupName->setChecked(false);
-
   anEnfLayout->addWidget(myEnforcedTreeWidget,     0, 0, ENF_VER_NB_LINES, 1);
   QGridLayout* anEnfLayout2 = new QGridLayout(myEnfGroup);
 //  FACE AND VERTEX SELECTION
-  anEnfLayout2->addWidget(myEnfFaceWdg,             ENF_VER_FACE, 0, 1, 2);
+  //anEnfLayout2->addWidget(myEnfFaceWdg,             ENF_VER_FACE, 0, 1, 2);
   anEnfLayout2->addWidget(myEnfVertexWdg,           ENF_VER_VERTEX, 0, 1, 2);
   anEnfLayout2->addWidget(myXCoordLabel,            ENF_VER_X_COORD, 0, 1, 1);
   anEnfLayout2->addWidget(myXCoord,                 ENF_VER_X_COORD, 1, 1, 1);
@@ -936,21 +911,17 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   anEnfLayout2->addWidget(myZCoord,                 ENF_VER_Z_COORD, 1, 1, 1);
   anEnfLayout2->addWidget(myGroupNameLabel,         ENF_VER_GROUP, 0, 1, 1);
   anEnfLayout2->addWidget(myGroupName,              ENF_VER_GROUP, 1, 1, 1);
-//   anEnfLayout2->addWidget(myGlobalGroupName,        ENF_VER_GROUP_CHECK, 0, 1, 2);
-//   anEnfLayout2->setRowStretch(                      ENF_VER_SPACE, 1);
   anEnfLayout2->addWidget(addVertexButton,          ENF_VER_BTN, 0, 1, 1);
   anEnfLayout2->addWidget(removeVertexButton,       ENF_VER_BTN, 1, 1, 1);
   anEnfLayout2->addWidget(myInternalEnforcedVerticesAllFaces, ENF_VER_INTERNAL_ALL_FACES, 0, 1, 2);
   anEnfLayout2->addWidget(myInternalEnforcedVerticesAllFacesGroupLabel, ENF_VER_INTERNAL_ALL_FACES_GROUP, 0, 1, 1);
   anEnfLayout2->addWidget(myInternalEnforcedVerticesAllFacesGroup, ENF_VER_INTERNAL_ALL_FACES_GROUP, 1, 1, 1);
   anEnfLayout2->setRowStretch(ENF_VER_NB_LINES+1, 1);
-//   anEnfLayout2->addWidget(makeGroupsCheck,          ENF_VER_GROUP_CHECK, 0, 1, 2);
   anEnfLayout->addLayout(anEnfLayout2, 0,1,ENF_VER_NB_LINES+1,2);
-//   anEnfLayout->setRowStretch(1, 1);
 
   // ---
   // Periodicity parameters
-  myPeriodicityGroup = new QWidget();
+  myPeriodicityGroup = new QWidget( dlg() );
   aPeriodicityLayout1 = new QGridLayout(myPeriodicityGroup);
 
   myPeriodicitySplitter = new QSplitter(myPeriodicityGroup);
@@ -1139,13 +1110,60 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   myPeriodicitySelectionWidgets.append(myPeriodicityP3TargetWdg);
   avoidSimultaneousSelection(myPeriodicitySelectionWidgets);
 
+  // HyperPatch parameters
+
+  QWidget*      hpGroup = new QWidget();
+  QGridLayout* hpLayout = new QGridLayout(hpGroup);
+
+  myHyPatchTable = new QTableWidget( hpGroup );
+  myHyPatchTable->setColumnCount(1);
+  myHyPatchTable->setHorizontalHeaderLabels( QStringList() << tr("BLSURF_HYPATCH_TBL_HEADER") );
+  myHyPatchTable->setAlternatingRowColors(true);
+  myHyPatchTable->horizontalHeader()->setSectionResizeMode( 0, QHeaderView::Stretch );
+
+
+  QPixmap iconSelect (SUIT_Session::session()->resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
+  myHyPatchFaceSelBtn  = new QPushButton( iconSelect, tr("BLSURF_HYPATCH_SEL_FACE"), hpGroup );
+  myHyPatchGroupSelBtn = new QPushButton( iconSelect, tr("BLSURF_HYPATCH_SEL_GROUP"), hpGroup );
+  myHyPatchFaceSelBtn->setCheckable( true );
+  myHyPatchGroupSelBtn->setCheckable( true );
+
+  myHyPatchFaceSelector = new StdMeshersGUI_SubShapeSelectorWdg( hpGroup, TopAbs_FACE, /*toShowList=*/false );
+
+  QLabel* hpTagsLbl = new QLabel( tr("BLSURF_TAGS"), hpGroup );
+  myHyPatchTagsLE   = new QLineEdit( hpGroup );
+  myHyPatchTagsLE->setValidator( new SMESHGUI_IdValidator( hpGroup ));
+
+  QPushButton* hpAddBtn = new QPushButton( tr("BLSURF_SM_ADD"), hpGroup );
+  QPushButton* hpRemBtn = new QPushButton( tr("BLSURF_SM_REMOVE"), hpGroup );
+
+  hpLayout->addWidget( myHyPatchTable,        0, 0, 5, 1 );
+  hpLayout->addWidget( myHyPatchFaceSelBtn,   0, 1, 1, 2 );
+  hpLayout->addWidget( myHyPatchGroupSelBtn,  0, 3, 1, 2 );
+  hpLayout->addWidget( hpTagsLbl,             1, 1, 1, 1 );
+  hpLayout->addWidget( myHyPatchTagsLE,       1, 2, 1, 3 );
+  hpLayout->addWidget( hpAddBtn,              2, 1, 1, 2 );
+  hpLayout->addWidget( hpRemBtn,              2, 3, 1, 2 );
+  hpLayout->addWidget( myHyPatchFaceSelector, 3, 1, 1, 4 );
+
+
+
   // ---
   myTabWidget->insertTab( STD_TAB, myStdGroup, tr( "SMESH_ARGUMENTS" ) );
   myTabWidget->insertTab( ADV_TAB, myAdvGroup, tr( "BLSURF_ADV_ARGS" ) );
-  myTabWidget->insertTab( SMP_TAB, mySmpGroup, tr( "LOCAL_SIZE" ) );
-  myTabWidget->insertTab( ENF_TAB, myEnfGroup, tr( "BLSURF_ENF_VER" ) );
-  myTabWidget->insertTab( PERIODICITY_TAB, myPeriodicityGroup, tr( "BLSURF_PERIODICITY" ) );
-
+  if ( hasGeom() ) {
+    myTabWidget->insertTab( SMP_TAB, mySmpGroup, tr( "LOCAL_SIZE" ) );
+    myTabWidget->insertTab( ENF_TAB, myEnfGroup, tr( "BLSURF_ENF_VER" ) );
+    myTabWidget->insertTab( PERIODICITY_TAB, myPeriodicityGroup, tr( "BLSURF_PERIODICITY" ) );
+    myTabWidget->insertTab( HYPERPATCH_TAB, hpGroup, tr( "BLSURF_HYPERPATCH_TAB" ));
+  }
+  else
+  {
+    mySmpGroup->hide();
+    myEnfGroup->hide();
+    myPeriodicityGroup->hide();
+    hpGroup->hide();
+  }
   myTabWidget->setCurrentIndex( STD_TAB );
 
   connect( myAdvWidget->addBtn, SIGNAL( clicked() ),           this, SLOT( onAddOption() ) );
@@ -1155,12 +1173,10 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   connect( addMapButton,        SIGNAL( clicked()),                    this,         SLOT( onAddMap() ) );
   connect( removeMapButton,     SIGNAL( clicked()),                    this,         SLOT( onRemoveMap() ) );
   connect( modifyMapButton,     SIGNAL( clicked()),                    this,         SLOT( onModifyMap() ) );
-//   connect( mySizeMapTable,      SIGNAL( cellChanged ( int, int  )),    this,         SLOT( onSetSizeMap(int,int ) ) );
   connect( mySizeMapTable,      SIGNAL( itemClicked (QTreeWidgetItem *, int)),this,  SLOT( onSmpItemClicked(QTreeWidgetItem *, int) ) );
   connect( myGeomSelWdg2,       SIGNAL( contentModified() ),           this,         SLOT( onMapGeomContentModified() ) );
   connect( myGeomSelWdg1,       SIGNAL( contentModified() ),           this,         SLOT( onMapGeomContentModified() ) );
   connect( myAttSelWdg,         SIGNAL( contentModified() ),           this,         SLOT( onMapGeomContentModified() ) );
-//   connect( myAttractorGroup,    SIGNAL( clicked(bool) ),               this,         SLOT( onAttractorGroupClicked(bool) ) );
   connect( mySizeMapTable,      SIGNAL( itemChanged (QTreeWidgetItem *, int)),this,  SLOT( onSetSizeMap(QTreeWidgetItem *, int) ) );
   connect( myAttractorCheck,    SIGNAL( stateChanged ( int )),         this,         SLOT( onAttractorClicked( int ) ) );
   connect( myConstSizeCheck,    SIGNAL( stateChanged ( int )),         this,         SLOT( onConstSizeClicked( int ) ) );
@@ -1170,14 +1186,11 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   // Enforced vertices
   connect( myEnforcedTreeWidget,SIGNAL( itemClicked(QTreeWidgetItem *, int)), this,  SLOT( synchronizeCoords() ) );
   connect( myEnforcedTreeWidget,SIGNAL( itemChanged(QTreeWidgetItem *, int)), this,  SLOT( updateEnforcedVertexValues(QTreeWidgetItem *, int) ) );
-//   connect( myEnforcedTreeWidget,SIGNAL( itemChanged(QTreeWidgetItem *, int)), this,  SLOT( update(QTreeWidgetItem *, int) ) );
   connect( myEnforcedTreeWidget,SIGNAL( itemSelectionChanged() ),      this,         SLOT( synchronizeCoords() ) );
   connect( addVertexButton,     SIGNAL( clicked()),                    this,         SLOT( onAddEnforcedVertices() ) );
   connect( removeVertexButton,  SIGNAL( clicked()),                    this,         SLOT( onRemoveEnforcedVertex() ) );
   connect( myEnfVertexWdg,      SIGNAL( contentModified()),            this,         SLOT( onSelectEnforcedVertex() ) );
   connect( myInternalEnforcedVerticesAllFaces, SIGNAL( stateChanged ( int )), this,  SLOT( onInternalVerticesClicked( int ) ) );
-//   connect( myEnfVertexWdg,     SIGNAL( selectionActivated()),         this,         SLOT( onVertexSelectionActivated() ) );
-//   connect( myEnfFaceWdg,       SIGNAL( selectionActivated()),         this,         SLOT( onFaceSelectionActivated() ) );
 
   // Periodicity
   connect( myPeriodicityAddButton,     SIGNAL( clicked()),                    this,   SLOT( onAddPeriodicity() ) );
@@ -1187,17 +1200,24 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
 
   ListOfWidgets::const_iterator anIt = myPeriodicitySelectionWidgets.begin();
   for (; anIt != myPeriodicitySelectionWidgets.end(); anIt++)
-    {
-      StdMeshersGUI_ObjectReferenceParamWdg * w1 = ( StdMeshersGUI_ObjectReferenceParamWdg* ) ( *anIt );
-      connect( w1,     SIGNAL(contentModified ()),                 this,   SLOT(onPeriodicityContentModified()));
+  {
+    StdMeshersGUI_ObjectReferenceParamWdg * w1 = ( StdMeshersGUI_ObjectReferenceParamWdg* ) ( *anIt );
+    connect( w1,     SIGNAL(contentModified ()),                 this,   SLOT(onPeriodicityContentModified()));
+
+  }
+
+  // HyperPatch
+  connect( myHyPatchFaceSelBtn,   SIGNAL( toggled(bool) ),   SLOT( onHyPatchFaceSelection(bool) ));
+  connect( myHyPatchGroupSelBtn,  SIGNAL( toggled(bool) ),   SLOT( onHyPatchGroupSelection(bool) ));
+  connect( myHyPatchFaceSelector, SIGNAL( shapeSelected() ), SLOT( onHyPatchSelectionChanged()));
+  connect( hpAddBtn,              SIGNAL( clicked() ),       SLOT( onHyPatchAdd()));
+  connect( hpRemBtn,              SIGNAL( clicked() ),       SLOT( onHyPatchRemove()));
 
-    }
-//  connect( myPeriodicitySourceFaceWdg,     SIGNAL(contentModified()),    this,   SLOT(onPeriodicityContentModified()));
   return fr;
 }
 
 /** BLSURFPluginGUI_HypothesisCreator::deactivateSelection(QWidget*, QWidget*)
-This method stop the selection of the widgets StdMeshersGUI_ObjectReferenceParamWdg
+    This method stop the selection of the widgets StdMeshersGUI_ObjectReferenceParamWdg
 */
 // void BLSURFPluginGUI_HypothesisCreator::deactivateSelection(QWidget* old, QWidget* now)
 // {
@@ -1226,15 +1246,14 @@ void BLSURFPluginGUI_HypothesisCreator::clearEnforcedVertexWidgets()
   myXCoord->setText("");
   myYCoord->setText("");
   myZCoord->setText("");
-//   myGroupName->setText("");
+  //   myGroupName->setText("");
 }
 
 /** BLSURFPluginGUI_HypothesisCreator::updateEnforcedVertexValues(item, column)
-This method updates the tooltip of a modified item. The QLineEdit widgets content
-is synchronized with the coordinates of the enforced vertex clicked in the tree widget.
+    This method updates the tooltip of a modified item. The QLineEdit widgets content
+    is synchronized with the coordinates of the enforced vertex clicked in the tree widget.
 */
 void BLSURFPluginGUI_HypothesisCreator::updateEnforcedVertexValues(QTreeWidgetItem* item, int column) {
-//   MESSAGE("BLSURFPluginGUI_HypothesisCreator::updateEnforcedVertexValues");
   QVariant vertexName = item->data(ENF_VER_NAME_COLUMN, Qt::EditRole);
   QVariant x = item->data(ENF_VER_X_COLUMN, Qt::EditRole);
   QVariant y = item->data(ENF_VER_Y_COLUMN, Qt::EditRole);
@@ -1347,62 +1366,45 @@ QTreeWidgetItem* BLSURFPluginGUI_HypothesisCreator::addEnforcedFace(std::string
 }
 
 /** BLSURFPluginGUI_HypothesisCreator::addEnforcedVertex(entry, shapeName, x, y, z)
-This method adds an enforced vertex (x,y,z) to shapeName in the tree widget.
+    This method adds an enforced vertex (x,y,z) to shapeName in the tree widget.
 */
-void BLSURFPluginGUI_HypothesisCreator::addEnforcedVertex(QTreeWidgetItem* theItem, double x, double y, double z, 
-                                                          std::string vertexName, std::string geomEntry, std::string groupName) {
-
-  std::string theFaceName = theItem->data(ENF_VER_NAME_COLUMN,Qt::EditRole).toString().toStdString();
-//   MESSAGE("theItemName is " << theItem->text(ENF_VER_NAME_COLUMN).toStdString());
+void BLSURFPluginGUI_HypothesisCreator::addEnforcedVertex(double x, double y, double z,
+                                                          std::string vertexName,
+                                                          std::string geomEntry,
+                                                          std::string groupName)
+{
   bool okToCreate = true;
 
-  const int nbVert = theItem->childCount();
-//   MESSAGE("Number of child rows: " << nbVert);
-  if (nbVert >0) {
-    double childValueX,childValueY,childValueZ;
-    QString childEntry, childGroupName;
-    QTreeWidgetItem* child;
-    for (int row = 0;row<nbVert;row++) {
-      child = theItem->child(row);
-      childGroupName = child->data(ENF_VER_GROUP_COLUMN,Qt::EditRole).toString();
-      childEntry = child->data(ENF_VER_ENTRY_COLUMN,Qt::EditRole).toString();
-      childValueX = child->data(ENF_VER_X_COLUMN,Qt::EditRole).toDouble();
-      childValueY = child->data(ENF_VER_Y_COLUMN,Qt::EditRole).toDouble();
-      childValueZ = child->data(ENF_VER_Z_COLUMN,Qt::EditRole).toDouble();
-      if (((childValueX == x) && (childValueY == y) && (childValueZ == z)) || ( (childEntry.toStdString() != "") && (childEntry.toStdString() == geomEntry))) {
-        // update group name
-        if (childGroupName.toStdString() != groupName) {
-          MESSAGE("Group is updated from \"" << childGroupName.toStdString() << "\" to \"" << groupName << "\"");
-          child->setData(ENF_VER_GROUP_COLUMN, Qt::EditRole, QVariant(groupName.c_str()));
-        }
-        okToCreate = false;
-        break;
-      } // if
-    } // for
-  } // if
+  const int nbVert = myEnforcedTreeWidget->topLevelItemCount();
+  for (int row = 0; row < nbVert; row++ )
+  {
+    QTreeWidgetItem* child = myEnforcedTreeWidget->topLevelItem( row );
+    QString childGroupName = child->data(ENF_VER_GROUP_COLUMN,Qt::EditRole).toString();
+    QString childEntry     = child->data(ENF_VER_ENTRY_COLUMN,Qt::EditRole).toString();
+    double childX          = child->data(ENF_VER_X_COLUMN,Qt::EditRole).toDouble();
+    double childY          = child->data(ENF_VER_Y_COLUMN,Qt::EditRole).toDouble();
+    double childZ          = child->data(ENF_VER_Z_COLUMN,Qt::EditRole).toDouble();
+    if (((childEntry.isEmpty()) && (childX == x) && (childY == y) && (childZ == z)) ||
+        ( !childEntry.isEmpty() && childEntry == geomEntry.c_str() ))
+    {
+      // update group name
+      if ( childGroupName != groupName.c_str() ) {
+        child->setData(ENF_VER_GROUP_COLUMN, Qt::EditRole, QVariant(groupName.c_str()));
+      }
+      okToCreate = false;
+      break;
+    } // if
+  } // for
   if (!okToCreate) {
-    if (geomEntry.empty()) {
-      MESSAGE("In " << theFaceName << " vertex with coords " << x << ", " << y << ", " << z << " already exist: dont create again");
-    }
-    else {
-      MESSAGE("In " << theFaceName << " vertex with entry " << geomEntry << " already exist: dont create again");
-    }
     return;
   }
-    
-  if (geomEntry.empty()) {
-    MESSAGE("In " << theFaceName << " vertex with coords " << x << ", " << y << ", " << z<< " is created");
-  }
-  else {
-    MESSAGE("In " << theFaceName << " vertex with geom entry " << geomEntry << " is created");
-  }
 
-  QTreeWidgetItem *vertexItem = new QTreeWidgetItem( theItem);
+  QTreeWidgetItem *vertexItem = new QTreeWidgetItem( myEnforcedTreeWidget );
   vertexItem->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
   QPixmap iconSelect (SUIT_Session::session()->resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
   QSize iconSize = iconSelect.size()*0.7;
-  
-  int vertexIndex=myEnforcedTreeWidget->indexOfTopLevelItem(theItem);
+
+  int vertexIndex=nbVert;
   QString myVertexName;
   int indexRef = -1;
   while(indexRef != vertexIndex) {
@@ -1413,7 +1415,7 @@ void BLSURFPluginGUI_HypothesisCreator::addEnforcedVertex(QTreeWidgetItem* theIt
       myVertexName = QString(vertexName.c_str());
 
     for (int row = 0;row<nbVert;row++) {
-      QString name = theItem->child(row)->data(ENF_VER_NAME_COLUMN,Qt::EditRole).toString();
+      QString name = myEnforcedTreeWidget->topLevelItem(row)->data(ENF_VER_NAME_COLUMN,Qt::EditRole).toString();
       if (myVertexName == name) {
         vertexIndex++;
         break;
@@ -1433,59 +1435,40 @@ void BLSURFPluginGUI_HypothesisCreator::addEnforcedVertex(QTreeWidgetItem* theIt
   if (groupName != "")
     vertexItem->setData( ENF_VER_GROUP_COLUMN, Qt::EditRole, QVariant(groupName.c_str()));
 
-  QString toolTip = QString(theFaceName.c_str())+QString(": ")+myVertexName;
+  QString toolTip = myVertexName;
   if (geomEntry.empty()) {
-    toolTip += QString(" (%1, ").arg(x);
-    toolTip += QString("%1, ").arg(y);
-    toolTip += QString("%1)").arg(z);
+    toolTip += QString(" (%1, %2, %3").arg(x).arg(y).arg(z);
   }
   if (groupName != "")
     toolTip += QString(" [%1]").arg(groupName.c_str());
   
   vertexItem->setToolTip(ENF_VER_NAME_COLUMN,toolTip);
-  theItem->setExpanded(true);
   myEnforcedTreeWidget->setCurrentItem(vertexItem,ENF_VER_NAME_COLUMN);
 }
 
 /** BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices()
 This method is called when a item is added into the enforced vertices tree widget
 */
-void BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices() {
-//   MESSAGE("BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices");
-
+void BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices()
+{
   BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
 
   getGeomSelectionTool()->selectionMgr()->clearFilters();
-  myEnfFaceWdg->deactivateSelection();
   myEnfVertexWdg->deactivateSelection();
 
   for (int column = 0; column < myEnforcedTreeWidget->columnCount(); ++column)
     myEnforcedTreeWidget->resizeColumnToContents(column);
 
   // Vertex selection
-  int selEnfFace   = myEnfFaceWdg->NbObjects();
   int selEnfVertex = myEnfVertexWdg->NbObjects();
   bool coordsEmpty = (myXCoord->text().isEmpty()) || (myYCoord->text().isEmpty()) || (myZCoord->text().isEmpty());
 
-  if (selEnfFace == 0)
-    return;
-
   if ((selEnfVertex == 0) && coordsEmpty)
     return;
 
   string entry, shapeName;
-
-  for (int i = 0 ; i < selEnfFace ; i++) {
-    myEnfFace = myEnfFaceWdg->GetObject< GEOM::GEOM_Object >(i);
-    entry = myEnfFace->GetStudyEntry();
-    shapeName = myEnfFace->GetName();
-    
-    QTreeWidgetItem * faceItem = addEnforcedFace(entry, shapeName);
-    
-    std::string groupName = myGroupName->text().toStdString();
-
-    if (boost::trim_copy(groupName).empty())
-      groupName = "";
+  {
+    std::string groupName = myGroupName->text().simplified().toStdString();
 
     if (selEnfVertex <= 1)
     {
@@ -1495,10 +1478,10 @@ void BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices() {
       z = myZCoord->GetValue();
       if (selEnfVertex == 1) {
         myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >();
-        addEnforcedVertex(faceItem, x, y, z, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName);
+        addEnforcedVertex(x, y, z, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName);
       }
       else
-        addEnforcedVertex(faceItem, x, y, z, "", "", groupName);
+        addEnforcedVertex(x, y, z, "", "", groupName);
     }
     else
     {
@@ -1517,15 +1500,14 @@ void BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices() {
         if (myEnfVertex->GetShapeType() == GEOM::VERTEX) {
           measureOp->PointCoordinates (myEnfVertex, x, y, z);
           if ( measureOp->IsDone() )
-            addEnforcedVertex(faceItem, x, y, z, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName);
+            addEnforcedVertex(x, y, z, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName);
         } else if (myEnfVertex->GetShapeType() == GEOM::COMPOUND) {
-            addEnforcedVertex(faceItem, 0, 0, 0, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName);
+            addEnforcedVertex(0, 0, 0, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName);
         }
       }
     }
   }
 
-  myEnfFaceWdg->SetObject(GEOM::GEOM_Object::_nil());
   myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
   
   for (int column = 0; column < myEnforcedTreeWidget->columnCount(); ++column)
@@ -1541,7 +1523,6 @@ void BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices() {
 This method is called when a item is removed from the enforced vertices tree widget
 */
 void BLSURFPluginGUI_HypothesisCreator::onRemoveEnforcedVertex() {
-//   MESSAGE("BLSURFPluginGUI_HypothesisCreator::onRemoveEnforcedVertex");
   QList<QTreeWidgetItem *> selectedItems = myEnforcedTreeWidget->selectedItems();
   QList<QTreeWidgetItem *> selectedVertices;
   QSet<QTreeWidgetItem *> selectedEntries;
@@ -1562,10 +1543,10 @@ void BLSURFPluginGUI_HypothesisCreator::onRemoveEnforcedVertex() {
 
   foreach(item,selectedVertices) {
     QTreeWidgetItem* parent = item->parent();
-//     MESSAGE("From geometry "<< parent->text(ENF_VER_NAME_COLUMN).toStdString()<<" remove " << item->text(ENF_VER_NAME_COLUMN).toStdString());
-    parent->removeChild(item);
+    if ( parent )
+      parent->removeChild(item);
     delete item;
-    if (parent->childCount() == 0) {
+    if ( parent && parent->childCount() == 0) {
       if (selectedEntries.contains(parent))
         selectedEntries.remove(parent);
       delete parent;
@@ -1573,7 +1554,6 @@ void BLSURFPluginGUI_HypothesisCreator::onRemoveEnforcedVertex() {
   }
 
   foreach(item,selectedEntries) {
-//     MESSAGE("Remove " << item->text(ENF_VER_NAME_COLUMN).toStdString());
     delete item;
   }
 
@@ -1590,7 +1570,6 @@ void BLSURFPluginGUI_HypothesisCreator::onInternalVerticesClicked(int state)
 This method is called when a item is added into the periodicity table widget
 */
 void BLSURFPluginGUI_HypothesisCreator::onAddPeriodicity() {
-//   MESSAGE("BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices");
 
   BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
 
@@ -1672,12 +1651,10 @@ void BLSURFPluginGUI_HypothesisCreator::onAddPeriodicity() {
 This method is called when a item is removed from the periodicity tree widget
 */
 void BLSURFPluginGUI_HypothesisCreator::onRemovePeriodicity() {
-//   MESSAGE("BLSURFPluginGUI_HypothesisCreator::onRemoveEnforcedVertex");
   QList<QTreeWidgetItem *> selectedItems = myPeriodicityTreeWidget->selectedItems();
   QTreeWidgetItem* item;
 
   foreach(item,selectedItems) {
-     MESSAGE("Remove " << item->text(0).toStdString());
     delete item;
   }
 
@@ -1707,7 +1684,6 @@ This method enable the proper shape selection widget to Face or Edge shapes
 //{
 //  if (myPeriodicityOnFaceRadioButton->isChecked())
 //    {
-//      MESSAGE("Show Face");
 //      myPeriodicitySourceEdgeWdg->hide();
 //      myPeriodicityTargetEdgeWdg->hide();
 //      myPeriodicitySourceFaceWdg->show();
@@ -1715,7 +1691,6 @@ This method enable the proper shape selection widget to Face or Edge shapes
 //    }
 //  else
 //    {
-//      MESSAGE("Show Edge");
 //      myPeriodicitySourceFaceWdg->hide();
 //      myPeriodicityTargetFaceWdg->hide();
 //      myPeriodicitySourceEdgeWdg->show();
@@ -1789,7 +1764,6 @@ This method updates the GUI widgets with the hypothesis data
 */
 void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const
 {
-  MESSAGE("BLSURFPluginGUI_HypothesisCreator::retrieveParams");
   BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
 
   BlsurfHypothesisData data;
@@ -1886,7 +1860,6 @@ void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const
 //   myGMFFileMode->setChecked(data.myGMFFileMode);
   
   // Sizemaps
-  MESSAGE("retrieveParams():that->mySMPMap.size() = " << that->mySMPMap.size());
   QMapIterator<QString, QString> i(that->mySMPMap);
   GeomSelectionTools* myGeomToolSelected = that->getGeomSelectionTool();
   while (i.hasNext()) {
@@ -1923,23 +1896,20 @@ void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const
     else
     {
       item->setData(SMP_SIZEMAP_COLUMN, Qt::EditRole, QVariant( sizeMap ) );
-    } 
+    }
   }
   mySizeMapTable->resizeColumnToContents( SMP_ENTRY_COLUMN );
   mySizeMapTable->resizeColumnToContents( SMP_NAME_COLUMN );
   mySizeMapTable->resizeColumnToContents(SMP_SIZEMAP_COLUMN);
 
   // Enforced vertices
-  MESSAGE("retrieveParams(): data.entryCoordsListMap.size() = " << data.faceEntryEnfVertexListMap.size());
   TFaceEntryEnfVertexListMap::const_iterator evmIt = data.faceEntryEnfVertexListMap.begin();
 
   for ( ; evmIt != data.faceEntryEnfVertexListMap.end() ; ++evmIt) {
     TEntry entry = (*evmIt).first;
     std::string shapeName = myGeomToolSelected->getNameFromEntry(entry);
-    MESSAGE("Face entry: " << entry);
-    MESSAGE("Face name: " << shapeName);
-    
-    QTreeWidgetItem* faceItem = that->addEnforcedFace(entry, shapeName);
+
+    //QTreeWidgetItem* faceItem = that->addEnforcedFace(entry, shapeName);
 
     TEnfVertexList evs = (*evmIt).second;
 
@@ -1947,17 +1917,16 @@ void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const
     TEnfVertex *enfVertex;
     for ( ; evsIt != evs.end() ; ++evsIt) {
       enfVertex = (*evsIt);
-      MESSAGE("Name: " << enfVertex->name);
       double x = 0, y = 0, z = 0;
       if (enfVertex->coords.size()) {
         x = enfVertex->coords[0];
         y = enfVertex->coords[1];
         z = enfVertex->coords[2];
       }
-      that->addEnforcedVertex(faceItem, x, y, z, enfVertex->name, enfVertex->geomEntry, enfVertex->grpName);
+      that->addEnforcedVertex(x, y, z, enfVertex->name, enfVertex->geomEntry, enfVertex->grpName);
     }
   }
-  
+
   for (int column = 0; column < myEnforcedTreeWidget->columnCount(); ++column)
     myEnforcedTreeWidget->resizeColumnToContents(column);
 
@@ -1966,24 +1935,26 @@ void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const
   myInternalEnforcedVerticesAllFacesGroup->setEnabled(data.myInternalEnforcedVerticesAllFaces);
 
   // Periodicity
-  MESSAGE("retrieveParams(): periodicity ");
-
 
   // Add an item in the tree widget for each association
   for (size_t i=0 ; i<data.preCadPeriodicityVector.size() ; i++)
+  {
+    QTreeWidgetItem* item = new QTreeWidgetItem();
+    myPeriodicityTreeWidget->addTopLevelItem(item);
+    item->setFlags( Qt::ItemIsSelectable   |Qt::ItemIsEnabled );
+    TPreCadPeriodicity periodicity_i = data.preCadPeriodicityVector[i];
+    for (size_t k=0; k<periodicity_i.size(); k++)
     {
-      QTreeWidgetItem* item = new QTreeWidgetItem();
-      myPeriodicityTreeWidget->addTopLevelItem(item);
-      item->setFlags( Qt::ItemIsSelectable   |Qt::ItemIsEnabled );
-      TPreCadPeriodicity periodicity_i = data.preCadPeriodicityVector[i];
-      for (size_t k=0; k<periodicity_i.size(); k++)
-        {
-          string shapeEntry = periodicity_i[k];
-          string shapeName = myGeomToolSelected->getNameFromEntry(shapeEntry);
-          item->setData(k, Qt::EditRole, shapeName.c_str() );
-          item->setData(k, Qt::UserRole, shapeEntry.c_str() );
-        }
+      string shapeEntry = periodicity_i[k];
+      string shapeName = myGeomToolSelected->getNameFromEntry(shapeEntry);
+      item->setData(k, Qt::EditRole, shapeName.c_str() );
+      item->setData(k, Qt::UserRole, shapeEntry.c_str() );
     }
+  }
+
+  // Hyper patches
+  for ( int i = 0; i < data.hyperpatches.size(); ++i )
+    that->addHyPatchToTable( data.hyperpatches[i] );
 
   // update widgets
   that->myStdWidget->onPhysicalMeshChanged();
@@ -1996,7 +1967,6 @@ This method updates the hypothesis data with the GUI widgets content.
 */
 QString BLSURFPluginGUI_HypothesisCreator::storeParams() const
 {
-  MESSAGE("BLSURFPluginGUI_HypothesisCreator::storeParams");
   BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
 
   BlsurfHypothesisData data;
@@ -2011,7 +1981,6 @@ Updates the hypothesis data from hypothesis values.
 */
 bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData& h_data ) const
 {
-  MESSAGE("BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo");
   BLSURFPlugin::BLSURFPlugin_Hypothesis_var h =
     BLSURFPlugin::BLSURFPlugin_Hypothesis::_narrow( initParamsHypothesis() );
 
@@ -2076,18 +2045,15 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData
 
   // classic size maps
   BLSURFPlugin::string_array_var mySizeMaps = h->GetSizeMapEntries();
-//   MESSAGE("mySizeMaps->length() = " << mySizeMaps->length());
   QString fullSizeMaps;
   QStringList fullSizeMapList;
   GeomSelectionTools* myGeomToolSelected = that->getGeomSelectionTool();
   for ( CORBA::ULong i = 0;i<mySizeMaps->length(); ++i ) {
     fullSizeMaps =  mySizeMaps[i].in();
-//     MESSAGE("fullSizeMaps: " << fullSizeMaps.toStdString());
     fullSizeMapList = fullSizeMaps.split( "|", QString::KeepEmptyParts );
     if ( fullSizeMapList.count() > 1 ) {
       string fullSizeMap = fullSizeMapList[1].toStdString();
       int pos = fullSizeMap.find("return")+7;
-//       MESSAGE("pos:" << pos);
       QString sizeMap;
       try {
         sizeMap = QString::fromStdString(fullSizeMap.substr(pos, fullSizeMap.size()-pos));
@@ -2096,16 +2062,13 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData
         continue;
       }
       that->mySMPMap[fullSizeMapList[0]] = sizeMap;
-//       MESSAGE("mySMPMap[" << fullSizeMapList[0].toStdString() << "] = " << sizeMap.toStdString());
       that->mySMPShapeTypeMap[fullSizeMapList[0]] = myGeomToolSelected->entryToShapeType(fullSizeMapList[0].toStdString());
-//       MESSAGE("mySMPShapeTypeMap[" << fullSizeMapList[0].toStdString() << "] = " << that->mySMPShapeTypeMap[fullSizeMapList[0]]);
     }
   }
 
   // custom size maps
 /*
   BLSURFPlugin::string_array_var myCustomSizeMaps = h->GetCustomSizeMapEntries();
-  MESSAGE("myCustomSizeMaps->length() = " << myCustomSizeMaps->length());
 
   for ( int i = 0;i<myCustomSizeMaps->length(); ++i ) {
     QString fullCustomSizeMaps =  myCustomSizeMaps[i].in();
@@ -2113,14 +2076,11 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData
     if ( fullCustomSizeMapList.count() > 1 ) {
       that->mySMPMap[fullCustomSizeMapList[0]] = fullCustomSizeMapList[1];
       that->mySMPShapeTypeMap[fullCustomSizeMapList[0]] = GeomToolSelected->entryToShapeType(fullCustomSizeMapList[0].toStdString());
-      MESSAGE("mySMPMap[" << fullCustomSizeMapList[0].toStdString() << "] = " << fullCustomSizeMapList[1].toStdString());
-      MESSAGE("mySMPShapeTypeMap[" << fullCustomSizeMapList[0].toStdString() << "] = " << that->mySMPShapeTypeMap[fullCustomSizeMapList[0]]);
     }
   }
 */
   // attractor
   BLSURFPlugin::string_array_var allMyAttractors = h->GetAttractorEntries();
-//   MESSAGE("myAttractors->length() = " << allMyAttractors->length());
 
   for ( CORBA::ULong i = 0;i<allMyAttractors->length(); ++i ) {
     QString myAttractors =  allMyAttractors[i].in();
@@ -2128,19 +2088,15 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData
     if ( myAttractorList.count() > 1 ) {
       that->mySMPMap[myAttractorList[0]] = myAttractorList[1];
       that->mySMPShapeTypeMap[myAttractorList[0]] = myGeomToolSelected->entryToShapeType(myAttractorList[0].toStdString());
-//       MESSAGE("mySMPMap[" << myAttractorList[0].toStdString() << "] = " << myAttractorList[1].toStdString());
-//       MESSAGE("mySMPShapeTypeMap[" << myAttractorList[0].toStdString() << "] = " << that->mySMPShapeTypeMap[myAttractorList[0]]);
     }
   }
   
   // attractor new version
-  MESSAGE("readParamsFromHypo, Attractors")
   BLSURFPlugin::TAttParamsMap_var allMyAttractorParams = h->GetAttractorParams();
   for ( CORBA::ULong i = 0;i<allMyAttractorParams->length(); ++i ) {
     BLSURFPlugin::TAttractorParams myAttractorParams =  allMyAttractorParams[i];
     QString faceEntry = myAttractorParams.faceEntry.in();
     QString attEntry  = myAttractorParams.attEntry.in();
-    MESSAGE("attEntry = "<<attEntry.toStdString())
     that->mySMPMap[faceEntry] = QString::number( myAttractorParams.startSize, 'g',  6 ); // TODO utiliser les préférences ici (cf. sketcher)
     that->mySMPShapeTypeMap[faceEntry] = myGeomToolSelected->entryToShapeType(faceEntry.toStdString());
     that->myATTMap[faceEntry].push_back( TAttractor( myAttractorParams.attEntry.in(),
@@ -2157,22 +2113,18 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData
   */
 
   BLSURFPlugin::TFaceEntryEnfVertexListMap_var faceEntryEnfVertexListMap = h->GetAllEnforcedVerticesByFace();
-  MESSAGE("faceEntryEnfVertexListMap->length() = " << faceEntryEnfVertexListMap->length());
 
-  for ( CORBA::ULong i = 0;i<faceEntryEnfVertexListMap->length(); ++i ) {
-    std::string entry =  faceEntryEnfVertexListMap[i].faceEntry.in();
-//     BLSURFPlugin::TEnfVertexList vertexList = faceEntryEnfVertexListMap[i].enfVertexList.in();
+  for ( CORBA::ULong i = 0;i<faceEntryEnfVertexListMap->length(); ++i )
+  {
+    std::string entry = faceEntryEnfVertexListMap[i].faceEntry.in();
     BLSURFPlugin::TEnfVertexList vertexList = faceEntryEnfVertexListMap[i].enfVertexList;
-//     BLSURFPlugin::TEnfVertexList_var vertexList = h->GetEnforcedVerticesEntry(entry.c_str());
-
-//     TEnfVertexList& enfVertexList = h_data.faceEntryEnfVertexListMap[entry];
 
-    for (CORBA::ULong j=0 ; j<vertexList.length(); ++j) {
+    for (CORBA::ULong j=0 ; j<vertexList.length(); ++j)
+    {
       TEnfVertex *enfVertex = new TEnfVertex();
-      
-      enfVertex->name = CORBA::string_dup(vertexList[j].name.in());
-      enfVertex->geomEntry = CORBA::string_dup(vertexList[j].geomEntry.in());
-      enfVertex->grpName = CORBA::string_dup(vertexList[j].grpName.in());
+      enfVertex->name      = vertexList[j].name.in();
+      enfVertex->geomEntry = vertexList[j].geomEntry.in();
+      enfVertex->grpName   = vertexList[j].grpName.in();
       for (CORBA::ULong k=0 ; k< vertexList[j].coords.length();k++)
         enfVertex->coords.push_back(vertexList[j].coords[k]);
 
@@ -2195,7 +2147,6 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData
   h_data.myInternalEnforcedVerticesAllFacesGroup = h->GetInternalEnforcedVertexAllFacesGroup();
 
   // Periodicity
-  MESSAGE("readParamsFromHypo, Periodicity")
 
   h_data.preCadPeriodicityVector.clear();
 
@@ -2204,6 +2155,21 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData
 
   BLSURFPlugin::TPeriodicityList_var preCadEdgePeriodicityVector = h->GetPreCadEdgesPeriodicityVector();
   AddPreCadSequenceToVector(h_data, preCadEdgePeriodicityVector, false);
+
+  // Hyper Patches
+
+  h_data.hyperpatches.clear();
+  BLSURFPlugin::THyperPatchList_var patchList = h->GetHyperPatches();
+  for ( CORBA::ULong i = 0; i < patchList->length(); ++i )
+  {
+    QString tags;
+    BLSURFPlugin::THyperPatch& patch = patchList[i];
+    for ( CORBA::ULong j = 0; j < patch.length(); ++j )
+      tags += QString::number( patch[j] ) + " ";
+    if ( !tags.isEmpty() )
+      h_data.hyperpatches.append( tags );
+  }
+
   return true;
 }
 
@@ -2248,7 +2214,6 @@ Saves the hypothesis data to hypothesis values.
 */
 bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesisData& h_data ) const
 {
-  MESSAGE("BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo");
   BLSURFPlugin::BLSURFPlugin_Hypothesis_var h =
     BLSURFPlugin::BLSURFPlugin_Hypothesis::_narrow( hypothesis() );
 
@@ -2333,7 +2298,7 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi
       h->SetOptimizeMesh( h_data.myOptimizeMesh );    
     
     if ( h->GetQuadraticMesh() != h_data.myQuadraticMesh )
-      h->SetQuadraticMesh( h_data.myQuadraticMesh );    
+      h->SetQuadraticMesh( h_data.myQuadraticMesh );
 
     if ( h->GetVerbosity() != h_data.myVerbosity )
       h->SetVerbosity( h_data.myVerbosity );
@@ -2349,10 +2314,10 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi
     // options are set in checkParams()
     //h->SetOptionValues( myOptions ); // is set in readParamsFromWidgets()
     //h->SetPreCADOptionValues( myPreCADOptions ); // is set in readParamsFromWidgets()
-    
+
     if ( h->GetGMFFile() != h_data.myGMFFileName )
-//       || ( h->GetGMFFileMode() != h_data.myGMFFileMode ) )
-//       h->SetGMFFile( h_data.myGMFFileName.c_str(), h_data.myGMFFileMode );
+      //       || ( h->GetGMFFileMode() != h_data.myGMFFileMode ) )
+      //       h->SetGMFFile( h_data.myGMFFileName.c_str(), h_data.myGMFFileMode );
       h->SetGMFFile( h_data.myGMFFileName.c_str());
 
     BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
@@ -2363,16 +2328,13 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi
       const QString sizeMap = i.value();
 
       if (sizeMap == "__TO_DELETE__") {
-        MESSAGE("Delete entry " << entry.toStdString() << " from engine");
         h->UnsetEntry(entry.toLatin1().constData());
       }
       else if (sizeMap.startsWith("ATTRACTOR")) {
-//         MESSAGE("SetAttractorEntry(" << entry.toStdString() << ")= " << sizeMap.toStdString());
         h->SetAttractorEntry( entry.toLatin1().constData(), sizeMap.toLatin1().constData());
       }
       else if (sizeMap.startsWith("def")) {
-//         MESSAGE("SetCustomSizeMapEntry(" << entry.toStdString() << ")= " << sizeMap.toStdString());
-//        h->SetCustomSizeMapEntry( entry.toLatin1().constData(), sizeMap.toLatin1().constData() );
+        //        h->SetCustomSizeMapEntry( entry.toLatin1().constData(), sizeMap.toLatin1().constData() );
       }
       else {
         if (!myATTMap[entry].empty()){
@@ -2400,7 +2362,6 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi
             fullSizeMap = QString("def f(t): return ") + sizeMap;
           else if (that->mySMPShapeTypeMap[entry] == TopAbs_VERTEX)
             fullSizeMap = QString("def f(): return ") + sizeMap;
-          MESSAGE("SetSizeMapEntry("<<entry.toStdString()<<") = " <<fullSizeMap.toStdString());
           h->SetSizeMapEntry( entry.toLatin1().constData(), fullSizeMap.toLatin1().constData() );
         }
       }
@@ -2411,13 +2372,13 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi
     double x, y, z = 0;
     std::string enfName;
     /* TODO GROUPS
-    std::string groupName = "";
+       std::string groupName = "";
     */
 
     TFaceEntryEnfVertexListMap::const_iterator evmIt = h_data.faceEntryEnfVertexListMap.begin();
     // 1. Clear all enforced vertices in hypothesis
     // 2. Add new enforced vertex according to h_data
-    
+
     if ( h->GetAllEnforcedVertices()->length() > 0 )
       h->ClearAllEnforcedVertices();
     TEnfName faceEntry;
@@ -2427,7 +2388,6 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi
     {
       faceEntry = evmIt->first;
       evs = evmIt->second;
-      MESSAGE("Number of enforced vertices for face entry " << faceEntry << ": " << evs.size());
       evsIt = evs.begin();
       for ( ; evsIt != evs.end() ; ++evsIt)
       {
@@ -2449,72 +2409,76 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi
 
     // Periodicity
     if ( h->GetPreCadFacesPeriodicityVector()->length() > 0 || h->GetPreCadEdgesPeriodicityVector()->length() > 0 )
-          h->ClearPreCadPeriodicityVectors();
+      h->ClearPreCadPeriodicityVectors();
 
-    MESSAGE("h_data.preCadPeriodicityVector.size(): " << h_data.preCadPeriodicityVector.size());
     TPreCadPeriodicityVector::const_iterator pIt = h_data.preCadPeriodicityVector.begin();
     for ( ; pIt != h_data.preCadPeriodicityVector.end() ; ++pIt)
+    {
+      TPreCadPeriodicity periodicity_i = *pIt;
+      TEntry source = periodicity_i[PERIODICITY_OBJ_SOURCE_COLUMN];
+      TEntry target = periodicity_i[PERIODICITY_OBJ_TARGET_COLUMN];
+      TEntry p1Source = periodicity_i[PERIODICITY_P1_SOURCE_COLUMN];
+      TEntry p2Source = periodicity_i[PERIODICITY_P2_SOURCE_COLUMN];
+      TEntry p3Source = periodicity_i[PERIODICITY_P3_SOURCE_COLUMN];
+      TEntry p1Target = periodicity_i[PERIODICITY_P1_TARGET_COLUMN];
+      TEntry p2Target = periodicity_i[PERIODICITY_P2_TARGET_COLUMN];
+      TEntry p3Target = periodicity_i[PERIODICITY_P3_TARGET_COLUMN];
+      bool onFace = (periodicity_i[PERIODICITY_SHAPE_TYPE]=="1") ? true : false;
+
+      BLSURFPlugin::TEntryList_var sourceVertices = new BLSURFPlugin::TEntryList();
+      if (! p1Source.empty())
       {
-        TPreCadPeriodicity periodicity_i = *pIt;
-        TEntry source = periodicity_i[PERIODICITY_OBJ_SOURCE_COLUMN];
-        TEntry target = periodicity_i[PERIODICITY_OBJ_TARGET_COLUMN];
-        TEntry p1Source = periodicity_i[PERIODICITY_P1_SOURCE_COLUMN];
-        TEntry p2Source = periodicity_i[PERIODICITY_P2_SOURCE_COLUMN];
-        TEntry p3Source = periodicity_i[PERIODICITY_P3_SOURCE_COLUMN];
-        TEntry p1Target = periodicity_i[PERIODICITY_P1_TARGET_COLUMN];
-        TEntry p2Target = periodicity_i[PERIODICITY_P2_TARGET_COLUMN];
-        TEntry p3Target = periodicity_i[PERIODICITY_P3_TARGET_COLUMN];
-        bool onFace = (periodicity_i[PERIODICITY_SHAPE_TYPE]=="1") ? true : false;
-
-        BLSURFPlugin::TEntryList_var sourceVertices = new BLSURFPlugin::TEntryList();
-        if (! p1Source.empty())
-          {
-            sourceVertices->length(3);
-            sourceVertices[0]=CORBA::string_dup(p1Source.c_str());
-            sourceVertices[1]=CORBA::string_dup(p2Source.c_str());
-            sourceVertices[2]=CORBA::string_dup(p3Source.c_str());
-          }
-
+        sourceVertices->length(3);
+        sourceVertices[0]=CORBA::string_dup(p1Source.c_str());
+        sourceVertices[1]=CORBA::string_dup(p2Source.c_str());
+        sourceVertices[2]=CORBA::string_dup(p3Source.c_str());
+      }
 
-        BLSURFPlugin::TEntryList_var targetVertices = new BLSURFPlugin::TEntryList();
-        if (! p1Target.empty())
-          {
-            targetVertices->length(3);
-            targetVertices[0]=CORBA::string_dup(p1Target.c_str());
-            targetVertices[1]=CORBA::string_dup(p2Target.c_str());
-            targetVertices[2]=CORBA::string_dup(p3Target.c_str());
-          }
 
-        if (onFace)
-          h->AddPreCadFacesPeriodicityEntry(source.c_str(), target.c_str(), sourceVertices, targetVertices);
-        else
-          h->AddPreCadEdgesPeriodicityEntry(source.c_str(), target.c_str(), sourceVertices, targetVertices);
+      BLSURFPlugin::TEntryList_var targetVertices = new BLSURFPlugin::TEntryList();
+      if (! p1Target.empty())
+      {
+        targetVertices->length(3);
+        targetVertices[0]=CORBA::string_dup(p1Target.c_str());
+        targetVertices[1]=CORBA::string_dup(p2Target.c_str());
+        targetVertices[2]=CORBA::string_dup(p3Target.c_str());
       }
 
-    MESSAGE("BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo end periodicity");
+      if (onFace)
+        h->AddPreCadFacesPeriodicityEntry(source.c_str(), target.c_str(), sourceVertices, targetVertices);
+      else
+        h->AddPreCadEdgesPeriodicityEntry(source.c_str(), target.c_str(), sourceVertices, targetVertices);
+    }
+
+    // Hyper-patches
+    BLSURFPlugin::THyperPatchList_var hpl = new BLSURFPlugin::THyperPatchList();
+    hpl->length( h_data.hyperpatches.size() );
+
+    for ( int i = 0; i < h_data.hyperpatches.size(); ++i )
+    {
+      QStringList tags = h_data.hyperpatches[i].split(" ",  QString::SkipEmptyParts);
+      BLSURFPlugin::THyperPatch& patch = hpl[ i ];
+      patch.length( tags.size() );
+
+      for ( int j = 0; j < tags.size(); ++j )
+        patch[ j ] = tags[ j ].toDouble();
+    }
+    h->SetHyperPatches( hpl );
 
 
   } // try
-  catch(const std::exception& ex) {
-    std::cout << "Exception: " << ex.what() << std::endl;
-    throw ex;
-  }
-//   catch(const SALOME::SALOME_Exception& ex)
-//   {
-//     throw ex;
-// //     SalomeApp_Tools::QtCatchCorbaException(ex);
-// //     ok = false;
-//   }
-  MESSAGE("BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo end");
+  catch(...) {
+    ok = false;
+  }
+
   return ok;
 }
 
 /** BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets(h_data)
-Stores the widgets content to the hypothesis data.
+    Stores the widgets content to the hypothesis data.
 */
 QString BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets( BlsurfHypothesisData& h_data ) const
 {
-  MESSAGE("BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets");
   h_data.myName                  = myName ? myName->text() : "";
   h_data.myPhysicalMesh          = myStdWidget->myPhysicalMesh->currentIndex();
   h_data.myGeometricMesh         = myStdWidget->myGeometricMesh->currentIndex();
@@ -2587,9 +2551,9 @@ QString BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets( BlsurfHypothes
   int row = 0, nbRows = mySizeMapTable->topLevelItemCount();
   for ( ; row < nbRows; ++row )
   {
-      QString entry   = mySizeMapTable->topLevelItem(row)->data(SMP_ENTRY_COLUMN ,Qt::EditRole).toString();
-      if ( that->mySMPMap.contains(entry) )
-        guiHyp += "SetSizeMapEntry(" + entry + ", " + that->mySMPMap[entry] + "); ";
+    QString entry   = mySizeMapTable->topLevelItem(row)->data(SMP_ENTRY_COLUMN ,Qt::EditRole).toString();
+    if ( that->mySMPMap.contains(entry) )
+      guiHyp += "SetSizeMapEntry(" + entry + ", " + that->mySMPMap[entry] + "); ";
   }
 
   // Enforced vertices
@@ -2597,54 +2561,42 @@ QString BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets( BlsurfHypothes
   h_data.faceEntryEnfVertexListMap.clear();
 
   int nbEnforcedShapes = myEnforcedTreeWidget->topLevelItemCount();
-  int nbEnforcedVertices = 0;
-  std::string groupName = "";
-//   MESSAGE("Nb of enforced shapes: " << nbEnforcedShapes);
-  for (int i=0 ; i<nbEnforcedShapes ; i++) {
-    QTreeWidgetItem* shapeItem = myEnforcedTreeWidget->topLevelItem(i);
-    if (shapeItem) {
-      std::string faceEntry = shapeItem->data(ENF_VER_FACE_ENTRY_COLUMN,Qt::EditRole).toString().toStdString();
-      nbEnforcedVertices = shapeItem->childCount();
-      if (nbEnforcedVertices >0) {
-        double childValueX,childValueY,childValueZ;
-        std::string childName, vertexEntry;
-        QTreeWidgetItem* child;
-        TEnfVertexList evs;
-        evs.clear();
-        for (row = 0;row<nbEnforcedVertices;row++) {
-          child = shapeItem->child(row);
-          childName   = child->data(ENF_VER_NAME_COLUMN,Qt::EditRole).toString().toStdString();
-          childValueX = child->data(ENF_VER_X_COLUMN,Qt::EditRole).toDouble();
-          childValueY = child->data(ENF_VER_Y_COLUMN,Qt::EditRole).toDouble();
-          childValueZ = child->data(ENF_VER_Z_COLUMN,Qt::EditRole).toDouble();
-          vertexEntry = child->data(ENF_VER_ENTRY_COLUMN,Qt::EditRole).toString().toStdString();
-//           if (myGlobalGroupName->isChecked())
-//             groupName = myGlobalGroupName->text().toStdString();
-//           else
-            groupName = child->data(ENF_VER_GROUP_COLUMN,Qt::EditRole).toString().toStdString();
-
-          TEnfVertex *enfVertex = new TEnfVertex();
-          enfVertex->name = childName;
-          if (vertexEntry.empty()) {
-            enfVertex->coords.push_back(childValueX);
-            enfVertex->coords.push_back(childValueY);
-            enfVertex->coords.push_back(childValueZ);
-          }
-          else
-            enfVertex->geomEntry = vertexEntry;
-          enfVertex->grpName = groupName;
-//           TEnfVertexList::iterator it = h_data.enfVertexList.find(enfVertex);
-//           if (it == h_data.enfVertexList.end())
-          h_data.enfVertexList.insert(enfVertex);
-          evs.insert(enfVertex);
-          /* TODO GROUPS
-          if (groupName != "")
-            h_data.groupNameEnfVertexListMap[groupName].insert(vertex);
-          */
-        }
-        h_data.faceEntryEnfVertexListMap[faceEntry] = evs;
-      }
+  std::string groupName = "", faceEntry = "";
+  for (int i=0 ; i<nbEnforcedShapes ; i++)
+  {
+    double childValueX,childValueY,childValueZ;
+    std::string childName, vertexEntry;
+    QTreeWidgetItem* child;
+
+    child = myEnforcedTreeWidget->topLevelItem(i);
+    childName   = child->data(ENF_VER_NAME_COLUMN,Qt::EditRole).toString().toStdString();
+    childValueX = child->data(ENF_VER_X_COLUMN,Qt::EditRole).toDouble();
+    childValueY = child->data(ENF_VER_Y_COLUMN,Qt::EditRole).toDouble();
+    childValueZ = child->data(ENF_VER_Z_COLUMN,Qt::EditRole).toDouble();
+    vertexEntry = child->data(ENF_VER_ENTRY_COLUMN,Qt::EditRole).toString().toStdString();
+    //           if (myGlobalGroupName->isChecked())
+    //             groupName = myGlobalGroupName->text().toStdString();
+    //           else
+    groupName = child->data(ENF_VER_GROUP_COLUMN,Qt::EditRole).toString().toStdString();
+
+    TEnfVertex *enfVertex = new TEnfVertex();
+    enfVertex->name = childName;
+    if (vertexEntry.empty()) {
+      enfVertex->coords.push_back(childValueX);
+      enfVertex->coords.push_back(childValueY);
+      enfVertex->coords.push_back(childValueZ);
     }
+    else
+      enfVertex->geomEntry = vertexEntry;
+    enfVertex->grpName = groupName;
+    //           TEnfVertexList::iterator it = h_data.enfVertexList.find(enfVertex);
+    //           if (it == h_data.enfVertexList.end())
+    h_data.enfVertexList.insert(enfVertex);
+    /* TODO GROUPS
+       if (groupName != "")
+       h_data.groupNameEnfVertexListMap[groupName].insert(vertex);
+    */
+    h_data.faceEntryEnfVertexListMap[faceEntry].insert( enfVertex );
   }
 
   h_data.myInternalEnforcedVerticesAllFaces      = myInternalEnforcedVerticesAllFaces->isChecked();
@@ -2660,9 +2612,7 @@ QString BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets( BlsurfHypothes
     if (item) {
         for (int k=0; k<myPeriodicityTreeWidget->columnCount(); ++k)
           {
-            MESSAGE(k);
             std::string entry = item->data(k, Qt::UserRole).toString().toStdString();
-            MESSAGE(entry);
             periodicity_i.push_back(entry);
           }
         h_data.preCadPeriodicityVector.push_back(periodicity_i);
@@ -2670,7 +2620,11 @@ QString BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets( BlsurfHypothes
     guiHyp += "PERIODICITY = yes; ";
   }
 
-  MESSAGE("guiHyp : " << guiHyp.toLatin1().data());
+  // Hyper-patches
+  h_data.hyperpatches.clear();
+  for ( int row = 0; row < myHyPatchTable->rowCount(); ++row )
+    h_data.hyperpatches.append( myHyPatchTable->item( row, 0 )->text() );
+
   return guiHyp;
 }
 
@@ -2725,7 +2679,6 @@ void BLSURFPluginGUI_HypothesisCreator::onMapGeomContentModified()
 
 void BLSURFPluginGUI_HypothesisCreator::onSmpItemClicked(QTreeWidgetItem * item, int col)
 { 
-  MESSAGE("BLSURFPluginGUI_HypothesisCreator::onSmpItemClicked("<<col<<")")
   BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
   if (col == SMP_SIZEMAP_COLUMN) {
     QString entry   = item->data( SMP_ENTRY_COLUMN, Qt::EditRole ).toString();
@@ -2799,7 +2752,6 @@ void BLSURFPluginGUI_HypothesisCreator::onTabChanged(int tab)
     myGeomSelWdg1             ->deactivateSelection();
     myGeomSelWdg2             ->deactivateSelection();
     myAttSelWdg               ->deactivateSelection();
-    myEnfFaceWdg              ->deactivateSelection();
     myEnfVertexWdg            ->deactivateSelection();
     myPeriodicitySourceFaceWdg->deactivateSelection();
     myPeriodicityTargetFaceWdg->deactivateSelection();
@@ -2809,6 +2761,10 @@ void BLSURFPluginGUI_HypothesisCreator::onTabChanged(int tab)
     myPeriodicityP1TargetWdg  ->deactivateSelection();
     myPeriodicityP2TargetWdg  ->deactivateSelection();
     myPeriodicityP3TargetWdg  ->deactivateSelection();
+    if ( myHyPatchFaceSelBtn->isChecked() )
+      myHyPatchFaceSelBtn->toggle();
+    if ( myHyPatchGroupSelBtn->isChecked() )
+      myHyPatchGroupSelBtn->toggle();
     return;
   }
   else if ( sender() == smpTab )
@@ -2891,7 +2847,6 @@ void BLSURFPluginGUI_HypothesisCreator::onConstSizeClicked(int state)
 
 void BLSURFPluginGUI_HypothesisCreator::onRemoveMap()
 {
-  MESSAGE("BLSURFPluginGUI_HypothesisCreator::onRemoveMap()");
   QList<int> selectedRows;
   QList<QTreeWidgetItem*> selected = mySizeMapTable->selectedItems();
   QTreeWidgetItem* item;
@@ -2939,15 +2894,11 @@ void BLSURFPluginGUI_HypothesisCreator::onRemoveMap()
 
 void BLSURFPluginGUI_HypothesisCreator::onSetSizeMap(QTreeWidgetItem* item, int col)
 {
-  MESSAGE("BLSURFPluginGUI_HypothesisCreator::onSetSizeMap("<< col << ")");
-  MESSAGE("mySMPMap.size() = "<<mySMPMap.size());
   if (col == SMP_SIZEMAP_COLUMN) {
     BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
     QString entry   = item->data(SMP_ENTRY_COLUMN, Qt::EditRole).toString();
     QString sizeMap = item->data(SMP_SIZEMAP_COLUMN, Qt::EditRole).toString();
-    MESSAGE("entry: " << entry.toStdString() << ", sizeMap: " << sizeMap.toStdString());
     if (! that->mySMPShapeTypeMap.contains(entry))
-      MESSAGE("no such entry in mySMPShapeTypeMap")
       return;
     if (that->mySMPMap.contains(entry))
       if (that->mySMPMap[entry] == sizeMap 
@@ -2960,7 +2911,6 @@ void BLSURFPluginGUI_HypothesisCreator::onSetSizeMap(QTreeWidgetItem* item, int
       sizeMapValidationFromEntry(entry); 
     }
     else {
-      MESSAGE("Size map empty: reverse to precedent value" );
       item->setData(SMP_SIZEMAP_COLUMN, Qt::EditRole, QVariant(that->mySMPMap[entry]) );
     }
     mySizeMapTable->resizeColumnToContents(SMP_SIZEMAP_COLUMN);
@@ -3006,7 +2956,6 @@ void BLSURFPluginGUI_HypothesisCreator::onAddMap()
 
 void BLSURFPluginGUI_HypothesisCreator::onModifyMap()
 {
-  MESSAGE("BLSURFPluginGUI_HypothesisCreator::onModifyMap()");
   bool res = false;
   if ( smpTab->currentIndex() == ATT_TAB ){    
     if ( myGeomSelWdg2->IsObjectSelected() && myAttSelWdg->IsObjectSelected() ){ 
@@ -3044,7 +2993,6 @@ void BLSURFPluginGUI_HypothesisCreator::onModifyMap()
 
 bool BLSURFPluginGUI_HypothesisCreator::insertElement(GEOM::GEOM_Object_var anObject, bool modify)
 {
-  MESSAGE("BLSURFPluginGUI_HypothesisCreator::insertElement()");
   // BLSURFPlugin::BLSURFPlugin_Hypothesis_var h =
   //   BLSURFPlugin::BLSURFPlugin_Hypothesis::_narrow( initParamsHypothesis());
 
@@ -3053,7 +3001,6 @@ bool BLSURFPluginGUI_HypothesisCreator::insertElement(GEOM::GEOM_Object_var anOb
   TopAbs_ShapeEnum shapeType;
   string entry, shapeName;
   entry = (string) anObject->GetStudyEntry();
-  MESSAGE("entry = "<<entry);
   shapeName = anObject->GetName();
   shapeType = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( anObject ).ShapeType();
   // Group management : the type of entities in the group is stored in the SMPShapeTypeMap
@@ -3091,7 +3038,6 @@ bool BLSURFPluginGUI_HypothesisCreator::insertElement(GEOM::GEOM_Object_var anOb
   else{
     if (that->mySMPMap.contains(shapeEntry)) {  
       if (that->mySMPMap[shapeEntry] != "__TO_DELETE__") {
-  //             MESSAGE("Size map for shape with name(entry): "<< shapeName << "(" << entry << ")");
         return false;
       }
     }
@@ -3118,7 +3064,6 @@ bool BLSURFPluginGUI_HypothesisCreator::insertElement(GEOM::GEOM_Object_var anOb
 
 bool BLSURFPluginGUI_HypothesisCreator::insertAttractor(GEOM::GEOM_Object_var aFace, GEOM::GEOM_Object_var anAttractor, bool modify)
 {
-  MESSAGE("BLSURFPluginGUI_HypothesisCreator::insertAttractor()");
   BLSURFPlugin::BLSURFPlugin_Hypothesis_var h =
     BLSURFPlugin::BLSURFPlugin_Hypothesis::_narrow( initParamsHypothesis());
 
@@ -3179,7 +3124,6 @@ bool BLSURFPluginGUI_HypothesisCreator::insertAttractor(GEOM::GEOM_Object_var aF
   else{
     // if (that->mySMPMap.contains(shapeEntry)) {  
     //   if (that->mySMPMap[shapeEntry] != "__TO_DELETE__") {
-    // //             MESSAGE("Size map for shape with name(entry): "<< shapeName << "(" << entry << ")");
     //     return false;
     //   }
     // }
@@ -3231,13 +3175,11 @@ bool BLSURFPluginGUI_HypothesisCreator::insertAttractor(GEOM::GEOM_Object_var aF
     myStdWidget->myPhysicalMesh->setCurrentIndex( PhysicalLocalSize );
     myStdWidget->onPhysicalMeshChanged();
   }
-  MESSAGE("mySMPMap.size() = "<<mySMPMap.size());
   return true;
 }
 
 bool BLSURFPluginGUI_HypothesisCreator::sizeMapsValidation()
 {
-  MESSAGE("BLSURFPluginGUI_HypothesisCreator::sizeMapsValidation()");
   int row = 0, nbRows = mySizeMapTable->topLevelItemCount();
   for ( ; row < nbRows; ++row )
     if (! sizeMapValidationFromRow(row))
@@ -3247,7 +3189,6 @@ bool BLSURFPluginGUI_HypothesisCreator::sizeMapsValidation()
 
 bool BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromRow(int myRow, bool displayError)
 {
-  MESSAGE("BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromRow(), row = "<<myRow);
   QString myEntry   = mySizeMapTable->topLevelItem( myRow )->data( SMP_ENTRY_COLUMN, Qt::EditRole ).toString();
   bool res = sizeMapValidationFromEntry(myEntry,displayError);
   mySizeMapTable->setFocus();
@@ -3256,28 +3197,22 @@ bool BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromRow(int myRow, bool
 
 bool BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromEntry(QString myEntry, bool displayError)
 {
-  MESSAGE("BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromEntry()");
-  MESSAGE("myEntry = "<<myEntry.toStdString())
 
   BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
 
   if (! that->mySMPMap.contains(myEntry)) {
-//     MESSAGE("Geometry with entry "<<myEntry.toStdString()<<" was not found.");
     return false;
   }
   if (! that->mySMPShapeTypeMap.contains(myEntry)) {
-//     MESSAGE("Shape type with entry "<<myEntry.toStdString()<<" was not found.");
     return false;
   }
 
   string expr;
 
   if (that->mySMPMap[myEntry].startsWith("def")) {
-//     MESSAGE("custom function" );
     expr = that->mySMPMap[myEntry].toStdString();
   }
   else if (that->mySMPMap[myEntry].startsWith("ATTRACTOR")) {
-//     MESSAGE("Attractor" );
     if ((that->mySMPMap[myEntry].count(QRegExp("^ATTRACTOR\\((?:(-?0(\\.\\d*)*|-?[1-9]+\\d*(\\.\\d*)*|-?\\.(\\d)+);){5}(True|False)(?:;(-?0(\\.\\d*)*|-?[1-9]+\\d*(\\.\\d*)*|-?\\.(\\d)+))?\\)$")) != 1)) {
 
       if (displayError)
@@ -3346,11 +3281,130 @@ bool BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromEntry(QString myEnt
 
   PyGILState_Release(gstate);
 
-//   MESSAGE("SizeMap expression "<<expr<<" is valid");
 
   return true;
 }
 
+//================================================================================
+/*!
+ * \brief SLOT: Activate selection of faces in the Viewer
+ */
+//================================================================================
+
+void BLSURFPluginGUI_HypothesisCreator::onHyPatchFaceSelection(bool on)
+{
+  if ( on && myHyPatchFaceSelector->GetMainShape().IsNull() )
+  {
+    QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
+    QString aSubEntry  = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
+    myHyPatchFaceSelector->SetGeomShapeEntry( aSubEntry, aMainEntry );
+  }
+  myHyPatchFaceSelector->setVisible( on );  // show its buttons
+  myHyPatchFaceSelector->ShowPreview( on ); // show faces in the Viewer
+  // treat selection or not
+  myHyPatchFaceSelector->ActivateSelection( on || myHyPatchGroupSelBtn->isChecked() );
+
+  if ( on )
+    myHyPatchGroupSelBtn->setChecked( false );
+}
+
+//================================================================================
+/*!
+ * \brief SLOT: Deactivate selection of faces in the Viewer
+ */
+//================================================================================
+
+void BLSURFPluginGUI_HypothesisCreator::onHyPatchGroupSelection(bool on)
+{
+  if ( on && myHyPatchFaceSelector->GetMainShape().IsNull() )
+  {
+    QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
+    QString aSubEntry  = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
+    myHyPatchFaceSelector->SetGeomShapeEntry( aSubEntry, aMainEntry );
+  }
+  if ( !myHyPatchFaceSelBtn->isChecked() )
+  {
+    myHyPatchFaceSelector->setVisible( false ); // show its buttons
+    myHyPatchFaceSelector->ShowPreview( false ); // show faces in the Viewer
+  }
+  // treat selection or not
+  myHyPatchFaceSelector->ActivateSelection( on || myHyPatchFaceSelBtn->isChecked() );
+
+  if ( on )
+    myHyPatchFaceSelBtn->setChecked( false );
+}
+
+//================================================================================
+/*!
+ * \brief SLOT: show IDs of selected faces in Tags LineEdit
+ */
+//================================================================================
+
+void BLSURFPluginGUI_HypothesisCreator::onHyPatchSelectionChanged()
+{
+  QString tagString;
+  const QList<int>& tags = myHyPatchFaceSelector->GetSelectedIDs();
+  for ( int i = 0; i < tags.size(); ++i )
+    tagString += QString::number( tags[i] ) + " ";
+
+  myHyPatchTagsLE->setText( tagString );
+}
+
+//================================================================================
+/*!
+ * \brief SLOT: Add the Tags to the HyperPatch table
+ */
+//================================================================================
+
+void BLSURFPluginGUI_HypothesisCreator::onHyPatchAdd()
+{
+  QStringList tagList = myHyPatchTagsLE->text().split(" ",  QString::SkipEmptyParts);
+  if ( tagList.size() > 1 )
+  {
+    addHyPatchToTable( myHyPatchTagsLE->text() );
+    myHyPatchTagsLE->setText("");
+  }
+}
+
+//================================================================================
+/*!
+ * \brief Add a row to myHyPatchTable
+ */
+//================================================================================
+
+void BLSURFPluginGUI_HypothesisCreator::addHyPatchToTable(const QString& tags)
+{
+  if ( tags.isEmpty() ) return;
+
+  QTableWidgetItem* cell = new QTableWidgetItem( tags );
+  cell->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled );
+
+  int row = myHyPatchTable->rowCount();
+  myHyPatchTable->insertRow( row );
+  myHyPatchTable->setItem( row, 0, cell );
+}
+
+//================================================================================
+/*!
+ * \brief SLOT: remove selected rows from the HyperPatch table
+ */
+//================================================================================
+
+void BLSURFPluginGUI_HypothesisCreator::onHyPatchRemove()
+{
+  QList<QTableWidgetItem *> items = myHyPatchTable->selectedItems();
+  while ( !items.isEmpty() )
+  {
+    myHyPatchTable->removeRow( items[0]->row() );
+    items = myHyPatchTable->selectedItems();
+  }
+}
+
+bool BLSURFPluginGUI_HypothesisCreator::hasGeom() const
+{
+  return hypType() == BLSURFPlugin_Hypothesis::GetHypType(true);
+}
+
 QString BLSURFPluginGUI_HypothesisCreator::caption() const
 {
   return tr( "BLSURF_TITLE" );
@@ -3401,7 +3455,6 @@ int BLSURFPluginGUI_HypothesisCreator::findRowFromEntry(QString entry){
     if (entry == entryForChecking )
       break;
   }
-  MESSAGE("BLSURFPluginGUI_HypothesisCreator::findRowFromEntry; row = "<<row<<" , endRow ="<<endRow)
   return row;
 }
 
index 05ea7a2251f00b66622f6341074b046c94d53604..4c5a952cdc4b7738bb0769ccb37948830e11fcc4 100644 (file)
@@ -95,6 +95,7 @@ class SMESH_NumberFilter;
 class LightApp_SelectionMgr;
 class BLSURFPluginGUI_StdWidget;
 class BLSURFPluginGUI_AdvWidget;
+class StdMeshersGUI_SubShapeSelectorWdg;
 // class DlgBlSurfHyp_Enforced;
 
 // Name
@@ -178,6 +179,7 @@ typedef struct
   TGroupNameEnfVertexListMap groupNameEnfVertexListMap;
   */
   TPreCadPeriodicityVector preCadPeriodicityVector;
+  QStringList hyperpatches;
   QString myName;
 } BlsurfHypothesisData;
 
@@ -209,10 +211,7 @@ protected slots:
   void                onStateChange();
   // Advanced tab
   void                onAddOption();
-//  void                onDeleteOption();
-//  void                onEditOption( int, int );
   void                onChangeOptionName( int, int );
-//  void                onOptionChosenInPopup( QAction* );
   // Sizemap tab
   void                onMapGeomContentModified();
   void                onSmpItemClicked( QTreeWidgetItem *, int );
@@ -225,23 +224,29 @@ protected slots:
   void                onSetSizeMap(QTreeWidgetItem *, int);
   // Enforced vertices tab
   QTreeWidgetItem*    addEnforcedFace(std::string theFaceEntry, std::string theFaceName);
-  void                addEnforcedVertex(QTreeWidgetItem * theFaceItem, double x=0, double y=0, double z=0, 
-                                        std::string vertexName = "", std::string geomEntry = "", std::string groupName = "");
+  void                addEnforcedVertex(double x=0, double y=0, double z=0, 
+                                        std::string vertexName = "",
+                                        std::string geomEntry = "",
+                                        std::string groupName = "");
   void                onAddEnforcedVertices();
   void                onRemoveEnforcedVertex();
   void                synchronizeCoords();
   void                updateEnforcedVertexValues(QTreeWidgetItem* , int );
   void                onSelectEnforcedVertex();
-//   void                deactivateSelection(QWidget*, QWidget*);
   void                clearEnforcedVertexWidgets();
   void                onInternalVerticesClicked(int);
   // Periodicity tab
   void                onPeriodicityByVerticesChecked(bool);
-//  void                onPeriodicityRadioButtonChanged();
   void                onAddPeriodicity();
   void                onRemovePeriodicity();
   void                onPeriodicityTreeClicked(QTreeWidgetItem*, int);
   void                onPeriodicityContentModified();
+  // HyperPatch tab
+  void                onHyPatchFaceSelection(bool);
+  void                onHyPatchGroupSelection(bool);
+  void                onHyPatchSelectionChanged();
+  void                onHyPatchAdd();
+  void                onHyPatchRemove();
 
 private:
   bool                readParamsFromHypo( BlsurfHypothesisData& ) const;
@@ -252,7 +257,6 @@ private:
   bool                sizeMapValidationFromEntry(QString,bool displayError = true);
   GeomSelectionTools* getGeomSelectionTool() const;
   GEOM::GEOM_Gen_var  getGeomEngine();
-  //void                insertElementType( TopAbs_ShapeEnum );
   bool                insertElement( GEOM::GEOM_Object_var, bool modify = false );
   bool                insertAttractor(GEOM::GEOM_Object_var, GEOM::GEOM_Object_var, bool modify = false);
   int                 findRowFromEntry(QString entry);
@@ -260,6 +264,8 @@ private:
   static LightApp_SelectionMgr* selectionMgr();
   void                avoidSimultaneousSelection(ListOfWidgets &myCustomWidgets) const;
   void                AddPreCadSequenceToVector(BlsurfHypothesisData& h_data, BLSURFPlugin::TPeriodicityList_var preCadFacePeriodicityVector, bool onFace) const;
+  void                addHyPatchToTable(const QString& tags);
+  bool                hasGeom() const;
 
 private:
   
@@ -305,21 +311,17 @@ private:
   
   
   QWidget*            myEnfGroup;
-//    TODO FACE AND VERTEX SELECTION
   StdMeshersGUI_ObjectReferenceParamWdg *myEnfFaceWdg;
   GEOM::GEOM_Object_var myEnfFace;
   StdMeshersGUI_ObjectReferenceParamWdg *myEnfVertexWdg;
   GEOM::GEOM_Object_var myEnfVertex;
 
-//   DlgBlSurfHyp_Enforced* myEnforcedVertexWidget;
   QTreeWidget*        myEnforcedTreeWidget;
   SMESHGUI_SpinBox*   myXCoord;
   SMESHGUI_SpinBox*   myYCoord;
   SMESHGUI_SpinBox*   myZCoord;
 
   QLineEdit*          myGroupName;
-//   QGroupBox*          makeGroupsCheck;
-//   QCheckBox*          myGlobalGroupName;
 
   QPushButton*        addVertexButton;
   QPushButton*        removeVertexButton;
@@ -330,41 +332,37 @@ private:
   // map =  entry , size map
   QMap<QString, QString>          mySMPMap;           // Map <face entry, size>
   QMap<QString, TAttractorVec >   myATTMap;           // Map <face entry, att. entry, etc>
-  // QMap<QString, double>           myDistMap;          // Map <entry,distance with constant size> 
-  // QMap<QString, double>           myAttDistMap;       // Map <entry, influence distance> 
   QMap<QString, TopAbs_ShapeEnum> mySMPShapeTypeMap;
   GeomSelectionTools*             GeomToolSelected;
   LightApp_SelectionMgr*          aSel;
 
   // Periodicity
-  QWidget* myPeriodicityGroup;
-  QSplitter* myPeriodicitySplitter;
-  QTreeWidget* myPeriodicityTreeWidget;
-  QWidget* myPeriodicityRightWidget;
-  QGridLayout* myPeriodicityRightGridLayout;
-  QGroupBox* myPeriodicityGroupBox1;
-  QGroupBox* myPeriodicityGroupBox2;
+  QWidget*      myPeriodicityGroup;
+  QSplitter*    myPeriodicitySplitter;
+  QTreeWidget*  myPeriodicityTreeWidget;
+  QWidget*      myPeriodicityRightWidget;
+  QGridLayout*  myPeriodicityRightGridLayout;
+  QGroupBox*    myPeriodicityGroupBox1;
+  QGroupBox*    myPeriodicityGroupBox2;
   QGridLayout* aPeriodicityLayout1;
-  QGridLayout* myPeriodicityGroupBox1Layout;
-  QGridLayout* myPeriodicityGroupBox2Layout;
+  QGridLayout*  myPeriodicityGroupBox1Layout;
+  QGridLayout*  myPeriodicityGroupBox2Layout;
   QRadioButton* myPeriodicityOnFaceRadioButton;
   QRadioButton* myPeriodicityOnEdgeRadioButton;
-  QLabel* myPeriodicityMainSourceLabel;
-  QLabel* myPeriodicityMainTargetLabel;
-  QLabel* myPeriodicitySourceLabel;
-  QLabel* myPeriodicityTargetLabel;
+  QLabel*       myPeriodicityMainSourceLabel;
+  QLabel*       myPeriodicityMainTargetLabel;
+  QLabel*       myPeriodicitySourceLabel;
+  QLabel*       myPeriodicityTargetLabel;
   StdMeshersGUI_ObjectReferenceParamWdg* myPeriodicitySourceFaceWdg;
-//  StdMeshersGUI_ObjectReferenceParamWdg* myPeriodicitySourceEdgeWdg;
   GEOM::GEOM_Object_var myPeriodicityFace;
   StdMeshersGUI_ObjectReferenceParamWdg* myPeriodicityTargetFaceWdg;
-//  StdMeshersGUI_ObjectReferenceParamWdg* myPeriodicityTargetEdgeWdg;
   GEOM::GEOM_Object_var myPeriodicityEdge;
-  QLabel* myPeriodicityP1SourceLabel;
-  QLabel* myPeriodicityP2SourceLabel;
-  QLabel* myPeriodicityP3SourceLabel;
-  QLabel* myPeriodicityP1TargetLabel;
-  QLabel* myPeriodicityP2TargetLabel;
-  QLabel* myPeriodicityP3TargetLabel;
+  QLabel*       myPeriodicityP1SourceLabel;
+  QLabel*       myPeriodicityP2SourceLabel;
+  QLabel*       myPeriodicityP3SourceLabel;
+  QLabel*       myPeriodicityP1TargetLabel;
+  QLabel*       myPeriodicityP2TargetLabel;
+  QLabel*       myPeriodicityP3TargetLabel;
   StdMeshersGUI_ObjectReferenceParamWdg* myPeriodicityP1SourceWdg;
   StdMeshersGUI_ObjectReferenceParamWdg* myPeriodicityP2SourceWdg;
   StdMeshersGUI_ObjectReferenceParamWdg* myPeriodicityP3SourceWdg;
@@ -372,9 +370,15 @@ private:
   StdMeshersGUI_ObjectReferenceParamWdg* myPeriodicityP2TargetWdg;
   StdMeshersGUI_ObjectReferenceParamWdg* myPeriodicityP3TargetWdg;
   ListOfWidgets myPeriodicitySelectionWidgets;
-  QPushButton* myPeriodicityAddButton;
-  QPushButton* myPeriodicityRemoveButton;
-  QSpacerItem* myPeriodicityVerticalSpacer;
+  QPushButton*  myPeriodicityAddButton;
+  QPushButton*  myPeriodicityRemoveButton;
+  QSpacerItem*  myPeriodicityVerticalSpacer;
+
+  QTableWidget*                      myHyPatchTable;
+  StdMeshersGUI_SubShapeSelectorWdg* myHyPatchFaceSelector;
+  QLineEdit*                         myHyPatchTagsLE;
+  QPushButton*                       myHyPatchFaceSelBtn;
+  QPushButton*                       myHyPatchGroupSelBtn;
 
   BLSURFPlugin::string_array_var myOptions, myPreCADOptions, myCustomOptions;
 
diff --git a/src/GUI/BLSURFPluginGUI_TreeWidget.cxx b/src/GUI/BLSURFPluginGUI_TreeWidget.cxx
new file mode 100644 (file)
index 0000000..ed121c6
--- /dev/null
@@ -0,0 +1,91 @@
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "BLSURFPluginGUI_TreeWidget.h"
+#include <QKeyEvent>
+
+namespace
+{
+  bool isEditable( const QModelIndex& index )
+  {
+    return index.isValid() &&
+      index.flags() & Qt::ItemIsEditable && 
+      index.flags() & Qt::ItemIsEnabled &&
+      ( !index.data( Qt::UserRole + 1 ).isValid() || index.data( Qt::UserRole + 1 ).toInt() != 0 );
+  }
+}
+
+BLSURFPluginGUI_TreeWidget::BLSURFPluginGUI_TreeWidget( QWidget* parent )
+  : QTreeWidget( parent )
+{
+}
+
+QModelIndex BLSURFPluginGUI_TreeWidget::moveCursor( CursorAction action, Qt::KeyboardModifiers modifiers )
+{
+  QModelIndex current = currentIndex();
+  int column = current.column();
+  if ( action == MoveNext ) {
+    if ( column < columnCount()-1 ) {
+      QModelIndex next = current.sibling( current.row(), column+1 );
+      if ( isEditable( next ) )
+        return next;
+    }
+    else {
+      QModelIndex next = current.sibling( current.row()+1, 0 );
+      if ( isEditable( next ) )
+        return next;
+    }
+  }
+  else if ( action == MovePrevious ) {
+    if ( column == 0 ) {
+      QModelIndex next = current.sibling( current.row()-1, columnCount()-1 );
+      if ( isEditable( next ) )
+        return next;
+    }
+    else {
+      QModelIndex next = current.sibling( current.row(), column-1 );
+      if ( isEditable( next ) )
+        return next;
+    }
+  }
+  return QTreeWidget::moveCursor( action, modifiers );
+}
+
+void BLSURFPluginGUI_TreeWidget::keyPressEvent( QKeyEvent* e )
+{
+  switch ( e->key() ) {
+  case Qt::Key_F2:
+    {
+      QModelIndex index = currentIndex();
+      if ( !isEditable( index ) ) {
+        for ( int i = 0; i < columnCount(); i++ ) {
+          QModelIndex sibling = index.sibling( index.row(), i );
+          if ( isEditable( sibling ) ) {
+            if ( !edit( sibling, EditKeyPressed, e ) )
+              e->ignore();
+          }
+        }
+      }
+    }
+    break;
+  default:
+    break;
+  }
+  QTreeWidget::keyPressEvent( e );
+}
diff --git a/src/GUI/BLSURFPluginGUI_TreeWidget.h b/src/GUI/BLSURFPluginGUI_TreeWidget.h
new file mode 100644 (file)
index 0000000..7581cb1
--- /dev/null
@@ -0,0 +1,36 @@
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#if !defined(BLSURFPluginGUI_TreeWidget_H)
+#define BLSURFPluginGUI_TreeWidget_H
+
+#include <QTreeWidget>
+
+class BLSURFPluginGUI_TreeWidget : public QTreeWidget
+{
+  Q_OBJECT
+public:
+  BLSURFPluginGUI_TreeWidget( QWidget* );
+
+protected:
+  QModelIndex moveCursor( CursorAction, Qt::KeyboardModifiers );
+  void keyPressEvent( QKeyEvent* );
+};
+
+#endif // BLSURFPluginGUI_TreeWidget_H
index db5c9a54aca3ee2fe82f816e165db06fd58e7a20..c50124dd4aae0198e06e8386137fc0f0f59cfaa3 100644 (file)
             <source>ICON_SMESH_TREE_HYPO_MG-CADSurf Parameters</source>
             <translation>mesh_tree_hypo_BLSURF.png</translation>
         </message>
+        <message>
+            <source>ICON_SMESH_TREE_ALGO_BLSURF</source>
+            <translation>mesh_tree_algo_BLSURF.png</translation>
+        </message>
+        <message>
+            <source>ICON_SMESH_TREE_HYPO_BLSURF_Parameters</source>
+            <translation>mesh_tree_hypo_BLSURF.png</translation>
+        </message>
+        <message>
+            <source>ICON_SMESH_TREE_ALGO_MG-CADSurf_NOGEOM</source>
+            <translation>mesh_tree_algo_BLSURF.png</translation>
+        </message>
+        <message>
+            <source>ICON_SMESH_TREE_HYPO_MG-CADSurf Parameters_NOGEOM</source>
+            <translation>mesh_tree_hypo_BLSURF.png</translation>
+        </message>
     </context>
 </TS>
index 5cda76bc76061cb73cd08d29f7552ff7dbb2e17c..6162398a4d906d4e71e2838ad282a0dc590f789e 100644 (file)
@@ -287,7 +287,7 @@ The smaller this distance is, the closer the mesh is to the exact surface (only
         <translation>Merge edges</translation>
     </message>
     <message>
-        <source>BLSURF_PRECAD_REMOVE_TINY_UV_EDGES</source>
+        <source>remove_tiny_uv_edges</source>
         <translation>Remove tiny UV edges</translation>
     </message>
     <message>
@@ -594,6 +594,26 @@ The smaller this distance is, the closer the mesh is to the exact surface (only
         <source>BLSURF_PERIODICITY_SELECT_EDGE</source>
         <translation>Edge</translation>
     </message>
+    <message>
+        <source>BLSURF_HYPATCH_TBL_HEADER</source>
+        <translation>Hyper-patch IDs</translation>
+    </message>
+    <message>
+        <source>BLSURF_HYPATCH_SEL_FACE</source>
+        <translation>Face selection</translation>
+    </message>
+    <message>
+        <source>BLSURF_HYPATCH_SEL_GROUP</source>
+        <translation>Group selection</translation>
+    </message>
+    <message>
+        <source>BLSURF_TAGS</source>
+        <translation>IDs</translation>
+    </message>
+    <message>
+        <source>BLSURF_HYPERPATCH_TAB</source>
+        <translation>Hyper-patch</translation>
+    </message>
 </context>
 <context>
     <name>BLSURFPluginGUI_AdvWidget</name>
@@ -609,10 +629,18 @@ The smaller this distance is, the closer the mesh is to the exact surface (only
         <source>max_number_of_points_per_patch</source>
         <translation>Maximal number of points per patch</translation>
     </message>
+    <message>
+        <source>max_number_of_threads</source>
+        <translation>Maximal number of threads</translation>
+    </message>
     <message>
         <source>rectify_jacobian</source>
         <translation>Rectify Jacobian</translation>
     </message>
+    <message>
+        <source>use_deprecated_patch_mesher</source>
+        <translation>use deprecated patch mesher</translation>
+    </message>
     <message>
         <source>respect_geometry</source>
         <translation>Respect geometry</translation>
@@ -661,9 +689,5 @@ The smaller this distance is, the closer the mesh is to the exact surface (only
         <source>tags</source>
         <translation>Tags</translation>
     </message>
-    <message>
-        <source></source>
-        <translation></translation>
-    </message>
 </context> 
 </TS>
index b28d916c69892086da1ec544ff65f2f6bb40431c..56d7efd6e1d0da17feac4ea60d0904c9504a1c49 100755 (executable)
@@ -291,7 +291,7 @@ Plus la distance est petite, plus le maillage sera proche de la surface (disponi
         <translation>Fusionner des arêtes</translation>
     </message>
     <message>
-        <source>BLSURF_PRECAD_REMOVE_TINY_UV_EDGES</source>
+        <source>remove_tiny_uv_edges</source>
         <translation>Supprime les petites arêtes UV</translation>
     </message>
     <message>
@@ -594,6 +594,26 @@ Plus la distance est petite, plus le maillage sera proche de la surface (disponi
         <source>BLSURF_PERIODICITY_SELECT_EDGE</source>
         <translation>Arête</translation>
     </message>
+    <message>
+        <source>BLSURF_HYPATCH_TBL_HEADER</source>
+        <translation>IDs de l'hyper-patch</translation>
+    </message>
+    <message>
+        <source>BLSURF_HYPATCH_SEL_FACE</source>
+        <translation>Faces</translation>
+    </message>
+    <message>
+        <source>BLSURF_HYPATCH_SEL_GROUP</source>
+        <translation>Groupes</translation>
+    </message>
+    <message>
+        <source>BLSURF_TAGS</source>
+        <translation>IDs</translation>
+    </message>
+    <message>
+        <source>BLSURF_HYPERPATCH_TAB</source>
+        <translation>Hyper-patch</translation>
+    </message>
 </context>
 <context>
     <name>BLSURFPluginGUI_AdvWidget</name>
@@ -609,10 +629,18 @@ Plus la distance est petite, plus le maillage sera proche de la surface (disponi
         <source>max_number_of_points_per_patch</source>
         <translation>Nombre de points maximal par patch</translation>
     </message>
+    <message>
+        <source>max_number_of_threads</source>
+        <translation>Nombre de threads maximal</translation>
+    </message>
     <message>
         <source>rectify_jacobian</source>
         <translation>Ajustement du Jacobien</translation>
     </message>
+    <message>
+        <source>use_deprecated_patch_mesher</source>
+        <translation>use deprecated patch mesher</translation>
+    </message>
     <message>
         <source>respect_geometry</source>
         <translation>Respect de la géométrie</translation>
index 22ae66990679bf852f511bb63840a18c9c18c0d2..1e0eb84bc1e2ef2476ac5c4763fdcefd47dfb779 100644 (file)
       <translation>エッジをマージします。</translation>
     </message>
     <message>
-      <source>BLSURF_PRECAD_REMOVE_TINY_UV_EDGES</source>
-      <translation>微小UVエッジの削除</translation>
+      <source>remove_tiny_uv_edges</source>
+      <translation>微小なuvエッジの削除</translation>
     </message>
     <message>
       <source>BLSURF_PRECAD_REMOVE_DUPLICATE_CAD_FACES</source>
       <source>BLSURF_PERIODICITY_SELECT_EDGE</source>
       <translation>Edge</translation>
     </message>
+    <message>
+      <source>BLSURF_HYPATCH_TBL_HEADER</source>
+      <translation>Hyper-patch ID</translation>
+    </message>
+    <message>
+      <source>BLSURF_HYPATCH_SEL_FACE</source>
+      <translation>面選択</translation>
+    </message>
+    <message>
+      <source>BLSURF_HYPATCH_SEL_GROUP</source>
+      <translation>グループ選択</translation>
+    </message>
+    <message>
+      <source>BLSURF_TAGS</source>
+      <translation>ID</translation>
+    </message>
+    <message>
+      <source>BLSURF_HYPERPATCH_TAB</source>
+      <translation>Hyper-patch</translation>
+    </message>
   </context>
   <context>
     <name>BLSURFPluginGUI_AdvWidget</name>
       <source>max_number_of_points_per_patch</source>
       <translation>1パッチの最大点数</translation>
     </message>
+    <message>
+      <source>max_number_of_threads</source>
+      <translation type="unfinished">Maximal number of threads</translation>
+    </message>
     <message>
       <source>rectify_jacobian</source>
       <translation>ヤコビアンの修正</translation>
     </message>
+    <message>
+        <source>use_deprecated_patch_mesher</source>
+        <translation>use deprecated patch mesher</translation>
+    </message>
     <message>
       <source>respect_geometry</source>
       <translation>ジオメトリの尊重</translation>
       <source>tags</source>
       <translation>タグ</translation>
     </message>
-    <message>
-      <source/>
-      <translation type="unfinished"/>
-    </message>
   </context>
 </TS>
index b42d57eef2141b3c611f1c3aa030748443f3fdfb..4a13b7de9825dcfffa411acd0be0297603486ed2 100644 (file)
@@ -36,6 +36,7 @@ INCLUDE_DIRECTORIES(
   ${CMAKE_CURRENT_BINARY_DIR}
   ${PROJECT_BINARY_DIR}/idl
   ${PROJECT_SOURCE_DIR}/src/BLSURFPlugin
+  ${PROJECT_SOURCE_DIR}/src/GUI
 )
 
 # additional preprocessor / compiler flags
@@ -73,6 +74,7 @@ SET(_link_LIBRARIES
 SET(BLSURFPluginGUI_HEADERS
   BLSURFPluginGUI_HypothesisCreator.h
   BLSURFPluginGUI_Dlg.h
+  BLSURFPluginGUI_TreeWidget.h
 )
 
 # --- sources ---
@@ -86,6 +88,7 @@ SET(_other_SOURCES
   BLSURFPluginGUI_StdWidget.cxx
   BLSURFPluginGUI_AdvWidget.cxx
   BLSURFPluginGUI_HypothesisCreator.cxx
+  BLSURFPluginGUI_TreeWidget.cxx
 )
 
 # --- resources ---
index b663c637da3e12d26cbd017ff870c9d15282bb41..07dec0091c8f7dd487c6f1567e050e4e2b6031cf 100755 (executable)
@@ -18,6 +18,7 @@
 #
 
 SET(BLSURFPLUGIN_TEST_FILES
+  test_cadsurf_multithread.py
   test_enforced_internal_vertex.py
   test_enforced_vertex.py
   test_periodicity_2D_precad.py
diff --git a/tests/test_cadsurf_multithread.py b/tests/test_cadsurf_multithread.py
new file mode 100644 (file)
index 0000000..62e8f0a
--- /dev/null
@@ -0,0 +1,83 @@
+# -*- coding: utf-8 -*-
+
+import os
+import sys
+import salome
+import time
+
+salome.salome_init()
+theStudy = salome.myStudy
+
+###
+### GEOM component
+###
+
+import GEOM
+from salome.geom import geomBuilder
+import math
+import SALOMEDS
+
+
+geompy = geomBuilder.New(theStudy)
+
+O = geompy.MakeVertex(0, 0, 0)
+OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
+OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
+OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
+flight_solid_brep_1 = geompy.ImportBREP(os.path.join(os.getenv("DATA_DIR"),"Shapes/Brep/flight_solid.brep" ))
+geompy.addToStudy( O, 'O' )
+geompy.addToStudy( OX, 'OX' )
+geompy.addToStudy( OY, 'OY' )
+geompy.addToStudy( OZ, 'OZ' )
+geompy.addToStudy( flight_solid_brep_1, 'flight_solid.brep_1' )
+
+###
+### SMESH component
+###
+
+import  SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+
+smesh = smeshBuilder.New(theStudy)
+
+Mesh_1 = smesh.Mesh(flight_solid_brep_1)
+MG_CADSurf = Mesh_1.Triangle(algo=smeshBuilder.MG_CADSurf)
+MG_CADSurf_Parameters_1 = MG_CADSurf.Parameters()
+MG_CADSurf_Parameters_1.SetPhySize( 1 )
+MG_CADSurf_Parameters_1.SetMaxSize( 1 )
+MG_CADSurf_Parameters_1.SetGradation( 1.05 )
+MG_CADSurf_Parameters_1.SetAngleMesh( 1 )
+MG_CADSurf_Parameters_1.SetChordalError( 2.40018 )
+# 4 procs are used by default
+# => No need to set an option
+
+time0 = time.time()
+isDone = Mesh_1.Compute()
+time1 = time.time()
+
+time_multithread = time1-time0
+
+print "Time in 4 proc: %.3s"%(time_multithread)
+
+Mesh_2 = smesh.Mesh(flight_solid_brep_1)
+MG_CADSurf = Mesh_2.Triangle(algo=smeshBuilder.MG_CADSurf)
+MG_CADSurf_Parameters_2 = MG_CADSurf.Parameters()
+MG_CADSurf_Parameters_2.SetPhySize( 1 )
+MG_CADSurf_Parameters_2.SetMaxSize( 1 )
+MG_CADSurf_Parameters_2.SetGradation( 1.05 )
+MG_CADSurf_Parameters_2.SetAngleMesh( 1 )
+MG_CADSurf_Parameters_2.SetChordalError( 2.40018 )
+# Use only one thread
+MG_CADSurf_Parameters_2.SetMaxNumberOfThreads( 1 )
+
+time2 = time.time()
+isDone = Mesh_2.Compute()
+time3 = time.time()
+
+time_singlethread = time3-time2
+print "Time in 1 proc: %.3s"%(time_singlethread)
+
+assert time_multithread < time_singlethread/2.
+
+if salome.sg.hasDesktop():
+  salome.sg.updateObjBrowser(True)
index 395c75a99a76793b15912767fddb1657d9a53ef9..1f5470b8fdaa11c915afe77a1e72abe9dde0e5de 100644 (file)
@@ -7,8 +7,6 @@ import GEOM
 from salome.geom import geomBuilder
 geompy = geomBuilder.New()
 
-r = 10
-dist = 10
 dist_coin = 10.1
 
 p1 = geompy.MakeVertex(0., 0., 0.)
@@ -22,6 +20,21 @@ geompy.addToStudy(p3, "p3")
 left = geompy.GetFaceNearPoint(box, p3)
 geompy.addToStudyInFather(box, left, "left")
 
+allEnforcedCoords = []
+allEnforcedCoords.append(( dist_coin, 0, dist_coin ))
+allEnforcedCoords.append(( 20, 0, 15.3 ))
+allEnforcedCoords.append(( 25, 1, 25.3 ))
+allEnforcedCoords.append(( 35, 1, 45.3 ))
+allEnforcedCoords.append(( 35, 1, 55.3 ))
+
+p4 = geompy.MakeVertex( *(allEnforcedCoords[1] ))
+p5 = geompy.MakeVertex( *(allEnforcedCoords[2] ))
+pp = geompy.MakeCompound( [p4,p5], theName="p4,p5" )
+p6 = geompy.MakeVertex( *(allEnforcedCoords[3] ), theName="p6")
+p7 = geompy.MakeVertex( *(allEnforcedCoords[4] ), theName="p7")
+
+xyz7 = allEnforcedCoords[4]
+
 # Mesh
 # ====
 
@@ -38,14 +51,21 @@ algo2d.SetAngleMesh( 4 )
 algo2d.SetPhySize( 8 )
 
 algo2d.SetEnforcedVertex(left, dist_coin, 0, dist_coin)
+algo2d.AddEnforcedVertexGeom( pp )
+algo2d.AddEnforcedVertexGeom( p6 )
+algo2d.AddEnforcedVertex( *xyz7 )
 
-Mesh.Compute()
+assert Mesh.Compute()
+assert not Mesh.FindCoincidentNodes( 1e-7 )
 
-id_node = Mesh.FindNodeClosestTo(dist_coin, 0, dist_coin)
+for x,y,z in allEnforcedCoords:
 
-x, y, z = Mesh.GetNodeXYZ(id_node)
+    id_node = Mesh.FindNodeClosestTo( x,y,z )
+    xn, yn, zn = Mesh.GetNodeXYZ( id_node )
 
-assert("%.2f, %.2f, %.2f"%(x, y, z) == "%.2f, %.2f, %.2f"%(dist_coin, 0, dist_coin))
+    # compare X and Z
+    assert "%.2f, %.2f"%(x, z) == "%.2f, %.2f"%( xn, zn ), \
+        "%.2f, %.2f, %.2f != %.2f, %.2f, %.2f"%( xn, yn, zn, x,y,z )
 
 
 salome.sg.updateObjBrowser()
index 7c135089e7a7e97d8c02ac0305fb4ef1a6a4e995..080594950a7ec55ad539760a69858d1bc8a5469f 100644 (file)
@@ -48,6 +48,7 @@ BLSURF_Parameters = BLSURF_1.Parameters()
 BLSURF_Parameters.SetPhySize( 5 )
 BLSURF_Parameters.SetPreCADMergeEdges( True )
 BLSURF_Parameters.SetPreCADProcess3DTopology( True )
+BLSURF_Parameters.SetPreCADOptionValue( 'remove_tiny_uv_edges', 'yes' )
 
 Mesh_1.Compute()
 
index bb8c9a2ac332bbd43533f8bf1f7097b624a14d1c..a1d8a976f8102721c3d17423c60fad41b828d889 100644 (file)
@@ -8,7 +8,7 @@ geompy = geomBuilder.New()
 
 import math
 
-area_tolerance = 1e-2
+area_tolerance = 0.1
 nb_faces_tolerance = 20
 
 ## Return the min and max areas of a mesh