Salome HOME
b78b774803ab0a83ea4ef29193ee0fcbc16c3f1c
[modules/geom.git] / src / TransformationGUI / TransformationGUI_MultiRotationDlg.h
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   : TransformationGUI_MultiRotationDlg.h
25 // Author : Damien COQUERET, Open CASCADE S.A.S.
26
27 #ifndef TRANSFORMATIONGUI_MULTIROTATIONDLG_H
28 #define TRANSFORMATIONGUI_MULTIROTATIONDLG_H
29
30 #include "GEOMBase_Skeleton.h"
31 #include "GEOM_GenericObjPtr.h"
32
33 #include <SalomeApp_IntSpinBox.h>
34
35 #include <QGridLayout>
36 #include <QGroupBox>
37 #include <QLabel>
38 #include <QPushButton>
39 #include <QLineEdit>
40 #include <QCheckBox>
41
42 //=================================================================================
43 // class    : TransformationGUI_2Sel4Spin1Check
44 // purpose  :
45 //=================================================================================
46 class TransformationGUI_2Sel4Spin1Check : public QWidget
47 {
48   Q_OBJECT
49
50  public:
51   TransformationGUI_2Sel4Spin1Check (QWidget *parent);
52   ~TransformationGUI_2Sel4Spin1Check();
53
54  public:
55   QGridLayout *gridLayout;
56   QGroupBox *GroupBox1;
57   QGridLayout *gridLayout1;
58
59   // 2Sel
60   QLabel *TextLabel1;
61   QLabel *TextLabel2;
62   QPushButton *PushButton1;
63   QPushButton *PushButton2;
64   QLineEdit *LineEdit1;
65   QLineEdit *LineEdit2;
66
67   // 4Spin (double-int-double-int)
68   QCheckBox *CheckAngleStep;
69   QLabel *TextLabel4;
70   QLabel *TextLabel5;
71   QLabel *TextLabel6;
72   SalomeApp_DoubleSpinBox *SpinBox_DX1;
73   SalomeApp_IntSpinBox *SpinBox_DY1;
74   SalomeApp_DoubleSpinBox *SpinBox_DX2;
75   SalomeApp_IntSpinBox *SpinBox_DY2;
76
77   // 1Check
78   QCheckBox *CheckButton1;
79 };
80
81 //=================================================================================
82 // class    : TransformationGUI_MultiRotationDlg
83 // purpose  :
84 //=================================================================================
85 class TransformationGUI_MultiRotationDlg : public GEOMBase_Skeleton
86 {
87   Q_OBJECT
88
89 public:
90   TransformationGUI_MultiRotationDlg (GeometryGUI*, QWidget* = 0,
91                                       bool = false, Qt::WindowFlags = 0);
92   ~TransformationGUI_MultiRotationDlg();
93
94 protected:
95   // redefined from GEOMBase_Helper
96   virtual GEOM::GEOM_IOperations_ptr createOperation();
97   virtual bool                       isValid( QString& );
98   virtual bool                       execute( ObjectList& );
99   virtual void                       addSubshapesToStudy();
100   virtual void                       restoreSubShapes( SALOMEDS::SObject_ptr );
101   virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
102
103 private:
104   void                               Init();
105   void                               enterEvent( QEvent* );
106
107 private:
108   GEOM::GeomObjPtr                   myBase, myVector;
109   int                                myNbTimes1;
110   int                                myNbTimes2;
111   Standard_Real                      myAng;
112   Standard_Real                      myStep;
113
114   // to initialize the first selection field with a selected object on the dialog creation
115   bool                               myInitial;
116
117   TransformationGUI_2Sel4Spin1Check* GroupArgs;
118
119 private slots:
120   void                               ClickOnOk();
121   bool                               ClickOnApply();
122   void                               ActivateThisDialog();
123   void                               SelectionIntoArgument();
124   void                               SetEditCurrentArgument();
125   void                               CheckAngleStep (bool);
126   void                               ReverseAngle();
127   void                               ValueChangedInSpinBox( double );
128   void                               ValueChangedInSpinBox( int );
129   void                               TextValueChangedInSpinBox( const QString& );
130   void                               ConstructorsClicked( int );
131   void                               SetDoubleSpinBoxStep( double );
132 };
133
134 #endif // TRANSFORMATIONGUI_MULTIROTATIONDLG_H