]> SALOME platform Git repositories - modules/smesh.git/blob - src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx
Salome HOME
d01762f3ac2bdc4acfb73eca5fb6f9766a4c1bee
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ExtrusionDlg.cxx
1 //  SMESH SMESHGUI : GUI for SMESH 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   : SMESHGUI_ExtrusionDlg.cxx
25 //  Author : Michael ZORIN
26 //  Module : SMESH
27 //  $Header: 
28
29 #include "SMESHGUI_ExtrusionDlg.h"
30 #include "SMESHGUI.h"
31 #include "SMESHGUI_SpinBox.h"
32 #include "SMESHGUI_Utils.h"
33 #include "SMESHGUI_VTKUtils.h"
34 #include "SMESHGUI_IdValidator.h"
35 #include "SMESH_Actor.h"
36 #include "SMDS_Mesh.hxx"
37
38 #include <TopoDS.hxx>
39 #include <gp_Lin.hxx>
40 #include <gp_Vec.hxx>
41 #include <BRepAdaptor_Curve.hxx>
42
43 #include "QAD_Application.h"
44 #include "QAD_Desktop.h"
45 #include "QAD_MessageBox.h"
46 #include "utilities.h"
47
48 // QT Includes
49 #include <qapplication.h>
50 #include <qbuttongroup.h>
51 #include <qgroupbox.h>
52 #include <qlabel.h>
53 #include <qlineedit.h>
54 #include <qpushbutton.h>
55 #include <qradiobutton.h>
56 #include <qlayout.h>
57 #include <qspinbox.h> 
58 #include <qvalidator.h>
59 #include <qpixmap.h>
60
61 using namespace std;
62
63 //=================================================================================
64 // class    : SMESHGUI_ExtrusionDlg()
65 // purpose  : 
66 //=================================================================================
67 SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg( QWidget* parent, const char* name, SALOME_Selection* Sel,
68                                               bool modal, WFlags fl )
69   : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu |
70              Qt::WDestructiveClose)
71 {
72   QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "SMESH",tr("ICON_DLG_EDGE")));
73   QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "SMESH",tr("ICON_DLG_TRIANGLE")));
74   QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap( "SMESH",tr("ICON_SELECT")));
75
76   if ( !name )
77     setName( "SMESHGUI_ExtrusionDlg" );
78   resize( 303, 185 ); 
79   setCaption( tr( "EXTRUSION_ALONG_LINE" ) );
80   setSizeGripEnabled( TRUE );
81   SMESHGUI_ExtrusionDlgLayout = new QGridLayout( this ); 
82   SMESHGUI_ExtrusionDlgLayout->setSpacing( 6 );
83   SMESHGUI_ExtrusionDlgLayout->setMargin( 11 );
84
85   /***************************************************************/
86   GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
87   GroupConstructors->setTitle( tr( "SMESH_EXTRUSION"  ) );
88   GroupConstructors->setExclusive( TRUE );
89   GroupConstructors->setColumnLayout(0, Qt::Vertical );
90   GroupConstructors->layout()->setSpacing( 0 );
91   GroupConstructors->layout()->setMargin( 0 );
92   GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
93   GroupConstructorsLayout->setAlignment( Qt::AlignTop );
94   GroupConstructorsLayout->setSpacing( 6 );
95   GroupConstructorsLayout->setMargin( 11 );
96   RadioButton1= new QRadioButton( GroupConstructors, "RadioButton1" );
97   RadioButton1->setText( tr( ""  ) );
98   RadioButton1->setPixmap( image0 );
99   GroupConstructorsLayout->addWidget( RadioButton1, 0, 0 );
100   RadioButton2= new QRadioButton( GroupConstructors, "RadioButton2" );
101   RadioButton2->setText( tr( ""  ) );
102   RadioButton2->setPixmap( image1 );
103   GroupConstructorsLayout->addWidget( RadioButton2, 0, 2 );
104   SMESHGUI_ExtrusionDlgLayout->addWidget( GroupConstructors, 0, 0 );
105   
106   /***************************************************************/
107   GroupButtons = new QGroupBox( this, "GroupButtons" );
108   GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); 
109   GroupButtons->setTitle( tr( ""  ) );
110   GroupButtons->setColumnLayout(0, Qt::Vertical );
111   GroupButtons->layout()->setSpacing( 0 );
112   GroupButtons->layout()->setMargin( 0 );
113   GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
114   GroupButtonsLayout->setAlignment( Qt::AlignTop );
115   GroupButtonsLayout->setSpacing( 6 );
116   GroupButtonsLayout->setMargin( 11 );
117   buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
118   buttonCancel->setText( tr( "SMESH_BUT_CLOSE"  ) );
119   buttonCancel->setAutoDefault( TRUE );
120   GroupButtonsLayout->addWidget( buttonCancel, 0, 3 );
121   buttonApply = new QPushButton( GroupButtons, "buttonApply" );
122   buttonApply->setText( tr( "SMESH_BUT_APPLY"  ) );
123   buttonApply->setAutoDefault( TRUE );
124   GroupButtonsLayout->addWidget( buttonApply, 0, 1 );
125   QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
126   GroupButtonsLayout->addItem( spacer_9, 0, 2 );
127   buttonOk = new QPushButton( GroupButtons, "buttonOk" );
128   buttonOk->setText( tr( "SMESH_BUT_OK"  ) );
129   buttonOk->setAutoDefault( TRUE );
130   buttonOk->setDefault( TRUE );
131   GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
132   SMESHGUI_ExtrusionDlgLayout->addWidget( GroupButtons, 2, 0 );
133
134   /***************************************************************/
135   GroupArguments = new QGroupBox( this, "GroupArguments" );
136   GroupArguments->setTitle( tr( "EXTRUSION_1D"  ) );
137   GroupArguments->setColumnLayout(0, Qt::Vertical );
138   GroupArguments->layout()->setSpacing( 0 );
139   GroupArguments->layout()->setMargin( 0 );
140   GroupArgumentsLayout = new QGridLayout( GroupArguments->layout());
141   GroupArgumentsLayout->setAlignment( Qt::AlignTop );
142   GroupArgumentsLayout->setSpacing( 6 );
143   GroupArgumentsLayout->setMargin( 11 );
144
145   // Controls for elements selection
146   TextLabelElements  = new QLabel( GroupArguments, "TextLabelElements" );
147   TextLabelElements->setText( tr( "SMESH_ID_ELEMENTS"  ) );
148   GroupArgumentsLayout->addWidget( TextLabelElements, 0, 0 );
149
150   SelectElementsButton  = new QPushButton( GroupArguments, "SelectElementsButton" );
151   SelectElementsButton->setText( tr( ""  ) );
152   SelectElementsButton->setPixmap( image2 );
153   SelectElementsButton->setToggleButton( FALSE );
154   GroupArgumentsLayout->addWidget( SelectElementsButton, 0, 1 );
155   
156   LineEditElements  = new QLineEdit( GroupArguments, "LineEditElements" );
157   LineEditElements->setValidator( new SMESHGUI_IdValidator( this, "validator" ));
158   GroupArgumentsLayout->addMultiCellWidget( LineEditElements, 0, 0, 2, 7 );
159
160   // Controls for vector selection
161   TextLabelVector = new QLabel( GroupArguments, "TextLabelVector" );
162   TextLabelVector->setText( tr( "SMESH_VECTOR" ) );
163   GroupArgumentsLayout->addWidget( TextLabelVector, 1, 0 );
164   
165   TextLabelDx = new QLabel( GroupArguments, "TextLabelDx" );
166   TextLabelDx->setText( tr( "SMESH_DX" ) );
167   GroupArgumentsLayout->addWidget( TextLabelDx, 1, 2 );
168
169   SpinBox_Dx = new SMESHGUI_SpinBox(GroupArguments, "SpinBox_Dx");
170   GroupArgumentsLayout->addWidget( SpinBox_Dx, 1, 3 );
171
172   TextLabelDy = new QLabel( GroupArguments, "TextLabelDy" );
173   TextLabelDy->setText( tr( "SMESH_DY" ) );
174   GroupArgumentsLayout->addWidget( TextLabelDy, 1, 4 );
175
176   SpinBox_Dy = new SMESHGUI_SpinBox(GroupArguments, "SpinBox_Dy");
177   GroupArgumentsLayout->addWidget( SpinBox_Dy, 1, 5 );
178
179   TextLabelDz = new QLabel( GroupArguments, "TextLabelDz" );
180   TextLabelDz->setText( tr( "SMESH_DZ" ) );
181   GroupArgumentsLayout->addWidget( TextLabelDz, 1, 6 );
182   
183   SpinBox_Dz = new SMESHGUI_SpinBox(GroupArguments, "SpinBox_Dz");
184   GroupArgumentsLayout->addWidget( SpinBox_Dz, 1, 7 );
185   
186   // Controls for nb. steps defining
187   TextLabelNbSteps = new QLabel( GroupArguments, "TextLabelNbSteps" );
188   TextLabelNbSteps->setText( tr( "SMESH_NUMBEROFSTEPS"  ) );
189   GroupArgumentsLayout->addMultiCellWidget( TextLabelNbSteps, 2, 2, 0, 1 );
190
191   SpinBox_NbSteps = new QSpinBox(GroupArguments, "SpinBox_NbSteps");
192   GroupArgumentsLayout->addMultiCellWidget( SpinBox_NbSteps, 2, 2,  2, 7 );
193   
194   SMESHGUI_ExtrusionDlgLayout->addWidget( GroupArguments, 1, 0 );
195   
196   /* Initialisations */
197   SpinBox_Dx->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 );
198   SpinBox_Dy->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 );
199   SpinBox_Dz->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 );
200
201   QIntValidator* anIntValidator = new QIntValidator(SpinBox_NbSteps);
202   SpinBox_NbSteps->setValidator(anIntValidator);
203   SpinBox_NbSteps->setRange( 1, 999999 );
204  
205   GroupArguments->show();
206   RadioButton1->setChecked( TRUE );
207   mySelection = Sel;  
208
209   mySMESHGUI  = SMESHGUI::GetSMESHGUI() ;
210   mySMESHGUI->SetActiveDialogBox( (QDialog*)this ) ;
211     
212   Init();
213   /* signals and slots connections */
214   connect( buttonOk, SIGNAL( clicked() ),     this, SLOT( ClickOnOk() ) );
215   connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ;
216   connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) );
217   connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) );
218   
219   connect( SelectElementsButton, SIGNAL (clicked() ),   this, SLOT( SetEditCurrentArgument() ) ) ;
220   connect( mySMESHGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;
221   connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
222   /* to close dialog if study change */
223   connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ;
224   connect( LineEditElements, SIGNAL( textChanged( const QString& )),
225            SLOT( onTextChange( const QString& )));
226   
227   /* Move widget on the botton right corner of main widget */
228   int x, y ;
229   mySMESHGUI->DefineDlgPosition( this, x, y ) ;
230   this->move( x, y ) ;
231   this->show() ; /* displays Dialog */
232
233   ConstructorsClicked(0);
234 }
235
236 //=================================================================================
237 // function : ~SMESHGUI_ExtrusionDlg()
238 // purpose  : Destroys the object and frees any allocated resources
239 //=================================================================================
240 SMESHGUI_ExtrusionDlg::~SMESHGUI_ExtrusionDlg()
241 {
242   // no need to delete child widgets, Qt does it all for us
243 }
244
245
246 //=================================================================================
247 // function : Init()
248 // purpose  :
249 //=================================================================================
250 void SMESHGUI_ExtrusionDlg::Init()
251 {
252   myBusy = false;    
253
254   SpinBox_NbSteps->setValue(1);
255   
256   myEditCurrentArgument = LineEditElements;
257   LineEditElements->setFocus();
258   myNbOkElements = 0 ;
259   myActor     = 0;
260   myMesh = SMESH::SMESH_Mesh::_nil();
261   
262   SpinBox_Dx->SetValue(0);
263   SpinBox_Dy->SetValue(0);
264   SpinBox_Dz->SetValue(0);
265   
266   SelectionIntoArgument();
267 }
268
269
270 //=================================================================================
271 // function : ConstructorsClicked()
272 // purpose  : Radio button management
273 //=================================================================================
274 void SMESHGUI_ExtrusionDlg::ConstructorsClicked(int constructorId)
275 {
276   disconnect(mySelection, 0, this, 0);
277   mySelection->ClearIObjects();
278   mySelection->ClearFilters();
279   myNbOkElements = 0 ;
280   myEditCurrentArgument = LineEditElements;
281   LineEditElements->setText("");
282   LineEditElements->setFocus();
283   
284   switch(constructorId)
285     { 
286     case 0 :
287       {
288         GroupArguments->setTitle( tr( "EXTRUSION_1D" ) );
289         QAD_Application::getDesktop()->SetSelectionMode( EdgeSelection, true );
290         break;
291       }
292     case 1 :
293       { 
294         GroupArguments->setTitle( tr( "EXTRUSION_2D" ) );
295         QAD_Application::getDesktop()->SetSelectionMode( FaceSelection, true );
296         break;
297       }
298     }
299   connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
300 }
301
302
303 //=================================================================================
304 // function : ClickOnApply()
305 // purpose  :
306 //=================================================================================
307 void SMESHGUI_ExtrusionDlg::ClickOnApply()
308 {
309   if (mySMESHGUI->ActiveStudyLocked())
310     return;
311   
312   if ( myNbOkElements)
313     {
314       QStringList aListElementsId = QStringList::split( " ", LineEditElements->text(), false);
315       
316       SMESH::long_array_var anElementsId = new SMESH::long_array;
317       
318       anElementsId->length( aListElementsId.count() );
319       for ( int i = 0; i < aListElementsId.count(); i++ )
320         anElementsId[i] = aListElementsId[i].toInt();
321       
322       SMESH::DirStruct aVector;
323       aVector.PS.x = SpinBox_Dx->GetValue();
324       aVector.PS.y = SpinBox_Dy->GetValue();
325       aVector.PS.z = SpinBox_Dz->GetValue();
326
327       long aNbSteps = (long)SpinBox_NbSteps->value();
328
329       try
330         {
331           SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
332           QApplication::setOverrideCursor(Qt::waitCursor);
333           aMeshEditor->ExtrusionSweep(anElementsId.inout(), aVector, aNbSteps);
334           QApplication::restoreOverrideCursor();
335         }
336       catch( ... )
337         {
338         }
339       
340       mySelection->ClearIObjects();
341       SMESH::UpdateView();
342       Init();
343     }
344 }
345
346 //=================================================================================
347 // function : ClickOnOk()
348 // purpose  :
349 //=================================================================================
350 void SMESHGUI_ExtrusionDlg::ClickOnOk()
351 {
352   this->ClickOnApply() ;
353   this->ClickOnCancel() ;
354 }
355
356         
357 //=================================================================================
358 // function : ClickOnCancel()
359 // purpose  :
360 //=================================================================================
361 void SMESHGUI_ExtrusionDlg::ClickOnCancel()
362 {
363   mySelection->ClearFilters();
364   mySelection->ClearIObjects();
365   SMESH::SetPointRepresentation(false);
366   QAD_Application::getDesktop()->SetSelectionMode( ActorSelection );
367   disconnect( mySelection, 0, this, 0 );
368   mySMESHGUI->ResetState() ;
369   reject() ;
370 }
371
372 //=======================================================================
373 //function : onTextChange
374 //purpose  : 
375 //=======================================================================
376 void SMESHGUI_ExtrusionDlg::onTextChange(const QString& theNewText)
377 {
378   QLineEdit* send = (QLineEdit*)sender();
379
380   if ( myBusy ) return;
381   myBusy = true;
382   
383   if (send == LineEditElements)
384     myNbOkElements = 0;
385   
386   buttonOk->setEnabled( false );
387   buttonApply->setEnabled( false );
388   
389   // hilight entered elements/nodes
390   SMDS_Mesh* aMesh = 0;
391   if ( myActor )
392     aMesh = myActor->GetObject()->GetMesh();
393   
394   if ( aMesh ) {
395     
396     mySelection->ClearIObjects();
397     mySelection->AddIObject( myActor->getIO() );
398     
399     QStringList aListId = QStringList::split( " ", theNewText, false);
400     
401     if (send == LineEditElements) {
402       for ( int i = 0; i < aListId.count(); i++ ) {
403         const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() );
404         if ( e ) {
405           if ( !mySelection->IsIndexSelected( myActor->getIO(), e->GetID() ))
406             mySelection->AddOrRemoveIndex (myActor->getIO(), e->GetID(), true);
407           myNbOkElements++;
408         }
409       }
410     }
411   }
412   
413   if ( myNbOkElements ) {
414     buttonOk->setEnabled( true );
415     buttonApply->setEnabled( true );
416   }
417   
418   myBusy = false;
419 }
420
421 //=================================================================================
422 // function : SelectionIntoArgument()
423 // purpose  : Called when selection as changed or other case
424 //=================================================================================
425 void SMESHGUI_ExtrusionDlg::SelectionIntoArgument()
426 {
427   if ( myBusy ) return;
428   
429   // clear
430   
431   myActor = 0;
432   QString aString = "";
433
434   myBusy = true;
435   myEditCurrentArgument->setText( aString );
436   myBusy = false;
437   
438   if ( !GroupButtons->isEnabled() ) // inactive
439     return;
440   
441   buttonOk->setEnabled( false );
442   buttonApply->setEnabled( false );
443   
444   // get selected mesh
445   
446   int nbSel = SMESH::GetNameOfSelectedIObjects(mySelection, aString);
447   if(nbSel != 1)
448     return;
449   
450   Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
451   
452   if (myEditCurrentArgument == LineEditElements)
453     {
454       myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO) ;
455       
456       myActor = SMESH::FindActorByEntry( mySelection->firstIObject()->getEntry() );
457       
458       // get selected elements
459       int aNbElements = 0;
460       
461       aNbElements = SMESH::GetNameOfSelectedElements(mySelection, aString) ;
462       
463       if(aNbElements < 1)
464         return ;
465     }
466   
467   myBusy = true;
468   myEditCurrentArgument->setText( aString );
469   myBusy = false;
470   
471   // OK
472   
473   if (myEditCurrentArgument == LineEditElements )
474     myNbOkElements = true;
475   
476   if(myNbOkElements)
477     {
478       buttonOk->setEnabled( true );
479       buttonApply->setEnabled( true );
480     }
481 }
482
483
484 //=================================================================================
485 // function : SetEditCurrentArgument()
486 // purpose  :
487 //=================================================================================
488 void SMESHGUI_ExtrusionDlg::SetEditCurrentArgument()
489 {
490   QPushButton* send = (QPushButton*)sender();
491   disconnect( mySelection, 0, this, 0 );
492   mySelection->ClearIObjects();
493   mySelection->ClearFilters();
494   
495   if(send == SelectElementsButton) {
496     myEditCurrentArgument = LineEditElements;
497     int aConstructorId = GetConstructorId();
498     if (aConstructorId == 0)
499       QAD_Application::getDesktop()->SetSelectionMode( EdgeSelection, true );
500     else if (aConstructorId == 1)
501       QAD_Application::getDesktop()->SetSelectionMode( FaceSelection, true );
502   }
503   
504   myEditCurrentArgument->setFocus();
505   connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
506   SelectionIntoArgument() ;
507 }
508
509 //=================================================================================
510 // function : DeactivateActiveDialog()
511 // purpose  :
512 //=================================================================================
513 void SMESHGUI_ExtrusionDlg::DeactivateActiveDialog()
514 {
515   if ( GroupConstructors->isEnabled() ) {
516     GroupConstructors->setEnabled(false) ;
517     GroupArguments->setEnabled(false) ;
518     GroupButtons->setEnabled(false) ;
519     mySMESHGUI->ResetState() ;    
520     mySMESHGUI->SetActiveDialogBox(0) ;
521   }
522   return ;
523 }
524
525
526 //=================================================================================
527 // function : ActivateThisDialog()
528 // purpose  :
529 //=================================================================================
530 void SMESHGUI_ExtrusionDlg::ActivateThisDialog()
531 {
532   /* Emit a signal to deactivate the active dialog */
533   mySMESHGUI->EmitSignalDeactivateDialog() ;   
534   GroupConstructors->setEnabled(true) ;
535   GroupArguments->setEnabled(true) ;
536   GroupButtons->setEnabled(true) ;
537   
538   mySMESHGUI->SetActiveDialogBox( (QDialog*)this ) ;
539
540   ConstructorsClicked(GetConstructorId());
541   SelectionIntoArgument();
542 }
543
544
545 //=================================================================================
546 // function : enterEvent()
547 // purpose  :
548 //=================================================================================
549 void SMESHGUI_ExtrusionDlg::enterEvent(QEvent* e)
550 {
551   if ( GroupConstructors->isEnabled() )
552     return ;  
553   ActivateThisDialog() ;
554   return ;
555 }
556
557
558 //=================================================================================
559 // function : closeEvent()
560 // purpose  :
561 //=================================================================================
562 void SMESHGUI_ExtrusionDlg::closeEvent( QCloseEvent* e )
563 {
564   /* same than click on cancel button */
565   this->ClickOnCancel() ;
566 }
567
568
569 //=======================================================================
570 //function : hideEvent
571 //purpose  : caused by ESC key
572 //=======================================================================
573
574 void SMESHGUI_ExtrusionDlg::hideEvent ( QHideEvent * e )
575 {
576   if ( !isMinimized() )
577     ClickOnCancel();
578 }
579
580
581 //=================================================================================
582 // function : GetConstructorId()
583 // purpose  : 
584 //=================================================================================
585 int SMESHGUI_ExtrusionDlg::GetConstructorId()
586
587   if ( GroupConstructors != NULL && GroupConstructors->selected() != NULL )
588     return GroupConstructors->id( GroupConstructors->selected() );
589   return -1;
590 }