Salome HOME
NRI : Rename resources and library.
[modules/geom.git] / src / GEOMGUI / GeometryGUI_FilletDlg.h
1 //  File      : GeometryGUI_FilletDlg.h
2 //  Created   : 
3 //  Author    : Damien COQUERET
4 //  Project   : SALOME
5 //  Module    : GEOM
6 //  Copyright : OPEN CASCADE 2002
7 //  $Header$
8
9 #ifndef DIALOGBOX_FILLET_H
10 #define DIALOGBOX_FILLET_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_FilletDlg
39 // purpose  :
40 //=================================================================================
41 class GeometryGUI_FilletDlg : public QDialog
42
43     Q_OBJECT
44
45 public:
46     GeometryGUI_FilletDlg( 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_FilletDlg();
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
69     GEOM::GEOM_Gen_var myGeom ;                       /* Current Geom object */
70     GeometryGUI*          myGeomGUI ;                    /* Current GeomGUI object */
71     SALOME_Selection*     mySelection ;                  /* User shape selection */    
72
73     TopoDS_Shape          mySimulationTopoDs ;    /* Shape used for simulation display */
74     void MakePreview();
75
76     TopoDS_Shape          myShape ;
77     bool                  myOkShape ;
78     char*                 myShapeIOR ;
79   
80     QLineEdit*            myEditCurrentArgument;         /* Current LineEdit */   
81     int                   myConstructorId ;              /* Current constructor id = radio button id */
82     int                   myShapeType ;
83
84     bool                  myOkRadius ;
85     double                myRadius ;
86     
87     QButtonGroup* GroupConstructors;
88
89     QRadioButton* Constructor1;
90     QRadioButton* Constructor2;
91     QRadioButton* Constructor3;
92
93     QGroupBox* GroupButtons;
94     QPushButton* buttonOk;
95     QPushButton* buttonCancel;
96     QPushButton* buttonApply;
97
98     QGroupBox* GroupC1;
99     QPushButton* SelectButtonC1A1;   
100     QLineEdit* LineEditC1A1;
101     QLabel* TextLabelC1A1;
102     GeometryGUI_SpinBox* SpinBox_C1A2 ;
103     QLabel* TextLabelC1A2; 
104
105     QGroupBox* GroupC2;
106     QPushButton* SelectButtonC2A1;   
107     QLineEdit* LineEditC2A1;
108     QLabel* TextLabelC2A1;
109     GeometryGUI_SpinBox* SpinBox_C2A2 ;
110     QLabel* TextLabelC2A2; 
111     
112     QGroupBox* GroupC3;
113     QPushButton* SelectButtonC3A1;   
114     QLineEdit* LineEditC3A1;
115     QLabel* TextLabelC3A1;
116     GeometryGUI_SpinBox* SpinBox_C3A2 ;
117     QLabel* TextLabelC3A2; 
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 DeactivateActiveDialog() ;
128     void LineEditReturnPressed() ;
129     void ActivateThisDialog() ;
130     void ValueChangedInSpinBox( double newValue ) ;
131
132 protected:
133
134     QGridLayout* GeometryGUI_FilletDlgLayout;
135     QGridLayout* GroupButtonsLayout;
136     QGridLayout* GroupConstructorsLayout;
137     QGridLayout* GroupC1Layout;
138     QGridLayout* GroupC2Layout;
139     QGridLayout* GroupC3Layout;
140 };
141
142 #endif // DIALOGBOX_FILLET_H
143