Salome HOME
0021031: EDF 1646 GEOM: Modify Location leads to Position driver failed
[modules/geom.git] / src / TransformationGUI / TransformationGUI_ScaleDlg.cxx
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 // GEOM GEOMGUI : GUI for Geometry component
24 // File   : TransformationGUI_ScaleDlg.cxx
25 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
26 //
27 #include "TransformationGUI_ScaleDlg.h"
28
29 #include <DlgRef.h>
30 #include <GeometryGUI.h>
31 #include <GEOMBase.h>
32
33 #include <SalomeApp_DoubleSpinBox.h>
34 #include <SUIT_Session.h>
35 #include <SUIT_ResourceMgr.h>
36 #include <SalomeApp_Application.h>
37 #include <LightApp_SelectionMgr.h>
38
39 // OCCT Includes
40 #include <TopoDS_Shape.hxx>
41 #include <TopoDS.hxx>
42 #include <TopExp.hxx>
43 #include <TColStd_IndexedMapOfInteger.hxx>
44 #include <TopTools_IndexedMapOfShape.hxx>
45
46 #include <GEOMImpl_Types.hxx>
47
48 //=================================================================================
49 // class    : TransformationGUI_ScaleDlg()
50 // purpose  : Constructs a TransformationGUI_ScaleDlg which is a child of 'parent', with the
51 //            name 'name' and widget flags set to 'f'.
52 //            The dialog will by default be modeless, unless you set 'modal' to
53 //            TRUE to construct a modal dialog.
54 //=================================================================================
55 TransformationGUI_ScaleDlg::TransformationGUI_ScaleDlg (GeometryGUI* theGeometryGUI, QWidget* parent,
56                                                         bool modal, Qt::WindowFlags fl)
57   : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl),
58     myInitial(true)
59 {
60   SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
61   QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_SCALE")));
62   QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_SCALE_ALONG_AXES")));
63   QPixmap image3 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
64
65   setWindowTitle(tr("GEOM_SCALE_TITLE"));
66
67   // Constructors
68   mainFrame()->GroupConstructors->setTitle(tr("GEOM_SCALE"));
69   mainFrame()->RadioButton1->setIcon(image1);
70   mainFrame()->RadioButton2->setIcon(image2);
71   mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
72   mainFrame()->RadioButton3->close();
73
74   // Own widgets
75   GroupBox1 = new QGroupBox(tr("GEOM_ARGUMENTS"), this);
76   QGridLayout* OwnLayout = new QGridLayout(GroupBox1);
77   OwnLayout->setSpacing(6);
78   OwnLayout->setMargin(11);
79
80   TextLabel1 = new QLabel(tr("GEOM_OBJECTS"), GroupBox1);
81   PushButton1 = new QPushButton(GroupBox1);
82   PushButton1->setIcon(image3);
83   PushButton1->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
84   LineEdit1 = new QLineEdit(GroupBox1);
85   LineEdit1->setReadOnly(true);
86   LineEdit1->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
87
88   TextLabel2 = new QLabel(tr("GEOM_CENTRAL_POINT"), GroupBox1);
89   PushButton2 = new QPushButton(GroupBox1);
90   PushButton2->setIcon(image3);
91   PushButton2->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
92   LineEdit2 = new QLineEdit(GroupBox1);
93   LineEdit2->setReadOnly(true);
94   LineEdit2->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
95
96   TextLabel3 = new QLabel(tr("GEOM_SCALE_FACTOR"), GroupBox1);
97   SpinBox_FX = new SalomeApp_DoubleSpinBox(GroupBox1);
98
99   TextLabel4 = new QLabel(tr("GEOM_SCALE_FACTOR_Y"), GroupBox1);
100   SpinBox_FY = new SalomeApp_DoubleSpinBox(GroupBox1);
101
102   TextLabel5 = new QLabel(tr("GEOM_SCALE_FACTOR_Z"), GroupBox1);
103   SpinBox_FZ = new SalomeApp_DoubleSpinBox(GroupBox1);
104
105   CheckBoxCopy = new QCheckBox(tr("GEOM_CREATE_COPY"), GroupBox1);
106   CheckBoxCopy->setChecked(true);
107
108   // Layouting
109   OwnLayout->addWidget(TextLabel1,   0, 0);
110   OwnLayout->addWidget(PushButton1,  0, 1);
111   OwnLayout->addWidget(LineEdit1,    0, 2, 1, 2);
112   OwnLayout->addWidget(TextLabel2,   1, 0);
113   OwnLayout->addWidget(PushButton2,  1, 1);
114   OwnLayout->addWidget(LineEdit2,    1, 2, 1, 2);
115   OwnLayout->addWidget(TextLabel3,   2, 0);
116   OwnLayout->addWidget(SpinBox_FX,   2, 2);
117   OwnLayout->addWidget(TextLabel4,   3, 0);
118   OwnLayout->addWidget(SpinBox_FY,   3, 2);
119   OwnLayout->addWidget(TextLabel5,   4, 0);
120   OwnLayout->addWidget(SpinBox_FZ,   4, 2);
121   OwnLayout->addWidget(CheckBoxCopy, 5, 0, 1, 4);
122
123   QVBoxLayout* layout = new QVBoxLayout(centralWidget());
124   layout->setMargin(0); layout->setSpacing(6);
125   layout->addWidget(GroupBox1);
126
127   setHelpFileName("scale_operation_page.html");
128
129   // Modification of an existing object by offset is not allowed
130   CheckBoxCopy->hide();
131
132   // Activate Create a Copy mode
133   CreateCopyModeChanged(true);
134
135   // Allowed inheritance of children and visual properties by the scaling result
136   mainFrame()->GroupBoxPublish->show();
137
138   Init();
139 }
140
141 //=================================================================================
142 // function : ~TransformationGUI_ScaleDlg()
143 // purpose  : Destroys the object and frees any allocated resources
144 //=================================================================================
145 TransformationGUI_ScaleDlg::~TransformationGUI_ScaleDlg()
146 {
147 }
148
149 //=================================================================================
150 // function : Init()
151 // purpose  :
152 //=================================================================================
153 void TransformationGUI_ScaleDlg::Init()
154 {
155   // Min, max, step and decimals for spin boxes & initial values
156   double aFactor = 2.0;
157   double SpecificStep = 0.5;
158
159   initSpinBox(SpinBox_FX, COORD_MIN, COORD_MAX, SpecificStep, "parametric_precision" );
160   initSpinBox(SpinBox_FY, COORD_MIN, COORD_MAX, SpecificStep, "parametric_precision" );
161   initSpinBox(SpinBox_FZ, COORD_MIN, COORD_MAX, SpecificStep, "parametric_precision" );
162   SpinBox_FX->setValue(aFactor);
163   SpinBox_FY->setValue(aFactor);
164   SpinBox_FZ->setValue(aFactor);
165
166   // init variables
167   LineEdit1->setText("");
168   LineEdit2->setText("");
169
170   myPoint = GEOM::GEOM_Object::_nil();
171
172   // Signals and slots connections
173   connect(buttonOk(),        SIGNAL(clicked()), this, SLOT(ClickOnOk()));
174   connect(buttonApply(),     SIGNAL(clicked()), this, SLOT(ClickOnApply()));
175   connect(this, SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
176
177   connect(PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
178   connect(PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
179
180   connect(LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
181   connect(LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
182
183   connect(SpinBox_FX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
184   connect(SpinBox_FY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
185   connect(SpinBox_FZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
186   
187   // san : Commented so as not to override specific step settings
188   //connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double)));
189
190   connect(CheckBoxCopy, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool)));
191
192   initName(tr("GEOM_SCALE"));
193
194   ConstructorsClicked(0);
195 }
196
197 //=================================================================================
198 // function : ConstructorsClicked()
199 // purpose  : Radio button management
200 //=================================================================================
201 void TransformationGUI_ScaleDlg::ConstructorsClicked (int constructorId)
202 {
203   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
204
205   myPoint = GEOM::GEOM_Object::_nil();
206   LineEdit2->clear();
207   
208   switch (constructorId) {
209   case 0: // translation an object by dx, dy, dz
210     TextLabel3->setText(tr("GEOM_SCALE_FACTOR"));
211     TextLabel4->hide();
212     TextLabel5->hide();
213     SpinBox_FY->hide();
214     SpinBox_FZ->hide();
215
216     PushButton1->click();
217     break;
218   case 1: // translation an object by 2 points
219     TextLabel3->setText(tr("GEOM_SCALE_FACTOR_X"));
220     TextLabel4->show();
221     TextLabel5->show();
222     SpinBox_FY->show();
223     SpinBox_FZ->show();
224
225     PushButton1->click();
226     break;
227   default:
228     break;
229   }
230
231   qApp->processEvents();
232   updateGeometry();
233   resize(minimumSizeHint());
234
235   if (myInitial) {
236     myInitial = false;
237     SelectionIntoArgument();
238   }
239   else {
240     displayPreview();
241   }
242 }
243
244 //=================================================================================
245 // function : ClickOnOk()
246 // purpose  :
247 //=================================================================================
248 void TransformationGUI_ScaleDlg::ClickOnOk()
249 {
250   if (ClickOnApply())
251     ClickOnCancel();
252 }
253
254 //=================================================================================
255 // function : ClickOnApply()
256 // purpose  :
257 //=================================================================================
258 bool TransformationGUI_ScaleDlg::ClickOnApply()
259 {
260   if (!onAccept(CheckBoxCopy->isChecked()))
261     return false;
262
263   initName(tr("GEOM_SCALE"));
264
265   myObjects.length(0);
266   myEditCurrentArgument = LineEdit1;
267   myEditCurrentArgument->setText("");
268   myGeomGUI->getApp()->selectionMgr()->clearSelected();
269
270   // activate selection and connect selection manager
271   ConstructorsClicked(getConstructorId());
272   return true;
273 }
274
275 //=================================================================================
276 // function : SelectionIntoArgument()
277 // purpose  : Called when selection is changed or on dialog initialization or activation
278 //=================================================================================
279 void TransformationGUI_ScaleDlg::SelectionIntoArgument()
280 {
281   erasePreview();
282   myEditCurrentArgument->setText("");
283
284   if (myEditCurrentArgument == LineEdit1)
285     myObjects.length(0);
286   else if (myEditCurrentArgument == LineEdit2)
287     myPoint = GEOM::GEOM_Object::_nil();
288
289   LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
290   SALOME_ListIO aSelList;
291   aSelMgr->selectedObjects(aSelList);
292
293   QString aName;
294
295   if (myEditCurrentArgument == LineEdit1)
296   {
297     int aNbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName);
298     if (aNbSel < 1)
299       return;
300
301     GEOMBase::ConvertListOfIOInListOfGO(aSelList, myObjects);
302     if (!myObjects.length())
303       return;
304     else
305       myEditCurrentArgument->setText(aName);
306   }
307   else if (myEditCurrentArgument == LineEdit2)
308   {
309     GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil();
310     if (aSelList.Extent() == 1)
311     {
312       Standard_Boolean testResult = Standard_False;
313       aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
314       if (testResult)
315       {
316         aName = GEOMBase::GetName(aSelectedObject);
317
318         TopoDS_Shape aShape;
319         if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull())
320         {
321           TColStd_IndexedMapOfInteger aMap;
322           aSelMgr->GetIndexes(aSelList.First(), aMap);
323           if (aMap.Extent() == 1)
324           {
325             int anIndex = aMap(1);
326             aName += QString(":vertex_%1").arg(anIndex);
327
328             //Find SubShape Object in Father
329             GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName);
330
331             if (aFindedObject->_is_nil()) { // Object not found in study
332               GEOM::GEOM_IShapesOperations_var aShapesOp =
333                 getGeomEngine()->GetIShapesOperations(getStudyId());
334               aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
335             }
336             else
337               aSelectedObject = aFindedObject; // get Object from study
338           }
339           else // Global Selection
340           {
341             if (aShape.ShapeType() != TopAbs_VERTEX) {
342               aSelectedObject = GEOM::GEOM_Object::_nil();
343               aName = "";
344             }
345           }
346         }
347       }
348     }
349
350     myPoint = aSelectedObject;
351     myEditCurrentArgument->setText(aName);
352
353     if (!myPoint->_is_nil() && !myObjects.length())
354       PushButton1->click();
355   }
356
357   // clear selection
358   /*  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
359   myGeomGUI->getApp()->selectionMgr()->clearSelected();
360   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
361   this, SLOT(SelectionIntoArgument()));*/
362   // here commented, because multiple objects can be selected IPAL 21437
363
364   displayPreview();
365 }
366
367 //=================================================================================
368 // function : SetEditCurrentArgument()
369 // purpose  :
370 //=================================================================================
371 void TransformationGUI_ScaleDlg::SetEditCurrentArgument()
372 {
373   QPushButton* send = (QPushButton*)sender();
374
375   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
376   globalSelection();
377
378   if (send == PushButton1) {
379     myEditCurrentArgument = LineEdit1;
380
381     PushButton2->setDown(false);
382     LineEdit2->setEnabled(false);
383   }
384   else if (send == PushButton2) {
385     myEditCurrentArgument = LineEdit2;
386
387     localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
388
389     PushButton1->setDown(false);
390     LineEdit1->setEnabled(false);
391   }
392   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
393           this, SLOT(SelectionIntoArgument()));
394
395   // enable line edit
396   myEditCurrentArgument->setEnabled(true);
397   myEditCurrentArgument->setFocus();
398   // after setFocus(), because it will be setDown(false) when loses focus
399   send->setDown(true);
400
401   // seems we need it only to avoid preview disappearing, caused by selection mode change
402   displayPreview();
403 }
404
405 //=================================================================================
406 // function : LineEditReturnPressed()
407 // purpose  :
408 //=================================================================================
409 void TransformationGUI_ScaleDlg::LineEditReturnPressed()
410 {
411   QLineEdit* send = (QLineEdit*)sender();
412   if (send == LineEdit1 || send == LineEdit2)
413   {
414     myEditCurrentArgument = send;
415     GEOMBase_Skeleton::LineEditReturnPressed();
416   }
417 }
418
419 //=================================================================================
420 // function : ActivateThisDialog()
421 // purpose  :
422 //=================================================================================
423 void TransformationGUI_ScaleDlg::ActivateThisDialog()
424 {
425   GEOMBase_Skeleton::ActivateThisDialog();
426   connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
427            this, SLOT( SelectionIntoArgument() ) );
428
429   ConstructorsClicked( getConstructorId() );
430 }
431
432 //=================================================================================
433 // function : enterEvent()
434 // purpose  :
435 //=================================================================================
436 void TransformationGUI_ScaleDlg::enterEvent (QEvent*)
437 {
438   if (!mainFrame()->GroupConstructors->isEnabled())
439     ActivateThisDialog();
440 }
441
442 //=================================================================================
443 // function : ValueChangedInSpinBox()
444 // purpose  :
445 //=================================================================================
446 void TransformationGUI_ScaleDlg::ValueChangedInSpinBox()
447 {
448   displayPreview();
449 }
450
451 //=================================================================================
452 // function : SetDoubleSpinBoxStep()
453 // purpose  : Double spin box management
454 //=================================================================================
455 void TransformationGUI_ScaleDlg::SetDoubleSpinBoxStep(double step)
456 {
457   SpinBox_FX->setSingleStep(step);
458   SpinBox_FY->setSingleStep(step);
459   SpinBox_FZ->setSingleStep(step);
460 }
461
462 //=================================================================================
463 // function : createOperation
464 // purpose  :
465 //=================================================================================
466 GEOM::GEOM_IOperations_ptr TransformationGUI_ScaleDlg::createOperation()
467 {
468   return getGeomEngine()->GetITransformOperations(getStudyId());
469 }
470
471 //=================================================================================
472 // function : isValid
473 // purpose  :
474 //=================================================================================
475 bool TransformationGUI_ScaleDlg::isValid (QString& msg)
476 {
477   // && !myPoint->_is_nil()
478   if (getConstructorId() == 0) {
479     bool ok = SpinBox_FX->isValid( msg, !IsPreview() );
480     return myObjects.length() > 0 && fabs(SpinBox_FX->value()) > 0.00001 && ok;
481   }
482
483   bool ok = true;
484   ok = SpinBox_FX->isValid( msg, !IsPreview() ) && ok;
485   ok = SpinBox_FY->isValid( msg, !IsPreview() ) && ok;
486   ok = SpinBox_FZ->isValid( msg, !IsPreview() ) && ok;
487   return myObjects.length() > 0 &&
488     fabs(SpinBox_FX->value()) > 0.00001 &&
489     fabs(SpinBox_FY->value()) > 0.00001 &&
490     fabs(SpinBox_FZ->value()) > 0.00001 && ok;
491 }
492
493 //=================================================================================
494 // function : execute
495 // purpose  :
496 //=================================================================================
497 bool TransformationGUI_ScaleDlg::execute (ObjectList& objects)
498 {
499   bool toCreateCopy = IsPreview() || CheckBoxCopy->isChecked();
500
501   GEOM::GEOM_Object_var anObj;
502
503   GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation());
504
505   switch (getConstructorId())
506   {
507   case 0:
508     {
509       if (toCreateCopy)
510       {
511         for (int i = 0; i < myObjects.length(); i++)
512         {
513           anObj = anOper->ScaleShapeCopy(myObjects[i], myPoint, SpinBox_FX->value());
514           if (!anObj->_is_nil()) {
515             if(!IsPreview()) 
516               anObj->SetParameters(SpinBox_FX->text().toLatin1().constData());
517             objects.push_back(anObj._retn());
518           }
519         }
520       }
521       else
522       {
523         for (int i = 0; i < myObjects.length(); i++)
524         {
525           anObj = anOper->ScaleShape(myObjects[i], myPoint, SpinBox_FX->value());
526           if (!anObj->_is_nil())
527             objects.push_back(anObj._retn());
528         }
529       }
530     }
531     break;
532   case 1:
533     {
534       if (toCreateCopy)
535       {
536         for (int i = 0; i < myObjects.length(); i++)
537         {
538           anObj = anOper->ScaleShapeAlongAxesCopy(myObjects[i], myPoint, SpinBox_FX->value(),
539                                                   SpinBox_FY->value(), SpinBox_FZ->value());
540           if (!anObj->_is_nil())
541             if(!IsPreview()) {
542               QStringList aParameters;
543               aParameters<<SpinBox_FX->text();
544               aParameters<<SpinBox_FY->text();
545               aParameters<<SpinBox_FZ->text();
546               anObj->SetParameters(aParameters.join(":").toLatin1().constData());
547             }
548             objects.push_back(anObj._retn());
549         }
550       }
551       else
552       {
553         for (int i = 0; i < myObjects.length(); i++)
554         {
555           anObj = anOper->ScaleShapeAlongAxes(myObjects[i], myPoint, SpinBox_FX->value(),
556                                               SpinBox_FY->value(), SpinBox_FZ->value());
557           if (!anObj->_is_nil())
558             objects.push_back(anObj._retn());
559         }
560       }
561     }
562     break;
563   default:
564     break;
565   }
566
567   return true;
568 }
569
570 //=================================================================================
571 // function : restoreSubShapes
572 // purpose  :
573 //=================================================================================
574 void TransformationGUI_ScaleDlg::restoreSubShapes (SALOMEDS::Study_ptr   theStudy,
575                                                    SALOMEDS::SObject_ptr theSObject)
576 {
577   if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
578     // empty list of arguments means that all arguments should be restored
579     getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
580                                         /*theFindMethod=*/GEOM::FSM_Transformed,
581                                         /*theInheritFirstArg=*/true,
582                                         mainFrame()->CheckBoxAddPrefix->isChecked());
583   }
584 }
585
586 //=================================================================================
587 // function :  CreateCopyModeChanged()
588 // purpose  :
589 //=================================================================================
590 void TransformationGUI_ScaleDlg::CreateCopyModeChanged (bool isCreateCopy)
591 {
592   mainFrame()->GroupBoxName->setEnabled(isCreateCopy);
593 }
594
595 //=================================================================================
596 // function : addSubshapesToStudy
597 // purpose  : virtual method to add new SubObjects if local selection
598 //=================================================================================
599 void TransformationGUI_ScaleDlg::addSubshapesToStudy()
600 {
601   bool toCreateCopy = IsPreview() || CheckBoxCopy->isChecked();
602   if (toCreateCopy)
603   {
604     if (!myPoint->_is_nil())
605     {
606       QMap<QString, GEOM::GEOM_Object_var> objMap;
607       objMap[LineEdit2->text()] = myPoint;
608       addSubshapesToFather(objMap);
609     }
610   }
611 }