]> SALOME platform Git repositories - modules/geom.git/blob - src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx
Salome HOME
2d7b5aae1dd7fbb7d64d1eb0fa99867e8364c723
[modules/geom.git] / src / TransformationGUI / TransformationGUI_MultiRotationDlg.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   : TransformationGUI_MultiTranslationDlg.cxx
25 //  Author : Damien COQUERET
26 //  Module : GEOM
27 //  $Header$
28
29 #include "TransformationGUI_MultiRotationDlg.h"
30
31 #include <gp_Lin.hxx>
32 #include <Precision.hxx>
33 #include <BRepBuilderAPI_MakeVertex.hxx>
34 #include <GeomAPI_ProjectPointOnCurve.hxx>
35 #include <BRepAdaptor_Curve.hxx>
36 #include <BRep_Builder.hxx>
37 #include <BRepGProp.hxx>
38 #include <GProp_GProps.hxx>
39 #include <TopoDS_Compound.hxx>
40 #include <Geom_Line.hxx>
41 #include <BRepBuilderAPI_Transform.hxx>
42 #include "QAD_Config.h"
43
44 #include "utilities.h"
45
46 using namespace std;
47
48 //=================================================================================
49 // class    : TransformationGUI_MultiRotationDlg()
50 // purpose  : Constructs a TransformationGUI_MultiRotationDlg which is a child of 'parent', with the 
51 //            name 'name' and widget flags set to 'f'.
52 //            The dialog will by default be modeless, unless you set 'modal' to
53 //            TRUE to construct a modal dialog.
54 //=================================================================================
55 TransformationGUI_MultiRotationDlg::TransformationGUI_MultiRotationDlg(QWidget* parent,  const char* name, TransformationGUI* theTransformationGUI, SALOME_Selection* Sel, bool modal, WFlags fl)
56   :GEOMBase_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
57 {
58   QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_MULTIROTATION_SIMPLE")));
59   QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_MULTIROTATION_DOUBLE")));
60   QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
61
62   setCaption(tr("GEOM_MULTIROTATION_TITLE"));
63
64   /***************************************************************/
65   GroupConstructors->setTitle(tr("GEOM_MULTIROTATION"));
66   RadioButton1->setPixmap(image0);
67   RadioButton2->setPixmap(image1);
68   RadioButton3->close(TRUE);
69
70   GroupPoints = new DlgRef_2Sel1Spin(this, "GroupPoints");
71   GroupPoints->GroupBox1->setTitle(tr("GEOM_MULTIROTATION_SIMPLE"));
72   GroupPoints->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
73   GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
74   GroupPoints->TextLabel3->setText(tr("GEOM_NB_TIMES"));
75   GroupPoints->PushButton1->setPixmap(image2);
76   GroupPoints->PushButton2->setPixmap(image2);
77
78   GroupDimensions = new DlgRef_2Sel4Spin1Check(this, "GroupDimensions");
79   GroupDimensions->GroupBox1->setTitle(tr("GEOM_MULTIROTATION_DOUBLE"));
80   GroupDimensions->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
81   GroupDimensions->TextLabel2->setText(tr("GEOM_VECTOR"));
82   GroupDimensions->TextLabel3->setText(tr("GEOM_ANGLE"));
83   GroupDimensions->TextLabel4->setText(tr("GEOM_NB_TIMES"));
84   GroupDimensions->TextLabel5->setText(tr("GEOM_STEP"));
85   GroupDimensions->TextLabel6->setText(tr("GEOM_NB_TIMES"));
86   GroupDimensions->CheckButton1->setText(tr("GEOM_REVERSE"));
87   GroupDimensions->PushButton1->setPixmap(image2);
88   GroupDimensions->PushButton2->setPixmap(image2);
89
90   Layout1->addWidget(GroupPoints, 1, 0);
91   Layout1->addWidget(GroupDimensions, 1, 0);
92   /***************************************************************/
93
94   /* Initialisations */
95   myTransformationGUI = theTransformationGUI;
96   Init();
97 }
98
99
100 //=================================================================================
101 // function : ~TransformationGUI_MultiRotationDlg()
102 // purpose  : Destroys the object and frees any allocated resources
103 //=================================================================================
104 TransformationGUI_MultiRotationDlg::~TransformationGUI_MultiRotationDlg()
105 {
106   // no need to delete child widgets, Qt does it all for us
107 }
108
109
110 //=================================================================================
111 // function : Init()
112 // purpose  :
113 //=================================================================================
114 void TransformationGUI_MultiRotationDlg::Init()
115 {
116   /* init variables */
117   myConstructorId = 0;
118   myEditCurrentArgument = GroupPoints->LineEdit1;
119
120   myAng = 45.0;
121   myStep = 50.0;
122   myNbTimes1 = 2;
123   myNbTimes2 = 2;
124   myOkBase = myOkDir = false;
125
126   myEdgeFilter = new GEOM_ShapeTypeFilter(TopAbs_EDGE, myGeom);
127
128   /* Get setting of step value from file configuration */
129   QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
130   step = St.toDouble();
131
132   double SpecificStep1 = 5;
133   double SpecificStep2 = 1;
134   /* min, max, step and decimals for spin boxes & initial values */
135   GroupPoints->SpinBox_DX->RangeStepAndValidator(1.0, 999.999, SpecificStep2, 3);
136   GroupPoints->SpinBox_DX->SetValue(myNbTimes1);
137
138   GroupDimensions->SpinBox_DX1->RangeStepAndValidator(-999.999, 999.999, SpecificStep1, 3);
139   GroupDimensions->SpinBox_DY1->RangeStepAndValidator(1.0, 999.999, SpecificStep2, 3);
140   GroupDimensions->SpinBox_DX2->RangeStepAndValidator(-999.999, 999.999, step, 3);
141   GroupDimensions->SpinBox_DY2->RangeStepAndValidator(1.0, 999.999, SpecificStep2, 3);
142   GroupDimensions->SpinBox_DX1->SetValue(myAng);
143   GroupDimensions->SpinBox_DY1->SetValue(myNbTimes1);
144   GroupDimensions->SpinBox_DX2->SetValue(myStep);
145   GroupDimensions->SpinBox_DY2->SetValue(myNbTimes2);
146
147   /* signals and slots connections */
148   connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
149   connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
150   connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
151
152   connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
153   connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
154   connect(GroupDimensions->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
155   connect(GroupDimensions->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
156
157   connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
158   connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
159   connect(GroupDimensions->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
160   connect(GroupDimensions->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
161
162   connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
163   connect(GroupDimensions->SpinBox_DX1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
164   connect(GroupDimensions->SpinBox_DY1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
165   connect(GroupDimensions->SpinBox_DX2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
166   connect(GroupDimensions->SpinBox_DY2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
167
168   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
169   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX1, SLOT(SetStep(double)));
170   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY1, SLOT(SetStep(double)));
171   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX2, SLOT(SetStep(double)));
172   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY2, SLOT(SetStep(double)));
173
174   connect(GroupDimensions->CheckButton1, SIGNAL(stateChanged(int)), this, SLOT(ReverseAngle(int)));
175   
176   connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
177
178   /* displays Dialog */
179   GroupDimensions->hide();
180   GroupPoints->show();
181   this->show();
182
183   return;
184 }
185
186
187 //=================================================================================
188 // function : ConstructorsClicked()
189 // purpose  : Radio button management
190 //=================================================================================
191 void TransformationGUI_MultiRotationDlg::ConstructorsClicked(int constructorId)
192 {
193   myConstructorId = constructorId;
194   mySelection->ClearFilters();
195   myGeomBase->EraseSimulationShape();
196   mySimulationTopoDs.Nullify();
197   disconnect(mySelection, 0, this, 0);
198   myAng = 45.0;
199   myStep = 50.0;
200   myNbTimes1 = 2;
201   myNbTimes2 = 2;
202   myOkBase = myOkDir = false;
203
204   switch (constructorId)
205     {
206     case 0: /* Rotate simple */
207       {
208         GroupDimensions->hide();
209         resize(0, 0);
210         GroupPoints->show();
211
212         myEditCurrentArgument = GroupPoints->LineEdit1;
213         GroupPoints->LineEdit1->setText("");
214         GroupPoints->LineEdit2->setText("");
215
216         GroupPoints->SpinBox_DX->SetValue(myNbTimes1);
217
218         /* filter for next selection */
219         connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
220         break;
221       }
222     case 1: /* Rotate double */
223       {
224         GroupPoints->hide();
225         resize(0, 0);
226         GroupDimensions->show();
227
228         myEditCurrentArgument = GroupDimensions->LineEdit1;
229         GroupDimensions->LineEdit1->setText("");
230         GroupDimensions->LineEdit2->setText("");
231
232         GroupDimensions->SpinBox_DX1->SetValue(myAng);
233         GroupDimensions->SpinBox_DY1->SetValue(myNbTimes1);
234         GroupDimensions->SpinBox_DX2->SetValue(myStep);
235         GroupDimensions->SpinBox_DY2->SetValue(myNbTimes2);
236
237         /* filter for next selection */
238         connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
239         break;
240       }      
241     }
242   return;
243 }
244
245
246 //=================================================================================
247 // function : ClickOnOk()
248 // purpose  :
249 //=================================================================================
250 void TransformationGUI_MultiRotationDlg::ClickOnOk()
251 {
252   this->ClickOnApply();
253   ClickOnCancel();
254   return;
255 }
256
257
258 //=================================================================================
259 // function : ClickOnApply()
260 // purpose  :
261 //=================================================================================
262 void TransformationGUI_MultiRotationDlg::ClickOnApply()
263 {
264   buttonApply->setFocus();
265   QAD_Application::getDesktop()->putInfo(tr(""));
266   if (mySimulationTopoDs.IsNull())
267     return;
268   myGeomBase->EraseSimulationShape();
269   mySimulationTopoDs.Nullify();
270
271   if(myConstructorId == 0) {
272     if(myOkBase && myOkDir)
273       myTransformationGUI->MakeMultiRotation1DAndDisplay(myGeomShape, myDir, myLoc, myNbTimes1);
274   }
275   else if(myConstructorId == 1) {
276     if(myOkBase && myOkDir)
277       myTransformationGUI->MakeMultiRotation2DAndDisplay(myGeomShape, myDir, myLoc, myAng, myNbTimes1, myStep, myNbTimes2);
278   }
279   return;
280 }
281
282
283 //=================================================================================
284 // function : SelectionIntoArgument()
285 // purpose  : Called when selection as changed or other case
286 //=================================================================================
287 void TransformationGUI_MultiRotationDlg::SelectionIntoArgument()
288 {
289   myGeomBase->EraseSimulationShape();
290   mySimulationTopoDs.Nullify();
291   myEditCurrentArgument->setText("");
292   QString aString = ""; /* name of selection */
293
294   int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
295   if(nbSel != 1) {
296     if(myEditCurrentArgument == GroupPoints->LineEdit1 || myEditCurrentArgument == GroupDimensions->LineEdit1)
297       myOkBase = false;
298     else if(myEditCurrentArgument == GroupPoints->LineEdit2 || myEditCurrentArgument == GroupDimensions->LineEdit2)
299       myOkDir = false;
300     return;
301   }
302
303   // nbSel == 1
304   TopoDS_Shape S; 
305   Standard_Boolean testResult;
306   Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
307   if(!myGeomBase->GetTopoFromSelection(mySelection, S))
308     return;
309
310   if(myEditCurrentArgument == GroupPoints->LineEdit1 || myEditCurrentArgument == GroupDimensions->LineEdit1) {
311     myGeomShape = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
312     if(!testResult)
313       return;
314     myEditCurrentArgument->setText(aString);
315     myBase = S;
316     myOkBase = true;
317   }    
318   else if(myEditCurrentArgument == GroupPoints->LineEdit2 || myEditCurrentArgument == GroupDimensions->LineEdit2) {
319     BRepAdaptor_Curve curv(TopoDS::Edge(S));
320     myDir = curv.Line().Direction();
321     myLoc = curv.Line().Location();
322     myEditCurrentArgument->setText(aString);
323     myOkDir = true;
324   }
325
326   if(myOkBase && myOkDir)
327     this->MakeMultiRotationSimulationAndDisplay();
328   return;
329 }
330
331
332 //=================================================================================
333 // function : SetEditCurrentArgument()
334 // purpose  :
335 //=================================================================================
336 void TransformationGUI_MultiRotationDlg::SetEditCurrentArgument()
337 {
338   QPushButton* send = (QPushButton*)sender();
339   mySelection->ClearFilters();
340
341   if(send == GroupPoints->PushButton1) {
342     GroupPoints->LineEdit1->setFocus();
343     myEditCurrentArgument = GroupPoints->LineEdit1;
344   }
345   else if(send == GroupPoints->PushButton2) {
346     GroupPoints->LineEdit2->setFocus();
347     myEditCurrentArgument = GroupPoints->LineEdit2;
348     mySelection->AddFilter(myEdgeFilter);
349   }
350   else if(send == GroupDimensions->PushButton1) {
351     GroupDimensions->LineEdit1->setFocus();
352     myEditCurrentArgument = GroupDimensions->LineEdit1;
353   }
354   else if(send == GroupDimensions->PushButton2) {
355     GroupDimensions->LineEdit2->setFocus();
356     myEditCurrentArgument = GroupDimensions->LineEdit2;
357     mySelection->AddFilter(myEdgeFilter);
358   }
359   this->SelectionIntoArgument();
360
361   return;
362 }
363
364
365 //=================================================================================
366 // function : LineEditReturnPressed()
367 // purpose  :
368 //=================================================================================
369 void TransformationGUI_MultiRotationDlg::LineEditReturnPressed()
370 {
371   QLineEdit* send = (QLineEdit*)sender();
372   if(send == GroupPoints->LineEdit1)
373     myEditCurrentArgument = GroupPoints->LineEdit1;
374   else if (send == GroupPoints->LineEdit2)
375     myEditCurrentArgument = GroupPoints->LineEdit2;
376   else if (send == GroupDimensions->LineEdit1)
377     myEditCurrentArgument = GroupDimensions->LineEdit1;
378   else if (send == GroupDimensions->LineEdit2)
379     myEditCurrentArgument = GroupDimensions->LineEdit2;
380   else
381     return;
382
383   GEOMBase_Skeleton::LineEditReturnPressed();
384   return;
385 }
386
387
388 //=================================================================================
389 // function : ActivateThisDialog()
390 // purpose  :
391 //=================================================================================
392 void TransformationGUI_MultiRotationDlg::ActivateThisDialog()
393 {
394   GEOMBase_Skeleton::ActivateThisDialog();
395   connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
396
397   if(myConstructorId == 0) {
398     GroupPoints->LineEdit1->setFocus();
399     myEditCurrentArgument = GroupPoints->LineEdit1;
400   }
401   else if(myConstructorId == 1) {
402     GroupDimensions->LineEdit1->setFocus();
403     myEditCurrentArgument = GroupDimensions->LineEdit1;
404   }
405
406   if(!mySimulationTopoDs.IsNull())
407     myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
408   return;
409 }
410
411
412 //=================================================================================
413 // function : enterEvent()
414 // purpose  :
415 //=================================================================================
416 void TransformationGUI_MultiRotationDlg::enterEvent(QEvent* e)
417 {
418   if (GroupConstructors->isEnabled())
419     return;
420   this->ActivateThisDialog();
421   return;
422 }
423
424
425 //=================================================================================
426 // function : ValueChangedInSpinBox()
427 // purpose  :
428 //=================================================================================
429 void TransformationGUI_MultiRotationDlg::ValueChangedInSpinBox(double newValue)
430 {
431   myGeomBase->EraseSimulationShape();
432   mySimulationTopoDs.Nullify();
433   QObject* send = (QObject*)sender();
434
435   if(send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DY1)
436     myNbTimes1 = (int)newValue;
437   else if(send == GroupDimensions->SpinBox_DX1)
438     myAng = newValue;
439   else if(send == GroupDimensions->SpinBox_DX2)
440     myStep = newValue;
441   else if(send == GroupDimensions->SpinBox_DY2)
442     myNbTimes2 = (int)newValue;
443
444   if(myOkBase && myOkDir)
445     this->MakeMultiRotationSimulationAndDisplay();
446   return;
447 }
448
449
450 //=================================================================================
451 // function : ReverseAngle()
452 // purpose  : 'state' not used here
453 //=================================================================================
454 void TransformationGUI_MultiRotationDlg::ReverseAngle(int state)
455 {
456   myAng = -myAng;
457   if(myConstructorId == 0)
458     GroupPoints->SpinBox_DX->SetValue(myAng);
459   else if(myConstructorId == 1)
460     GroupDimensions->SpinBox_DX1->SetValue(myAng);
461
462   if(myOkBase && myOkDir)
463     this->MakeMultiRotationSimulationAndDisplay();
464   return;
465 }
466
467
468 //=================================================================================
469 // function : MakeMultiRotationSimulationAndDisplay()
470 // purpose  :
471 //=================================================================================
472 void TransformationGUI_MultiRotationDlg::MakeMultiRotationSimulationAndDisplay() 
473 {
474   myGeomBase->EraseSimulationShape();
475   mySimulationTopoDs.Nullify();
476
477   int i, j;
478   Standard_Real DX, DY, DZ;
479   gp_Trsf theTransformation;
480   gp_Trsf theTransformation1;
481   gp_Trsf theTransformation2;
482   gp_Pnt myPoint;
483   GProp_GProps System;
484   TopoDS_Compound compound;
485
486   BRep_Builder B;
487   B.MakeCompound(compound);  
488
489   if(myBase.ShapeType() == TopAbs_VERTEX)
490     myGeomBase->VertexToPoint(myBase, myPoint);
491   else if(myBase.ShapeType() == TopAbs_EDGE || myBase.ShapeType() == TopAbs_WIRE) {
492     BRepGProp::LinearProperties(myBase, System);
493     myPoint = System.CentreOfMass();
494   }
495   else if(myBase.ShapeType() == TopAbs_FACE || myBase.ShapeType() == TopAbs_SHELL) {
496     BRepGProp::SurfaceProperties(myBase, System);
497     myPoint = System.CentreOfMass();
498   }
499   else {
500     BRepGProp::VolumeProperties(myBase, System);
501     myPoint = System.CentreOfMass();
502   }
503
504   TopoDS_Shape S = BRepBuilderAPI_MakeVertex(myPoint).Shape();
505
506   try {
507     switch (myConstructorId)
508       {
509       case 0 :
510         { 
511           gp_Ax1 AX1(myLoc, myDir);
512           Standard_Real angle = 360/myNbTimes1;
513           for(i = 0; i < myNbTimes1; i++) {
514             theTransformation.SetRotation(AX1, i*angle*PI180);
515             BRepBuilderAPI_Transform myBRepTransformation(S, theTransformation, Standard_False);
516             B.Add(compound, myBRepTransformation.Shape());
517           }
518           mySimulationTopoDs = compound;
519           myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
520           break;
521         }
522       case 1 :
523         {       
524           gp_Ax1 AX2(myLoc, myDir);
525           Handle(Geom_Line) Line = new Geom_Line(AX2);
526           gp_Pnt P2 = GeomAPI_ProjectPointOnCurve(myPoint, Line);
527           if(myPoint.IsEqual(P2, Precision::Confusion()))
528             return;
529
530           gp_Vec Vec(P2, myPoint);
531           Vec.Normalize();
532
533           for(i = 0; i < myNbTimes2; i++) {
534             for(j = 0; j < myNbTimes1; j++) {
535               DX = i * myStep * Vec.X();
536               DY = i * myStep * Vec.Y();
537               DZ = i * myStep * Vec.Z();
538               myVec.SetCoord(DX, DY, DZ);
539
540               theTransformation1.SetTranslation(myVec);
541               theTransformation2.SetRotation(AX2, j*myAng*PI180);
542               BRepBuilderAPI_Transform myBRepTransformation1(S, theTransformation1, Standard_False);
543               BRepBuilderAPI_Transform myBRepTransformation2(myBRepTransformation1.Shape(), theTransformation2, Standard_False);
544               B.Add(compound, myBRepTransformation2.Shape());
545             }
546           }
547           mySimulationTopoDs = compound;
548           myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
549           break;
550         }
551       }
552   }
553   catch(Standard_Failure) {
554     MESSAGE("Exception catched in MakeMultitranslationSimulationAndDisplay");
555     return;
556   }
557   return;
558 }