From: eap Date: Thu, 29 Dec 2005 14:07:05 +0000 (+0000) Subject: PAL10953: take initial param values from the edited hypothesis. PAL10940: return... X-Git-Tag: T_Before_Join_BR-D5-38-2003~24 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=46fd3388e8956b9b49fc30a85ef89aedbd9a8d21;p=modules%2Fsmesh.git PAL10953: take initial param values from the edited hypothesis. PAL10940: return string from storeParams() --- diff --git a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx index 3e2a9860a..33abb0698 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx @@ -75,7 +75,7 @@ void StdMeshersGUI_StdHypothesisCreator::retrieveParams() const //here this method must be empty because buildStdParam sets values itself } -void StdMeshersGUI_StdHypothesisCreator::storeParams() const +QString StdMeshersGUI_StdHypothesisCreator::storeParams() const { ListOfStdParams params; bool res = getStdParamFromDlg( params ); @@ -85,6 +85,8 @@ void StdMeshersGUI_StdHypothesisCreator::storeParams() const params.remove( params.begin() ); } + QString valueStr = stdParamValues( params ); + if( res && !params.isEmpty() ) { if( hypType()=="LocalLength" ) @@ -139,6 +141,7 @@ void StdMeshersGUI_StdHypothesisCreator::storeParams() const h->SetFineness( params[0].myValue.toDouble() ); } } + return valueStr; } bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const @@ -155,73 +158,75 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const p.append( item ); } + SMESH::SMESH_Hypothesis_var hyp = initParamsHypothesis(); + if( hypType()=="LocalLength" ) { StdMeshers::StdMeshers_LocalLength_var h = - StdMeshers::StdMeshers_LocalLength::_narrow( hypothesis() ); + StdMeshers::StdMeshers_LocalLength::_narrow( hyp ); item.myName = tr("SMESH_LOCAL_LENGTH_PARAM"); - item.myValue = isCreation() ? 1.0 : h->GetLength(); + item.myValue = h->GetLength(); p.append( item ); } else if( hypType()=="Arithmetic1D" ) { StdMeshers::StdMeshers_Arithmetic1D_var h = - StdMeshers::StdMeshers_Arithmetic1D::_narrow( hypothesis() ); + StdMeshers::StdMeshers_Arithmetic1D::_narrow( hyp ); item.myName = tr( "SMESH_START_LENGTH_PARAM" ); - item.myValue = isCreation() ? 1.0 : h->GetLength( true ); + item.myValue = h->GetLength( true ); p.append( item ); item.myName = tr( "SMESH_END_LENGTH_PARAM" ); - item.myValue = isCreation() ? 10.0 : h->GetLength( false ); + item.myValue = h->GetLength( false ); p.append( item ); } else if( hypType()=="MaxElementArea" ) { StdMeshers::StdMeshers_MaxElementArea_var h = - StdMeshers::StdMeshers_MaxElementArea::_narrow( hypothesis() ); + StdMeshers::StdMeshers_MaxElementArea::_narrow( hyp ); item.myName = tr( "SMESH_MAX_ELEMENT_AREA_PARAM" ); - item.myValue = isCreation() ? 1.0 : h->GetMaxElementArea(); + item.myValue = h->GetMaxElementArea(); p.append( item ); } else if( hypType()=="MaxElementVolume" ) { StdMeshers::StdMeshers_MaxElementVolume_var h = - StdMeshers::StdMeshers_MaxElementVolume::_narrow( hypothesis() ); + StdMeshers::StdMeshers_MaxElementVolume::_narrow( hyp ); item.myName = tr( "SMESH_MAX_ELEMENT_VOLUME_PARAM" ); - item.myValue = isCreation() ? 1.0 : h->GetMaxElementVolume(); + item.myValue = h->GetMaxElementVolume(); p.append( item ); } else if( hypType()=="StartEndLength" ) { StdMeshers::StdMeshers_StartEndLength_var h = - StdMeshers::StdMeshers_StartEndLength::_narrow( hypothesis() ); + StdMeshers::StdMeshers_StartEndLength::_narrow( hyp ); item.myName = tr( "SMESH_START_LENGTH_PARAM" ); - item.myValue = isCreation() ? 1.0 : h->GetLength( true ); + item.myValue = h->GetLength( true ); p.append( item ); item.myName = tr( "SMESH_END_LENGTH_PARAM" ); - item.myValue = isCreation() ? 10.0 : h->GetLength( false ); + item.myValue = h->GetLength( false ); p.append( item ); } else if( hypType()=="Deflection1D" ) { StdMeshers::StdMeshers_Deflection1D_var h = - StdMeshers::StdMeshers_Deflection1D::_narrow( hypothesis() ); + StdMeshers::StdMeshers_Deflection1D::_narrow( hyp ); item.myName = tr( "SMESH_DEFLECTION1D_PARAM" ); - item.myValue = isCreation() ? 1.0 : h->GetDeflection(); + item.myValue = h->GetDeflection(); p.append( item ); } else if( hypType()=="AutomaticLength" ) { StdMeshers::StdMeshers_AutomaticLength_var h = - StdMeshers::StdMeshers_AutomaticLength::_narrow( hypothesis() ); + StdMeshers::StdMeshers_AutomaticLength::_narrow( hyp ); item.myName = tr( "SMESH_FINENESS_PARAM" ); - item.myValue = isCreation() ? 0.0 : h->GetFineness(); + item.myValue = h->GetFineness(); p.append( item ); } else diff --git a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.h b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.h index df42e46cc..216324cab 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.h +++ b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.h @@ -46,7 +46,7 @@ public: protected: virtual QFrame* buildFrame (); virtual void retrieveParams() const; - virtual void storeParams () const; + virtual QString storeParams () const; virtual bool stdParams ( ListOfStdParams& ) const; virtual void attuneStdWidget( QWidget*, const int ) const; virtual QString caption() const;