1 // Copyright (C) 2007-2010 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
23 // GEOM GEOMGUI : GUI for Geometry component
24 // File : TransformationGUI_TranslationDlg.cxx
25 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
27 #include "TransformationGUI_TranslationDlg.h"
30 #include <GeometryGUI.h>
33 #include <SUIT_Session.h>
34 #include <SUIT_ResourceMgr.h>
35 #include <SalomeApp_Application.h>
36 #include <LightApp_SelectionMgr.h>
39 #include <TopoDS_Shape.hxx>
40 #include <TopoDS_Edge.hxx>
43 #include <TColStd_IndexedMapOfInteger.hxx>
44 #include <TopTools_IndexedMapOfShape.hxx>
46 #include <GEOMImpl_Types.hxx>
48 //=================================================================================
49 // class : TransformationGUI_TranslationDlg()
50 // purpose : Constructs a TransformationGUI_TranslationDlg which is a child of 'parent', with the
51 // name 'name' and widget flags set to 'f'.
52 // The dialog will by default be modeless, unless you set 'modal' to
53 // TRUE to construct a modal dialog.
54 //=================================================================================
55 TransformationGUI_TranslationDlg::TransformationGUI_TranslationDlg
56 (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal, Qt::WindowFlags fl)
57 : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl),
60 SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
61 QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TRANSLATION_DXYZ")));
62 QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TRANSLATION_POINTS")));
63 QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TRANSLATION_VECTOR")));
64 QPixmap image3 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
66 setWindowTitle(tr("GEOM_TRANSLATION_TITLE"));
68 /***************************************************************/
69 mainFrame()->GroupConstructors->setTitle(tr("GEOM_TRANSLATION"));
70 mainFrame()->RadioButton1->setIcon(image0);
71 mainFrame()->RadioButton2->setIcon(image1);
72 mainFrame()->RadioButton3->setIcon(image2);
73 mainFrame()->RadioButton1->setChecked(true);
75 GroupPoints = new DlgRef_3Sel3Spin2Check(centralWidget());
76 GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
77 GroupPoints->TextLabel1->setText(tr("GEOM_OBJECTS"));
78 GroupPoints->TextLabel3->setText(tr("GEOM_POINT_I").arg(2));
79 GroupPoints->TextLabel4->setText(tr("GEOM_DX"));
80 GroupPoints->TextLabel5->setText(tr("GEOM_DY"));
81 GroupPoints->TextLabel6->setText(tr("GEOM_DZ"));
82 GroupPoints->PushButton1->setIcon(image3);
83 GroupPoints->PushButton2->setIcon(image3);
84 GroupPoints->PushButton3->setIcon(image3);
85 GroupPoints->CheckBox1->setText(tr("Activate Distance"));
86 GroupPoints->CheckBox2->setText(tr("GEOM_CREATE_COPY"));
88 QVBoxLayout* layout = new QVBoxLayout(centralWidget());
89 layout->setMargin(0); layout->setSpacing(6);
90 layout->addWidget(GroupPoints);
91 /***************************************************************/
93 setHelpFileName("translation_operation_page.html");
95 // Activate Create a Copy mode
96 GroupPoints->CheckBox2->setChecked(true);
97 CreateCopyModeChanged(true);
102 //=================================================================================
103 // function : ~TransformationGUI_TranslationDlg()
104 // purpose : Destroys the object and frees any allocated resources
105 //=================================================================================
106 TransformationGUI_TranslationDlg::~TransformationGUI_TranslationDlg()
108 // no need to delete child widgets, Qt does it all for us
111 //=================================================================================
114 //=================================================================================
115 void TransformationGUI_TranslationDlg::Init()
117 // Get setting of step value from file configuration
118 SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
119 double step = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100);
121 // min, max, step and decimals for spin boxes & initial values
122 initSpinBox(GroupPoints->SpinBox1, COORD_MIN, COORD_MAX, step, "length_precision" );
123 initSpinBox(GroupPoints->SpinBox2, COORD_MIN, COORD_MAX, step, "length_precision" );
124 initSpinBox(GroupPoints->SpinBox3, COORD_MIN, COORD_MAX, step, "length_precision" );
126 GroupPoints->SpinBox1->setValue(0.0);
127 GroupPoints->SpinBox2->setValue(0.0);
128 GroupPoints->SpinBox3->setValue(0.0);
131 GroupPoints->LineEdit1->setReadOnly(true);
132 GroupPoints->LineEdit2->setReadOnly(true);
133 GroupPoints->LineEdit3->setReadOnly(true);
135 GroupPoints->LineEdit1->setText("");
136 GroupPoints->LineEdit2->setText("");
137 GroupPoints->LineEdit3->setText("");
139 myVector = myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
141 mainFrame()->GroupBoxPublish->show();
143 // signals and slots connections
144 connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
145 connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
147 connect(this, SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
149 connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
150 connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
151 connect(GroupPoints->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
153 connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); //@ Delete ?
155 connect(GroupPoints->SpinBox1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
156 connect(GroupPoints->SpinBox2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
157 connect(GroupPoints->SpinBox3, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
159 connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double)));
161 connect(GroupPoints->CheckBox1, SIGNAL(toggled(bool)), this, SLOT(ActivateDistanceChanged(bool)));
162 connect(GroupPoints->CheckBox2, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool)));
164 initName(tr("GEOM_TRANSLATION"));
166 ConstructorsClicked(0);
169 //=================================================================================
170 // function : SetDoubleSpinBoxStep()
171 // purpose : Double spin box management
172 //=================================================================================
173 void TransformationGUI_TranslationDlg::SetDoubleSpinBoxStep (double step)
175 GroupPoints->SpinBox1->setSingleStep(step);
176 GroupPoints->SpinBox2->setSingleStep(step);
177 GroupPoints->SpinBox3->setSingleStep(step);
180 //=================================================================================
181 // function : ConstructorsClicked()
182 // purpose : Radio button management
183 //=================================================================================
184 void TransformationGUI_TranslationDlg::ConstructorsClicked (int constructorId)
186 disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
188 switch (constructorId) {
189 case 0: // translation an object by dx, dy, dz
191 GroupPoints->ShowRows(1, 2, false);
192 GroupPoints->ShowRows(3, 5, true);
194 GroupPoints->TextLabel6->setText(tr("GEOM_DZ"));
195 GroupPoints->SpinBox3->setEnabled(true);
197 GroupPoints->CheckBox1->hide();
199 GroupPoints->PushButton1->click();
202 case 1: // translation an object by 2 points
204 GroupPoints->ShowRows(3, 5, false);
205 GroupPoints->ShowRows(0, 2, true);
207 GroupPoints->TextLabel6->setText(tr("GEOM_DZ"));
208 GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg(1));
209 GroupPoints->LineEdit2->clear();
210 GroupPoints->LineEdit3->clear();
211 GroupPoints->SpinBox3->setEnabled(true);
213 GroupPoints->CheckBox1->hide();
215 myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
217 GroupPoints->PushButton1->click();
220 case 2: // translation an object by vector
222 GroupPoints->ShowRows(0, 1, true);
223 GroupPoints->ShowRows(2, 4, false);
224 GroupPoints->ShowRows(5, 5, true);
226 GroupPoints->TextLabel6->setText(tr("GEOM_DISTANCE"));
227 GroupPoints->SpinBox3->setValue(0.0);
228 GroupPoints->SpinBox3->setEnabled(false);
229 GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
230 GroupPoints->LineEdit2->clear();
232 GroupPoints->CheckBox1->show();
234 myVector = GEOM::GEOM_Object::_nil();
235 ActivateDistanceChanged(GroupPoints->CheckBox1->isChecked());
237 GroupPoints->PushButton1->click();
242 qApp->processEvents();
244 resize(minimumSizeHint());
248 SelectionIntoArgument();
255 //=================================================================================
256 // function : ClickOnOk()
258 //=================================================================================
259 void TransformationGUI_TranslationDlg::ClickOnOk()
265 //=================================================================================
266 // function : ClickOnApply()
268 //=================================================================================
269 bool TransformationGUI_TranslationDlg::ClickOnApply()
271 if (!onAccept(GroupPoints->CheckBox2->isChecked()))
277 myEditCurrentArgument = GroupPoints->LineEdit1;
278 myEditCurrentArgument->setText("");
280 // activate selection and connect selection manager
281 ConstructorsClicked(getConstructorId());
285 //=================================================================================
286 // function : SelectionIntoArgument()
287 // purpose : Called when selection is changed or on dialog initialization or activation
288 //=================================================================================
289 void TransformationGUI_TranslationDlg::SelectionIntoArgument()
292 myEditCurrentArgument->setText("");
294 if (myEditCurrentArgument == GroupPoints->LineEdit1)
296 else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1)
297 myPoint1 = GEOM::GEOM_Object::_nil();
298 else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
299 myVector = GEOM::GEOM_Object::_nil();
300 else if (myEditCurrentArgument == GroupPoints->LineEdit3)
301 myPoint2 = GEOM::GEOM_Object::_nil();
303 LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
304 SALOME_ListIO aSelList;
305 aSelMgr->selectedObjects(aSelList);
309 if (myEditCurrentArgument == GroupPoints->LineEdit1) {
310 int aNbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName);
314 GEOMBase::ConvertListOfIOInListOfGO(aSelList, myObjects);
315 if (!myObjects.length())
318 myEditCurrentArgument->setText(aName);
320 // here we do not switch to the next field, because multiple objects can be selected
322 if (getConstructorId() == 1) {
323 if (myPoint1->_is_nil())
324 GroupPoints->PushButton2->click();
326 else if (getConstructorId() == 2) {
327 if (myVector->_is_nil())
328 GroupPoints->PushButton2->click();
334 if (aSelList.Extent() != 1)
338 Standard_Boolean testResult = Standard_False;
339 GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
341 if (!testResult || CORBA::is_nil(aSelectedObject))
344 aName = GEOMBase::GetName(aSelectedObject);
346 // Get Selected object if selected subshape
348 if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull())
350 TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
351 if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
352 aNeedType = TopAbs_EDGE;
354 TColStd_IndexedMapOfInteger aMap;
355 aSelMgr->GetIndexes(aSelList.First(), aMap);
356 if (aMap.Extent() == 1)
358 int anIndex = aMap(1);
359 if (aNeedType == TopAbs_EDGE)
360 aName += QString(":edge_%1").arg(anIndex);
362 aName += QString(":vertex_%1").arg(anIndex);
364 //Find SubShape Object in Father
365 GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName);
367 if (aFindedObject->_is_nil()) { // Object not found in study
368 GEOM::GEOM_IShapesOperations_var aShapesOp =
369 getGeomEngine()->GetIShapesOperations(getStudyId());
370 aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
373 aSelectedObject = aFindedObject;
376 else // Global Selection
378 if (aShape.ShapeType() != aNeedType) {
379 aSelectedObject = GEOM::GEOM_Object::_nil();
385 myEditCurrentArgument->setText(aName);
387 if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1) {
388 myPoint1 = aSelectedObject;
389 if (!myPoint1->_is_nil() && myPoint2->_is_nil())
390 GroupPoints->PushButton3->click();
392 else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2) {
393 myVector = aSelectedObject;
394 if (!myVector->_is_nil() && !myObjects.length())
395 GroupPoints->PushButton1->click();
397 else if (myEditCurrentArgument == GroupPoints->LineEdit3) {
398 myPoint2 = aSelectedObject;
399 if (!myPoint2->_is_nil() && !myObjects.length())
400 GroupPoints->PushButton1->click();
405 /* disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
406 myGeomGUI->getApp()->selectionMgr()->clearSelected();
407 connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
408 this, SLOT(SelectionIntoArgument()));*/
409 // here commented, because multiple objects can be selected IPAL 21437
414 //=================================================================================
415 // function : SetEditCurrentArgument()
417 //=================================================================================
418 void TransformationGUI_TranslationDlg::SetEditCurrentArgument()
420 QPushButton* send = (QPushButton*)sender();
422 disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
425 if (send == GroupPoints->PushButton1) {
426 myEditCurrentArgument = GroupPoints->LineEdit1;
428 GroupPoints->PushButton2->setDown(false);
429 GroupPoints->PushButton3->setDown(false);
430 GroupPoints->LineEdit2->setEnabled(false);
431 GroupPoints->LineEdit3->setEnabled(false);
433 else if (send == GroupPoints->PushButton2) {
434 myEditCurrentArgument = GroupPoints->LineEdit2;
436 GroupPoints->PushButton1->setDown(false);
437 GroupPoints->PushButton3->setDown(false);
438 GroupPoints->LineEdit1->setEnabled(false);
439 GroupPoints->LineEdit3->setEnabled(false);
441 if (getConstructorId() == 1)
442 localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
444 localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
446 else if (send == GroupPoints->PushButton3) {
447 myEditCurrentArgument = GroupPoints->LineEdit3;
449 GroupPoints->PushButton1->setDown(false);
450 GroupPoints->PushButton2->setDown(false);
451 GroupPoints->LineEdit1->setEnabled(false);
452 GroupPoints->LineEdit2->setEnabled(false);
454 localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
456 connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
457 this, SLOT(SelectionIntoArgument()));
460 myEditCurrentArgument->setEnabled(true);
461 myEditCurrentArgument->setFocus();
462 // after setFocus(), because it will be setDown(false) when loses focus
465 // seems we need it only to avoid preview disappearing, caused by selection mode change
469 //=================================================================================
470 // function : LineEditReturnPressed()
472 //=================================================================================
473 void TransformationGUI_TranslationDlg::LineEditReturnPressed()
475 QLineEdit* send = (QLineEdit*)sender();
476 if (send == GroupPoints->LineEdit1) {
477 myEditCurrentArgument = send;
478 GEOMBase_Skeleton::LineEditReturnPressed();
482 //=================================================================================
483 // function : ActivateThisDialog()
485 //=================================================================================
486 void TransformationGUI_TranslationDlg::ActivateThisDialog()
488 GEOMBase_Skeleton::ActivateThisDialog();
489 connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
490 this, SLOT( SelectionIntoArgument() ) );
492 ConstructorsClicked( getConstructorId() );
495 //=================================================================================
496 // function : enterEvent()
498 //=================================================================================
499 void TransformationGUI_TranslationDlg::enterEvent (QEvent*)
501 if (!mainFrame()->GroupConstructors->isEnabled())
502 ActivateThisDialog();
505 //=================================================================================
506 // function : ValueChangedInSpinBox()
508 //=================================================================================
509 void TransformationGUI_TranslationDlg::ValueChangedInSpinBox()
514 //=================================================================================
515 // function : createOperation
517 //=================================================================================
518 GEOM::GEOM_IOperations_ptr TransformationGUI_TranslationDlg::createOperation()
520 return getGeomEngine()->GetITransformOperations(getStudyId());
523 //=================================================================================
524 // function : isValid
526 //=================================================================================
527 bool TransformationGUI_TranslationDlg::isValid (QString& msg)
529 int aConstructorId = getConstructorId();
531 switch (aConstructorId) {
535 ok = GroupPoints->SpinBox1->isValid( msg, !IsPreview() ) && ok;
536 ok = GroupPoints->SpinBox2->isValid( msg, !IsPreview() ) && ok;
537 ok = GroupPoints->SpinBox3->isValid( msg, !IsPreview() ) && ok;
538 return myObjects.length() > 0 && ok;
541 return myObjects.length() > 0 && !(myPoint1->_is_nil() || myPoint2->_is_nil());
544 bool ok = GroupPoints->SpinBox3->isValid( msg, !IsPreview() );
545 return myObjects.length() > 0 && !(myVector->_is_nil()) && ok;
553 //=================================================================================
554 // function : execute
556 //=================================================================================
557 bool TransformationGUI_TranslationDlg::execute (ObjectList& objects)
560 bool toCreateCopy = IsPreview() || GroupPoints->CheckBox2->isChecked();
562 GEOM::GEOM_Object_var anObj;
564 GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation());
566 switch (getConstructorId()) {
569 double dx = GroupPoints->SpinBox1->value();
570 double dy = GroupPoints->SpinBox2->value();
571 double dz = GroupPoints->SpinBox3->value();
573 QStringList aParameters;
574 aParameters<<GroupPoints->SpinBox1->text();
575 aParameters<<GroupPoints->SpinBox2->text();
576 aParameters<<GroupPoints->SpinBox3->text();
579 for (int i = 0; i < myObjects.length(); i++) {
580 myCurrObject = myObjects[i];
581 anObj = anOper->TranslateDXDYDZCopy(myObjects[i], dx, dy, dz);
582 if (!anObj->_is_nil()) {
584 anObj->SetParameters(aParameters.join(":").toLatin1().constData());
585 objects.push_back(anObj._retn());
590 for (int i = 0; i < myObjects.length(); i++) {
591 myCurrObject = myObjects[i];
592 anObj = anOper->TranslateDXDYDZ(myObjects[i], dx, dy, dz);
593 if (!anObj->_is_nil()) {
595 anObj->SetParameters(aParameters.join(":").toLatin1().constData());
596 updateAttributes(anObj, aParameters);
598 objects.push_back(anObj._retn());
608 for (int i = 0; i < myObjects.length(); i++) {
609 myCurrObject = myObjects[i];
610 anObj = anOper->TranslateTwoPointsCopy(myObjects[i], myPoint1, myPoint2);
611 if (!anObj->_is_nil())
612 objects.push_back(anObj._retn());
616 for (int i = 0; i < myObjects.length(); i++) {
617 myCurrObject = myObjects[i];
618 anObj = anOper->TranslateTwoPoints(myObjects[i], myPoint1, myPoint2);
619 if (!anObj->_is_nil())
620 objects.push_back(anObj._retn());
628 QStringList aParameters;
629 aParameters<<GroupPoints->SpinBox3->text();
630 bool byDistance = GroupPoints->CheckBox1->isChecked();
632 double aDistance = GroupPoints->SpinBox3->value();
633 for (int i = 0; i < myObjects.length(); i++) {
634 myCurrObject = myObjects[i];
635 anObj = anOper->TranslateVectorDistance(myObjects[i], myVector, aDistance, toCreateCopy);
636 if (!anObj->_is_nil()) {
638 anObj->SetParameters(aParameters.join(":").toLatin1().constData());
640 updateAttributes(anObj, aParameters);
642 objects.push_back(anObj._retn());
648 for (int i = 0; i < myObjects.length(); i++) {
649 myCurrObject = myObjects[i];
650 anObj = anOper->TranslateVectorCopy(myObjects[i], myVector);
651 if (!anObj->_is_nil())
652 objects.push_back(anObj._retn());
656 for (int i = 0; i < myObjects.length(); i++) {
657 myCurrObject = myObjects[i];
658 anObj = anOper->TranslateVector(myObjects[i], myVector);
659 if (!anObj->_is_nil())
660 objects.push_back(anObj._retn());
671 //=================================================================================
672 // function : restoreSubShapes
674 //=================================================================================
675 void TransformationGUI_TranslationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
676 SALOMEDS::SObject_ptr theSObject)
678 if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
679 // we pass here the first operation argument (object) through the list of arguments
680 // because the rotation operation place its arguments in the data structure in another order,
681 // and we need to point the first argument directly
682 GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO;
684 anArgs[0] = myCurrObject;
685 getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
686 /*theFindMethod=*/GEOM::FSM_Transformed,
687 /*theInheritFirstArg=*/true,
688 mainFrame()->CheckBoxAddPrefix->isChecked());
692 //=================================================================================
693 // function : CreateCopyModeChanged()
695 //=================================================================================
696 void TransformationGUI_TranslationDlg::CreateCopyModeChanged (bool isCreateCopy)
698 mainFrame()->GroupBoxName->setEnabled(isCreateCopy);
701 //=================================================================================
702 // function : ActivateDistanceChanged()
704 //=================================================================================
705 void TransformationGUI_TranslationDlg::ActivateDistanceChanged (bool theEnable)
707 GroupPoints->SpinBox3->setEnabled(theEnable);
711 //=================================================================================
712 // function : addSubshapeToStudy
713 // purpose : virtual method to add new SubObjects if local selection
714 //=================================================================================
715 void TransformationGUI_TranslationDlg::addSubshapesToStudy()
717 bool toCreateCopy = IsPreview() || GroupPoints->CheckBox2->isChecked();
719 QMap<QString, GEOM::GEOM_Object_var> objMap;
721 switch (getConstructorId()) {
725 objMap[GroupPoints->LineEdit2->text()] = myPoint1;
726 objMap[GroupPoints->LineEdit3->text()] = myPoint2;
729 objMap[GroupPoints->LineEdit2->text()] = myVector;
732 addSubshapesToFather(objMap);