From 15a0260a971abf8665b1aa014e03e298f1d2f6bb Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 29 Mar 2013 13:37:23 +0000 Subject: [PATCH] 0051789: TC7.2.0: NoteBook cannot update study - StdMeshersGUI_LayerDistributionParamWdg(SMESH::SMESH_Hypothesis_ptr, - const QString&, - QDialog*); + StdMeshersGUI_LayerDistributionParamWdg(SMESH::SMESH_Hypothesis_ptr holderHyp, + SMESH::SMESH_Hypothesis_ptr distribHyp, + const QString& name, + QDialog* dlg); private: + SMESH::SMESH_Hypothesis_var myHolderHyp; --- .../StdMeshersGUI_LayerDistributionParamWdg.cxx | 17 +++++++++-------- .../StdMeshersGUI_LayerDistributionParamWdg.h | 8 +++++--- .../StdMeshersGUI_StdHypothesisCreator.cxx | 8 ++++---- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx index 1a04ee904..4cbe1bce3 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx @@ -50,15 +50,15 @@ //================================================================================ StdMeshersGUI_LayerDistributionParamWdg -::StdMeshersGUI_LayerDistributionParamWdg(SMESH::SMESH_Hypothesis_ptr hyp, - const QString& theName, - QDialog* dlg): - QWidget(), myName(theName), myDlg( dlg ) +::StdMeshersGUI_LayerDistributionParamWdg(SMESH::SMESH_Hypothesis_ptr holderHyp, + SMESH::SMESH_Hypothesis_ptr distribHyp, + const QString& name, + QDialog* dlg): + QWidget(), myName(name), myDlg( dlg ) { + myHolderHyp = SMESH::SMESH_Hypothesis::_duplicate( holderHyp ); init(); - set( hyp ); -// if ( IsOk() ) -// onEdit(); + set( distribHyp ); } //================================================================================ @@ -73,6 +73,7 @@ void StdMeshersGUI_LayerDistributionParamWdg::set(SMESH::SMESH_Hypothesis_ptr hy myHyp = SMESH::SMESH_Hypothesis::_nil(); if ( !CORBA::is_nil( hyp )) { myHyp = SMESH::SMESH_Hypothesis::_duplicate( hyp ); + myHyp->SetHolderHypothesis( myHolderHyp ); myEditButton->setEnabled( true ); myCreateButton->setText( tr("CHANGE_TYPE")); myParamValue = hyp->GetName(); @@ -96,7 +97,7 @@ StdMeshersGUI_LayerDistributionParamWdg::~StdMeshersGUI_LayerDistributionParamWd //================================================================================ /*! - * \brief Create a leayout, initialize fields + * \brief Create a layout, initialize fields */ //================================================================================ diff --git a/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.h b/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.h index 237260c38..aaeb5ff2d 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.h +++ b/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.h @@ -51,9 +51,10 @@ class STDMESHERSGUI_EXPORT StdMeshersGUI_LayerDistributionParamWdg : public QWid Q_OBJECT public: - StdMeshersGUI_LayerDistributionParamWdg(SMESH::SMESH_Hypothesis_ptr, - const QString&, - QDialog*); + StdMeshersGUI_LayerDistributionParamWdg(SMESH::SMESH_Hypothesis_ptr holderHyp, + SMESH::SMESH_Hypothesis_ptr distribHyp, + const QString& name, + QDialog* dlg); ~StdMeshersGUI_LayerDistributionParamWdg(); SMESH::SMESH_Hypothesis_var GetHypothesis() { return myHyp; } @@ -74,6 +75,7 @@ private: private: SMESH::SMESH_Hypothesis_var myHyp; + SMESH::SMESH_Hypothesis_var myHolderHyp; SMESHGUI* mySMESHGUI; QPushButton* myCreateButton; diff --git a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx index 2f1694c25..1c6007296 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx @@ -994,8 +994,8 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const item.myName = tr( "SMESH_LAYERS_DISTRIBUTION" ); p.append( item ); initVariableName( hyp, item, "SetLayerDistribution" ); - customWidgets()->append - ( new StdMeshersGUI_LayerDistributionParamWdg( h->GetLayerDistribution(), hypName(), dlg())); + customWidgets()->append ( new StdMeshersGUI_LayerDistributionParamWdg + ( h, h->GetLayerDistribution(), hypName(), dlg() )); } else if( hypType()=="NumberOfLayers2D" ) { @@ -1014,8 +1014,8 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const item.myName = tr( "SMESH_LAYERS_DISTRIBUTION" ); p.append( item ); initVariableName( hyp, item, "SetLayerDistribution" ); - customWidgets()->append - ( new StdMeshersGUI_LayerDistributionParamWdg( h->GetLayerDistribution(), hypName(), dlg())); + customWidgets()->append ( new StdMeshersGUI_LayerDistributionParamWdg + ( h, h->GetLayerDistribution(), hypName(), dlg() )); } else if( hypType()=="ProjectionSource1D" ) { -- 2.39.2