Salome HOME
IMP 0019918: Re-open popup for imported shapes. Enable for multiple selection.
[modules/geom.git] / src / TransformationGUI / TransformationGUI_ScaleDlg.cxx
1 //  GEOM GEOMGUI : GUI for Geometry component
2 //
3 //  Copyright (C) 2003  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 //
24 //  File   : TransformationGUI_ScaleDlg.cxx
25 //  Author : Lucien PIGNOLONI
26 //  Module : GEOM
27 //  $Header$
28
29 #include "TransformationGUI_ScaleDlg.h"
30
31 #include "SUIT_Desktop.h"
32 #include "SUIT_Session.h"
33 #include "SalomeApp_Application.h"
34 #include "LightApp_SelectionMgr.h"
35
36 #include <TopoDS_Shape.hxx>
37 #include <TopoDS.hxx>
38 #include <TopExp.hxx>
39 #include <TColStd_IndexedMapOfInteger.hxx>
40 #include <TopTools_IndexedMapOfShape.hxx>
41
42 #include "DlgRef_SpinBox.h"
43
44 #include <qlabel.h>
45 #include <qcheckbox.h>
46
47 #include "GEOMImpl_Types.hxx"
48
49 #include "utilities.h"
50
51 using namespace std;
52
53 //=================================================================================
54 // class    : TransformationGUI_ScaleDlg()
55 // purpose  : Constructs a TransformationGUI_ScaleDlg which is a child of 'parent', with the
56 //            name 'name' and widget flags set to 'f'.
57 //            The dialog will by default be modeless, unless you set 'modal' to
58 //            TRUE to construct a modal dialog.
59 //=================================================================================
60 TransformationGUI_ScaleDlg::TransformationGUI_ScaleDlg (GeometryGUI* theGeometryGUI, QWidget* parent,
61                                                         const char* name, bool modal, WFlags fl)
62   : GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
63                       WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
64 {
65   SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
66   QPixmap image1 (aResMgr->loadPixmap("GEOM",tr("ICON_DLG_SCALE")));
67   QPixmap image2 (aResMgr->loadPixmap("GEOM",tr("ICON_DLG_SCALE_ALONG_AXES")));
68   QPixmap image3 (aResMgr->loadPixmap("GEOM",tr("ICON_SELECT")));
69
70   setCaption(tr("GEOM_SCALE_TITLE"));
71
72   // Constructors
73   GroupConstructors->setTitle(tr("GEOM_SCALE"));
74   RadioButton1->setPixmap(image1);
75   RadioButton2->setPixmap(image2);
76   RadioButton3->close(TRUE);
77
78   // Own widgets
79   GroupBox1 = new QGroupBox (this, "GroupBox1");
80   GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
81   GroupBox1->setColumnLayout(0, Qt::Vertical);
82   GroupBox1->layout()->setSpacing(6);
83   GroupBox1->layout()->setMargin(11);
84
85   TextLabel1 = new QLabel (GroupBox1, "TextLabel1");
86   TextLabel1->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0,
87                                         0, 0, TextLabel1->sizePolicy().hasHeightForWidth()));
88
89   TextLabel2 = new QLabel (GroupBox1, "TextLabel2");
90   TextLabel2->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0,
91                                         0, 0, TextLabel2->sizePolicy().hasHeightForWidth()));
92
93   PushButton1 = new QPushButton(GroupBox1, "PushButton1");
94   PushButton1->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0,
95                                          0, 0, PushButton1->sizePolicy().hasHeightForWidth()));
96
97   PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
98   PushButton2->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0,
99                                          0, 0, PushButton2->sizePolicy().hasHeightForWidth()));
100
101   LineEdit1 = new QLineEdit (GroupBox1, "LineEdit1");
102   LineEdit2 = new QLineEdit (GroupBox1, "LineEdit2");
103
104   TextLabel3 = new QLabel (GroupBox1, "TextLabel3");
105   TextLabel3->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0,
106                                         0, 0, TextLabel3->sizePolicy().hasHeightForWidth()));
107
108   TextLabel4 = new QLabel (GroupBox1, "TextLabel4");
109   TextLabel4->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0,
110                                         0, 0, TextLabel3->sizePolicy().hasHeightForWidth()));
111
112   TextLabel5 = new QLabel (GroupBox1, "TextLabel5");
113   TextLabel5->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0,
114                                         0, 0, TextLabel3->sizePolicy().hasHeightForWidth()));
115
116   SpinBox_FX = new DlgRef_SpinBox(GroupBox1, "SpinBox_FX");
117   SpinBox_FY = new DlgRef_SpinBox(GroupBox1, "SpinBox_FY");
118   SpinBox_FZ = new DlgRef_SpinBox(GroupBox1, "SpinBox_FZ");
119
120   CheckBoxCopy = new QCheckBox (GroupBox1, "CheckBoxCopy");
121
122   QSpacerItem* spacer = new QSpacerItem(0, 316, QSizePolicy::Minimum, QSizePolicy::Expanding);
123
124   // Layouting
125   OwnLayout = new QGridLayout (0, 1, 1, 0, 6, "Layout1");
126
127   OwnLayout->addWidget(TextLabel1, 0, 0);
128   OwnLayout->addWidget(TextLabel2, 1, 0);
129
130   OwnLayout->addWidget(PushButton1, 0, 1);
131   OwnLayout->addWidget(PushButton2, 1, 1);
132
133   OwnLayout->addMultiCellWidget(LineEdit1, 0, 0, 2, 3);
134   OwnLayout->addMultiCellWidget(LineEdit2, 1, 1, 2, 3);
135
136   OwnLayout->addWidget(TextLabel3, 2, 0);
137   OwnLayout->addWidget(TextLabel4, 3, 0);
138   OwnLayout->addWidget(TextLabel5, 4, 0);
139
140   OwnLayout->addWidget(SpinBox_FX, 2, 2);
141   OwnLayout->addWidget(SpinBox_FY, 3, 2);
142   OwnLayout->addWidget(SpinBox_FZ, 4, 2);
143
144   OwnLayout->addMultiCellWidget(CheckBoxCopy, 5, 5, 0, 3);
145
146   OwnLayout->addItem(spacer, 6, 2);
147
148   GroupBox1Layout = new QGridLayout (GroupBox1->layout());
149   GroupBox1Layout->setAlignment(Qt::AlignTop);
150   GroupBox1Layout->addLayout(OwnLayout, 0, 0);
151
152   Layout1->addWidget(GroupBox1, 2, 0);
153
154   // Text and pictures for own widgets
155   TextLabel1->setText(tr("GEOM_OBJECTS"));
156   TextLabel2->setText(tr("GEOM_CENTRAL_POINT"));
157
158   PushButton1->setPixmap(image3);
159   PushButton2->setPixmap(image3);
160
161   LineEdit1->setReadOnly( true );
162   LineEdit2->setReadOnly( true );
163
164   TextLabel3->setText(tr("GEOM_SCALE_FACTOR"));
165   TextLabel4->setText(tr("GEOM_SCALE_FACTOR_Y"));
166   TextLabel5->setText(tr("GEOM_SCALE_FACTOR_Z"));
167
168   // Min, max, step and decimals for spin boxes & initial values
169   double aFactor = 2.0;
170   double SpecificStep = 0.5;
171   SpinBox_FX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
172   SpinBox_FY->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
173   SpinBox_FZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
174   SpinBox_FX->SetValue(aFactor);
175   SpinBox_FY->SetValue(aFactor);
176   SpinBox_FZ->SetValue(aFactor);
177
178   // Tab order
179   setTabOrder(PushButton1, LineEdit1);
180   setTabOrder(LineEdit1, PushButton2);
181   setTabOrder(PushButton2, LineEdit2);
182   setTabOrder(LineEdit2 , SpinBox_FX);
183   setTabOrder(SpinBox_FX, SpinBox_FY);
184   setTabOrder(SpinBox_FY, SpinBox_FZ);
185   setTabOrder(SpinBox_FZ, CheckBoxCopy);
186   setTabOrder(CheckBoxCopy, CheckBoxRestoreSS);
187
188   // Modification of an existing object by offset is not allowed
189   CheckBoxCopy->hide();
190
191   // Activate Create a Copy mode
192   CheckBoxCopy->setText(tr("GEOM_CREATE_COPY"));
193   CheckBoxCopy->setChecked(true);
194   CreateCopyModeChanged(true);
195
196   // Allowed inheritance of children and visual properties by the scaling result
197   GroupBoxPublish->show();
198
199   // Signals and slots connections
200   connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
201   connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
202   connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
203
204   connect(PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
205   connect(PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
206
207   connect(LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
208   connect(LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
209
210   connect(SpinBox_FX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
211   connect(SpinBox_FY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
212   connect(SpinBox_FZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
213
214   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), SpinBox_FX, SLOT(SetStep(double)));
215   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), SpinBox_FY, SLOT(SetStep(double)));
216   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), SpinBox_FZ, SLOT(SetStep(double)));
217
218   connect(CheckBoxCopy, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool)));
219
220   connect(myGeomGUI->getApp()->selectionMgr(),
221           SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
222
223   setHelpFileName("scale_operation_page.html");
224
225   Init();
226 }
227
228 //=================================================================================
229 // function : ~TransformationGUI_ScaleDlg()
230 // purpose  : Destroys the object and frees any allocated resources
231 //=================================================================================
232 TransformationGUI_ScaleDlg::~TransformationGUI_ScaleDlg()
233 {
234   /* no need to delete child widgets, Qt does it all for us */
235 }
236
237 //=================================================================================
238 // function : Init()
239 // purpose  :
240 //=================================================================================
241 void TransformationGUI_ScaleDlg::Init()
242 {
243   myEditCurrentArgument = LineEdit1;
244   LineEdit2->clear();
245
246   myPoint = GEOM::GEOM_Object::_nil();
247
248   initName(tr("GEOM_SCALE"));
249
250   ConstructorsClicked(0);
251 }
252
253 //=================================================================================
254 // function : ConstructorsClicked()
255 // purpose  : Radio button management
256 //=================================================================================
257 void TransformationGUI_ScaleDlg::ConstructorsClicked(int constructorId)
258 {
259   erasePreview();
260
261   switch (constructorId)
262   {
263   case 0: /* translation an object by dx, dy, dz */
264     TextLabel3->setText(tr("GEOM_SCALE_FACTOR"));
265     TextLabel4->hide();
266     TextLabel5->hide();
267     SpinBox_FY->hide();
268     SpinBox_FZ->hide();
269     resize(0,0);
270     break;
271   case 1: /* translation an object by 2 points */
272     TextLabel3->setText(tr("GEOM_SCALE_FACTOR_X"));
273     TextLabel4->show();
274     TextLabel5->show();
275     SpinBox_FY->show();
276     SpinBox_FZ->show();
277     resize(0,0);
278     break;
279   default:
280     break;
281   }
282
283   //qApp->processEvents();
284   //updateGeometry();
285   //resize(minimumSize());
286   displayPreview();
287 }
288
289 //=================================================================================
290 // function : ClickOnOk()
291 // purpose  :
292 //=================================================================================
293 void TransformationGUI_ScaleDlg::ClickOnOk()
294 {
295   if (ClickOnApply())
296     ClickOnCancel();
297 }
298
299 //=================================================================================
300 // function : ClickOnApply()
301 // purpose  :
302 //=================================================================================
303 bool TransformationGUI_ScaleDlg::ClickOnApply()
304 {
305   if (!onAccept(CheckBoxCopy->isChecked()))
306     return false;
307
308   //Init();
309   initName(tr("GEOM_SCALE"));
310   return true;
311 }
312
313 //=================================================================================
314 // function : SelectionIntoArgument()
315 // purpose  : Called when selection as changed or other case
316 //=================================================================================
317 void TransformationGUI_ScaleDlg::SelectionIntoArgument()
318 {
319   erasePreview();
320   myEditCurrentArgument->setText("");
321   QString aName;
322
323   if (myEditCurrentArgument == LineEdit1)
324   {
325     int aNbSel = GEOMBase::GetNameOfSelectedIObjects(selectedIO(), aName);
326     if (aNbSel < 1)
327     {
328       myObjects.length(0);
329       return;
330     }
331     GEOMBase::ConvertListOfIOInListOfGO(selectedIO(), myObjects);
332     if (!myObjects.length())
333       return;
334   }
335   else if (myEditCurrentArgument == LineEdit2)
336   {
337     GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil();
338     if (IObjectCount() == 1)
339     {
340       Standard_Boolean testResult = Standard_False;
341       aSelectedObject = GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult);
342       if (testResult)
343       {
344         aName = GEOMBase::GetName(aSelectedObject);
345
346         TopoDS_Shape aShape;
347         if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull())
348         {
349           LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
350           TColStd_IndexedMapOfInteger aMap;
351           aSelMgr->GetIndexes(firstIObject(), aMap);
352           if (aMap.Extent() == 1)
353           {
354             int anIndex = aMap( 1 );
355             aName += QString(":vertex_%1").arg(anIndex);
356
357             //Find SubShape Object in Father
358             GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName);
359
360             if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
361               GEOM::GEOM_IShapesOperations_var aShapesOp =
362                 getGeomEngine()->GetIShapesOperations( getStudyId() );
363               aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
364               aSelMgr->clearSelected();
365             }
366             else
367               aSelectedObject = aFindedObject; // get Object from study
368           }
369           else
370           {
371             if (aShape.ShapeType() != TopAbs_VERTEX) {
372               aSelectedObject = GEOM::GEOM_Object::_nil();
373               aName = "";
374             }
375           }
376         }
377       }
378     }
379
380     myPoint = aSelectedObject;
381   }
382
383   myEditCurrentArgument->setText(aName);
384   displayPreview();
385 }
386
387 //=================================================================================
388 // function : LineEditReturnPressed()
389 // purpose  :
390 //=================================================================================
391 void TransformationGUI_ScaleDlg::LineEditReturnPressed()
392 {
393   QLineEdit* send = (QLineEdit*)sender();
394   if (send == LineEdit1 || send == LineEdit2)
395   {
396     myEditCurrentArgument = send;
397     GEOMBase_Skeleton::LineEditReturnPressed();
398   }
399 }
400
401 //=================================================================================
402 // function : SetEditCurrentArgument()
403 // purpose  :
404 //=================================================================================
405 void TransformationGUI_ScaleDlg::SetEditCurrentArgument()
406 {
407   QPushButton* send = (QPushButton*)sender();
408   globalSelection();
409
410   if (send == PushButton1) {
411     myEditCurrentArgument = LineEdit1;
412   }
413   else if (send == PushButton2) {
414     myEditCurrentArgument = LineEdit2;
415     localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
416   }
417
418   myEditCurrentArgument->setFocus();
419   SelectionIntoArgument();
420 }
421
422 //=================================================================================
423 // function : ActivateThisDialog()
424 // purpose  :
425 //=================================================================================
426 void TransformationGUI_ScaleDlg::ActivateThisDialog()
427 {
428   GEOMBase_Skeleton::ActivateThisDialog();
429   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
430           this, SLOT(SelectionIntoArgument()));
431
432   globalSelection();
433   myEditCurrentArgument->setFocus();
434   if (myEditCurrentArgument == LineEdit2) {
435     localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
436   }
437 }
438
439 //=================================================================================
440 // function : enterEvent()
441 // purpose  :
442 //=================================================================================
443 void TransformationGUI_ScaleDlg::enterEvent (QEvent* e)
444 {
445   if (!GroupConstructors->isEnabled())
446     ActivateThisDialog();
447 }
448
449 //=================================================================================
450 // function : ValueChangedInSpinBox()
451 // purpose  :
452 //=================================================================================
453 void TransformationGUI_ScaleDlg::ValueChangedInSpinBox()
454 {
455   displayPreview();
456 }
457
458 //=================================================================================
459 // function : createOperation
460 // purpose  :
461 //=================================================================================
462 GEOM::GEOM_IOperations_ptr TransformationGUI_ScaleDlg::createOperation()
463 {
464   return myGeomGUI->GetGeomGen()->GetITransformOperations(getStudyId());
465 }
466
467 //=================================================================================
468 // function : isValid
469 // purpose  :
470 //=================================================================================
471 bool TransformationGUI_ScaleDlg::isValid (QString& msg)
472 {
473   if (myObjects.length() > 0 && fabs(SpinBox_FX->GetValue()) > 0.00001)
474   {
475     // && !myPoint->_is_nil()
476     if (getConstructorId() == 0)
477       return true;
478     if (fabs(SpinBox_FY->GetValue()) > 0.00001 &&
479         fabs(SpinBox_FZ->GetValue()) > 0.00001)
480       return true;
481   }
482   return false;
483 }
484
485 //=================================================================================
486 // function : execute
487 // purpose  :
488 //=================================================================================
489 bool TransformationGUI_ScaleDlg::execute (ObjectList& objects)
490 {
491   bool res = false;
492   bool toCreateCopy = IsPreview() || CheckBoxCopy->isChecked();
493
494   GEOM::GEOM_Object_var anObj;
495
496   switch (getConstructorId())
497   {
498   case 0:
499     {
500       if (toCreateCopy)
501       {
502         for (int i = 0; i < myObjects.length(); i++)
503         {
504           anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
505             ScaleShapeCopy(myObjects[i], myPoint, SpinBox_FX->GetValue());
506           if (!anObj->_is_nil())
507             objects.push_back(anObj._retn());
508         }
509       }
510       else
511       {
512         for (int i = 0; i < myObjects.length(); i++)
513         {
514           anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
515             ScaleShape(myObjects[i], myPoint, SpinBox_FX->GetValue());
516           if (!anObj->_is_nil())
517             objects.push_back(anObj._retn());
518         }
519       }
520     }
521     break;
522   case 1:
523     {
524       if (toCreateCopy)
525       {
526         for (int i = 0; i < myObjects.length(); i++)
527         {
528           anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
529             ScaleShapeAlongAxesCopy(myObjects[i], myPoint, SpinBox_FX->GetValue(),
530                                     SpinBox_FY->GetValue(), SpinBox_FZ->GetValue());
531           if (!anObj->_is_nil())
532             objects.push_back(anObj._retn());
533         }
534       }
535       else
536       {
537         for (int i = 0; i < myObjects.length(); i++)
538         {
539           anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
540             ScaleShapeAlongAxes(myObjects[i], myPoint, SpinBox_FX->GetValue(),
541                                 SpinBox_FY->GetValue(), SpinBox_FZ->GetValue());
542           if (!anObj->_is_nil())
543             objects.push_back(anObj._retn());
544         }
545       }
546     }
547     break;
548   default:
549     break;
550   }
551
552   res = true;
553   return res;
554 }
555
556 //=================================================================================
557 // function : restoreSubShapes
558 // purpose  :
559 //=================================================================================
560 void TransformationGUI_ScaleDlg::restoreSubShapes (SALOMEDS::Study_ptr   theStudy,
561                                                    SALOMEDS::SObject_ptr theSObject)
562 {
563   if (CheckBoxRestoreSS->isChecked()) {
564     // empty list of arguments means that all arguments should be restored
565     getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
566                                         /*theFindMethod=*/GEOM::FSM_Transformed,
567                                         /*theInheritFirstArg=*/true);
568   }
569 }
570
571 //=================================================================================
572 // function :  CreateCopyModeChanged()
573 // purpose  :
574 //=================================================================================
575 void TransformationGUI_ScaleDlg::CreateCopyModeChanged (bool isCreateCopy)
576 {
577   GroupBoxName->setEnabled(isCreateCopy);
578 }
579
580 //=================================================================================
581 // function : addSubshapesToStudy
582 // purpose  : virtual method to add new SubObjects if local selection
583 //=================================================================================
584 void TransformationGUI_ScaleDlg::addSubshapesToStudy()
585 {
586   bool toCreateCopy = IsPreview() || CheckBoxCopy->isChecked();
587   if (toCreateCopy)
588   {
589     if (!myPoint->_is_nil())
590     {
591       QMap<QString, GEOM::GEOM_Object_var> objMap;
592       objMap[LineEdit2->text()] = myPoint;
593       addSubshapesToFather(objMap);
594     }
595   }
596 }