Salome HOME
NRI : First integration.
[modules/geom.git] / src / GEOMGUI / GeometryGUI_SphereDlg.cxx
1 using namespace std;
2 //  File      : GeometryGUI_SphereDlg.cxx
3 //  Created   :
4 //  Author    : Lucien PIGNOLONI
5 //  Project   : SALOME
6 //  Module    : GeometryGUI
7 //  Copyright : OPEN CASCADE
8 //  $Header$
9
10 #include "GeometryGUI_SphereDlg.h"
11 #include "GeometryGUI_SpinBox.h"
12
13 #include "GeometryGUI.h"
14
15 #include "QAD_Application.h"
16 #include "QAD_Desktop.h"
17 #include "QAD_Config.h"
18 #include "utilities.h"
19
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 <qvalidator.h>
32 #include <qpixmap.h>
33
34
35
36 //=================================================================================
37 // class    : GeometryGUI_SphereDlg()
38 // purpose  : Constructs a GeometryGUI_SphereDlg which is a child of 'parent', with the 
39 //            name 'name' and widget flags set to 'f'.
40 //            The dialog will by default be modeless, unless you set 'modal' to
41 //            TRUE to construct a modal dialog.
42 //=================================================================================
43 GeometryGUI_SphereDlg::GeometryGUI_SphereDlg( QWidget* parent,  const char* name, SALOME_Selection* Sel, bool modal, WFlags fl )
44     : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
45 {
46     QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GeometryGUI",tr("ICON_DLG_SPHERE_P")));
47     QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GeometryGUI",tr("ICON_SELECT")));
48     QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap( "GeometryGUI",tr("ICON_DLG_SPHERE_DXYZ")));
49
50     if ( !name )
51       setName( "GeometryGUI_SphereDlg" );
52     resize( 303, 219 ); 
53     setCaption( tr( "GEOM_SPHERE_TITLE"  ) );
54     setSizeGripEnabled( TRUE );
55     GeometryGUI_SphereDlgLayout = new QGridLayout( this ); 
56     GeometryGUI_SphereDlgLayout->setSpacing( 6 );
57     GeometryGUI_SphereDlgLayout->setMargin( 11 );
58     
59     /***************************************************************/
60     GroupButtons = new QGroupBox( this, "GroupButtons" );
61     GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); 
62     GroupButtons->setTitle( tr( ""  ) );
63     GroupButtons->setColumnLayout(0, Qt::Vertical );
64     GroupButtons->layout()->setSpacing( 0 );
65     GroupButtons->layout()->setMargin( 0 );
66     GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
67     GroupButtonsLayout->setAlignment( Qt::AlignTop );
68     GroupButtonsLayout->setSpacing( 6 );
69     GroupButtonsLayout->setMargin( 11 );
70     buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
71     buttonCancel->setText( tr( "GEOM_BUT_CLOSE"  ) );
72     buttonCancel->setAutoDefault( TRUE );
73     GroupButtonsLayout->addWidget( buttonCancel, 0, 3 );
74     buttonApply = new QPushButton( GroupButtons, "buttonApply" );
75     buttonApply->setText( tr( "GEOM_BUT_APPLY"  ) );
76     buttonApply->setAutoDefault( TRUE );
77     GroupButtonsLayout->addWidget( buttonApply, 0, 1 );
78     QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
79     GroupButtonsLayout->addItem( spacer_9, 0, 2 );
80     buttonOk = new QPushButton( GroupButtons, "buttonOk" );
81     buttonOk->setText( tr( "GEOM_BUT_OK"  ) );
82     buttonOk->setAutoDefault( TRUE );
83     buttonOk->setDefault( TRUE );
84     GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
85     GeometryGUI_SphereDlgLayout->addWidget( GroupButtons, 2, 0 );
86
87     /***************************************************************/
88     GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
89     GroupConstructors->setTitle( tr( "GEOM_SPHERE"  ) );
90     GroupConstructors->setExclusive( TRUE );
91     GroupConstructors->setColumnLayout(0, Qt::Vertical );
92     GroupConstructors->layout()->setSpacing( 0 );
93     GroupConstructors->layout()->setMargin( 0 );
94     GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
95     GroupConstructorsLayout->setAlignment( Qt::AlignTop );
96     GroupConstructorsLayout->setSpacing( 6 );
97     GroupConstructorsLayout->setMargin( 11 );
98     QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
99     GroupConstructorsLayout->addItem( spacer_2, 0, 3 );
100     Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" );
101     Constructor1->setText( tr( ""  ) );
102     Constructor1->setPixmap( image0 );
103     Constructor1->setChecked( TRUE );
104     Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) );
105     Constructor1->setMinimumSize( QSize( 50, 0 ) );
106     GroupConstructorsLayout->addWidget( Constructor1, 0, 0 );
107     QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
108     GroupConstructorsLayout->addItem( spacer_3, 0, 1 );
109     Constructor2 = new QRadioButton( GroupConstructors, "Constructor2" );
110     Constructor2->setText( tr( ""  ) );
111     GroupConstructors->insert( Constructor2, 1 );
112     Constructor2->setMinimumSize( QSize( 50, 0 ) );
113     Constructor2->setPixmap( image2 );
114     GroupConstructorsLayout->addWidget( Constructor2, 0, 2 );
115     GeometryGUI_SphereDlgLayout->addWidget( GroupConstructors, 0, 0 );
116     GroupConstructor1 = new QGroupBox( this, "GroupConstructor1" );
117     GroupConstructor1->setTitle( tr( "GEOM_SPHERE_CR"  ) );
118     GroupConstructor1->setColumnLayout(0, Qt::Vertical );
119     GroupConstructor1->layout()->setSpacing( 0 );
120     GroupConstructor1->layout()->setMargin( 0 );
121     GroupConstructor1Layout = new QGridLayout( GroupConstructor1->layout() );
122     GroupConstructor1Layout->setAlignment( Qt::AlignTop );
123     GroupConstructor1Layout->setSpacing( 6 );
124     GroupConstructor1Layout->setMargin( 11 );
125     LineEditC1A1 = new QLineEdit( GroupConstructor1, "LineEditC1A1" );
126     LineEditC1A1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1->sizePolicy().hasHeightForWidth() ) );
127     GroupConstructor1Layout->addWidget( LineEditC1A1, 0, 2 );
128     SelectButtonC1A1 = new QPushButton( GroupConstructor1, "SelectButtonC1A1" );
129     SelectButtonC1A1->setText( tr( ""  ) );
130     SelectButtonC1A1->setPixmap( image1 );
131     GroupConstructor1Layout->addWidget( SelectButtonC1A1, 0, 1 );
132     TextLabelC1A1 = new QLabel( GroupConstructor1, "TextLabelC1A1" );
133     TextLabelC1A1->setText( tr( "GEOM_CENTER"  ) );
134     TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) );
135     TextLabelC1A1->setFrameShape( QLabel::NoFrame );
136     TextLabelC1A1->setFrameShadow( QLabel::Plain );
137     GroupConstructor1Layout->addWidget( TextLabelC1A1, 0, 0 );
138     TextLabelC1A2 = new QLabel( GroupConstructor1, "TextLabelC1A2" );
139     TextLabelC1A2->setText( tr( "GEOM_RADIUS"  ) );
140     TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) );
141     TextLabelC1A2->setFrameShape( QLabel::NoFrame );
142     TextLabelC1A2->setFrameShadow( QLabel::Plain );
143     GroupConstructor1Layout->addWidget( TextLabelC1A2, 1, 0 );
144
145     SpinBox_C1A2 = new GeometryGUI_SpinBox( GroupConstructor1, "GeomSpinBox_C1A2" ) ;
146     GroupConstructor1Layout->addWidget( SpinBox_C1A2, 1, 2 );
147
148     GeometryGUI_SphereDlgLayout->addWidget( GroupConstructor1, 1, 0 );
149
150     /***************************************************************/
151     GroupConstructor2 = new QGroupBox( this, "GroupConstructor2" );
152     GroupConstructor2->setTitle( tr( "GEOM_SPHERE_RO"  ) );
153     GroupConstructor2->setColumnLayout(0, Qt::Vertical );
154     GroupConstructor2->layout()->setSpacing( 0 );
155     GroupConstructor2->layout()->setMargin( 0 );
156     GroupConstructor2Layout = new QGridLayout( GroupConstructor2->layout() );
157     GroupConstructor2Layout->setAlignment( Qt::AlignTop );
158     GroupConstructor2Layout->setSpacing( 6 );
159     GroupConstructor2Layout->setMargin( 11 );
160
161     SpinBox_C2A1 = new GeometryGUI_SpinBox( GroupConstructor2, "GeomSpinBox_C2A1" ) ;
162     GroupConstructor2Layout->addWidget( SpinBox_C2A1, 0, 1 );
163
164     TextLabelC2A1 = new QLabel( GroupConstructor2, "TextLabelC2A1" );
165     TextLabelC2A1->setText( tr( "GEOM_RADIUS" ) );
166     TextLabelC2A1->setMinimumSize( QSize( 50, 0 ) );
167     TextLabelC2A1->setFrameShape( QLabel::NoFrame );
168     TextLabelC2A1->setFrameShadow( QLabel::Plain );
169     GroupConstructor2Layout->addWidget( TextLabelC2A1, 0, 0 );
170     QSpacerItem* spacer_5 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
171     GroupConstructor2Layout->addItem( spacer_5, 1, 1 );
172     GeometryGUI_SphereDlgLayout->addWidget( GroupConstructor2, 1, 0 );
173
174     Init(Sel) ; /* Initialisations */
175 }
176
177
178 //=================================================================================
179 // function : ~GeometryGUI_SphereDlg()
180 // purpose  : Destroys the object and frees any allocated resources
181 //=================================================================================
182 GeometryGUI_SphereDlg::~GeometryGUI_SphereDlg()
183 {  
184   /* no need to delete child widgets, Qt does it all for us */
185 }
186
187
188 //=================================================================================
189 // function : Init()
190 // purpose  :
191 //=================================================================================
192 void GeometryGUI_SphereDlg::Init( SALOME_Selection* Sel )
193 {
194
195   /* Get setting of step value from file configuration */
196   double step ;
197   QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ;
198   step = St.toDouble() ;
199
200   /* min, max, step and decimals for spin boxes */
201   SpinBox_C1A2->RangeStepAndValidator( 0.001, 999.999, step, 3 ) ;
202   SpinBox_C1A2->SetValue( 100.0 ) ;  
203   SpinBox_C2A1->RangeStepAndValidator( 0.001, 999.999, step, 3 ) ;
204   SpinBox_C2A1->SetValue( 100.0 ) ;
205   
206   GroupConstructor1->show();
207   GroupConstructor2->hide();
208   myConstructorId = 0 ;
209   Constructor1->setChecked( TRUE );
210   myEditCurrentArgument = LineEditC1A1 ;        
211   mySelection = Sel;
212   myGeomGUI = GeometryGUI::GetGeometryGUI() ;
213   myPoint1.SetCoord( 0.0, 0.0, 0.0 );
214   
215   myRadius = 100.0 ;
216   myOkRadius = true ;
217   myOkPoint1 = false ;
218   
219   mySimulationTopoDs.Nullify() ;
220   myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;  
221   
222   /* Filters definition */
223   Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "Geometry");
224   myGeom = GEOM::GEOM_Gen::_narrow(comp);
225   myVertexFilter = new GEOM_ShapeTypeFilter( TopAbs_VERTEX, myGeom );
226   mySelection->AddFilter(myVertexFilter) ; /* first filter used */
227
228   /* signals and slots connections */
229   connect( buttonOk, SIGNAL( clicked() ),     this, SLOT( ClickOnOk() ) );
230   connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ;
231   connect( buttonApply, SIGNAL( clicked() ),  this, SLOT(ClickOnApply() ) );
232   connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) );  
233   connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
234   
235   connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
236
237   connect( SpinBox_C1A2, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ;
238   connect( SpinBox_C2A1, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ;
239
240   connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;  
241   connect( mySelection, SIGNAL( currentSelectionChanged() ),     this, SLOT( SelectionIntoArgument() ) );
242   /* to close dialog if study change */
243   connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ;
244  
245   /* Move widget on the botton right corner of main widget */
246   int x, y ;
247   myGeomGUI->DefineDlgPosition( this, x, y ) ;
248   this->move( x, y ) ;
249   this->show() ; /* displays Dialog */
250
251   return ;
252 }
253
254
255
256 //=================================================================================
257 // function : ConstructorsClicked()
258 // purpose  : Radio button management
259 //=================================================================================
260 void GeometryGUI_SphereDlg::ConstructorsClicked(int constructorId)
261 {
262   myGeomGUI->EraseSimulationShape() ;
263
264   switch (constructorId)
265     {
266     case 0:
267       {
268         GroupConstructor1->show();
269         GroupConstructor2->hide();
270         myConstructorId = constructorId ;
271         myEditCurrentArgument = SpinBox_C1A2 ;  
272         LineEditC1A1->setText(tr("")) ;
273         SpinBox_C1A2->SetValue( 100.0 ) ;
274         myRadius = 100.0 ;
275         myOkRadius = true ;
276         myOkPoint1 = false ;
277         /* filter for next selections */
278         mySelection->ClearFilters() ;
279         mySelection->AddFilter( myVertexFilter );
280         connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
281         break;
282       }
283     case 1:
284       {
285         GroupConstructor1->hide();
286         GroupConstructor2->show();
287         myConstructorId = constructorId ;
288         myEditCurrentArgument = SpinBox_C2A1 ;;
289         SpinBox_C2A1->SetValue( 100.0 ) ;
290         myRadius = 100.0 ;
291         myOkRadius = true ;
292         myPoint1.SetCoord( 0.0, 0.0, 0.0 ); /* at origin */
293         myOkPoint1 = false ;
294         mySimulationTopoDs = BRepPrimAPI_MakeSphere(myPoint1, myRadius).Shape();
295         myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; 
296         /* no filters here */
297         mySelection->ClearFilters() ;
298         break;
299       }
300     }
301  return ;
302 }
303
304 //=================================================================================
305 // function : ClickOnApply()
306 // purpose  :
307 //=================================================================================
308 void GeometryGUI_SphereDlg::ClickOnApply()
309 {
310   myGeomGUI->EraseSimulationShape() ;
311   mySimulationTopoDs.Nullify() ;
312   myGeomGUI->GetDesktop()->putInfo( tr("") ) ; 
313   switch(myConstructorId)
314     { 
315     case 0 :
316       { 
317         if( myOkPoint1 && myOkRadius ) {
318           myGeomGUI->MakeSphereAndDisplay( myPoint1, myRadius ) ;
319         }
320         break ;
321       }
322     case 1 :
323       {
324         if( myOkRadius )
325           myGeomGUI->MakeSphereAndDisplay( myPoint1, myRadius ) ;
326         break ;
327       }
328     }
329   return ;
330 }
331
332
333 //=================================================================================
334 // function : ClickOnOk()
335 // purpose  :
336 //=================================================================================
337 void GeometryGUI_SphereDlg::ClickOnOk()
338 {
339   this->ClickOnApply() ;
340   this->ClickOnCancel() ;
341
342   return ;
343 }
344
345 //=================================================================================
346 // function : ClickOnCancel()
347 // purpose  :
348 //=================================================================================
349 void GeometryGUI_SphereDlg::ClickOnCancel()
350 {
351   mySelection->ClearFilters() ;
352   myGeomGUI->EraseSimulationShape() ;
353   mySimulationTopoDs.Nullify() ;
354   disconnect( mySelection, 0, this, 0 );
355   myGeomGUI->ResetState() ;
356   reject() ;
357   return ;
358 }
359
360
361 //=================================================================================
362 // function : SelectionIntoArgument()
363 // purpose  : Called when selection as changed or other case
364 //=================================================================================
365 void GeometryGUI_SphereDlg::SelectionIntoArgument()
366 {
367   myGeomGUI->EraseSimulationShape() ; 
368   mySimulationTopoDs.Nullify() ;
369   
370   /* Future name of selection */
371   QString aString = "";
372
373   int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ;
374   if ( nbSel != 1 ) {
375     if ( myEditCurrentArgument == LineEditC1A1 ) {
376       LineEditC1A1->setText("") ;
377       myOkPoint1 = false ;
378     }
379     return ;
380   }
381   
382   /* nbSel == 1 ! */
383   TopoDS_Shape S; 
384   if( !myGeomGUI->GetTopoFromSelection(mySelection, S) )
385     return ;
386     
387   /* Constructor 1 treatment */
388   if ( myConstructorId == 0 && myEditCurrentArgument == LineEditC1A1 && myGeomGUI->VertexToPoint(S, myPoint1) ) {
389     LineEditC1A1->setText(aString) ;
390     myOkPoint1 = true ;
391   }
392   
393   if( ( myOkPoint1 || myConstructorId == 1 ) && myOkRadius )  {
394     mySimulationTopoDs = BRepPrimAPI_MakeSphere(myPoint1, myRadius).Shape();
395     myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; 
396   }
397   return ;
398 }
399
400
401 //=================================================================================
402 // function : LineEditReturnPressed()
403 // purpose  :
404 //=================================================================================
405 void GeometryGUI_SphereDlg::LineEditReturnPressed()
406 {
407   QLineEdit* send = (QLineEdit*)sender();  
408   if( send == LineEditC1A1 )
409     myEditCurrentArgument = LineEditC1A1 ;
410   else
411     return ;
412   
413   /* User name of object input management                          */
414   /* If successfull the selection is changed and signal emitted... */
415   /* so SelectionIntoArgument() is automatically called.           */
416   QLineEdit* LE = (QLineEdit*)myEditCurrentArgument ;
417   const QString objectUserName = LE->text() ;
418   QWidget* thisWidget = (QWidget*)this ;
419   if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) {
420     LE->setText( objectUserName ) ;
421   }
422   return ;
423 }
424
425
426 //=================================================================================
427 // function : ValueChangedInSpinBox()
428 // purpose  :
429 //=================================================================================
430 void GeometryGUI_SphereDlg::ValueChangedInSpinBox( double newValue )
431 {  
432   myRadius = newValue ;
433   myOkRadius = true ;
434   
435   if ( ( myOkPoint1 || myConstructorId == 1 ) && myOkRadius ) {
436     mySimulationTopoDs = BRepPrimAPI_MakeSphere(myPoint1, myRadius).Shape();
437     myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; 
438   }
439   else {
440     myGeomGUI->EraseSimulationShape() ; 
441     mySimulationTopoDs.Nullify() ;
442   }
443
444   return ;
445 }
446
447
448
449 //=================================================================================
450 // function : SetEditCurrentArgument()
451 // purpose  :
452 //=================================================================================
453 void GeometryGUI_SphereDlg::SetEditCurrentArgument()
454 {
455   QPushButton* send = (QPushButton*)sender();
456   switch (myConstructorId)
457     {
458     case 0: /* default constructor */
459       { 
460         if(send == SelectButtonC1A1) {
461           LineEditC1A1->setFocus() ;
462           myEditCurrentArgument = LineEditC1A1;
463           mySelection->AddFilter(myVertexFilter) ;
464           SelectionIntoArgument() ;
465         }
466         break;
467       }
468     case 1:
469       {
470         /* no selection button here */
471         break;
472       }
473
474     }
475   return ;
476 }
477
478 //=================================================================================
479 // function : DeactivateActiveDialog()
480 // purpose  :
481 //=================================================================================
482 void GeometryGUI_SphereDlg::DeactivateActiveDialog()
483 {
484   if ( GroupConstructors->isEnabled() ) {
485
486     GroupConstructors->setEnabled(false) ;
487     GroupConstructor1->setEnabled(false) ;
488     GroupConstructor2->setEnabled(false) ;
489     GroupButtons->setEnabled(false) ;
490     disconnect( mySelection, 0, this, 0 );
491     myGeomGUI->EraseSimulationShape() ;
492     mySelection->ClearFilters() ;
493   }
494   return ;
495 }
496
497 //=================================================================================
498 // function : ActivateThisDialog()
499 // purpose  :
500 //=================================================================================
501 void GeometryGUI_SphereDlg::ActivateThisDialog()
502 {
503   /* Emit a signal to deactivate other active dialog */
504   myGeomGUI->EmitSignalDeactivateDialog() ;
505   GroupConstructors->setEnabled(true) ;
506   GroupConstructor1->setEnabled(true) ;
507   GroupConstructor2->setEnabled(true) ;
508   GroupButtons->setEnabled(true) ;
509
510   connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
511   if( !mySimulationTopoDs.IsNull() )
512     myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ;
513
514   return ;
515 }
516
517
518 //=================================================================================
519 // function : enterEvent()
520 // purpose  :
521 //=================================================================================
522 void GeometryGUI_SphereDlg::enterEvent(QEvent* e)
523 {
524   if ( GroupConstructors->isEnabled() )
525     return ;  
526   ActivateThisDialog() ;
527 }
528
529
530 //=================================================================================
531 // function : closeEvent()
532 // purpose  :
533 //=================================================================================
534 void GeometryGUI_SphereDlg::closeEvent( QCloseEvent* e )
535 {
536   this->ClickOnCancel() ; /* same than click on cancel button */
537 }
538
539
540