Salome HOME
NRI : First integration.
[modules/geom.git] / src / GEOMGUI / GeometryGUI_SubShapeDlg.h
1 //  File      : GeometryGUI_SubShapeDlg.h
2 //  Created   :
3 //  Author    : Lucien PIGNOLONI
4 //  Project   : SALOME
5 //  Module    : GeometryGUI
6 //  Copyright : OPEN CASCADE
7 //  $Header$
8
9 #ifndef DIALOGBOX_SUBSHAPE_H
10 #define DIALOGBOX_SUBSHAPE_H
11
12 #include "SALOME_Selection.h"
13 #include "GEOM_ShapeTypeFilter.hxx"
14
15 #include <AIS_InteractiveContext.hxx>
16
17 #include <qvariant.h>
18 #include <qdialog.h>
19
20 class QVBoxLayout;
21 class QHBoxLayout;
22 class QGridLayout;
23 class QButtonGroup;
24 class QCheckBox;
25 class QComboBox;
26 class QGroupBox;
27 class QLabel;
28 class QLineEdit;
29 class QPushButton;
30 class QRadioButton;
31 class GeometryGUI;
32
33
34 //=================================================================================
35 // class    : GeometryGUI_SubShapeDlg
36 // purpose  :
37 //=================================================================================
38 class GeometryGUI_SubShapeDlg : public QDialog
39
40     Q_OBJECT
41
42 public:
43     GeometryGUI_SubShapeDlg( QWidget* parent = 0,
44                         const char* name = 0,
45                         SALOME_Selection* Sel = 0,
46                         Handle (AIS_InteractiveContext) ic = 0,
47                         bool modal = FALSE,
48                         WFlags fl = 0 );
49
50     ~GeometryGUI_SubShapeDlg();
51
52 private :
53
54     void Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic ) ;
55     void closeEvent( QCloseEvent* e ) ;
56     void enterEvent ( QEvent * ) ;                         /* mouse enter the QWidget */
57     void ResetStateOfDialog() ;
58
59     unsigned int NumberOfSubShapes( const TopoDS_Shape& S, const int shapeType ) ;
60
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     GEOM::GEOM_Gen_var              myGeom ;                /* Current Geom object */
68     GeometryGUI*                    myGeomGUI ;             /* Current GeomGUI object */
69     SALOME_Selection*               mySelection ;           /* User shape selection */
70
71     TopoDS_Shape                    myShape ;
72     char*                           myShapeIOR ;
73     bool                            myOkShape ;
74     int                             myShapeType ;           /* define a type of topology mode of sub selection */
75
76     bool                            myWithShape ;           /* check if Shape item exists */
77
78     bool                            myOkSelectSubMode ;     /* true = sub mode selection activated */
79     QLineEdit*                      myEditCurrentArgument;  /* Current LineEdit */   
80     int                             myConstructorId ;       /* Current constructor id = radio button id */
81     bool                            myAbort ;               /* Indicate if sub Shape All has been aborted by user */
82     
83     QButtonGroup* GroupConstructors;
84     QRadioButton* Constructor1;
85     QGroupBox* GroupButtons;
86     QPushButton* buttonOk;
87     QPushButton* buttonCancel;
88     QPushButton* buttonApply;
89     QGroupBox* GroupC1;
90     QPushButton* SelectButtonC1A1;   
91     QLineEdit* LineEditC1A1;
92     QLabel* TextLabelC1A1;
93     QLabel* TextLabelComboBox1;
94     QComboBox* ComboBox1;
95
96     QCheckBox* CheckBox1;
97
98 private slots:
99
100     void ConstructorsClicked(int constructorId);
101     void ClickOnOk();
102     void ClickOnCancel();
103     void ClickOnApply();
104     void LineEditReturnPressed() ;
105     void SetEditCurrentArgument() ;
106     void SelectionIntoArgument() ;
107     void DeactivateActiveDialog() ;
108     void ActivateThisDialog() ;
109     void AllOrNotAll() ;
110     void ComboTextChanged() ;
111
112 protected:
113     QGridLayout* GeometryGUI_SubShapeDlgLayout;
114     QGridLayout* GroupConstructorsLayout;
115     QGridLayout* GroupButtonsLayout;
116     QGridLayout* GroupC1Layout;
117 };
118
119 #endif // DIALOGBOX_SUBSHAPE_H