Salome HOME
Issue #1660: Ability to change the deflection coefficient
[modules/shaper.git] / src / XGUI / XGUI_DeflectionDialog.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        XGUI_DeflectionDialog.cpp
4 // Created:     27 Jul 2016
5 // Author:      Natalia ERMOLAEVA
6
7 #include <XGUI_DeflectionDialog.h>
8
9 #include <ModelAPI_Tools.h>
10
11 #include <QDoubleSpinBox>
12
13 #include <QLabel>
14 #include <QButtonGroup>
15 #include <QGridLayout>
16 #include <QRadioButton>
17 #include <QDialogButtonBox>
18
19 XGUI_DeflectionDialog::XGUI_DeflectionDialog(QWidget* theParent)
20   : QDialog(theParent)
21 {
22   setWindowTitle("Deflection");
23   QGridLayout* aLay = new QGridLayout(this);
24
25   myDeflection = new QDoubleSpinBox(this);
26   myDeflection->setRange(0, 1);
27   aLay->addWidget(new QLabel("Deviation", this), 0, 0);
28   aLay->addWidget(myDeflection, 0, 1);
29
30   QDialogButtonBox* aButtons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
31                                                     Qt::Horizontal, this);
32   connect(aButtons, SIGNAL(accepted()), this, SLOT(accept()));
33   connect(aButtons, SIGNAL(rejected()), this, SLOT(reject()));
34   aLay->addWidget(aButtons, 1, 0, 1, 2);
35 }
36
37 void XGUI_DeflectionDialog::setDeflection(const double& theValue)
38 {
39   myDeflection->setValue(theValue);
40 }
41
42 double XGUI_DeflectionDialog::getDeflection() const
43 {
44   return myDeflection->value();
45 }