X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FSMESHGUI%2FSMESHGUI_ConvToQuadDlg.cxx;h=57b69e7b66fa1798fecd948189e0c6de315385f6;hb=373c03904b8e3fc5490ff4e17716f0cdcb39c03c;hp=161a5f69628818bfda16d6233e7a24c5dbfeafc8;hpb=d992d85973a627445c091bd3f6df766b4990b282;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_ConvToQuadDlg.cxx b/src/SMESHGUI/SMESHGUI_ConvToQuadDlg.cxx index 161a5f696..57b69e7b6 100644 --- a/src/SMESHGUI/SMESHGUI_ConvToQuadDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ConvToQuadDlg.cxx @@ -1,23 +1,23 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// Copyright (C) 2003-2007 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 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. +// 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 +// 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 +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // SMESH SMESHGUI : GUI for SMESH component @@ -27,6 +27,8 @@ // #include "SMESHGUI_ConvToQuadDlg.h" +#include "SMESHGUI_ConvToQuadOp.h" + // Qt includes #include #include @@ -62,14 +64,17 @@ SMESHGUI_ConvToQuadDlg::SMESHGUI_ConvToQuadDlg() aBGLayout->setMargin(MARGIN); aBGLayout->setSpacing(SPACING); - myRB1 = new QRadioButton( tr( "RADIOBTN_1" ), myBGBox ); - myRB2 = new QRadioButton( tr( "RADIOBTN_2" ), myBGBox ); - - aBGLayout->addWidget(myRB1); - aBGLayout->addWidget(myRB2); - myBG->addButton(myRB1, 0); - myBG->addButton(myRB2, 1); - myRB1->setChecked( true ); + myRB2Lin = new QRadioButton( tr( "RADIOBTN_1" ), myBGBox ); + myRB2Quad = new QRadioButton( tr( "RADIOBTN_2" ), myBGBox ); + myRB2BiQua = new QRadioButton( tr( "RADIOBTN_3" ), myBGBox ); + + aBGLayout->addWidget(myRB2Lin); + aBGLayout->addWidget(myRB2Quad); + aBGLayout->addWidget(myRB2BiQua); + myBG->addButton(myRB2Lin, 0); + myBG->addButton(myRB2Quad, 1); + myBG->addButton(myRB2BiQua, 2); + myRB2Lin->setChecked( true ); myWarning = new QLabel(QString("%1").arg(tr("NON_CONFORM_WARNING")), mainFrame()); @@ -92,6 +97,11 @@ SMESHGUI_ConvToQuadDlg::~SMESHGUI_ConvToQuadDlg() { } +bool SMESHGUI_ConvToQuadDlg::IsBiQuadratic() const +{ + return myRB2BiQua->isChecked(); +} + bool SMESHGUI_ConvToQuadDlg::IsMediumNdsOnGeom() const { return !myMedNdsOnGeom->isChecked(); @@ -133,27 +143,32 @@ bool SMESHGUI_ConvToQuadDlg::isWarningShown() void SMESHGUI_ConvToQuadDlg::SetEnabledControls( const bool theCheck ) { //myBGBox->setEnabled( theCheck ); - myRB1->setEnabled( theCheck ); - myRB2->setEnabled( theCheck ); + myRB2Lin->setEnabled( theCheck ); + myRB2Quad->setEnabled( theCheck ); + myRB2BiQua->setEnabled( theCheck ); myMedNdsOnGeom->setEnabled( theCheck ); //setButtonEnabled( theCheck, QtxDialog::OK | QtxDialog::Apply ); } void SMESHGUI_ConvToQuadDlg::SetEnabledRB( const int idx, const bool theCheck ) { - if(idx) + myRB2Lin ->setEnabled( idx & SMESHGUI_ConvToQuadOp::Linear ); + myRB2Quad ->setEnabled( idx & SMESHGUI_ConvToQuadOp::Quadratic ); + myRB2BiQua->setEnabled( idx & SMESHGUI_ConvToQuadOp::BiQuadratic ); + + if ( idx & SMESHGUI_ConvToQuadOp::Linear ) { - myRB2->setEnabled( theCheck ); - myRB1->setEnabled( !theCheck ); - myRB1->setChecked( true ); + myRB2Lin->setChecked( true ); + myRB2Quad->setChecked( false ); } else { - myRB1->setEnabled( theCheck ); - myRB2->setEnabled( !theCheck ); - myRB2->setChecked( true ); + myRB2Lin->setChecked( false ); + myRB2Quad->setChecked( true ); } - emit onClicked( myBG->checkedId() ); -} + myRB2BiQua->setChecked( false ); + myMedNdsOnGeom->setEnabled( theCheck ); + emit onClicked( myBG->checkedId() ); +}