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