From: eap Date: Tue, 24 Feb 2009 08:28:39 +0000 (+0000) Subject: 19923: EDF 765 SMESH : default values of hypothesis X-Git-Tag: V5_1_1a2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=93b251f66dab414b9acc276d48927690fabb8973;p=plugins%2Fnetgenplugin.git 19923: EDF 765 SMESH : default values of hypothesis set default values --- diff --git a/src/GUI/NETGENPluginGUI_SimpleCreator.cxx b/src/GUI/NETGENPluginGUI_SimpleCreator.cxx index 596a34d..2b7fcfe 100644 --- a/src/GUI/NETGENPluginGUI_SimpleCreator.cxx +++ b/src/GUI/NETGENPluginGUI_SimpleCreator.cxx @@ -225,20 +225,18 @@ void NETGENPluginGUI_SimpleCreator::retrieveParams() const if ( isCreation() ) myName->setText( hypName() ); - // set default real values + // Set default values NETGENPlugin_SimpleHypothesis_2D_var h = NETGENPlugin_SimpleHypothesis_2D::_narrow( initParamsHypothesis( hasInitParamsHypothesis() )); - if ( double len = h->GetLocalLength() ) + int dfltNbSeg = (int) h->GetNumberOfSegments(); + myNbSeg->setValue( dfltNbSeg ); + if ( double len = h->GetLocalLength() ) { myLength->setValue( len ); - if ( double area = h->GetMaxElementArea() ) - myArea->setValue( area ); - if ( myVolume ) { - NETGENPlugin_SimpleHypothesis_3D_var h3d = - NETGENPlugin_SimpleHypothesis_3D::_narrow( initParamsHypothesis( hasInitParamsHypothesis()) ); - if ( double volume = (double) h3d->GetMaxElementVolume() ) - myVolume->setValue( volume ); + myArea->setValue( len * len ); + if ( myVolume ) + myVolume->setValue( len * len * len ); } h = NETGENPlugin_SimpleHypothesis_2D::_narrow( hypothesis() ); @@ -248,7 +246,7 @@ void NETGENPluginGUI_SimpleCreator::retrieveParams() const SMESH::ListOfParameters_var aParameters = h->GetLastParameters(); // 1D - int nbSeg = (int) h->GetNumberOfSegments(); + int nbSeg = isCreation() ? dfltNbSeg : (int) h->GetNumberOfSegments(); myNbSegRadioBut->setChecked( nbSeg ); myLengthRadioBut->setChecked( !nbSeg ); QString aPrm;