From 93b251f66dab414b9acc276d48927690fabb8973 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 24 Feb 2009 08:28:39 +0000 Subject: [PATCH] 19923: EDF 765 SMESH : default values of hypothesis set default values --- src/GUI/NETGENPluginGUI_SimpleCreator.cxx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) 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; -- 2.39.2