X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FOperationGUI%2FOperationGUI_ChamferDlg.cxx;h=02519e43480c4a303a590c7f4750308cfda3e925;hb=6c057505a6e4bcff162cfb8b86deeda0eefff60a;hp=856d941d1dd77098a483a18c77772ae882fdee55;hpb=d3dd282390888d7dc091ba2c2ffe7923bd7458e6;p=modules%2Fgeom.git diff --git a/src/OperationGUI/OperationGUI_ChamferDlg.cxx b/src/OperationGUI/OperationGUI_ChamferDlg.cxx index 856d941d1..02519e434 100644 --- a/src/OperationGUI/OperationGUI_ChamferDlg.cxx +++ b/src/OperationGUI/OperationGUI_ChamferDlg.cxx @@ -1,39 +1,47 @@ -// GEOM GEOMGUI : GUI for Geometry component +// GEOM GEOMGUI : GUI for Geometry component // -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : OperationGUI_ChamferDlg.cxx +// Author : Damien COQUERET, Open CASCADE S.A.S. // -// File : OperationGUI_ChamferDlg.cxx -// Author : Damien COQUERET -// Module : GEOM - -// $Header$ #include "OperationGUI_ChamferDlg.h" -#include "DlgRef_SpinBox.h" -#include "QAD_Desktop.h" -#include "qpixmap.h" -#include -#include "GEOMImpl_Types.hxx" +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +// OCCT Includes +#include + +#include //================================================================================= // class : OperationGUI_ChamferDlg() @@ -42,110 +50,115 @@ // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -OperationGUI_ChamferDlg::OperationGUI_ChamferDlg( QWidget* parent, SALOME_Selection* Sel ) -: GEOMBase_Skeleton(parent, "ChamferDlg", Sel, false, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +OperationGUI_ChamferDlg::OperationGUI_ChamferDlg (GeometryGUI* theGeometryGUI, QWidget* parent) + : GEOMBase_Skeleton(theGeometryGUI, parent, false), + myInitial(true) { + SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr(); + QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_CHAMFER_ALL"))); + QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_CHAMFER_EDGE_FROM_FACE"))); + QPixmap image3 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_CHAMFER_FACE"))); + QPixmap image4 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_CHAMFER_EDGE"))); - mySelection = Sel; - myConstructorId = -1; - - QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_CHAMFER_ALL"))); - QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_CHAMFER_EDGE"))); - QPixmap image3(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_CHAMFER_FACE"))); - QPixmap iconSelect(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); + QPixmap iconSelect (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT"))); - setCaption( tr( "GEOM_CHAMFER_TITLE" ) ); + setWindowTitle(tr("GEOM_CHAMFER_TITLE")); - GroupConstructors->setTitle( tr( "GEOM_CHAMFER" ) ); + /***************************************************************/ + mainFrame()->GroupConstructors->setTitle(tr("GEOM_CHAMFER")); - RadioButton1->setPixmap( image1 ); - RadioButton2->setPixmap( image2 ); - RadioButton3->setPixmap( image3 ); + mainFrame()->RadioButton1->setIcon(image1); + mainFrame()->RadioButton2->setIcon(image2); + mainFrame()->RadioButton3->setIcon(image3); + mainFrame()->RadioButton4->show(); + mainFrame()->RadioButton4->setIcon(image4); // Create first group - myGrp1 = new QGroupBox( 1, Qt::Horizontal, tr( "GEOM_CHAMFER_ALL" ), this ); + myGrp1 = new QGroupBox(tr("GEOM_CHAMFER_ALL"), centralWidget()); - QGroupBox* aSelGrp1 = new QGroupBox( 3, Qt::Horizontal, myGrp1 ); - aSelGrp1->setFrameStyle( QFrame::NoFrame ); - aSelGrp1->setInsideMargin( 0 ); + QGridLayout* aLayout = new QGridLayout(myGrp1); + aLayout->setMargin(9); aLayout->setSpacing(6); - createSelWg( tr( "GEOM_MAIN_OBJECT" ), iconSelect, aSelGrp1, MainObj1 ); + createSelWg(tr("GEOM_MAIN_OBJECT"), iconSelect, myGrp1, aLayout, MainObj1); - QGroupBox* aSpinGrp = new QGroupBox( 1, Qt::Vertical, myGrp1 ); - aSpinGrp->setFrameStyle( QFrame::NoFrame ); - aSpinGrp->setInsideMargin( 0 ); + int row = aLayout->rowCount(); + aLayout->addWidget(new QLabel(tr("D"), myGrp1), row, 0); + aLayout->addWidget((mySpinBox[ SpinBox1 ] = new QDoubleSpinBox(myGrp1)), row++, 2); + aLayout->setRowStretch(row, 10); - new QLabel( tr( "D" ), aSpinGrp ); - mySpinBox[ SpinBox1 ] = new DlgRef_SpinBox( aSpinGrp ); + // Create second group - ( new QFrame( myGrp1 ) )->setSizePolicy( - QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); + myGrp2 = new QGroupBox(tr("GEOM_CHAMFER_EDGES"), centralWidget()); - // Create second group + aLayout = new QGridLayout(myGrp2); + aLayout->setMargin(9); aLayout->setSpacing(6); - myGrp2 = new QGroupBox( 1, Qt::Horizontal, tr( "GEOM_CHAMFER_EDGES" ), this ); + createSelWg(tr("GEOM_MAIN_OBJECT"), iconSelect, myGrp2, aLayout, MainObj2); + createSelWg(tr("FACE_1"), iconSelect, myGrp2, aLayout, Face1); + createSelWg(tr("FACE_2"), iconSelect, myGrp2, aLayout, Face2); - QGroupBox* aSelGrp2 = new QGroupBox( 3, Qt::Horizontal, myGrp2 ); - aSelGrp2->setFrameStyle( QFrame::NoFrame ); - aSelGrp2->setInsideMargin( 0 ); + createRadioWg(tr("GEOM_D1"), tr("GEOM_D2"), myGrp2, aLayout, RadioButton21, SpinBox21, SpinBox22); + createRadioWg(tr("GEOM_D"), tr("GEOM_ANGLE"), myGrp2, aLayout, RadioButton22, SpinBox23, SpinBox24); - createSelWg( tr( "GEOM_MAIN_OBJECT" ), iconSelect, aSelGrp2, MainObj2 ); - createSelWg( tr( "FACE_1" ), iconSelect, aSelGrp2, Face1 ); - createSelWg( tr( "FACE_2" ), iconSelect, aSelGrp2, Face2 ); + aLayout->setRowStretch(aLayout->rowCount(), 10); - aSpinGrp = new QGroupBox( 1, Qt::Vertical, myGrp2 ); - aSpinGrp->setFrameStyle( QFrame::NoFrame ); - aSpinGrp->setInsideMargin( 0 ); + // Create third group - new QLabel( tr( "GEOM_D1" ), aSpinGrp ); - mySpinBox[ SpinBox21 ] = new DlgRef_SpinBox( aSpinGrp ); + myGrp3 = new QGroupBox(tr("GEOM_CHAMFER_FACES"), centralWidget()); - new QLabel( tr( "GEOM_D2" ), aSpinGrp ); - mySpinBox[ SpinBox22 ] = new DlgRef_SpinBox( aSpinGrp ); + aLayout = new QGridLayout(myGrp3); + aLayout->setMargin(9); aLayout->setSpacing(6); - // Create third group + createSelWg(tr("GEOM_MAIN_OBJECT"), iconSelect, myGrp3, aLayout, MainObj3); + createSelWg(tr("SELECTED_FACES"), iconSelect, myGrp3, aLayout, Faces); + + createRadioWg(tr("GEOM_D1"), tr("GEOM_D2"), myGrp3, aLayout, RadioButton31, SpinBox31, SpinBox32); + createRadioWg(tr("GEOM_D"), tr("GEOM_ANGLE"), myGrp3, aLayout, RadioButton32, SpinBox33, SpinBox34); - myGrp3 = new QGroupBox( 1, Qt::Horizontal, tr( "GEOM_CHAMFER_FACES" ), this ); + aLayout->setRowStretch(aLayout->rowCount(), 10); - QGroupBox* aSelGrp3 = new QGroupBox( 3, Qt::Horizontal, myGrp3 ); - aSelGrp3->setFrameStyle( QFrame::NoFrame ); - aSelGrp3->setInsideMargin( 0 ); + // Create fourth group - createSelWg( tr( "GEOM_MAIN_OBJECT" ), iconSelect, aSelGrp3, MainObj3 ); - createSelWg( tr( "SELECTED_FACES" ), iconSelect, aSelGrp3, Faces ); + myGrp4 = new QGroupBox(tr("GEOM_CHAMFER_EDGE"), centralWidget()); - aSpinGrp = new QGroupBox( 1, Qt::Vertical, myGrp3 ); - aSpinGrp->setFrameStyle( QFrame::NoFrame ); - aSpinGrp->setInsideMargin( 0 ); + aLayout = new QGridLayout(myGrp4); + aLayout->setMargin(9); aLayout->setSpacing(6); - new QLabel( tr( "GEOM_D1" ), aSpinGrp ); - mySpinBox[ SpinBox31 ] = new DlgRef_SpinBox( aSpinGrp ); + createSelWg(tr("GEOM_MAIN_OBJECT"), iconSelect, myGrp4, aLayout, MainObj4); + createSelWg(tr("SELECTED_EDGE"), iconSelect, myGrp4, aLayout, Edges); - new QLabel( tr( "GEOM_D2" ), aSpinGrp ); - mySpinBox[ SpinBox32 ] = new DlgRef_SpinBox( aSpinGrp ); + createRadioWg(tr("GEOM_D1"), tr("GEOM_D2"), myGrp4, aLayout, RadioButton41, SpinBox41, SpinBox42); + createRadioWg(tr("GEOM_D"), tr("GEOM_ANGLE"), myGrp4, aLayout, RadioButton42, SpinBox43, SpinBox44); - ( new QLabel( myGrp3 ) )->setSizePolicy( - QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); + aLayout->setRowStretch(aLayout->rowCount(), 10); // Add groups to layout - Layout1->addWidget( myGrp1, 2, 0 ); - Layout1->addWidget( myGrp2, 2, 0 ); - Layout1->addWidget( myGrp3, 2, 0 ); + QVBoxLayout* layout = new QVBoxLayout(centralWidget()); + layout->setMargin(0); layout->setSpacing(6); + layout->addWidget(myGrp1); + layout->addWidget(myGrp2); + layout->addWidget(myGrp3); + layout->addWidget(myGrp4); + /***************************************************************/ // Set range of spinboxes - double SpecificStep = 10.0; - QMap< int, DlgRef_SpinBox* >::iterator anIter; - for ( anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter ) - anIter.data()->RangeStepAndValidator( 0.001, 999.999, SpecificStep, 3 ); + QMap< int, QDoubleSpinBox* >::iterator anIter; + for (anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter) { + if (anIter.key() == SpinBox44 || anIter.key() == SpinBox34 || anIter.key() == SpinBox24) + initSpinBox(anIter.value(), 0.001, 89.999, 5, 0); + else + initSpinBox(anIter.value(), 0.001, COORD_MAX, SpecificStep, 3); + } - /* Initialisations */ - Init( mySelection ); -} + setHelpFileName("chamfer_operation_page.html"); + // Initialisation + Init(); + myRadioButton[ RadioButton21 ]->click(); +} //================================================================================= // function : ~OperationGUI_ChamferDlg() @@ -155,138 +168,197 @@ OperationGUI_ChamferDlg::~OperationGUI_ChamferDlg() { } - //================================================================================= // function : Init() // purpose : //================================================================================= -void OperationGUI_ChamferDlg::Init( SALOME_Selection* Sel ) +void OperationGUI_ChamferDlg::Init() { - mySelection = Sel; - myConstructorId = -1; - reset(); - RadioButton1->setChecked( true ); - myEditCurrentArgument = mySelName[ MainObj1 ]; + // Set Initial values of spinboxes + QMap< int, QDoubleSpinBox* >::iterator anIter; + for (anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter) + anIter.value()->setValue(5); - /* signals and slots connections */ + // Clear line edits + QMap< int, QLineEdit* >::iterator anIterLE; + for (anIterLE = mySelName.begin(); anIterLE != mySelName.end(); ++anIterLE) + anIterLE.value()->setText(""); + + myShape = GEOM::GEOM_Object::_nil(); + + myFaces.Clear(); + myEdges.Clear(); + myFace[ Face1 ] = -1; + myFace[ Face2 ] = -1; + + // signals and slots connections // main buttons - connect( buttonOk , SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) ); + connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk() )); + connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); // group box - connect( GroupConstructors, SIGNAL( clicked( int ) ), - this, SLOT( ConstructorsClicked( int ) ) ); + connect(this, SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int))); // push buttons QMap< int, QPushButton* >::iterator anIterBtn; - for ( anIterBtn = mySelBtn.begin(); anIterBtn != mySelBtn.end(); ++anIterBtn ) - connect( anIterBtn.data(), SIGNAL( clicked() ), - this, SLOT( SetEditCurrentArgument() ) ); + for (anIterBtn = mySelBtn.begin(); anIterBtn != mySelBtn.end(); ++anIterBtn) + connect(anIterBtn.value(), SIGNAL(clicked()), + this, SLOT(SetEditCurrentArgument())); // line edits QMap< int, QLineEdit* >::iterator anIterLE2; - for ( anIterLE2 = mySelName.begin(); anIterLE2 != mySelName.end(); ++anIterLE2 ) - connect( anIterLE2.data(), SIGNAL( returnPressed() ), - this, SLOT( LineEditReturnPressed() ) ); + for (anIterLE2 = mySelName.begin(); anIterLE2 != mySelName.end(); ++anIterLE2) + connect(anIterLE2.value(), SIGNAL(returnPressed()), + this, SLOT(LineEditReturnPressed())); // spin boxes - QMap< int, DlgRef_SpinBox* >::iterator anIterSpin; - for ( anIterSpin = mySpinBox.begin(); anIterSpin != mySpinBox.end(); ++anIterSpin ) - connect( anIterSpin.data(), SIGNAL( valueChanged( double ) ), - this, SLOT( ValueChangedInSpinBox( double ) ) ); - - // selection - connect( mySelection, SIGNAL( currentSelectionChanged() ), - this, SLOT( SelectionIntoArgument() ) ); + QMap< int, QDoubleSpinBox* >::iterator anIterSpin; + for (anIterSpin = mySpinBox.begin(); anIterSpin != mySpinBox.end(); ++anIterSpin) + connect(anIterSpin.value(), SIGNAL(valueChanged(double)), + this, SLOT(ValueChangedInSpinBox(double))); - initName( tr( "GEOM_CHAMFER" ) ); + // radio buttons + QMap< int, QRadioButton* >::iterator anIterRadio; + for (anIterRadio = myRadioButton.begin(); anIterRadio != myRadioButton.end(); ++anIterRadio) + connect(anIterRadio.value(), SIGNAL(clicked()), + this, SLOT(RadioButtonPressed())); - myGrp2->hide(); - myGrp3->hide(); - myGrp1->show(); + initName(tr("GEOM_CHAMFER")); - this->show(); + myConstructorId = -1; + ConstructorsClicked(0); } - //================================================================================= // function : ConstructorsClicked() // purpose : Radio button management //================================================================================= -void OperationGUI_ChamferDlg::ConstructorsClicked( int constructorId ) +void OperationGUI_ChamferDlg::ConstructorsClicked (int constructorId) { // Activate next widget - if ( QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC ) - { - RadioButton1->setChecked( true ); + if (myGeomGUI->getApp()->desktop()->activeWindow()->getViewManager()->getType() + != OCCViewer_Viewer::Type()) { + mainFrame()->RadioButton1->setChecked(true); return; - } - - if ( myConstructorId == constructorId ) + } + + if (myConstructorId == constructorId) return; + //disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); + // Get values from previous widget - double D1 = 5, D2 = 5; - if ( myConstructorId == 0 ) - D1 = D2 = mySpinBox[ SpinBox1 ]->GetValue(); - else if ( myConstructorId == 1 ) - { - D1 = mySpinBox[ SpinBox21 ]->GetValue(); - D2 = mySpinBox[ SpinBox22 ]->GetValue(); + double D1 = 5, D2 = 5, D = 5, Angle = 5; + if (myConstructorId == 0) + D1 = D2 = mySpinBox[ SpinBox1 ]->value(); + else if (myConstructorId == 1) { + D1 = mySpinBox[ SpinBox21 ]->value(); + D2 = mySpinBox[ SpinBox22 ]->value(); + D = mySpinBox[ SpinBox23 ]->value(); + Angle = mySpinBox[ SpinBox24 ]->value(); } - else if ( myConstructorId == 2 ) - { - D1 = mySpinBox[ SpinBox31 ]->GetValue(); - D2 = mySpinBox[ SpinBox32 ]->GetValue(); + else if (myConstructorId == 2) { + D1 = mySpinBox[ SpinBox31 ]->value(); + D2 = mySpinBox[ SpinBox32 ]->value(); + D = mySpinBox[ SpinBox33 ]->value(); + Angle = mySpinBox[ SpinBox34 ]->value(); + } + else if (myConstructorId == 3) { + D1 = mySpinBox[ SpinBox41 ]->value(); + D2 = mySpinBox[ SpinBox42 ]->value(); + D = mySpinBox[ SpinBox43 ]->value(); + Angle = mySpinBox[ SpinBox44 ]->value(); } myConstructorId = constructorId; - switch ( constructorId ) - { - case 0: - myGrp1->show(); - myGrp2->hide(); - myGrp3->hide(); - mySpinBox[ SpinBox1 ]->SetValue( D1 ); + switch (constructorId) { + case 0: + myGrp2->hide(); + myGrp3->hide(); + myGrp4->hide(); + myGrp1->show(); + mySpinBox[ SpinBox1 ]->setValue(D1); + break; + case 1: + myGrp1->hide(); + myGrp3->hide(); + myGrp4->hide(); + myGrp2->show(); + mySpinBox[ SpinBox21 ]->setValue(D1); + mySpinBox[ SpinBox22 ]->setValue(D2); + mySpinBox[ SpinBox23 ]->setValue(D); + mySpinBox[ SpinBox24 ]->setValue(Angle); break; - case 1: - myGrp1->hide(); - myGrp2->show(); - myGrp3->hide(); - mySpinBox[ SpinBox21 ]->SetValue( D1 ); - mySpinBox[ SpinBox22 ]->SetValue( D2 ); + case 2: + myGrp1->hide(); + myGrp2->hide(); + myGrp4->hide(); + myGrp3->show(); + mySpinBox[ SpinBox31 ]->setValue(D1); + mySpinBox[ SpinBox32 ]->setValue(D2); + mySpinBox[ SpinBox32 ]->setValue(D2); + mySpinBox[ SpinBox33 ]->setValue(D); + mySpinBox[ SpinBox34 ]->setValue(Angle); break; - case 2: - myGrp1->hide(); - myGrp2->hide(); - myGrp3->show(); - mySpinBox[ SpinBox31 ]->SetValue( D1 ); - mySpinBox[ SpinBox32 ]->SetValue( D2 ); + case 3: + myGrp1->hide(); + myGrp2->hide(); + myGrp3->hide(); + myGrp4->show(); + mySpinBox[ SpinBox41 ]->setValue(D1); + mySpinBox[ SpinBox42 ]->setValue(D2); + mySpinBox[ SpinBox43 ]->setValue(D); + mySpinBox[ SpinBox44 ]->setValue(Angle); break; - default: + default: break; } - if ( constructorId == 0 ) myEditCurrentArgument = mySelName[ MainObj1 ]; - else if ( constructorId == 1 ) myEditCurrentArgument = mySelName[ MainObj2 ]; - else myEditCurrentArgument = mySelName[ MainObj3 ]; + if (constructorId == 0) mySelBtn[ MainObj1 ]->click(); + else if (constructorId == 1) mySelBtn[ MainObj2 ]->click(); + else if (constructorId == 2) mySelBtn[ MainObj3 ]->click(); + else mySelBtn[ MainObj4 ]->click(); - activateSelection(); enableWidgets(); - - if ( !myShape->_is_nil() ) - { - myEditCurrentArgument->setText( GEOMBase::GetName( myShape ) ); - GEOMBase_Skeleton::LineEditReturnPressed(); + + if (myInitial) { + myInitial = false; + SelectionIntoArgument(); } - else - myEditCurrentArgument->setText( "" ); + else { + if (!myShape->_is_nil()) { + myEditCurrentArgument->setText(GEOMBase::GetName(myShape)); + GEOMBase_Skeleton::LineEditReturnPressed(); + switch (getConstructorId()) { + case 1: + if (myFace[ Face1 ] == -1) + mySelBtn[ Face1 ]->click(); + break; + case 2: + if (myFaces.Extent() == 0) + mySelBtn[ Faces ]->click(); + break; + case 3: + if (myEdges.Extent() == 0) + mySelBtn[ Edges ]->click(); + break; + default: + break; + } + } + else { + myEditCurrentArgument->setText(""); + } - displayPreview(); -} + displayPreview(); + } + qApp->processEvents(); + updateGeometry(); + resize(minimumSize()); +} //================================================================================= // function : ClickOnOk() @@ -294,7 +366,7 @@ void OperationGUI_ChamferDlg::ConstructorsClicked( int constructorId ) //================================================================================= void OperationGUI_ChamferDlg::ClickOnOk() { - if ( ClickOnApply() ) + if (ClickOnApply()) ClickOnCancel(); } @@ -304,168 +376,203 @@ void OperationGUI_ChamferDlg::ClickOnOk() //================================================================================= bool OperationGUI_ChamferDlg::ClickOnApply() { - if ( !onAccept() ) + if (!onAccept()) return false; initName(); + // activate selection and connect selection manager + ConstructorsClicked(getConstructorId()); return true; } - //================================================================================= // function : SelectionIntoArgument() -// purpose : Called when selection has changed +// purpose : Called when selection is changed or on dialog initialization or activation //================================================================================= void OperationGUI_ChamferDlg::SelectionIntoArgument() { erasePreview(); - myEditCurrentArgument->setText( "" ); + myEditCurrentArgument->setText(""); // Get index of current selection focus int aCurrFocus = -1; QMap< int, QLineEdit* >::iterator anIter; - for ( anIter = mySelName.begin(); anIter != mySelName.end(); ++anIter ) - if ( myEditCurrentArgument == anIter.data() ) - { + for (anIter = mySelName.begin(); anIter != mySelName.end(); ++anIter) { + if (myEditCurrentArgument == anIter.value()) { aCurrFocus = anIter.key(); break; } + } + + LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); + SALOME_ListIO aSelList; + aSelMgr->selectedObjects(aSelList); // If selection of main object is activated - if ( aCurrFocus == MainObj1 || aCurrFocus == MainObj2 || aCurrFocus == MainObj3 ) + if (aCurrFocus == MainObj1 || aCurrFocus == MainObj2 || aCurrFocus == MainObj3 || aCurrFocus == MainObj4) { - if ( mySelection->IObjectCount() == 1 ) - { + myShape = GEOM::GEOM_Object::_nil(); + if (aSelList.Extent() == 1) { Standard_Boolean aResult = Standard_False; GEOM::GEOM_Object_var anObj = - GEOMBase::ConvertIOinGEOMObject( mySelection->firstIObject(), aResult ); + GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult); - if ( aResult && !anObj->_is_nil() ) - { + if (aResult && !anObj->_is_nil()) { myShape = anObj; - mySelName[ aCurrFocus ]->setText( GEOMBase::GetName( anObj ) ); + myEditCurrentArgument->setText(GEOMBase::GetName(anObj)); displayPreview(); - enableWidgets(); - return; } } - myShape = GEOM::GEOM_Object::_nil(); enableWidgets(); } // If face selection of second tab is activated - else if ( aCurrFocus == Face1 || aCurrFocus == Face2 ) + else if (aCurrFocus == Face1 || aCurrFocus == Face2) { - if ( mySelection->IObjectCount() == 1 ) - { + myFace[ aCurrFocus ] = -1; + if (aSelList.Extent() == 1) { Standard_Boolean aResult = Standard_False; GEOM::GEOM_Object_var anObj = - GEOMBase::ConvertIOinGEOMObject( mySelection->firstIObject(), aResult ); + GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult); - if ( aResult && !anObj->_is_nil() ) - { + if (aResult && !anObj->_is_nil()) { TColStd_IndexedMapOfInteger anIndexes; - mySelection->GetIndex( mySelection->firstIObject(), anIndexes ); + aSelMgr->GetIndexes(aSelList.First(), anIndexes); - if ( anIndexes.Extent() == 1 ) - { - int anIndex = anIndexes( 1 ); - QString aFaceName = QString( GEOMBase::GetName( anObj ) ) + ":%1"; - myEditCurrentArgument->setText( aFaceName.arg( anIndex ) ); + if (anIndexes.Extent() == 1) { + int anIndex = anIndexes(1); + QString aFaceName = QString(GEOMBase::GetName(anObj)) + ":%1"; + myEditCurrentArgument->setText(aFaceName.arg(anIndex)); myFace[ aCurrFocus ] = anIndex; displayPreview(); - return; } } } - - myFace[ aCurrFocus ] = -1; } - // If face selection of third tab is activated - else if ( aCurrFocus == Faces ) - { - if ( mySelection->IObjectCount() == 1 ) - { + // If face selection of third or fourth tab is activated + else if (aCurrFocus == Faces || aCurrFocus == Edges) { + if (aCurrFocus == Faces) myFaces.Clear(); + else myEdges.Clear(); + if (aSelList.Extent() == 1) { Standard_Boolean aResult = Standard_False; GEOM::GEOM_Object_var anObj = - GEOMBase::ConvertIOinGEOMObject( mySelection->firstIObject(), aResult ); - - if ( aResult && !anObj->_is_nil() ) - { - TColStd_IndexedMapOfInteger anIndexes; - mySelection->GetIndex( mySelection->firstIObject(), anIndexes ); - - if ( anIndexes.Extent() > 0 ) - { - QString aFaceName; - if ( anIndexes.Extent() == 1 ) - { - int anIndex = anIndexes( 1 ); - - aFaceName = QString( GEOMBase::GetName( anObj ) ) + QString( ":%1" ).arg( anIndex ); - } - else - aFaceName = tr( "GEOM_MEN_POPUP_NAME" ).arg( anIndexes.Extent() ); - - myEditCurrentArgument->setText( aFaceName ); - myFaces = anIndexes; - displayPreview(); - return; - } + GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult); + + if (aResult && !anObj->_is_nil()) { + TColStd_IndexedMapOfInteger anIndexes; + aSelMgr->GetIndexes(aSelList.First(), anIndexes); + + if (anIndexes.Extent() > 0) { + QString aName; + if (anIndexes.Extent() == 1) { + int anIndex = anIndexes(1); + + aName = QString(GEOMBase::GetName(anObj)) + QString(":%1").arg(anIndex); + } + else { + aName = tr("GEOM_MEN_POPUP_NAME").arg(anIndexes.Extent()); + } + + myEditCurrentArgument->setText(aName); + int aConstructorId = getConstructorId(); + if (aConstructorId == 2) + myFaces = anIndexes; + else if (aConstructorId == 3) + myEdges = anIndexes; + + displayPreview(); + } } } - myFaces.Clear(); } -} - - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void OperationGUI_ChamferDlg::LineEditReturnPressed() -{ - QLineEdit* aSender = ( QLineEdit* )sender(); - QMap< int, QLineEdit* >::iterator anIterLE; - for ( anIterLE = mySelName.begin(); anIterLE != mySelName.end(); ++anIterLE ) - if ( anIterLE.data() == aSender ) - myEditCurrentArgument = anIterLE.data(); + // clear selection + if (aCurrFocus != Faces && aCurrFocus != Edges) { + disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); + myGeomGUI->getApp()->selectionMgr()->clearSelected(); + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(SelectionIntoArgument())); + } - GEOMBase_Skeleton::LineEditReturnPressed(); + switch (getConstructorId()) { + case 1: + if (aCurrFocus == MainObj2) { + if (!myShape->_is_nil() && myFace[ Face1 ] == -1) + mySelBtn[ Face1 ]->click(); + } + else if (aCurrFocus == Face1) { + if (myFace[ Face1 ] != -1 && myFace[ Face2 ] == -1) + mySelBtn[ Face2 ]->click(); + } + else if (aCurrFocus == Face2) { + if (myFace[ Face2 ] != -1 && myShape->_is_nil()) + mySelBtn[ MainObj2 ]->click(); + } + break; + case 2: + if (aCurrFocus == MainObj3) { + if (!myShape->_is_nil() && myFaces.Extent() == 0) + mySelBtn[ Faces ]->click(); + } + break; + case 3: + if (aCurrFocus == MainObj4) { + if (!myShape->_is_nil() && myEdges.Extent() == 0) + mySelBtn[ Edges ]->click(); + } + break; + default: + break; + } } - //================================================================================= // function : SetEditCurrentArgument() // purpose : //================================================================================= void OperationGUI_ChamferDlg::SetEditCurrentArgument() { - QPushButton* aSender = ( QPushButton* )sender(); + QPushButton* send = (QPushButton*)sender(); QMap< int, QPushButton* >::iterator anIter; - for ( anIter = mySelBtn.begin(); anIter != mySelBtn.end(); ++anIter ) - if ( anIter.data() == aSender ) - { + for (anIter = mySelBtn.begin(); anIter != mySelBtn.end(); ++anIter) { + if (anIter.value() == send) { mySelName[ anIter.key() ]->setFocus(); myEditCurrentArgument = mySelName[ anIter.key() ]; } + else { + anIter.value()->setDown(false); + mySelName[ anIter.key() ]->setEnabled(false); + } + } + + // enable line edit + myEditCurrentArgument->setEnabled(true); + myEditCurrentArgument->setFocus(); + // after setFocus(), because it will be setDown(false) when loses focus + send->setDown(true); activateSelection(); -} + // seems we need it only to avoid preview disappearing, caused by selection mode change + displayPreview(); +} //================================================================================= -// function : DeactivateActiveDialog() +// function : LineEditReturnPressed() // purpose : //================================================================================= -void OperationGUI_ChamferDlg::DeactivateActiveDialog() +void OperationGUI_ChamferDlg::LineEditReturnPressed() { - // disconnect selection - GEOMBase_Skeleton::DeactivateActiveDialog(); -} + QLineEdit* send = (QLineEdit*)sender(); + + QMap< int, QLineEdit* >::iterator anIterLE; + for (anIterLE = mySelName.begin(); anIterLE != mySelName.end(); ++anIterLE) + if (anIterLE.value() == send) + myEditCurrentArgument = anIterLE.value(); + GEOMBase_Skeleton::LineEditReturnPressed(); +} //================================================================================= // function : ActivateThisDialog() @@ -475,94 +582,73 @@ void OperationGUI_ChamferDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - connect( mySelection, SIGNAL(currentSelectionChanged()), - this, SLOT( SelectionIntoArgument() ) ); - - activateSelection(); - displayPreview(); + // reinit, because some selected objects could be removed + Init(); } - //================================================================================= // function : enterEvent() // purpose : //================================================================================= -void OperationGUI_ChamferDlg::enterEvent(QEvent* e) +void OperationGUI_ChamferDlg::enterEvent (QEvent*) { - if ( !GroupConstructors->isEnabled() ) + if (!mainFrame()->GroupConstructors->isEnabled()) this->ActivateThisDialog(); } - //================================================================================= // function : ValueChangedInSpinBox() // purpose : //================================================================================= -void OperationGUI_ChamferDlg::ValueChangedInSpinBox( double newValue ) +void OperationGUI_ChamferDlg::ValueChangedInSpinBox (double) { displayPreview(); } - //================================================================================= // function : createSelWg() // purpose : //================================================================================= -void OperationGUI_ChamferDlg::createSelWg( const QString& theLbl, +void OperationGUI_ChamferDlg::createSelWg (const QString& theLbl, QPixmap& thePix, QWidget* theParent, - const int theId ) + QGridLayout* theLayout, + const int theId) { - new QLabel( theLbl, theParent ); - mySelBtn[ theId ] = new QPushButton( theParent ); - mySelBtn[ theId ]->setPixmap( thePix ); - mySelName[ theId ] = new QLineEdit( theParent ); - mySelName[ theId ]->setReadOnly( true ); + QLabel* lab = new QLabel(theLbl, theParent); + mySelBtn[ theId ] = new QPushButton(theParent); + mySelBtn[ theId ]->setIcon(thePix); + mySelName[ theId ] = new QLineEdit(theParent); + mySelName[ theId ]->setReadOnly(true); + int row = theLayout->rowCount(); + theLayout->addWidget(lab, row, 0); + theLayout->addWidget(mySelBtn[ theId ], row, 1); + theLayout->addWidget(mySelName[ theId ], row, 2, 1, 4); // take into account createRadioWg() } //================================================================================= -// function : reset() +// function : createRadioWg() // purpose : //================================================================================= -void OperationGUI_ChamferDlg::reset() +void OperationGUI_ChamferDlg::createRadioWg(const QString& theLbl1, + const QString& theLbl2, + QWidget* theParent, + QGridLayout* theLayout, + const int theRbId, + const int theSpin1Id, + const int theSpin2Id) { - // Set Initial values of spinboxes - QMap< int, DlgRef_SpinBox* >::iterator anIter; - for ( anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter ) - anIter.data()->SetValue( 5 ); - - // clear line edits - QMap< int, QLineEdit* >::iterator anIterLE; - for ( anIterLE = mySelName.begin(); anIterLE != mySelName.end(); ++anIterLE ) - anIterLE.data()->setText( "" ); - - // constructor id - int aConstructorId = getConstructorId(); - - if ( aConstructorId == 0 ) myEditCurrentArgument = mySelName[ MainObj1 ]; - else if ( aConstructorId == 1 ) myEditCurrentArgument = mySelName[ MainObj2 ]; - else myEditCurrentArgument = mySelName[ MainObj3 ]; - - myShape = GEOM::GEOM_Object::_nil(); - - myFaces.Clear(); - myFace[ Face1 ] = -1; - myFace[ Face2 ] = -1; - - erasePreview( true ); - - activateSelection(); - - enableWidgets(); -} - -//================================================================================= -// function : getConstructorId() -// purpose : -//================================================================================= -int OperationGUI_ChamferDlg::getConstructorId() const -{ - return GroupConstructors->id( GroupConstructors->selected() ); + myRadioButton[ theRbId ] = new QRadioButton(theParent); + QLabel* lab1 = new QLabel(theLbl1, theParent); + QLabel* lab2 = new QLabel(theLbl2, theParent); + mySpinBox[ theSpin1Id ] = new QDoubleSpinBox(theParent); + mySpinBox[ theSpin2Id ] = new QDoubleSpinBox(theParent); + int row = theLayout->rowCount(); + theLayout->addWidget(myRadioButton[ theRbId ], row, 0); + theLayout->addWidget(lab1, row, 2); + theLayout->addWidget(mySpinBox[ theSpin1Id ], row, 3); + theLayout->addWidget(lab2, row, 4); + theLayout->addWidget(mySpinBox[ theSpin2Id ], row, 5); } //================================================================================= @@ -571,21 +657,27 @@ int OperationGUI_ChamferDlg::getConstructorId() const //================================================================================= void OperationGUI_ChamferDlg::activateSelection() { - if ( !myShape->_is_nil() && - ( myEditCurrentArgument == mySelName[ Face1 ] || - myEditCurrentArgument == mySelName[ Face2 ] || - myEditCurrentArgument == mySelName[ Faces ] ) ) - localSelection( myShape, TopAbs_FACE ); - else - { + disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); + + if (!myShape->_is_nil() && + (myEditCurrentArgument == mySelName[ Face1 ] || + myEditCurrentArgument == mySelName[ Face2 ] || + myEditCurrentArgument == mySelName[ Faces ])) { + localSelection(myShape, TopAbs_FACE); + } + else if (!myShape->_is_nil() && myEditCurrentArgument == mySelName[ Edges ]) { + localSelection(myShape, TopAbs_EDGE); + } + else { TColStd_MapOfInteger aMap; - aMap.Add( GEOM_SHELL ); - aMap.Add( GEOM_SOLID ); - aMap.Add( GEOM_COMPOUND ); - globalSelection( aMap ); + aMap.Add(GEOM_SHELL); + aMap.Add(GEOM_SOLID); + aMap.Add(GEOM_COMPOUND); + globalSelection(aMap); } - SelectionIntoArgument(); + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(SelectionIntoArgument())); } //================================================================================= @@ -597,28 +689,39 @@ void OperationGUI_ChamferDlg::enableWidgets() int anId = getConstructorId(); bool toEnable = !myShape->_is_nil(); - - if ( anId == 1 ) + + if (anId == 1) { - mySelName[ Face1 ]->setEnabled( toEnable ); - mySelName[ Face2 ]->setEnabled( toEnable ); - mySelBtn[ Face1 ]->setEnabled( toEnable ); - mySelBtn[ Face2 ]->setEnabled( toEnable ); + //mySelName[ Face1 ]->setEnabled(toEnable); + //mySelName[ Face2 ]->setEnabled(toEnable); + mySelBtn[ Face1 ]->setEnabled(toEnable); + mySelBtn[ Face2 ]->setEnabled(toEnable); - if ( !toEnable ) + if (!toEnable) { - mySelName[ Face1 ]->setText( "" ); - mySelName[ Face2 ]->setText( "" ); + mySelName[ Face1 ]->setText(""); + mySelName[ Face2 ]->setText(""); myFace[ Face1 ] = -1; myFace[ Face2 ] = -1; } } - else if ( anId == 2 ) + else if (anId == 2) { - mySelName[ Faces ]->setEnabled( toEnable ); - - if ( !toEnable ) + //mySelName[ Faces ]->setEnabled(toEnable); + mySelBtn[ Faces ]->setEnabled(toEnable); + if (!toEnable) { + mySelName[ Faces ]->setText(""); myFaces.Clear(); + } + } + else if (anId == 3) { + //mySelName[ Edges ]->setEnabled(toEnable); + mySelBtn[ Edges ]->setEnabled(toEnable); + + if (!toEnable) { + mySelName[ Edges ]->setText(""); + myEdges.Clear(); + } } } @@ -628,20 +731,21 @@ void OperationGUI_ChamferDlg::enableWidgets() //================================================================================= GEOM::GEOM_IOperations_ptr OperationGUI_ChamferDlg::createOperation() { - return getGeomEngine()->GetILocalOperations( getStudyId() ); + return getGeomEngine()->GetILocalOperations(getStudyId()); } //================================================================================= -// function : ClickOnApply() +// function : isValid() // purpose : Verify validity of input data //================================================================================= -bool OperationGUI_ChamferDlg::isValid( QString& ) +bool OperationGUI_ChamferDlg::isValid (QString&) { - switch ( getConstructorId() ) + switch (getConstructorId()) { case 0: return !myShape->_is_nil(); case 1: return !myShape->_is_nil() && myFace[ Face1 ] > 0 && myFace[ Face2 ] > 0; case 2: return !myShape->_is_nil() && myFaces.Extent() > 0; + case 3: return !myShape->_is_nil() && myEdges.Extent() > 0; default: return false; } } @@ -650,52 +754,127 @@ bool OperationGUI_ChamferDlg::isValid( QString& ) // function : execute // purpose : //================================================================================= -bool OperationGUI_ChamferDlg::execute( ObjectList& objects ) +bool OperationGUI_ChamferDlg::execute (ObjectList& objects) { GEOM::GEOM_Object_var anObj; + bool flag = (myRadioButton[ RadioButton21 ]->isChecked() && + myRadioButton[ RadioButton31 ]->isChecked() && + myRadioButton[ RadioButton41 ]->isChecked()); int anId = getConstructorId(); - if ( anId == 0 ) - anObj = GEOM::GEOM_ILocalOperations::_narrow( - getOperation() )->MakeChamferAll( myShape, - mySpinBox[ SpinBox1 ]->GetValue() ); - else if ( anId == 1 ) - anObj = GEOM::GEOM_ILocalOperations::_narrow( - getOperation() )->MakeChamferEdge( myShape, - mySpinBox[ SpinBox21 ]->GetValue(), - mySpinBox[ SpinBox22 ]->GetValue(), - myFace[ Face1 ], - myFace[ Face2 ] ); - else if ( anId == 2 ) + if (anId == 0) { + anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())-> + MakeChamferAll(myShape, mySpinBox[ SpinBox1 ]->value()); + } + else if (anId == 1) { + if (flag) { + anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())-> + MakeChamferEdge(myShape, + mySpinBox[ SpinBox21 ]->value(), + mySpinBox[ SpinBox22 ]->value(), + myFace[ Face1 ], + myFace[ Face2 ]); + } + else { + anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())-> + MakeChamferEdgeAD(myShape, + mySpinBox[ SpinBox23 ]->value(), + mySpinBox[ SpinBox24 ]->value() * PI180, + myFace[ Face1 ], + myFace[ Face2 ]); + } + } + else if (anId == 2) { - - int i = 0; GEOM::ListOfLong_var anArray = new GEOM::ListOfLong; - anArray->length( myFaces.Extent() ); - - - for ( int i = 1, n = myFaces.Extent(); i <= n; i++ ) - anArray[ i - 1 ] = myFaces( i ); - - anObj = GEOM::GEOM_ILocalOperations::_narrow( - getOperation() )->MakeChamferFaces( myShape, - mySpinBox[ SpinBox31 ]->GetValue(), - mySpinBox[ SpinBox32 ]->GetValue(), - anArray ); + anArray->length(myFaces.Extent()); + + for (int i = 1, n = myFaces.Extent(); i <= n; i++) + anArray[ i - 1 ] = myFaces(i); + + if (flag) + anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())-> + MakeChamferFaces(myShape, + mySpinBox[ SpinBox31 ]->value(), + mySpinBox[ SpinBox32 ]->value(), + anArray); + else + anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())-> + MakeChamferFacesAD(myShape, + mySpinBox[ SpinBox33 ]->value(), + mySpinBox[ SpinBox34 ]->value() * PI180, + anArray); + } + else if (anId == 3) { + GEOM::ListOfLong_var anArray = new GEOM::ListOfLong; + anArray->length(myEdges.Extent()); + for (int i = 1, n = myEdges.Extent(); i <= n; i++) + anArray[ i - 1 ] = myEdges(i); + if (flag) { + anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())-> + MakeChamferEdges(myShape, + mySpinBox[ SpinBox41 ]->value(), + mySpinBox[ SpinBox42 ]->value(), + anArray); + } + else { + anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())-> + MakeChamferEdgesAD(myShape, + mySpinBox[ SpinBox43 ]->value(), + mySpinBox[ SpinBox44 ]->value() * PI180, + anArray); + } } - - if ( !anObj->_is_nil() ) - objects.push_back( anObj._retn() ); + if (!anObj->_is_nil()) + objects.push_back(anObj._retn()); return true; } +//================================================================================= +// function : RadioButtonPressed() +// purpose : +//================================================================================= +void OperationGUI_ChamferDlg::RadioButtonPressed() +{ + const QObject* s = sender(); + bool flag = s == myRadioButton[ RadioButton21 ] || + s == myRadioButton[ RadioButton31 ] || + s == myRadioButton[ RadioButton41 ]; + + myRadioButton[ RadioButton21 ]->blockSignals(true); + myRadioButton[ RadioButton22 ]->blockSignals(true); + myRadioButton[ RadioButton31 ]->blockSignals(true); + myRadioButton[ RadioButton32 ]->blockSignals(true); + myRadioButton[ RadioButton41 ]->blockSignals(true); + myRadioButton[ RadioButton42 ]->blockSignals(true); + + myRadioButton[ RadioButton21 ]->setChecked(flag); + myRadioButton[ RadioButton31 ]->setChecked(flag); + myRadioButton[ RadioButton41 ]->setChecked(flag); + myRadioButton[ RadioButton22 ]->setChecked(!flag); + myRadioButton[ RadioButton32 ]->setChecked(!flag); + myRadioButton[ RadioButton42 ]->setChecked(!flag); + mySpinBox[ SpinBox21 ]->setEnabled(flag); + mySpinBox[ SpinBox22 ]->setEnabled(flag); + mySpinBox[ SpinBox31 ]->setEnabled(flag); + mySpinBox[ SpinBox32 ]->setEnabled(flag); + mySpinBox[ SpinBox41 ]->setEnabled(flag); + mySpinBox[ SpinBox42 ]->setEnabled(flag); + mySpinBox[ SpinBox23 ]->setEnabled(!flag); + mySpinBox[ SpinBox24 ]->setEnabled(!flag); + mySpinBox[ SpinBox33 ]->setEnabled(!flag); + mySpinBox[ SpinBox34 ]->setEnabled(!flag); + mySpinBox[ SpinBox43 ]->setEnabled(!flag); + mySpinBox[ SpinBox44 ]->setEnabled(!flag); + + myRadioButton[ RadioButton21 ]->blockSignals(false); + myRadioButton[ RadioButton22 ]->blockSignals(false); + myRadioButton[ RadioButton31 ]->blockSignals(false); + myRadioButton[ RadioButton32 ]->blockSignals(false); + myRadioButton[ RadioButton41 ]->blockSignals(false); + myRadioButton[ RadioButton42 ]->blockSignals(false); - - - - - - - + displayPreview(); +}