]> SALOME platform Git repositories - plugins/netgenplugin.git/commitdiff
Salome HOME
Enable 'Fineness' at 'curvature' switch on
authoreap <eap@opencascade.com>
Wed, 7 May 2014 10:56:51 +0000 (14:56 +0400)
committereap <eap@opencascade.com>
Wed, 7 May 2014 10:56:51 +0000 (14:56 +0400)
src/GUI/NETGENPluginGUI_HypothesisCreator.cxx
src/NETGENPlugin/NETGENPlugin_Mesher.cxx

index 129a39b114a761a08f988c05368ac6c6a3cacf14..4eb34023d0c32fdec661f9b1bd6866a699faf298 100644 (file)
@@ -330,14 +330,7 @@ void NETGENPluginGUI_HypothesisCreator::retrieveParams() const
     myFuseEdges->setChecked( data.myFuseEdges );
 
   // update widgets
-  bool isCustom = (myFineness->currentIndex() == UserDefined);
-  bool isSurfaceCurvature = (mySurfaceCurvature ? mySurfaceCurvature->checkState() == Qt::Checked : true);
-  myFineness->setEnabled(isSurfaceCurvature);
-  myGrowthRate->setEnabled(isCustom && isSurfaceCurvature);
-  if ( myNbSegPerEdge )
-    myNbSegPerEdge->setEnabled(isCustom && isSurfaceCurvature);
-  if ( myNbSegPerRadius )
-    myNbSegPerRadius->setEnabled(isCustom && isSurfaceCurvature);
+  ((NETGENPluginGUI_HypothesisCreator*) this )-> onSurfaceCurvatureChanged();
 
   if ( myLocalSizeTable )
   {
@@ -566,6 +559,7 @@ void NETGENPluginGUI_HypothesisCreator::onSurfaceCurvatureChanged()
 {
   bool isSurfaceCurvature = (mySurfaceCurvature ? mySurfaceCurvature->isChecked() : true);
   bool isCustom           = (myFineness->currentIndex() == UserDefined);
+  myFineness->setEnabled(isSurfaceCurvature);
   myGrowthRate->setEnabled(isCustom);
   if ( myNbSegPerEdge )
     myNbSegPerEdge->setEnabled(isCustom && isSurfaceCurvature);
index 113498c1cd13806bf53b3367373a8e65dcb2134b..a5336548afba6d2df5573e73fa2723d642436a97 100644 (file)
@@ -1672,12 +1672,12 @@ NETGENPlugin_Mesher::AddSegmentsToMesh(netgen::Mesh&                    ngMesh,
         // element size (regression on issue 0020452, note 0010898)
         int   iPrev = SMESH_MesherHelper::WrapIndex( i-1, nbSegments );
         int   iNext = SMESH_MesherHelper::WrapIndex( i+1, nbSegments );
-        double sunH = segLen[ iPrev ] + segLen[ i ] + segLen[ iNext ];
-        int   nbSeg = ( int( segLen[ iPrev ] > sunH / 100.)  +
-                        int( segLen[ i     ] > sunH / 100.)  +
-                        int( segLen[ iNext ] > sunH / 100.));
+        double sumH = segLen[ iPrev ] + segLen[ i ] + segLen[ iNext ];
+        int   nbSeg = ( int( segLen[ iPrev ] > sumH / 100.)  +
+                        int( segLen[ i     ] > sumH / 100.)  +
+                        int( segLen[ iNext ] > sumH / 100.));
         if ( nbSeg > 0 )
-          RestrictLocalSize( ngMesh, 0.5*(np1+np2), sunH / nbSeg );
+          RestrictLocalSize( ngMesh, 0.5*(np1+np2), sumH / nbSeg );
       }
       if ( isInternalWire )
       {