Salome HOME
6ac1ca9232ae1d232490b38d179604ea99a4e871
[modules/geom.git] / src / TransformationGUI / TransformationGUI_MultiRotationDlg.cxx
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  File   : TransformationGUI_MultiRotationDlg.cxx
23 //  Author : Damien COQUERET, Open CASCADE S.A.S.
24
25 #include "TransformationGUI_MultiRotationDlg.h"
26
27 #include <DlgRef.h>
28 #include <GeometryGUI.h>
29 #include <GEOMBase.h>
30
31 #include <SUIT_Session.h>
32 #include <SUIT_ResourceMgr.h>
33 #include <SalomeApp_Application.h>
34 #include <LightApp_SelectionMgr.h>
35
36 // OCCT Includes
37 #include <TopoDS_Shape.hxx>
38 #include <TopoDS_Edge.hxx>
39 #include <TopoDS.hxx>
40 #include <TopExp.hxx>
41 #include <TColStd_IndexedMapOfInteger.hxx>
42 #include <TopTools_IndexedMapOfShape.hxx>
43
44 #include <GEOMImpl_Types.hxx>
45
46 //=================================================================================
47 // class    : TransformationGUI_MultiRotationDlg()
48 // purpose  : Constructs a TransformationGUI_MultiRotationDlg which is a child of 'parent', with the
49 //            name 'name' and widget flags set to 'f'.
50 //            The dialog will by default be modeless, unless you set 'modal' to
51 //            TRUE to construct a modal dialog.
52 //=================================================================================
53 TransformationGUI_MultiRotationDlg::TransformationGUI_MultiRotationDlg
54 (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal, Qt::WindowFlags fl)
55   : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl),
56     myInitial(true)
57 {
58   SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
59   QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_MULTIROTATION_SIMPLE")));
60   QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_MULTIROTATION_DOUBLE")));
61   QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
62
63   setWindowTitle(tr("GEOM_MULTIROTATION_TITLE"));
64
65   /***************************************************************/
66   mainFrame()->GroupConstructors->setTitle(tr("GEOM_MULTIROTATION"));
67   mainFrame()->RadioButton1->setIcon(image0);
68   mainFrame()->RadioButton2->setIcon(image1);
69   mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
70   mainFrame()->RadioButton3->close();
71
72   bool isAngleStep = false;
73
74   GroupArgs = new TransformationGUI_2Sel4Spin1Check (centralWidget());
75   GroupArgs->GroupBox1->setTitle(tr("GEOM_MULTIROTATION_DOUBLE"));
76   GroupArgs->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
77   GroupArgs->TextLabel2->setText(tr("GEOM_VECTOR"));
78   //GroupArgs->TextLabel3->setText(tr("GEOM_ANGLE_STEP"));
79   GroupArgs->CheckAngleStep->setText(tr("GEOM_ANGLE_STEP"));
80   GroupArgs->CheckAngleStep->setChecked(isAngleStep);
81   GroupArgs->TextLabel4->setText(tr("GEOM_NB_TIMES"));
82   GroupArgs->TextLabel5->setText(tr("GEOM_STEP_R"));
83   GroupArgs->TextLabel6->setText(tr("GEOM_NB_TIMES"));
84   GroupArgs->CheckButton1->setText(tr("GEOM_REVERSE"));
85   GroupArgs->PushButton1->setIcon(image2);
86   GroupArgs->PushButton2->setIcon(image2);
87   GroupArgs->LineEdit1->setReadOnly(true);
88   GroupArgs->LineEdit2->setReadOnly(true);
89   GroupArgs->SpinBox_DX1->setEnabled(isAngleStep);
90   GroupArgs->CheckButton1->setEnabled(isAngleStep);
91   /***************************************************************/
92
93   setHelpFileName("multi_rotation_operation_page.html");
94
95   Init();
96 }
97
98 //=================================================================================
99 // function : ~TransformationGUI_MultiRotationDlg()
100 // purpose  : Destroys the object and frees any allocated resources
101 //=================================================================================
102 TransformationGUI_MultiRotationDlg::~TransformationGUI_MultiRotationDlg()
103 {
104   // no need to delete child widgets, Qt does it all for us
105 }
106
107 //=================================================================================
108 // function : Init()
109 // purpose  :
110 //=================================================================================
111 void TransformationGUI_MultiRotationDlg::Init()
112 {
113   // init variables
114   myAng = 45.0;
115   myStep = 50.0;
116   myNbTimes1 = myNbTimes2 = 3;
117
118   // Get setting of step value from file configuration
119   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
120   double step = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100);
121
122   int SpecificStep1 = 5;
123   int SpecificStep2 = 1;
124
125   // min, max, step and decimals for spin boxes & initial values
126   initSpinBox(GroupArgs->SpinBox_DX1, COORD_MIN, COORD_MAX, SpecificStep1, "angle_precision");
127   initSpinBox(GroupArgs->SpinBox_DY1, 1, 999, SpecificStep2);
128   initSpinBox(GroupArgs->SpinBox_DX2, COORD_MIN, COORD_MAX, step, "length_precision");
129   initSpinBox(GroupArgs->SpinBox_DY2, 1, 999, SpecificStep2);
130
131   mainFrame()->GroupBoxPublish->show();
132
133   // signals and slots connections
134   connect(buttonOk(),    SIGNAL(clicked()), this, SLOT(ClickOnOk()));
135   connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
136
137   connect(this, SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
138
139   connect(GroupArgs->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
140   connect(GroupArgs->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
141
142   connect(GroupArgs->SpinBox_DX1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
143   connect(GroupArgs->SpinBox_DY1, SIGNAL(valueChanged(int)),    this, SLOT(ValueChangedInSpinBox(int)));
144   connect(GroupArgs->SpinBox_DX2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
145   connect(GroupArgs->SpinBox_DY2, SIGNAL(valueChanged(int)),    this, SLOT(ValueChangedInSpinBox(int)));
146
147   connect(GroupArgs->SpinBox_DX1, SIGNAL(textChanged(const QString&)),
148           this, SLOT(TextValueChangedInSpinBox(const QString&)));
149
150   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double)));
151
152   connect(GroupArgs->CheckAngleStep, SIGNAL(toggled(bool)), this, SLOT(CheckAngleStep(bool)));
153   connect(GroupArgs->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseAngle()));
154
155   initName(tr("GEOM_MULTIROTATION"));
156
157   ConstructorsClicked(0);
158 }
159
160 //=================================================================================
161 // function : SetDoubleSpinBoxStep()
162 // purpose  : Double spin box management
163 //=================================================================================
164 void TransformationGUI_MultiRotationDlg::SetDoubleSpinBoxStep (double step)
165 {
166   GroupArgs->SpinBox_DX2->setSingleStep(step);
167 }
168
169 //=================================================================================
170 // function : ConstructorsClicked()
171 // purpose  : Radio button management
172 //=================================================================================
173 void TransformationGUI_MultiRotationDlg::ConstructorsClicked (int constructorId)
174 {
175   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
176
177   myBase.nullify();
178   myVector.nullify();
179
180   GroupArgs->LineEdit1->setText("");
181   GroupArgs->LineEdit2->setText("");
182
183   GroupArgs->SpinBox_DX1->setValue(myAng);
184   GroupArgs->SpinBox_DY1->setValue(myNbTimes1);
185   GroupArgs->SpinBox_DX2->setValue(myStep);
186   GroupArgs->SpinBox_DY2->setValue(myNbTimes2);
187
188   switch (constructorId) {
189   case 0: // Rotate simple
190     {
191       GroupArgs->GroupBox1->setTitle(tr("GEOM_MULTIROTATION_SIMPLE"));
192       GroupArgs->TextLabel5->hide();
193       GroupArgs->TextLabel6->hide();
194       GroupArgs->SpinBox_DX2->hide();
195       GroupArgs->SpinBox_DY2->hide();
196       GroupArgs->CheckButton1->hide();
197     }
198     break;
199   case 1: // Rotate double
200     {
201       GroupArgs->GroupBox1->setTitle(tr("GEOM_MULTIROTATION_DOUBLE"));
202       GroupArgs->TextLabel5->show();
203       GroupArgs->TextLabel6->show();
204       GroupArgs->SpinBox_DX2->show();
205       GroupArgs->SpinBox_DY2->show();
206       GroupArgs->CheckButton1->show();
207     }
208     break;
209   }
210
211   GroupArgs->PushButton1->click();
212
213   qApp->processEvents();
214   updateGeometry();
215   resize(minimumSizeHint());
216
217   if (myInitial) {
218     myInitial = false;
219     SelectionIntoArgument();
220   }
221   else {
222     processPreview();
223   }
224 }
225
226 //=================================================================================
227 // function : ClickOnOk()
228 // purpose  :
229 //=================================================================================
230 void TransformationGUI_MultiRotationDlg::ClickOnOk()
231 {
232   setIsApplyAndClose( true );
233   if (ClickOnApply())
234     ClickOnCancel();
235 }
236
237 //=================================================================================
238 // function : ClickOnApply()
239 // purpose  :
240 //=================================================================================
241 bool TransformationGUI_MultiRotationDlg::ClickOnApply()
242 {
243   if (!onAccept())
244     return false;
245
246   initName();
247   // activate selection and connect selection manager
248   ConstructorsClicked(getConstructorId());
249   return true;
250 }
251
252 //=================================================================================
253 // function : SelectionIntoArgument()
254 // purpose  : Called when selection is changed or on dialog initialization or activation
255 //=================================================================================
256 void TransformationGUI_MultiRotationDlg::SelectionIntoArgument()
257 {
258   erasePreview();
259
260   TopAbs_ShapeEnum aNeedType = ( myEditCurrentArgument == GroupArgs->LineEdit2 ) ?
261     TopAbs_EDGE : TopAbs_SHAPE;
262   GEOM::GeomObjPtr aSelectedObject = getSelected( aNeedType );
263   TopoDS_Shape aShape;
264   if ( aSelectedObject && GEOMBase::GetShape( aSelectedObject.get(), aShape ) && !aShape.IsNull() ) {
265     QString aName = GEOMBase::GetName( aSelectedObject.get() );
266     myEditCurrentArgument->setText( aName );
267     if ( myEditCurrentArgument == GroupArgs->LineEdit1 ) {
268       myBase = aSelectedObject;
269
270       // recompute myAng and myStep (Mantis issue 0021718)
271       GEOM::GEOM_IMeasureOperations_var anOper = getGeomEngine()->GetIMeasureOperations(getStudyId());
272       double Xmin, Xmax, Ymin, Ymax, Zmin, Zmax;
273       anOper->GetBoundingBox(myBase.get(), true, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax);
274       if (anOper->IsDone()) {
275         // angular step
276         double diag = sqrt((Xmax-Xmin)*(Xmax-Xmin) + (Ymax-Ymin)*(Ymax-Ymin));
277         double d = sqrt((0.5*(Xmax+Xmin))*(0.5*(Xmax+Xmin)) + (0.5*(Ymax+Ymin))*(0.5*(Ymax+Ymin)));
278         myAng = floor(2.0 * atan(diag/d) * 180.0 / M_PI);
279         GroupArgs->SpinBox_DX1->setValue(myAng);
280
281         // radial step
282         myStep = Max(floor(1.5*(Xmax-Xmin)), floor(1.5*(Ymax-Ymin)));
283         GroupArgs->SpinBox_DX2->setValue(myStep);
284       }
285
286       if ( !myVector )
287         GroupArgs->PushButton2->click();
288     }
289     else if ( myEditCurrentArgument == GroupArgs->LineEdit2 ) {
290       myVector = aSelectedObject;
291       if ( !myBase )
292         GroupArgs->PushButton1->click();
293     }
294     
295     // clear selection
296     disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
297     myGeomGUI->getApp()->selectionMgr()->clearSelected();
298     connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
299             this, SLOT(SelectionIntoArgument()));
300   }
301   else {
302     if ( myEditCurrentArgument == GroupArgs->LineEdit1 )
303       myBase.nullify();
304     else if ( myEditCurrentArgument == GroupArgs->LineEdit2 )
305       myVector.nullify();
306     myEditCurrentArgument->setText("");
307   }
308
309   processPreview();
310 }
311
312 //=================================================================================
313 // function : SetEditCurrentArgument()
314 // purpose  :
315 //=================================================================================
316 void TransformationGUI_MultiRotationDlg::SetEditCurrentArgument()
317 {
318   QPushButton* send = (QPushButton*)sender();
319
320   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
321   globalSelection(GEOM_ALLSHAPES);
322
323   if (send == GroupArgs->PushButton1) {
324     myEditCurrentArgument = GroupArgs->LineEdit1;
325
326     GroupArgs->PushButton2->setDown(false);
327     GroupArgs->LineEdit2->setEnabled(false);
328   }
329   else if (send == GroupArgs->PushButton2) {
330     myEditCurrentArgument = GroupArgs->LineEdit2;
331
332     localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
333
334     GroupArgs->PushButton1->setDown(false);
335     GroupArgs->LineEdit1->setEnabled(false);
336   }
337   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
338           this, SLOT(SelectionIntoArgument()));
339
340   // enable line edit
341   myEditCurrentArgument->setEnabled(true);
342   myEditCurrentArgument->setFocus();
343   // after setFocus(), because it will be setDown(false) when loses focus
344   send->setDown(true);
345
346   // seems we need it only to avoid preview disappearing, caused by selection mode change
347   processPreview();
348 }
349
350 //=================================================================================
351 // function : ActivateThisDialog()
352 // purpose  :
353 //=================================================================================
354 void TransformationGUI_MultiRotationDlg::ActivateThisDialog()
355 {
356   GEOMBase_Skeleton::ActivateThisDialog();
357   connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
358            this, SLOT( SelectionIntoArgument() ) );
359
360   ConstructorsClicked( getConstructorId() );
361 }
362
363 //=================================================================================
364 // function : enterEvent()
365 // purpose  :
366 //=================================================================================
367 void TransformationGUI_MultiRotationDlg::enterEvent (QEvent*)
368 {
369   if (!mainFrame()->GroupConstructors->isEnabled())
370     ActivateThisDialog();
371 }
372
373 //=================================================================================
374 // function : TextValueChangedInSpinBox()
375 // purpose  :
376 //=================================================================================
377 void TransformationGUI_MultiRotationDlg::TextValueChangedInSpinBox (const QString& s)
378 {
379   bool isDigit;
380   s.toDouble(&isDigit);
381   if (!isDigit)
382     GroupArgs->CheckButton1->setChecked(false);
383   GroupArgs->CheckButton1->setEnabled(isDigit);
384 }
385
386 //=================================================================================
387 // function : ValueChangedInSpinBox()
388 // purpose  :
389 //=================================================================================
390 void TransformationGUI_MultiRotationDlg::ValueChangedInSpinBox (double newValue)
391 {
392   QObject* send = (QObject*)sender();
393
394   if (send == GroupArgs->SpinBox_DX1)
395     myAng = newValue;
396   else if (send == GroupArgs->SpinBox_DX2)
397     myStep = newValue;
398
399   processPreview();
400 }
401
402 //=================================================================================
403 // function : ValueChangedInSpinBox()
404 // purpose  :
405 //=================================================================================
406 void TransformationGUI_MultiRotationDlg::ValueChangedInSpinBox (int newValue)
407 {
408   QObject* send = (QObject*)sender();
409
410   if (send == GroupArgs->SpinBox_DY1)
411     myNbTimes1 = newValue;
412   else if (send == GroupArgs->SpinBox_DY2)
413     myNbTimes2 = newValue;
414
415   processPreview();
416 }
417
418 //=================================================================================
419 // function : ReverseAngle()
420 // purpose  :
421 //=================================================================================
422 void TransformationGUI_MultiRotationDlg::ReverseAngle()
423 {
424   myAng = -myAng;
425
426   int aConstructorId = getConstructorId();
427
428   if (aConstructorId == 1)
429     GroupArgs->SpinBox_DX1->setValue(myAng);
430
431   processPreview();
432 }
433
434 //=================================================================================
435 // function : CheckAngleStep()
436 // purpose  :
437 //=================================================================================
438 void TransformationGUI_MultiRotationDlg::CheckAngleStep (bool isOn)
439 {
440   GroupArgs->SpinBox_DX1->setEnabled(isOn);
441   GroupArgs->CheckButton1->setEnabled(isOn);
442   processPreview();
443 }
444
445 //=================================================================================
446 // function : createOperation
447 // purpose  :
448 //=================================================================================
449 GEOM::GEOM_IOperations_ptr TransformationGUI_MultiRotationDlg::createOperation()
450 {
451   return getGeomEngine()->GetITransformOperations(getStudyId());
452 }
453
454 //=================================================================================
455 // function : isValid
456 // purpose  :
457 //=================================================================================
458 bool TransformationGUI_MultiRotationDlg::isValid (QString& msg)
459 {
460   bool ok = false;
461   switch (getConstructorId()) {
462   case 0:
463     ok = (GroupArgs->SpinBox_DX1->isValid( msg, !IsPreview() ) &&
464           GroupArgs->SpinBox_DY1->isValid( msg, !IsPreview() ) &&
465           //myBase && myVector); // myVector = DZ by default
466           myBase);
467     break;
468   case 1:
469     ok = (GroupArgs->SpinBox_DX1->isValid( msg, !IsPreview() ) &&
470           GroupArgs->SpinBox_DY1->isValid( msg, !IsPreview() ) &&
471           GroupArgs->SpinBox_DX2->isValid( msg, !IsPreview() ) &&
472           GroupArgs->SpinBox_DY2->isValid( msg, !IsPreview() ) &&
473           //myBase && myVector); // myVector = DZ by default
474           myBase);
475     break;
476   default:
477     break;
478   }
479   return ok;
480 }
481
482 //=================================================================================
483 // function : execute
484 // purpose  :
485 //=================================================================================
486 bool TransformationGUI_MultiRotationDlg::execute (ObjectList& objects)
487 {
488   bool res = false;
489
490   GEOM::GEOM_Object_var anObj;
491   QStringList aParameters;
492
493   GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation());
494
495   switch (getConstructorId()) {
496   case 0:
497     if (GroupArgs->CheckAngleStep->isChecked())
498       anObj = anOper->MultiRotate1DByStep(myBase.get(), myVector.get(), myAng * M_PI / 180., myNbTimes1);
499     else
500       anObj = anOper->MultiRotate1D(myBase.get(), myVector.get(), myNbTimes1);
501
502     if (!IsPreview()) {
503       if (GroupArgs->CheckAngleStep->isChecked())
504         aParameters << GroupArgs->SpinBox_DX1->text();
505       aParameters << GroupArgs->SpinBox_DY1->text();
506     }
507     res = true;
508     break;
509   case 1:
510     if (GroupArgs->CheckAngleStep->isChecked())
511       anObj = anOper->MultiRotate2DByStep(myBase.get(), myVector.get(), myAng * M_PI / 180., myNbTimes1,
512                                           myStep, myNbTimes2);
513     else
514       anObj = anOper->MultiRotate2DNbTimes(myBase.get(), myVector.get(), myNbTimes1, myStep, myNbTimes2);
515
516     if (!IsPreview()) {
517       if (GroupArgs->CheckAngleStep->isChecked())
518         aParameters << GroupArgs->SpinBox_DX1->text();
519       aParameters << GroupArgs->SpinBox_DY1->text();
520       aParameters << GroupArgs->SpinBox_DX2->text();
521       aParameters << GroupArgs->SpinBox_DY2->text();
522     }
523     res = true;
524     break;
525   }
526
527   if (!anObj->_is_nil()) {
528     if (!IsPreview())
529       anObj->SetParameters(aParameters.join(":").toLatin1().constData());
530     objects.push_back(anObj._retn());
531   }
532
533   return res;
534 }
535
536 //=================================================================================
537 // function : addSubshapeToStudy
538 // purpose  : virtual method to add new SubObjects if local selection
539 //=================================================================================
540 void TransformationGUI_MultiRotationDlg::addSubshapesToStudy()
541 {
542   switch (getConstructorId()) {
543   case 0:
544   case 1:
545     GEOMBase::PublishSubObject( myVector.get() );
546     break;
547   default:
548     break;
549   }
550 }
551
552 //=================================================================================
553 // function : restoreSubShapes
554 // purpose  :
555 //=================================================================================
556 void TransformationGUI_MultiRotationDlg::restoreSubShapes (SALOMEDS::Study_ptr   theStudy,
557                                                            SALOMEDS::SObject_ptr theSObject)
558 {
559   if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
560     // we pass here the first operation argument (object) through the list of arguments
561     // because the rotation operation place its arguments in the data structure in another order,
562     // and we need to point the first argument directly
563     GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO;
564     anArgs->length(1);
565     anArgs[0] = myBase.copy();
566     getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
567                                         /*theFindMethod=*/GEOM::FSM_MultiTransformed,
568                                         /*theInheritFirstArg=*/true,
569                                         mainFrame()->CheckBoxAddPrefix->isChecked());
570   }
571 }
572
573 //=================================================================================
574 // function : TransformationGUI_2Sel4Spin1Check
575 // purpose  :
576 //=================================================================================
577 TransformationGUI_2Sel4Spin1Check::TransformationGUI_2Sel4Spin1Check (QWidget *parent)
578 {
579   gridLayout = new QGridLayout (parent);
580   gridLayout->setSpacing(6);
581   gridLayout->setContentsMargins(11, 11, 11, 11);
582   gridLayout->setHorizontalSpacing(0);
583   gridLayout->setVerticalSpacing(0);
584   gridLayout->setContentsMargins(0, 0, 0, 0);
585
586   GroupBox1 = new QGroupBox (parent);
587
588   gridLayout1 = new QGridLayout (GroupBox1);
589   gridLayout1->setSpacing(6);
590   gridLayout1->setContentsMargins(11, 11, 11, 11);
591   gridLayout1->setHorizontalSpacing(6);
592   gridLayout1->setVerticalSpacing(6);
593   gridLayout1->setContentsMargins(9, 9, 9, 9);
594
595   // 2Sel
596   TextLabel1 = new QLabel(GroupBox1);
597   TextLabel2 = new QLabel(GroupBox1);
598
599   PushButton1 = new QPushButton (GroupBox1);
600   PushButton2 = new QPushButton (GroupBox1);
601
602   LineEdit2 = new QLineEdit(GroupBox1);
603   LineEdit1 = new QLineEdit(GroupBox1);
604
605   gridLayout1->addWidget(TextLabel1, 0, 0, 1, 1);
606   gridLayout1->addWidget(TextLabel2, 1, 0, 1, 1);
607   gridLayout1->addWidget(PushButton1, 0, 1, 1, 1);
608   gridLayout1->addWidget(PushButton2, 1, 1, 1, 1);
609   gridLayout1->addWidget(LineEdit1, 0, 2, 1, 1);
610   gridLayout1->addWidget(LineEdit2, 1, 2, 1, 1);
611
612   // 4Spin (double-int-double-int)
613   //TextLabel3 = new QLabel (GroupBox1);
614   CheckAngleStep = new QCheckBox (GroupBox1);
615   TextLabel4 = new QLabel (GroupBox1);
616   TextLabel5 = new QLabel (GroupBox1);
617   TextLabel6 = new QLabel (GroupBox1);
618
619   SpinBox_DX1 = new SalomeApp_DoubleSpinBox (GroupBox1);
620   SpinBox_DY1 = new SalomeApp_IntSpinBox (GroupBox1);
621   SpinBox_DX2 = new SalomeApp_DoubleSpinBox (GroupBox1);
622   SpinBox_DY2 = new SalomeApp_IntSpinBox (GroupBox1);
623
624   //gridLayout1->addWidget(TextLabel3, 2, 0, 1, 1);
625   gridLayout1->addWidget(CheckAngleStep, 2, 0, 1, 1);
626   gridLayout1->addWidget(TextLabel4, 3, 0, 1, 1);
627   gridLayout1->addWidget(TextLabel5, 5, 0, 1, 1);
628   gridLayout1->addWidget(TextLabel6, 6, 0, 1, 1);
629
630   gridLayout1->addWidget(SpinBox_DX1, 2, 1, 1, 2);
631   gridLayout1->addWidget(SpinBox_DY1, 3, 1, 1, 2);
632   gridLayout1->addWidget(SpinBox_DX2, 5, 1, 1, 2);
633   gridLayout1->addWidget(SpinBox_DY2, 6, 1, 1, 2);
634
635   // 1Check
636   CheckButton1 = new QCheckBox (GroupBox1);
637
638   gridLayout1->addWidget(CheckButton1, 4, 0, 1, 3);
639
640   gridLayout->addWidget(GroupBox1, 0, 0, 1, 1);
641 }
642
643 //=================================================================================
644 // function : ~TransformationGUI_2Sel4Spin1Check()
645 // purpose  : Destroys the object and frees any allocated resources
646 //=================================================================================
647 TransformationGUI_2Sel4Spin1Check::~TransformationGUI_2Sel4Spin1Check()
648 {
649   // no need to delete child widgets, Qt does it all for us
650 }