1 // SMESH SMESHGUI : GUI for SMESH component
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SMESHGUI_SmoothingDlg.cxx
25 // Author : Michael ZORIN
29 #include "SMESHGUI_SmoothingDlg.h"
32 #include "SMESHGUI_SpinBox.h"
33 #include "SMESHGUI_Utils.h"
34 #include "SMESHGUI_VTKUtils.h"
35 #include "SMESHGUI_IdValidator.h"
36 #include "SMESH_Actor.h"
37 #include "SMDS_Mesh.hxx"
39 #include "QAD_Application.h"
40 #include "QAD_Desktop.h"
41 #include "QAD_MessageBox.h"
42 #include "utilities.h"
45 #include <qapplication.h>
46 #include <qbuttongroup.h>
47 #include <qgroupbox.h>
49 #include <qlineedit.h>
50 #include <qpushbutton.h>
51 #include <qradiobutton.h>
52 #include <qcombobox.h>
53 #include <qcheckbox.h>
56 #include <qvalidator.h>
61 //=================================================================================
62 // class : SMESHGUI_SmoothingDlg()
64 //=================================================================================
65 SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( QWidget* parent, const char* name, SALOME_Selection* Sel,
66 bool modal, WFlags fl )
67 : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu |
68 Qt::WDestructiveClose)
70 QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "SMESH",tr("ICON_DLG_SMOOTHING")));
71 QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "SMESH",tr("ICON_SELECT")));
74 setName( "SMESHGUI_SmoothingDlg" );
76 setCaption( tr( "SMESH_SMOOTHING" ) );
77 setSizeGripEnabled( TRUE );
78 SMESHGUI_SmoothingDlgLayout = new QGridLayout( this );
79 SMESHGUI_SmoothingDlgLayout->setSpacing( 6 );
80 SMESHGUI_SmoothingDlgLayout->setMargin( 11 );
82 /***************************************************************/
83 GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
84 GroupConstructors->setTitle( tr( "SMESH_SMOOTHING" ) );
85 GroupConstructors->setExclusive( TRUE );
86 GroupConstructors->setColumnLayout(0, Qt::Vertical );
87 GroupConstructors->layout()->setSpacing( 0 );
88 GroupConstructors->layout()->setMargin( 0 );
89 GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
90 GroupConstructorsLayout->setAlignment( Qt::AlignTop );
91 GroupConstructorsLayout->setSpacing( 6 );
92 GroupConstructorsLayout->setMargin( 11 );
93 Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" );
94 Constructor1->setText( tr( "" ) );
95 Constructor1->setPixmap( image0 );
96 Constructor1->setChecked( TRUE );
97 Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) );
98 Constructor1->setMinimumSize( QSize( 50, 0 ) );
99 GroupConstructorsLayout->addWidget( Constructor1, 0, 0 );
100 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
101 GroupConstructorsLayout->addItem( spacer, 0, 1 );
102 SMESHGUI_SmoothingDlgLayout->addWidget( GroupConstructors, 0, 0 );
104 /***************************************************************/
105 GroupButtons = new QGroupBox( this, "GroupButtons" );
106 GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) );
107 GroupButtons->setTitle( tr( "" ) );
108 GroupButtons->setColumnLayout(0, Qt::Vertical );
109 GroupButtons->layout()->setSpacing( 0 );
110 GroupButtons->layout()->setMargin( 0 );
111 GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
112 GroupButtonsLayout->setAlignment( Qt::AlignTop );
113 GroupButtonsLayout->setSpacing( 6 );
114 GroupButtonsLayout->setMargin( 11 );
115 buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
116 buttonCancel->setText( tr( "SMESH_BUT_CLOSE" ) );
117 buttonCancel->setAutoDefault( TRUE );
118 GroupButtonsLayout->addWidget( buttonCancel, 0, 3 );
119 buttonApply = new QPushButton( GroupButtons, "buttonApply" );
120 buttonApply->setText( tr( "SMESH_BUT_APPLY" ) );
121 buttonApply->setAutoDefault( TRUE );
122 GroupButtonsLayout->addWidget( buttonApply, 0, 1 );
123 QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
124 GroupButtonsLayout->addItem( spacer_9, 0, 2 );
125 buttonOk = new QPushButton( GroupButtons, "buttonOk" );
126 buttonOk->setText( tr( "SMESH_BUT_OK" ) );
127 buttonOk->setAutoDefault( TRUE );
128 buttonOk->setDefault( TRUE );
129 GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
130 SMESHGUI_SmoothingDlgLayout->addWidget( GroupButtons, 2, 0 );
132 /***************************************************************/
133 GroupArguments = new QGroupBox( this, "GroupArguments" );
134 GroupArguments->setTitle( tr( "SMESH_ARGUMENTS" ) );
135 GroupArguments->setColumnLayout(0, Qt::Vertical );
136 GroupArguments->layout()->setSpacing( 0 );
137 GroupArguments->layout()->setMargin( 0 );
138 GroupArgumentsLayout = new QGridLayout( GroupArguments->layout() );
139 GroupArgumentsLayout->setAlignment( Qt::AlignTop );
140 GroupArgumentsLayout->setSpacing( 6 );
141 GroupArgumentsLayout->setMargin( 11 );
143 // Controls for elements selection
144 TextLabelElements = new QLabel( GroupArguments, "TextLabelElements" );
145 TextLabelElements->setText( tr( "SMESH_ID_ELEMENTS" ) );
146 GroupArgumentsLayout->addWidget( TextLabelElements, 0, 0 );
148 SelectElementsButton = new QPushButton( GroupArguments, "SelectElementsButton" );
149 SelectElementsButton->setText( tr( "" ) );
150 SelectElementsButton->setPixmap( image1 );
151 SelectElementsButton->setToggleButton( FALSE );
152 GroupArgumentsLayout->addWidget( SelectElementsButton, 0, 1 );
154 LineEditElements = new QLineEdit( GroupArguments, "LineEditElements" );
155 LineEditElements->setValidator( new SMESHGUI_IdValidator( this, "validator" ));
156 GroupArgumentsLayout->addWidget( LineEditElements, 0, 2 );
158 // Control for the whole mesh selection
159 CheckBoxMesh = new QCheckBox( GroupArguments, "CheckBoxMesh" );
160 CheckBoxMesh->setText( tr( "SMESH_SELECT_WHOLE_MESH" ) );
161 GroupArgumentsLayout->addMultiCellWidget( CheckBoxMesh, 1, 1, 0, 2 );
163 // Controls for nodes selection
164 TextLabelNodes = new QLabel( GroupArguments, "TextLabelNodes" );
165 TextLabelNodes->setText( tr( "FIXED_NODES_IDS" ) );
166 GroupArgumentsLayout->addWidget( TextLabelNodes, 2, 0 );
168 SelectNodesButton = new QPushButton( GroupArguments, "SelectNodesButton" );
169 SelectNodesButton->setText( tr( "" ) );
170 SelectNodesButton->setPixmap( image1 );
171 SelectNodesButton->setToggleButton( FALSE );
172 GroupArgumentsLayout->addWidget( SelectNodesButton, 2, 1 );
174 LineEditNodes = new QLineEdit( GroupArguments, "LineEditNodes" );
175 LineEditNodes->setValidator( new SMESHGUI_IdValidator( this, "validator" ));
176 GroupArgumentsLayout->addWidget( LineEditNodes, 2, 2 );
178 // Controls for method selection
179 TextLabelMethod = new QLabel( GroupArguments, "TextLabelMethod" );
180 TextLabelMethod->setText( tr( "METHOD" ) );
181 GroupArgumentsLayout->addMultiCellWidget( TextLabelMethod, 3, 3, 0, 1 );
183 ComboBoxMethod = new QComboBox( GroupArguments, "ComboBoxMethod" );
184 GroupArgumentsLayout->addWidget( ComboBoxMethod, 3, 2 );
186 // Controls for iteration limit defining
187 TextLabelLimit = new QLabel( GroupArguments, "TextLabelLimit" );
188 TextLabelLimit->setText( tr( "ITERATION_LIMIT" ) );
189 GroupArgumentsLayout->addMultiCellWidget( TextLabelLimit, 4, 4, 0, 1 );
191 SpinBox_IterationLimit = new QSpinBox(GroupArguments, "SpinBox_IterationLimit");
192 GroupArgumentsLayout->addWidget( SpinBox_IterationLimit, 4, 2 );
194 // Controls for max. aspect ratio defining
195 TextLabelAspectRatio = new QLabel( GroupArguments, "TextLabelAspectRatio" );
196 TextLabelAspectRatio->setText( tr( "MAX_ASPECT_RATIO" ) );
197 GroupArgumentsLayout->addMultiCellWidget( TextLabelAspectRatio, 5, 5, 0, 1 );
199 SpinBox_AspectRatio = new SMESHGUI_SpinBox(GroupArguments, "SpinBox_AspectRatio");
200 GroupArgumentsLayout->addWidget( SpinBox_AspectRatio, 5, 2 );
203 SMESHGUI_SmoothingDlgLayout->addWidget( GroupArguments, 1, 0 );
205 /* Initialisations */
206 ComboBoxMethod->insertItem(tr("LAPLACIAN"));
207 ComboBoxMethod->insertItem(tr("CENTROIDAL"));
209 QIntValidator* anIntValidator = new QIntValidator(SpinBox_IterationLimit);
210 SpinBox_IterationLimit->setValidator(anIntValidator);
211 SpinBox_IterationLimit->setRange( 1, 999999 );
212 SpinBox_AspectRatio->RangeStepAndValidator( 0.0, +999999.999, 0.1, 3 );
214 GroupArguments->show();
215 myConstructorId = 0 ;
216 Constructor1->setChecked( TRUE );
219 mySMESHGUI = SMESHGUI::GetSMESHGUI() ;
220 mySMESHGUI->SetActiveDialogBox( (QDialog*)this ) ;
222 myMeshOrSubMeshFilter = new SMESH_TypeFilter( MESHorSUBMESH );
225 /* signals and slots connections */
226 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
227 connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ;
228 connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) );
229 connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) );
231 connect( SelectElementsButton, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
232 connect( SelectNodesButton, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
233 connect( mySMESHGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;
234 connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
235 /* to close dialog if study change */
236 connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ;
237 connect( LineEditElements, SIGNAL( textChanged( const QString& )),
238 SLOT( onTextChange( const QString& )));
239 connect( LineEditNodes, SIGNAL( textChanged( const QString& )),
240 SLOT( onTextChange( const QString& )));
241 connect( CheckBoxMesh, SIGNAL( toggled( bool )),
242 SLOT( onSelectMesh( bool )));
244 /* Move widget on the botton right corner of main widget */
246 mySMESHGUI->DefineDlgPosition( this, x, y ) ;
248 this->show() ; /* displays Dialog */
251 //=================================================================================
252 // function : ~SMESHGUI_SmoothingDlg()
253 // purpose : Destroys the object and frees any allocated resources
254 //=================================================================================
255 SMESHGUI_SmoothingDlg::~SMESHGUI_SmoothingDlg()
257 // no need to delete child widgets, Qt does it all for us
261 //=================================================================================
264 //=================================================================================
265 void SMESHGUI_SmoothingDlg::Init()
269 ComboBoxMethod->setCurrentItem(0);
271 SpinBox_IterationLimit->setValue(20);
272 SpinBox_AspectRatio->SetValue(1.1);
274 myEditCurrentArgument = LineEditElements;
275 LineEditElements->setFocus();
280 myMesh = SMESH::SMESH_Mesh::_nil();
282 CheckBoxMesh->setChecked(false);
283 onSelectMesh( false );
287 //=================================================================================
288 // function : ConstructorsClicked()
289 // purpose : Radio button management
290 //=================================================================================
291 void SMESHGUI_SmoothingDlg::ConstructorsClicked(int constructorId)
297 //=================================================================================
298 // function : ClickOnApply()
300 //=================================================================================
301 void SMESHGUI_SmoothingDlg::ClickOnApply()
303 if (mySMESHGUI->ActiveStudyLocked())
306 if ( myNbOkElements && (myNbOkNodes || LineEditNodes->text().stripWhiteSpace().isEmpty()))
308 QStringList aListElementsId = QStringList::split( " ", myElementsId, false);
309 QStringList aListNodesId = QStringList::split( " ", LineEditNodes->text(), false);
311 SMESH::long_array_var anElementsId = new SMESH::long_array;
312 SMESH::long_array_var aNodesId = new SMESH::long_array;
314 anElementsId->length( aListElementsId.count() );
315 for ( int i = 0; i < aListElementsId.count(); i++ )
316 anElementsId[i] = aListElementsId[i].toInt();
320 aNodesId->length( aListNodesId.count() );
321 for ( int i = 0; i < aListNodesId.count(); i++ )
322 aNodesId[i] = aListNodesId[i].toInt();
325 anElementsId->length(0);
327 long anIterationLimit = (long)SpinBox_IterationLimit->value();
328 double aMaxAspectRatio = SpinBox_AspectRatio->GetValue();
330 SMESH::SMESH_MeshEditor::Smooth_Method aMethod = SMESH::SMESH_MeshEditor::LAPLACIAN_SMOOTH;
331 if (ComboBoxMethod->currentItem() > 0)
332 aMethod = SMESH::SMESH_MeshEditor::CENTROIDAL_SMOOTH;
334 bool aResult = false;
337 SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
338 QApplication::setOverrideCursor(Qt::waitCursor);
339 aResult = aMeshEditor->Smooth(anElementsId.inout(), aNodesId.inout(), anIterationLimit, aMaxAspectRatio, aMethod);
340 QApplication::restoreOverrideCursor();
348 Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
349 mySelection->ClearIObjects();
351 mySelection->AddIObject( anIO, false );
358 //=================================================================================
359 // function : ClickOnOk()
361 //=================================================================================
362 void SMESHGUI_SmoothingDlg::ClickOnOk()
369 //=================================================================================
370 // function : ClickOnCancel()
372 //=================================================================================
373 void SMESHGUI_SmoothingDlg::ClickOnCancel()
375 mySelection->ClearFilters();
376 mySelection->ClearIObjects();
377 SMESH::SetPointRepresentation(false);
378 QAD_Application::getDesktop()->SetSelectionMode( ActorSelection );
379 disconnect( mySelection, 0, this, 0 );
380 mySMESHGUI->ResetState() ;
384 //=======================================================================
385 //function : onTextChange
387 //=======================================================================
389 void SMESHGUI_SmoothingDlg::onTextChange(const QString& theNewText)
391 QLineEdit* send = (QLineEdit*)sender();
393 if ( myBusy ) return;
396 if (send == LineEditElements)
398 else if (send == LineEditNodes)
401 buttonOk->setEnabled( false );
402 buttonApply->setEnabled( false );
404 // hilight entered elements/nodes
405 SMDS_Mesh* aMesh = 0;
407 aMesh = myActor->GetObject()->GetMesh();
411 mySelection->ClearIObjects();
412 mySelection->AddIObject( myActor->getIO() );
414 QStringList aListId = QStringList::split( " ", theNewText, false);
416 if (send == LineEditElements) {
417 for ( int i = 0; i < aListId.count(); i++ ) {
418 const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() );
420 if ( !mySelection->IsIndexSelected( myActor->getIO(), e->GetID() ))
421 mySelection->AddOrRemoveIndex (myActor->getIO(), e->GetID(), true);
425 myElementsId = theNewText;
427 else if (send == LineEditNodes) {
428 for ( int i = 0; i < aListId.count(); i++ ) {
429 const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() );
431 if ( !mySelection->IsIndexSelected( myActor->getIO(), n->GetID() ))
432 mySelection->AddOrRemoveIndex (myActor->getIO(), n->GetID(), true);
439 if ( myNbOkElements && (myNbOkNodes || LineEditNodes->text().stripWhiteSpace().isEmpty()) ) {
440 buttonOk->setEnabled( true );
441 buttonApply->setEnabled( true );
447 //=================================================================================
448 // function : SelectionIntoArgument()
449 // purpose : Called when selection as changed or other case
450 //=================================================================================
451 void SMESHGUI_SmoothingDlg::SelectionIntoArgument()
453 if ( myBusy ) return;
459 myEditCurrentArgument->setText( "" );
462 if ( !GroupButtons->isEnabled() ) // inactive
465 buttonOk->setEnabled( false );
466 buttonApply->setEnabled( false );
469 QString aString = "";
471 int nbSel = mySelection->IObjectCount();
475 Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
476 myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO) ;
478 myActor = SMESH::FindActorByEntry( mySelection->firstIObject()->getEntry() );
480 // get selected elements/nodes
484 if (myEditCurrentArgument == LineEditElements)
488 if (CheckBoxMesh->isChecked())
490 SMESH::GetNameOfSelectedIObjects(mySelection, aString);
491 if(!myMesh->_is_nil())
497 SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
500 for (int i = aSMDSMesh->MinElementID(); i <= aSMDSMesh->MaxElementID(); i++ )
502 const SMDS_MeshElement * e = aSMDSMesh->FindElement( i );
504 myElementsId += QString(" %1").arg(i);
512 SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO) ;
513 if(aSubMesh->_is_nil())
516 myMesh = aSubMesh->GetFather();
517 if(myMesh->_is_nil())
520 myActor = SMESH::FindActorByObject(myMesh);
524 SMESH::long_array_var anElementsIds = new SMESH::long_array;
525 anElementsIds = aSubMesh->GetElementsId();
526 for ( int i = 0; i < anElementsIds->length(); i++ )
527 myElementsId += QString(" %1").arg(anElementsIds[i]);
528 aNbUnits = anElementsIds->length();
531 else if(!myMesh->_is_nil() && myActor)
533 aNbUnits = SMESH::GetNameOfSelectedElements(mySelection, aString) ;
534 myElementsId = aString;
537 else if (myEditCurrentArgument == LineEditNodes && !myMesh->_is_nil() && myActor)
540 aNbUnits = SMESH::GetNameOfSelectedNodes(mySelection, aString) ;
547 myEditCurrentArgument->setText( aString );
552 if (myEditCurrentArgument == LineEditElements)
553 myNbOkElements = true;
554 else if (myEditCurrentArgument == LineEditNodes)
559 buttonOk->setEnabled( true );
560 buttonApply->setEnabled( true );
565 //=================================================================================
566 // function : SetEditCurrentArgument()
568 //=================================================================================
569 void SMESHGUI_SmoothingDlg::SetEditCurrentArgument()
571 QPushButton* send = (QPushButton*)sender();
573 switch (myConstructorId)
575 case 0: /* default constructor */
577 disconnect( mySelection, 0, this, 0 );
578 mySelection->ClearIObjects();
579 mySelection->ClearFilters();
581 if(send == SelectElementsButton) {
582 myEditCurrentArgument = LineEditElements;
583 SMESH::SetPointRepresentation(false);
584 if (CheckBoxMesh->isChecked())
586 QAD_Application::getDesktop()->SetSelectionMode( ActorSelection );
587 mySelection->AddFilter(myMeshOrSubMeshFilter) ;
590 QAD_Application::getDesktop()->SetSelectionMode( CellSelection, true );
592 else if (send == SelectNodesButton)
594 myEditCurrentArgument = LineEditNodes;
595 SMESH::SetPointRepresentation(true);
596 QAD_Application::getDesktop()->SetSelectionMode( NodeSelection, true );
599 myEditCurrentArgument->setFocus();
600 connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
601 SelectionIntoArgument() ;
607 //=================================================================================
608 // function : DeactivateActiveDialog()
610 //=================================================================================
611 void SMESHGUI_SmoothingDlg::DeactivateActiveDialog()
613 if ( GroupConstructors->isEnabled() ) {
614 GroupConstructors->setEnabled(false) ;
615 GroupArguments->setEnabled(false) ;
616 GroupButtons->setEnabled(false) ;
617 mySMESHGUI->ResetState() ;
618 mySMESHGUI->SetActiveDialogBox(0) ;
623 //=================================================================================
624 // function : ActivateThisDialog()
626 //=================================================================================
627 void SMESHGUI_SmoothingDlg::ActivateThisDialog()
629 /* Emit a signal to deactivate the active dialog */
630 mySMESHGUI->EmitSignalDeactivateDialog() ;
631 GroupConstructors->setEnabled(true) ;
632 GroupArguments->setEnabled(true) ;
633 GroupButtons->setEnabled(true) ;
635 mySMESHGUI->SetActiveDialogBox( (QDialog*)this ) ;
637 QAD_Application::getDesktop()->SetSelectionMode( CellSelection, true );
638 SelectionIntoArgument();
642 //=================================================================================
643 // function : enterEvent()
645 //=================================================================================
646 void SMESHGUI_SmoothingDlg::enterEvent(QEvent* e)
648 if ( GroupConstructors->isEnabled() )
650 ActivateThisDialog() ;
654 //=================================================================================
655 // function : closeEvent()
657 //=================================================================================
658 void SMESHGUI_SmoothingDlg::closeEvent( QCloseEvent* e )
660 /* same than click on cancel button */
661 this->ClickOnCancel() ;
665 //=======================================================================
666 //function : hideEvent
667 //purpose : caused by ESC key
668 //=======================================================================
670 void SMESHGUI_SmoothingDlg::hideEvent ( QHideEvent * e )
672 if ( !isMinimized() )
677 //=======================================================================
678 //function : onSelectMesh
680 //=======================================================================
681 void SMESHGUI_SmoothingDlg::onSelectMesh ( bool toSelectMesh )
683 mySelection->ClearFilters() ;
687 TextLabelElements->setText( tr( "SMESH_NAME" ) );
689 QAD_Application::getDesktop()->SetSelectionMode( ActorSelection );
690 mySelection->AddFilter(myMeshOrSubMeshFilter);
691 LineEditElements->setReadOnly(true);
695 TextLabelElements->setText( tr( "SMESH_ID_ELEMENTS" ) );
697 QAD_Application::getDesktop()->SetSelectionMode( CellSelection, true );
698 LineEditElements->setReadOnly(false);
699 onTextChange(LineEditElements->text());
702 SelectionIntoArgument();