Salome HOME
Revert "Synchronize adm files"
[modules/geom.git] / src / MeasureGUI / MeasureGUI_DistanceDlg.cxx
1 // Copyright (C) 2007-2014  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
23 // GEOM GEOMGUI : GUI for Geometry component
24 // File   : MeasureGUI_DistanceDlg.cxx
25 // Author : Nicolas REJNERI, Open CASCADE S.A.S.
26
27 #include "MeasureGUI_DistanceDlg.h"
28 #include "MeasureGUI_Widgets.h"
29
30 #include <DlgRef.h>
31 #include <GEOMBase.h>
32 #include <GeometryGUI.h>
33
34 #include <SUIT_Session.h>
35 #include <SUIT_Desktop.h>
36 #include <SUIT_ResourceMgr.h>
37 #include <SUIT_ViewWindow.h>
38 #include <SUIT_ViewManager.h>
39 #include <SUIT_OverrideCursor.h>
40 #include <SUIT_MessageBox.h>
41 #include <SOCC_Prs.h>
42 #include <SOCC_ViewModel.h>
43 #include <SalomeApp_Tools.h>
44 #include <SalomeApp_Application.h>
45 #include <LightApp_SelectionMgr.h>
46
47 // OCCT Includes
48 #include <Geom_Plane.hxx>
49 #include <AIS_LengthDimension.hxx>
50 #include <AIS_Drawer.hxx>
51 #include <Prs3d_LineAspect.hxx>
52 #include <BRepBuilderAPI_MakeEdge.hxx>
53 #include <BRepBuilderAPI_MakeVertex.hxx>
54 #include <gce_MakePln.hxx>
55 #include <Precision.hxx>
56
57 //=================================================================================
58 // class    : MeasureGUI_DistanceDlg()
59 // purpose  : Constructs a MeasureGUI_DistanceDlg which is a child of 'parent', with the
60 //            name 'name' and widget flags set to 'f'.
61 //            The dialog will by default be modeless, unless you set 'modal' to
62 //            true to construct a modal dialog.
63 //=================================================================================
64 MeasureGUI_DistanceDlg::MeasureGUI_DistanceDlg (GeometryGUI* GUI, QWidget* parent)
65   : GEOMBase_Skeleton(GUI, parent)
66 {
67   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
68   QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_MINDIST")));
69   QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
70
71   setWindowTitle(tr("GEOM_MINDIST_TITLE"));
72
73   /***************************************************************/
74   mainFrame()->GroupConstructors->setTitle(tr("GEOM_DISTANCE"));
75   mainFrame()->RadioButton1->setIcon(image0);
76   mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose);
77   mainFrame()->RadioButton2->close();
78   mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
79   mainFrame()->RadioButton3->close();
80
81   mainFrame()->GroupBoxName->hide();
82
83   myGrp = new MeasureGUI_DistanceGroup (centralWidget());
84   myGrp->GroupBox1->setTitle(tr("GEOM_MINDIST_OBJ"));
85
86   // Arguments
87   myGrp->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1"));
88   myGrp->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2"));
89   myGrp->PushButton1->setIcon(image1);
90   myGrp->PushButton2->setIcon(image1);
91   myGrp->LineEdit1->setReadOnly(true);
92   myGrp->LineEdit2->setReadOnly(true);
93
94   // Solutions combobox
95   myGrp->TextLabel7->setText(tr("GEOM_SOLUTION"));
96
97   // Distance, dx, dy and dz
98   myGrp->TextLabel3->setText(tr("GEOM_LENGTH"));
99   myGrp->TextLabel4->setText(tr("GEOM_DX"));
100   myGrp->TextLabel5->setText(tr("GEOM_DY"));
101   myGrp->TextLabel6->setText(tr("GEOM_DZ"));
102   myGrp->LineEdit3->setReadOnly(true);
103   myGrp->LineEdit4->setReadOnly(true);
104   myGrp->LineEdit5->setReadOnly(true);
105   myGrp->LineEdit6->setReadOnly(true);
106   /***************************************************************/
107
108   myHelpFileName = "min_distance_page.html";
109
110   // Initialisation
111   Init();
112 }
113
114 //=================================================================================
115 // function : ~MeasureGUI_DistanceDlg()
116 // purpose  : Destroys the object and frees any allocated resources
117 //=================================================================================
118 MeasureGUI_DistanceDlg::~MeasureGUI_DistanceDlg()
119 {
120 }
121
122 //=================================================================================
123 // function : Init()
124 // purpose  :
125 //=================================================================================
126 void MeasureGUI_DistanceDlg::Init()
127 {
128   myEditCurrentArgument = myGrp->LineEdit1;
129   myDbls = new GEOM::ListOfDouble();
130
131   // signals and slots connections
132   connect(buttonOk(),         SIGNAL(clicked()), this, SLOT(ClickOnOk()));
133   connect(buttonApply(),      SIGNAL(clicked()), this, SLOT(ClickOnApply()));
134
135   connect(myGrp->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
136   connect(myGrp->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
137
138   connect(myGrp->ComboBox1, SIGNAL(currentIndexChanged(int)), this, SLOT(SolutionSelected(int)));
139
140   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
141           this, SLOT(SelectionIntoArgument()));
142
143   globalSelection();
144   SelectionIntoArgument();
145 }
146
147 //=================================================================================
148 // function : ClickOnOk()
149 // purpose  :
150 //=================================================================================
151 void MeasureGUI_DistanceDlg::ClickOnOk()
152 {
153   if (ClickOnApply())
154     ClickOnCancel();
155 }
156
157 //=================================================================================
158 // function : ClickOnApply()
159 // purpose  :
160 //=================================================================================
161 bool MeasureGUI_DistanceDlg::ClickOnApply()
162 {
163   if (!onAccept())
164     return false;
165
166   initName();
167   return true;
168 }
169
170 //=================================================================================
171 // function : ActivateThisDialog()
172 // purpose  :
173 //=================================================================================
174 void MeasureGUI_DistanceDlg::ActivateThisDialog()
175 {
176   GEOMBase_Skeleton::ActivateThisDialog();
177
178   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
179           this, SLOT(SelectionIntoArgument()));
180
181   globalSelection();
182   redisplayPreview();
183 }
184
185 //=================================================================================
186 // function : enterEvent()
187 // purpose  :
188 //=================================================================================
189 void MeasureGUI_DistanceDlg::enterEvent(QEvent*)
190 {
191   if (!mainFrame()->GroupConstructors->isEnabled())
192     ActivateThisDialog();
193 }
194
195 //=================================================================================
196 // function : SolutionSelected()
197 // purpose  : Called when ComboBox selection has changed
198 //=================================================================================
199 void MeasureGUI_DistanceDlg::SolutionSelected (int i)
200 {
201   if (i < 0 || myDbls->length() < (i+1)*6) {
202     myGrp->LineEdit3->setText("");
203     myGrp->LineEdit4->setText("");
204     myGrp->LineEdit5->setText("");
205     myGrp->LineEdit6->setText("");
206     erasePreview();
207     return;
208   }
209
210   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
211   int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 );
212
213   gp_Pnt p1 (myDbls[i*6 + 0], myDbls[i*6 + 1], myDbls[i*6 + 2]);
214   gp_Pnt p2 (myDbls[i*6 + 3], myDbls[i*6 + 4], myDbls[i*6 + 5]);
215
216   double aDist = p1.Distance(p2);
217   myGrp->LineEdit3->setText(DlgRef::PrintDoubleValue(aDist, aPrecision));
218
219   gp_XYZ aVec = p2.XYZ() - p1.XYZ();
220   myGrp->LineEdit4->setText(DlgRef::PrintDoubleValue(aVec.X(), aPrecision));
221   myGrp->LineEdit5->setText(DlgRef::PrintDoubleValue(aVec.Y(), aPrecision));
222   myGrp->LineEdit6->setText(DlgRef::PrintDoubleValue(aVec.Z(), aPrecision));
223
224   redisplayPreview();
225 }
226
227 //=================================================================================
228 // function : SelectionIntoArgument()
229 // purpose  : Called when selection has changed
230 //=================================================================================
231 void MeasureGUI_DistanceDlg::SelectionIntoArgument()
232 {
233   LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
234   SALOME_ListIO aSelList;
235   aSelMgr->selectedObjects(aSelList);
236
237   GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil();
238
239   if (aSelList.Extent() > 0) {
240     aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First());
241   }
242
243   // clear selection
244   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
245   myGeomGUI->getApp()->selectionMgr()->clearSelected();
246   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
247           this, SLOT(SelectionIntoArgument()));
248
249   if (myEditCurrentArgument == myGrp->LineEdit1) {
250     myObj1 = aSelectedObject;
251     if (!myObj1->_is_nil() && myObj2->_is_nil())
252       myGrp->PushButton2->click();
253   }
254   else {
255     myObj2 = aSelectedObject;
256     if (!myObj2->_is_nil() && myObj1->_is_nil())
257       myGrp->PushButton1->click();
258   }
259
260   processObject();
261 }
262
263 //=================================================================================
264 // function : SetEditCurrentArgument()
265 // purpose  :
266 //=================================================================================
267 void MeasureGUI_DistanceDlg::SetEditCurrentArgument()
268 {
269   QPushButton* send = (QPushButton*)sender();
270
271   if (send == myGrp->PushButton1) {
272     myEditCurrentArgument = myGrp->LineEdit1;
273
274     myGrp->PushButton2->setDown(false);
275     myGrp->LineEdit2->setEnabled(false);
276   }
277   else {
278     myEditCurrentArgument = myGrp->LineEdit2;
279
280     myGrp->PushButton1->setDown(false);
281     myGrp->LineEdit1->setEnabled(false);
282   }
283
284   // enable line edit
285   myEditCurrentArgument->setEnabled(true);
286   myEditCurrentArgument->setFocus();
287   // after setFocus(), because it will be setDown(false) when loses focus
288   send->setDown(true);
289
290   // seems we need it only to avoid preview disappearing, caused by selection mode change
291   redisplayPreview();
292 }
293
294 //=================================================================================
295 // function : processObject()
296 // purpose  : Fill dialogs fields in accordance with myObj1 and myObj2
297 //=================================================================================
298 void MeasureGUI_DistanceDlg::processObject()
299 {
300   myGrp->LineEdit1->setText(!myObj1->_is_nil() ? GEOMBase::GetName(myObj1) : "");
301   myGrp->LineEdit2->setText(!myObj2->_is_nil() ? GEOMBase::GetName(myObj2) : "");
302
303   myGrp->ComboBox1->clear();
304   myDbls->length(0);
305   erasePreview();
306
307   int nbSols = 0;
308
309   QString msg;
310   if (!isValid(msg)) return;
311
312   GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
313   try {
314     nbSols = anOper->ClosestPoints(myObj1, myObj2, myDbls);
315   }
316   catch (const SALOME::SALOME_Exception& e) {
317     SalomeApp_Tools::QtCatchCorbaException(e);
318     return;
319   }
320
321   if (!anOper->IsDone())
322     myGrp->ComboBox1->addItem(tr(anOper->GetErrorCode()));
323   else if (nbSols <= 0)
324     myGrp->ComboBox1->addItem(tr("GEOM_MINDIST_NO_SOL"));
325   else {
326     for (int i = 0; i < nbSols; i++) {
327       myGrp->ComboBox1->addItem(tr("GEOM_SOLUTION_I").arg(i + 1));
328     }
329     myGrp->ComboBox1->setCurrentIndex(0);
330   }
331 }
332
333 //=================================================================================
334 // function : buildPrs()
335 // purpose  :
336 //=================================================================================
337 SALOME_Prs* MeasureGUI_DistanceDlg::buildPrs()
338 {
339   SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
340
341   int currSol = myGrp->ComboBox1->currentIndex();
342
343   if (myObj1->_is_nil() || myObj2->_is_nil() ||
344       currSol == -1 || (currSol+1)*6 > myDbls->length() ||
345       vw->getViewManager()->getType() != OCCViewer_Viewer::Type())
346     return 0;
347
348   gp_Pnt aPnt1 (myDbls[currSol*6 + 0], myDbls[currSol*6 + 1], myDbls[currSol*6 + 2]);
349   gp_Pnt aPnt2 (myDbls[currSol*6 + 3], myDbls[currSol*6 + 4], myDbls[currSol*6 + 5]);
350
351   double aDist = aPnt1.Distance(aPnt2);
352
353   try
354   {
355     if (aDist <= 1.e-9) {
356       BRepBuilderAPI_MakeVertex aMaker (aPnt1);
357       return getDisplayer()->BuildPrs(aMaker.Vertex());
358     }
359     else {
360       BRepBuilderAPI_MakeEdge MakeEdge (aPnt1, aPnt2);
361       TopoDS_Vertex aVert1 = BRepBuilderAPI_MakeVertex(aPnt1);
362       TopoDS_Vertex aVert2 = BRepBuilderAPI_MakeVertex(aPnt2);
363
364       //QString aLabel;
365       //aLabel.sprintf("%.1f", aDist);
366
367       gp_Pnt aPnt3 ((aPnt1.X() + aPnt2.X()) / 2,
368                     (aPnt1.Y() + aPnt2.Y()) / 2,
369                     (aPnt1.Z() + aPnt2.Z()) / 2);
370
371       gp_Vec va (aPnt3, aPnt1);
372       gp_Vec vb (aPnt3, aPnt2);
373
374       if (va.IsParallel(vb, Precision::Angular())) {
375         aPnt3.SetY((aPnt1.Y() + aPnt2.Y()) / 2 + 100);
376         aPnt3.SetZ((aPnt1.Z() + aPnt2.Z()) / 2);
377       }
378
379       gce_MakePln gce_MP (aPnt1, aPnt2, aPnt3);
380       Handle(Geom_Plane) P = new Geom_Plane (gce_MP.Value());
381
382       Handle(AIS_LengthDimension) anIO = new AIS_LengthDimension( aVert1, aVert2, P->Pln() );
383
384       SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
385       int w = resMgr->integerValue( "Geometry", "measures_line_width", 1 );
386
387       Handle(Prs3d_DimensionAspect) aDimensionStyle = new Prs3d_DimensionAspect;
388
389       aDimensionStyle->ArrowAspect()->SetLength( aDist / 20.0 );
390       aDimensionStyle->LineAspect()->SetWidth( w );
391       aDimensionStyle->SetTextHorizontalPosition( Prs3d_DTHP_Center );
392       aDimensionStyle->SetTextVerticalPosition( Prs3d_DTVP_Center );
393       aDimensionStyle->MakeText3d( Standard_False );
394       aDimensionStyle->MakeArrows3d( Standard_True );
395
396       anIO->SetFlyout( 0.0 );
397       anIO->SetDimensionAspect( aDimensionStyle );
398
399       SOCC_Prs* aPrs = dynamic_cast<SOCC_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));
400
401       if (aPrs)
402         aPrs->AddObject(anIO);
403
404       return aPrs;
405     }
406   }
407   catch (Standard_Failure) {
408     return 0;
409   }
410 }
411
412 //=================================================================================
413 // function : createOperation
414 // purpose  :
415 //=================================================================================
416 GEOM::GEOM_IOperations_ptr MeasureGUI_DistanceDlg::createOperation()
417 {
418   return getGeomEngine()->GetIMeasureOperations(getStudyId());
419 }
420
421 //=================================================================================
422 // function : isValid()
423 // purpose  :
424 //=================================================================================
425 bool MeasureGUI_DistanceDlg::isValid (QString& msg)
426 {
427   return !myObj1->_is_nil() && !myObj2->_is_nil();
428 }
429
430 //=================================================================================
431 // function : execute
432 // purpose  :
433 //=================================================================================
434 bool MeasureGUI_DistanceDlg::execute (ObjectList& objects)
435 {
436   GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
437   GEOM::GEOM_IBasicOperations_var aBasicOper = getGeomEngine()->GetIBasicOperations(getStudyId());
438
439   GEOM::ListOfDouble_var aDbls;
440   int nbSols = anOper->ClosestPoints(myObj1, myObj2, aDbls);
441
442   if (anOper->IsDone()) {
443     bool doPublishAll = true;
444     if (nbSols > 1) {
445       QMessageBox::StandardButton anAnswer =
446         SUIT_MessageBox::question(this, tr("GEOM_MINDIST_PUBLISH_TITLE"),
447                                   tr("GEOM_MINDIST_PUBLISH_TEXT"),
448                                   QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
449                                   QMessageBox::No);
450       if (anAnswer == QMessageBox::No)
451         doPublishAll = false;
452       else if (anAnswer != QMessageBox::Yes)
453         return true;
454     }
455     if (doPublishAll) {
456       for (int i = 0; i < nbSols; i++) {
457         GEOM::GEOM_Object_var anObj1 =
458           aBasicOper->MakePointXYZ(aDbls[i*6 + 0], aDbls[i*6 + 1], aDbls[i*6 + 2]);
459         GEOM::GEOM_Object_var anObj2 =
460           aBasicOper->MakePointXYZ(aDbls[i*6 + 3], aDbls[i*6 + 4], aDbls[i*6 + 5]);
461
462         if (!anObj1->_is_nil() && !anObj2->_is_nil()) {
463           objects.push_back(anObj1._retn());
464           objects.push_back(anObj2._retn());
465         }
466       }
467     }
468     else {
469       int i = myGrp->ComboBox1->currentIndex();
470       GEOM::GEOM_Object_var anObj1 =
471         aBasicOper->MakePointXYZ(aDbls[i*6 + 0], aDbls[i*6 + 1], aDbls[i*6 + 2]);
472       GEOM::GEOM_Object_var anObj2 =
473         aBasicOper->MakePointXYZ(aDbls[i*6 + 3], aDbls[i*6 + 4], aDbls[i*6 + 5]);
474
475       if (!anObj1->_is_nil() && !anObj2->_is_nil()) {
476         objects.push_back(anObj1._retn());
477         objects.push_back(anObj2._retn());
478       }
479     }
480   }
481
482   return true;
483 }
484
485 //=================================================================================
486 // function : redisplayPreview()
487 // purpose  :
488 //=================================================================================
489 void MeasureGUI_DistanceDlg::redisplayPreview()
490 {
491   QString aMess;
492   if (!isValid(aMess)) {
493     erasePreview(true);
494     return;
495   }
496
497   erasePreview(false);
498
499   try {
500     SUIT_OverrideCursor();
501
502     getDisplayer()->SetColor(Quantity_NOC_VIOLET);
503     getDisplayer()->SetToActivate(false);
504     
505     if (SALOME_Prs* aPrs = buildPrs())
506       displayPreview(aPrs);
507   }
508   catch (const SALOME::SALOME_Exception& e) {
509     SalomeApp_Tools::QtCatchCorbaException(e);
510   }
511 }
512
513 //================================================================
514 // Function : getNewObjectName
515 // Purpose  : Redefine this method to return proper name for a new object
516 //================================================================
517 QString MeasureGUI_DistanceDlg::getNewObjectName (int currObj) const
518 {
519   QString aName = tr("GEOM_MINDIST_NAME") + QString("_%1_").arg((currObj+1)/2);
520   aName += GEOMBase::GetName(currObj%2 ? myObj1 : myObj2);
521
522   return aName;
523 }
524
525 //=================================================================================
526 // function : MeasureGUI_DistanceGroup
527 // purpose  :
528 //=================================================================================
529 MeasureGUI_DistanceGroup::MeasureGUI_DistanceGroup (QWidget *parent)
530 {
531   gridLayout = new QGridLayout (parent);
532   gridLayout->setSpacing(6);
533   gridLayout->setContentsMargins(11, 11, 11, 11);
534   gridLayout->setHorizontalSpacing(0);
535   gridLayout->setVerticalSpacing(0);
536   gridLayout->setContentsMargins(0, 0, 0, 0);
537
538   GroupBox1 = new QGroupBox (parent);
539
540   gridLayout1 = new QGridLayout (GroupBox1);
541   gridLayout1->setSpacing(6);
542   gridLayout1->setContentsMargins(11, 11, 11, 11);
543   gridLayout1->setHorizontalSpacing(6);
544   gridLayout1->setVerticalSpacing(6);
545   gridLayout1->setContentsMargins(9, 9, 9, 9);
546
547   // 2Sel
548   TextLabel1 = new QLabel(GroupBox1);
549   TextLabel2 = new QLabel(GroupBox1);
550
551   PushButton1 = new QPushButton (GroupBox1);
552   PushButton2 = new QPushButton (GroupBox1);
553
554   LineEdit1 = new QLineEdit(GroupBox1);
555   LineEdit2 = new QLineEdit(GroupBox1);
556
557   gridLayout1->addWidget(TextLabel1, 0, 0, 1, 1);
558   gridLayout1->addWidget(TextLabel2, 1, 0, 1, 1);
559   gridLayout1->addWidget(PushButton1, 0, 1, 1, 1);
560   gridLayout1->addWidget(PushButton2, 1, 1, 1, 1);
561   gridLayout1->addWidget(LineEdit1, 0, 2, 1, 1);
562   gridLayout1->addWidget(LineEdit2, 1, 2, 1, 1);
563
564   // 1Combo
565   TextLabel7 = new QLabel (GroupBox1);
566
567   ComboBox1 = new QComboBox (GroupBox1);
568
569   gridLayout1->addWidget(TextLabel7, 2, 0, 1, 1);
570   gridLayout1->addWidget(ComboBox1, 2, 1, 1, 2);
571
572   // 4Text
573   TextLabel3 = new QLabel (GroupBox1);
574   TextLabel4 = new QLabel (GroupBox1);
575   TextLabel5 = new QLabel (GroupBox1);
576   TextLabel6 = new QLabel (GroupBox1);
577
578   LineEdit3 = new QLineEdit(GroupBox1);
579   LineEdit4 = new QLineEdit(GroupBox1);
580   LineEdit5 = new QLineEdit(GroupBox1);
581   LineEdit6 = new QLineEdit(GroupBox1);
582
583   gridLayout1->addWidget(TextLabel3, 3, 0, 1, 1);
584   gridLayout1->addWidget(TextLabel4, 4, 0, 1, 1);
585   gridLayout1->addWidget(TextLabel5, 5, 0, 1, 1);
586   gridLayout1->addWidget(TextLabel6, 6, 0, 1, 1);
587
588   gridLayout1->addWidget(LineEdit3, 3, 1, 1, 2);
589   gridLayout1->addWidget(LineEdit4, 4, 1, 1, 2);
590   gridLayout1->addWidget(LineEdit5, 5, 1, 1, 2);
591   gridLayout1->addWidget(LineEdit6, 6, 1, 1, 2);
592
593   gridLayout->addWidget(GroupBox1, 0, 0, 1, 1);
594 }
595
596 //=================================================================================
597 // function : ~MeasureGUI_DistanceGroup()
598 // purpose  : Destroys the object and frees any allocated resources
599 //=================================================================================
600 MeasureGUI_DistanceGroup::~MeasureGUI_DistanceGroup()
601 {
602   // no need to delete child widgets, Qt does it all for us
603 }