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()));*/
403 // here commented, because multiple objects can be selected IPAL 21437
408 //=================================================================================
409 // function : SetEditCurrentArgument()
411 //=================================================================================
412 void TransformationGUI_TranslationDlg::SetEditCurrentArgument()
414 QPushButton* send = (QPushButton*)sender();
416 disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
419 if (send == GroupPoints->PushButton1) {
420 myEditCurrentArgument = GroupPoints->LineEdit1;
422 GroupPoints->PushButton2->setDown(false);
423 GroupPoints->PushButton3->setDown(false);
424 GroupPoints->LineEdit2->setEnabled(false);
425 GroupPoints->LineEdit3->setEnabled(false);
427 else if (send == GroupPoints->PushButton2) {
428 myEditCurrentArgument = GroupPoints->LineEdit2;
430 GroupPoints->PushButton1->setDown(false);
431 GroupPoints->PushButton3->setDown(false);
432 GroupPoints->LineEdit1->setEnabled(false);
433 GroupPoints->LineEdit3->setEnabled(false);
435 if (getConstructorId() == 1)
436 localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
438 localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
440 else if (send == GroupPoints->PushButton3) {
441 myEditCurrentArgument = GroupPoints->LineEdit3;
443 GroupPoints->PushButton1->setDown(false);
444 GroupPoints->PushButton2->setDown(false);
445 GroupPoints->LineEdit1->setEnabled(false);
446 GroupPoints->LineEdit2->setEnabled(false);
448 localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
450 connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
451 this, SLOT(SelectionIntoArgument()));
454 myEditCurrentArgument->setEnabled(true);
455 myEditCurrentArgument->setFocus();
456 // after setFocus(), because it will be setDown(false) when loses focus
459 // seems we need it only to avoid preview disappearing, caused by selection mode change
463 //=================================================================================
464 // function : LineEditReturnPressed()
466 //=================================================================================
467 void TransformationGUI_TranslationDlg::LineEditReturnPressed()
469 QLineEdit* send = (QLineEdit*)sender();
470 if (send == GroupPoints->LineEdit1) {
471 myEditCurrentArgument = send;
472 GEOMBase_Skeleton::LineEditReturnPressed();
476 //=================================================================================
477 // function : ActivateThisDialog()
479 //=================================================================================
480 void TransformationGUI_TranslationDlg::ActivateThisDialog()
482 GEOMBase_Skeleton::ActivateThisDialog();
483 connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
484 this, SLOT( SelectionIntoArgument() ) );
486 ConstructorsClicked( getConstructorId() );
489 //=================================================================================
490 // function : enterEvent()
492 //=================================================================================
493 void TransformationGUI_TranslationDlg::enterEvent (QEvent*)
495 if (!mainFrame()->GroupConstructors->isEnabled())
496 ActivateThisDialog();
499 //=================================================================================
500 // function : ValueChangedInSpinBox()
502 //=================================================================================
503 void TransformationGUI_TranslationDlg::ValueChangedInSpinBox()
508 //=================================================================================
509 // function : createOperation
511 //=================================================================================
512 GEOM::GEOM_IOperations_ptr TransformationGUI_TranslationDlg::createOperation()
514 return getGeomEngine()->GetITransformOperations(getStudyId());
517 //=================================================================================
518 // function : isValid
520 //=================================================================================
521 bool TransformationGUI_TranslationDlg::isValid (QString& msg)
523 int aConstructorId = getConstructorId();
525 switch (aConstructorId) {
529 ok = GroupPoints->SpinBox1->isValid( msg, !IsPreview() ) && ok;
530 ok = GroupPoints->SpinBox2->isValid( msg, !IsPreview() ) && ok;
531 ok = GroupPoints->SpinBox3->isValid( msg, !IsPreview() ) && ok;
532 return myObjects.length() > 0 && ok;
535 return myObjects.length() > 0 && !(myPoint1->_is_nil() || myPoint2->_is_nil());
538 bool ok = GroupPoints->SpinBox3->isValid( msg, !IsPreview() );
539 return myObjects.length() > 0 && !(myVector->_is_nil()) && ok;
547 //=================================================================================
548 // function : execute
550 //=================================================================================
551 bool TransformationGUI_TranslationDlg::execute (ObjectList& objects)
554 bool toCreateCopy = IsPreview() || GroupPoints->CheckBox2->isChecked();
556 GEOM::GEOM_Object_var anObj;
558 GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation());
560 switch (getConstructorId()) {
563 double dx = GroupPoints->SpinBox1->value();
564 double dy = GroupPoints->SpinBox2->value();
565 double dz = GroupPoints->SpinBox3->value();
567 QStringList aParameters;
568 aParameters<<GroupPoints->SpinBox1->text();
569 aParameters<<GroupPoints->SpinBox2->text();
570 aParameters<<GroupPoints->SpinBox3->text();
573 for (int i = 0; i < myObjects.length(); i++) {
574 myCurrObject = myObjects[i];
575 anObj = anOper->TranslateDXDYDZCopy(myObjects[i], dx, dy, dz);
576 if (!anObj->_is_nil()) {
578 anObj->SetParameters(aParameters.join(":").toLatin1().constData());
579 objects.push_back(anObj._retn());
584 for (int i = 0; i < myObjects.length(); i++) {
585 myCurrObject = myObjects[i];
586 anObj = anOper->TranslateDXDYDZ(myObjects[i], dx, dy, dz);
587 if (!anObj->_is_nil()) {
589 anObj->SetParameters(aParameters.join(":").toLatin1().constData());
590 updateAttributes(anObj, aParameters);
592 objects.push_back(anObj._retn());
602 for (int i = 0; i < myObjects.length(); i++) {
603 myCurrObject = myObjects[i];
604 anObj = anOper->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 = anOper->TranslateTwoPoints(myObjects[i], myPoint1, myPoint2);
613 if (!anObj->_is_nil())
614 objects.push_back(anObj._retn());
622 QStringList aParameters;
623 aParameters<<GroupPoints->SpinBox3->text();
624 bool byDistance = GroupPoints->CheckBox1->isChecked();
626 double aDistance = GroupPoints->SpinBox3->value();
627 for (int i = 0; i < myObjects.length(); i++) {
628 myCurrObject = myObjects[i];
629 anObj = anOper->TranslateVectorDistance(myObjects[i], myVector, aDistance, toCreateCopy);
630 if (!anObj->_is_nil()) {
632 anObj->SetParameters(aParameters.join(":").toLatin1().constData());
634 updateAttributes(anObj, aParameters);
636 objects.push_back(anObj._retn());
642 for (int i = 0; i < myObjects.length(); i++) {
643 myCurrObject = myObjects[i];
644 anObj = anOper->TranslateVectorCopy(myObjects[i], myVector);
645 if (!anObj->_is_nil())
646 objects.push_back(anObj._retn());
650 for (int i = 0; i < myObjects.length(); i++) {
651 myCurrObject = myObjects[i];
652 anObj = anOper->TranslateVector(myObjects[i], myVector);
653 if (!anObj->_is_nil())
654 objects.push_back(anObj._retn());
665 //=================================================================================
666 // function : restoreSubShapes
668 //=================================================================================
669 void TransformationGUI_TranslationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
670 SALOMEDS::SObject_ptr theSObject)
672 if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
673 // we pass here the first operation argument (object) through the list of arguments
674 // because the rotation operation place its arguments in the data structure in another order,
675 // and we need to point the first argument directly
676 GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO;
678 anArgs[0] = myCurrObject;
679 getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
680 /*theFindMethod=*/GEOM::FSM_Transformed,
681 /*theInheritFirstArg=*/true,
682 mainFrame()->CheckBoxAddPrefix->isChecked());
686 //=================================================================================
687 // function : CreateCopyModeChanged()
689 //=================================================================================
690 void TransformationGUI_TranslationDlg::CreateCopyModeChanged (bool isCreateCopy)
692 mainFrame()->GroupBoxName->setEnabled(isCreateCopy);
695 //=================================================================================
696 // function : ActivateDistanceChanged()
698 //=================================================================================
699 void TransformationGUI_TranslationDlg::ActivateDistanceChanged (bool theEnable)
701 GroupPoints->SpinBox3->setEnabled(theEnable);
705 //=================================================================================
706 // function : addSubshapeToStudy
707 // purpose : virtual method to add new SubObjects if local selection
708 //=================================================================================
709 void TransformationGUI_TranslationDlg::addSubshapesToStudy()
711 bool toCreateCopy = IsPreview() || GroupPoints->CheckBox2->isChecked();
713 QMap<QString, GEOM::GEOM_Object_var> objMap;
715 switch (getConstructorId()) {
719 objMap[GroupPoints->LineEdit2->text()] = myPoint1;
720 objMap[GroupPoints->LineEdit3->text()] = myPoint2;
723 objMap[GroupPoints->LineEdit2->text()] = myVector;
726 addSubshapesToFather(objMap);