1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // GEOM GEOMGUI : GUI for Geometry component
23 // File : TransformationGUI_TranslationDlg.cxx
24 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
26 #include "TransformationGUI_TranslationDlg.h"
29 #include <GeometryGUI.h>
32 #include <SUIT_Session.h>
33 #include <SUIT_ResourceMgr.h>
34 #include <SalomeApp_Application.h>
35 #include <LightApp_SelectionMgr.h>
38 #include <TopoDS_Shape.hxx>
39 #include <TopoDS_Edge.hxx>
42 #include <TColStd_IndexedMapOfInteger.hxx>
43 #include <TopTools_IndexedMapOfShape.hxx>
45 #include <GEOMImpl_Types.hxx>
47 //=================================================================================
48 // class : TransformationGUI_TranslationDlg()
49 // purpose : Constructs a TransformationGUI_TranslationDlg 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_TranslationDlg::TransformationGUI_TranslationDlg
55 (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal, Qt::WindowFlags fl)
56 : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl),
59 SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
60 QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TRANSLATION_DXYZ")));
61 QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TRANSLATION_POINTS")));
62 QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TRANSLATION_VECTOR")));
63 QPixmap image3 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
65 setWindowTitle(tr("GEOM_TRANSLATION_TITLE"));
67 /***************************************************************/
68 mainFrame()->GroupConstructors->setTitle(tr("GEOM_TRANSLATION"));
69 mainFrame()->RadioButton1->setIcon(image0);
70 mainFrame()->RadioButton2->setIcon(image1);
71 mainFrame()->RadioButton3->setIcon(image2);
72 mainFrame()->RadioButton1->setChecked(true);
74 GroupPoints = new DlgRef_3Sel3Spin2Check(centralWidget());
75 GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
76 GroupPoints->TextLabel1->setText(tr("GEOM_OBJECTS"));
77 GroupPoints->TextLabel3->setText(tr("GEOM_POINT_I").arg(2));
78 GroupPoints->TextLabel4->setText(tr("GEOM_DX"));
79 GroupPoints->TextLabel5->setText(tr("GEOM_DY"));
80 GroupPoints->TextLabel6->setText(tr("GEOM_DZ"));
81 GroupPoints->PushButton1->setIcon(image3);
82 GroupPoints->PushButton2->setIcon(image3);
83 GroupPoints->PushButton3->setIcon(image3);
84 GroupPoints->CheckBox1->setText(tr("Activate Distance"));
85 GroupPoints->CheckBox2->setText(tr("GEOM_CREATE_COPY"));
87 QVBoxLayout* layout = new QVBoxLayout(centralWidget());
88 layout->setMargin(0); layout->setSpacing(6);
89 layout->addWidget(GroupPoints);
90 /***************************************************************/
92 setHelpFileName("translation_operation_page.html");
94 // Activate Create a Copy mode
95 GroupPoints->CheckBox2->setChecked(true);
96 CreateCopyModeChanged(true);
101 //=================================================================================
102 // function : ~TransformationGUI_TranslationDlg()
103 // purpose : Destroys the object and frees any allocated resources
104 //=================================================================================
105 TransformationGUI_TranslationDlg::~TransformationGUI_TranslationDlg()
107 // no need to delete child widgets, Qt does it all for us
110 //=================================================================================
113 //=================================================================================
114 void TransformationGUI_TranslationDlg::Init()
116 // Get setting of step value from file configuration
117 SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
118 double step = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100);
120 // min, max, step and decimals for spin boxes & initial values
121 initSpinBox(GroupPoints->SpinBox1, COORD_MIN, COORD_MAX, step, 3); // VSR: TODO: DBL_DIGITS_DISPLAY
122 initSpinBox(GroupPoints->SpinBox2, COORD_MIN, COORD_MAX, step, 3); // VSR: TODO: DBL_DIGITS_DISPLAY
123 initSpinBox(GroupPoints->SpinBox3, COORD_MIN, COORD_MAX, step, 3); // VSR: TODO: DBL_DIGITS_DISPLAY
125 GroupPoints->SpinBox1->setValue(0.0);
126 GroupPoints->SpinBox2->setValue(0.0);
127 GroupPoints->SpinBox3->setValue(0.0);
130 GroupPoints->LineEdit1->setReadOnly(true);
131 GroupPoints->LineEdit2->setReadOnly(true);
132 GroupPoints->LineEdit3->setReadOnly(true);
134 GroupPoints->LineEdit1->setText("");
135 GroupPoints->LineEdit2->setText("");
136 GroupPoints->LineEdit3->setText("");
138 myVector = myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
140 mainFrame()->GroupBoxPublish->show();
142 // signals and slots connections
143 connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
144 connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
146 connect(this, SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
148 connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
149 connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
150 connect(GroupPoints->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
152 connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); //@ Delete ?
154 connect(GroupPoints->SpinBox1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
155 connect(GroupPoints->SpinBox2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
156 connect(GroupPoints->SpinBox3, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
158 connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double)));
160 connect(GroupPoints->CheckBox1, SIGNAL(toggled(bool)), this, SLOT(ActivateDistanceChanged(bool)));
161 connect(GroupPoints->CheckBox2, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool)));
163 initName(tr("GEOM_TRANSLATION"));
165 ConstructorsClicked(0);
168 //=================================================================================
169 // function : SetDoubleSpinBoxStep()
170 // purpose : Double spin box management
171 //=================================================================================
172 void TransformationGUI_TranslationDlg::SetDoubleSpinBoxStep (double step)
174 GroupPoints->SpinBox1->setSingleStep(step);
175 GroupPoints->SpinBox2->setSingleStep(step);
176 GroupPoints->SpinBox3->setSingleStep(step);
179 //=================================================================================
180 // function : ConstructorsClicked()
181 // purpose : Radio button management
182 //=================================================================================
183 void TransformationGUI_TranslationDlg::ConstructorsClicked (int constructorId)
185 disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
187 switch (constructorId) {
188 case 0: // translation an object by dx, dy, dz
190 GroupPoints->ShowRows(1, 2, false);
191 GroupPoints->ShowRows(3, 5, true);
193 GroupPoints->TextLabel6->setText(tr("GEOM_DZ"));
194 GroupPoints->SpinBox3->setEnabled(true);
196 GroupPoints->CheckBox1->hide();
198 GroupPoints->PushButton1->click();
201 case 1: // translation an object by 2 points
203 GroupPoints->ShowRows(3, 5, false);
204 GroupPoints->ShowRows(0, 2, true);
206 GroupPoints->TextLabel6->setText(tr("GEOM_DZ"));
207 GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg(1));
208 GroupPoints->LineEdit2->clear();
209 GroupPoints->LineEdit3->clear();
210 GroupPoints->SpinBox3->setEnabled(true);
212 GroupPoints->CheckBox1->hide();
214 myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
216 GroupPoints->PushButton1->click();
219 case 2: // translation an object by vector
221 GroupPoints->ShowRows(0, 1, true);
222 GroupPoints->ShowRows(2, 4, false);
223 GroupPoints->ShowRows(5, 5, true);
225 GroupPoints->TextLabel6->setText(tr("GEOM_DISTANCE"));
226 GroupPoints->SpinBox3->setValue(0.0);
227 GroupPoints->SpinBox3->setEnabled(false);
228 GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
229 GroupPoints->LineEdit2->clear();
231 GroupPoints->CheckBox1->show();
233 myVector = GEOM::GEOM_Object::_nil();
234 ActivateDistanceChanged(GroupPoints->CheckBox1->isChecked());
236 GroupPoints->PushButton1->click();
241 qApp->processEvents();
243 resize(minimumSizeHint());
247 SelectionIntoArgument();
254 //=================================================================================
255 // function : ClickOnOk()
257 //=================================================================================
258 void TransformationGUI_TranslationDlg::ClickOnOk()
264 //=================================================================================
265 // function : ClickOnApply()
267 //=================================================================================
268 bool TransformationGUI_TranslationDlg::ClickOnApply()
270 if (!onAccept(GroupPoints->CheckBox2->isChecked()))
274 // activate selection and connect selection manager
275 ConstructorsClicked(getConstructorId());
279 //=================================================================================
280 // function : SelectionIntoArgument()
281 // purpose : Called when selection is changed or on dialog initialization or activation
282 //=================================================================================
283 void TransformationGUI_TranslationDlg::SelectionIntoArgument()
286 myEditCurrentArgument->setText("");
288 if (myEditCurrentArgument == GroupPoints->LineEdit1)
290 else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1)
291 myPoint1 = GEOM::GEOM_Object::_nil();
292 else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
293 myVector = GEOM::GEOM_Object::_nil();
294 else if (myEditCurrentArgument == GroupPoints->LineEdit3)
295 myPoint2 = GEOM::GEOM_Object::_nil();
297 LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
298 SALOME_ListIO aSelList;
299 aSelMgr->selectedObjects(aSelList);
303 if (myEditCurrentArgument == GroupPoints->LineEdit1) {
304 int aNbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName);
308 GEOMBase::ConvertListOfIOInListOfGO(aSelList, myObjects);
309 if (!myObjects.length())
312 myEditCurrentArgument->setText(aName);
314 // here we do not switch to the next field, because multiple objects can be selected
316 if (getConstructorId() == 1) {
317 if (myPoint1->_is_nil())
318 GroupPoints->PushButton2->click();
320 else if (getConstructorId() == 2) {
321 if (myVector->_is_nil())
322 GroupPoints->PushButton2->click();
328 if (aSelList.Extent() != 1)
332 Standard_Boolean testResult = Standard_False;
333 GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
335 if (!testResult || CORBA::is_nil(aSelectedObject))
338 aName = GEOMBase::GetName(aSelectedObject);
340 // Get Selected object if selected subshape
342 if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull())
344 TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
345 if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
346 aNeedType = TopAbs_EDGE;
348 TColStd_IndexedMapOfInteger aMap;
349 aSelMgr->GetIndexes(aSelList.First(), aMap);
350 if (aMap.Extent() == 1)
352 int anIndex = aMap(1);
353 if (aNeedType == TopAbs_EDGE)
354 aName += QString(":edge_%1").arg(anIndex);
356 aName += QString(":vertex_%1").arg(anIndex);
358 //Find SubShape Object in Father
359 GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName);
361 if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study
362 GEOM::GEOM_IShapesOperations_var aShapesOp =
363 getGeomEngine()->GetIShapesOperations(getStudyId());
364 aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
367 aSelectedObject = aFindedObject;
370 else // Global Selection
372 if (aShape.ShapeType() != aNeedType) {
373 aSelectedObject = GEOM::GEOM_Object::_nil();
379 myEditCurrentArgument->setText(aName);
381 if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1) {
382 myPoint1 = aSelectedObject;
383 if (!myPoint1->_is_nil() && myPoint2->_is_nil())
384 GroupPoints->PushButton3->click();
386 else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2) {
387 myVector = aSelectedObject;
388 if (!myVector->_is_nil() && !myObjects.length())
389 GroupPoints->PushButton1->click();
391 else if (myEditCurrentArgument == GroupPoints->LineEdit3) {
392 myPoint2 = aSelectedObject;
393 if (!myPoint2->_is_nil() && !myObjects.length())
394 GroupPoints->PushButton1->click();
399 disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
400 myGeomGUI->getApp()->selectionMgr()->clearSelected();
401 connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
402 this, SLOT(SelectionIntoArgument()));
407 //=================================================================================
408 // function : SetEditCurrentArgument()
410 //=================================================================================
411 void TransformationGUI_TranslationDlg::SetEditCurrentArgument()
413 QPushButton* send = (QPushButton*)sender();
415 disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
418 if (send == GroupPoints->PushButton1) {
419 myEditCurrentArgument = GroupPoints->LineEdit1;
421 GroupPoints->PushButton2->setDown(false);
422 GroupPoints->PushButton3->setDown(false);
423 GroupPoints->LineEdit2->setEnabled(false);
424 GroupPoints->LineEdit3->setEnabled(false);
426 else if (send == GroupPoints->PushButton2) {
427 myEditCurrentArgument = GroupPoints->LineEdit2;
429 GroupPoints->PushButton1->setDown(false);
430 GroupPoints->PushButton3->setDown(false);
431 GroupPoints->LineEdit1->setEnabled(false);
432 GroupPoints->LineEdit3->setEnabled(false);
434 if (getConstructorId() == 1)
435 localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
437 localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
439 else if (send == GroupPoints->PushButton3) {
440 myEditCurrentArgument = GroupPoints->LineEdit3;
442 GroupPoints->PushButton1->setDown(false);
443 GroupPoints->PushButton2->setDown(false);
444 GroupPoints->LineEdit1->setEnabled(false);
445 GroupPoints->LineEdit2->setEnabled(false);
447 localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
449 connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
450 this, SLOT(SelectionIntoArgument()));
453 myEditCurrentArgument->setEnabled(true);
454 myEditCurrentArgument->setFocus();
455 // after setFocus(), because it will be setDown(false) when loses focus
458 // seems we need it only to avoid preview disappearing, caused by selection mode change
462 //=================================================================================
463 // function : LineEditReturnPressed()
465 //=================================================================================
466 void TransformationGUI_TranslationDlg::LineEditReturnPressed()
468 QLineEdit* send = (QLineEdit*)sender();
469 if (send == GroupPoints->LineEdit1) {
470 myEditCurrentArgument = send;
471 GEOMBase_Skeleton::LineEditReturnPressed();
475 //=================================================================================
476 // function : ActivateThisDialog()
478 //=================================================================================
479 void TransformationGUI_TranslationDlg::ActivateThisDialog()
481 GEOMBase_Skeleton::ActivateThisDialog();
482 connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
483 this, SLOT( SelectionIntoArgument() ) );
485 ConstructorsClicked( getConstructorId() );
488 //=================================================================================
489 // function : enterEvent()
491 //=================================================================================
492 void TransformationGUI_TranslationDlg::enterEvent (QEvent*)
494 if (!mainFrame()->GroupConstructors->isEnabled())
495 ActivateThisDialog();
498 //=================================================================================
499 // function : ValueChangedInSpinBox()
501 //=================================================================================
502 void TransformationGUI_TranslationDlg::ValueChangedInSpinBox()
507 //=================================================================================
508 // function : createOperation
510 //=================================================================================
511 GEOM::GEOM_IOperations_ptr TransformationGUI_TranslationDlg::createOperation()
513 return getGeomEngine()->GetITransformOperations(getStudyId());
516 //=================================================================================
517 // function : isValid
519 //=================================================================================
520 bool TransformationGUI_TranslationDlg::isValid (QString& msg)
522 int aConstructorId = getConstructorId();
524 switch (aConstructorId) {
528 ok = GroupPoints->SpinBox1->isValid( msg, !IsPreview() ) && ok;
529 ok = GroupPoints->SpinBox2->isValid( msg, !IsPreview() ) && ok;
530 ok = GroupPoints->SpinBox3->isValid( msg, !IsPreview() ) && ok;
531 return myObjects.length() > 0 && ok;
534 return myObjects.length() > 0 && !(myPoint1->_is_nil() || myPoint2->_is_nil());
537 bool ok = GroupPoints->SpinBox3->isValid( msg, !IsPreview() );
538 return myObjects.length() > 0 && !(myVector->_is_nil()) && ok;
546 //=================================================================================
547 // function : execute
549 //=================================================================================
550 bool TransformationGUI_TranslationDlg::execute (ObjectList& objects)
553 bool toCreateCopy = IsPreview() || GroupPoints->CheckBox2->isChecked();
555 GEOM::GEOM_Object_var anObj;
557 switch (getConstructorId()) {
560 double dx = GroupPoints->SpinBox1->value();
561 double dy = GroupPoints->SpinBox2->value();
562 double dz = GroupPoints->SpinBox3->value();
564 QStringList aParameters;
565 aParameters<<GroupPoints->SpinBox1->text();
566 aParameters<<GroupPoints->SpinBox2->text();
567 aParameters<<GroupPoints->SpinBox3->text();
570 for (int i = 0; i < myObjects.length(); i++) {
571 myCurrObject = myObjects[i];
572 anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
573 TranslateDXDYDZCopy(myObjects[i], dx, dy, dz);
574 if (!anObj->_is_nil()) {
576 anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
577 objects.push_back(anObj._retn());
582 for (int i = 0; i < myObjects.length(); i++) {
583 myCurrObject = myObjects[i];
584 anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
585 TranslateDXDYDZ(myObjects[i], dx, dy, dz);
586 if (!anObj->_is_nil()) {
588 anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
589 updateAttributes(anObj, aParameters);
591 objects.push_back(anObj._retn());
601 for (int i = 0; i < myObjects.length(); i++) {
602 myCurrObject = myObjects[i];
603 anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
604 TranslateTwoPointsCopy(myObjects[i], myPoint1, myPoint2);
605 if (!anObj->_is_nil())
606 objects.push_back(anObj._retn());
610 for (int i = 0; i < myObjects.length(); i++) {
611 myCurrObject = myObjects[i];
612 anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
613 TranslateTwoPoints(myObjects[i], myPoint1, myPoint2);
614 if (!anObj->_is_nil())
615 objects.push_back(anObj._retn());
623 QStringList aParameters;
624 aParameters<<GroupPoints->SpinBox3->text();
625 bool byDistance = GroupPoints->CheckBox1->isChecked();
627 double aDistance = GroupPoints->SpinBox3->value();
628 for (int i = 0; i < myObjects.length(); i++) {
629 myCurrObject = myObjects[i];
630 anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
631 TranslateVectorDistance(myObjects[i], myVector, aDistance, toCreateCopy);
632 if (!anObj->_is_nil()) {
634 anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
636 updateAttributes(anObj, aParameters);
638 objects.push_back(anObj._retn());
644 for (int i = 0; i < myObjects.length(); i++) {
645 myCurrObject = myObjects[i];
646 anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
647 TranslateVectorCopy(myObjects[i], myVector);
648 if (!anObj->_is_nil())
649 objects.push_back(anObj._retn());
653 for (int i = 0; i < myObjects.length(); i++) {
654 myCurrObject = myObjects[i];
655 anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
656 TranslateVector(myObjects[i], myVector);
657 if (!anObj->_is_nil())
658 objects.push_back(anObj._retn());
669 //=================================================================================
670 // function : restoreSubShapes
672 //=================================================================================
673 void TransformationGUI_TranslationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
674 SALOMEDS::SObject_ptr theSObject)
676 if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
677 // we pass here the first operation argument (object) through the list of arguments
678 // because the rotation operation place its arguments in the data structure in another order,
679 // and we need to point the first argument directly
680 GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO;
682 anArgs[0] = myCurrObject;
683 getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
684 /*theFindMethod=*/GEOM::FSM_Transformed,
685 /*theInheritFirstArg=*/true);
689 //=================================================================================
690 // function : CreateCopyModeChanged()
692 //=================================================================================
693 void TransformationGUI_TranslationDlg::CreateCopyModeChanged (bool isCreateCopy)
695 mainFrame()->GroupBoxName->setEnabled(isCreateCopy);
698 //=================================================================================
699 // function : ActivateDistanceChanged()
701 //=================================================================================
702 void TransformationGUI_TranslationDlg::ActivateDistanceChanged (bool theEnable)
704 GroupPoints->SpinBox3->setEnabled(theEnable);
708 //=================================================================================
709 // function : addSubshapeToStudy
710 // purpose : virtual method to add new SubObjects if local selection
711 //=================================================================================
712 void TransformationGUI_TranslationDlg::addSubshapesToStudy()
714 bool toCreateCopy = IsPreview() || GroupPoints->CheckBox2->isChecked();
716 QMap<QString, GEOM::GEOM_Object_var> objMap;
718 switch (getConstructorId()) {
722 objMap[GroupPoints->LineEdit2->text()] = myPoint1;
723 objMap[GroupPoints->LineEdit3->text()] = myPoint2;
726 objMap[GroupPoints->LineEdit2->text()] = myVector;
729 addSubshapesToFather(objMap);