Salome HOME
NRI : First integration.
[modules/geom.git] / src / GEOMGUI / GeometryGUI_ChamferDlg.h
1 //  File      : GeometryGUI_ChamferDlg.h
2 //  Created   : 
3 //  Author    : Damien COQUERET
4 //  Project   : SALOME
5 //  Module    : GEOM
6 //  Copyright : OPEN CASCADE 2002
7 //  $Header$
8
9 #ifndef DIALOGBOX_CHAMFER_H
10 #define DIALOGBOX_CHAMFER_H
11
12 #include "SALOME_Selection.h"
13 #include "GEOM_ShapeTypeFilter.hxx"
14 #include "GeometryGUI_SpinBox.h"
15
16 // Qt Includes
17 #include <qvariant.h>
18 #include <qdialog.h>
19 #include <qvalidator.h>
20
21 // Open CASCADE Includes
22 #include <AIS_InteractiveContext.hxx>
23
24 class QVBoxLayout; 
25 class QHBoxLayout; 
26 class QGridLayout; 
27 class QButtonGroup;
28 class QFrame;
29 class QGroupBox;
30 class QLineEdit;
31 class QPushButton;
32 class QRadioButton;
33 class QToolButton;
34 class QLabel;
35 class GeometryGUI;
36
37 //=================================================================================
38 // class    : GeometryGUI_ChamferDlg
39 // purpose  :
40 //=================================================================================
41 class GeometryGUI_ChamferDlg : public QDialog
42
43     Q_OBJECT
44
45 public:
46     GeometryGUI_ChamferDlg( QWidget* parent = 0,
47                       const char* name = 0,
48                       SALOME_Selection* Sel = 0,
49                       Handle (AIS_InteractiveContext) ic = 0,
50                       bool modal = FALSE,
51                       WFlags fl = 0 );
52     
53     ~GeometryGUI_ChamferDlg();
54
55 private :
56  
57     void Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic  ) ;
58     void closeEvent( QCloseEvent* e ) ;
59     void enterEvent( QEvent* e);
60     void ResetStateOfDialog() ;
61
62     /* Interactive and local context management see also : bool myUseLocalContext() */
63     Handle (AIS_InteractiveContext) myIC ;                 /* Interactive context */ 
64     Standard_Integer                myLocalContextId ;     /* identify a local context used by this method */
65     bool                            myUseLocalContext ;    /* true when this method as opened a local context  */
66
67     QDoubleValidator      *myVa ;                  /* Double validator for numeric input */
68     QDoubleValidator      *myVb ;                  /* Double validator for numeric input */
69
70     GEOM::GEOM_Gen_var myGeom ;                       /* Current Geom object */
71     GeometryGUI*          myGeomGUI ;                    /* Current GeomGUI object */
72     SALOME_Selection*     mySelection ;                  /* User shape selection */    
73
74     TopoDS_Shape          myShape ;
75     bool                  myOkShape ;
76     char*                 myShapeIOR ;
77   
78     QLineEdit*            myEditCurrentArgument;         /* Current LineEdit */   
79     int                   myConstructorId ;              /* Current constructor id = radio button id */
80     int                   myShapeType ;
81
82     TopoDS_Shape          mySimulationTopoDs ;    /* Shape used for simulation display */
83     void MakePreview();
84
85     bool                  myOkD1 ;
86     double                myD1 ;
87     bool                  myOkD2 ;
88     double                myD2 ;
89     
90     QButtonGroup* GroupConstructors;
91
92     QRadioButton* Constructor1;
93     QRadioButton* Constructor2;
94     QRadioButton* Constructor3;
95
96     QGroupBox* GroupButtons;
97     QPushButton* buttonOk;
98     QPushButton* buttonCancel;
99     QPushButton* buttonApply;
100
101     QGroupBox* GroupC1;
102     QPushButton* SelectButtonC1A1;   
103     QLineEdit* LineEditC1A1;
104     QLabel* TextLabelC1A1; 
105     GeometryGUI_SpinBox* SpinBox_C1A2 ;
106     QLabel* TextLabelC1A2; 
107     GeometryGUI_SpinBox* SpinBox_C1A3 ;
108     QLabel* TextLabelC1A3; 
109
110     QGroupBox* GroupC2;
111     QPushButton* SelectButtonC2A1;   
112     QLineEdit* LineEditC2A1;
113     QLabel* TextLabelC2A1; 
114     GeometryGUI_SpinBox* SpinBox_C2A2 ;
115     QLabel* TextLabelC2A2; 
116     GeometryGUI_SpinBox* SpinBox_C2A3;
117     QLabel* TextLabelC2A3; 
118
119     QGroupBox* GroupC3;
120     QPushButton* SelectButtonC3A1;   
121     QLineEdit* LineEditC3A1;
122     QLabel* TextLabelC3A1; 
123     GeometryGUI_SpinBox* SpinBox_C3A2 ;
124     QLabel* TextLabelC3A2; 
125     GeometryGUI_SpinBox* SpinBox_C3A3;
126     QLabel* TextLabelC3A3; 
127
128 private slots:
129
130     void ConstructorsClicked(int constructorId);
131     void ClickOnOk();
132     void ClickOnCancel();
133     void ClickOnApply();
134     void SetEditCurrentArgument() ;
135     void SelectionIntoArgument() ;
136     void LineEditReturnPressed() ;
137     void DeactivateActiveDialog() ;
138     void ActivateThisDialog() ;
139     void ValueChangedInSpinBox( double newValue ) ;
140
141 protected:
142
143     QGridLayout* GeometryGUI_ChamferDlgLayout;
144     QGridLayout* GroupButtonsLayout;
145     QGridLayout* GroupConstructorsLayout;
146     QGridLayout* GroupC1Layout;
147     QGridLayout* GroupC2Layout;
148     QGridLayout* GroupC3Layout;
149 };
150
151 #endif // DIALOGBOX_CHAMFER_H
152