Salome HOME
NRI : Update according to naming rule.
[modules/geom.git] / src / GEOMGUI / GeometryGUI_MultiRotationDlg.h
1 //  File      : GeometryGUI_MultiRotationDlg.h
2 //  Created   :
3 //  Author    : Damien COQUERET
4 //  Project   : SALOME
5 //  Module    : GeometryGUI
6 //  Copyright : OPEN CASCADE
7 //  $Header$
8
9 #ifndef DIALOGBOX_MULTIROTATION_H
10 #define DIALOGBOX_MULTIROTATION_H
11
12
13 #include "SALOME_Selection.h"
14 #include "GEOM_ShapeTypeFilter.hxx"
15 #include "GEOM_EdgeFilter.hxx"
16 #include "GeometryGUI_SpinBox.h"
17
18 #include <gp_Pnt.hxx>
19 #include <gp_Vec.hxx>
20 #include <gp_Dir.hxx>
21
22 #include <qvariant.h>
23 #include <qdialog.h>
24 #include <qvalidator.h>
25
26 class QVBoxLayout; 
27 class QHBoxLayout; 
28 class QGridLayout; 
29 class QButtonGroup;
30 class QCheckBox;
31 class QGroupBox;
32 class QLabel;
33 class QLineEdit;
34 class QPushButton;
35 class QSpinBox;
36 class QRadioButton;
37 class GeometryGUI;
38
39 //=================================================================================
40 // class    : GeometryGUI_MultiRotationDlg
41 // purpose  :
42 //=================================================================================
43 class GeometryGUI_MultiRotationDlg : public QDialog
44
45     Q_OBJECT
46
47 public:
48     GeometryGUI_MultiRotationDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
49     ~GeometryGUI_MultiRotationDlg();
50
51 private :
52     
53     GEOM::GEOM_Gen_var        myGeom ;                /* Current Geom object */   
54     GeometryGUI*                 myGeomGUI ;             /* Current GeomGUI object */ 
55     TopoDS_Shape                 mySimulationTopoDs ;    /* Shape used for simulation display */
56     SALOME_Selection*            mySelection ;           /* User shape selection */
57     TopoDS_Shape                 myBase ;
58     GEOM::GEOM_Shape_var               myGeomShape ;           /* is myBase */
59
60     gp_Vec                       myVec ;
61     int                          myNbTimes1 ;
62     int                          myNbTimes2 ;
63     Standard_Real                myAng ;
64     Standard_Real                myStep ;
65     gp_Dir                       myDir ;
66     gp_Pnt                       myLoc ;
67    
68     bool                         myOkBase ; 
69     bool                         myOkDir ;
70     bool                         myOkAng ;
71
72     QLineEdit*                   myEditCurrentArgument;  /* Current LineEdit */   
73     int                          myConstructorId ;       /* Current constructor id = radio button id */ 
74     Handle(GEOM_EdgeFilter)      myEdgeFilter;           /* Filter selection */
75
76     void closeEvent( QCloseEvent* e ) ;
77     void enterEvent( QEvent* e);
78     void Init( SALOME_Selection* Sel ) ;
79     void MakeMultiRotationSimulationAndDisplay() ;
80
81     QButtonGroup* GroupConstructors;
82     QRadioButton* Constructor1;
83     QRadioButton* Constructor2;
84
85     QGroupBox* GroupButtons;
86     QPushButton* buttonOk;
87     QPushButton* buttonCancel;
88     QPushButton* buttonApply;
89
90     QGroupBox* GroupC1;
91     QPushButton* SelectButtonC1A1;
92     QPushButton* SelectButtonC1A2;
93     QLabel* TextLabelC1A1;
94     QLabel* TextLabelC1A2;
95     QLabel* TextLabelC1A3;
96     QLineEdit* LineEditC1A1;
97     QLineEdit* LineEditC1A2;
98     QSpinBox* SpinBox_C1A3;            /* int : Nb times */
99
100     QGroupBox* GroupC2;
101     QPushButton* SelectButtonC2A1;
102     QPushButton* SelectButtonC2A2;
103     QLabel* TextLabelC2A1;
104     QLabel* TextLabelC2A2;
105     QLabel* TextLabelC2A3;
106     QLabel* TextLabelC2A4;
107     QLabel* TextLabelC2A5;
108     QLabel* TextLabelC2A6;
109    
110     QLineEdit* LineEditC2A1; 
111     QLineEdit* LineEditC2A2; 
112     GeometryGUI_SpinBox* SpinBox_C2A3 ;  /* double : angle       */
113     QSpinBox* SpinBox_C2A4;              /* int    : Nb times 1  */ 
114     GeometryGUI_SpinBox* SpinBox_C2A5 ;  /* double : step value  */
115     QSpinBox* SpinBox_C2A6;              /* int    : Nb times 2  */ 
116
117     QCheckBox* CheckBoxReverse;
118
119 private slots:
120
121     void ConstructorsClicked(int constructorId);
122     void ClickOnOk();
123     void ClickOnCancel();
124     void ClickOnApply();
125     void SetEditCurrentArgument() ;
126     void SelectionIntoArgument() ;
127     void LineEditReturnPressed() ;
128     void DeactivateActiveDialog() ;
129     void ActivateThisDialog() ;
130     void ReverseAngle(int) ;
131     void ValueChangedInSpinBox( double newValue ) ; /* for GeometryGUI_SpinBox       */
132     void ValueChangedInt( int newIntValue ) ;       /* for QT spin box ! not const ! */
133
134 protected:
135     QGridLayout* GeometryGUI_MultiRotationDlgLayout;
136     QGridLayout* GroupConstructorsLayout;
137     QGridLayout* GroupButtonsLayout;
138     QGridLayout* GroupC1Layout;
139     QGridLayout* GroupC2Layout;
140 };
141
142 #endif // DIALOGBOX_MULTIROTATION_H