Salome HOME
b1eca454e4b0ad0c97ddb7a1b858b9d65f5e7166
[modules/geom.git] / src / BasicGUI / BasicGUI_ParamCurveWidget.cxx
1 // Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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, or (at your option) any later version.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 // GEOM GEOMGUI : GUI for Geometry component
24 // File   : BasicGUI_ParamCurveWidget.h
25 // Author : Roman NIKOLAEV (roman.nikolaev@opencascade.com)
26
27 #include "BasicGUI_ParamCurveWidget.h"
28
29 #include <QLabel>
30 #include <QLineEdit>
31 #include <QGridLayout>
32 #include <QGroupBox>
33
34 #include <SalomeApp_DoubleSpinBox.h>
35 #include <SalomeApp_IntSpinBox.h>
36
37
38 BasicGUI_ParamCurveWidget::BasicGUI_ParamCurveWidget(QWidget* parent):
39   QWidget(parent) {
40
41   QGridLayout* l = new QGridLayout( this );
42   l->setSpacing( 0 );
43   l->setMargin( 0 );
44
45   QGroupBox* groupBox = new QGroupBox( tr("GEOM_PCURVE_TITLE"), this );
46
47   QGridLayout* gridLayout = new QGridLayout( groupBox );
48   gridLayout->setSpacing( 6 );
49   gridLayout->setMargin( 11 );
50   
51   //X Equation
52   QLabel* textLabel1 = new QLabel( tr("GEOM_PCURVE_X"), groupBox );
53   myXExpr = new QLineEdit( groupBox );
54
55   //Y Equation
56   QLabel* textLabel2 = new QLabel(tr("GEOM_PCURVE_Y"), groupBox);
57   myYExpr = new QLineEdit( groupBox );
58
59   //Z Equation
60   QLabel* textLabel3 = new QLabel( tr("GEOM_PCURVE_Z"), groupBox );
61   myZExpr = new QLineEdit( groupBox );
62
63   // Min and Max
64   QLabel* textLabel4 = new QLabel( tr("GEOM_PCURVE_MIN"), groupBox );
65   myPMin = new SalomeApp_DoubleSpinBox( groupBox );
66
67   // Min and Max
68   QLabel* textLabel5 = new QLabel( tr("GEOM_PCURVE_MAX"), groupBox );
69   myPMax = new SalomeApp_DoubleSpinBox( groupBox );    
70
71   // Step
72   QLabel* textLabel6 = new QLabel( tr("GEOM_PCURVE_NBSTEP"), groupBox );
73   myPStep = new SalomeApp_IntSpinBox( groupBox );
74
75   //Layout
76   gridLayout->addWidget(textLabel1, 0, 0, 1, 1);
77   gridLayout->addWidget(myXExpr,    0, 1, 1, 1);
78
79   gridLayout->addWidget(textLabel2, 1, 0, 1, 1);
80   gridLayout->addWidget(myYExpr,    1, 1, 1, 1);
81
82   gridLayout->addWidget(textLabel3, 2, 0, 1, 1);
83   gridLayout->addWidget(myZExpr,    2, 1, 1, 1);
84
85   gridLayout->addWidget(textLabel4, 3, 0, 1, 1);
86   gridLayout->addWidget(myPMin,     3, 1, 1, 1);
87
88   gridLayout->addWidget(textLabel5, 4, 0, 1, 1);
89   gridLayout->addWidget(myPMax,     4, 1, 1, 1);
90
91   gridLayout->addWidget(textLabel6, 5, 0, 1, 1);
92   gridLayout->addWidget(myPStep,    5, 1, 1, 1);
93
94   l->addWidget(groupBox, 0, 0, 1, 1);
95 }
96
97
98 BasicGUI_ParamCurveWidget::~BasicGUI_ParamCurveWidget(){
99 }