0019941: EDF 766 SMESH : Max length hypothesis

+  void                         setInitParamsHypothesis(SMESH::SMESH_Hypothesis_ptr);
-  SMESH::SMESH_Hypothesis_var  initParamsHypothesis() const;
+  SMESH::SMESH_Hypothesis_var  initParamsHypothesis(const bool strict=false) const;
This commit is contained in:
eap 2009-01-14 09:22:40 +00:00
parent 0aaf2804aa
commit 1527eb6887
2 changed files with 22 additions and 6 deletions

View File

@ -61,14 +61,18 @@ SMESHGUI_GenericHypothesisCreator::~SMESHGUI_GenericHypothesisCreator()
{
}
void SMESHGUI_GenericHypothesisCreator::setInitParamsHypothesis(SMESH::SMESH_Hypothesis_ptr hyp)
{
if ( !CORBA::is_nil( hyp ) && hypType() == hyp->GetName() )
myInitParamsHypo = SMESH::SMESH_Hypothesis::_duplicate( hyp );
}
void SMESHGUI_GenericHypothesisCreator::create( SMESH::SMESH_Hypothesis_ptr initParamsHyp,
const QString& theHypName,
QWidget* parent)
{
MESSAGE( "Creation of hypothesis with initial params" );
if ( !CORBA::is_nil( initParamsHyp ) && hypType() == initParamsHyp->GetName() )
myInitParamsHypo = SMESH::SMESH_Hypothesis::_duplicate( initParamsHyp );
setInitParamsHypothesis( initParamsHyp );
create( false, theHypName, parent );
}
@ -341,9 +345,20 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_GenericHypothesisCreator::hypothesis() cons
return myHypo;
}
SMESH::SMESH_Hypothesis_var SMESHGUI_GenericHypothesisCreator::initParamsHypothesis() const
//================================================================================
/*!
* \brief Return hypothesis containing initial parameters
* \param strictly - if true, always return myInitParamsHypo,
* else, return myInitParamsHypo only in creation mode and if it
* is non-nil
*/
//================================================================================
SMESH::SMESH_Hypothesis_var SMESHGUI_GenericHypothesisCreator::initParamsHypothesis(const bool strictly) const
{
if ( CORBA::is_nil( myInitParamsHypo ))
if ( strictly )
return myInitParamsHypo;
if ( !isCreation() || CORBA::is_nil( myInitParamsHypo ))
return myHypo;
return myInitParamsHypo;
}

View File

@ -54,6 +54,7 @@ public:
void create( bool, const QString&, QWidget* );
void edit( SMESH::SMESH_Hypothesis_ptr,
const QString&, QWidget* );
void setInitParamsHypothesis(SMESH::SMESH_Hypothesis_ptr);
virtual bool checkParams() const = 0;
virtual void onReject();
@ -75,7 +76,7 @@ protected:
typedef QList<QWidget*> ListOfWidgets;
SMESH::SMESH_Hypothesis_var hypothesis() const;
SMESH::SMESH_Hypothesis_var initParamsHypothesis() const;
SMESH::SMESH_Hypothesis_var initParamsHypothesis(const bool strict=false) const;
const ListOfWidgets& widgets() const;
ListOfWidgets& changeWidgets();
QtxDialog* dlg() const;