Salome HOME
correction for bug #23439: add use_deprecated_patch_mesher parameter to allow the...
authorPaul RASCLE <paul.rascle@edf.fr>
Thu, 4 May 2017 09:52:23 +0000 (11:52 +0200)
committerPaul RASCLE <paul.rascle@edf.fr>
Thu, 4 May 2017 09:52:23 +0000 (11:52 +0200)
idl/BLSURFPlugin_Algorithm.idl
src/BLSURFPlugin/BLSURFPluginBuilder.py
src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx
src/GUI/BLSURFPlugin_msg_en.ts
src/GUI/BLSURFPlugin_msg_fr.ts
src/GUI/BLSURFPlugin_msg_ja.ts

index 141982f352e57f2a8264ef0fdb289ec0c316b168..671fd60ffd2e7b6178641046211cc8341289fbb9 100644 (file)
@@ -343,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
      * 
index af4e99d7f139edaf2f92aa711c5a5906fc7831c2..4548fa314698a9d019fc9cb19dd95c144cf1d3ce 100644 (file)
@@ -234,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
index 0300bdd4a5cc4381e8f987bbd7df6a55cd803701..d567f50e71685b858392aa3753db1bac50046bed 100644 (file)
@@ -116,6 +116,7 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_G
                                             // "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
       };
@@ -209,8 +210,10 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_G
   _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["use_deprecated_patch_mesher"            ] = "no";
   _defaultOptionValues["debug"                                  ] = "no";
   if ( hasgeom )
   {
@@ -538,6 +541,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)
 {
index 1ed967509cced5dac13ff85be47495ffa52197f7..1531872641aeb3787c63124c492b9ce55a03f6c9 100644 (file)
@@ -157,6 +157,9 @@ public:
   void SetJacobianRectificationRespectGeometry( bool allowRectification );
   bool GetJacobianRectificationRespectGeometry();
     
+  void SetUseDeprecatedPatchMesher( bool useDeprecatedPatchMesher );
+  bool GetUseDeprecatedPatchMesher();
+
   void SetJacobianRectification( bool allowRectification );
   bool GetJacobianRectification();
 
index b8c667791af542d4a017701d079c014984ee08e4..3eef21beb1a39d0645e4ab3597ea7d89027e6f7a 100644 (file)
@@ -832,6 +832,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 )
@@ -1221,6 +1236,9 @@ void BLSURFPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const cha
     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 ));
 
index 6a55caa6fbb9e138f357a1e8af09adf0b8add43a..aceec48f0f89a4c00e7bce4f55afe3797fc17358 100644 (file)
@@ -138,6 +138,9 @@ 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();
 
index a866bd44436f473df5c9fc16f9328f4f54997df7..6162398a4d906d4e71e2838ad282a0dc590f789e 100644 (file)
@@ -637,6 +637,10 @@ The smaller this distance is, the closer the mesh is to the exact surface (only
         <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>
index 259cd865f945076c030af8e4c2deec9c463e7b11..56d7efd6e1d0da17feac4ea60d0904c9504a1c49 100755 (executable)
@@ -637,6 +637,10 @@ Plus la distance est petite, plus le maillage sera proche de la surface (disponi
         <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 96534dd5317050158d1ace4cde26852002ddc581..1e0eb84bc1e2ef2476ac5c4763fdcefd47dfb779 100644 (file)
       <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>