Salome HOME
updated copyright message
[modules/geom.git] / src / AdvancedGUI / AdvancedGUI_PipeTShapeDlg.cxx
1 // Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #include "AdvancedGUI_PipeTShapeDlg.h"
21
22 #include <SALOMEconfig.h>
23 #include CORBA_SERVER_HEADER(AdvancedGEOM)
24
25 #include <DlgRef.h>
26 #include <GeometryGUI.h>
27 #include <GEOMBase.h>
28
29 #include <SUIT_Session.h>
30 #include <SUIT_ResourceMgr.h>
31 #include <SUIT_OverrideCursor.h>
32 #include <LightApp_SelectionMgr.h>
33 #include <SalomeApp_Application.h>
34 #include <SalomeApp_Tools.h>
35
36 // OCCT Includes
37 #include <BRep_Tool.hxx>
38 #include <TopTools_IndexedMapOfShape.hxx>
39 #include <TopoDS_Shape.hxx>
40 #include <TopoDS.hxx>
41 #include <TopExp.hxx>
42 #include <TColStd_IndexedMapOfInteger.hxx>
43 #include <gp_Pnt.hxx>
44
45 #include <QTabWidget>
46
47 #include <GEOMImpl_Types.hxx>
48
49 //=================================================================================
50 // Constructor
51 //=================================================================================
52 AdvancedGUI_PipeTShapeDlg::AdvancedGUI_PipeTShapeDlg (GeometryGUI* theGeometryGUI, QWidget* parent)
53   : GEOMBase_Skeleton(theGeometryGUI, parent, false)
54 {
55   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
56   //QPixmap imageOp  = aResMgr->loadPixmap("GEOM", tr("ICON_DLG_PIPETSHAPE"));
57   QPixmap imageSel = aResMgr->loadPixmap("GEOM", tr("ICON_SELECT"));
58   QPixmap imageImp = aResMgr->loadPixmap("GEOM", tr("ICO_PIPETSHAPE_IMPORT"));
59   imagePipeTShape  = aResMgr->loadPixmap("GEOM", tr("DLG_PIPETSHAPE"));
60   imageReduction   = aResMgr->loadPixmap("GEOM", tr("IMG_PIPETSHAPE_SECT"));
61
62   setWindowTitle(tr("GEOM_PIPE_TSHAPE_TITLE"));
63
64   /***************************************************************/
65   mainFrame()->GroupConstructors->setAttribute(Qt::WA_DeleteOnClose);
66   mainFrame()->GroupConstructors->close();
67
68   QTabWidget* aTabWidget = new QTabWidget (centralWidget());
69
70   QGridLayout* myMainLayout = new QGridLayout (centralWidget());
71   myMainLayout->setMargin(0);
72   myMainLayout->setSpacing(6);
73
74   // Main parameters
75   QGroupBox* GroupMain = new QGroupBox();
76   QGridLayout* layoutGroupMain = new QGridLayout (GroupMain);
77
78   MainTubeGroupParams = new DlgRef_3Spin();
79   MainTubeGroupParams->GroupBox1->setTitle(tr("GEOM_PIPE_TSHAPE_MPIPE"));
80   MainTubeGroupParams->TextLabel1->setText(tr("GEOM_PIPE_TSHAPE_R"));
81   MainTubeGroupParams->TextLabel2->setText(tr("GEOM_PIPE_TSHAPE_W"));
82   MainTubeGroupParams->TextLabel3->setText(tr("GEOM_PIPE_TSHAPE_L"));
83   MainTubeGroupParams->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); // ??
84
85   IncidentTubeGroupParams = new DlgRef_3Spin();
86   IncidentTubeGroupParams->GroupBox1->setTitle(tr("GEOM_PIPE_TSHAPE_IPIPE"));
87   IncidentTubeGroupParams->TextLabel1->setText(tr("GEOM_PIPE_TSHAPE_R"));
88   IncidentTubeGroupParams->TextLabel2->setText(tr("GEOM_PIPE_TSHAPE_W"));
89   IncidentTubeGroupParams->TextLabel3->setText(tr("GEOM_PIPE_TSHAPE_L"));
90
91   ChamferGroupParams = new DlgRef_2Spin();
92   ChamferGroupParams->GroupBox1->setCheckable(true);
93   ChamferGroupParams->GroupBox1->setChecked(false);
94   ChamferGroupParams->GroupBox1->setTitle(tr("GEOM_PIPE_TSHAPE_CHAMFER"));
95   ChamferGroupParams->TextLabel1->setText(tr("GEOM_PIPE_TSHAPE_CHAMFER_H"));
96   ChamferGroupParams->TextLabel2->setText(tr("GEOM_PIPE_TSHAPE_CHAMFER_W"));
97
98   FilletGroupParams = new DlgRef_1Spin();
99   FilletGroupParams->GroupBox1->setCheckable(true);
100   FilletGroupParams->GroupBox1->setChecked(false);
101   FilletGroupParams->GroupBox1->setTitle(tr("GEOM_PIPE_TSHAPE_FILLET"));
102   FilletGroupParams->TextLabel1->setText(tr("GEOM_PIPE_TSHAPE_R"));
103
104   HexMeshCheckBox = new QCheckBox();
105   HexMeshCheckBox->setText(tr("GEOM_PIPE_TSHAPE_HEX"));
106   HexMeshCheckBox->setChecked(true);
107
108   LabelImgPipeTShape = new QLabel();
109   LabelImgPipeTShape->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
110   LabelImgPipeTShape->setAlignment(Qt::AlignCenter);
111   LabelImgPipeTShape->setMinimumSize(300, 300);
112
113   layoutGroupMain->addWidget(MainTubeGroupParams, 0, 0, 1, 1);
114   layoutGroupMain->addWidget(IncidentTubeGroupParams, 1, 0, 1, 1);
115   layoutGroupMain->addWidget(ChamferGroupParams, 2, 0, 1, 1);
116   layoutGroupMain->addWidget(FilletGroupParams, 3, 0, 1, 1);
117   layoutGroupMain->addWidget(HexMeshCheckBox, 4, 0, 1, 1);
118
119   layoutGroupMain->addWidget(LabelImgPipeTShape, 0, 1, 5, 1);
120   layoutGroupMain->setColumnStretch(1, 1); // stretch of column 0 is supposed 0 by default
121
122   // Thickness reduction parameters
123   QGroupBox* GroupReduct = new QGroupBox();
124   QGridLayout* layoutGroupReduct = new QGridLayout (GroupReduct);
125
126   LReductionGroupParams = new AdvancedGUI_4Spin();
127   LReductionGroupParams->GroupBox1->setCheckable(true);
128   LReductionGroupParams->GroupBox1->setChecked(false);
129   LReductionGroupParams->GroupBox1->setTitle(tr("GEOM_PIPE_TSHAPE_LEFT_TR"));
130   LReductionGroupParams->TextLabel1->setText(tr("GEOM_PIPE_TSHAPE_TR_R").arg("L"));
131   LReductionGroupParams->TextLabel2->setText(tr("GEOM_PIPE_TSHAPE_TR_W").arg("L"));
132   LReductionGroupParams->TextLabel3->setText(tr("GEOM_PIPE_TSHAPE_TR_L_TRANS").arg("L"));
133   LReductionGroupParams->TextLabel4->setText(tr("GEOM_PIPE_TSHAPE_TR_L_THIN").arg("L"));
134
135   RReductionGroupParams = new AdvancedGUI_4Spin();
136   RReductionGroupParams->GroupBox1->setCheckable(true);
137   RReductionGroupParams->GroupBox1->setChecked(false);
138   RReductionGroupParams->GroupBox1->setTitle(tr("GEOM_PIPE_TSHAPE_RIGHT_TR"));
139   RReductionGroupParams->TextLabel1->setText(tr("GEOM_PIPE_TSHAPE_TR_R").arg("R"));
140   RReductionGroupParams->TextLabel2->setText(tr("GEOM_PIPE_TSHAPE_TR_W").arg("R"));
141   RReductionGroupParams->TextLabel3->setText(tr("GEOM_PIPE_TSHAPE_TR_L_TRANS").arg("R"));
142   RReductionGroupParams->TextLabel4->setText(tr("GEOM_PIPE_TSHAPE_TR_L_THIN").arg("R"));
143
144   IReductionGroupParams = new AdvancedGUI_4Spin();
145   IReductionGroupParams->GroupBox1->setCheckable(true);
146   IReductionGroupParams->GroupBox1->setChecked(false);
147   IReductionGroupParams->GroupBox1->setTitle(tr("GEOM_PIPE_TSHAPE_INCI_TR"));
148   IReductionGroupParams->TextLabel1->setText(tr("GEOM_PIPE_TSHAPE_TR_R").arg("I"));
149   IReductionGroupParams->TextLabel2->setText(tr("GEOM_PIPE_TSHAPE_TR_W").arg("I"));
150   IReductionGroupParams->TextLabel3->setText(tr("GEOM_PIPE_TSHAPE_TR_L_TRANS").arg("I"));
151   IReductionGroupParams->TextLabel4->setText(tr("GEOM_PIPE_TSHAPE_TR_L_THIN").arg("I"));
152
153   LabelImgReduction = new QLabel();
154   LabelImgReduction->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
155   LabelImgReduction->setAlignment(Qt::AlignCenter);
156   LabelImgReduction->setMinimumSize(300, 300);
157
158   layoutGroupReduct->addWidget(LReductionGroupParams->GroupBox1, 0, 0, 1, 1);
159   layoutGroupReduct->addWidget(RReductionGroupParams->GroupBox1, 1, 0, 1, 1);
160   layoutGroupReduct->addWidget(IReductionGroupParams->GroupBox1, 2, 0, 1, 1);
161
162   layoutGroupReduct->addWidget(LabelImgReduction, 0, 1, 3, 1);
163   layoutGroupReduct->setColumnStretch(1, 1); // stretch of column 0 is supposed 0 by default
164
165   // Position parameters
166   QGroupBox* GroupPos = new QGroupBox();
167   QVBoxLayout* layoutGroupPos = new QVBoxLayout (GroupPos);
168
169   JunctionPointsSel = new DlgRef_6Sel();
170   JunctionPointsSel->GroupBox1->setTitle(tr("GEOM_PIPE_TSHAPE_POSITION"));
171   JunctionPointsSel->GroupBox1->setCheckable(true);
172   JunctionPointsSel->GroupBox1->setChecked(false);
173   JunctionPointsSel->PushButton1->setIcon(imageSel);
174   JunctionPointsSel->LineEdit1->setReadOnly(true);
175   JunctionPointsSel->LineEdit1->setText("");
176   JunctionPointsSel->TextLabel1->setText(tr("GEOM_PIPE_TSHAPE_POSITION_P1"));
177
178   JunctionPointsSel->PushButton2->setIcon(imageSel);
179   JunctionPointsSel->LineEdit2->setReadOnly(true);
180   JunctionPointsSel->LineEdit2->setText("");
181   JunctionPointsSel->TextLabel2->setText(tr("GEOM_PIPE_TSHAPE_POSITION_P2"));
182
183   JunctionPointsSel->PushButton3->setIcon(imageSel);
184   JunctionPointsSel->LineEdit3->setReadOnly(true);
185   JunctionPointsSel->LineEdit3->setText("");
186   JunctionPointsSel->TextLabel3->setText(tr("GEOM_PIPE_TSHAPE_POSITION_P3"));
187
188   JunctionPointsSel->PushButton4->setIcon(imageImp);
189   JunctionPointsSel->LineEdit4->setReadOnly(true);
190   JunctionPointsSel->LineEdit4->setText("");
191   JunctionPointsSel->TextLabel4->setText(tr("GEOM_PIPE_TSHAPE_POSITION_LBL_L1"));
192
193   JunctionPointsSel->PushButton5->setIcon(imageImp);
194   JunctionPointsSel->LineEdit5->setReadOnly(true);
195   JunctionPointsSel->LineEdit5->setText("");
196   JunctionPointsSel->TextLabel5->setText(tr("GEOM_PIPE_TSHAPE_POSITION_LBL_L2"));
197
198   JunctionPointsSel->PushButton6->setAttribute(Qt::WA_DeleteOnClose);
199   JunctionPointsSel->PushButton6->close();
200   JunctionPointsSel->LineEdit6->setAttribute(Qt::WA_DeleteOnClose);
201   JunctionPointsSel->LineEdit6->close();
202   JunctionPointsSel->TextLabel6->setAttribute(Qt::WA_DeleteOnClose);
203   JunctionPointsSel->TextLabel6->close();
204
205   layoutGroupPos->addWidget(JunctionPointsSel);
206   layoutGroupPos->addStretch();
207
208   //aTabWidget->addTab(GroupMain, imageOp, tr("GEOM_PIPETSHAPE_GROUPMAIN"));
209   aTabWidget->addTab(GroupMain, tr("GEOM_PIPETSHAPE_GROUPMAIN"));
210   aTabWidget->addTab(GroupReduct, tr("GEOM_PIPETSHAPE_GROUPREDUCT"));
211   aTabWidget->addTab(GroupPos, tr("GEOM_PIPETSHAPE_GROUPPOS"));
212
213   myMainLayout->addWidget(aTabWidget, 0, 0, 1, 1);
214   connect(aTabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentChanged(int)));
215   /***************************************************************/
216
217   setHelpFileName("create_pipetshape_page.html");
218
219   Init();
220 }
221
222 //=================================================================================
223 // Destructor
224 //=================================================================================
225 AdvancedGUI_PipeTShapeDlg::~AdvancedGUI_PipeTShapeDlg() {
226   // no need to delete child widgets, Qt does it all for us
227 }
228
229 //=================================================================================
230 // function : Init()
231 // purpose  :
232 //=================================================================================
233 void AdvancedGUI_PipeTShapeDlg::Init()
234 {
235   // Get setting of step value from file configuration
236   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
237   double step = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100);
238   double minValue = Precision::Approximation();
239
240   myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
241   myOkPoint1 = myOkPoint2 = myOkPoint3 = false;
242
243   pipeTShapeGroupObjects.clear();
244
245   // min, max, step and decimals for spin boxes
246   initSpinBox(MainTubeGroupParams->SpinBox_DX, minValue, COORD_MAX, step, "length_precision");
247   initSpinBox(MainTubeGroupParams->SpinBox_DY, minValue, COORD_MAX, step, "length_precision");
248   initSpinBox(MainTubeGroupParams->SpinBox_DZ, minValue, COORD_MAX, step, "length_precision");
249   initSpinBox(IncidentTubeGroupParams->SpinBox_DX, minValue, COORD_MAX, step, "length_precision");
250   initSpinBox(IncidentTubeGroupParams->SpinBox_DY, minValue, COORD_MAX, step, "length_precision");
251   initSpinBox(IncidentTubeGroupParams->SpinBox_DZ, minValue, COORD_MAX, step, "length_precision");
252   initSpinBox(ChamferGroupParams->SpinBox_DX, minValue, COORD_MAX, step, "length_precision");
253   initSpinBox(ChamferGroupParams->SpinBox_DY, minValue, COORD_MAX, step, "length_precision");
254   initSpinBox(FilletGroupParams->SpinBox_DX, minValue, COORD_MAX, step, "length_precision");
255
256   initSpinBox(LReductionGroupParams->SpinBox1, minValue, COORD_MAX, step, "length_precision");
257   initSpinBox(LReductionGroupParams->SpinBox2, minValue, COORD_MAX, step, "length_precision");
258   initSpinBox(LReductionGroupParams->SpinBox3, minValue, COORD_MAX, step, "length_precision");
259   initSpinBox(LReductionGroupParams->SpinBox4, 0.,       COORD_MAX, step, "length_precision");
260
261   initSpinBox(RReductionGroupParams->SpinBox1, minValue, COORD_MAX, step, "length_precision");
262   initSpinBox(RReductionGroupParams->SpinBox2, minValue, COORD_MAX, step, "length_precision");
263   initSpinBox(RReductionGroupParams->SpinBox3, minValue, COORD_MAX, step, "length_precision");
264   initSpinBox(RReductionGroupParams->SpinBox4, 0.,       COORD_MAX, step, "length_precision");
265
266   initSpinBox(IReductionGroupParams->SpinBox1, minValue, COORD_MAX, step, "length_precision");
267   initSpinBox(IReductionGroupParams->SpinBox2, minValue, COORD_MAX, step, "length_precision");
268   initSpinBox(IReductionGroupParams->SpinBox3, minValue, COORD_MAX, step, "length_precision");
269   initSpinBox(IReductionGroupParams->SpinBox4, 0.,       COORD_MAX, step, "length_precision");
270
271   // init variables
272   MainTubeGroupParams->SpinBox_DX->setValue(80);
273   MainTubeGroupParams->SpinBox_DY->setValue(20);
274   MainTubeGroupParams->SpinBox_DZ->setValue(200);
275   IncidentTubeGroupParams->SpinBox_DX->setValue(50);
276   IncidentTubeGroupParams->SpinBox_DY->setValue(20);
277   IncidentTubeGroupParams->SpinBox_DZ->setValue(200);
278   ChamferGroupParams->SpinBox_DX->setValue(20);
279   ChamferGroupParams->SpinBox_DY->setValue(10);
280   FilletGroupParams->SpinBox_DX->setValue(20);
281
282   LReductionGroupParams->SpinBox1->setValue(60);
283   LReductionGroupParams->SpinBox2->setValue(30);
284   LReductionGroupParams->SpinBox3->setValue(40);
285   LReductionGroupParams->SpinBox4->setValue(20);
286
287   RReductionGroupParams->SpinBox1->setValue(60);
288   RReductionGroupParams->SpinBox2->setValue(30);
289   RReductionGroupParams->SpinBox3->setValue(40);
290   RReductionGroupParams->SpinBox4->setValue(20);
291
292   IReductionGroupParams->SpinBox1->setValue(40);
293   IReductionGroupParams->SpinBox2->setValue(10);
294   IReductionGroupParams->SpinBox3->setValue(30);
295   IReductionGroupParams->SpinBox4->setValue(15);
296
297   CssNormal = QString("QDoubleSpinBox {");
298   CssNormal.append(MainTubeGroupParams->SpinBox_DZ->styleSheet());
299   CssNormal.append("}");
300   CssNormal.append("\nQPushButton {");
301   CssNormal.append(JunctionPointsSel->PushButton4->styleSheet());
302   CssNormal.append("}");
303   CssAcceptable = "QDoubleSpinBox, QPushButton {background-color: rgb(85, 170, 127)}";
304   CssRefused = "QDoubleSpinBox, QPushButton {background-color: rgb(255, 0, 0)}";
305
306   showOnlyPreviewControl();
307
308   // Signal/slot connections
309   connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
310   connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
311   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double)));
312   //connect(this, SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
313   // ValueChangedInSpinBox
314   connect(MainTubeGroupParams->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
315   connect(MainTubeGroupParams->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
316   connect(MainTubeGroupParams->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
317   connect(IncidentTubeGroupParams->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
318   connect(IncidentTubeGroupParams->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
319   connect(IncidentTubeGroupParams->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
320   connect(ChamferGroupParams->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
321   connect(ChamferGroupParams->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
322   connect(FilletGroupParams->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
323   // ChamferOrFillet
324   connect(ChamferGroupParams->GroupBox1, SIGNAL(toggled(bool)), this, SLOT(ChamferOrFillet(bool)));
325   connect(FilletGroupParams->GroupBox1, SIGNAL(toggled(bool)), this, SLOT(ChamferOrFillet(bool)));
326   // Thickness reduction:
327   //   Left
328   connect(LReductionGroupParams->GroupBox1, SIGNAL(toggled(bool)), this, SLOT(processPreview()));
329   connect(LReductionGroupParams->SpinBox1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
330   connect(LReductionGroupParams->SpinBox2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
331   connect(LReductionGroupParams->SpinBox3, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
332   connect(LReductionGroupParams->SpinBox4, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
333   //   Right
334   connect(RReductionGroupParams->GroupBox1, SIGNAL(toggled(bool)), this, SLOT(processPreview()));
335   connect(RReductionGroupParams->SpinBox1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
336   connect(RReductionGroupParams->SpinBox2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
337   connect(RReductionGroupParams->SpinBox3, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
338   connect(RReductionGroupParams->SpinBox4, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
339   //   Incident pipe
340   connect(IReductionGroupParams->GroupBox1, SIGNAL(toggled(bool)), this, SLOT(processPreview()));
341   connect(IReductionGroupParams->SpinBox1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
342   connect(IReductionGroupParams->SpinBox2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
343   connect(IReductionGroupParams->SpinBox3, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
344   connect(IReductionGroupParams->SpinBox4, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
345   // Position
346   connect(JunctionPointsSel->GroupBox1, SIGNAL(toggled(bool)), this, SLOT(SetPosition(bool)));
347   connect(JunctionPointsSel->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
348   connect(JunctionPointsSel->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
349   connect(JunctionPointsSel->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
350   // ApplyNewDimensions
351   connect(JunctionPointsSel->PushButton4, SIGNAL(clicked()), this, SLOT(ApplyNewDimensions()));
352   connect(JunctionPointsSel->PushButton5, SIGNAL(clicked()), this, SLOT(ApplyNewDimensions()));
353   connect(QApplication::instance(), SIGNAL(focusChanged(QWidget*, QWidget*)), this, SLOT(UpdatePicture(QWidget*, QWidget*)));
354   //@@ put additional signal/slot connections here @@//
355
356   initName(tr("GEOM_PIPE_TSHAPE"));
357
358   qApp->processEvents();
359   updateGeometry();
360   resize(minimumSizeHint());
361
362   updateLabelImgPipeTShape();
363   LabelImgReduction->setPixmap(imageReduction.scaled(LabelImgReduction->size(),
364                                                      Qt::KeepAspectRatio,
365                                                      Qt::SmoothTransformation));
366   processPreview();
367 }
368
369 //=================================================================================
370 // function : currentChanged()
371 // purpose  : Tab widget management
372 //=================================================================================
373 void AdvancedGUI_PipeTShapeDlg::currentChanged (int tabId)
374 {
375   if (tabId == 0 || tabId == 1)
376     resizeEvent(NULL);
377 }
378
379 //=================================================================================
380 // function : ApplyNewDimensions()
381 // purpose  :
382 //=================================================================================
383 void AdvancedGUI_PipeTShapeDlg::ApplyNewDimensions()
384 {
385   QPushButton* send = (QPushButton*) sender();
386
387   bool ok = false;
388   double newVal;
389   if (send == JunctionPointsSel->PushButton4) {
390     if (!JunctionPointsSel->LineEdit4->text().isEmpty()) {
391       newVal = JunctionPointsSel->LineEdit4->text().toDouble(&ok);
392       if (ok) {
393         disconnect(MainTubeGroupParams->SpinBox_DZ, 0, this, 0);
394         MainTubeGroupParams->SpinBox_DZ->setValue(newVal);
395         connect(MainTubeGroupParams->SpinBox_DZ, SIGNAL(valueChanged( double )), this, SLOT(ValueChangedInSpinBox(double)));
396         MainTubeGroupParams->SpinBox_DZ->setToolTip("");
397         MainTubeGroupParams->SpinBox_DZ->setStyleSheet("background-color: rgb(255, 255, 255);");
398         CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
399         processPreview();
400       }
401     }
402   }
403   else if (send == JunctionPointsSel->PushButton5) {
404     if (!JunctionPointsSel->LineEdit5->text().isEmpty()) {
405       newVal = JunctionPointsSel->LineEdit5->text().toDouble(&ok);
406       if (ok) {
407         disconnect(IncidentTubeGroupParams->SpinBox_DZ, 0, this, 0);
408         IncidentTubeGroupParams->SpinBox_DZ->setValue(newVal);
409         connect(IncidentTubeGroupParams->SpinBox_DZ, SIGNAL(valueChanged( double )), this, SLOT(ValueChangedInSpinBox(double)));
410         IncidentTubeGroupParams->SpinBox_DZ->setToolTip("");
411         IncidentTubeGroupParams->SpinBox_DZ->setStyleSheet("background-color: rgb(255, 255, 255);");
412         CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
413         processPreview();
414       }
415     }
416   }
417 }
418
419 //=================================================================================
420 // function : UpdatePicture()
421 // purpose  :
422 //=================================================================================
423 void AdvancedGUI_PipeTShapeDlg::UpdatePicture (QWidget* /*old*/, QWidget* now)
424 {
425   if (ChamferGroupParams->GroupBox1->isChecked())
426     if (now == MainTubeGroupParams->SpinBox_DX)
427       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_CHAMFER_R1"));
428     else if (now == MainTubeGroupParams->SpinBox_DY)
429       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_CHAMFER_W1"));
430     else if (now == MainTubeGroupParams->SpinBox_DZ)
431       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_CHAMFER_L1"));
432     else if (now == IncidentTubeGroupParams->SpinBox_DX)
433       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_CHAMFER_R2"));
434     else if (now == IncidentTubeGroupParams->SpinBox_DY)
435       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_CHAMFER_W2"));
436     else if (now == IncidentTubeGroupParams->SpinBox_DZ)
437       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_CHAMFER_L2"));
438     else if (now == ChamferGroupParams->SpinBox_DX)
439       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_CHAMFER_H"));
440     else if (now == ChamferGroupParams->SpinBox_DY)
441       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_CHAMFER_W"));
442     else
443       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_CHAMFER"));
444   else if (FilletGroupParams->GroupBox1->isChecked())
445     if (now == MainTubeGroupParams->SpinBox_DX)
446       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_FILLET_R1"));
447     else if (now == MainTubeGroupParams->SpinBox_DY)
448       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_FILLET_W1"));
449     else if (now == MainTubeGroupParams->SpinBox_DZ)
450       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_FILLET_L1"));
451     else if (now == IncidentTubeGroupParams->SpinBox_DX)
452       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_FILLET_R2"));
453     else if (now == IncidentTubeGroupParams->SpinBox_DY)
454       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_FILLET_W2"));
455     else if (now == IncidentTubeGroupParams->SpinBox_DZ)
456       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_FILLET_L2"));
457     else if (now == FilletGroupParams->SpinBox_DX)
458       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_FILLET_RF"));
459     else
460       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_FILLET"));
461   else
462     if (now == MainTubeGroupParams->SpinBox_DX)
463       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_R1"));
464     else if (now == MainTubeGroupParams->SpinBox_DY)
465       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_W1"));
466     else if (now == MainTubeGroupParams->SpinBox_DZ)
467       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_L1"));
468     else if (now == IncidentTubeGroupParams->SpinBox_DX)
469       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_R2"));
470     else if (now == IncidentTubeGroupParams->SpinBox_DY)
471       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_W2"));
472     else if (now == IncidentTubeGroupParams->SpinBox_DZ)
473       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_L2"));
474     else
475       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE"));
476
477   updateLabelImgPipeTShape();
478 }
479
480 //=================================================================================
481 // function : SetPosition()
482 // purpose  :
483 //=================================================================================
484 void AdvancedGUI_PipeTShapeDlg::SetPosition (bool isChecked)
485 {
486   if (isChecked) {
487     erasePreview();
488     JunctionPointsSel->LineEdit4->setText("");
489     JunctionPointsSel->LineEdit5->setText("");
490     //connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(
491     //SelectionIntoArgument()));
492     JunctionPointsSel->PushButton1->click();
493     SelectionIntoArgument();
494   }
495   else {
496     disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
497     JunctionPointsSel->LineEdit4->setText("");
498     JunctionPointsSel->LineEdit5->setText("");
499     processPreview();
500   }
501 }
502
503 //=================================================================================
504 // function : ValueChangedInSpinBox()
505 // purpose  :
506 //=================================================================================
507 void AdvancedGUI_PipeTShapeDlg::ValueChangedInSpinBox (double /*newValue*/)
508 {
509   if (JunctionPointsSel->GroupBox1->isChecked() && myOkPoint1 && myOkPoint2 && myOkPoint3)
510     CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
511   processPreview();
512 }
513
514 //=================================================================================
515 // function : SelectionIntoArgument()
516 // purpose  : Called when selection as changed or other case
517 //=================================================================================
518 void AdvancedGUI_PipeTShapeDlg::SelectionIntoArgument()
519 {
520   erasePreview();
521   //myEditCurrentArgument->setText("");
522
523   LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
524   SALOME_ListIO aSelList;
525   aSelMgr->selectedObjects(aSelList);
526
527   if (aSelList.Extent() != 1) {
528     if (myEditCurrentArgument == JunctionPointsSel->LineEdit1)
529       myOkPoint1 = false;
530     else if (myEditCurrentArgument == JunctionPointsSel->LineEdit2)
531       myOkPoint2 = false;
532     else if (myEditCurrentArgument == JunctionPointsSel->LineEdit3)
533       myOkPoint3 = false;
534     return;
535     myEditCurrentArgument->setText("");
536   }
537
538   // nbSel == 1
539   if (aSelList.Extent() == 1) {
540     Handle(SALOME_InteractiveObject) anIO = aSelList.First();
541     GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(anIO);
542     if (!CORBA::is_nil(aSelectedObject)) {
543       QString aName = GEOMBase::GetName(aSelectedObject);
544       TopoDS_Shape aShape;
545       if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull()) {
546
547         TColStd_IndexedMapOfInteger aMap;
548         aSelMgr->GetIndexes(anIO, aMap);
549         if (aMap.Extent() == 1) { // Local Selection
550           int anIndex = aMap(1);
551           aName += QString(":vertex_%1").arg(anIndex);
552
553           //Find SubShape Object in Father
554           GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
555
556           if (aFindedObject->_is_nil()) { // Object not found in study
557             GEOM::GEOM_IShapesOperations_var aShapesOp =
558               getGeomEngine()->GetIShapesOperations();
559             aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
560           }
561           else {
562             aSelectedObject = aFindedObject; // get Object from study
563           }
564           GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE);
565         } else { // Global Selection
566           if (aShape.ShapeType() != TopAbs_VERTEX) {
567             aSelectedObject = GEOM::GEOM_Object::_nil();
568             aName = "";
569           }
570         }
571       }
572
573       if (aShape.IsNull() || aShape.ShapeType() != TopAbs_VERTEX) {
574         return;
575       }
576       myEditCurrentArgument->setText(aName);
577       if (myEditCurrentArgument == JunctionPointsSel->LineEdit1) {
578         myPoint1 = aSelectedObject;
579         myOkPoint1 = true;
580         if (!myOkPoint2)
581           JunctionPointsSel->PushButton2->click();
582       } else if (myEditCurrentArgument == JunctionPointsSel->LineEdit2) {
583         myPoint2 = aSelectedObject;
584         myOkPoint2 = true;
585         if (!myOkPoint3)
586           JunctionPointsSel->PushButton3->click();
587       } else if (myEditCurrentArgument == JunctionPointsSel->LineEdit3) {
588         myPoint3 = aSelectedObject;
589         myOkPoint3 = true;
590         if (!myOkPoint1)
591           JunctionPointsSel->PushButton1->click();
592       }
593     }
594   }
595
596   if (myOkPoint1 && myOkPoint2 && myOkPoint3) {
597     CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
598     processPreview();
599   }
600 }
601
602 //=================================================================================
603 // function : SetEditCurrentArgument()
604 // purpose  :
605 //=================================================================================
606 void AdvancedGUI_PipeTShapeDlg::SetEditCurrentArgument()
607 {
608   QPushButton* send = (QPushButton*) sender();
609
610   if (send == JunctionPointsSel->PushButton1) {
611     myEditCurrentArgument = JunctionPointsSel->LineEdit1;
612     JunctionPointsSel->PushButton2->setDown(false);
613     JunctionPointsSel->LineEdit2->setEnabled(false);
614     JunctionPointsSel->PushButton3->setDown(false);
615     JunctionPointsSel->LineEdit3->setEnabled(false);
616   }
617   else if (send == JunctionPointsSel->PushButton2) {
618     myEditCurrentArgument = JunctionPointsSel->LineEdit2;
619     JunctionPointsSel->PushButton1->setDown(false);
620     JunctionPointsSel->LineEdit1->setEnabled(false);
621     JunctionPointsSel->PushButton3->setDown(false);
622     JunctionPointsSel->LineEdit3->setEnabled(false);
623   }
624   else if (send == JunctionPointsSel->PushButton3) {
625     myEditCurrentArgument = JunctionPointsSel->LineEdit3;
626     JunctionPointsSel->PushButton1->setDown(false);
627     JunctionPointsSel->LineEdit1->setEnabled(false);
628     JunctionPointsSel->PushButton2->setDown(false);
629     JunctionPointsSel->LineEdit2->setEnabled(false);
630   }
631
632   // enable line edit
633   myEditCurrentArgument->setEnabled(true);
634   myEditCurrentArgument->setFocus();
635   myEditCurrentArgument->setText("");
636   // after setFocus(), because it will be setDown(false) when loses focus
637   send->setDown(true);
638
639   JunctionPointsSel->LineEdit4->setText("");
640   JunctionPointsSel->LineEdit5->setText("");
641
642   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
643   //globalSelection(GEOM_POINT);
644   globalSelection(); // close local contexts, if any
645   localSelection( TopAbs_VERTEX );
646   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
647           this, SLOT(SelectionIntoArgument()));
648 }
649
650 //=================================================================================
651 // function : SetDoubleSpinBoxStep()
652 // purpose  : Double spin box management
653 //=================================================================================
654 void AdvancedGUI_PipeTShapeDlg::SetDoubleSpinBoxStep (double step)
655 {
656   MainTubeGroupParams->SpinBox_DX->setSingleStep(step);
657   MainTubeGroupParams->SpinBox_DY->setSingleStep(step);
658   MainTubeGroupParams->SpinBox_DZ->setSingleStep(step);
659   IncidentTubeGroupParams->SpinBox_DX->setSingleStep(step);
660   IncidentTubeGroupParams->SpinBox_DY->setSingleStep(step);
661   IncidentTubeGroupParams->SpinBox_DZ->setSingleStep(step);
662   ChamferGroupParams->SpinBox_DX->setSingleStep(step);
663   ChamferGroupParams->SpinBox_DY->setSingleStep(step);
664   FilletGroupParams->SpinBox_DX->setSingleStep(step);
665
666   LReductionGroupParams->SpinBox1->setSingleStep(step);
667   LReductionGroupParams->SpinBox2->setSingleStep(step);
668   LReductionGroupParams->SpinBox3->setSingleStep(step);
669   LReductionGroupParams->SpinBox4->setSingleStep(step);
670
671   RReductionGroupParams->SpinBox1->setSingleStep(step);
672   RReductionGroupParams->SpinBox2->setSingleStep(step);
673   RReductionGroupParams->SpinBox3->setSingleStep(step);
674   RReductionGroupParams->SpinBox4->setSingleStep(step);
675
676   IReductionGroupParams->SpinBox1->setSingleStep(step);
677   IReductionGroupParams->SpinBox2->setSingleStep(step);
678   IReductionGroupParams->SpinBox3->setSingleStep(step);
679   IReductionGroupParams->SpinBox4->setSingleStep(step);
680 }
681
682 //=================================================================================
683 // function : ClickOnOk()
684 // purpose  :
685 //=================================================================================
686 void AdvancedGUI_PipeTShapeDlg::ClickOnOk()
687 {
688   setIsApplyAndClose( true );
689   if (ClickOnApply())
690     ClickOnCancel();
691 }
692
693 //=================================================================================
694 // function : ClickOnApply()
695 // purpose  :
696 //=================================================================================
697 bool AdvancedGUI_PipeTShapeDlg::ClickOnApply()
698 {
699   if (!onAccept())
700     return false;
701
702   initName();
703
704   if (!isApplyAndClose())
705     processPreview();
706   return true;
707 }
708
709 //=================================================================================
710 // function : ActivateThisDialog()
711 // purpose  :
712 //=================================================================================
713 void AdvancedGUI_PipeTShapeDlg::ActivateThisDialog()
714 {
715   GEOMBase_Skeleton::ActivateThisDialog();
716   //globalSelection( GEOM_POINT);
717   //connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(
718   //        currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
719   if (myOkPoint1 && myOkPoint2 && myOkPoint3)
720     CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
721   processPreview();
722 }
723
724 //=================================================================================
725 // function : enterEvent [REDEFINED]
726 // purpose  :
727 //=================================================================================
728 void AdvancedGUI_PipeTShapeDlg::enterEvent (QEvent*)
729 {
730   if (!mainFrame()->GroupButtons->isEnabled())
731     ActivateThisDialog();
732 }
733
734 //=================================================================================
735 // function : resizeEvent [REDEFINED]
736 // purpose  :
737 //=================================================================================
738 void AdvancedGUI_PipeTShapeDlg::resizeEvent (QResizeEvent */*event*/)
739 {
740   QSize scaledSize1 = imagePipeTShape.size();
741   scaledSize1.scale(LabelImgPipeTShape->size(), Qt::KeepAspectRatio);
742   if (!LabelImgPipeTShape->pixmap() || scaledSize1 != LabelImgPipeTShape->pixmap()->size())
743     updateLabelImgPipeTShape();
744
745   QSize scaledSize2 = imageReduction.size();
746   scaledSize2.scale(LabelImgReduction->size(), Qt::KeepAspectRatio);
747   if (!LabelImgReduction->pixmap() || scaledSize2 != LabelImgReduction->pixmap()->size())
748     LabelImgReduction->setPixmap(imageReduction.scaled(LabelImgReduction->size(),
749                                                        Qt::KeepAspectRatio,
750                                                        Qt::SmoothTransformation));
751 }
752
753 //=================================================================================
754 // function : updateLabelImgPipeTShape
755 // purpose  :
756 //=================================================================================
757 void AdvancedGUI_PipeTShapeDlg::updateLabelImgPipeTShape()
758 {
759   LabelImgPipeTShape->setPixmap(imagePipeTShape.scaled(LabelImgPipeTShape->size(),
760                                                        Qt::KeepAspectRatio,
761                                                        Qt::SmoothTransformation));
762 }
763
764 //=================================================================================
765 // function : ChamferOrFillet()
766 // purpose  :
767 //=================================================================================
768 void AdvancedGUI_PipeTShapeDlg::ChamferOrFillet (bool)
769 {
770   QGroupBox* send = (QGroupBox*) sender();
771
772   if (send == ChamferGroupParams->GroupBox1) {
773     if (send->isChecked()) {
774       disconnect(FilletGroupParams->GroupBox1, SIGNAL(toggled(bool)), this, 0);
775       FilletGroupParams->GroupBox1->setChecked(false);
776       connect(FilletGroupParams->GroupBox1, SIGNAL(toggled(bool)), this, SLOT(ChamferOrFillet(bool)));
777       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_CHAMFER"));
778     }
779     else
780       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE"));
781
782     updateLabelImgPipeTShape();
783     if (myOkPoint1 && myOkPoint2 && myOkPoint3)
784       CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
785     processPreview();
786   }
787   else if (send == FilletGroupParams->GroupBox1) {
788     if (send->isChecked()) {
789       disconnect(ChamferGroupParams->GroupBox1, SIGNAL(toggled(bool)), this, 0);
790       ChamferGroupParams->GroupBox1->setChecked(!send->isChecked());
791       connect(ChamferGroupParams->GroupBox1, SIGNAL(toggled(bool)), this, SLOT(ChamferOrFillet(bool)));
792       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE_FILLET"));
793     }
794     else
795       imagePipeTShape = SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("DLG_PIPETSHAPE"));
796
797     updateLabelImgPipeTShape();
798     if (myOkPoint1 && myOkPoint2 && myOkPoint3)
799       CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
800     processPreview();
801   }
802 }
803
804 //=================================================================================
805 // function : DisplayPreview()
806 // purpose  :
807 //=================================================================================
808 void AdvancedGUI_PipeTShapeDlg::DisplayPreview (const bool activate, const bool update,
809                                                 const bool toRemoveFromEngine, const double lineWidth,
810                                                 const int displayMode, const int color)
811 {
812   QString msg;
813   if (!isValid(msg)) {
814     erasePreview(update);
815     return;
816   }
817
818   erasePreview(false);
819
820   try {
821     SUIT_OverrideCursor wc;
822     ObjectList objects;
823     bool hexMeshState = HexMeshCheckBox->isChecked();
824     HexMeshCheckBox->setChecked(false);
825     if (!executeNoCheck(objects) || !getOperation()->IsDone()) {
826       wc.suspend();
827     }
828     else {
829       ObjectList::iterator it = objects.begin();
830       GEOM::GEOM_Object_var obj = *it;
831       displayPreview(obj, true, activate, false, lineWidth, displayMode, color);
832       if (toRemoveFromEngine)
833         obj->UnRegister();
834     }
835     HexMeshCheckBox->setChecked(hexMeshState);
836   } catch (const SALOME::SALOME_Exception& e) {
837     SalomeApp_Tools::QtCatchCorbaException(e);
838   }
839
840   if (update)
841     updateViewer();
842 }
843
844 //=================================================================================
845 // function : createOperation
846 // purpose  :
847 //=================================================================================
848 GEOM::GEOM_IOperations_ptr AdvancedGUI_PipeTShapeDlg::createOperation()
849 {
850   return getGeomEngine()->GetPluginOperations("AdvancedEngine");
851 }
852
853 //=================================================================================
854 // function : isValid
855 // purpose  :
856 //=================================================================================
857 bool AdvancedGUI_PipeTShapeDlg::isValid (QString& msg)
858 {
859   bool ok = true;
860
861   ok = MainTubeGroupParams->SpinBox_DX->isValid(msg, !IsPreview()) && ok;
862   ok = MainTubeGroupParams->SpinBox_DY->isValid(msg, !IsPreview()) && ok;
863   ok = MainTubeGroupParams->SpinBox_DZ->isValid(msg, !IsPreview()) && ok;
864   ok = IncidentTubeGroupParams->SpinBox_DX->isValid(msg, !IsPreview()) && ok;
865   ok = IncidentTubeGroupParams->SpinBox_DY->isValid(msg, !IsPreview()) && ok;
866   ok = IncidentTubeGroupParams->SpinBox_DZ->isValid(msg, !IsPreview()) && ok;
867   ok = ChamferGroupParams->SpinBox_DX->isValid(msg, !IsPreview()) && ok;
868   ok = ChamferGroupParams->SpinBox_DY->isValid(msg, !IsPreview()) && ok;
869   ok = FilletGroupParams->SpinBox_DX->isValid(msg, !IsPreview()) && ok;
870
871   if (LReductionGroupParams->GroupBox1->isChecked()) {
872     ok = LReductionGroupParams->SpinBox1->isValid(msg, !IsPreview()) && ok;
873     ok = LReductionGroupParams->SpinBox2->isValid(msg, !IsPreview()) && ok;
874     ok = LReductionGroupParams->SpinBox3->isValid(msg, !IsPreview()) && ok;
875     ok = LReductionGroupParams->SpinBox4->isValid(msg, !IsPreview()) && ok;
876     if(MainTubeGroupParams->SpinBox_DX->value() == LReductionGroupParams->SpinBox1->value()) {
877       msg += tr("GEOM_PIPETSHAPE_ERR_EQUAL_RADII_L") + "\n";
878       ok = false;
879     }
880     if(MainTubeGroupParams->SpinBox_DX->value() + MainTubeGroupParams->SpinBox_DY->value() ==
881        LReductionGroupParams->SpinBox1->value() + LReductionGroupParams->SpinBox2->value()) {
882       msg += tr("GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_L") + "\n";
883       ok = false;
884     }
885   }
886   if (RReductionGroupParams->GroupBox1->isChecked()) {
887     ok = RReductionGroupParams->SpinBox1->isValid(msg, !IsPreview()) && ok;
888     ok = RReductionGroupParams->SpinBox2->isValid(msg, !IsPreview()) && ok;
889     ok = RReductionGroupParams->SpinBox3->isValid(msg, !IsPreview()) && ok;
890     ok = RReductionGroupParams->SpinBox4->isValid(msg, !IsPreview()) && ok;
891     if(MainTubeGroupParams->SpinBox_DX->value() == RReductionGroupParams->SpinBox1->value()) {
892       msg += tr("GEOM_PIPETSHAPE_ERR_EQUAL_RADII_R") + "\n";
893       ok = false;
894     }
895     if(MainTubeGroupParams->SpinBox_DX->value() + MainTubeGroupParams->SpinBox_DY->value() ==
896        RReductionGroupParams->SpinBox1->value() + RReductionGroupParams->SpinBox2->value()) {
897       msg += tr("GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_R") + "\n";
898       ok = false;
899     }
900   }
901   if (IReductionGroupParams->GroupBox1->isChecked()) {
902     ok = IReductionGroupParams->SpinBox1->isValid(msg, !IsPreview()) && ok;
903     ok = IReductionGroupParams->SpinBox2->isValid(msg, !IsPreview()) && ok;
904     ok = IReductionGroupParams->SpinBox3->isValid(msg, !IsPreview()) && ok;
905     ok = IReductionGroupParams->SpinBox4->isValid(msg, !IsPreview()) && ok;
906     if(IncidentTubeGroupParams->SpinBox_DX->value() == IReductionGroupParams->SpinBox1->value()) {
907       msg += tr("GEOM_PIPETSHAPE_ERR_EQUAL_RADII_I") + "\n";
908       ok = false;
909     }
910     if(IncidentTubeGroupParams->SpinBox_DX->value() + IncidentTubeGroupParams->SpinBox_DY->value() ==
911        IReductionGroupParams->SpinBox1->value() + IReductionGroupParams->SpinBox2->value()) {
912       msg += tr("GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_I") + "\n";
913       ok = false;
914     }
915   }
916
917   ok = fabs(MainTubeGroupParams->SpinBox_DX->value()) > Precision::Confusion() && ok;
918   ok = fabs(MainTubeGroupParams->SpinBox_DY->value()) > Precision::Confusion() && ok;
919   ok = fabs(MainTubeGroupParams->SpinBox_DZ->value()) > Precision::Confusion() && ok;
920   ok = fabs(IncidentTubeGroupParams->SpinBox_DX->value()) > Precision::Confusion() && ok;
921   ok = fabs(IncidentTubeGroupParams->SpinBox_DY->value()) > Precision::Confusion() && ok;
922   ok = fabs(IncidentTubeGroupParams->SpinBox_DZ->value()) > Precision::Confusion() && ok;
923   ok = fabs(ChamferGroupParams->SpinBox_DX->value()) > Precision::Confusion() && ok;
924   ok = fabs(ChamferGroupParams->SpinBox_DY->value()) > Precision::Confusion() && ok;
925   ok = fabs(FilletGroupParams->SpinBox_DX->value()) > Precision::Confusion() && ok;
926
927   if (JunctionPointsSel->GroupBox1->isChecked())
928     ok = myOkPoint1 && myOkPoint2 && myOkPoint3 && ok;
929
930   return ok;
931 }
932
933 //=================================================================================
934 // function : CheckCompatiblePosition()
935 // purpose  :
936 //=================================================================================
937 bool AdvancedGUI_PipeTShapeDlg::CheckCompatiblePosition
938      (GEOM::GEOM_Object_var theP1, GEOM::GEOM_Object_var theP2, GEOM::GEOM_Object_var theP3,
939       double theTolerance)
940 {
941   MainTubeGroupParams->SpinBox_DZ->setStyleSheet(CssNormal);
942   IncidentTubeGroupParams->SpinBox_DZ->setStyleSheet(CssNormal);
943   JunctionPointsSel->PushButton4->setStyleSheet(CssNormal);
944   JunctionPointsSel->PushButton5->setStyleSheet(CssNormal);
945
946   CORBA::Double theL1 = MainTubeGroupParams->SpinBox_DZ->value();
947   CORBA::Double theL2 = IncidentTubeGroupParams->SpinBox_DZ->value();
948
949   JunctionPointsSel->LineEdit4->setText("");
950   JunctionPointsSel->LineEdit5->setText("");
951
952   MainTubeGroupParams->SpinBox_DZ->setToolTip("");
953   IncidentTubeGroupParams->SpinBox_DZ->setToolTip("");
954
955   TopoDS_Shape aShape;
956   gp_Pnt P1, P2, P3;
957   if ( GEOMBase::GetShape( theP1, aShape ) && !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
958     P1 = BRep_Tool::Pnt(TopoDS::Vertex(aShape));
959   else
960     return false;
961
962   if ( GEOMBase::GetShape( theP2, aShape ) && !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
963     P2 = BRep_Tool::Pnt(TopoDS::Vertex(aShape));
964   else
965     return false;
966
967   if ( GEOMBase::GetShape( theP3, aShape ) && !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
968     P3 = BRep_Tool::Pnt(TopoDS::Vertex(aShape));
969   else
970     return false;
971
972   double d12 = P1.Distance(P2);
973   double d13 = P1.Distance(P3);
974   double d23 = P2.Distance(P3);
975
976   if (Abs(d12) <= Precision::Confusion()) {
977     //SetErrorCode("Junctions points P1 and P2 are identical");
978     return false;
979   }
980   if (Abs(d13) <= Precision::Confusion()) {
981     //SetErrorCode("Junctions points P1 and P3 are identical");
982     return false;
983   }
984   if (Abs(d23) <= Precision::Confusion()) {
985     //SetErrorCode("Junctions points P2 and P3 are identical");
986     return false;
987   }
988
989   long double newL1 = 0.5 * d12;
990   long double newL2 = sqrt(pow(d13,2)-pow(newL1,2));
991
992   JunctionPointsSel->LineEdit4->setText(QString::number(newL1,'f',7));
993   JunctionPointsSel->LineEdit5->setText(QString::number(newL2,'f',7));
994
995   if (fabs(newL1 - theL1) > Precision::Approximation()) {
996     if ((newL1 * (1 - theTolerance) - theL1 <= Precision::Approximation()) &&
997         (newL1 * (1 + theTolerance) - theL1 >= Precision::Approximation())) {
998       disconnect(MainTubeGroupParams->SpinBox_DZ, 0, this, 0);
999       MainTubeGroupParams->SpinBox_DZ->setValue(newL1);
1000       connect(MainTubeGroupParams->SpinBox_DZ, SIGNAL(valueChanged(double)),
1001               this, SLOT(ValueChangedInSpinBox(double)));
1002       MainTubeGroupParams->SpinBox_DZ->setToolTip("Value was recomputed to fit with position");
1003       MainTubeGroupParams->SpinBox_DZ->setStyleSheet(CssAcceptable);
1004       JunctionPointsSel->PushButton4->setStyleSheet(CssAcceptable);
1005     }
1006     else {
1007       MainTubeGroupParams->SpinBox_DZ->setToolTip("Value is incompatible with position");
1008       MainTubeGroupParams->SpinBox_DZ->setStyleSheet(CssRefused);
1009       JunctionPointsSel->PushButton4->setStyleSheet(CssRefused);
1010     }
1011   }
1012   else {
1013     MainTubeGroupParams->SpinBox_DZ->setStyleSheet(CssNormal);
1014     JunctionPointsSel->PushButton4->setStyleSheet(CssNormal);
1015   }
1016
1017   if (fabs(newL2 - theL2) > Precision::Approximation()) {
1018     if ((newL2 * (1 - theTolerance) - theL2 <= Precision::Approximation()) &&
1019         (newL2 * (1 + theTolerance) - theL2 >= Precision::Approximation())) {
1020       disconnect(IncidentTubeGroupParams->SpinBox_DZ, 0, this, 0);
1021       IncidentTubeGroupParams->SpinBox_DZ->setValue(newL2);
1022       connect(IncidentTubeGroupParams->SpinBox_DZ, SIGNAL(valueChanged( double )), this, SLOT(ValueChangedInSpinBox(double)));
1023       IncidentTubeGroupParams->SpinBox_DZ->setToolTip("Value was recomputed to fit with position");
1024       IncidentTubeGroupParams->SpinBox_DZ->setStyleSheet(CssAcceptable);
1025       JunctionPointsSel->PushButton5->setStyleSheet(CssAcceptable);
1026     }
1027     else {
1028       IncidentTubeGroupParams->SpinBox_DZ->setToolTip("Value is incompatible with position");
1029       IncidentTubeGroupParams->SpinBox_DZ->setStyleSheet(CssRefused);
1030       JunctionPointsSel->PushButton5->setStyleSheet(CssRefused);
1031     }
1032   }
1033   else {
1034     IncidentTubeGroupParams->SpinBox_DZ->setStyleSheet(CssNormal);
1035     JunctionPointsSel->PushButton5->setStyleSheet(CssNormal);
1036   }
1037
1038   return true;
1039 }
1040
1041 //=================================================================================
1042 // function : execute
1043 // purpose  :
1044 //=================================================================================
1045 bool AdvancedGUI_PipeTShapeDlg::execute (ObjectList& objects)
1046 {
1047   if (JunctionPointsSel->GroupBox1->isChecked() && myOkPoint1 && myOkPoint2 && myOkPoint3)
1048     CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
1049
1050   return executeNoCheck(objects);
1051 }
1052
1053 //=================================================================================
1054 // function : executeNoCheck
1055 // purpose  :
1056 //=================================================================================
1057 bool AdvancedGUI_PipeTShapeDlg::executeNoCheck (ObjectList& objects)
1058 {
1059   bool res = false;
1060
1061   //   GEOM::GEOM_Object_var anObj;
1062   GEOM::ListOfGO_var anObj;
1063
1064   GEOM::IAdvancedOperations_var anOper = GEOM::IAdvancedOperations::_narrow(getOperation());
1065
1066   //@@ retrieve input values from the widgets here @@//
1067   CORBA::Double theR1 = MainTubeGroupParams->SpinBox_DX->value();
1068   CORBA::Double theW1 = MainTubeGroupParams->SpinBox_DY->value();
1069   CORBA::Double theL1 = MainTubeGroupParams->SpinBox_DZ->value();
1070   CORBA::Double theR2 = IncidentTubeGroupParams->SpinBox_DX->value();
1071   CORBA::Double theW2 = IncidentTubeGroupParams->SpinBox_DY->value();
1072   CORBA::Double theL2 = IncidentTubeGroupParams->SpinBox_DZ->value();
1073   CORBA::Double theH = ChamferGroupParams->SpinBox_DX->value();
1074   CORBA::Double theW = ChamferGroupParams->SpinBox_DY->value();
1075   CORBA::Double theRF = FilletGroupParams->SpinBox_DX->value();
1076   CORBA::Boolean theHexMesh = HexMeshCheckBox->isChecked();
1077
1078   // Thickness reductions
1079   CORBA::Double theRL = 0., theWL = 0., theLtransL = 0., theLthinL = 0.;
1080   CORBA::Double theRR = 0., theWR = 0., theLtransR = 0., theLthinR = 0.;
1081   CORBA::Double theRI = 0., theWI = 0., theLtransI = 0., theLthinI = 0.;
1082
1083   if (LReductionGroupParams->GroupBox1->isChecked()) {
1084     theRL = LReductionGroupParams->SpinBox1->value();
1085     theWL = LReductionGroupParams->SpinBox2->value();
1086     theLtransL = LReductionGroupParams->SpinBox3->value();
1087     theLthinL = LReductionGroupParams->SpinBox4->value();
1088   }
1089   if (RReductionGroupParams->GroupBox1->isChecked()) {
1090     theRR = RReductionGroupParams->SpinBox1->value();
1091     theWR = RReductionGroupParams->SpinBox2->value();
1092     theLtransR = RReductionGroupParams->SpinBox3->value();
1093     theLthinR = RReductionGroupParams->SpinBox4->value();
1094   }
1095   if (IReductionGroupParams->GroupBox1->isChecked()) {
1096     theRI = IReductionGroupParams->SpinBox1->value();
1097     theWI = IReductionGroupParams->SpinBox2->value();
1098     theLtransI = IReductionGroupParams->SpinBox3->value();
1099     theLthinI = IReductionGroupParams->SpinBox4->value();
1100   }
1101
1102   //if (JunctionPointsSel->GroupBox1->isChecked()) {
1103   //  CheckCompatiblePosition(theL1, theL2, myPoint1, myPoint2, myPoint3, 0.01);
1104   //  theL1 = MainTubeGroupParams->SpinBox_DZ->value();
1105   //  theL2 = IncidentTubeGroupParams->SpinBox_DZ->value();
1106   //}
1107
1108   // call engine function
1109   if (ChamferGroupParams->GroupBox1->isChecked()) {
1110     if (JunctionPointsSel->GroupBox1->isChecked())
1111       anObj = anOper->MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
1112                                                           theRL, theWL, theLtransL, theLthinL,
1113                                                           theRR, theWR, theLtransR, theLthinR,
1114                                                           theRI, theWI, theLtransI, theLthinI,
1115                                                           theH, theW, theHexMesh, myPoint1, myPoint2, myPoint3);
1116     else
1117       anObj = anOper->MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
1118                                               theRL, theWL, theLtransL, theLthinL,
1119                                               theRR, theWR, theLtransR, theLthinR,
1120                                               theRI, theWI, theLtransI, theLthinI,
1121                                               theH, theW, theHexMesh);
1122   }
1123   else if (FilletGroupParams->GroupBox1->isChecked()) {
1124     if (JunctionPointsSel->GroupBox1->isChecked())
1125       anObj = anOper->MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
1126                                                          theRL, theWL, theLtransL, theLthinL,
1127                                                          theRR, theWR, theLtransR, theLthinR,
1128                                                          theRI, theWI, theLtransI, theLthinI,
1129                                                          theRF, theHexMesh, myPoint1, myPoint2, myPoint3);
1130     else
1131       anObj = anOper->MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
1132                                              theRL, theWL, theLtransL, theLthinL,
1133                                              theRR, theWR, theLtransR, theLthinR,
1134                                              theRI, theWI, theLtransI, theLthinI,
1135                                              theRF, theHexMesh);
1136   }
1137   else {
1138     if (JunctionPointsSel->GroupBox1->isChecked())
1139       anObj = anOper->MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
1140                                                    theRL, theWL, theLtransL, theLthinL,
1141                                                    theRR, theWR, theLtransR, theLthinR,
1142                                                    theRI, theWI, theLtransI, theLthinI,
1143                                                    theHexMesh, myPoint1, myPoint2, myPoint3);
1144     else
1145       anObj = anOper->MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
1146                                        theRL, theWL, theLtransL, theLthinL,
1147                                        theRR, theWR, theLtransR, theLthinR,
1148                                        theRI, theWI, theLtransI, theLthinI,
1149                                        theHexMesh);
1150   }
1151
1152   res = anObj->length();
1153   if (!res)
1154     return false;
1155
1156   //res = !anObj->_is_nil();
1157   if (res && !IsPreview()) {
1158     QStringList aParameters;
1159     //@@ put stringified input parameters to the string list here to store in the data model for notebook @@//
1160     aParameters << MainTubeGroupParams->SpinBox_DX->text(); // R1 parameter
1161     aParameters << MainTubeGroupParams->SpinBox_DY->text(); // W1 parameter
1162     aParameters << MainTubeGroupParams->SpinBox_DZ->text(); // L1 parameter
1163     aParameters << IncidentTubeGroupParams->SpinBox_DX->text(); // R2 parameter
1164     aParameters << IncidentTubeGroupParams->SpinBox_DY->text(); // W2 parameter
1165     aParameters << IncidentTubeGroupParams->SpinBox_DZ->text(); // L2 parameter
1166
1167     if (ChamferGroupParams->GroupBox1->isChecked()) { // Chamfer parameter
1168       aParameters << ChamferGroupParams->SpinBox_DX->text(); // H parameter
1169       aParameters << ChamferGroupParams->SpinBox_DY->text(); // W parameter
1170     }
1171     if (FilletGroupParams->GroupBox1->isChecked()) // Fillet parameter
1172       aParameters << FilletGroupParams->SpinBox_DX->text(); // RF parameter
1173
1174     // Thickness reductions
1175     if (LReductionGroupParams->GroupBox1->isChecked()) {
1176       aParameters << LReductionGroupParams->SpinBox1->text();
1177       aParameters << LReductionGroupParams->SpinBox2->text();
1178       aParameters << LReductionGroupParams->SpinBox3->text();
1179       aParameters << LReductionGroupParams->SpinBox4->text();
1180     }
1181     else {
1182       aParameters << "0" << "0" << "0" << "0";
1183     }
1184     if (RReductionGroupParams->GroupBox1->isChecked()) {
1185       aParameters << RReductionGroupParams->SpinBox1->text();
1186       aParameters << RReductionGroupParams->SpinBox2->text();
1187       aParameters << RReductionGroupParams->SpinBox3->text();
1188       aParameters << RReductionGroupParams->SpinBox4->text();
1189     }
1190     else {
1191       aParameters << "0" << "0" << "0" << "0";
1192     }
1193     if (IReductionGroupParams->GroupBox1->isChecked()) {
1194       aParameters << IReductionGroupParams->SpinBox1->text();
1195       aParameters << IReductionGroupParams->SpinBox2->text();
1196       aParameters << IReductionGroupParams->SpinBox3->text();
1197       aParameters << IReductionGroupParams->SpinBox4->text();
1198     }
1199     else {
1200       aParameters << "0" << "0" << "0" << "0";
1201     }
1202
1203     if (aParameters.count() > 0)
1204       anObj[0]->SetParameters(aParameters.join(":").toUtf8().constData());
1205   }
1206
1207   objects.push_back(anObj[0]._retn());
1208   pipeTShapeGroupObjects.clear();
1209   for (int i = 1, n = anObj->length(); i < n; i++) {
1210     pipeTShapeGroupObjects.push_back(anObj[i]._retn());
1211   }
1212
1213   return objects.size() > 0;
1214 }
1215
1216 //=================================================================================
1217 // function : restoreSubShapes
1218 // purpose  :
1219 //=================================================================================
1220 void AdvancedGUI_PipeTShapeDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
1221 {
1222   SALOMEDS::GenericAttribute_var anAttr;
1223   if (!theSObject->FindAttribute(anAttr, "AttributeIOR"))
1224     return;
1225
1226   SALOMEDS::AttributeIOR_var anAttrIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
1227   CORBA::String_var anIORso = anAttrIOR->Value();
1228
1229   // get Object from SObject
1230   GEOM::GEOM_Object_var theFather =
1231     GEOM::GEOM_Object::_narrow(myGeomGUI->getApp()->orb()->string_to_object(anIORso));
1232   if (CORBA::is_nil(theFather))
1233     return;
1234
1235   ObjectList::iterator it = pipeTShapeGroupObjects.begin();
1236
1237   for (int i = 0; it != pipeTShapeGroupObjects.end(); it++, i++) {
1238     getGeomEngine()->AddInStudy((*it), tr((*it)->GetName()).toStdString().c_str(), theFather);
1239   }
1240 }
1241
1242 //=================================================================================
1243 // function : processPreview()
1244 // purpose  : Display preview if CheckBoxPreview is checked
1245 //=================================================================================
1246 void AdvancedGUI_PipeTShapeDlg::processPreview()
1247 {
1248   if (mainFrame()->CheckBoxPreview->isChecked())
1249     DisplayPreview();
1250   else
1251     erasePreview(true);
1252 }
1253
1254 //=================================================================================
1255 // function : getSourceObjects
1256 // purpose  : virtual method to get source objects
1257 //=================================================================================
1258 QList<GEOM::GeomObjPtr> AdvancedGUI_PipeTShapeDlg::getSourceObjects()
1259 {
1260   QList<GEOM::GeomObjPtr> res;
1261   GEOM::GeomObjPtr aGeomObjPtr1(myPoint1), aGeomObjPtr2(myPoint2), aGeomObjPtr3(myPoint3);
1262   res << aGeomObjPtr1 << aGeomObjPtr2 << aGeomObjPtr3;
1263   return res;
1264 }
1265
1266 //=================================================================================
1267 // function : AdvancedGUI_4Spin
1268 // purpose  :
1269 //=================================================================================
1270 AdvancedGUI_4Spin::AdvancedGUI_4Spin()
1271 {
1272   GroupBox1 = new QGroupBox ();
1273
1274   gridLayout1 = new QGridLayout (GroupBox1);
1275   gridLayout1->setSpacing(6);
1276   gridLayout1->setContentsMargins(11, 11, 11, 11);
1277   gridLayout1->setHorizontalSpacing(6);
1278   gridLayout1->setVerticalSpacing(6);
1279   gridLayout1->setContentsMargins(9, 9, 9, 9);
1280
1281   TextLabel1 = new QLabel (GroupBox1);
1282   TextLabel2 = new QLabel (GroupBox1);
1283   TextLabel3 = new QLabel (GroupBox1);
1284   TextLabel4 = new QLabel (GroupBox1);
1285
1286   SpinBox1 = new SalomeApp_DoubleSpinBox (GroupBox1);
1287   SpinBox2 = new SalomeApp_DoubleSpinBox (GroupBox1);
1288   SpinBox3 = new SalomeApp_DoubleSpinBox (GroupBox1);
1289   SpinBox4 = new SalomeApp_DoubleSpinBox (GroupBox1);
1290
1291   SpinBox1->setMinimumWidth(60);
1292   SpinBox2->setMinimumWidth(60);
1293   SpinBox3->setMinimumWidth(60);
1294   SpinBox4->setMinimumWidth(60);
1295
1296   gridLayout1->addWidget(TextLabel1, 0, 0, 1, 1);
1297   gridLayout1->addWidget(TextLabel2, 1, 0, 1, 1);
1298   gridLayout1->addWidget(TextLabel3, 2, 0, 1, 1);
1299   gridLayout1->addWidget(TextLabel4, 3, 0, 1, 1);
1300
1301   gridLayout1->addWidget(SpinBox1, 0, 1, 1, 1);
1302   gridLayout1->addWidget(SpinBox2, 1, 1, 1, 1);
1303   gridLayout1->addWidget(SpinBox3, 2, 1, 1, 1);
1304   gridLayout1->addWidget(SpinBox4, 3, 1, 1, 1);
1305 }
1306
1307 //=================================================================================
1308 // function : ~AdvancedGUI_4Spin()
1309 // purpose  : Destroys the object and frees any allocated resources
1310 //=================================================================================
1311 AdvancedGUI_4Spin::~AdvancedGUI_4Spin()
1312 {
1313   // no need to delete child widgets, Qt does it all for us
1314 }