1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // File : StdMeshersGUI_QuadrangleParamWdg.cxx
20 // Author : Open CASCADE S.A.S. (jfa)
23 #include "StdMeshersGUI_QuadrangleParamWdg.h"
27 #include "SUIT_ResourceMgr.h"
30 #include <QButtonGroup>
31 #include <QRadioButton>
33 #include <QGridLayout>
36 #include <SALOMEconfig.h>
37 #include CORBA_CLIENT_HEADER(SMESH_BasicHypothesis)
42 //================================================================================
43 // function : Constructor
45 //================================================================================
46 StdMeshersGUI_QuadrangleParamWdg::StdMeshersGUI_QuadrangleParamWdg (QWidget * parent)
50 myType = new QButtonGroup (this);
52 QGridLayout* typeLay = new QGridLayout( this );
54 typeLay->setMargin(MARGIN);
55 typeLay->setSpacing(SPACING);
57 QString aTypeKey ("SMESH_QUAD_TYPE_%1");
58 QString aPictKey ("ICON_StdMeshers_Quadrangle_Params_%1");
61 for (; itype < int(StdMeshers::QUAD_NB_TYPES); itype++) {
62 QRadioButton* rbi = new QRadioButton (tr(aTypeKey.arg(itype).toLatin1()), this);
63 QPixmap pmi (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr(aPictKey.arg(itype).toLatin1())));
64 QLabel* pli = new QLabel (this);
66 typeLay->addWidget(rbi, itype, 0, 1, 1);
67 typeLay->addWidget(pli, itype, 1, 1, 1);
68 myType->addButton(rbi, itype);
70 myType->button(0)->setChecked(true);
76 //================================================================================
77 // function : Destructor
79 //================================================================================
80 StdMeshersGUI_QuadrangleParamWdg::~StdMeshersGUI_QuadrangleParamWdg()
84 //=================================================================================
87 //=================================================================================
88 void StdMeshersGUI_QuadrangleParamWdg::SetType (int theType)
90 myType->button(theType)->setChecked(true);
93 //=================================================================================
96 //=================================================================================
97 int StdMeshersGUI_QuadrangleParamWdg::GetType()
99 return myType->checkedId();