Salome HOME
Fix the option remove_tiny_uv_edges to use the new advanced options mechanism cbr/change_remove_tiny_uv_edges_to_use_new_avdanced_options_mechanism
authorChristophe Bourcier <christophe.bourcier@cea.fr>
Fri, 18 Nov 2016 13:25:15 +0000 (14:25 +0100)
committerChristophe Bourcier <christophe.bourcier@cea.fr>
Fri, 18 Nov 2016 13:25:15 +0000 (14:25 +0100)
The option remove_tiny_uv_edges was introduced in cbr/CEA_1537_remove_deprecated_precad as an advanced option but was lost during the merge in master.
This option is needed to completely disable preprocessing of the CAD.

idl/BLSURFPlugin_Algorithm.idl
src/BLSURFPlugin/BLSURFPluginBuilder.py
src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx
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
tests/test_precad_intersections.py

index 1296ba19e9f3fcfff4eef6624e38a20f9a066a87..545282aee6ebfc91b702cb8c3d49413a837b9a69 100644 (file)
@@ -446,12 +446,6 @@ module BLSURFPlugin
     void SetPreCADMergeEdges(in boolean toMergeEdges);
     boolean GetPreCADMergeEdges();
 
-    /*!
-     * To remove tiny UV edges edges.
-     */
-    void SetPreCADRemoveTinyUVEdges(in boolean toRemoveTinyUVEdges);
-    boolean GetPreCADRemoveTinyUVEdges();
-
     /*!
      * To remove duplicate CAD faces.
      */
index 9fd78e96357fee5b910da555a083e5b7ce1be3fb..369a94f6df154d996c67cd742cd29ce18f122704 100644 (file)
@@ -347,12 +347,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):
index 8a91ab3ecf2c4871ca4d9457f84266aaa3f16e2c..5a2acd99018fe3ac079d88605e39e58977ac171d 100644 (file)
@@ -915,7 +915,6 @@ 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();
@@ -971,7 +970,6 @@ 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();
@@ -1002,7 +1000,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");
index ca91973b53556a07e2365c4b3eeb2863b527f22e..4048437af099027795a3c30e5f8b1c06efe32a24 100644 (file)
@@ -81,7 +81,6 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_G
   _verb(GetDefaultVerbosity()),
   _topology(GetDefaultTopology()),
   _preCADMergeEdges(GetDefaultPreCADMergeEdges()),
-  _preCADRemoveTinyUVEdges(GetDefaultPreCADRemoveTinyUVEdges()),
   _preCADRemoveDuplicateCADFaces(GetDefaultPreCADRemoveDuplicateCADFaces()),
   _preCADProcess3DTopology(GetDefaultPreCADProcess3DTopology()),
   _preCADDiscardInput(GetDefaultPreCADDiscardInput()),
@@ -143,6 +142,9 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_G
                                             "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
@@ -208,6 +210,7 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_G
   _defaultOptionValues["respect_geometry"                       ] = "yes";
   _defaultOptionValues["tiny_edge_avoid_surface_intersections"  ] = "yes";
   _defaultOptionValues["process_3d_topology"                    ] = "no";
+  _defaultOptionValues["remove_tiny_uv_edges"                   ] = "no";
   _defaultOptionValues["closed_geometry"                        ] = "no";
   _defaultOptionValues["debug"                                  ] = "no";
   _defaultOptionValues["discard_input_topology"                 ] = "no";
@@ -765,15 +768,6 @@ void BLSURFPlugin_Hypothesis::SetPreCADMergeEdges(bool theVal)
   }
 }
 
-//=============================================================================
-void BLSURFPlugin_Hypothesis::SetPreCADRemoveTinyUVEdges(bool theVal)
-{
-  if (theVal != _preCADRemoveTinyUVEdges) {
-    _preCADRemoveTinyUVEdges = theVal;
-    NotifySubMeshesHypothesisModification();
-  }
-}
-
 //=============================================================================
 void BLSURFPlugin_Hypothesis::SetPreCADRemoveDuplicateCADFaces(bool theVal)
 {
@@ -1901,7 +1895,7 @@ std::ostream & BLSURFPlugin_Hypothesis::SaveTo(std::ostream & save)
   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;
@@ -2445,12 +2439,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;
index 18ffa41dd31257b29ae5445da38b457d0ae81831..bcf1e84024035119c24e7c1fa40057ef8a86d49b 100644 (file)
@@ -197,9 +197,6 @@ public:
   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; }
 
@@ -445,7 +442,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; }
@@ -583,7 +579,6 @@ private:
   Topology        _topology;
   
   bool            _preCADMergeEdges;
-  bool            _preCADRemoveTinyUVEdges;
   bool            _preCADRemoveDuplicateCADFaces;
   bool            _preCADProcess3DTopology;
   bool            _preCADDiscardInput;
index 3db9133b7eb91c6c58b98636370a9448ea744399..16a34586f56aaca1e2147e44ee1b06d1701e0be7 100644 (file)
@@ -1132,34 +1132,6 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges() {
   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
@@ -1397,9 +1369,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 ));
 
index ad283c949f89514d3732074a90ca2f4936d883e3..50b68061646d9ca8a28f7d3442469db58752c8e2 100644 (file)
@@ -169,9 +169,6 @@ public:
   void SetPreCADMergeEdges(CORBA::Boolean theValue);
   CORBA::Boolean GetPreCADMergeEdges();
 
-  void SetPreCADRemoveTinyUVEdges(CORBA::Boolean theValue);
-  CORBA::Boolean GetPreCADRemoveTinyUVEdges();
-
   void SetPreCADRemoveDuplicateCADFaces(CORBA::Boolean theValue);
   CORBA::Boolean GetPreCADRemoveDuplicateCADFaces();
 
index 80948d7a6b3cab5eb4d2b347ecaa694a88d65212..caa0fa060fb1baf60cef9755a1c9e46707d8ae1b 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>
index b28d916c69892086da1ec544ff65f2f6bb40431c..ffa22d467def2871d07e0a0dc24e9b7b02b1fb37 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>
index 22ae66990679bf852f511bb63840a18c9c18c0d2..95b0a4c5787d7c9a7c03c8d2822ffaa70aee669d 100644 (file)
       <translation>エッジをマージします。</translation>
     </message>
     <message>
-      <source>BLSURF_PRECAD_REMOVE_TINY_UV_EDGES</source>
+      <source>remove_tiny_uv_edges</source>
       <translation>微小UVエッジの削除</translation>
     </message>
     <message>
index 0602459c7ec36dcfdef27d42bc5708bb4cdbcece..47eef3df6b88b55a976134b9d180e26afb331178 100644 (file)
@@ -49,6 +49,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()