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