From: eap Date: Wed, 7 May 2014 10:56:51 +0000 (+0400) Subject: Enable 'Fineness' at 'curvature' switch on X-Git-Tag: V7_4_0rc1~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e69bcd9018dda896da9c738e1fd7f691191b680d;p=plugins%2Fnetgenplugin.git Enable 'Fineness' at 'curvature' switch on --- diff --git a/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx b/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx index 129a39b..4eb3402 100644 --- a/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx @@ -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); diff --git a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx index 113498c..a533654 100644 --- a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx @@ -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 ) {