mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-27 21:10:32 +05:00
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:
parent
0aaf2804aa
commit
1527eb6887
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user