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()))
275 // activate selection and connect selection manager
276 ConstructorsClicked(getConstructorId());
280 //=================================================================================
281 // function : SelectionIntoArgument()
282 // purpose : Called when selection is changed or on dialog initialization or activation
283 //=================================================================================
284 void TransformationGUI_TranslationDlg::SelectionIntoArgument()
287 myEditCurrentArgument->setText("");
289 if (myEditCurrentArgument == GroupPoints->LineEdit1)
291 else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1)
292 myPoint1 = GEOM::GEOM_Object::_nil();
293 else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
294 myVector = GEOM::GEOM_Object::_nil();
295 else if (myEditCurrentArgument == GroupPoints->LineEdit3)
296 myPoint2 = GEOM::GEOM_Object::_nil();
298 LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
299 SALOME_ListIO aSelList;
300 aSelMgr->selectedObjects(aSelList);
304 if (myEditCurrentArgument == GroupPoints->LineEdit1) {
305 int aNbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName);
309 GEOMBase::ConvertListOfIOInListOfGO(aSelList, myObjects);
310 if (!myObjects.length())
313 myEditCurrentArgument->setText(aName);
315 // here we do not switch to the next field, because multiple objects can be selected
317 if (getConstructorId() == 1) {
318 if (myPoint1->_is_nil())
319 GroupPoints->PushButton2->click();
321 else if (getConstructorId() == 2) {
322 if (myVector->_is_nil())
323 GroupPoints->PushButton2->click();
329 if (aSelList.Extent() != 1)
333 Standard_Boolean testResult = Standard_False;
334 GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
336 if (!testResult || CORBA::is_nil(aSelectedObject))
339 aName = GEOMBase::GetName(aSelectedObject);
341 // Get Selected object if selected subshape
343 if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull())
345 TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
346 if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
347 aNeedType = TopAbs_EDGE;
349 TColStd_IndexedMapOfInteger aMap;
350 aSelMgr->GetIndexes(aSelList.First(), aMap);
351 if (aMap.Extent() == 1)
353 int anIndex = aMap(1);
354 if (aNeedType == TopAbs_EDGE)
355 aName += QString(":edge_%1").arg(anIndex);
357 aName += QString(":vertex_%1").arg(anIndex);
359 //Find SubShape Object in Father
360 GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName);
362 if (aFindedObject->_is_nil()) { // Object not found in study
363 GEOM::GEOM_IShapesOperations_var aShapesOp =
364 getGeomEngine()->GetIShapesOperations(getStudyId());
365 aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
368 aSelectedObject = aFindedObject;
371 else // Global Selection
373 if (aShape.ShapeType() != aNeedType) {
374 aSelectedObject = GEOM::GEOM_Object::_nil();
380 myEditCurrentArgument->setText(aName);
382 if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1) {
383 myPoint1 = aSelectedObject;
384 if (!myPoint1->_is_nil() && myPoint2->_is_nil())
385 GroupPoints->PushButton3->click();
387 else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2) {
388 myVector = aSelectedObject;
389 if (!myVector->_is_nil() && !myObjects.length())
390 GroupPoints->PushButton1->click();
392 else if (myEditCurrentArgument == GroupPoints->LineEdit3) {
393 myPoint2 = aSelectedObject;
394 if (!myPoint2->_is_nil() && !myObjects.length())
395 GroupPoints->PushButton1->click();
400 /* disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
401 myGeomGUI->getApp()->selectionMgr()->clearSelected();
402 connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
403 this, SLOT(SelectionIntoArgument()));*/
404 // here commented, because multiple objects can be selected IPAL 21437
409 //=================================================================================
410 // function : SetEditCurrentArgument()
412 //=================================================================================
413 void TransformationGUI_TranslationDlg::SetEditCurrentArgument()
415 QPushButton* send = (QPushButton*)sender();
417 disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
420 if (send == GroupPoints->PushButton1) {
421 myEditCurrentArgument = GroupPoints->LineEdit1;
423 GroupPoints->PushButton2->setDown(false);
424 GroupPoints->PushButton3->setDown(false);
425 GroupPoints->LineEdit2->setEnabled(false);
426 GroupPoints->LineEdit3->setEnabled(false);
428 else if (send == GroupPoints->PushButton2) {
429 myEditCurrentArgument = GroupPoints->LineEdit2;
431 GroupPoints->PushButton1->setDown(false);
432 GroupPoints->PushButton3->setDown(false);
433 GroupPoints->LineEdit1->setEnabled(false);
434 GroupPoints->LineEdit3->setEnabled(false);
436 if (getConstructorId() == 1)
437 localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
439 localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
441 else if (send == GroupPoints->PushButton3) {
442 myEditCurrentArgument = GroupPoints->LineEdit3;
444 GroupPoints->PushButton1->setDown(false);
445 GroupPoints->PushButton2->setDown(false);
446 GroupPoints->LineEdit1->setEnabled(false);
447 GroupPoints->LineEdit2->setEnabled(false);
449 localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
451 connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
452 this, SLOT(SelectionIntoArgument()));
455 myEditCurrentArgument->setEnabled(true);
456 myEditCurrentArgument->setFocus();
457 // after setFocus(), because it will be setDown(false) when loses focus
460 // seems we need it only to avoid preview disappearing, caused by selection mode change
464 //=================================================================================
465 // function : LineEditReturnPressed()
467 //=================================================================================
468 void TransformationGUI_TranslationDlg::LineEditReturnPressed()
470 QLineEdit* send = (QLineEdit*)sender();
471 if (send == GroupPoints->LineEdit1) {
472 myEditCurrentArgument = send;
473 GEOMBase_Skeleton::LineEditReturnPressed();
477 //=================================================================================
478 // function : ActivateThisDialog()
480 //=================================================================================
481 void TransformationGUI_TranslationDlg::ActivateThisDialog()
483 GEOMBase_Skeleton::ActivateThisDialog();
484 connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
485 this, SLOT( SelectionIntoArgument() ) );
487 ConstructorsClicked( getConstructorId() );
490 //=================================================================================
491 // function : enterEvent()
493 //=================================================================================
494 void TransformationGUI_TranslationDlg::enterEvent (QEvent*)
496 if (!mainFrame()->GroupConstructors->isEnabled())
497 ActivateThisDialog();
500 //=================================================================================
501 // function : ValueChangedInSpinBox()
503 //=================================================================================
504 void TransformationGUI_TranslationDlg::ValueChangedInSpinBox()
509 //=================================================================================
510 // function : createOperation
512 //=================================================================================
513 GEOM::GEOM_IOperations_ptr TransformationGUI_TranslationDlg::createOperation()
515 return getGeomEngine()->GetITransformOperations(getStudyId());
518 //=================================================================================
519 // function : isValid
521 //=================================================================================
522 bool TransformationGUI_TranslationDlg::isValid (QString& msg)
524 int aConstructorId = getConstructorId();
526 switch (aConstructorId) {
530 ok = GroupPoints->SpinBox1->isValid( msg, !IsPreview() ) && ok;
531 ok = GroupPoints->SpinBox2->isValid( msg, !IsPreview() ) && ok;
532 ok = GroupPoints->SpinBox3->isValid( msg, !IsPreview() ) && ok;
533 return myObjects.length() > 0 && ok;
536 return myObjects.length() > 0 && !(myPoint1->_is_nil() || myPoint2->_is_nil());
539 bool ok = GroupPoints->SpinBox3->isValid( msg, !IsPreview() );
540 return myObjects.length() > 0 && !(myVector->_is_nil()) && ok;
548 //=================================================================================
549 // function : execute
551 //=================================================================================
552 bool TransformationGUI_TranslationDlg::execute (ObjectList& objects)
555 bool toCreateCopy = IsPreview() || GroupPoints->CheckBox2->isChecked();
557 GEOM::GEOM_Object_var anObj;
559 GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation());
561 switch (getConstructorId()) {
564 double dx = GroupPoints->SpinBox1->value();
565 double dy = GroupPoints->SpinBox2->value();
566 double dz = GroupPoints->SpinBox3->value();
568 QStringList aParameters;
569 aParameters<<GroupPoints->SpinBox1->text();
570 aParameters<<GroupPoints->SpinBox2->text();
571 aParameters<<GroupPoints->SpinBox3->text();
574 for (int i = 0; i < myObjects.length(); i++) {
575 myCurrObject = myObjects[i];
576 anObj = anOper->TranslateDXDYDZCopy(myObjects[i], dx, dy, dz);
577 if (!anObj->_is_nil()) {
579 anObj->SetParameters(aParameters.join(":").toLatin1().constData());
580 objects.push_back(anObj._retn());
585 for (int i = 0; i < myObjects.length(); i++) {
586 myCurrObject = myObjects[i];
587 anObj = anOper->TranslateDXDYDZ(myObjects[i], dx, dy, dz);
588 if (!anObj->_is_nil()) {
590 anObj->SetParameters(aParameters.join(":").toLatin1().constData());
591 updateAttributes(anObj, aParameters);
593 objects.push_back(anObj._retn());
603 for (int i = 0; i < myObjects.length(); i++) {
604 myCurrObject = myObjects[i];
605 anObj = anOper->TranslateTwoPointsCopy(myObjects[i], myPoint1, myPoint2);
606 if (!anObj->_is_nil())
607 objects.push_back(anObj._retn());
611 for (int i = 0; i < myObjects.length(); i++) {
612 myCurrObject = myObjects[i];
613 anObj = anOper->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 = anOper->TranslateVectorDistance(myObjects[i], myVector, aDistance, toCreateCopy);
631 if (!anObj->_is_nil()) {
633 anObj->SetParameters(aParameters.join(":").toLatin1().constData());
635 updateAttributes(anObj, aParameters);
637 objects.push_back(anObj._retn());
643 for (int i = 0; i < myObjects.length(); i++) {
644 myCurrObject = myObjects[i];
645 anObj = anOper->TranslateVectorCopy(myObjects[i], myVector);
646 if (!anObj->_is_nil())
647 objects.push_back(anObj._retn());
651 for (int i = 0; i < myObjects.length(); i++) {
652 myCurrObject = myObjects[i];
653 anObj = anOper->TranslateVector(myObjects[i], myVector);
654 if (!anObj->_is_nil())
655 objects.push_back(anObj._retn());
666 //=================================================================================
667 // function : restoreSubShapes
669 //=================================================================================
670 void TransformationGUI_TranslationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
671 SALOMEDS::SObject_ptr theSObject)
673 if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
674 // we pass here the first operation argument (object) through the list of arguments
675 // because the rotation operation place its arguments in the data structure in another order,
676 // and we need to point the first argument directly
677 GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO;
679 anArgs[0] = myCurrObject;
680 getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
681 /*theFindMethod=*/GEOM::FSM_Transformed,
682 /*theInheritFirstArg=*/true,
683 mainFrame()->CheckBoxAddPrefix->isChecked());
687 //=================================================================================
688 // function : CreateCopyModeChanged()
690 //=================================================================================
691 void TransformationGUI_TranslationDlg::CreateCopyModeChanged (bool isCreateCopy)
693 mainFrame()->GroupBoxName->setEnabled(isCreateCopy);
696 //=================================================================================
697 // function : ActivateDistanceChanged()
699 //=================================================================================
700 void TransformationGUI_TranslationDlg::ActivateDistanceChanged (bool theEnable)
702 GroupPoints->SpinBox3->setEnabled(theEnable);
706 //=================================================================================
707 // function : addSubshapeToStudy
708 // purpose : virtual method to add new SubObjects if local selection
709 //=================================================================================
710 void TransformationGUI_TranslationDlg::addSubshapesToStudy()
712 bool toCreateCopy = IsPreview() || GroupPoints->CheckBox2->isChecked();
714 QMap<QString, GEOM::GEOM_Object_var> objMap;
716 switch (getConstructorId()) {
720 objMap[GroupPoints->LineEdit2->text()] = myPoint1;
721 objMap[GroupPoints->LineEdit3->text()] = myPoint2;
724 objMap[GroupPoints->LineEdit2->text()] = myVector;
727 addSubshapesToFather(objMap);