Salome HOME
NRI : Replace Geometry by GEOM.
[modules/geom.git] / src / GEOMGUI / GeometryGUI_CylinderDlg.h
1 //  File      : GeometryGUI_CylinderDlg.h
2 //  Created   :
3 //  Author    : Lucien PIGNOLONI
4 //  Project   : SALOME
5 //  Module    : GeometryGUI
6 //  Copyright : OPEN CASCADE
7 //  $Header$
8
9 #ifndef DIALOGBOX_CYLINDER_H
10 #define DIALOGBOX_CYLINDER_H
11
12 #include "SALOME_Selection.h"
13
14 #include "GEOM_ShapeTypeFilter.hxx"
15 #include "GEOM_EdgeFilter.hxx"
16 #include "GeometryGUI_SpinBox.h"
17
18 #include <BRepPrimAPI_MakeCylinder.hxx>
19 #include <Precision.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 QGroupBox;
30 class QLabel;
31 class QLineEdit;
32 class QPushButton;
33 class QSpinBox;
34 class QRadioButton;
35 class GeometryGUI;
36
37
38 //=================================================================================
39 // class    : GeometryGUI_CylinderDlg
40 // purpose  :
41 //=================================================================================
42 class GeometryGUI_CylinderDlg : public QDialog
43
44     Q_OBJECT
45
46 public:
47     GeometryGUI_CylinderDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0,  bool modal = FALSE, WFlags fl = 0 );
48     ~GeometryGUI_CylinderDlg();
49
50 private:
51
52     void Init( SALOME_Selection* Sel ) ;
53     void closeEvent( QCloseEvent* e ) ;
54     void enterEvent ( QEvent * ) ;                /* mouse enter the QWidget */
55     void MakeCylinderSimulationAndDisplay() ;
56
57     GEOM::GEOM_Gen_var myGeom ;                /* Current GeomI object */
58     GeometryGUI*          myGeomGUI ;             /* Current GeomGUI object */
59     TopoDS_Shape          mySimulationTopoDs ;
60     SALOME_Selection*     mySelection ;           /* User shape selection */
61     
62     gp_Pnt                myPoint1 ;              /* topology used  */
63     gp_Dir                myDir ;
64
65     Standard_Real         myRadius ;
66     Standard_Real         myHeight ;
67     bool                  myOkRadius ;
68     bool                  myOkHeight ;
69     QDoubleValidator      *myVa ;                  /* Double validator for numeric input */
70     QDoubleValidator      *myVb ;                  /* Double validator for numeric input */
71
72     bool                  myOkPoint1 ;
73     bool                  myOkDir ;               /* to check when arguments is defined */
74     int                   myConstructorId ;       /* Current constructor id = radio button id */
75     QWidget*              myEditCurrentArgument;  /* Current LineEdit or spin box */
76     Handle(GEOM_ShapeTypeFilter) myVertexFilter ; /* Filter selection */
77     Handle(GEOM_EdgeFilter) myEdgeFilter ;        /* Filter selection */
78
79     QGroupBox* GroupButtons;
80     QPushButton* buttonApply;
81     QPushButton* buttonOk;
82     QPushButton* buttonCancel;
83     QButtonGroup* GroupConstructors;
84     QRadioButton* Constructor1;
85     QRadioButton* Constructor2;
86     QGroupBox* GroupC1;
87     QGroupBox* GroupC2;
88     QPushButton* SelectButtonC1A1;
89     QLineEdit* LineEditC1A1;
90     QLabel* TextLabelC1A1;
91     QPushButton* SelectButtonC1A2;
92     QLineEdit* LineEditC1A2;
93     QLabel* TextLabelC1A2;
94
95     QLabel* TextLabelC1A3;
96     GeometryGUI_SpinBox*  SpinBox_C1A3 ;
97     QLabel* TextLabelC1A4 ;
98     GeometryGUI_SpinBox*  SpinBox_C1A4 ;
99
100     QLabel* TextLabel_Radius ;
101     GeometryGUI_SpinBox*  SpinBox_Radius ;
102     QLabel* TextLabel_Height ;
103     GeometryGUI_SpinBox*  SpinBox_Height ;
104
105 private slots:
106
107     void ConstructorsClicked(int constructorId);
108     void ClickOnOk();
109     void ClickOnCancel();
110     void ClickOnApply();
111     void SetEditCurrentArgument() ;
112     void SelectionIntoArgument() ;
113     void LineEditReturnPressed() ;
114     void DeactivateActiveDialog() ;
115     void ActivateThisDialog() ;
116     void ValueChangedInSpinBox( double newValue ) ;
117   
118 protected:
119     QGridLayout* GeometryGUI_CylinderDlgLayout;
120     QGridLayout* GroupButtonsLayout;
121     QGridLayout* GroupConstructorsLayout;
122     QGridLayout* GroupC1Layout;
123     QGridLayout* GroupC2Layout;
124 };
125
126 #endif // DIALOGBOX_CYLINDER_H