X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_SmoothingDlg.cxx;h=e31d5c79b8df7ede974e9454e57bdcf003ad439b;hp=055333cd2c1382889a9d0d0293c8505fe0dc670b;hb=4cd2499bddcd3da3ec8900fe825bc98669b789b5;hpb=2c607013a23bd4e7ba07e72e0c04dee2c1209cff diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx index 055333cd2..e31d5c79b 100644 --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -263,7 +263,7 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule ) // Costruction of the logical filter for the elements: mesh/sub-mesh/group QList aListOfFilters; - aListOfFilters << new SMESH_TypeFilter(MESHorSUBMESH) << new SMESH_TypeFilter(GROUP); + aListOfFilters << new SMESH_TypeFilter(SMESH::MESHorSUBMESH) << new SMESH_TypeFilter(SMESH::GROUP); myMeshOrSubMeshOrGroupFilter = new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR); @@ -275,7 +275,7 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule ) /***************************************************************/ // signals and slots connections connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); @@ -284,7 +284,7 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule ) connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* to close dialog if study change */ - connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(LineEditNodes, SIGNAL(textChanged(const QString&)), @@ -380,6 +380,8 @@ bool SMESHGUI_SmoothingDlg::ClickOnApply() SUIT_OverrideCursor aWaitCursor; SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); + myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); + if ( CheckBoxParametric->isChecked() ) { if(CheckBoxMesh->isChecked()) aResult = aMeshEditor->SmoothParametricObject(mySelectedObject, aNodesId.inout(), @@ -397,8 +399,6 @@ bool SMESHGUI_SmoothingDlg::ClickOnApply() anIterationLimit, aMaxAspectRatio, aMethod); } - myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); - } catch (...) { } @@ -421,14 +421,14 @@ bool SMESHGUI_SmoothingDlg::ClickOnApply() void SMESHGUI_SmoothingDlg::ClickOnOk() { if( ClickOnApply() ) - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : Called when dialog box is closed //================================================================================= -void SMESHGUI_SmoothingDlg::ClickOnCancel() +void SMESHGUI_SmoothingDlg::reject() { disconnect(mySelectionMgr, 0, this, 0); mySelectionMgr->clearFilters(); @@ -441,7 +441,7 @@ void SMESHGUI_SmoothingDlg::ClickOnCancel() if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(ActorSelection); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -704,26 +704,6 @@ void SMESHGUI_SmoothingDlg::enterEvent (QEvent*) ActivateThisDialog(); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_SmoothingDlg::closeEvent (QCloseEvent*) -{ - /* same than click on cancel button */ - ClickOnCancel(); -} - -//======================================================================= -// function : hideEvent() -// purpose : caused by ESC key -//======================================================================= -void SMESHGUI_SmoothingDlg::hideEvent (QHideEvent*) -{ - if (!isMinimized()) - ClickOnCancel(); -} - //======================================================================= // function : onSelectMesh() // purpose :