Salome HOME
yfr : Merge V1.2
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_AddSubMeshDlg.cxx
1 using namespace std;
2 //  File      : SMESHGUI_AddSubMeshDlg.cxx
3 //  Created   : Mon May 27 10:20:11 2002
4 //  Author    : Nicolas REJNERI
5
6 //  Project   : SALOME
7 //  Module    : SMESH
8 //  Copyright : Open CASCADE 2002
9 //  $Header$
10
11 #include "SMESHGUI_AddSubMeshDlg.h"
12 #include "SMESHGUI.h"
13 #include "SALOME_ListIteratorOfListIO.hxx"
14
15 #include "QAD_Application.h"
16 #include "QAD_Desktop.h"
17 #include "utilities.h"
18
19 // QT Includes
20 #include <qbuttongroup.h>
21 #include <qgroupbox.h>
22 #include <qlabel.h>
23 #include <qlineedit.h>
24 #include <qpushbutton.h>
25 #include <qradiobutton.h>
26 #include <qlayout.h>
27 #include <qvariant.h>
28 #include <qtooltip.h>
29 #include <qwhatsthis.h>
30 #include <qimage.h>
31 #include <qpixmap.h>
32
33
34 //=================================================================================
35 // class    : SMESHGUI_AddSubMeshDlg()
36 // purpose  : Constructs a SMESHGUI_AddSubMeshDlg which is a child of 'parent', with the 
37 //            name 'name' and widget flags set to 'f'.
38 //            The dialog will by default be modeless, unless you set 'modal' to
39 //            TRUE to construct a modal dialog.
40 //=================================================================================
41 SMESHGUI_AddSubMeshDlg::SMESHGUI_AddSubMeshDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl )
42     : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
43 {
44     QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "SMESH",tr("ICON_DLG_ADD_SUBMESH")));
45     QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "SMESH",tr("ICON_SELECT")));
46     if ( !name )
47         setName( "SMESHGUI_AddSubMeshDlg" );
48     resize( 303, 175 ); 
49     setCaption( tr( "SMESH_ADD_SUBMESH"  ) );
50     setSizeGripEnabled( TRUE );
51     SMESHGUI_AddSubMeshDlgLayout = new QGridLayout( this ); 
52     SMESHGUI_AddSubMeshDlgLayout->setSpacing( 6 );
53     SMESHGUI_AddSubMeshDlgLayout->setMargin( 11 );
54     
55     /***************************************************************/
56     GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
57     GroupConstructors->setTitle( tr( "SMESH_SUBMESH"  ) );
58     GroupConstructors->setExclusive( TRUE );
59     GroupConstructors->setColumnLayout(0, Qt::Vertical );
60     GroupConstructors->layout()->setSpacing( 0 );
61     GroupConstructors->layout()->setMargin( 0 );
62     GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
63     GroupConstructorsLayout->setAlignment( Qt::AlignTop );
64     GroupConstructorsLayout->setSpacing( 6 );
65     GroupConstructorsLayout->setMargin( 11 );
66     Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" );
67     Constructor1->setText( tr( ""  ) );
68     Constructor1->setPixmap( image1 );
69     Constructor1->setChecked( TRUE );
70     Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) );
71     Constructor1->setMinimumSize( QSize( 50, 0 ) );
72     GroupConstructorsLayout->addWidget( Constructor1, 0, 0 );
73     QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
74     GroupConstructorsLayout->addItem( spacer, 0, 1 );
75     SMESHGUI_AddSubMeshDlgLayout->addWidget( GroupConstructors, 0, 0 );
76     
77     /***************************************************************/
78     GroupButtons = new QGroupBox( this, "GroupButtons" );
79     GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); 
80     GroupButtons->setTitle( tr( ""  ) );
81     GroupButtons->setColumnLayout(0, Qt::Vertical );
82     GroupButtons->layout()->setSpacing( 0 );
83     GroupButtons->layout()->setMargin( 0 );
84     GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
85     GroupButtonsLayout->setAlignment( Qt::AlignTop );
86     GroupButtonsLayout->setSpacing( 6 );
87     GroupButtonsLayout->setMargin( 11 );
88     buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
89     buttonCancel->setText( tr( "SMESH_BUT_CLOSE"  ) );
90     buttonCancel->setAutoDefault( TRUE );
91     GroupButtonsLayout->addWidget( buttonCancel, 0, 3 );
92     buttonApply = new QPushButton( GroupButtons, "buttonApply" );
93     buttonApply->setText( tr( "SMESH_BUT_APPLY"  ) );
94     buttonApply->setAutoDefault( TRUE );
95     GroupButtonsLayout->addWidget( buttonApply, 0, 1 );
96     QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
97     GroupButtonsLayout->addItem( spacer_9, 0, 2 );
98     buttonOk = new QPushButton( GroupButtons, "buttonOk" );
99     buttonOk->setText( tr( "SMESH_BUT_OK"  ) );
100     buttonOk->setAutoDefault( TRUE );
101     buttonOk->setDefault( TRUE );
102     GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
103     SMESHGUI_AddSubMeshDlgLayout->addWidget( GroupButtons, 2, 0 );
104
105     /***************************************************************/
106     GroupC1 = new QGroupBox( this, "GroupC1" );
107     GroupC1->setTitle( tr( "SMESH_ARGUMENTS"  ) );
108     GroupC1->setMinimumSize( QSize( 0, 0 ) );
109     GroupC1->setFrameShape( QGroupBox::Box );
110     GroupC1->setFrameShadow( QGroupBox::Sunken );
111     GroupC1->setColumnLayout(0, Qt::Vertical );
112     GroupC1->layout()->setSpacing( 0 );
113     GroupC1->layout()->setMargin( 0 );
114     GroupC1Layout = new QGridLayout( GroupC1->layout() );
115     GroupC1Layout->setAlignment( Qt::AlignTop );
116     GroupC1Layout->setSpacing( 6 );
117     GroupC1Layout->setMargin( 11 );
118
119     TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" );
120     TextLabelC1A1->setText( tr( "SMESH_OBJECT_MESH"  ) );
121     TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) );
122     TextLabelC1A1->setFrameShape( QLabel::NoFrame );
123     TextLabelC1A1->setFrameShadow( QLabel::Plain );
124     GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 );
125     SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" );
126     SelectButtonC1A1->setText( tr( ""  ) );
127     SelectButtonC1A1->setPixmap( image0 );
128     SelectButtonC1A1->setToggleButton( FALSE );
129     GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 );
130     LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" );
131     GroupC1Layout->addWidget( LineEditC1A1, 0, 2 );
132
133     TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" );
134     TextLabelC1A2->setText( tr( "SMESH_OBJECT_GEOM"  ) );
135     TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) );
136     TextLabelC1A2->setFrameShape( QLabel::NoFrame );
137     TextLabelC1A2->setFrameShadow( QLabel::Plain );
138     GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 );
139     SelectButtonC1A2 = new QPushButton( GroupC1, "SelectButtonC1A2" );
140     SelectButtonC1A2->setText( tr( ""  ) );
141     SelectButtonC1A2->setPixmap( image0 );
142     SelectButtonC1A2->setToggleButton( FALSE );
143     GroupC1Layout->addWidget( SelectButtonC1A2, 1, 1 );
144     LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" );
145     GroupC1Layout->addWidget( LineEditC1A2, 1, 2 );
146
147     TextLabel_NameMesh = new QLabel( GroupC1, "TextLabel_NameMesh" );
148     TextLabel_NameMesh->setText( tr( "SMESH_NAME"  ) );
149     GroupC1Layout->addWidget( TextLabel_NameMesh, 2, 0 );
150     LineEdit_NameMesh = new QLineEdit( GroupC1, "LineEdit_NameMesh" );
151     GroupC1Layout->addWidget( LineEdit_NameMesh, 2, 2 );
152
153     TextLabelC1A1Hyp = new QLabel( GroupC1, "TextLabelC1A1Hyp" );
154     TextLabelC1A1Hyp->setText( tr( "SMESH_OBJECT_HYPOTHESIS" ) );
155     TextLabelC1A1Hyp->setMinimumSize( QSize( 50, 0 ) );
156     TextLabelC1A1Hyp->setFrameShape( QLabel::NoFrame );
157     TextLabelC1A1Hyp->setFrameShadow( QLabel::Plain );
158     GroupC1Layout->addWidget( TextLabelC1A1Hyp, 3, 0 );
159     SelectButtonC1A1Hyp = new QPushButton( GroupC1, "SelectButtonC1A1Hyp" );
160     SelectButtonC1A1Hyp->setText( tr( ""  ) );
161     SelectButtonC1A1Hyp->setPixmap( image0 );
162     GroupC1Layout->addWidget( SelectButtonC1A1Hyp, 3, 1 );
163     LineEditC1A1Hyp = new QLineEdit( GroupC1, "LineEditC1A1Hyp" );
164     LineEditC1A1Hyp->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1Hyp->sizePolicy().hasHeightForWidth() ) );
165     GroupC1Layout->addWidget( LineEditC1A1Hyp, 3, 2 );
166
167     TextLabelC1A1Algo = new QLabel( GroupC1, "TextLabelC1A1Algo" );
168     TextLabelC1A1Algo->setText( tr( "SMESH_OBJECT_ALGORITHM" ) );
169     TextLabelC1A1Algo->setMinimumSize( QSize( 50, 0 ) );
170     TextLabelC1A1Algo->setFrameShape( QLabel::NoFrame );
171     TextLabelC1A1Algo->setFrameShadow( QLabel::Plain );
172     GroupC1Layout->addWidget( TextLabelC1A1Algo, 4, 0 );
173     SelectButtonC1A1Algo = new QPushButton( GroupC1, "SelectButtonC1A1Algo" );
174     SelectButtonC1A1Algo->setText( tr( ""  ) );
175     SelectButtonC1A1Algo->setPixmap( image0 );
176     GroupC1Layout->addWidget( SelectButtonC1A1Algo, 4, 1 );
177     LineEditC1A1Algo = new QLineEdit( GroupC1, "LineEditC1A1Algo" );
178     LineEditC1A1Algo->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1Algo->sizePolicy().hasHeightForWidth() ) );
179     GroupC1Layout->addWidget( LineEditC1A1Algo, 4, 2 );
180
181     SMESHGUI_AddSubMeshDlgLayout->addWidget( GroupC1, 1, 0 );
182     /***************************************************************/
183
184     Init(Sel) ;
185 }
186
187
188 //=================================================================================
189 // function : ~SMESHGUI_AddSubMeshDlg()
190 // purpose  : Destroys the object and frees any allocated resources
191 //=================================================================================
192 SMESHGUI_AddSubMeshDlg::~SMESHGUI_AddSubMeshDlg()
193 {
194     // no need to delete child widgets, Qt does it all for us
195 }
196
197
198 //=================================================================================
199 // function : Init()
200 // purpose  :
201 //=================================================================================
202 void SMESHGUI_AddSubMeshDlg::Init( SALOME_Selection* Sel )
203 {
204   GroupC1->show();
205   myConstructorId = 0 ;
206   Constructor1->setChecked( TRUE );
207   myEditCurrentArgument = LineEditC1A1 ;        
208   mySelection = Sel;
209   mySMESHGUI = SMESHGUI::GetSMESHGUI() ;
210   mySMESHGUI->SetActiveDialogBox( (QDialog*)this ) ;
211
212   myGeomFilter = new SALOME_TypeFilter( "GEOM" );
213   myMeshFilter = new SMESH_TypeFilter( MESH );
214
215   myAlgorithmFilter = new SMESH_TypeFilter( ALGORITHM );
216   myHypothesisFilter = new SMESH_TypeFilter( HYPOTHESIS );
217
218   myNameSubMesh = "SubMesh";
219
220   myGeomShape = GEOM::GEOM_Shape::_nil();
221   myMesh = SMESH::SMESH_Mesh::_nil();
222
223   /* signals and slots connections */
224   connect( buttonOk, SIGNAL( clicked() ),     this, SLOT( ClickOnOk() ) );
225   connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) );
226   connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ;
227   connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) );
228
229   connect( SelectButtonC1A1, SIGNAL (clicked() ),   this, SLOT( SetEditCurrentArgument() ) ) ;
230   connect( SelectButtonC1A2, SIGNAL (clicked() ),   this, SLOT( SetEditCurrentArgument() ) ) ;
231   connect( LineEdit_NameMesh, SIGNAL (textChanged(const QString&)  ), this, SLOT( TextChangedInLineEdit(const QString&) ) ) ;
232
233   connect( SelectButtonC1A1Hyp, SIGNAL (clicked() ),  this, SLOT( SetEditCurrentArgument() ) ) ;
234   connect( SelectButtonC1A1Algo, SIGNAL (clicked() ),  this, SLOT( SetEditCurrentArgument() ) ) ;
235
236   connect( mySelection, SIGNAL( currentSelectionChanged() ),     this, SLOT( SelectionIntoArgument() ) );
237   connect( mySMESHGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;
238   connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ;
239   
240   int x, y ;
241   mySMESHGUI->DefineDlgPosition( this, x, y ) ;
242   this->move( x, y ) ;
243   this->show() ; 
244
245   SelectionIntoArgument();
246
247   return ;
248 }
249
250
251 //=================================================================================
252 // function : ConstructorsClicked()
253 // purpose  : Radio button management
254 //=================================================================================
255 void SMESHGUI_AddSubMeshDlg::ConstructorsClicked(int constructorId)
256 {
257   return ;
258 }
259
260 //=================================================================================
261 // function : ClickOnOk()
262 // purpose  :
263 //=================================================================================
264 void SMESHGUI_AddSubMeshDlg::ClickOnOk()
265 {
266   this->ClickOnApply() ;
267   this->ClickOnCancel() ;
268 }
269
270 //=================================================================================
271 // function : ClickOnApply()
272 // purpose  :
273 //=================================================================================
274 void SMESHGUI_AddSubMeshDlg::ClickOnApply()
275 {
276   switch(myConstructorId)
277     { 
278     case 0 :
279       { 
280         if ( !myNameSubMesh.isEmpty() && !myNameSubMesh.isNull() && 
281              !myGeomShape->_is_nil() && !myMesh->_is_nil()) {
282           mySubMesh = mySMESHGUI->AddSubMesh( myMesh, myGeomShape, myNameSubMesh ) ;
283         }
284         
285         if( myOkHypothesis && !mySubMesh->_is_nil() ) {
286           SALOME_ListIteratorOfListIO It( HypoList );
287           for(;It.More();It.Next()) {
288             Handle(SALOME_InteractiveObject) IObject = It.Value();
289             Standard_Boolean testResult;
290             myHypothesis = mySMESHGUI->ConvertIOinSMESHHypothesis(IObject, testResult) ;
291             if( testResult )
292               mySMESHGUI->AddHypothesisOnSubMesh(mySubMesh, myHypothesis) ;
293           }
294         }
295
296         if( myOkAlgorithm && !mySubMesh->_is_nil() ) {
297           SALOME_ListIteratorOfListIO It( AlgoList );
298           for(;It.More();It.Next()) {
299             Handle(SALOME_InteractiveObject) IObject = It.Value();
300             Standard_Boolean testResult;
301             myAlgorithm = mySMESHGUI->ConvertIOinSMESHHypothesis(IObject, testResult) ;
302             if( testResult )
303               mySMESHGUI->AddAlgorithmOnSubMesh(mySubMesh, myAlgorithm) ;
304           }
305         }
306         
307         break ;
308       }
309     }
310 }
311
312
313 //=================================================================================
314 // function : ClickOnCancel()
315 // purpose  :
316 //=================================================================================
317 void SMESHGUI_AddSubMeshDlg::ClickOnCancel()
318 {
319   disconnect( mySelection, 0, this, 0 );
320   mySMESHGUI->ResetState() ;
321   mySelection->ClearFilters() ;
322   reject() ;
323   return ;
324 }
325
326
327 //=================================================================================
328 // function : SelectionIntoArgument()
329 // purpose  : Called when selection as changed or other case
330 //=================================================================================
331 void SMESHGUI_AddSubMeshDlg::SelectionIntoArgument()
332 {
333   myEditCurrentArgument->setText("") ;
334   QString aString = ""; 
335
336   int nbSel = mySMESHGUI->GetNameOfSelectedIObjects(mySelection, aString) ;
337
338   switch (myConstructorId) 
339     {
340     case 0:
341       {
342         if ( myEditCurrentArgument == LineEditC1A1 ) {
343           if ( nbSel != 1 ) {
344             myOkHypothesis = false;
345             myOkAlgorithm = false;
346             return ;
347           } else {
348             Standard_Boolean testResult ;
349             Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ;
350             myMesh = mySMESHGUI->ConvertIOinMesh(IO, testResult) ;
351             if( !testResult ) {
352               myMesh = SMESH::SMESH_Mesh::_nil();
353               return ;
354             }
355           }
356         } else if ( myEditCurrentArgument == LineEditC1A2 ) {
357           if ( nbSel != 1 ) {
358             myOkHypothesis = false;
359             myOkAlgorithm = false;
360             return ;
361           } else {
362             Standard_Boolean testResult ;
363             Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ;
364             myGeomShape = mySMESHGUI->ConvertIOinGEOMShape(IO, testResult) ;
365             if( !testResult ) {
366               myGeomShape = GEOM::GEOM_Shape::_nil();
367               return ;
368             }
369           }
370         } else if ( myEditCurrentArgument == LineEditC1A1Hyp ) {
371           if ( nbSel >= 1 ) {
372             HypoList.Clear();
373             SALOME_ListIteratorOfListIO Itinit( mySelection->StoredIObjects() );
374             for (; Itinit.More(); Itinit.Next()) {
375               HypoList.Append(Itinit.Value());
376             }
377             myOkHypothesis = true ;
378             if (nbSel > 1)
379               aString = tr("%1 Hypothesis").arg(nbSel) ;
380             LineEditC1A1Hyp->setText(aString) ;
381           }
382           else {
383             myOkHypothesis = false ;
384             return ;
385           }
386         } else if ( myEditCurrentArgument == LineEditC1A1Algo ) {
387           if ( nbSel >= 1 ) {
388             AlgoList.Clear(); 
389             SALOME_ListIteratorOfListIO Itinit( mySelection->StoredIObjects() );
390             for (; Itinit.More(); Itinit.Next()) {
391               AlgoList.Append(Itinit.Value());
392             }
393             myOkAlgorithm = true ;
394             if (nbSel > 1)
395               aString = tr("%1 Algorithms").arg(nbSel) ;
396             LineEditC1A1Algo->setText(aString) ;
397           }
398           else {
399             myOkAlgorithm = false ;
400             return ;
401           }
402         }
403         break;
404       }
405     }
406   
407   myEditCurrentArgument->setText(aString) ;
408 }
409
410
411 //=================================================================================
412 // function : SetEditCurrentArgument()
413 // purpose  :
414 //=================================================================================
415 void SMESHGUI_AddSubMeshDlg::SetEditCurrentArgument()
416 {
417   QPushButton* send = (QPushButton*)sender();
418   switch (myConstructorId)
419     {
420     case 0: /* default constructor */
421       { 
422         if(send == SelectButtonC1A1) {
423           LineEditC1A1->setFocus() ;
424           myEditCurrentArgument = LineEditC1A1;
425           mySelection->ClearFilters() ;   
426           mySelection->AddFilter(myMeshFilter) ;
427         } else if (send == SelectButtonC1A2) {
428           LineEditC1A2->setFocus() ;
429           myEditCurrentArgument = LineEditC1A2;
430           mySelection->ClearFilters() ;
431           mySelection->AddFilter(myGeomFilter) ;
432         } else if( send == SelectButtonC1A1Hyp ) {
433           LineEditC1A1Hyp->setFocus() ;
434           myEditCurrentArgument = LineEditC1A1Hyp ;
435           mySelection->ClearFilters() ;   
436           mySelection->AddFilter(myHypothesisFilter) ;
437         } else if( send == SelectButtonC1A1Algo ) {
438           LineEditC1A1Algo->setFocus() ;
439           myEditCurrentArgument = LineEditC1A1Algo ;
440           mySelection->ClearFilters() ;   
441           mySelection->AddFilter(myAlgorithmFilter) ;
442         }
443         SelectionIntoArgument() ;
444         break;
445       }
446     }
447   return ;
448 }
449
450 //=================================================================================
451 // function : DeactivateActiveDialog()
452 // purpose  :
453 //=================================================================================
454 void SMESHGUI_AddSubMeshDlg::DeactivateActiveDialog()
455 {
456   if ( GroupConstructors->isEnabled() ) {
457     disconnect( mySelection, 0, this, 0 );
458     GroupConstructors->setEnabled(false) ;
459     GroupC1->setEnabled(false) ;
460     GroupButtons->setEnabled(false) ;
461   }
462 }
463
464
465 //=================================================================================
466 // function : ActivateThisDialog()
467 // purpose  :
468 //=================================================================================
469 void SMESHGUI_AddSubMeshDlg::ActivateThisDialog()
470 {
471   mySMESHGUI->EmitSignalDeactivateDialog() ;   
472   GroupConstructors->setEnabled(true) ;
473   GroupC1->setEnabled(true) ;
474   GroupButtons->setEnabled(true) ;
475   connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
476   return ;
477 }
478
479
480 //=================================================================================
481 // function : enterEvent()
482 // purpose  :
483 //=================================================================================
484 void SMESHGUI_AddSubMeshDlg::enterEvent(QEvent* e)
485 {
486   if ( GroupConstructors->isEnabled() )
487     return ;  
488   ActivateThisDialog() ;
489   return ;
490 }
491
492
493 //=================================================================================
494 // function : closeEvent()
495 // purpose  :
496 //=================================================================================
497 void SMESHGUI_AddSubMeshDlg::closeEvent( QCloseEvent* e )
498 {
499   this->ClickOnCancel() ;
500   return ;
501 }
502
503 //=================================================================================
504 // function : TextChangedInLineEdit()
505 // purpose  :
506 //=================================================================================
507 void SMESHGUI_AddSubMeshDlg::TextChangedInLineEdit(const QString& newText)
508 {  
509   QLineEdit* send = (QLineEdit*)sender();
510   QString newT = strdup(newText) ;
511   
512   if (send == LineEdit_NameMesh) {
513     myNameSubMesh = newText;
514   }
515   return ;
516 }