]> SALOME platform Git repositories - modules/geom.git/blob - src/MeasureGUI/MeasureGUI_DistanceDlg.cxx
Salome HOME
Merge branch 'fbt/add_header_for_mpi_compilation'
[modules/geom.git] / src / MeasureGUI / MeasureGUI_DistanceDlg.cxx
1 // Copyright (C) 2007-2015  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   myGrp->LineEdit1->setEnabled(true);
132   myGrp->LineEdit2->setEnabled(false);
133
134   myObj1.nullify();
135   myObj2.nullify();
136
137   // signals and slots connections
138   connect(buttonOk(),         SIGNAL(clicked()), this, SLOT(ClickOnOk()));
139   connect(buttonApply(),      SIGNAL(clicked()), this, SLOT(ClickOnApply()));
140
141   connect(myGrp->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
142   connect(myGrp->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
143
144   connect(myGrp->ComboBox1, SIGNAL(currentIndexChanged(int)), this, SLOT(SolutionSelected(int)));
145
146   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
147           this, SLOT(SelectionIntoArgument()));
148
149   activateSelection();
150   SelectionIntoArgument();
151 }
152
153 //=================================================================================
154 // function : ClickOnOk()
155 // purpose  :
156 //=================================================================================
157 void MeasureGUI_DistanceDlg::ClickOnOk()
158 {
159   if (ClickOnApply())
160     ClickOnCancel();
161 }
162
163 //=================================================================================
164 // function : ClickOnApply()
165 // purpose  :
166 //=================================================================================
167 bool MeasureGUI_DistanceDlg::ClickOnApply()
168 {
169   if (!onAccept())
170     return false;
171
172   initName();
173   activateSelection();
174   return true;
175 }
176
177 //=================================================================================
178 // function : ActivateThisDialog()
179 // purpose  :
180 //=================================================================================
181 void MeasureGUI_DistanceDlg::ActivateThisDialog()
182 {
183   GEOMBase_Skeleton::ActivateThisDialog();
184
185   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
186           this, SLOT(SelectionIntoArgument()));
187
188   activateSelection();
189   redisplayPreview();
190 }
191
192 //=================================================================================
193 // function : enterEvent()
194 // purpose  :
195 //=================================================================================
196 void MeasureGUI_DistanceDlg::enterEvent(QEvent*)
197 {
198   if (!mainFrame()->GroupConstructors->isEnabled())
199     ActivateThisDialog();
200 }
201
202 //=================================================================================
203 // function : SolutionSelected()
204 // purpose  : Called when ComboBox selection has changed
205 //=================================================================================
206 void MeasureGUI_DistanceDlg::SolutionSelected (int i)
207 {
208   if (i < 0 || myDbls->length() < (i+1)*6) {
209     myGrp->LineEdit3->setText("");
210     myGrp->LineEdit4->setText("");
211     myGrp->LineEdit5->setText("");
212     myGrp->LineEdit6->setText("");
213     erasePreview();
214     return;
215   }
216
217   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
218   int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 );
219
220   gp_Pnt p1 (myDbls[i*6 + 0], myDbls[i*6 + 1], myDbls[i*6 + 2]);
221   gp_Pnt p2 (myDbls[i*6 + 3], myDbls[i*6 + 4], myDbls[i*6 + 5]);
222
223   double aDist = p1.Distance(p2);
224   myGrp->LineEdit3->setText(DlgRef::PrintDoubleValue(aDist, aPrecision));
225
226   gp_XYZ aVec = p2.XYZ() - p1.XYZ();
227   myGrp->LineEdit4->setText(DlgRef::PrintDoubleValue(aVec.X(), aPrecision));
228   myGrp->LineEdit5->setText(DlgRef::PrintDoubleValue(aVec.Y(), aPrecision));
229   myGrp->LineEdit6->setText(DlgRef::PrintDoubleValue(aVec.Z(), aPrecision));
230
231   redisplayPreview();
232 }
233
234 //=================================================================================
235 // function : SelectionIntoArgument()
236 // purpose  : Called when selection has changed
237 //=================================================================================
238 void MeasureGUI_DistanceDlg::SelectionIntoArgument()
239 {
240   QList<TopAbs_ShapeEnum> aTypes;
241   aTypes << TopAbs_VERTEX << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPSOLID << TopAbs_COMPOUND << TopAbs_SHAPE;
242   GEOM::GeomObjPtr aSelectedObject = getSelected( aTypes );
243
244   // clear selection
245   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
246   myGeomGUI->getApp()->selectionMgr()->clearSelected();
247   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
248           this, SLOT(SelectionIntoArgument()));
249
250   if (myEditCurrentArgument == myGrp->LineEdit1) {
251     myObj1 = aSelectedObject;
252     if (myObj1 && !myObj2)
253       myGrp->PushButton2->click();
254   }
255   else {
256     myObj2 = aSelectedObject;
257     if (myObj2 && !myObj1)
258       myGrp->PushButton1->click();
259   }
260
261   processObject();
262 }
263
264 //=================================================================================
265 // function : SetEditCurrentArgument()
266 // purpose  :
267 //=================================================================================
268 void MeasureGUI_DistanceDlg::SetEditCurrentArgument()
269 {
270   QPushButton* send = (QPushButton*)sender();
271
272   if (send == myGrp->PushButton1) {
273     myEditCurrentArgument = myGrp->LineEdit1;
274
275     myGrp->PushButton2->setDown(false);
276     myGrp->LineEdit2->setEnabled(false);
277   }
278   else {
279     myEditCurrentArgument = myGrp->LineEdit2;
280
281     myGrp->PushButton1->setDown(false);
282     myGrp->LineEdit1->setEnabled(false);
283   }
284
285   // enable line edit
286   myEditCurrentArgument->setEnabled(true);
287   myEditCurrentArgument->setFocus();
288   // after setFocus(), because it will be setDown(false) when loses focus
289   send->setDown(true);
290
291   // seems we need it only to avoid preview disappearing, caused by selection mode change
292   redisplayPreview();
293 }
294
295 //=================================================================================
296 // function : processObject()
297 // purpose  : Fill dialogs fields in accordance with myObj1 and myObj2
298 //=================================================================================
299 void MeasureGUI_DistanceDlg::processObject()
300 {
301   myGrp->LineEdit1->setText(myObj1 ? GEOMBase::GetName(myObj1.get()) : "");
302   myGrp->LineEdit2->setText(myObj2 ? GEOMBase::GetName(myObj2.get()) : "");
303
304   myGrp->ComboBox1->clear();
305   myDbls->length(0);
306   erasePreview();
307
308   int nbSols = 0;
309
310   QString msg;
311   if (!isValid(msg)) return;
312
313   GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
314   try {
315     nbSols = anOper->ClosestPoints(myObj1.get(), myObj2.get(), myDbls);
316   }
317   catch (const SALOME::SALOME_Exception& e) {
318     SalomeApp_Tools::QtCatchCorbaException(e);
319     return;
320   }
321
322   if (!anOper->IsDone())
323     myGrp->ComboBox1->addItem(tr(anOper->GetErrorCode()));
324   else if (nbSols <= 0)
325     myGrp->ComboBox1->addItem(tr("GEOM_MINDIST_NO_SOL"));
326   else {
327     for (int i = 0; i < nbSols; i++) {
328       myGrp->ComboBox1->addItem(tr("GEOM_SOLUTION_I").arg(i + 1));
329     }
330     myGrp->ComboBox1->setCurrentIndex(0);
331   }
332 }
333
334 //=================================================================================
335 // function : buildPrs()
336 // purpose  :
337 //=================================================================================
338 SALOME_Prs* MeasureGUI_DistanceDlg::buildPrs()
339 {
340   SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
341
342   int currSol = myGrp->ComboBox1->currentIndex();
343
344   if (!myObj1 || !myObj2 ||
345       currSol == -1 || (currSol+1)*6 > myDbls->length() ||
346       vw->getViewManager()->getType() != OCCViewer_Viewer::Type())
347     return 0;
348
349   gp_Pnt aPnt1 (myDbls[currSol*6 + 0], myDbls[currSol*6 + 1], myDbls[currSol*6 + 2]);
350   gp_Pnt aPnt2 (myDbls[currSol*6 + 3], myDbls[currSol*6 + 4], myDbls[currSol*6 + 5]);
351
352   double aDist = aPnt1.Distance(aPnt2);
353
354   try
355   {
356     if (aDist <= 1.e-9) {
357       BRepBuilderAPI_MakeVertex aMaker (aPnt1);
358       return getDisplayer()->BuildPrs(aMaker.Vertex());
359     }
360     else {
361       BRepBuilderAPI_MakeEdge MakeEdge (aPnt1, aPnt2);
362       TopoDS_Vertex aVert1 = BRepBuilderAPI_MakeVertex(aPnt1);
363       TopoDS_Vertex aVert2 = BRepBuilderAPI_MakeVertex(aPnt2);
364
365       //QString aLabel;
366       //aLabel.sprintf("%.1f", aDist);
367
368       gp_Pnt aPnt3 ((aPnt1.X() + aPnt2.X()) / 2,
369                     (aPnt1.Y() + aPnt2.Y()) / 2,
370                     (aPnt1.Z() + aPnt2.Z()) / 2);
371
372       gp_Vec va (aPnt3, aPnt1);
373       gp_Vec vb (aPnt3, aPnt2);
374
375       if (va.IsParallel(vb, Precision::Angular())) {
376         aPnt3.SetY((aPnt1.Y() + aPnt2.Y()) / 2 + 100);
377         aPnt3.SetZ((aPnt1.Z() + aPnt2.Z()) / 2);
378       }
379
380       gce_MakePln gce_MP (aPnt1, aPnt2, aPnt3);
381       Handle(Geom_Plane) P = new Geom_Plane (gce_MP.Value());
382
383       Handle(AIS_LengthDimension) anIO = new AIS_LengthDimension( aVert1, aVert2, P->Pln() );
384
385       SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
386       int w = resMgr->integerValue( "Geometry", "measures_line_width", 1 );
387
388       Handle(Prs3d_DimensionAspect) aDimensionStyle = new Prs3d_DimensionAspect;
389
390       aDimensionStyle->ArrowAspect()->SetLength( aDist / 20.0 );
391       aDimensionStyle->LineAspect()->SetWidth( w );
392       aDimensionStyle->SetTextHorizontalPosition( Prs3d_DTHP_Center );
393       aDimensionStyle->SetTextVerticalPosition( Prs3d_DTVP_Center );
394       aDimensionStyle->MakeText3d( Standard_False );
395       aDimensionStyle->MakeArrows3d( Standard_True );
396
397       anIO->SetFlyout( 0.0 );
398       anIO->SetDimensionAspect( aDimensionStyle );
399
400       SOCC_Prs* aPrs = dynamic_cast<SOCC_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));
401
402       if (aPrs)
403         aPrs->AddObject(anIO);
404
405       return aPrs;
406     }
407   }
408   catch (Standard_Failure) {
409     return 0;
410   }
411 }
412
413 //=================================================================================
414 // function : createOperation
415 // purpose  :
416 //=================================================================================
417 GEOM::GEOM_IOperations_ptr MeasureGUI_DistanceDlg::createOperation()
418 {
419   return getGeomEngine()->GetIMeasureOperations(getStudyId());
420 }
421
422 //=================================================================================
423 // function : isValid()
424 // purpose  :
425 //=================================================================================
426 bool MeasureGUI_DistanceDlg::isValid (QString& msg)
427 {
428   return myObj1 && myObj2;
429 }
430
431 //=================================================================================
432 // function : execute
433 // purpose  :
434 //=================================================================================
435 bool MeasureGUI_DistanceDlg::execute (ObjectList& objects)
436 {
437   GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
438   GEOM::GEOM_IBasicOperations_var aBasicOper = getGeomEngine()->GetIBasicOperations(getStudyId());
439
440   GEOM::ListOfDouble_var aDbls;
441   int nbSols = anOper->ClosestPoints(myObj1.get(), myObj2.get(), aDbls);
442
443   if (anOper->IsDone()) {
444     bool doPublishAll = true;
445     if (nbSols > 1) {
446       QMessageBox::StandardButton anAnswer =
447         SUIT_MessageBox::question(this, tr("GEOM_MINDIST_PUBLISH_TITLE"),
448                                   tr("GEOM_MINDIST_PUBLISH_TEXT"),
449                                   QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
450                                   QMessageBox::No);
451       if (anAnswer == QMessageBox::No)
452         doPublishAll = false;
453       else if (anAnswer != QMessageBox::Yes)
454         return true;
455     }
456     if (doPublishAll) {
457       for (int i = 0; i < nbSols; i++) {
458         GEOM::GEOM_Object_var anObj1 =
459           aBasicOper->MakePointXYZ(aDbls[i*6 + 0], aDbls[i*6 + 1], aDbls[i*6 + 2]);
460         GEOM::GEOM_Object_var anObj2 =
461           aBasicOper->MakePointXYZ(aDbls[i*6 + 3], aDbls[i*6 + 4], aDbls[i*6 + 5]);
462
463         if (!anObj1->_is_nil() && !anObj2->_is_nil()) {
464           objects.push_back(anObj1._retn());
465           objects.push_back(anObj2._retn());
466         }
467       }
468     }
469     else {
470       int i = myGrp->ComboBox1->currentIndex();
471       GEOM::GEOM_Object_var anObj1 =
472         aBasicOper->MakePointXYZ(aDbls[i*6 + 0], aDbls[i*6 + 1], aDbls[i*6 + 2]);
473       GEOM::GEOM_Object_var anObj2 =
474         aBasicOper->MakePointXYZ(aDbls[i*6 + 3], aDbls[i*6 + 4], aDbls[i*6 + 5]);
475
476       if (!anObj1->_is_nil() && !anObj2->_is_nil()) {
477         objects.push_back(anObj1._retn());
478         objects.push_back(anObj2._retn());
479       }
480     }
481   }
482
483   return true;
484 }
485
486 //=================================================================================
487 // function : activateSelection()
488 // purpose  :
489 //=================================================================================
490 void MeasureGUI_DistanceDlg::activateSelection()
491 {
492   globalSelection( GEOM_ALLSHAPES );
493   std::list<int> needTypes;
494   needTypes.push_back( TopAbs_SHAPE ), needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ); 
495   needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL );
496   needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPSOLID ), needTypes.push_back( TopAbs_COMPOUND );
497   localSelection(GEOM::GEOM_Object::_nil(), needTypes );
498 }
499
500 //=================================================================================
501 // function : redisplayPreview()
502 // purpose  :
503 //=================================================================================
504 void MeasureGUI_DistanceDlg::redisplayPreview()
505 {
506   QString aMess;
507   if (!isValid(aMess)) {
508     erasePreview(true);
509     return;
510   }
511
512   erasePreview(false);
513
514   try {
515     SUIT_OverrideCursor();
516
517     getDisplayer()->SetColor(Quantity_NOC_VIOLET);
518     getDisplayer()->SetToActivate(false);
519     
520     if (SALOME_Prs* aPrs = buildPrs())
521       displayPreview(aPrs);
522   }
523   catch (const SALOME::SALOME_Exception& e) {
524     SalomeApp_Tools::QtCatchCorbaException(e);
525   }
526 }
527
528 //================================================================
529 // Function : getNewObjectName
530 // Purpose  : Redefine this method to return proper name for a new object
531 //================================================================
532 QString MeasureGUI_DistanceDlg::getNewObjectName (int currObj) const
533 {
534   QString aName = tr("GEOM_MINDIST_NAME") + QString("_%1_").arg((currObj+1)/2);
535   aName += GEOMBase::GetName(currObj%2 ? myObj1.get() : myObj2.get());
536
537   return aName;
538 }
539
540 //=================================================================================
541 // function : addSubshapeToStudy
542 // purpose  : virtual method to add new SubObjects if local selection
543 //=================================================================================
544 void MeasureGUI_DistanceDlg::addSubshapesToStudy()
545 {
546   GEOMBase::PublishSubObject( myObj1.get() );
547   GEOMBase::PublishSubObject( myObj2.get() );
548 }
549
550 //=================================================================================
551 // function : MeasureGUI_DistanceGroup
552 // purpose  :
553 //=================================================================================
554 MeasureGUI_DistanceGroup::MeasureGUI_DistanceGroup (QWidget *parent)
555 {
556   gridLayout = new QGridLayout (parent);
557   gridLayout->setSpacing(6);
558   gridLayout->setContentsMargins(11, 11, 11, 11);
559   gridLayout->setHorizontalSpacing(0);
560   gridLayout->setVerticalSpacing(0);
561   gridLayout->setContentsMargins(0, 0, 0, 0);
562
563   GroupBox1 = new QGroupBox (parent);
564
565   gridLayout1 = new QGridLayout (GroupBox1);
566   gridLayout1->setSpacing(6);
567   gridLayout1->setContentsMargins(11, 11, 11, 11);
568   gridLayout1->setHorizontalSpacing(6);
569   gridLayout1->setVerticalSpacing(6);
570   gridLayout1->setContentsMargins(9, 9, 9, 9);
571
572   // 2Sel
573   TextLabel1 = new QLabel(GroupBox1);
574   TextLabel2 = new QLabel(GroupBox1);
575
576   PushButton1 = new QPushButton (GroupBox1);
577   PushButton2 = new QPushButton (GroupBox1);
578
579   LineEdit1 = new QLineEdit(GroupBox1);
580   LineEdit2 = new QLineEdit(GroupBox1);
581
582   gridLayout1->addWidget(TextLabel1, 0, 0, 1, 1);
583   gridLayout1->addWidget(TextLabel2, 1, 0, 1, 1);
584   gridLayout1->addWidget(PushButton1, 0, 1, 1, 1);
585   gridLayout1->addWidget(PushButton2, 1, 1, 1, 1);
586   gridLayout1->addWidget(LineEdit1, 0, 2, 1, 1);
587   gridLayout1->addWidget(LineEdit2, 1, 2, 1, 1);
588
589   // 1Combo
590   TextLabel7 = new QLabel (GroupBox1);
591
592   ComboBox1 = new QComboBox (GroupBox1);
593
594   gridLayout1->addWidget(TextLabel7, 2, 0, 1, 1);
595   gridLayout1->addWidget(ComboBox1, 2, 1, 1, 2);
596
597   // 4Text
598   TextLabel3 = new QLabel (GroupBox1);
599   TextLabel4 = new QLabel (GroupBox1);
600   TextLabel5 = new QLabel (GroupBox1);
601   TextLabel6 = new QLabel (GroupBox1);
602
603   LineEdit3 = new QLineEdit(GroupBox1);
604   LineEdit4 = new QLineEdit(GroupBox1);
605   LineEdit5 = new QLineEdit(GroupBox1);
606   LineEdit6 = new QLineEdit(GroupBox1);
607
608   gridLayout1->addWidget(TextLabel3, 3, 0, 1, 1);
609   gridLayout1->addWidget(TextLabel4, 4, 0, 1, 1);
610   gridLayout1->addWidget(TextLabel5, 5, 0, 1, 1);
611   gridLayout1->addWidget(TextLabel6, 6, 0, 1, 1);
612
613   gridLayout1->addWidget(LineEdit3, 3, 1, 1, 2);
614   gridLayout1->addWidget(LineEdit4, 4, 1, 1, 2);
615   gridLayout1->addWidget(LineEdit5, 5, 1, 1, 2);
616   gridLayout1->addWidget(LineEdit6, 6, 1, 1, 2);
617
618   gridLayout->addWidget(GroupBox1, 0, 0, 1, 1);
619 }
620
621 //=================================================================================
622 // function : ~MeasureGUI_DistanceGroup()
623 // purpose  : Destroys the object and frees any allocated resources
624 //=================================================================================
625 MeasureGUI_DistanceGroup::~MeasureGUI_DistanceGroup()
626 {
627   // no need to delete child widgets, Qt does it all for us
628 }