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 : OperationGUI_FilletDlg.cxx
25 // Author : Damien COQUERET, Open CASCADE S.A.S.
27 #include "OperationGUI_FilletDlg.h"
30 #include <GeometryGUI.h>
33 #include <SUIT_Desktop.h>
34 #include <SUIT_Session.h>
35 #include <SUIT_ResourceMgr.h>
36 #include <SUIT_ViewWindow.h>
37 #include <SUIT_ViewManager.h>
38 #include <SalomeApp_Application.h>
39 #include <LightApp_SelectionMgr.h>
40 #include <OCCViewer_ViewModel.h>
43 #include <TColStd_MapOfInteger.hxx>
44 #include <TColStd_IndexedMapOfInteger.hxx>
46 #include <GEOMImpl_Types.hxx>
48 //=================================================================================
49 // class : OperationGUI_FilletDlg()
50 // purpose : Constructs a OperationGUI_FilletDlg 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 OperationGUI_FilletDlg::OperationGUI_FilletDlg (GeometryGUI* theGeometryGUI, QWidget* parent)
56 : GEOMBase_Skeleton(theGeometryGUI, parent, false),
59 SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
60 QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_FILLET_ALL")));
61 QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_FILLET_EDGE")));
62 QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_FILLET_FACE")));
64 QPixmap iconSelect (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
66 setWindowTitle(tr("GEOM_FILLET_TITLE"));
68 /***************************************************************/
69 mainFrame()->GroupConstructors->setTitle(tr("GEOM_FILLET"));
70 mainFrame()->RadioButton1->setIcon(image0);
71 mainFrame()->RadioButton2->setIcon(image1);
72 mainFrame()->RadioButton3->setIcon(image2);
74 Group1 = new DlgRef_1Sel1Spin(centralWidget());
75 Group1->GroupBox1->setTitle(tr("GEOM_FILLET_ALL"));
76 Group1->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
77 Group1->TextLabel2->setText(tr("GEOM_RADIUS"));
78 Group1->PushButton1->setIcon(iconSelect);
79 Group1->LineEdit1->setReadOnly(true);
81 Group2 = new DlgRef_2Sel3Spin2Rb(centralWidget());
82 Group2->GroupBox1->setTitle(tr("GEOM_FILLET_EDGES"));
83 Group2->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
84 Group2->TextLabel2->setText(tr("SELECTED_EDGES"));
85 Group2->TextLabel3->setText(tr("GEOM_RADIUS"));
86 Group2->TextLabel4->setText(tr("GEOM_R1"));
87 Group2->TextLabel5->setText(tr("GEOM_R2"));
88 Group2->PushButton1->setIcon(iconSelect);
89 Group2->PushButton2->setIcon(iconSelect);
90 Group2->LineEdit1->setReadOnly(true);
91 Group2->LineEdit2->setReadOnly(true);
93 Group3 = new DlgRef_2Sel3Spin2Rb(centralWidget());
94 Group3->GroupBox1->setTitle(tr("GEOM_FILLET_FACES"));
95 Group3->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
96 Group3->TextLabel2->setText(tr("SELECTED_FACES"));
97 Group3->TextLabel3->setText(tr("GEOM_RADIUS"));
98 Group3->TextLabel4->setText(tr("GEOM_R1"));
99 Group3->TextLabel5->setText(tr("GEOM_R2"));
100 Group3->PushButton1->setIcon(iconSelect);
101 Group3->PushButton2->setIcon(iconSelect);
102 Group3->LineEdit1->setReadOnly(true);
103 Group3->LineEdit2->setReadOnly(true);
105 QVBoxLayout* layout = new QVBoxLayout(centralWidget());
106 layout->setMargin(0); layout->setSpacing(6);
107 layout->addWidget(Group1);
108 layout->addWidget(Group2);
109 layout->addWidget(Group3);
110 /***************************************************************/
112 // Set range of spinboxes
113 double SpecificStep = 10.0;
114 initSpinBox(Group1->SpinBox_DX, 0.001, COORD_MAX, SpecificStep, "length_precision" );
115 initSpinBox(Group2->SpinBox_DX, 0.001, COORD_MAX, SpecificStep, "length_precision" );
116 initSpinBox(Group2->SpinBox_DY, 0.001, COORD_MAX, SpecificStep, "length_precision" );
117 initSpinBox(Group2->SpinBox_DZ, 0.001, COORD_MAX, SpecificStep, "length_precision" );
118 initSpinBox(Group3->SpinBox_DX, 0.001, COORD_MAX, SpecificStep, "length_precision" );
119 initSpinBox(Group3->SpinBox_DY, 0.001, COORD_MAX, SpecificStep, "length_precision" );
120 initSpinBox(Group3->SpinBox_DZ, 0.001, COORD_MAX, SpecificStep, "length_precision" );
122 setHelpFileName("fillet_operation_page.html");
128 //=================================================================================
129 // function : ~OperationGUI_FilletDlg()
130 // purpose : Destroys the object and frees any allocated resources
131 //=================================================================================
132 OperationGUI_FilletDlg::~OperationGUI_FilletDlg()
136 //=================================================================================
139 //=================================================================================
140 void OperationGUI_FilletDlg::Init()
142 // Set Initial values of spinboxes
143 Group1->SpinBox_DX->setValue(5);
144 Group2->SpinBox_DX->setValue(5);
145 Group2->SpinBox_DY->setValue(5);
146 Group2->SpinBox_DZ->setValue(5);
147 Group3->SpinBox_DX->setValue(5);
148 Group3->SpinBox_DY->setValue(5);
149 Group3->SpinBox_DZ->setValue(5);
152 Group1->LineEdit1->setText("");
153 Group2->LineEdit1->setText("");
154 Group2->LineEdit2->setText("");
155 Group3->LineEdit1->setText("");
156 Group3->LineEdit2->setText("");
158 myShape = GEOM::GEOM_Object::_nil();
163 // signals and slots connections
166 connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk() ));
167 connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
170 connect(this, SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
173 connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
174 connect(Group2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
175 connect(Group3->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
176 connect(Group2->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
177 connect(Group3->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
180 connect(Group1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
181 connect(Group2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
182 connect(Group3->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
185 connect(Group1->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
186 connect(Group2->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
187 connect(Group2->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
188 connect(Group2->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
189 connect(Group3->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
190 connect(Group3->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
191 connect(Group3->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
194 connect(Group2->RadioButton1, SIGNAL(clicked()), this, SLOT(RadioButtonClicked()));
195 connect(Group2->RadioButton2, SIGNAL(clicked()), this, SLOT(RadioButtonClicked()));
196 connect(Group3->RadioButton1, SIGNAL(clicked()), this, SLOT(RadioButtonClicked()));
197 connect(Group3->RadioButton2, SIGNAL(clicked()), this, SLOT(RadioButtonClicked()));
199 initName(tr("GEOM_FILLET"));
201 myConstructorId = -1;
202 ConstructorsClicked(0);
205 //=================================================================================
206 // function : ConstructorsClicked()
207 // purpose : Radio button management
208 //=================================================================================
209 void OperationGUI_FilletDlg::ConstructorsClicked (int constructorId)
211 if (myGeomGUI->getApp()->desktop()->activeWindow()->getViewManager()->getType()
212 != OCCViewer_Viewer::Type()) {
213 mainFrame()->RadioButton1->setChecked(true);
217 if (myConstructorId == constructorId)
220 // Get radius from previous widget
221 QString R = "5", R1 = "5", R2 = "5";
222 if (myConstructorId == 0) {
223 R = Group1->SpinBox_DX->text();
225 else if (myConstructorId == 1) {
226 R = Group2->SpinBox_DX->text();
227 R1 = Group2->SpinBox_DY->text();
228 R2 = Group2->SpinBox_DZ->text();
231 R = Group3->SpinBox_DX->text();
232 R1 = Group3->SpinBox_DY->text();
233 R2 = Group3->SpinBox_DZ->text();
236 myConstructorId = constructorId;
238 switch (constructorId) {
243 Group1->SpinBox_DX->setText(R);
249 Group2->SpinBox_DX->setText(R);
250 Group2->SpinBox_DY->setText(R1);
251 Group2->SpinBox_DZ->setText(R2);
257 Group3->SpinBox_DX->setText(R);
258 Group3->SpinBox_DY->setText(R1);
259 Group3->SpinBox_DZ->setText(R2);
265 if (constructorId == 0) Group1->PushButton1->click();
266 else if (constructorId == 1) Group2->PushButton1->click();
267 else Group3->PushButton1->click();
273 SelectionIntoArgument();
276 if (!myShape->_is_nil()) {
277 myEditCurrentArgument->setText(GEOMBase::GetName(myShape));
278 GEOMBase_Skeleton::LineEditReturnPressed();
279 switch (getConstructorId()) {
281 if (myEdges.Extent() == 0)
282 Group2->PushButton2->click();
285 if (myFaces.Extent() == 0)
286 Group3->PushButton2->click();
293 myEditCurrentArgument->setText("");
298 qApp->processEvents();
300 resize(minimumSizeHint());
301 SelectionIntoArgument();
304 //=================================================================================
305 // function : ClickOnOk()
307 //=================================================================================
308 void OperationGUI_FilletDlg::ClickOnOk()
314 //=================================================================================
315 // function : ClickOnApply()
317 //=================================================================================
318 bool OperationGUI_FilletDlg::ClickOnApply()
324 // activate selection and connect selection manager
325 ConstructorsClicked(getConstructorId());
329 //=================================================================================
330 // function : SelectionIntoArgument()
331 // purpose : Called when selection is changed or on dialog initialization or activation
332 //=================================================================================
333 void OperationGUI_FilletDlg::SelectionIntoArgument()
336 myEditCurrentArgument->setText("");
338 LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
339 SALOME_ListIO aSelList;
340 aSelMgr->selectedObjects(aSelList);
342 // If selection of main object is activated
343 if (myEditCurrentArgument == Group1->LineEdit1 ||
344 myEditCurrentArgument == Group2->LineEdit1 ||
345 myEditCurrentArgument == Group3->LineEdit1)
347 myShape = GEOM::GEOM_Object::_nil();
348 if (aSelList.Extent() == 1) {
349 Standard_Boolean aResult = Standard_False;
350 GEOM::GEOM_Object_var anObj =
351 GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
353 if (aResult && !anObj->_is_nil()) {
355 myEditCurrentArgument->setText(GEOMBase::GetName(anObj));
362 // If face or edge selection is activated
363 else if (myEditCurrentArgument == Group2->LineEdit2 ||
364 myEditCurrentArgument == Group3->LineEdit2)
366 if (myEditCurrentArgument == Group2->LineEdit2) myEdges.Clear();
367 else myFaces.Clear();
368 if (aSelList.Extent() == 1) {
369 Standard_Boolean aResult = Standard_False;
370 GEOM::GEOM_Object_var anObj =
371 GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
373 if (aResult && !anObj->_is_nil()) {
374 TColStd_IndexedMapOfInteger anIndexes;
375 aSelMgr->GetIndexes(aSelList.First(), anIndexes);
377 if (anIndexes.Extent() > 0) {
379 if (anIndexes.Extent() == 1) {
380 int anIndex = anIndexes(1);
382 aName = QString(GEOMBase::GetName(anObj)) + QString(":%1").arg(anIndex);
385 aName = tr("GEOM_MEN_POPUP_NAME").arg(anIndexes.Extent());
388 myEditCurrentArgument->setText(aName);
390 if (myConstructorId == 1)
402 if (!(myEditCurrentArgument == Group2->LineEdit2 ||
403 myEditCurrentArgument == Group3->LineEdit2)) {
404 disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
405 myGeomGUI->getApp()->selectionMgr()->clearSelected();
406 connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
407 this, SLOT(SelectionIntoArgument()));
410 switch (getConstructorId()) {
412 if (myEditCurrentArgument == Group2->LineEdit1) {
413 if (!myShape->_is_nil() && myEdges.Extent() == 0)
414 Group2->PushButton2->click();
418 if (myEditCurrentArgument == Group3->LineEdit1) {
419 if (!myShape->_is_nil() && myFaces.Extent() == 0)
420 Group3->PushButton2->click();
428 //=================================================================================
429 // function : SetEditCurrentArgument()
431 //=================================================================================
432 void OperationGUI_FilletDlg::SetEditCurrentArgument()
434 QPushButton* send = (QPushButton*)sender();
436 if (send == Group1->PushButton1) {
437 myEditCurrentArgument = Group1->LineEdit1;
439 else if (send == Group2->PushButton1) {
440 myEditCurrentArgument = Group2->LineEdit1;
441 Group2->PushButton2->setDown(false);
442 Group2->LineEdit2->setEnabled(false);
444 else if (send == Group2->PushButton2) {
445 myEditCurrentArgument = Group2->LineEdit2;
446 Group2->PushButton1->setDown(false);
447 Group2->LineEdit1->setEnabled(false);
449 else if (send == Group3->PushButton1) {
450 myEditCurrentArgument = Group3->LineEdit1;
451 Group3->PushButton2->setDown(false);
452 Group3->LineEdit2->setEnabled(false);
454 else if (send == Group3->PushButton2) {
455 myEditCurrentArgument = Group3->LineEdit2;
456 Group3->PushButton1->setDown(false);
457 Group3->LineEdit1->setEnabled(false);
461 myEditCurrentArgument->setEnabled(true);
462 myEditCurrentArgument->setFocus();
463 // after setFocus(), because it will be setDown(false) when loses focus
468 // seems we need it only to avoid preview disappearing, caused by selection mode change
472 //=================================================================================
473 // function : LineEditReturnPressed()
475 //=================================================================================
476 void OperationGUI_FilletDlg::LineEditReturnPressed()
478 QLineEdit* send = (QLineEdit*)sender();
480 if (send == Group1->LineEdit1)
481 myEditCurrentArgument = Group1->LineEdit1;
482 else if (send == Group2->LineEdit1)
483 myEditCurrentArgument = Group2->LineEdit1;
484 else if (send == Group3->LineEdit1)
485 myEditCurrentArgument = Group3->LineEdit1;
489 GEOMBase_Skeleton::LineEditReturnPressed();
492 //=================================================================================
493 // function : ActivateThisDialog()
495 //=================================================================================
496 void OperationGUI_FilletDlg::ActivateThisDialog()
498 GEOMBase_Skeleton::ActivateThisDialog();
499 connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
500 this, SLOT( SelectionIntoArgument() ) );
502 ConstructorsClicked( getConstructorId() );
505 //=================================================================================
506 // function : enterEvent()
508 //=================================================================================
509 void OperationGUI_FilletDlg::enterEvent (QEvent*)
511 if (!mainFrame()->GroupConstructors->isEnabled())
512 this->ActivateThisDialog();
515 //=================================================================================
516 // function : ValueChangedInSpinBox()
518 //=================================================================================
519 void OperationGUI_FilletDlg::ValueChangedInSpinBox (double)
524 //=================================================================================
525 // function : activateSelection
526 // purpose : Activate selection in accordance with myEditCurrentArgument
527 //=================================================================================
528 void OperationGUI_FilletDlg::activateSelection()
530 disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
532 if (!myShape->_is_nil() && myEditCurrentArgument == Group2->LineEdit2)
533 localSelection(myShape, TopAbs_EDGE);
534 else if (!myShape->_is_nil() && myEditCurrentArgument == Group3->LineEdit2)
535 localSelection(myShape, TopAbs_FACE);
537 TColStd_MapOfInteger aMap;
538 aMap.Add(GEOM_SHELL);
539 aMap.Add(GEOM_SOLID);
540 aMap.Add(GEOM_COMPOUND);
541 globalSelection(aMap);
544 connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
545 this, SLOT(SelectionIntoArgument()));
548 //=================================================================================
549 // function : enableWidgets
550 // purpose : Enable widgets of faces in accordance with value of main object
551 //=================================================================================
552 void OperationGUI_FilletDlg::enableWidgets()
554 int anId = getConstructorId();
556 bool toEnable = !myShape->_is_nil();
559 //Group2->LineEdit2->setEnabled(toEnable);
560 Group2->PushButton2->setEnabled(toEnable);
563 Group2->LineEdit2->setText("");
567 else if (anId == 2) {
568 //Group3->LineEdit2->setEnabled(toEnable);
569 Group3->PushButton2->setEnabled(toEnable);
572 Group3->LineEdit2->setText("");
578 //=================================================================================
579 // function : createOperation
581 //=================================================================================
582 GEOM::GEOM_IOperations_ptr OperationGUI_FilletDlg::createOperation()
584 return getGeomEngine()->GetILocalOperations(getStudyId());
587 //=================================================================================
588 // function : isValid()
589 // purpose : Verify validity of input data
590 //=================================================================================
591 bool OperationGUI_FilletDlg::isValid (QString& msg)
594 switch (getConstructorId())
597 ok = Group1->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
598 return !myShape->_is_nil() && ok;
600 if (Group2->RadioButton1->isChecked())
601 ok = Group2->SpinBox_DX->isValid( msg, !IsPreview() );
604 ok = Group2->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
605 ok = Group2->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
607 return !myShape->_is_nil() && myEdges.Extent() > 0 && ok;
609 if (Group3->RadioButton1->isChecked())
610 ok = Group3->SpinBox_DX->isValid( msg, !IsPreview() );
613 ok = Group3->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
614 ok = Group3->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
616 return !myShape->_is_nil() && myFaces.Extent() > 0 && ok;
617 default: return false;
621 //=================================================================================
622 // function : execute
624 //=================================================================================
625 bool OperationGUI_FilletDlg::execute (ObjectList& objects)
627 QStringList aParameters;
628 GEOM::GEOM_Object_var anObj;
630 int anId = getConstructorId();
632 GEOM::GEOM_ILocalOperations_var anOper = GEOM::GEOM_ILocalOperations::_narrow(getOperation());
635 anObj = anOper->MakeFilletAll(myShape, getRadius());
636 if (!anObj->_is_nil())
637 aParameters << Group1->SpinBox_DX->text();
639 else if (anId == 1) {
640 GEOM::ListOfLong_var aList = new GEOM::ListOfLong;
641 aList->length(myEdges.Extent());
643 for (int i = 1, n = myEdges.Extent(); i <= n; i++)
644 aList[ i - 1 ] = myEdges(i);
646 if (Group2->RadioButton1->isChecked())
648 anObj = anOper->MakeFilletEdges(myShape, getRadius(), aList);
649 if (!anObj->_is_nil())
650 aParameters << Group2->SpinBox_DX->text();
654 anObj = anOper->MakeFilletEdgesR1R2(myShape,
655 Group2->SpinBox_DY->value(),
656 Group2->SpinBox_DZ->value(),
658 if (!anObj->_is_nil())
660 aParameters << Group2->SpinBox_DY->text();
661 aParameters << Group2->SpinBox_DZ->text();
665 else if (anId == 2) {
666 GEOM::ListOfLong_var aList = new GEOM::ListOfLong;
667 aList->length(myFaces.Extent());
669 for (int i = 1, n = myFaces.Extent(); i <= n; i++)
670 aList[ i - 1 ] = myFaces(i);
672 if (Group3->RadioButton1->isChecked()) {
673 anObj = anOper->MakeFilletFaces(myShape, getRadius(), aList);
674 if (!anObj->_is_nil())
675 aParameters << Group3->SpinBox_DX->text();
678 anObj = anOper->MakeFilletFacesR1R2(myShape,
679 Group3->SpinBox_DY->value(),
680 Group3->SpinBox_DZ->value(), aList);
681 if (!anObj->_is_nil())
683 aParameters << Group3->SpinBox_DY->text();
684 aParameters << Group3->SpinBox_DZ->text();
689 if (!anObj->_is_nil())
692 anObj->SetParameters(aParameters.join(":").toLatin1().constData());
693 objects.push_back(anObj._retn());
699 //=================================================================================
700 // function : getRadius
701 // purpose : Get radius
702 //=================================================================================
703 double OperationGUI_FilletDlg::getRadius() const
705 int anId = getConstructorId();
706 if (anId == 0) return Group1->SpinBox_DX->value();
707 else if (anId == 1) return Group2->SpinBox_DX->value();
708 else return Group3->SpinBox_DX->value();
711 //=================================================================================
712 // function : RadiobuttonClicked
714 //=================================================================================
715 void OperationGUI_FilletDlg::RadioButtonClicked()
717 const QObject* s = sender();
719 bool flag = s == Group2->RadioButton1 || s == Group3->RadioButton1;
721 Group2->RadioButton1->blockSignals(true);
722 Group2->RadioButton2->blockSignals(true);
723 Group3->RadioButton1->blockSignals(true);
724 Group3->RadioButton2->blockSignals(true);
726 Group2->SpinBox_DX->setEnabled(flag);
727 Group2->SpinBox_DY->setEnabled(!flag);
728 Group2->SpinBox_DZ->setEnabled(!flag);
729 Group2->RadioButton1->setChecked(flag);
730 Group2->RadioButton2->setChecked(!flag);
731 Group3->SpinBox_DX->setEnabled(flag);
732 Group3->SpinBox_DY->setEnabled(!flag);
733 Group3->SpinBox_DZ->setEnabled(!flag);
734 Group3->RadioButton1->setChecked(flag);
735 Group3->RadioButton2->setChecked(!flag);
737 Group2->RadioButton1->blockSignals(false);
738 Group2->RadioButton2->blockSignals(false);
739 Group3->RadioButton1->blockSignals(false);
740 Group3->RadioButton2->blockSignals(false);