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