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