From 3ff18da0b04f45e37810f77ec086a9f2f438f183 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 20 Jan 2009 15:11:41 +0000 Subject: [PATCH] 0019923: EDF 765 SMESH : default values of hypothesis use initial precomputed values --- src/GUI/NETGENPluginGUI_SimpleCreator.cxx | 34 +++++++++++++++++------ 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/src/GUI/NETGENPluginGUI_SimpleCreator.cxx b/src/GUI/NETGENPluginGUI_SimpleCreator.cxx index 5456c25..630099a 100644 --- a/src/GUI/NETGENPluginGUI_SimpleCreator.cxx +++ b/src/GUI/NETGENPluginGUI_SimpleCreator.cxx @@ -53,6 +53,8 @@ #define SPACING 6 #define MARGIN 11 +using namespace NETGENPlugin; + // copied from StdMeshersGUI_StdHypothesisCreator.cxx const double VALUE_MAX = 1.0e+15, // COORD_MAX VALUE_MAX_2 = VALUE_MAX * VALUE_MAX, @@ -214,8 +216,25 @@ void NETGENPluginGUI_SimpleCreator::retrieveParams() const if ( isCreation() ) myName->setText( hypName() ); - NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D_var h = - NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D::_narrow( initParamsHypothesis() ); + // set default real values + + NETGENPlugin_SimpleHypothesis_2D_var h = + NETGENPlugin_SimpleHypothesis_2D::_narrow( initParamsHypothesis( hasInitParamsHypothesis() )); + + 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 ); + } + + h = NETGENPlugin_SimpleHypothesis_2D::_narrow( hypothesis() ); + + // set values of hypothesis // 1D int nbSeg = (int) h->GetNumberOfSegments(); @@ -245,8 +264,7 @@ void NETGENPluginGUI_SimpleCreator::retrieveParams() const // 3D if ( myVolume ) { - NETGENPlugin::NETGENPlugin_SimpleHypothesis_3D_var h = - NETGENPlugin::NETGENPlugin_SimpleHypothesis_3D::_narrow( initParamsHypothesis() ); + NETGENPlugin_SimpleHypothesis_3D_var h = NETGENPlugin_SimpleHypothesis_3D::_narrow( hypothesis() ); if ( double volume = (double) h->GetMaxElementVolume() ) { myLenFromFacesCheckBox->setChecked( false ); myVolume->setEnabled( true ); @@ -264,8 +282,8 @@ QString NETGENPluginGUI_SimpleCreator::storeParams() const QString valStr; try { - NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D_var h = - NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D::_narrow( initParamsHypothesis() ); + NETGENPlugin_SimpleHypothesis_2D_var h = + NETGENPlugin_SimpleHypothesis_2D::_narrow( hypothesis() ); if( isCreation() ) SMESH::SetName( SMESH::FindSObject( h ), myName->text().toLatin1().data() ); @@ -292,8 +310,8 @@ QString NETGENPluginGUI_SimpleCreator::storeParams() const // 3D if ( myVolume ) { - NETGENPlugin::NETGENPlugin_SimpleHypothesis_3D_var h = - NETGENPlugin::NETGENPlugin_SimpleHypothesis_3D::_narrow( initParamsHypothesis() ); + NETGENPlugin_SimpleHypothesis_3D_var h = + NETGENPlugin_SimpleHypothesis_3D::_narrow( hypothesis() ); if ( myVolume->isEnabled() ) { h->SetMaxElementVolume( myVolume->value() ); valStr += "; vol=" + myVolume->text(); -- 2.39.2