Salome HOME
594073b64871ba10e40782af5979cd1da8414c3c
[modules/geom.git] / src / TransformationGUI / TransformationGUI_MultiRotationDlg.cxx
1 // Copyright (C) 2007-2023  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, or (at your option) any later version.
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();
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         if ( fabs(d) > 1.e-16 )
279           myAng = floor(2.0 * atan(diag/d) * 180.0 / M_PI);
280         GroupArgs->SpinBox_DX1->setValue(myAng);
281
282         // radial step
283         myStep = Max(floor(1.5*(Xmax-Xmin)), floor(1.5*(Ymax-Ymin)));
284         GroupArgs->SpinBox_DX2->setValue(myStep);
285       }
286
287       if ( !myVector )
288         GroupArgs->PushButton2->click();
289     }
290     else if ( myEditCurrentArgument == GroupArgs->LineEdit2 ) {
291       myVector = aSelectedObject;
292       if ( !myBase )
293         GroupArgs->PushButton1->click();
294     }
295     
296     // clear selection
297     // disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
298     // myGeomGUI->getApp()->selectionMgr()->clearSelected();
299     // connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
300     //         this, SLOT(SelectionIntoArgument()));
301   }
302   else {
303     if ( myEditCurrentArgument == GroupArgs->LineEdit1 )
304       myBase.nullify();
305     else if ( myEditCurrentArgument == GroupArgs->LineEdit2 )
306       myVector.nullify();
307     myEditCurrentArgument->setText("");
308   }
309
310   processPreview();
311 }
312
313 //=================================================================================
314 // function : SetEditCurrentArgument()
315 // purpose  :
316 //=================================================================================
317 void TransformationGUI_MultiRotationDlg::SetEditCurrentArgument()
318 {
319   QPushButton* send = (QPushButton*)sender();
320
321   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
322   globalSelection(GEOM_ALLSHAPES);
323
324   if (send == GroupArgs->PushButton1) {
325     myEditCurrentArgument = GroupArgs->LineEdit1;
326
327     GroupArgs->PushButton2->setDown(false);
328     GroupArgs->LineEdit2->setEnabled(false);
329   }
330   else if (send == GroupArgs->PushButton2) {
331     myEditCurrentArgument = GroupArgs->LineEdit2;
332
333     localSelection(TopAbs_EDGE);
334
335     GroupArgs->PushButton1->setDown(false);
336     GroupArgs->LineEdit1->setEnabled(false);
337   }
338   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
339           this, SLOT(SelectionIntoArgument()));
340
341   // enable line edit
342   myEditCurrentArgument->setEnabled(true);
343   myEditCurrentArgument->setFocus();
344   // after setFocus(), because it will be setDown(false) when loses focus
345   send->setDown(true);
346
347   // seems we need it only to avoid preview disappearing, caused by selection mode change
348   processPreview();
349 }
350
351 //=================================================================================
352 // function : ActivateThisDialog()
353 // purpose  :
354 //=================================================================================
355 void TransformationGUI_MultiRotationDlg::ActivateThisDialog()
356 {
357   GEOMBase_Skeleton::ActivateThisDialog();
358   connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
359            this, SLOT( SelectionIntoArgument() ) );
360
361   ConstructorsClicked( getConstructorId() );
362 }
363
364 //=================================================================================
365 // function : enterEvent()
366 // purpose  :
367 //=================================================================================
368 void TransformationGUI_MultiRotationDlg::enterEvent (QEvent*)
369 {
370   if (!mainFrame()->GroupConstructors->isEnabled())
371     ActivateThisDialog();
372 }
373
374 //=================================================================================
375 // function : TextValueChangedInSpinBox()
376 // purpose  :
377 //=================================================================================
378 void TransformationGUI_MultiRotationDlg::TextValueChangedInSpinBox (const QString& s)
379 {
380   bool isDigit;
381   s.toDouble(&isDigit);
382   if (!isDigit)
383     GroupArgs->CheckButton1->setChecked(false);
384   GroupArgs->CheckButton1->setEnabled(isDigit);
385 }
386
387 //=================================================================================
388 // function : ValueChangedInSpinBox()
389 // purpose  :
390 //=================================================================================
391 void TransformationGUI_MultiRotationDlg::ValueChangedInSpinBox (double newValue)
392 {
393   QObject* send = (QObject*)sender();
394
395   if (send == GroupArgs->SpinBox_DX1)
396     myAng = newValue;
397   else if (send == GroupArgs->SpinBox_DX2)
398     myStep = newValue;
399
400   processPreview();
401 }
402
403 //=================================================================================
404 // function : ValueChangedInSpinBox()
405 // purpose  :
406 //=================================================================================
407 void TransformationGUI_MultiRotationDlg::ValueChangedInSpinBox (int newValue)
408 {
409   QObject* send = (QObject*)sender();
410
411   if (send == GroupArgs->SpinBox_DY1)
412     myNbTimes1 = newValue;
413   else if (send == GroupArgs->SpinBox_DY2)
414     myNbTimes2 = newValue;
415
416   processPreview();
417 }
418
419 //=================================================================================
420 // function : ReverseAngle()
421 // purpose  :
422 //=================================================================================
423 void TransformationGUI_MultiRotationDlg::ReverseAngle()
424 {
425   myAng = -myAng;
426
427   int aConstructorId = getConstructorId();
428
429   if (aConstructorId == 1)
430     GroupArgs->SpinBox_DX1->setValue(myAng);
431
432   processPreview();
433 }
434
435 //=================================================================================
436 // function : CheckAngleStep()
437 // purpose  :
438 //=================================================================================
439 void TransformationGUI_MultiRotationDlg::CheckAngleStep (bool isOn)
440 {
441   GroupArgs->SpinBox_DX1->setEnabled(isOn);
442   GroupArgs->CheckButton1->setEnabled(isOn);
443   processPreview();
444 }
445
446 //=================================================================================
447 // function : createOperation
448 // purpose  :
449 //=================================================================================
450 GEOM::GEOM_IOperations_ptr TransformationGUI_MultiRotationDlg::createOperation()
451 {
452   return getGeomEngine()->GetITransformOperations();
453 }
454
455 //=================================================================================
456 // function : isValid
457 // purpose  :
458 //=================================================================================
459 bool TransformationGUI_MultiRotationDlg::isValid (QString& msg)
460 {
461   bool ok = false;
462   switch (getConstructorId()) {
463   case 0:
464     ok = (GroupArgs->SpinBox_DX1->isValid( msg, !IsPreview() ) &&
465           GroupArgs->SpinBox_DY1->isValid( msg, !IsPreview() ) &&
466           //myBase && myVector); // myVector = DZ by default
467           myBase);
468     break;
469   case 1:
470     ok = (GroupArgs->SpinBox_DX1->isValid( msg, !IsPreview() ) &&
471           GroupArgs->SpinBox_DY1->isValid( msg, !IsPreview() ) &&
472           GroupArgs->SpinBox_DX2->isValid( msg, !IsPreview() ) &&
473           GroupArgs->SpinBox_DY2->isValid( msg, !IsPreview() ) &&
474           //myBase && myVector); // myVector = DZ by default
475           myBase);
476     break;
477   default:
478     break;
479   }
480   return ok;
481 }
482
483 //=================================================================================
484 // function : execute
485 // purpose  :
486 //=================================================================================
487 bool TransformationGUI_MultiRotationDlg::execute (ObjectList& objects)
488 {
489   bool res = false;
490
491   GEOM::GEOM_Object_var anObj;
492   QStringList aParameters;
493
494   GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation());
495
496   switch (getConstructorId()) {
497   case 0:
498     if (GroupArgs->CheckAngleStep->isChecked())
499       anObj = anOper->MultiRotate1DByStep(myBase.get(), myVector.get(), myAng * M_PI / 180., myNbTimes1);
500     else
501       anObj = anOper->MultiRotate1D(myBase.get(), myVector.get(), myNbTimes1);
502
503     if (!IsPreview()) {
504       if (GroupArgs->CheckAngleStep->isChecked())
505         aParameters << GroupArgs->SpinBox_DX1->text();
506       aParameters << GroupArgs->SpinBox_DY1->text();
507     }
508     res = true;
509     break;
510   case 1:
511     if (GroupArgs->CheckAngleStep->isChecked())
512       anObj = anOper->MultiRotate2DByStep(myBase.get(), myVector.get(), myAng * M_PI / 180., myNbTimes1,
513                                           myStep, myNbTimes2);
514     else
515       anObj = anOper->MultiRotate2DNbTimes(myBase.get(), myVector.get(), myNbTimes1, myStep, myNbTimes2);
516
517     if (!IsPreview()) {
518       if (GroupArgs->CheckAngleStep->isChecked())
519         aParameters << GroupArgs->SpinBox_DX1->text();
520       aParameters << GroupArgs->SpinBox_DY1->text();
521       aParameters << GroupArgs->SpinBox_DX2->text();
522       aParameters << GroupArgs->SpinBox_DY2->text();
523     }
524     res = true;
525     break;
526   }
527
528   if (!anObj->_is_nil()) {
529     if (!IsPreview())
530       anObj->SetParameters(aParameters.join(":").toUtf8().constData());
531     objects.push_back(anObj._retn());
532   }
533
534   return res;
535 }
536
537 //=================================================================================
538 // function : addSubshapeToStudy
539 // purpose  : virtual method to add new SubObjects if local selection
540 //=================================================================================
541 void TransformationGUI_MultiRotationDlg::addSubshapesToStudy()
542 {
543   switch (getConstructorId()) {
544   case 0:
545   case 1:
546     GEOMBase::PublishSubObject( myVector.get() );
547     break;
548   default:
549     break;
550   }
551 }
552
553 //=================================================================================
554 // function : getSourceObjects
555 // purpose  : virtual method to get source objects
556 //=================================================================================
557 QList<GEOM::GeomObjPtr> TransformationGUI_MultiRotationDlg::getSourceObjects()
558 {
559   QList<GEOM::GeomObjPtr> res;
560   res << myBase << myVector;
561   return res;
562 }
563
564 //=================================================================================
565 // function : restoreSubShapes
566 // purpose  :
567 //=================================================================================
568 void TransformationGUI_MultiRotationDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
569 {
570   if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
571     // we pass here the first operation argument (object) through the list of arguments
572     // because the rotation operation place its arguments in the data structure in another order,
573     // and we need to point the first argument directly
574     GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO;
575     anArgs->length(1);
576     anArgs[0] = myBase.copy();
577     getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs,
578                                         /*theFindMethod=*/GEOM::FSM_MultiTransformed,
579                                         /*theInheritFirstArg=*/true,
580                                         mainFrame()->CheckBoxAddPrefix->isChecked());
581   }
582 }
583
584 //=================================================================================
585 // function : TransformationGUI_2Sel4Spin1Check
586 // purpose  :
587 //=================================================================================
588 TransformationGUI_2Sel4Spin1Check::TransformationGUI_2Sel4Spin1Check (QWidget *parent)
589 {
590   gridLayout = new QGridLayout (parent);
591   gridLayout->setSpacing(6);
592   gridLayout->setContentsMargins(11, 11, 11, 11);
593   gridLayout->setHorizontalSpacing(0);
594   gridLayout->setVerticalSpacing(0);
595   gridLayout->setContentsMargins(0, 0, 0, 0);
596
597   GroupBox1 = new QGroupBox (parent);
598
599   gridLayout1 = new QGridLayout (GroupBox1);
600   gridLayout1->setSpacing(6);
601   gridLayout1->setContentsMargins(11, 11, 11, 11);
602   gridLayout1->setHorizontalSpacing(6);
603   gridLayout1->setVerticalSpacing(6);
604   gridLayout1->setContentsMargins(9, 9, 9, 9);
605
606   // 2Sel
607   TextLabel1 = new QLabel(GroupBox1);
608   TextLabel2 = new QLabel(GroupBox1);
609
610   PushButton1 = new QPushButton (GroupBox1);
611   PushButton2 = new QPushButton (GroupBox1);
612
613   LineEdit2 = new QLineEdit(GroupBox1);
614   LineEdit1 = new QLineEdit(GroupBox1);
615
616   gridLayout1->addWidget(TextLabel1, 0, 0, 1, 1);
617   gridLayout1->addWidget(TextLabel2, 1, 0, 1, 1);
618   gridLayout1->addWidget(PushButton1, 0, 1, 1, 1);
619   gridLayout1->addWidget(PushButton2, 1, 1, 1, 1);
620   gridLayout1->addWidget(LineEdit1, 0, 2, 1, 1);
621   gridLayout1->addWidget(LineEdit2, 1, 2, 1, 1);
622
623   // 4Spin (double-int-double-int)
624   //TextLabel3 = new QLabel (GroupBox1);
625   CheckAngleStep = new QCheckBox (GroupBox1);
626   TextLabel4 = new QLabel (GroupBox1);
627   TextLabel5 = new QLabel (GroupBox1);
628   TextLabel6 = new QLabel (GroupBox1);
629
630   SpinBox_DX1 = new SalomeApp_DoubleSpinBox (GroupBox1);
631   SpinBox_DY1 = new SalomeApp_IntSpinBox (GroupBox1);
632   SpinBox_DX2 = new SalomeApp_DoubleSpinBox (GroupBox1);
633   SpinBox_DY2 = new SalomeApp_IntSpinBox (GroupBox1);
634
635   //gridLayout1->addWidget(TextLabel3, 2, 0, 1, 1);
636   gridLayout1->addWidget(CheckAngleStep, 2, 0, 1, 1);
637   gridLayout1->addWidget(TextLabel4, 3, 0, 1, 1);
638   gridLayout1->addWidget(TextLabel5, 5, 0, 1, 1);
639   gridLayout1->addWidget(TextLabel6, 6, 0, 1, 1);
640
641   gridLayout1->addWidget(SpinBox_DX1, 2, 1, 1, 2);
642   gridLayout1->addWidget(SpinBox_DY1, 3, 1, 1, 2);
643   gridLayout1->addWidget(SpinBox_DX2, 5, 1, 1, 2);
644   gridLayout1->addWidget(SpinBox_DY2, 6, 1, 1, 2);
645
646   // 1Check
647   CheckButton1 = new QCheckBox (GroupBox1);
648
649   gridLayout1->addWidget(CheckButton1, 4, 0, 1, 3);
650
651   gridLayout->addWidget(GroupBox1, 0, 0, 1, 1);
652 }
653
654 //=================================================================================
655 // function : ~TransformationGUI_2Sel4Spin1Check()
656 // purpose  : Destroys the object and frees any allocated resources
657 //=================================================================================
658 TransformationGUI_2Sel4Spin1Check::~TransformationGUI_2Sel4Spin1Check()
659 {
660   // no need to delete child widgets, Qt does it all for us
661 }