Salome HOME
Update copyright information
[modules/geom.git] / src / TransformationGUI / TransformationGUI_MultiRotationDlg.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_MultiRotationDlg.cxx
24 // Author : Damien COQUERET, Open CASCADE S.A.S.
25 //
26 #include "TransformationGUI_MultiRotationDlg.h"
27
28 #include <DlgRef.h>
29 #include <GeometryGUI.h>
30 #include <GEOMBase.h>
31
32 #include <SUIT_Session.h>
33 #include <SUIT_ResourceMgr.h>
34 #include <SalomeApp_Application.h>
35 #include <LightApp_SelectionMgr.h>
36
37 // OCCT Includes
38 #include <TopoDS_Shape.hxx>
39 #include <TopoDS_Edge.hxx>
40 #include <TopoDS.hxx>
41 #include <TopExp.hxx>
42 #include <TColStd_IndexedMapOfInteger.hxx>
43 #include <TopTools_IndexedMapOfShape.hxx>
44
45 #include <GEOMImpl_Types.hxx>
46
47 //=================================================================================
48 // class    : TransformationGUI_MultiRotationDlg()
49 // purpose  : Constructs a TransformationGUI_MultiRotationDlg which is a child of 'parent', with the
50 //            name 'name' and widget flags set to 'f'.
51 //            The dialog will by default be modeless, unless you set 'modal' to
52 //            TRUE to construct a modal dialog.
53 //=================================================================================
54 TransformationGUI_MultiRotationDlg::TransformationGUI_MultiRotationDlg
55 (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal, Qt::WindowFlags fl)
56   : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl),
57     myInitial(true)
58 {
59   SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
60   QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_MULTIROTATION_SIMPLE")));
61   QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_MULTIROTATION_DOUBLE")));
62   QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
63
64   setWindowTitle(tr("GEOM_MULTIROTATION_TITLE"));
65
66   /***************************************************************/
67   mainFrame()->GroupConstructors->setTitle(tr("GEOM_MULTIROTATION"));
68   mainFrame()->RadioButton1->setIcon(image0);
69   mainFrame()->RadioButton2->setIcon(image1);
70   mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
71   mainFrame()->RadioButton3->close();
72
73   GroupPoints = new DlgRef_2Sel1Spin(centralWidget());
74   GroupPoints->GroupBox1->setTitle(tr("GEOM_MULTIROTATION_SIMPLE"));
75   GroupPoints->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
76   GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
77   GroupPoints->TextLabel3->setText(tr("GEOM_NB_TIMES"));
78   GroupPoints->PushButton1->setIcon(image2);
79   GroupPoints->PushButton2->setIcon(image2);
80   GroupPoints->LineEdit1->setReadOnly(true);
81   GroupPoints->LineEdit2->setReadOnly(true);
82
83   GroupDimensions = new DlgRef_2Sel4Spin1Check(centralWidget());
84   GroupDimensions->GroupBox1->setTitle(tr("GEOM_MULTIROTATION_DOUBLE"));
85   GroupDimensions->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
86   GroupDimensions->TextLabel2->setText(tr("GEOM_VECTOR"));
87   GroupDimensions->TextLabel3->setText(tr("GEOM_ANGLE"));
88   GroupDimensions->TextLabel4->setText(tr("GEOM_NB_TIMES"));
89   GroupDimensions->TextLabel5->setText(tr("GEOM_STEP"));
90   GroupDimensions->TextLabel6->setText(tr("GEOM_NB_TIMES"));
91   GroupDimensions->CheckButton1->setText(tr("GEOM_REVERSE"));
92   GroupDimensions->PushButton1->setIcon(image2);
93   GroupDimensions->PushButton2->setIcon(image2);
94   GroupDimensions->LineEdit1->setReadOnly(true);
95   GroupDimensions->LineEdit2->setReadOnly(true);
96
97   QVBoxLayout* layout = new QVBoxLayout(centralWidget());
98   layout->setMargin(0); layout->setSpacing(6);
99   layout->addWidget(GroupPoints);
100   layout->addWidget(GroupDimensions);
101   /***************************************************************/
102
103   setHelpFileName("multi_rotation_operation_page.html");
104
105   Init();
106 }
107
108 //=================================================================================
109 // function : ~TransformationGUI_MultiRotationDlg()
110 // purpose  : Destroys the object and frees any allocated resources
111 //=================================================================================
112 TransformationGUI_MultiRotationDlg::~TransformationGUI_MultiRotationDlg()
113 {
114   // no need to delete child widgets, Qt does it all for us
115 }
116
117 //=================================================================================
118 // function : Init()
119 // purpose  :
120 //=================================================================================
121 void TransformationGUI_MultiRotationDlg::Init()
122 {
123   // Get setting of step value from file configuration
124   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
125   double step = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100);
126
127   double SpecificStep1 = 5;
128   double SpecificStep2 = 1;
129   // min, max, step and decimals for spin boxes & initial values
130   initSpinBox(GroupPoints->SpinBox_DX, 1.0, MAX_NUMBER, SpecificStep2, 10);
131   GroupPoints->SpinBox_DX->setValue(myNbTimes1);
132   GroupPoints->SpinBox_DX->setDecimals(0);
133
134   initSpinBox(GroupDimensions->SpinBox_DX1, COORD_MIN, COORD_MAX, SpecificStep1, 10); // VSR: TODO: DBL_DIGITS_DISPLAY
135   initSpinBox(GroupDimensions->SpinBox_DY1, 1.0, MAX_NUMBER, SpecificStep2, 10);
136   initSpinBox(GroupDimensions->SpinBox_DX2, COORD_MIN, COORD_MAX, step, 10); // VSR: TODO: DBL_DIGITS_DISPLAY
137   initSpinBox(GroupDimensions->SpinBox_DY2, 1.0, MAX_NUMBER, SpecificStep2, 10);
138   GroupDimensions->SpinBox_DX1->setValue(myAng);
139   GroupDimensions->SpinBox_DY1->setValue(myNbTimes1);
140   GroupDimensions->SpinBox_DX2->setValue(myStep);
141   GroupDimensions->SpinBox_DY2->setValue(myNbTimes2);
142   GroupDimensions->SpinBox_DY1->setDecimals(0);
143   GroupDimensions->SpinBox_DY2->setDecimals(0);
144
145   // init variables
146   myAng = 45.0;
147   myStep = 50.0;
148   myNbTimes1 = myNbTimes2 = 2;
149
150   GroupPoints->LineEdit1->setText("");
151   GroupPoints->LineEdit2->setText("");
152
153   GroupDimensions->LineEdit1->setText("");
154   GroupDimensions->LineEdit2->setText("");
155
156   myBase = myVector = GEOM::GEOM_Object::_nil();
157
158   // signals and slots connections
159   connect(buttonOk(),    SIGNAL(clicked()), this, SLOT(ClickOnOk()));
160   connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
161
162   connect(this,          SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
163
164   connect(GroupPoints->PushButton1,     SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
165   connect(GroupPoints->PushButton2,     SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
166   connect(GroupDimensions->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
167   connect(GroupDimensions->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
168
169   connect(GroupPoints->LineEdit1,     SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
170   connect(GroupPoints->LineEdit2,     SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
171   connect(GroupDimensions->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
172   connect(GroupDimensions->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
173
174   connect(GroupPoints->SpinBox_DX,      SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
175   connect(GroupDimensions->SpinBox_DX1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
176   connect(GroupDimensions->SpinBox_DY1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
177   connect(GroupDimensions->SpinBox_DX2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
178   connect(GroupDimensions->SpinBox_DY2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
179
180   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double)));
181
182   connect(GroupDimensions->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseAngle()));
183
184   initName(tr("GEOM_MULTIROTATION"));
185
186   ConstructorsClicked(0);
187 }
188
189 //=================================================================================
190 // function : SetDoubleSpinBoxStep()
191 // purpose  : Double spin box management
192 //=================================================================================
193 void TransformationGUI_MultiRotationDlg::SetDoubleSpinBoxStep (double step)
194 {
195   GroupPoints->SpinBox_DX->setSingleStep(step);
196   GroupDimensions->SpinBox_DX1->setSingleStep(step);
197   GroupDimensions->SpinBox_DY1->setSingleStep(step);
198   GroupDimensions->SpinBox_DX2->setSingleStep(step);
199   GroupDimensions->SpinBox_DY2->setSingleStep(step);
200 }
201
202 //=================================================================================
203 // function : ConstructorsClicked()
204 // purpose  : Radio button management
205 //=================================================================================
206 void TransformationGUI_MultiRotationDlg::ConstructorsClicked (int constructorId)
207 {
208   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
209
210   switch (constructorId) {
211   case 0: // Rotate simple
212     {
213       GroupDimensions->hide();
214       GroupPoints->show();
215
216       GroupPoints->LineEdit1->setText("");
217       GroupPoints->LineEdit2->setText("");
218       myBase = myVector = GEOM::GEOM_Object::_nil();
219
220       GroupPoints->SpinBox_DX->setValue(myNbTimes1);
221
222       GroupPoints->PushButton1->click();
223     }
224     break;
225   case 1: // Rotate double
226     {
227       GroupPoints->hide();
228       GroupDimensions->show();
229
230       GroupDimensions->LineEdit1->setText("");
231       GroupDimensions->LineEdit2->setText("");
232       myBase = myVector = GEOM::GEOM_Object::_nil();
233
234       GroupDimensions->SpinBox_DX1->setValue(myAng);
235       GroupDimensions->SpinBox_DY1->setValue(myNbTimes1);
236       GroupDimensions->SpinBox_DX2->setValue(myStep);
237       GroupDimensions->SpinBox_DY2->setValue(myNbTimes2);
238
239       GroupDimensions->PushButton1->click();
240     }
241     break;
242   }
243
244   qApp->processEvents();
245   updateGeometry();
246   resize(minimumSize());
247
248   if (myInitial) {
249     myInitial = false;
250     SelectionIntoArgument();
251   }
252   else {
253     displayPreview();
254   }
255 }
256
257 //=================================================================================
258 // function : ClickOnOk()
259 // purpose  :
260 //=================================================================================
261 void TransformationGUI_MultiRotationDlg::ClickOnOk()
262 {
263   if (ClickOnApply())
264     ClickOnCancel();
265 }
266
267 //=================================================================================
268 // function : ClickOnApply()
269 // purpose  :
270 //=================================================================================
271 bool TransformationGUI_MultiRotationDlg::ClickOnApply()
272 {
273   if (!onAccept())
274     return false;
275
276   initName();
277   // activate selection and connect selection manager
278   ConstructorsClicked(getConstructorId());
279   return true;
280 }
281
282 //=================================================================================
283 // function : SelectionIntoArgument()
284 // purpose  : Called when selection is changed or on dialog initialization or activation
285 //=================================================================================
286 void TransformationGUI_MultiRotationDlg::SelectionIntoArgument()
287 {
288   erasePreview();
289   myEditCurrentArgument->setText("");
290
291   if (myEditCurrentArgument == GroupPoints->LineEdit1 ||
292       myEditCurrentArgument == GroupDimensions->LineEdit1)
293     myBase = GEOM::GEOM_Object::_nil();
294   else if (myEditCurrentArgument == GroupPoints->LineEdit2 ||
295            myEditCurrentArgument == GroupDimensions->LineEdit2)
296     myVector = GEOM::GEOM_Object::_nil();
297
298   LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
299   SALOME_ListIO aSelList;
300   aSelMgr->selectedObjects(aSelList);
301
302   if (aSelList.Extent() != 1)
303     return;
304
305   // nbSel == 1
306   Standard_Boolean testResult = Standard_False;;
307   GEOM::GEOM_Object_var aSelectedObject =
308     GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
309
310   if (!testResult || CORBA::is_nil(aSelectedObject) || !GEOMBase::IsShape(aSelectedObject))
311     return;
312
313   QString aName = GEOMBase::GetName(aSelectedObject);
314
315   if (myEditCurrentArgument == GroupPoints->LineEdit1 ||
316       myEditCurrentArgument == GroupDimensions->LineEdit1)
317     myBase = aSelectedObject;
318   else if (myEditCurrentArgument == GroupPoints->LineEdit2 ||
319            myEditCurrentArgument == GroupDimensions->LineEdit2) {
320     TopoDS_Shape aShape;
321
322     if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull()) {
323       TColStd_IndexedMapOfInteger aMap;
324       aSelMgr->GetIndexes(aSelList.First(), aMap);
325       if (aMap.Extent() == 1) {
326         int anIndex = aMap(1);
327         aName += QString(":edge_%1").arg(anIndex);
328
329         //Find SubShape Object in Father
330         GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName);
331
332         if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study
333           GEOM::GEOM_IShapesOperations_var aShapesOp =
334             getGeomEngine()->GetIShapesOperations(getStudyId());
335           myVector = aShapesOp->GetSubShape(aSelectedObject, anIndex);
336         }
337         else {
338           myVector = aFindedObject; // get existing object
339         }
340       }
341       else {
342         if (aShape.ShapeType() != TopAbs_EDGE) {
343           aSelectedObject = GEOM::GEOM_Object::_nil();
344           aName = "";
345         }
346         myVector = aSelectedObject;
347       }
348     }
349   }
350   myEditCurrentArgument->setText(aName);
351
352   if (myEditCurrentArgument == GroupPoints->LineEdit1) {
353     if (!myBase->_is_nil() && myVector->_is_nil())
354       GroupPoints->PushButton2->click();
355   }
356   else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
357     if (!myVector->_is_nil() && myBase->_is_nil())
358       GroupPoints->PushButton1->click();
359   }
360   else if (myEditCurrentArgument == GroupDimensions->LineEdit1) {
361     if (!myBase->_is_nil() && myVector->_is_nil())
362       GroupDimensions->PushButton2->click();
363   }
364   else if (myEditCurrentArgument == GroupDimensions->LineEdit2) {
365     if (!myVector->_is_nil() && myBase->_is_nil())
366       GroupDimensions->PushButton1->click();
367   }
368
369   // clear selection
370   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
371   myGeomGUI->getApp()->selectionMgr()->clearSelected();
372   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
373           this, SLOT(SelectionIntoArgument()));
374
375   displayPreview();
376 }
377
378 //=================================================================================
379 // function : SetEditCurrentArgument()
380 // purpose  :
381 //=================================================================================
382 void TransformationGUI_MultiRotationDlg::SetEditCurrentArgument()
383 {
384   QPushButton* send = (QPushButton*)sender();
385
386   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
387   globalSelection(GEOM_ALLSHAPES);
388
389   if (send == GroupPoints->PushButton1) {
390     myEditCurrentArgument = GroupPoints->LineEdit1;
391
392     GroupPoints->PushButton2->setDown(false);
393     GroupPoints->LineEdit2->setEnabled(false);
394   }
395   else if (send == GroupPoints->PushButton2) {
396     myEditCurrentArgument = GroupPoints->LineEdit2;
397
398     localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
399
400     GroupPoints->PushButton1->setDown(false);
401     GroupPoints->LineEdit1->setEnabled(false);
402   }
403   else if (send == GroupDimensions->PushButton1) {
404     myEditCurrentArgument = GroupDimensions->LineEdit1;
405
406     GroupDimensions->PushButton2->setDown(false);
407     GroupDimensions->LineEdit2->setEnabled(false);
408   }
409   else if (send == GroupDimensions->PushButton2) {
410     myEditCurrentArgument = GroupDimensions->LineEdit2;
411
412     localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
413
414     GroupDimensions->PushButton1->setDown(false);
415     GroupDimensions->LineEdit1->setEnabled(false);
416   }
417   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
418           this, SLOT(SelectionIntoArgument()));
419
420   // enable line edit
421   myEditCurrentArgument->setEnabled(true);
422   myEditCurrentArgument->setFocus();
423   // after setFocus(), because it will be setDown(false) when loses focus
424   send->setDown(true);
425
426   // seems we need it only to avoid preview disappearing, caused by selection mode change
427   displayPreview();
428 }
429
430 //=================================================================================
431 // function : LineEditReturnPressed()
432 // purpose  :
433 //=================================================================================
434 void TransformationGUI_MultiRotationDlg::LineEditReturnPressed()
435 {
436   QLineEdit* send = (QLineEdit*)sender();
437   if (send == GroupPoints->LineEdit1 || send == GroupDimensions->LineEdit1 ||
438       send == GroupPoints->LineEdit2 || send == GroupDimensions->LineEdit2) {
439     myEditCurrentArgument = send;
440     GEOMBase_Skeleton::LineEditReturnPressed();
441   }
442 }
443
444 //=================================================================================
445 // function : ActivateThisDialog()
446 // purpose  :
447 //=================================================================================
448 void TransformationGUI_MultiRotationDlg::ActivateThisDialog()
449 {
450   GEOMBase_Skeleton::ActivateThisDialog();
451   connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
452            this, SLOT( SelectionIntoArgument() ) );
453
454   ConstructorsClicked( getConstructorId() );
455 }
456
457 //=================================================================================
458 // function : enterEvent()
459 // purpose  :
460 //=================================================================================
461 void TransformationGUI_MultiRotationDlg::enterEvent (QEvent*)
462 {
463   if (!mainFrame()->GroupConstructors->isEnabled())
464     ActivateThisDialog();
465 }
466
467 //=================================================================================
468 // function : ValueChangedInSpinBox()
469 // purpose  :
470 //=================================================================================
471 void TransformationGUI_MultiRotationDlg::ValueChangedInSpinBox (double newValue)
472 {
473   QObject* send = (QObject*)sender();
474
475   if (send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DY1)
476     myNbTimes1 = (int)newValue;
477   else if (send == GroupDimensions->SpinBox_DX1)
478     myAng = newValue;
479   else if (send == GroupDimensions->SpinBox_DX2)
480     myStep = newValue;
481   else if (send == GroupDimensions->SpinBox_DY2)
482     myNbTimes2 = (int)newValue;
483
484   displayPreview();
485 }
486
487 //=================================================================================
488 // function : ReverseAngle()
489 // purpose  : 'state' not used here
490 //=================================================================================
491 void TransformationGUI_MultiRotationDlg::ReverseAngle()
492 {
493   myAng = -myAng;
494
495   int aConstructorId = getConstructorId();
496
497   if (aConstructorId == 0)
498     GroupPoints->SpinBox_DX->setValue(myAng);
499   else if (aConstructorId == 1)
500     GroupDimensions->SpinBox_DX1->setValue(myAng);
501
502   displayPreview();
503 }
504
505 //=================================================================================
506 // function : createOperation
507 // purpose  :
508 //=================================================================================
509 GEOM::GEOM_IOperations_ptr TransformationGUI_MultiRotationDlg::createOperation()
510 {
511   return getGeomEngine()->GetITransformOperations(getStudyId());
512 }
513
514 //=================================================================================
515 // function : isValid
516 // purpose  :
517 //=================================================================================
518 bool TransformationGUI_MultiRotationDlg::isValid (QString& /*msg*/)
519 {
520   return !(myBase->_is_nil() || myVector->_is_nil());
521 }
522
523 //=================================================================================
524 // function : execute
525 // purpose  :
526 //=================================================================================
527 bool TransformationGUI_MultiRotationDlg::execute (ObjectList& objects)
528 {
529   bool res = false;
530
531   GEOM::GEOM_Object_var anObj;
532
533   switch (getConstructorId()) {
534   case 0:
535     if (!CORBA::is_nil(myBase) && !CORBA::is_nil(myVector)) {
536       anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
537         MultiRotate1D(myBase, myVector, myNbTimes1);
538       res = true;
539     }
540     break;
541   case 1:
542     if (!CORBA::is_nil(myBase) && !CORBA::is_nil(myVector)) {
543       anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
544         MultiRotate2D(myBase, myVector, myAng, myNbTimes1, myStep, myNbTimes2);
545       res = true;
546     }
547     break;
548   }
549
550   if (!anObj->_is_nil())
551     objects.push_back(anObj._retn());
552
553   return res;
554 }
555
556 //=================================================================================
557 // function : addSubshapeToStudy
558 // purpose  : virtual method to add new SubObjects if local selection
559 //=================================================================================
560 void TransformationGUI_MultiRotationDlg::addSubshapesToStudy()
561 {
562   QMap<QString, GEOM::GEOM_Object_var> objMap;
563
564   switch (getConstructorId()) {
565   case 0:
566     objMap[GroupPoints->LineEdit2->text()] = myVector;
567     break;
568   case 1:
569     objMap[GroupDimensions->LineEdit2->text()] = myVector;
570     break;
571   }
572   addSubshapesToFather(objMap);
573 }