Salome HOME
NRI : Merge from V1_2.
[modules/geom.git] / src / GEOMGUI / GeometryGUI_MultiTranslationDlg.cxx
1 using namespace std;
2 //  File      : GeometryGUI_MultiTranslationDlg.cxx
3 //  Created   :
4 //  Author    : Damien COQUERET
5 //  Project   : SALOME
6 //  Module    : GeometryGUI
7 //  Copyright : OPEN CASCADE
8 //  $Header$
9
10 #include "GeometryGUI_MultiTranslationDlg.h"
11
12 #include "GeometryGUI.h"
13 #include "QAD_Application.h"
14 #include "QAD_Desktop.h"
15 #include "QAD_Config.h"
16 #include "utilities.h"
17
18 #include <BRepBuilderAPI_MakeVertex.hxx>
19 #include <BRepBuilderAPI_Transform.hxx>
20 #include <BRepAdaptor_Curve.hxx>
21 #include <BRep_Builder.hxx>
22 #include <BRepGProp.hxx>
23 #include <GProp_GProps.hxx>
24 #include <TopoDS_Compound.hxx>
25
26 #include <qbuttongroup.h>
27 #include <qcheckbox.h>
28 #include <qgroupbox.h>
29 #include <qlabel.h>
30 #include <qlineedit.h>
31 #include <qpushbutton.h>
32 #include <qradiobutton.h>
33 #include <qlayout.h>
34 #include <qvariant.h>
35 #include <qtooltip.h>
36 #include <qwhatsthis.h>
37 #include <qimage.h>
38 #include <qpixmap.h>
39 #include <qspinbox.h>
40
41
42 //=================================================================================
43 // class    : GeometryGUI_MultiTranslationDlg()
44 // purpose  : Constructs a GeometryGUI_MultiTranslationDlg which is a child of 'parent', with the 
45 //            name 'name' and widget flags set to 'f'.
46 //            The dialog will by default be modeless, unless you set 'modal' to
47 //            TRUE to construct a modal dialog.
48 //=================================================================================
49 GeometryGUI_MultiTranslationDlg::GeometryGUI_MultiTranslationDlg( QWidget* parent,  const char* name, SALOME_Selection* Sel, bool modal, WFlags fl )
50     : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
51 {
52     QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_MULTITRANSLATION_SIMPLE")));
53     QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT")));
54     QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_MULTITRANSLATION_DOUBLE")));
55
56     if ( !name )
57         setName( "GeometryGUI_MultiTranlationDlg" );
58     resize( 303, 251 ); 
59     setCaption( tr( "GEOM_MULTITRANSLATION_TITLE"  ) );
60     setSizeGripEnabled( TRUE );
61     GeometryGUI_MultiTranslationDlgLayout = new QGridLayout( this ); 
62     GeometryGUI_MultiTranslationDlgLayout->setSpacing( 6 );
63     GeometryGUI_MultiTranslationDlgLayout->setMargin( 11 );
64
65     GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
66     GroupConstructors->setTitle( tr( "GEOM_MULTITRANSLATION"  ) );
67     GroupConstructors->setExclusive( TRUE );
68     GroupConstructors->setColumnLayout(0, Qt::Vertical );
69     GroupConstructors->layout()->setSpacing( 0 );
70     GroupConstructors->layout()->setMargin( 0 );
71     GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
72     GroupConstructorsLayout->setAlignment( Qt::AlignTop );
73     GroupConstructorsLayout->setSpacing( 6 );
74     GroupConstructorsLayout->setMargin( 11 );
75
76     Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" );
77     Constructor1->setText( tr( ""  ) );
78     Constructor1->setPixmap( image0 );
79     Constructor1->setChecked( TRUE );
80     Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) );
81     Constructor1->setMinimumSize( QSize( 50, 0 ) );
82     GroupConstructorsLayout->addWidget( Constructor1, 0, 0 );
83     Constructor2 = new QRadioButton( GroupConstructors, "Constructor2" );
84     Constructor2->setText( tr( ""  ) );
85     Constructor2->setPixmap( image2 );
86     Constructor2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor2->sizePolicy().hasHeightForWidth() ) );
87     Constructor2->setMinimumSize( QSize( 50, 0 ) );
88     GroupConstructorsLayout->addWidget( Constructor2, 0, 2 );
89     QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
90     GroupConstructorsLayout->addItem( spacer_2, 0, 3 );
91     QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
92     GroupConstructorsLayout->addItem( spacer_3, 0, 1 );
93
94     GeometryGUI_MultiTranslationDlgLayout->addWidget( GroupConstructors, 0, 0 );
95
96     /***************************************************************/
97     GroupButtons = new QGroupBox( this, "GroupButtons" );
98     GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); 
99     GroupButtons->setTitle( tr( ""  ) );
100     GroupButtons->setColumnLayout(0, Qt::Vertical );
101     GroupButtons->layout()->setSpacing( 0 );
102     GroupButtons->layout()->setMargin( 0 );
103     GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
104     GroupButtonsLayout->setAlignment( Qt::AlignTop );
105     GroupButtonsLayout->setSpacing( 6 );
106     GroupButtonsLayout->setMargin( 11 );
107     buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
108     buttonCancel->setText( tr( "GEOM_BUT_CLOSE"  ) );
109     buttonCancel->setAutoDefault( TRUE );
110     GroupButtonsLayout->addWidget( buttonCancel, 0, 3 );
111     buttonApply = new QPushButton( GroupButtons, "buttonApply" );
112     buttonApply->setText( tr( "GEOM_BUT_APPLY"  ) );
113     buttonApply->setAutoDefault( TRUE );
114     GroupButtonsLayout->addWidget( buttonApply, 0, 1 );
115     QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
116     GroupButtonsLayout->addItem( spacer_9, 0, 2 );
117     buttonOk = new QPushButton( GroupButtons, "buttonOk" );
118     buttonOk->setText( tr( "GEOM_BUT_OK"  ) );
119     buttonOk->setAutoDefault( TRUE );
120     buttonOk->setDefault( TRUE );
121     GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
122     GeometryGUI_MultiTranslationDlgLayout->addWidget( GroupButtons, 2, 0 );
123
124     /***************************************************************/
125     GroupC1 = new QGroupBox( this, "GroupC1" );
126     GroupC1->setTitle( tr( "GEOM_MULTITRANSLATION_SIMPLE"  ) );
127     GroupC1->setMinimumSize( QSize( 0, 0 ) );
128     GroupC1->setFrameShape( QGroupBox::Box );
129     GroupC1->setFrameShadow( QGroupBox::Sunken );
130     GroupC1->setColumnLayout(0, Qt::Vertical );
131     GroupC1->layout()->setSpacing( 0 );
132     GroupC1->layout()->setMargin( 0 );
133     GroupC1Layout = new QGridLayout( GroupC1->layout() );
134     GroupC1Layout->setAlignment( Qt::AlignTop );
135     GroupC1Layout->setSpacing( 6 );
136     GroupC1Layout->setMargin( 11 );
137
138     TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" );
139     TextLabelC1A1->setText( tr( "GEOM_MAIN_OBJECT"  ) );
140     TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) );
141     TextLabelC1A1->setFrameShape( QLabel::NoFrame );
142     TextLabelC1A1->setFrameShadow( QLabel::Plain );
143     GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 );
144
145     TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" );
146     TextLabelC1A2->setText( tr( "GEOM_VECTOR_U"  ) );
147     TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) );
148     TextLabelC1A2->setFrameShape( QLabel::NoFrame );
149     TextLabelC1A2->setFrameShadow( QLabel::Plain );
150     GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 );
151
152     TextLabelC1A3 = new QLabel( GroupC1, "TextLabelC1A3" );
153     TextLabelC1A3->setText( tr( "GEOM_STEP_U"  ) );
154     TextLabelC1A3->setMinimumSize( QSize( 50, 0 ) );
155     TextLabelC1A3->setFrameShape( QLabel::NoFrame );
156     TextLabelC1A3->setFrameShadow( QLabel::Plain );
157     GroupC1Layout->addWidget( TextLabelC1A3, 2, 0 );
158
159     TextLabelC1A4 = new QLabel( GroupC1, "TextLabelC1A4" );
160     TextLabelC1A4->setText( tr( "GEOM_NB_TIMES_U"  ) );
161     TextLabelC1A4->setMinimumSize( QSize( 50, 0 ) );
162     TextLabelC1A4->setFrameShape( QLabel::NoFrame );
163     TextLabelC1A4->setFrameShadow( QLabel::Plain );
164     GroupC1Layout->addWidget( TextLabelC1A4, 3, 0 );
165
166     LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" );
167     GroupC1Layout->addWidget( LineEditC1A1, 0, 2 );
168
169     LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" );
170     GroupC1Layout->addWidget( LineEditC1A2, 1, 2 );
171
172     /* a GeometryGUI_SpinBox */
173     SpinBox_C1A3 = new GeometryGUI_SpinBox( GroupC1, "GeomSpinBox_C1A3" ) ;
174     SpinBox_C1A3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C1A3->sizePolicy().hasHeightForWidth() ) );
175     GroupC1Layout->addWidget( SpinBox_C1A3, 2, 2 );
176     /* a QSpinBox            */
177     SpinBox_C1A4 = new QSpinBox( GroupC1, "SpinBox_C1A4" ) ;
178     SpinBox_C1A4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C1A4->sizePolicy().hasHeightForWidth() ) );
179     GroupC1Layout->addWidget( SpinBox_C1A4, 3, 2 );
180
181     CheckBoxReverse0 = new QCheckBox( GroupC1, "CheckBoxReverse0" );
182     CheckBoxReverse0->setText( tr( "GEOM_REVERSE_U"  ) );
183     GroupC1Layout->addWidget( CheckBoxReverse0, 5, 0  );
184
185     SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" );
186     SelectButtonC1A1->setText( tr( ""  ) );
187     SelectButtonC1A1->setPixmap( image1 );
188     SelectButtonC1A1->setToggleButton( FALSE );
189     SelectButtonC1A1->setMaximumSize( QSize( 28, 32767 ) );
190     GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 );
191
192     SelectButtonC1A2 = new QPushButton( GroupC1, "SelectButtonC1A2" );
193     SelectButtonC1A2->setText( tr( ""  ) );
194     SelectButtonC1A2->setPixmap( image1 );
195     SelectButtonC1A2->setToggleButton( FALSE );
196     SelectButtonC1A2->setMaximumSize( QSize( 28, 32767 ) );
197     GroupC1Layout->addWidget( SelectButtonC1A2, 1, 1 );
198
199     GeometryGUI_MultiTranslationDlgLayout->addWidget( GroupC1, 1, 0 );
200
201     /***************************************************************/
202
203     GroupC2 = new QGroupBox( this, "GroupC2" );
204     GroupC2->setTitle( tr( "GEOM_MULTITRANSLATION_DOUBLE"  ) );
205     GroupC2->setMinimumSize( QSize( 0, 0 ) );
206     GroupC2->setFrameShape( QGroupBox::Box );
207     GroupC2->setFrameShadow( QGroupBox::Sunken );
208     GroupC2->setColumnLayout(0, Qt::Vertical );
209     GroupC2->layout()->setSpacing( 0 );
210     GroupC2->layout()->setMargin( 0 );
211     GroupC2Layout = new QGridLayout( GroupC2->layout() );
212     GroupC2Layout->setAlignment( Qt::AlignTop );
213     GroupC2Layout->setSpacing( 6 );
214     GroupC2Layout->setMargin( 11 );
215
216     TextLabelC2A1 = new QLabel( GroupC2, "TextLabelC2A1" );
217     TextLabelC2A1->setText( tr( "GEOM_MAIN_OBJECT"  ) );
218     TextLabelC2A1->setMinimumSize( QSize( 50, 0 ) );
219     TextLabelC2A1->setFrameShape( QLabel::NoFrame );
220     TextLabelC2A1->setFrameShadow( QLabel::Plain );
221     GroupC2Layout->addWidget( TextLabelC2A1, 0, 0 );
222
223     TextLabelC2A2 = new QLabel( GroupC2, "TextLabelC2A2" );
224     TextLabelC2A2->setText( tr( "GEOM_VECTOR_U"  ) );
225     TextLabelC2A2->setMinimumSize( QSize( 50, 0 ) );
226     TextLabelC2A2->setFrameShape( QLabel::NoFrame );
227     TextLabelC2A2->setFrameShadow( QLabel::Plain );
228     GroupC2Layout->addWidget( TextLabelC2A2, 1, 0 );
229
230     TextLabelC2A3 = new QLabel( GroupC2, "TextLabelC2A3" );
231     TextLabelC2A3->setText( tr( "GEOM_VECTOR_V"  ) );
232     TextLabelC2A3->setMinimumSize( QSize( 50, 0 ) );
233     TextLabelC2A3->setFrameShape( QLabel::NoFrame );
234     TextLabelC2A3->setFrameShadow( QLabel::Plain );
235     GroupC2Layout->addWidget( TextLabelC2A3, 2, 0 );
236
237     TextLabelC2A4 = new QLabel( GroupC2, "TextLabelC2A4" );
238     TextLabelC2A4->setText( tr( "GEOM_STEP_U"  ) );
239     TextLabelC2A4->setMinimumSize( QSize( 50, 0 ) );
240     TextLabelC2A4->setFrameShape( QLabel::NoFrame );
241     TextLabelC2A4->setFrameShadow( QLabel::Plain );
242     GroupC2Layout->addWidget( TextLabelC2A4, 3, 0 );
243
244     TextLabelC2A5 = new QLabel( GroupC2, "TextLabelC2A5" );
245     TextLabelC2A5->setText( tr( "GEOM_NB_TIMES_U"  ) );
246     TextLabelC2A5->setMinimumSize( QSize( 50, 0 ) );
247     TextLabelC2A5->setFrameShape( QLabel::NoFrame );
248     TextLabelC2A5->setFrameShadow( QLabel::Plain );
249     GroupC2Layout->addWidget( TextLabelC2A5, 4, 0 );
250
251     TextLabelC2A6 = new QLabel( GroupC2, "TextLabelC2A6" );
252     TextLabelC2A6->setText( tr( "GEOM_STEP_V"  ) );
253     TextLabelC2A6->setMinimumSize( QSize( 50, 0 ) );
254     TextLabelC2A6->setFrameShape( QLabel::NoFrame );
255     TextLabelC2A6->setFrameShadow( QLabel::Plain );
256     GroupC2Layout->addWidget( TextLabelC2A6, 6, 0 );
257
258     TextLabelC2A7 = new QLabel( GroupC2, "TextLabelC2A7" );
259     TextLabelC2A7->setText( tr( "GEOM_NB_TIMES_V"  ) );
260     TextLabelC2A7->setMinimumSize( QSize( 50, 0 ) );
261     TextLabelC2A7->setFrameShape( QLabel::NoFrame );
262     TextLabelC2A7->setFrameShadow( QLabel::Plain );
263     GroupC2Layout->addWidget( TextLabelC2A7, 7, 0 );
264
265     LineEditC2A1 = new QLineEdit( GroupC2, "LineEditC2A1" );
266     GroupC2Layout->addWidget( LineEditC2A1, 0, 2 );
267
268     LineEditC2A2 = new QLineEdit( GroupC2, "LineEditC2A2" );
269     GroupC2Layout->addWidget( LineEditC2A2, 1, 2 );
270
271     LineEditC2A3 = new QLineEdit( GroupC2, "LineEditC2A3" );
272     GroupC2Layout->addWidget( LineEditC2A3, 2, 2 );
273
274     /* a GeometryGUI_SpinBox */
275     SpinBox_C2A4 = new GeometryGUI_SpinBox( GroupC2, "GeomSpinBox_C2A4" ) ;
276     SpinBox_C2A4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C2A4->sizePolicy().hasHeightForWidth() ) );
277     GroupC2Layout->addWidget( SpinBox_C2A4, 3, 2 );
278     /* a QSpinBox            */
279     SpinBox_C2A5 = new QSpinBox( GroupC2, "SpinBox_C2A5" ) ;
280     SpinBox_C2A5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C2A5->sizePolicy().hasHeightForWidth() ) );
281     GroupC2Layout->addWidget( SpinBox_C2A5, 4, 2 );
282
283     /* a GeometryGUI_SpinBox */
284     SpinBox_C2A6 = new GeometryGUI_SpinBox( GroupC2, "GeomSpinBox_C2A6" ) ;
285     SpinBox_C2A6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C2A6->sizePolicy().hasHeightForWidth() ) );
286     GroupC2Layout->addWidget( SpinBox_C2A6, 6, 2 );
287     /* a QSpinBox            */
288     SpinBox_C2A7 = new QSpinBox( GroupC2, "SpinBox_C2A7" ) ;
289     SpinBox_C2A7->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, SpinBox_C2A7->sizePolicy().hasHeightForWidth() ) );
290     GroupC2Layout->addWidget( SpinBox_C2A7, 7, 2 );
291
292
293     CheckBoxReverse1 = new QCheckBox( GroupC2, "CheckBoxReverse1" );
294     CheckBoxReverse1->setText( tr( "GEOM_REVERSE_U"  ) );
295     GroupC2Layout->addWidget( CheckBoxReverse1, 5, 0  );
296
297     CheckBoxReverse2 = new QCheckBox( GroupC2, "CheckBoxReverse2" );
298     CheckBoxReverse2->setText( tr( "GEOM_REVERSE_V"  ) );
299     GroupC2Layout->addWidget( CheckBoxReverse2, 8, 0  );
300
301     SelectButtonC2A1 = new QPushButton( GroupC2, "SelectButtonC2A1" );
302     SelectButtonC2A1->setText( tr( ""  ) );
303     SelectButtonC2A1->setPixmap( image1 );
304     SelectButtonC2A1->setToggleButton( FALSE );
305     SelectButtonC2A1->setMaximumSize( QSize( 28, 32767 ) );
306     GroupC2Layout->addWidget( SelectButtonC2A1, 0, 1 );
307
308     SelectButtonC2A2 = new QPushButton( GroupC2, "SelectButtonC2A2" );
309     SelectButtonC2A2->setText( tr( ""  ) );
310     SelectButtonC2A2->setPixmap( image1 );
311     SelectButtonC2A2->setToggleButton( FALSE );
312     SelectButtonC2A2->setMaximumSize( QSize( 28, 32767 ) );
313     GroupC2Layout->addWidget( SelectButtonC2A2, 1, 1 );
314
315     SelectButtonC2A3 = new QPushButton( GroupC2, "SelectButtonC2A3" );
316     SelectButtonC2A3->setText( tr( ""  ) );
317     SelectButtonC2A3->setPixmap( image1 );
318     SelectButtonC2A3->setToggleButton( FALSE );
319     SelectButtonC2A3->setMaximumSize( QSize( 28, 32767 ) );
320     GroupC2Layout->addWidget( SelectButtonC2A3, 2, 1 );
321
322     GeometryGUI_MultiTranslationDlgLayout->addWidget( GroupC2, 1, 0 );
323
324     /***************************************************************/
325    
326
327     Init(Sel) ; /* Initialisations */
328 }
329
330 //=================================================================================
331 // function : ~GeometryGUI_MultiTranslationDlg()
332 // purpose  : Destroys the object and frees any allocated resources
333 //=================================================================================
334 GeometryGUI_MultiTranslationDlg::~GeometryGUI_MultiTranslationDlg()
335 {
336     // no need to delete child widgets, Qt does it all for us
337   this->destroy(TRUE, TRUE) ;
338 }
339
340 //=================================================================================
341 // function : Init()
342 // purpose  :
343 //=================================================================================
344 void GeometryGUI_MultiTranslationDlg::Init( SALOME_Selection* Sel )
345 {
346  
347   /* Get setting of step value from file configuration */
348   double step ;
349   QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ;
350   step = St.toDouble() ;
351
352   /* min, max, step and decimals for geom spin boxes */
353   SpinBox_C1A3->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; /* step U : constructor 1 */
354   SpinBox_C1A3->SetValue( 50 ) ;
355   SpinBox_C2A4->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; /* step U : constructor 2 */
356   SpinBox_C2A4->SetValue( 50 ) ;
357   SpinBox_C2A6->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; /* step V : constructor 2 */
358   SpinBox_C2A6->SetValue( 50 ) ;
359   
360   /* min, max, step for QT spin boxes */
361   SpinBox_C1A4->setMinValue( 1 );    /* myNbTimes1 : constructor 1 */
362   SpinBox_C1A4->setMaxValue( 10000 );
363   SpinBox_C1A4->setWrapping( TRUE );
364   SpinBox_C1A4->setValue(2) ;
365   
366   SpinBox_C2A5->setMinValue( 1 );    /* myNbTimes1 : constructor 2 */
367   SpinBox_C2A5->setMaxValue( 10000 );
368   SpinBox_C2A5->setWrapping( TRUE );
369   SpinBox_C2A5->setValue(2) ;
370   
371   SpinBox_C2A7->setMinValue( 1 );    /* myNbTimes2 : constructor 2 */
372   SpinBox_C2A7->setMaxValue( 10000 );
373   SpinBox_C2A7->setWrapping( TRUE );
374   SpinBox_C2A7->setValue(2) ;
375
376   myStep1 = 50.0 ;
377   myStep2 = 50.0 ;
378   myNbTimes1 = 2 ;
379   myNbTimes2 = 2 ;
380
381   GroupC1->show();
382   GroupC2->hide() ;
383   myConstructorId = 0 ;
384   Constructor1->setChecked( TRUE );
385   myEditCurrentArgument = LineEditC1A1 ;        
386   mySelection = Sel;
387   myGeomGUI = GeometryGUI::GetGeometryGUI() ;
388
389   myOkBase = myOkDir1 = myOkDir2  = false ;
390   mySimulationTopoDs.Nullify() ;
391   myBase.Nullify() ;
392   myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
393
394   // TODO : set previous selection into argument ?
395
396   /* Filter definitions */
397   Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
398   myGeom = GEOM::GEOM_Gen::_narrow(comp);
399   myEdgeFilter = new GEOM_EdgeFilter( StdSelect_Line, myGeom );
400
401   /* signals and slots connections */
402   connect( buttonOk, SIGNAL( clicked() ),     this, SLOT( ClickOnOk() ) );
403   connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ;
404   connect( buttonApply, SIGNAL( clicked() ),  this, SLOT(ClickOnApply() ) );
405
406   connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) );  
407   connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
408   connect( SelectButtonC1A2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
409   connect( SelectButtonC2A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
410   connect( SelectButtonC2A2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
411   connect( SelectButtonC2A3, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
412   
413   /* GeometryGUI_SpinBox */
414   connect( SpinBox_C1A3, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ;
415   connect( SpinBox_C2A4, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ;
416   connect( SpinBox_C2A6, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ;
417   
418   connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
419   connect( LineEditC1A2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
420   connect( LineEditC2A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
421   connect( LineEditC2A2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
422   connect( LineEditC2A3, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
423
424   /* QSpinBox */
425   connect( SpinBox_C1A4, SIGNAL ( valueChanged(int) ), this, SLOT( ValueChangedInt(int) ) ) ; /* Not const ! */
426   connect( SpinBox_C2A5, SIGNAL ( valueChanged(int) ), this, SLOT( ValueChangedInt(int) ) ) ;
427   connect( SpinBox_C2A7, SIGNAL ( valueChanged(int) ), this, SLOT( ValueChangedInt(int) ) ) ;
428   
429   connect( CheckBoxReverse0, SIGNAL (stateChanged(int) ), this, SLOT( ReverseAngle1(int) ) ) ;
430   connect( CheckBoxReverse1, SIGNAL (stateChanged(int) ), this, SLOT( ReverseAngle1(int) ) ) ;
431   connect( CheckBoxReverse2, SIGNAL (stateChanged(int) ), this, SLOT( ReverseAngle2(int) ) ) ;
432   
433   connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;  
434   connect( mySelection, SIGNAL( currentSelectionChanged() ),     this, SLOT( SelectionIntoArgument() ) );
435   /* to close dialog if study change */
436   connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ;
437  
438   /* Move widget on the botton right corner of main widget */
439   int x, y ;
440   myGeomGUI->DefineDlgPosition( this, x, y ) ;
441   this->move( x, y ) ;
442   this->show() ; /* displays Dialog */
443
444   return ;
445 }
446
447 //=================================================================================
448 // function : ReverseAngle1()
449 // purpose  : 'state' not used here
450 //=================================================================================
451 void GeometryGUI_MultiTranslationDlg::ReverseAngle1(int state)
452 {
453   myStep1 = -myStep1 ;
454   SpinBox_C1A3->SetValue( myStep1 ) ;
455   SpinBox_C2A4->SetValue( myStep1 ) ;
456   if( myOkBase && myOkDir1 ) {
457     MakeMultiTranslationSimulationAndDisplay() ;
458   }
459   else {
460     myGeomGUI->EraseSimulationShape() ; 
461     mySimulationTopoDs.Nullify() ;
462   }
463    return ;
464 }
465
466
467 //=================================================================================
468 // function : ReverseAngle2()
469 // purpose  : 'state' not used here
470 //=================================================================================
471 void GeometryGUI_MultiTranslationDlg::ReverseAngle2(int state)
472 {
473   myStep2 = -myStep2 ;
474   SpinBox_C2A6->SetValue( myStep2 ) ;
475   if( myOkBase && myOkDir1 && myOkDir2 ) {
476     MakeMultiTranslationSimulationAndDisplay() ;
477   }
478   else {
479     myGeomGUI->EraseSimulationShape() ; 
480     mySimulationTopoDs.Nullify() ;
481   }
482    return ;
483 }
484
485
486 //=================================================================================
487 // function : ConstructorsClicked()
488 // purpose  : Radio button management
489 //=================================================================================
490 void GeometryGUI_MultiTranslationDlg::ConstructorsClicked(int constructorId)
491 {
492   myEditCurrentArgument->setText(tr("")) ;
493   myGeomGUI->EraseSimulationShape() ;
494   mySimulationTopoDs.Nullify() ;
495
496   myStep1 = 50.0 ;
497   myStep2 = 50.0 ;
498   myNbTimes1 = 2;
499   myNbTimes2 = 2;
500
501   myOkBase = myOkDir1 = myOkDir2  = false ;
502   myConstructorId = constructorId ;
503
504   switch (constructorId)
505     {
506     case 0: /* Translate simple */
507       {
508         GroupC1->show();
509         GroupC2->hide() ;
510         myEditCurrentArgument = LineEditC1A1 ;
511         SpinBox_C1A3->SetValue(50) ;
512         SpinBox_C1A4->setValue(2) ;
513         LineEditC1A1->setText(tr("")) ;
514         LineEditC1A2->setText(tr("")) ;
515         break;
516       }
517
518     case 1: /* Translate double */
519       {
520         GroupC1->hide();
521         GroupC2->show() ;
522         myEditCurrentArgument = LineEditC2A1 ;
523         SpinBox_C2A4->SetValue(50) ;
524         SpinBox_C2A5->setValue(2) ;
525         SpinBox_C2A6->SetValue(50) ;
526         SpinBox_C2A7->setValue(2) ;
527         LineEditC2A1->setText(tr("")) ;
528         LineEditC2A2->setText(tr("")) ;
529         LineEditC2A3->setText(tr("")) ;
530         break ;
531       }
532       
533     }
534
535   return ;
536 }
537
538 //=================================================================================
539 // function : ClickOnOk()
540 // purpose  :
541 //=================================================================================
542 void GeometryGUI_MultiTranslationDlg::ClickOnOk()
543 {
544   this->ClickOnApply() ;
545   this->ClickOnCancel() ;
546
547   return ;
548 }
549
550 //=================================================================================
551 // function : ClickOnApply()
552 // purpose  :
553 //=================================================================================
554 void GeometryGUI_MultiTranslationDlg::ClickOnApply()
555 {
556   myGeomGUI->EraseSimulationShape() ;
557   mySimulationTopoDs.Nullify() ;
558   myGeomGUI->GetDesktop()->putInfo( tr("") ) ; 
559   switch(myConstructorId)
560     { 
561     case 0 :
562       { 
563         if(myOkBase && myOkDir1 ) {
564           myGeomGUI->MakeMultiTranslation1DAndDisplay( myGeomShape, myDir1, myStep1, myNbTimes1 ) ;
565         }
566         break ;
567       }
568     case 1 :
569       { 
570         if(myOkBase && myOkDir1 && myOkDir2 ) {
571           myGeomGUI->MakeMultiTranslation2DAndDisplay( myGeomShape, myDir1, myStep1, myNbTimes1, myDir2, myStep2, myNbTimes2 ) ;
572         }
573         break ;
574       }
575     }
576   return ;
577 }
578
579
580 //=================================================================================
581 // function : ClickOnCancel()
582 // purpose  :
583 //=================================================================================
584 void GeometryGUI_MultiTranslationDlg::ClickOnCancel()
585 {
586   mySelection->ClearFilters() ;
587   myGeomGUI->EraseSimulationShape() ;
588   mySimulationTopoDs.Nullify() ;
589   disconnect( mySelection, 0, this, 0 );
590   myGeomGUI->ResetState() ;
591   reject() ;
592   return ;
593 }
594
595
596 //=================================================================================
597 // function : LineEditReturnPressed()
598 // purpose  :
599 //=================================================================================
600 void GeometryGUI_MultiTranslationDlg::LineEditReturnPressed()
601 {
602   QLineEdit* send = (QLineEdit*)sender() ;
603   if( send == LineEditC1A1 )
604     myEditCurrentArgument = LineEditC1A1 ;
605   else if ( send == LineEditC1A2 )
606     myEditCurrentArgument = LineEditC1A2 ; 
607   else if ( send == LineEditC2A1 )
608     myEditCurrentArgument = LineEditC2A1;
609   else if ( send == LineEditC2A2 )
610     myEditCurrentArgument = LineEditC2A2 ; 
611   else if ( send == LineEditC2A3 )
612     myEditCurrentArgument = LineEditC2A3 ; 
613   else
614     return ;
615   
616   /* User name of object input management                          */
617   /* If successfull the selection is changed and signal emitted... */
618   /* so SelectionIntoArgument() is automatically called.           */
619   const QString objectUserName = myEditCurrentArgument->text() ;
620   QWidget* thisWidget = (QWidget*)this ;
621   if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) {
622     myEditCurrentArgument->setText( objectUserName ) ;
623   }
624   return ;
625 }
626
627
628
629 //=================================================================================
630 // function : SelectionIntoArgument()
631 // purpose  : Called when selection as changed or other case
632 //=================================================================================
633 void GeometryGUI_MultiTranslationDlg::SelectionIntoArgument()
634 {
635   myEditCurrentArgument->setText("") ;
636   myGeomGUI->EraseSimulationShape() ; 
637   mySimulationTopoDs.Nullify() ;
638
639   /* Future name of selection */
640   QString aString = "";
641   int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ;
642
643   TopoDS_Shape S;
644   Standard_Boolean testResult ;
645   
646   switch (myConstructorId)
647     {
648     case 0 :
649       { 
650         if ( nbSel != 1 ) {
651           if ( myEditCurrentArgument == LineEditC1A1 ) {
652             myEditCurrentArgument->setText("") ;
653             myOkBase = false ;
654           }
655           else if ( myEditCurrentArgument == LineEditC1A2 ) { 
656             myEditCurrentArgument->setText("") ;
657             myOkDir1 = false ;
658           }
659           return ;
660         }
661
662         Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ;
663         if( !myGeomGUI->GetTopoFromSelection(mySelection, S) )
664           return ;
665
666         if ( myEditCurrentArgument == LineEditC1A1 ) {
667           myGeomShape = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ;
668           if( !testResult )
669             return ;
670           myEditCurrentArgument->setText(aString) ;
671           myBase = S ;
672           myOkBase = true ;
673         }    
674         else if ( myEditCurrentArgument == LineEditC1A2 ) {
675           BRepAdaptor_Curve curv(TopoDS::Edge(S));
676           myDir1 = curv.Line().Direction();
677           myEditCurrentArgument->setText(aString) ;
678           myOkDir1 = true ;
679         }
680         
681         if (myOkBase && myOkDir1 ) {
682           MakeMultiTranslationSimulationAndDisplay() ;
683         }
684         else {
685           myGeomGUI->EraseSimulationShape() ; 
686           mySimulationTopoDs.Nullify() ;
687         }
688         break;
689       }
690     case 1 :
691       { 
692         if ( nbSel != 1 ) {
693           if ( myEditCurrentArgument == LineEditC2A1 ) {
694             myEditCurrentArgument->setText("") ;
695             myOkBase = false ;
696           }
697           else if ( myEditCurrentArgument == LineEditC2A2 ) { 
698             myEditCurrentArgument->setText("") ;
699             myOkDir1 = false ;
700           }
701           else if ( myEditCurrentArgument == LineEditC2A3 ) { 
702             myEditCurrentArgument->setText("") ;
703             myOkDir2 = false ;
704           }
705           return ;
706         }
707
708         Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ;
709         if( !myGeomGUI->GetTopoFromSelection(mySelection, S) )
710           return ; 
711
712         if ( myEditCurrentArgument == LineEditC2A1 ) {
713           myGeomShape = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ;
714           if( !testResult )
715             return ;
716           myEditCurrentArgument->setText(aString) ;
717           myBase = S ;
718           myOkBase = true ;
719         }    
720         else if ( myEditCurrentArgument == LineEditC2A2 ) {
721           BRepAdaptor_Curve curv(TopoDS::Edge(S));
722           myDir1 = curv.Line().Direction();
723           myEditCurrentArgument->setText(aString) ;
724           myOkDir1 = true ;
725         }
726         else if ( myEditCurrentArgument == LineEditC2A3 ) {
727           BRepAdaptor_Curve curv(TopoDS::Edge(S));
728           myDir2 = curv.Line().Direction();
729           myEditCurrentArgument->setText(aString) ;
730           myOkDir2 = true ;
731         }
732
733         if (myOkBase && myOkDir1 && myOkDir2 ) {
734           MakeMultiTranslationSimulationAndDisplay() ;
735         }
736         else {
737           myGeomGUI->EraseSimulationShape() ; 
738           mySimulationTopoDs.Nullify() ;
739         }
740         break;
741       }
742     }
743
744   return ;
745 }
746
747
748 //=================================================================================
749 // function : SetEditCurrentArgument()
750 // purpose  :
751 //=================================================================================
752 void GeometryGUI_MultiTranslationDlg::SetEditCurrentArgument()
753 {
754   QPushButton* send = (QPushButton*)sender();
755   switch (myConstructorId)
756     {
757     case 0 :
758       { 
759         if(send == SelectButtonC1A1) {
760           LineEditC1A1->setFocus() ;
761           myEditCurrentArgument = LineEditC1A1;
762           mySelection->ClearFilters() ;
763         }
764         else if(send == SelectButtonC1A2) {
765           LineEditC1A2->setFocus() ;      
766           myEditCurrentArgument = LineEditC1A2;
767           mySelection->AddFilter(myEdgeFilter) ;
768         }       
769         SelectionIntoArgument() ;
770         break;
771       }
772     case 1 :
773       { 
774         if(send == SelectButtonC2A1) {
775           LineEditC2A1->setFocus() ;
776           myEditCurrentArgument = LineEditC2A1;
777           mySelection->ClearFilters() ;
778         }
779         else if(send == SelectButtonC2A2) {
780           LineEditC2A2->setFocus() ;      
781           myEditCurrentArgument = LineEditC2A2;
782           mySelection->AddFilter(myEdgeFilter) ;
783         }
784         else if(send == SelectButtonC2A3) {
785           LineEditC2A3->setFocus() ;      
786           myEditCurrentArgument = LineEditC2A3;
787           mySelection->AddFilter(myEdgeFilter) ;
788         }
789         SelectionIntoArgument() ;
790         break;
791       }
792     }
793   return ;
794 }
795
796
797 //=================================================================================
798 // function : ValueChangedInt()
799 // purpose  : (General QT SpinBox)
800 //=================================================================================
801 void GeometryGUI_MultiTranslationDlg::ValueChangedInt( int newIntValue )
802 {
803   QSpinBox* send = (QSpinBox*)sender();
804
805   /* First constructor */
806   if( send == SpinBox_C1A4 ) {
807     myNbTimes1 = newIntValue ;
808   }
809   /* Second constructor */
810   else if( send == SpinBox_C2A5 ) {
811     myNbTimes1 = newIntValue ;
812   }
813   else if( send == SpinBox_C2A7 ) {
814     myNbTimes2 = newIntValue ;
815   }
816
817   switch (myConstructorId)
818     {
819     case 0 :
820       { 
821         if (myOkBase && myOkDir1 ) {
822           MakeMultiTranslationSimulationAndDisplay() ;
823         }
824         else {
825           myGeomGUI->EraseSimulationShape() ; 
826           mySimulationTopoDs.Nullify() ;
827         }
828         break;
829       }
830     case 1 :
831       { 
832         if (myOkBase && myOkDir1 && myOkDir2 ) {
833           MakeMultiTranslationSimulationAndDisplay() ;
834         }
835         else {
836           myGeomGUI->EraseSimulationShape() ; 
837           mySimulationTopoDs.Nullify() ;
838         }
839         break;
840       }
841     }
842   return ;
843 }
844
845
846 //=================================================================================
847 // function : ValueChangedInSpinBox()
848 // purpose  : (specifig for GeometryGUI_SpinBox)
849 //=================================================================================
850 void GeometryGUI_MultiTranslationDlg::ValueChangedInSpinBox( double newValue )
851 {    
852   GeometryGUI_SpinBox* send = (GeometryGUI_SpinBox*)sender();
853
854   /* First constructor */
855   if( send == SpinBox_C1A3 ) {
856     myStep1 = newValue ;
857   }
858   /* Second constructor */
859   else if( send == SpinBox_C2A4 ) {
860     myStep1 = newValue ;
861   }
862   else if( send == SpinBox_C2A6 ) {
863     myStep2 = newValue ;
864   }
865   
866   switch (myConstructorId)
867     {
868     case 0 :
869       { 
870         if (myOkBase && myOkDir1 ) {
871           MakeMultiTranslationSimulationAndDisplay() ;
872         }
873         else {
874           myGeomGUI->EraseSimulationShape() ; 
875           mySimulationTopoDs.Nullify() ;
876         }
877         break;
878       }
879     case 1 :
880       { 
881         if (myOkBase && myOkDir1 && myOkDir2 ) {
882           MakeMultiTranslationSimulationAndDisplay() ;
883         }
884         else {
885           myGeomGUI->EraseSimulationShape() ; 
886           mySimulationTopoDs.Nullify() ;
887         }
888         break;
889       }
890     }
891   return ;
892 }
893
894
895 //=================================================================================
896 // function : DeactivateActiveDialog()
897 // purpose  :
898 //=================================================================================
899 void GeometryGUI_MultiTranslationDlg::DeactivateActiveDialog()
900 {
901   if ( GroupConstructors->isEnabled() ) {
902     GroupConstructors->setEnabled(false) ;
903     GroupC1->setEnabled(false) ;
904     GroupC2->setEnabled(false) ;
905     GroupButtons->setEnabled(false) ;
906     disconnect( mySelection, 0, this, 0 );
907     myGeomGUI->EraseSimulationShape() ;
908     mySelection->ClearFilters() ;
909     myGeomGUI->ResetState() ;    
910     myGeomGUI->SetActiveDialogBox(0) ;
911     myGeomGUI->OnDisplayAll(true) ;
912   }
913   return ;
914 }
915
916
917 //=================================================================================
918 // function : ActivateThisDialog()
919 // purpose  :
920 //=================================================================================
921 void GeometryGUI_MultiTranslationDlg::ActivateThisDialog()
922 {
923   /* Emit a signal to deactivate the active dialog */
924   myGeomGUI->EmitSignalDeactivateDialog() ;   
925   GroupConstructors->setEnabled(true) ;
926   GroupC1->setEnabled(true) ;
927   GroupC2->setEnabled(true) ;
928   GroupButtons->setEnabled(true) ;
929   connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
930   myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
931   if( !mySimulationTopoDs.IsNull() )
932     myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ;
933   return ;
934 }
935
936
937
938 //=================================================================================
939 // function : enterEvent()
940 // purpose  :
941 //=================================================================================
942 void GeometryGUI_MultiTranslationDlg::enterEvent(QEvent* e)
943 {
944   if ( GroupConstructors->isEnabled() )
945     return ;  
946   ActivateThisDialog() ;
947   return ;
948 }
949
950
951
952 //=================================================================================
953 // function : closeEvent()
954 // purpose  :
955 //=================================================================================
956 void GeometryGUI_MultiTranslationDlg::closeEvent( QCloseEvent* e )
957 {
958   this->ClickOnCancel() ; /* same than click on cancel button */
959   return ;
960 }
961
962
963 //=================================================================================
964 // function : MakeMultiTranslationSimulationAndDisplay()
965 // purpose  :
966 //=================================================================================
967 void GeometryGUI_MultiTranslationDlg::MakeMultiTranslationSimulationAndDisplay() 
968 {
969   myGeomGUI->EraseSimulationShape() ;
970   gp_Trsf theTransformation ;
971   mySimulationTopoDs.Nullify() ;
972
973   int i ;
974   int j ;
975   Standard_Real DX ;
976   Standard_Real DY ;
977   Standard_Real DZ ;
978   GProp_GProps System ;
979   gp_Pnt myPoint ;
980   TopoDS_Compound compound;
981   BRep_Builder B;
982
983   B.MakeCompound( compound );  
984   TopoDS_Shape S ; 
985     
986   try {
987
988     BRepGProp::LinearProperties(myBase, System);
989     myPoint = System.CentreOfMass() ;
990     S = BRepBuilderAPI_MakeVertex(myPoint).Shape();
991
992     switch (myConstructorId)
993       {
994       case 0 :
995         { 
996           gp_Vec Vec(myDir1) ;
997           Vec.Normalize();
998
999           for ( i = 0; i < myNbTimes1; i++ ) {
1000             DX = i * myStep1 * Vec.X() ;
1001             DY = i * myStep1 * Vec.Y() ;
1002             DZ = i * myStep1 * Vec.Z() ;
1003             myVec.SetCoord( DX, DY, DZ ) ;
1004             
1005             theTransformation.SetTranslation(myVec) ;
1006             BRepBuilderAPI_Transform myBRepTransformation(S, theTransformation, Standard_False) ;
1007             B.Add( compound, myBRepTransformation.Shape() );
1008           }
1009           mySimulationTopoDs = compound;
1010           myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ;
1011           break;
1012         }
1013       case 1 :
1014         {       
1015           gp_Vec Vec1(myDir1) ;
1016           Vec1.Normalize();
1017           gp_Vec Vec2(myDir2) ;
1018           Vec2.Normalize();
1019
1020           for ( i = 0; i < myNbTimes1; i++ ) {
1021             for ( j = 0; j < myNbTimes2; j++ ) {
1022               DX = i * myStep1 * Vec1.X() + j * myStep2 * Vec2.X() ;
1023               DY = i * myStep1 * Vec1.Y() + j * myStep2 * Vec2.Y() ;
1024               DZ = i * myStep1 * Vec1.Z() + j * myStep2 * Vec2.Z() ;
1025               myVec.SetCoord( DX, DY, DZ ) ;
1026               
1027               theTransformation.SetTranslation(myVec) ;
1028               BRepBuilderAPI_Transform myBRepTransformation(S, theTransformation, Standard_False) ;
1029               B.Add( compound, myBRepTransformation.Shape() );
1030             }
1031           }
1032           mySimulationTopoDs = compound ;
1033           myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ;
1034           break;
1035         }
1036       }
1037   }
1038   catch(Standard_Failure) {
1039     MESSAGE( "Exception catched in MakeMultitranslationSimulationAndDisplay" ) ;
1040     return ;
1041   }
1042   return ;
1043 }