Salome HOME
#18963 Minimize compiler warnings
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_Hypothesis.cxx
index 4748b1fcd19d7196c605c26d96c40c7a483d0c26..8c58e3b360a24a81bda87c923ba6d937d96f0939 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2020  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -642,8 +642,8 @@ istream & NETGENPlugin_Hypothesis::LoadFrom(istream & load)
  * \retval bool - always false
  */
 //================================================================================
-bool NETGENPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh*   theMesh,
-                                                  const TopoDS_Shape& theShape)
+bool NETGENPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh*   /*theMesh*/,
+                                                  const TopoDS_Shape& /*theShape*/)
 {
   return false;
 }
@@ -666,5 +666,14 @@ bool NETGENPlugin_Hypothesis::SetParametersByDefaults(const TDefaults&  dflts,
   else if ( theMesh && theMesh->HasShapeToMesh() )
     _minSize    = NETGENPlugin_Mesher::GetDefaultMinSize( theMesh->GetShapeToMesh(), _maxSize );
 
+  if ( dflts._way == SMESH_Hypothesis::BY_AVERAGE_LENGTH )
+  {
+    _minSize      = dflts._elemLength / 100.;
+    _nbSegPerEdge = 1;
+    _chordalError = dflts._elemLength / 2.;
+    _chordalErrorEnabled = true;
+    _quadAllowed  = dflts._quadDominated;
+  }
+
   return _nbSegPerEdge && _maxSize > 0;
 }