Salome HOME
NRI : First integration.
[modules/geom.git] / src / GEOMGUI / GeometryGUI_CommonDlg.h
1 //  File      : GeometryGUI_CommonDlg.h
2 //  Created   :
3 //  Author    : Lucien PIGNOLONI
4 //  Project   : SALOME
5 //  Module    : GeometryGUI
6 //  Copyright : OPEN CASCADE
7 //  $Header$
8
9
10 #ifndef DIALOGBOX_COMMON_H
11 #define DIALOGBOX_COMMON_H
12
13 #include "SALOME_Selection.h"
14 #include "GEOM_ShapeTypeFilter.hxx"
15
16 #include <BRepAlgoAPI_Common.hxx>
17
18 #include <qvariant.h>
19 #include <qdialog.h>
20
21 class QVBoxLayout; 
22 class QHBoxLayout; 
23 class QGridLayout; 
24 class QButtonGroup;
25 class QFrame;
26 class QGroupBox;
27 class QLabel;
28 class QLineEdit;
29 class QPushButton;
30 class QRadioButton;
31 class GeometryGUI;
32
33
34 //=================================================================================
35 // class    : GeometryGUI_CommonDlg
36 // purpose  :
37 //=================================================================================
38 class GeometryGUI_CommonDlg : public QDialog
39
40     Q_OBJECT
41
42 public:
43     GeometryGUI_CommonDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
44     ~GeometryGUI_CommonDlg();
45
46 private:
47
48     void Init( SALOME_Selection* Sel ) ;
49     void closeEvent( QCloseEvent* e ) ;
50     void enterEvent ( QEvent * ) ;                /* mouse enter the QWidget */
51
52     GEOM::GEOM_Gen_var myGeom ;                /* Current GeomI object */
53     GeometryGUI*          myGeomGUI ;             /* Current GeomGUI object */
54     SALOME_Selection*     mySelection ;           /* User shape selection */
55     TopoDS_Shape          myShape1 ;              /* topology used  */
56     TopoDS_Shape          myShape2 ;              /* topology used  */
57     GEOM::GEOM_Shape_var        myGeomShape1 ;          /* is myShape1 */
58     GEOM::GEOM_Shape_var        myGeomShape2 ;          /* is myShape2 */
59     bool                  myOkShape1 ;
60     bool                  myOkShape2 ;            /* to check when arguments are defined */
61     int                   myConstructorId ;       /* Current constructor id = radio button id */
62     QLineEdit*            myEditCurrentArgument;  /* Current LineEdit */    
63
64
65     QButtonGroup* GroupConstructors;
66     QRadioButton* Constructor1;
67
68     QGroupBox* GroupConstructor1;
69     QLineEdit* LineEditC1A1Shape;
70     QLineEdit* LineEditC1A2Shape;
71     QPushButton* SelectButtonC1A1Shape;
72     QPushButton* SelectButtonC1A2Shape;
73     QLabel* TextLabelC1A2Shape;
74     QLabel* TextLabelC1A1Shape;
75
76     QGroupBox* GroupButtons;
77     QPushButton* buttonApply;
78     QPushButton* buttonOk;
79     QPushButton* buttonCancel;
80
81 private slots:
82
83     void ConstructorsClicked(int constructorId);
84     void ClickOnOk();
85     void ClickOnCancel();
86     void ClickOnApply();
87     void SetEditCurrentArgument() ;
88     void SelectionIntoArgument() ;
89     void LineEditReturnPressed() ;
90     void DeactivateActiveDialog() ;
91     void ActivateThisDialog() ;
92
93 protected:
94     QGridLayout* GeometryGUI_CommonDlgLayout;
95     QGridLayout* GroupConstructorsLayout;
96     QGridLayout* GroupButtonsLayout;
97     QGridLayout* GroupConstructor1Layout;
98 };
99
100 #endif // DIALOGBOX_COMMON_H