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 : OperationGUI_FilletDlg.cxx
24 // Author : Damien COQUERET, Open CASCADE S.A.S.
26 #include "OperationGUI_FilletDlg.h"
29 #include <GeometryGUI.h>
32 #include <SUIT_Desktop.h>
33 #include <SUIT_Session.h>
34 #include <SUIT_ResourceMgr.h>
35 #include <SUIT_ViewWindow.h>
36 #include <SUIT_ViewManager.h>
37 #include <SalomeApp_Application.h>
38 #include <LightApp_SelectionMgr.h>
39 #include <OCCViewer_ViewModel.h>
42 #include <TColStd_MapOfInteger.hxx>
43 #include <TColStd_IndexedMapOfInteger.hxx>
45 #include <GEOMImpl_Types.hxx>
47 //=================================================================================
48 // class : OperationGUI_FilletDlg()
49 // purpose : Constructs a OperationGUI_FilletDlg 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 OperationGUI_FilletDlg::OperationGUI_FilletDlg (GeometryGUI* theGeometryGUI, QWidget* parent)
55 : GEOMBase_Skeleton(theGeometryGUI, parent, false),
58 SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
59 QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_FILLET_ALL")));
60 QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_FILLET_EDGE")));
61 QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_FILLET_FACE")));
63 QPixmap iconSelect (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
65 setWindowTitle(tr("GEOM_FILLET_TITLE"));
67 /***************************************************************/
68 mainFrame()->GroupConstructors->setTitle(tr("GEOM_FILLET"));
69 mainFrame()->RadioButton1->setIcon(image0);
70 mainFrame()->RadioButton2->setIcon(image1);
71 mainFrame()->RadioButton3->setIcon(image2);
73 Group1 = new DlgRef_1Sel1Spin(centralWidget());
74 Group1->GroupBox1->setTitle(tr("GEOM_FILLET_ALL"));
75 Group1->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
76 Group1->TextLabel2->setText(tr("GEOM_RADIUS"));
77 Group1->PushButton1->setIcon(iconSelect);
78 Group1->LineEdit1->setReadOnly(true);
80 Group2 = new DlgRef_2Sel3Spin2Rb(centralWidget());
81 Group2->GroupBox1->setTitle(tr("GEOM_FILLET_EDGES"));
82 Group2->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
83 Group2->TextLabel2->setText(tr("SELECTED_EDGES"));
84 Group2->TextLabel3->setText(tr("GEOM_RADIUS"));
85 Group2->TextLabel4->setText(tr("GEOM_R1"));
86 Group2->TextLabel5->setText(tr("GEOM_R2"));
87 Group2->PushButton1->setIcon(iconSelect);
88 Group2->PushButton2->setIcon(iconSelect);
89 Group2->LineEdit1->setReadOnly(true);
90 Group2->LineEdit2->setReadOnly(true);
92 Group3 = new DlgRef_2Sel3Spin2Rb(centralWidget());
93 Group3->GroupBox1->setTitle(tr("GEOM_FILLET_FACES"));
94 Group3->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
95 Group3->TextLabel2->setText(tr("SELECTED_FACES"));
96 Group3->TextLabel3->setText(tr("GEOM_RADIUS"));
97 Group3->TextLabel4->setText(tr("GEOM_R1"));
98 Group3->TextLabel5->setText(tr("GEOM_R2"));
99 Group3->PushButton1->setIcon(iconSelect);
100 Group3->PushButton2->setIcon(iconSelect);
101 Group3->LineEdit1->setReadOnly(true);
102 Group3->LineEdit2->setReadOnly(true);
104 QVBoxLayout* layout = new QVBoxLayout(centralWidget());
105 layout->setMargin(0); layout->setSpacing(6);
106 layout->addWidget(Group1);
107 layout->addWidget(Group2);
108 layout->addWidget(Group3);
109 /***************************************************************/
111 // Set range of spinboxes
112 double SpecificStep = 10.0;
113 initSpinBox(Group1->SpinBox_DX, 0.001, COORD_MAX, SpecificStep, "length_precision" );
114 initSpinBox(Group2->SpinBox_DX, 0.001, COORD_MAX, SpecificStep, "length_precision" );
115 initSpinBox(Group2->SpinBox_DY, 0.001, COORD_MAX, SpecificStep, "length_precision" );
116 initSpinBox(Group2->SpinBox_DZ, 0.001, COORD_MAX, SpecificStep, "length_precision" );
117 initSpinBox(Group3->SpinBox_DX, 0.001, COORD_MAX, SpecificStep, "length_precision" );
118 initSpinBox(Group3->SpinBox_DY, 0.001, COORD_MAX, SpecificStep, "length_precision" );
119 initSpinBox(Group3->SpinBox_DZ, 0.001, COORD_MAX, SpecificStep, "length_precision" );
121 setHelpFileName("fillet_operation_page.html");
127 //=================================================================================
128 // function : ~OperationGUI_FilletDlg()
129 // purpose : Destroys the object and frees any allocated resources
130 //=================================================================================
131 OperationGUI_FilletDlg::~OperationGUI_FilletDlg()
135 //=================================================================================
138 //=================================================================================
139 void OperationGUI_FilletDlg::Init()
141 // Set Initial values of spinboxes
142 Group1->SpinBox_DX->setValue(5);
143 Group2->SpinBox_DX->setValue(5);
144 Group2->SpinBox_DY->setValue(5);
145 Group2->SpinBox_DZ->setValue(5);
146 Group3->SpinBox_DX->setValue(5);
147 Group3->SpinBox_DY->setValue(5);
148 Group3->SpinBox_DZ->setValue(5);
151 Group1->LineEdit1->setText("");
152 Group2->LineEdit1->setText("");
153 Group2->LineEdit2->setText("");
154 Group3->LineEdit1->setText("");
155 Group3->LineEdit2->setText("");
157 myShape = GEOM::GEOM_Object::_nil();
162 // signals and slots connections
165 connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk() ));
166 connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
169 connect(this, SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
172 connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
173 connect(Group2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
174 connect(Group3->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
175 connect(Group2->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
176 connect(Group3->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
179 connect(Group1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
180 connect(Group2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
181 connect(Group3->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
184 connect(Group1->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
185 connect(Group2->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
186 connect(Group2->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
187 connect(Group2->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
188 connect(Group3->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
189 connect(Group3->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
190 connect(Group3->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
193 connect(Group2->RadioButton1, SIGNAL(clicked()), this, SLOT(RadioButtonClicked()));
194 connect(Group2->RadioButton2, SIGNAL(clicked()), this, SLOT(RadioButtonClicked()));
195 connect(Group3->RadioButton1, SIGNAL(clicked()), this, SLOT(RadioButtonClicked()));
196 connect(Group3->RadioButton2, SIGNAL(clicked()), this, SLOT(RadioButtonClicked()));
198 initName(tr("GEOM_FILLET"));
200 myConstructorId = -1;
201 ConstructorsClicked(0);
204 //=================================================================================
205 // function : ConstructorsClicked()
206 // purpose : Radio button management
207 //=================================================================================
208 void OperationGUI_FilletDlg::ConstructorsClicked (int constructorId)
210 if (myGeomGUI->getApp()->desktop()->activeWindow()->getViewManager()->getType()
211 != OCCViewer_Viewer::Type()) {
212 mainFrame()->RadioButton1->setChecked(true);
216 if (myConstructorId == constructorId)
219 // Get radius from previous widget
220 QString R = "5", R1 = "5", R2 = "5";
221 if (myConstructorId == 0) {
222 R = Group1->SpinBox_DX->text();
224 else if (myConstructorId == 1) {
225 R = Group2->SpinBox_DX->text();
226 R1 = Group2->SpinBox_DY->text();
227 R2 = Group2->SpinBox_DZ->text();
230 R = Group3->SpinBox_DX->text();
231 R1 = Group3->SpinBox_DY->text();
232 R2 = Group3->SpinBox_DZ->text();
235 myConstructorId = constructorId;
237 switch (constructorId) {
242 Group1->SpinBox_DX->setText(R);
248 Group2->SpinBox_DX->setText(R);
249 Group2->SpinBox_DY->setText(R1);
250 Group2->SpinBox_DZ->setText(R2);
256 Group3->SpinBox_DX->setText(R);
257 Group3->SpinBox_DY->setText(R1);
258 Group3->SpinBox_DZ->setText(R2);
264 if (constructorId == 0) Group1->PushButton1->click();
265 else if (constructorId == 1) Group2->PushButton1->click();
266 else Group3->PushButton1->click();
272 SelectionIntoArgument();
275 if (!myShape->_is_nil()) {
276 myEditCurrentArgument->setText(GEOMBase::GetName(myShape));
277 GEOMBase_Skeleton::LineEditReturnPressed();
278 switch (getConstructorId()) {
280 if (myEdges.Extent() == 0)
281 Group2->PushButton2->click();
284 if (myFaces.Extent() == 0)
285 Group3->PushButton2->click();
292 myEditCurrentArgument->setText("");
297 qApp->processEvents();
299 resize(minimumSizeHint());
302 //=================================================================================
303 // function : ClickOnOk()
305 //=================================================================================
306 void OperationGUI_FilletDlg::ClickOnOk()
312 //=================================================================================
313 // function : ClickOnApply()
315 //=================================================================================
316 bool OperationGUI_FilletDlg::ClickOnApply()
322 // activate selection and connect selection manager
323 ConstructorsClicked(getConstructorId());
327 //=================================================================================
328 // function : SelectionIntoArgument()
329 // purpose : Called when selection is changed or on dialog initialization or activation
330 //=================================================================================
331 void OperationGUI_FilletDlg::SelectionIntoArgument()
334 myEditCurrentArgument->setText("");
336 LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
337 SALOME_ListIO aSelList;
338 aSelMgr->selectedObjects(aSelList);
340 // If selection of main object is activated
341 if (myEditCurrentArgument == Group1->LineEdit1 ||
342 myEditCurrentArgument == Group2->LineEdit1 ||
343 myEditCurrentArgument == Group3->LineEdit1)
345 myShape = GEOM::GEOM_Object::_nil();
346 if (aSelList.Extent() == 1) {
347 Standard_Boolean aResult = Standard_False;
348 GEOM::GEOM_Object_var anObj =
349 GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
351 if (aResult && !anObj->_is_nil()) {
353 myEditCurrentArgument->setText(GEOMBase::GetName(anObj));
360 // If face or edge selection is activated
361 else if (myEditCurrentArgument == Group2->LineEdit2 ||
362 myEditCurrentArgument == Group3->LineEdit2)
364 if (myEditCurrentArgument == Group2->LineEdit2) myEdges.Clear();
365 else myFaces.Clear();
366 if (aSelList.Extent() == 1) {
367 Standard_Boolean aResult = Standard_False;
368 GEOM::GEOM_Object_var anObj =
369 GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
371 if (aResult && !anObj->_is_nil()) {
372 TColStd_IndexedMapOfInteger anIndexes;
373 aSelMgr->GetIndexes(aSelList.First(), anIndexes);
375 if (anIndexes.Extent() > 0) {
377 if (anIndexes.Extent() == 1) {
378 int anIndex = anIndexes(1);
380 aName = QString(GEOMBase::GetName(anObj)) + QString(":%1").arg(anIndex);
383 aName = tr("GEOM_MEN_POPUP_NAME").arg(anIndexes.Extent());
386 myEditCurrentArgument->setText(aName);
388 if (myConstructorId == 1)
400 if (!(myEditCurrentArgument == Group2->LineEdit2 ||
401 myEditCurrentArgument == Group3->LineEdit2)) {
402 disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
403 myGeomGUI->getApp()->selectionMgr()->clearSelected();
404 connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
405 this, SLOT(SelectionIntoArgument()));
408 switch (getConstructorId()) {
410 if (myEditCurrentArgument == Group2->LineEdit1) {
411 if (!myShape->_is_nil() && myEdges.Extent() == 0)
412 Group2->PushButton2->click();
416 if (myEditCurrentArgument == Group3->LineEdit1) {
417 if (!myShape->_is_nil() && myFaces.Extent() == 0)
418 Group3->PushButton2->click();
426 //=================================================================================
427 // function : SetEditCurrentArgument()
429 //=================================================================================
430 void OperationGUI_FilletDlg::SetEditCurrentArgument()
432 QPushButton* send = (QPushButton*)sender();
434 if (send == Group1->PushButton1) {
435 myEditCurrentArgument = Group1->LineEdit1;
437 else if (send == Group2->PushButton1) {
438 myEditCurrentArgument = Group2->LineEdit1;
439 Group2->PushButton2->setDown(false);
440 Group2->LineEdit2->setEnabled(false);
442 else if (send == Group2->PushButton2) {
443 myEditCurrentArgument = Group2->LineEdit2;
444 Group2->PushButton1->setDown(false);
445 Group2->LineEdit1->setEnabled(false);
447 else if (send == Group3->PushButton1) {
448 myEditCurrentArgument = Group3->LineEdit1;
449 Group3->PushButton2->setDown(false);
450 Group3->LineEdit2->setEnabled(false);
452 else if (send == Group3->PushButton2) {
453 myEditCurrentArgument = Group3->LineEdit2;
454 Group3->PushButton1->setDown(false);
455 Group3->LineEdit1->setEnabled(false);
459 myEditCurrentArgument->setEnabled(true);
460 myEditCurrentArgument->setFocus();
461 // after setFocus(), because it will be setDown(false) when loses focus
466 // seems we need it only to avoid preview disappearing, caused by selection mode change
470 //=================================================================================
471 // function : LineEditReturnPressed()
473 //=================================================================================
474 void OperationGUI_FilletDlg::LineEditReturnPressed()
476 QLineEdit* send = (QLineEdit*)sender();
478 if (send == Group1->LineEdit1)
479 myEditCurrentArgument = Group1->LineEdit1;
480 else if (send == Group2->LineEdit1)
481 myEditCurrentArgument = Group2->LineEdit1;
482 else if (send == Group3->LineEdit1)
483 myEditCurrentArgument = Group3->LineEdit1;
487 GEOMBase_Skeleton::LineEditReturnPressed();
490 //=================================================================================
491 // function : ActivateThisDialog()
493 //=================================================================================
494 void OperationGUI_FilletDlg::ActivateThisDialog()
496 GEOMBase_Skeleton::ActivateThisDialog();
497 connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
498 this, SLOT( SelectionIntoArgument() ) );
500 ConstructorsClicked( getConstructorId() );
503 //=================================================================================
504 // function : enterEvent()
506 //=================================================================================
507 void OperationGUI_FilletDlg::enterEvent (QEvent*)
509 if (!mainFrame()->GroupConstructors->isEnabled())
510 this->ActivateThisDialog();
513 //=================================================================================
514 // function : ValueChangedInSpinBox()
516 //=================================================================================
517 void OperationGUI_FilletDlg::ValueChangedInSpinBox (double)
522 //=================================================================================
523 // function : activateSelection
524 // purpose : Activate selection in accordance with myEditCurrentArgument
525 //=================================================================================
526 void OperationGUI_FilletDlg::activateSelection()
528 disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
530 if (!myShape->_is_nil() && myEditCurrentArgument == Group2->LineEdit2)
531 localSelection(myShape, TopAbs_EDGE);
532 else if (!myShape->_is_nil() && myEditCurrentArgument == Group3->LineEdit2)
533 localSelection(myShape, TopAbs_FACE);
535 TColStd_MapOfInteger aMap;
536 aMap.Add(GEOM_SHELL);
537 aMap.Add(GEOM_SOLID);
538 aMap.Add(GEOM_COMPOUND);
539 globalSelection(aMap);
542 connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
543 this, SLOT(SelectionIntoArgument()));
546 //=================================================================================
547 // function : enableWidgets
548 // purpose : Enable widgets of faces in accordance with value of main object
549 //=================================================================================
550 void OperationGUI_FilletDlg::enableWidgets()
552 int anId = getConstructorId();
554 bool toEnable = !myShape->_is_nil();
557 //Group2->LineEdit2->setEnabled(toEnable);
558 Group2->PushButton2->setEnabled(toEnable);
561 Group2->LineEdit2->setText("");
565 else if (anId == 2) {
566 //Group3->LineEdit2->setEnabled(toEnable);
567 Group3->PushButton2->setEnabled(toEnable);
570 Group3->LineEdit2->setText("");
576 //=================================================================================
577 // function : createOperation
579 //=================================================================================
580 GEOM::GEOM_IOperations_ptr OperationGUI_FilletDlg::createOperation()
582 return getGeomEngine()->GetILocalOperations(getStudyId());
585 //=================================================================================
586 // function : isValid()
587 // purpose : Verify validity of input data
588 //=================================================================================
589 bool OperationGUI_FilletDlg::isValid (QString& msg)
592 switch (getConstructorId())
595 ok = Group1->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
596 return !myShape->_is_nil() && ok;
598 if (Group2->RadioButton1->isChecked())
599 ok = Group2->SpinBox_DX->isValid( msg, !IsPreview() );
602 ok = Group2->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
603 ok = Group2->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
605 return !myShape->_is_nil() && myEdges.Extent() > 0 && ok;
607 if (Group3->RadioButton1->isChecked())
608 ok = Group3->SpinBox_DX->isValid( msg, !IsPreview() );
611 ok = Group3->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
612 ok = Group3->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
614 return !myShape->_is_nil() && myFaces.Extent() > 0 && ok;
615 default: return false;
619 //=================================================================================
620 // function : execute
622 //=================================================================================
623 bool OperationGUI_FilletDlg::execute (ObjectList& objects)
625 QStringList aParameters;
626 GEOM::GEOM_Object_var anObj;
628 int anId = getConstructorId();
630 GEOM::GEOM_ILocalOperations_var anOper = GEOM::GEOM_ILocalOperations::_narrow(getOperation());
633 anObj = anOper->MakeFilletAll(myShape, getRadius());
634 if (!anObj->_is_nil())
635 aParameters << Group1->SpinBox_DX->text();
637 else if (anId == 1) {
638 GEOM::ListOfLong_var aList = new GEOM::ListOfLong;
639 aList->length(myEdges.Extent());
641 for (int i = 1, n = myEdges.Extent(); i <= n; i++)
642 aList[ i - 1 ] = myEdges(i);
644 if (Group2->RadioButton1->isChecked())
646 anObj = anOper->MakeFilletEdges(myShape, getRadius(), aList);
647 if (!anObj->_is_nil())
648 aParameters << Group2->SpinBox_DX->text();
652 anObj = anOper->MakeFilletEdgesR1R2(myShape,
653 Group2->SpinBox_DY->value(),
654 Group2->SpinBox_DZ->value(),
656 if (!anObj->_is_nil())
658 aParameters << Group2->SpinBox_DY->text();
659 aParameters << Group2->SpinBox_DZ->text();
663 else if (anId == 2) {
664 GEOM::ListOfLong_var aList = new GEOM::ListOfLong;
665 aList->length(myFaces.Extent());
667 for (int i = 1, n = myFaces.Extent(); i <= n; i++)
668 aList[ i - 1 ] = myFaces(i);
670 if (Group3->RadioButton1->isChecked()) {
671 anObj = anOper->MakeFilletFaces(myShape, getRadius(), aList);
672 if (!anObj->_is_nil())
673 aParameters << Group3->SpinBox_DX->text();
676 anObj = anOper->MakeFilletFacesR1R2(myShape,
677 Group3->SpinBox_DY->value(),
678 Group3->SpinBox_DZ->value(), aList);
679 if (!anObj->_is_nil())
681 aParameters << Group3->SpinBox_DY->text();
682 aParameters << Group3->SpinBox_DZ->text();
687 if (!anObj->_is_nil())
690 anObj->SetParameters(aParameters.join(":").toLatin1().constData());
691 objects.push_back(anObj._retn());
697 //=================================================================================
698 // function : getRadius
699 // purpose : Get radius
700 //=================================================================================
701 double OperationGUI_FilletDlg::getRadius() const
703 int anId = getConstructorId();
704 if (anId == 0) return Group1->SpinBox_DX->value();
705 else if (anId == 1) return Group2->SpinBox_DX->value();
706 else return Group3->SpinBox_DX->value();
709 //=================================================================================
710 // function : RadiobuttonClicked
712 //=================================================================================
713 void OperationGUI_FilletDlg::RadioButtonClicked()
715 const QObject* s = sender();
717 bool flag = s == Group2->RadioButton1 || s == Group3->RadioButton1;
719 Group2->RadioButton1->blockSignals(true);
720 Group2->RadioButton2->blockSignals(true);
721 Group3->RadioButton1->blockSignals(true);
722 Group3->RadioButton2->blockSignals(true);
724 Group2->SpinBox_DX->setEnabled(flag);
725 Group2->SpinBox_DY->setEnabled(!flag);
726 Group2->SpinBox_DZ->setEnabled(!flag);
727 Group2->RadioButton1->setChecked(flag);
728 Group2->RadioButton2->setChecked(!flag);
729 Group3->SpinBox_DX->setEnabled(flag);
730 Group3->SpinBox_DY->setEnabled(!flag);
731 Group3->SpinBox_DZ->setEnabled(!flag);
732 Group3->RadioButton1->setChecked(flag);
733 Group3->RadioButton2->setChecked(!flag);
735 Group2->RadioButton1->blockSignals(false);
736 Group2->RadioButton2->blockSignals(false);
737 Group3->RadioButton1->blockSignals(false);
738 Group3->RadioButton2->blockSignals(false);