]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOMGUI/GeometryGUI_PartitionDlg.cxx
Salome HOME
sources v1.2
[modules/geom.git] / src / GEOMGUI / GeometryGUI_PartitionDlg.cxx
1 //  GEOM GEOMGUI : GUI for Geometry component
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
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. 
10 // 
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. 
15 // 
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 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : GeometryGUI_PartitionDlg.cxx
25 //  Author : Lucien PIGNOLONI
26 //  Module : GEOM
27 //  $Header$
28
29 using namespace std;
30 #include "GeometryGUI_PartitionDlg.h"
31
32 #include "GeometryGUI.h"
33 #include "QAD_Application.h"
34 #include "QAD_Desktop.h"
35 #include "utilities.h"
36
37 #include <qbuttongroup.h>
38 #include <qgroupbox.h>
39 #include <qlabel.h>
40 #include <qlineedit.h>
41 #include <qpushbutton.h>
42 #include <qradiobutton.h>
43 #include <qlayout.h>
44 #include <qimage.h>
45 #include <qpixmap.h>
46
47 #define   MIN_EDIT_SIZE       150
48
49 //=================================================================================
50 // class    : GeometryGUI_PartitionDlg()
51 // purpose  : Constructs a GeometryGUI_PartitionDlg which is a child of 'parent', with the 
52 //            name 'name' and widget flags set to 'f'.
53 //            The dialog will by default be modeless, unless you set 'modal' to
54 //            TRUE to construct a modal dialog.
55 //=================================================================================
56 GeometryGUI_PartitionDlg::GeometryGUI_PartitionDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl )
57     : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
58 {
59     QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GeometryGUI",tr("ICON_DLG_PARTITION")));
60     QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GeometryGUI",tr("ICON_SELECT")));
61 //    QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap( "GeometryGUI",tr("ICON_DLG_PARTITION_KEEP_FACES")));
62
63     if ( !name )
64         setName( "GeometryGUI_PartitionDlg" );
65     setCaption( tr( "GEOM_PARTITION_TITLE"  ) );
66     setSizeGripEnabled( TRUE );
67     QGridLayout* GeometryGUI_PartitionDlgLayout = new QGridLayout( this ); 
68     GeometryGUI_PartitionDlgLayout->setSpacing( 6 );
69     GeometryGUI_PartitionDlgLayout->setMargin( 11 );
70     
71     /***************************************************************/
72     /* Constructor group */
73     /***************************************************************/
74     GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
75     GroupConstructors->setTitle( tr( "GEOM_PARTITION"  ) );
76     GroupConstructors->setColumnLayout(0, Qt::Vertical );
77     GroupConstructors->layout()->setSpacing( 0 );
78     GroupConstructors->layout()->setMargin( 0 );
79     QGridLayout* GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
80     GroupConstructorsLayout->setAlignment( Qt::AlignTop );
81     GroupConstructorsLayout->setSpacing( 6 );
82     GroupConstructorsLayout->setMargin( 11 );
83
84     Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" );
85     Constructor1->setPixmap( image0 );
86     Constructor1->setChecked( TRUE );
87     Constructor1->setMinimumSize( QSize( 50, 0 ) );
88     GroupConstructorsLayout->addWidget( Constructor1, 0, 0 );
89     GroupConstructorsLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ), 1, 0 );
90
91     GeometryGUI_PartitionDlgLayout->addWidget( GroupConstructors, 0, 0 );
92
93     /***************************************************************/
94     /* Arguments group */
95     /***************************************************************/
96     /* Shapes and Tools */
97     GroupC1 = new QGroupBox( this, "GroupC1" );
98     GroupC1->setTitle( tr( "GEOM_PARTITION"  ) );
99     GroupC1->setColumnLayout(0, Qt::Vertical );
100     GroupC1->layout()->setSpacing( 0 );
101     GroupC1->layout()->setMargin( 0 );
102     QGridLayout* GroupC1Layout = new QGridLayout( GroupC1->layout() );
103     GroupC1Layout->setAlignment( Qt::AlignTop );
104     GroupC1Layout->setSpacing( 6 );
105     GroupC1Layout->setMargin( 11 );
106
107     TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" );
108     TextLabelC1A1->setText( tr( "GEOM_OBJECTS"  ) );
109     GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 );
110     SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" );
111     SelectButtonC1A1->setPixmap( image1 );
112     SelectButtonC1A1->setToggleButton( FALSE );
113     GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 );
114     LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" );
115     LineEditC1A1->setMinimumSize(MIN_EDIT_SIZE, 0);
116     GroupC1Layout->addWidget( LineEditC1A1, 0, 2 );
117     
118     TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" );
119     TextLabelC1A2->setText( tr( "GEOM_TOOL_OBJECT"  ) );
120     GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 );
121     SelectButtonC1A2 = new QPushButton( GroupC1, "SelectButtonC1A2" );
122     SelectButtonC1A2->setPixmap( image1 );
123     SelectButtonC1A2->setToggleButton( FALSE );
124     GroupC1Layout->addWidget( SelectButtonC1A2, 1, 1 );
125     LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" );
126     LineEditC1A2->setMinimumSize(MIN_EDIT_SIZE, 0);
127     GroupC1Layout->addWidget( LineEditC1A2, 1, 2 );
128
129     /* Limit */
130     TextLabelComboBox1 = new QLabel( GroupC1, "TextLabelComboBox1" );
131     TextLabelComboBox1->setText( tr( "RECONSTRUCTION_LIMIT") );
132     GroupC1Layout->addWidget( TextLabelComboBox1, 2, 0 );
133     ComboBox1 = new QComboBox( FALSE, GroupC1, "ComboBox1" );
134     ComboBox1->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) );
135     ComboBox1->setMinimumSize(MIN_EDIT_SIZE, 0);
136     GroupC1Layout->addWidget( ComboBox1, 2, 2 );
137
138     GeometryGUI_PartitionDlgLayout->addWidget( GroupC1, 1, 0 );
139
140     /***************************************************************/
141     /* Result suppresion */
142     /***************************************************************/
143     GroupC2 = new QGroupBox( this, "GroupC2" );
144     GroupC2->setTitle( tr( "SUPPRESS_RESULT") );
145     GroupC2->setColumnLayout(0, Qt::Vertical );
146     GroupC2->layout()->setSpacing( 0 );
147     GroupC2->layout()->setMargin( 0 );
148     QGridLayout* GroupC2Layout = new QGridLayout( GroupC2->layout() );
149     GroupC2Layout->setAlignment( Qt::AlignTop );
150     GroupC2Layout->setSpacing( 6 );
151     GroupC2Layout->setMargin( 11 );
152
153     TextLabelC2A1 = new QLabel( GroupC2, "TextLabelC2A1" );
154     TextLabelC2A1->setText( tr( "SUPPRESS_RESULT_INSIDE") );
155     GroupC2Layout->addWidget( TextLabelC2A1, 0, 0 );
156     SelectButtonC2A1 = new QPushButton( GroupC2, "SelectButtonC2A1" );
157     SelectButtonC2A1->setPixmap( image1 );
158     GroupC2Layout->addWidget( SelectButtonC2A1, 0, 1 );
159     LineEditC2A1 = new QLineEdit( GroupC2, "LineEditC2A1" );
160     GroupC2Layout->addWidget( LineEditC2A1, 0, 2 );
161
162     TextLabelC2A2 = new QLabel( GroupC2, "TextLabelC2A2" );
163     TextLabelC2A2->setText( tr( "SUPPRESS_RESULT_OUTSIDE") );
164     GroupC2Layout->addWidget( TextLabelC2A2, 1, 0 );
165     SelectButtonC2A2 = new QPushButton( GroupC2, "SelectButtonC2A2" );
166     SelectButtonC2A2->setPixmap( image1 );
167     GroupC2Layout->addWidget( SelectButtonC2A2, 1, 1 );
168     LineEditC2A2 = new QLineEdit( GroupC2, "LineEditC2A2" );
169     GroupC2Layout->addWidget( LineEditC2A2, 1, 2 );
170
171     GeometryGUI_PartitionDlgLayout->addWidget( GroupC2, 2, 0 );
172     
173     /***************************************************************/
174     /* <OK>, <Apply>, <Cancel> buttons */
175     /***************************************************************/
176     GroupButtons = new QGroupBox( this, "GroupButtons" );
177     GroupButtons->setColumnLayout(0, Qt::Vertical );
178     GroupButtons->layout()->setSpacing( 0 );
179     GroupButtons->layout()->setMargin( 0 );
180     QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
181     GroupButtonsLayout->setAlignment( Qt::AlignTop );
182     GroupButtonsLayout->setSpacing( 6 );
183     GroupButtonsLayout->setMargin( 11 );
184     
185     buttonOk = new QPushButton( GroupButtons, "buttonOk" );
186     buttonOk->setText( tr( "GEOM_BUT_OK"  ) );
187     buttonOk->setAutoDefault( TRUE );
188     buttonOk->setDefault( TRUE );
189     GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
190
191     buttonApply = new QPushButton( GroupButtons, "buttonApply" );
192     buttonApply->setText( tr( "GEOM_BUT_APPLY"  ) );
193     buttonApply->setAutoDefault( TRUE );
194     GroupButtonsLayout->addWidget( buttonApply, 0, 1 );
195
196     GroupButtonsLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 2 );
197
198     buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
199     buttonCancel->setText( tr( "GEOM_BUT_CLOSE"  ) );
200     buttonCancel->setAutoDefault( TRUE );
201     GroupButtonsLayout->addWidget( buttonCancel, 0, 3 );
202
203     GeometryGUI_PartitionDlgLayout->addWidget( GroupButtons, 3, 0 );
204
205     /***************************************************************/
206     Init(Sel) ; /* Initialisations */
207 }
208
209
210 //=================================================================================
211 // function : ~GeometryGUI_PartitionDlg()
212 // purpose  : Destroys the object and frees any allocated resources
213 //=================================================================================
214 GeometryGUI_PartitionDlg::~GeometryGUI_PartitionDlg()
215 {
216     // no need to delete child widgets, Qt does it all for us
217 }
218
219
220
221 //=================================================================================
222 // function : Init()
223 // purpose  :
224 //=================================================================================
225 void GeometryGUI_PartitionDlg::Init( SALOME_Selection* Sel )
226 {
227   myEditCurrentArgument = LineEditC1A1 ;        
228   mySelection = Sel;
229   myGeomGUI = GeometryGUI::GetGeometryGUI() ;
230   myOkListShapes = myOkListTools = myOkKeepShape = myOkRemoveShape = false ;
231
232   myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
233
234   /* type for sub shape selection */
235 //  ComboBox1->insertItem( tr( "RECONSTRUCTION_LIMIT_SHAPE"  ) );
236   ComboBox1->insertItem( tr( "RECONSTRUCTION_LIMIT_SOLID"  ) );
237   ComboBox1->insertItem( tr( "RECONSTRUCTION_LIMIT_SHELL"  ) );
238   ComboBox1->insertItem( tr( "RECONSTRUCTION_LIMIT_FACE"   ) );
239   ComboBox1->insertItem( tr( "RECONSTRUCTION_LIMIT_WIRE"   ) );
240   ComboBox1->insertItem( tr( "RECONSTRUCTION_LIMIT_EDGE"   ) );
241   ComboBox1->insertItem( tr( "RECONSTRUCTION_LIMIT_VERTEX" ) );
242
243   /* Current item is 'Shape' */
244   ComboBox1->setCurrentItem(0);
245   myLimit = ComboBox1->currentItem();
246
247   /* Filter definitions */
248   Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "Geometry");
249   myGeom = GEOM::GEOM_Gen::_narrow(comp);
250
251   /* signals and slots connections */
252   connect( buttonOk,     SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
253   connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ;
254   connect( buttonApply,  SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
255 //  connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) );  
256   connect( ComboBox1, SIGNAL( activated(int) ), this, SLOT( ComboTextChanged() ) );
257
258   connect( SelectButtonC1A1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
259   connect( SelectButtonC1A2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
260
261   connect( SelectButtonC2A1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
262   connect( SelectButtonC2A2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
263
264   connect( LineEditC1A1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
265   connect( LineEditC1A2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
266   connect( LineEditC2A1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
267   connect( LineEditC2A2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
268
269   connect( myGeomGUI,   SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;  
270   connect( mySelection, SIGNAL( currentSelectionChanged() ),      this, SLOT( SelectionIntoArgument() ) );
271   /* to close dialog if study change */
272   connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ;
273  
274   /* Move widget on the botton right corner of main widget */
275   int x, y ;
276   myGeomGUI->DefineDlgPosition( this, x, y ) ;
277   this->move( x, y ) ;
278   this->show() ; /* displays Dialog */
279
280   ComboTextChanged();
281   return ;
282 }
283
284 //=================================================================================
285 // function : ClickOnOk()
286 // purpose  :
287 //=================================================================================
288 void GeometryGUI_PartitionDlg::ClickOnOk()
289 {
290   this->ClickOnApply() ;
291   this->ClickOnCancel() ;
292
293   return ;
294 }
295
296 //=================================================================================
297 // function : ClickOnApply()
298 // purpose  :
299 //=================================================================================
300 void GeometryGUI_PartitionDlg::ClickOnApply()
301 {
302   myGeomGUI->GetDesktop()->putInfo( tr("") ) ;
303   if (myOkListShapes || myOkListTools || myOkKeepShape || myOkRemoveShape)
304   {
305     GEOM::shape_type limit;
306     switch (myLimit) {
307 //    case 0: limit = GEOM::SOLID ; break;
308     case 0: limit = GEOM::SHAPE ; break;  
309     case 1: limit = GEOM::SHELL ; break;
310     case 2: limit = GEOM::FACE  ; break;
311     case 3: limit = GEOM::WIRE  ; break; 
312     case 4: limit = GEOM::EDGE  ; break; 
313     case 5: limit = GEOM::VERTEX; break; 
314     default:limit = GEOM::SHAPE;
315     }
316     myGeomGUI->MakePartitionAndDisplay (myListShapes,
317                                         myListTools,
318                                         myListKeepInside,
319                                         myListRemoveInside,
320                                         limit);
321
322   }
323   // accept();
324   return ;
325 }
326
327
328 //=================================================================================
329 // function : ClickOnCancel()
330 // purpose  :
331 //=================================================================================
332 void GeometryGUI_PartitionDlg::ClickOnCancel()
333 {
334   myGeomGUI->EraseSimulationShape() ;
335   disconnect( mySelection, 0, this, 0 );
336   myGeomGUI->ResetState() ;
337   reject() ;
338   return ;
339 }
340
341
342 //=================================================================================
343 // function : ConstructorsClicked()
344 // purpose  :
345 //=================================================================================
346 // void GeometryGUI_PartitionDlg::ConstructorsClicked(int constructorId)
347 // {
348 // }
349
350
351 //=================================================================================
352 // function : SelectionIntoArgument()
353 // purpose  : Called when selection as changed or other case
354 //=================================================================================
355 void GeometryGUI_PartitionDlg::SelectionIntoArgument()
356 {
357   myEditCurrentArgument->setText("") ;
358   QString aString = ""; /* name of selection */
359   int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ;
360
361   if ( nbSel < 1 ) {
362     if      ( myEditCurrentArgument == LineEditC1A1 ) {
363       myOkListShapes = false ;
364     }
365     else if ( myEditCurrentArgument == LineEditC1A2 ) {
366       myOkListTools = false ;
367     }
368     else if ( myEditCurrentArgument == LineEditC2A1 ) {
369       myOkListTools = false ;
370     }
371     else if ( myEditCurrentArgument == LineEditC2A2 ) {
372       myOkListTools = false ;
373     }
374     return ;
375   }
376         
377   if ( myEditCurrentArgument == LineEditC1A1  ) {
378     myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes) ;
379     myEditCurrentArgument->setText(aString) ;
380     myOkListShapes = true ;
381   }
382   else if ( myEditCurrentArgument == LineEditC1A2  ) {
383     myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListTools)  ;
384     myEditCurrentArgument->setText(aString) ;
385     myOkListTools = true ;
386   }
387   else if ( myEditCurrentArgument == LineEditC2A1 ) {
388     myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListRemoveInside)  ;
389     myEditCurrentArgument->setText(aString) ;
390     myOkKeepShape = true ;
391   }
392   else if ( myEditCurrentArgument == LineEditC2A2 ) {
393     myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListKeepInside)  ;
394     myEditCurrentArgument->setText(aString) ;
395     myOkRemoveShape = true ;
396   }
397   /* no simulation */
398   return ;
399 }
400
401
402 //=================================================================================
403 // function : SetEditCurrentArgument()
404 // purpose  :
405 //=================================================================================
406 void GeometryGUI_PartitionDlg::SetEditCurrentArgument()
407 {
408   QPushButton* send = (QPushButton*)sender();
409   
410   if (send == SelectButtonC1A1) {
411     LineEditC1A1->setFocus() ;
412     myEditCurrentArgument = LineEditC1A1 ;
413   }
414   else if(send == SelectButtonC1A2) {
415     LineEditC1A2->setFocus() ;
416     myEditCurrentArgument = LineEditC1A2 ;
417   }
418   else if(send == SelectButtonC2A1) {
419     LineEditC2A1->setFocus() ;
420     myEditCurrentArgument = LineEditC2A1 ;
421   }
422   else if(send == SelectButtonC2A2) {
423     LineEditC2A2->setFocus() ;
424     myEditCurrentArgument = LineEditC2A2 ;
425   }
426   SelectionIntoArgument() ;
427   
428   return ;
429 }
430
431 //=================================================================================
432 // function : LineEditReturnPressed()
433 // purpose  :
434 //=================================================================================
435 void GeometryGUI_PartitionDlg::LineEditReturnPressed()
436 {  
437   QLineEdit* send = (QLineEdit*)sender();  
438   if( send == LineEditC1A1 )
439     myEditCurrentArgument = LineEditC1A1 ;
440   else if ( send == LineEditC1A2 )
441     myEditCurrentArgument = LineEditC1A2 ; 
442   else if ( send == LineEditC2A1 )
443     myEditCurrentArgument = LineEditC2A1 ; 
444   else if ( send == LineEditC2A2 )
445     myEditCurrentArgument = LineEditC2A2 ; 
446   else
447     return ;
448   
449   /* User name of object input management                          */
450   /* If successfull the selection is changed and signal emitted... */
451   /* so SelectionIntoArgument() is automatically called.           */
452   const QString objectUserName = myEditCurrentArgument->text() ;
453   QWidget* thisWidget = (QWidget*)this ;
454   if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) {
455     myEditCurrentArgument->setText( objectUserName ) ;
456   }
457   return ;
458 }
459
460
461 //=================================================================================
462 // function : DeactivateActiveDialog()
463 // purpose  :
464 //=================================================================================
465
466 void GeometryGUI_PartitionDlg::DeactivateActiveDialog()
467 {
468   if ( GroupConstructors->isEnabled() ) {
469     GroupConstructors->setEnabled(false) ;
470     GroupC1->setEnabled(false) ;
471     GroupC2->setEnabled(false) ;
472     GroupButtons->setEnabled(false) ;
473   }
474   return ;
475 }
476
477
478 //=================================================================================
479 // function : ActivateThisDialog()
480 // purpose  :
481 //=================================================================================
482 void GeometryGUI_PartitionDlg::ActivateThisDialog()
483 {
484   /* Emit a signal to deactivate the active dialog */
485   myGeomGUI->EmitSignalDeactivateDialog() ;   
486   GroupConstructors->setEnabled(true) ;
487   GroupC1->setEnabled(true) ;
488   GroupC2->setEnabled(true) ;
489   GroupButtons->setEnabled(true) ;
490   return ;
491 }
492
493
494 //=================================================================================
495 // function : enterEvent()
496 // purpose  :
497 //=================================================================================
498 void GeometryGUI_PartitionDlg::enterEvent(QEvent* e)
499 {
500   if ( GroupConstructors->isEnabled() )
501     return ;  
502   ActivateThisDialog() ;
503   return ;
504 }
505
506
507 //=================================================================================
508 // function : closeEvent()
509 // purpose  :
510 //=================================================================================
511 void GeometryGUI_PartitionDlg::closeEvent( QCloseEvent* e )
512 {
513   /* same than click on cancel button */
514   this->ClickOnCancel() ;
515   return ;
516 }
517
518 //=======================================================================
519 //function : ComboTextChanged
520 //purpose  : 
521 //=======================================================================
522
523 void GeometryGUI_PartitionDlg::ComboTextChanged()
524 {
525
526  myLimit = ComboBox1->currentItem();
527  GroupC2->setEnabled( ComboBox1->currentItem() < 3 );
528
529  return ;
530 }