Salome HOME
ba8879d239706dea4a4171433c05fb8be2d0e429
[modules/geom.git] / src / GEOMGUI / GeometryGUI_RevolDlg.h
1 //  File      : GeometryGUI_RevolDlg.h
2 //  Created   :
3 //  Author    : Lucien PIGNOLONI
4 //  Project   : SALOME
5 //  Module    : GeometryGUI
6 //  Copyright : OPEN CASCADE
7 //  $Header$
8
9 #ifndef DIALOGBOX_REVOLUTION_H
10 #define DIALOGBOX_REVOLUTION_H
11
12 #include "SALOME_Selection.h"
13 #include "GEOM_ShapeTypeFilter.hxx"
14 #include "GEOM_EdgeFilter.hxx"
15 #include "GeometryGUI_SpinBox.h"
16
17 #include <gp_Pnt.hxx>
18 #include <gp_Dir.hxx>
19 #include <BRepPrimAPI_MakeRevol.hxx>
20
21 #include <qvariant.h>
22 #include <qdialog.h>
23 #include <qvalidator.h>
24
25 class QVBoxLayout; 
26 class QHBoxLayout; 
27 class QGridLayout; 
28 class QButtonGroup;
29 class QCheckBox;
30 class QGroupBox;
31 class QLabel;
32 class QLineEdit;
33 class QPushButton;
34 class QRadioButton;
35 class GeometryGUI;
36
37
38 //=================================================================================
39 // class    : GeometryGUI_RevolDlg
40 // purpose  :
41 //=================================================================================
42 class GeometryGUI_RevolDlg : public QDialog
43
44     Q_OBJECT
45
46 public:
47     GeometryGUI_RevolDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
48     ~GeometryGUI_RevolDlg();
49
50 private :
51     
52     GEOM::GEOM_Gen_var        myGeom ;                /* Current Geom object */   
53     GeometryGUI*                 myGeomGUI ;             /* Current GeomGUI object */ 
54     SALOME_Selection*            mySelection ;           /* User shape selection */
55     TopoDS_Shape                 mySimulationTopoDs;     /* Shape used for simulation display */
56     TopoDS_Shape                 myBase ;
57     GEOM::GEOM_Shape_var               myGeomShape ;           /* is myBase */
58
59     gp_Pnt                       myLoc ;
60     gp_Dir                       myDir ;
61
62     Standard_Real                myAngle ;
63
64     bool                         myOkBase ; 
65     bool                         myOkAxis ;
66     QLineEdit*                   myEditCurrentArgument;  /* Current LineEdit */   
67     int                          myConstructorId ;       /* Current constructor id = radio button id */ 
68     Handle(GEOM_EdgeFilter)      myEdgeFilter;           /* Filter selection */
69
70     void closeEvent( QCloseEvent* e ) ;
71     void enterEvent( QEvent* e);
72     void Init( SALOME_Selection* Sel ) ;
73     void MakeRevolutionSimulationAndDisplay( const TopoDS_Shape& S) ;
74
75     QButtonGroup* GroupConstructors;
76     QRadioButton* Constructor1;
77     QGroupBox* GroupButtons;
78     QPushButton* buttonOk;
79     QPushButton* buttonCancel;
80     QPushButton* buttonApply;
81     QGroupBox* GroupC1;
82     QPushButton* SelectButtonC1A2;
83     QLineEdit* LineEditC1A1;
84     QLineEdit* LineEditC1A2;
85     QPushButton* SelectButtonC1A1;
86     QLabel* TextLabelC1A1;
87     QLabel* TextLabelC1A2;
88     GeometryGUI_SpinBox* SpinBox_C1A3 ; /* for angle */
89     QLabel* TextLabelC1A3;
90     QCheckBox* CheckBoxReverse;
91
92 private slots:
93
94     void ConstructorsClicked(int constructorId);
95     void ClickOnOk();
96     void ClickOnCancel();
97     void ClickOnApply();
98     void SetEditCurrentArgument() ;
99     void SelectionIntoArgument() ;
100     void LineEditReturnPressed() ;
101     void DeactivateActiveDialog() ;
102     void ActivateThisDialog() ;
103     void ReverseAngle(int state) ;
104     void ValueChangedInSpinBox( double newValue ) ;
105
106 protected:
107     QGridLayout* GeometryGUI_RevolDlgLayout;
108     QGridLayout* GroupConstructorsLayout;
109     QGridLayout* GroupButtonsLayout;
110     QGridLayout* GroupC1Layout;
111 };
112
113 #endif // DIALOGBOX_REVOLUTION_H