]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOMGUI/GeometryGUI_SuppressHoleDlg.h
Salome HOME
NRI : First integration.
[modules/geom.git] / src / GEOMGUI / GeometryGUI_SuppressHoleDlg.h
1 //  File      : GeometryGUI_SuppressHoleDlg.h
2 //  Created   :
3 //  Author    : Lucien PIGNOLONI
4 //  Project   : SALOME
5 //  Module    : GeometryGUI
6 //  Copyright : OPEN CASCADE
7 //  $Header$
8
9 #ifndef GEOMETRYGUI_SUPPRESSHOLE_H
10 #define GEOMETRYGUI_SUPPRESSHOLE_H
11
12 #include "SALOME_Selection.h"
13 #include "GEOM_ShapeTypeFilter.hxx"
14
15 #include <qvariant.h>
16 #include <qdialog.h>
17
18 #include <AIS_InteractiveContext.hxx>
19
20 class QVBoxLayout; 
21 class QHBoxLayout; 
22 class QGridLayout; 
23 class QButtonGroup;
24 class QCheckBox;
25 class QGroupBox;
26 class QLabel;
27 class QLineEdit;
28 class QPushButton;
29 class QRadioButton;
30 class GeometryGUI;
31
32 //=================================================================================
33 // class    : GeometryGUI_SuppressHoleDlg
34 // purpose  :
35 //=================================================================================
36 class GeometryGUI_SuppressHoleDlg : public QDialog
37
38     Q_OBJECT
39       
40 public:
41     GeometryGUI_SuppressHoleDlg( QWidget* parent = 0,
42                                  const char* name = 0,
43                                  SALOME_Selection* Sel = 0,             
44                                  Handle (AIS_InteractiveContext) ic = 0,  
45                                  bool modal = FALSE,
46                                  WFlags fl = 0 );
47
48     ~GeometryGUI_SuppressHoleDlg();
49
50 private :
51       
52     void Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic ) ;
53     void closeEvent( QCloseEvent* e ) ;
54     void enterEvent ( QEvent * ) ;                            /* Mouse enter the QWidget (to reactivate it) */
55
56     void ResetStateOfDialog() ;
57     void ResetPartial() ;
58
59     /* Return the face selected by user from the main shape and index in a ListOfSub */
60     TopoDS_Shape FaceFromList( const TopoDS_Shape& aShape,
61                                const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfSub ) ;
62
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 ;               /* Main shape selected  */
72     TopoDS_Shape                      myFace ;                /* Face selected        */
73
74     char*                             myShapeIOR ;
75     bool                              myOkShape ;
76
77     bool                              myOkSelectFace ;        /* true = sub mode GEOM::FACE selection done               */
78     bool                              myOkSelectWire ;        /* true = sub mode GEOM::WIRE selection done (first wire)  */  
79
80     GEOM::GEOM_Shape::ListOfSubShapeID_var  myListOfIdFace ;        /* After selection contains index of face into myShape      */
81     GEOM::GEOM_Shape::ListOfSubShapeID_var  myListOfIdWire ;        /* After selection contains index of wire into myFace       */
82     GEOM::GEOM_Shape::ListOfSubShapeID_var  myListOfIdEndFace ;     /* After selection contains index of end face into myShape  */
83   
84     QLineEdit*                        myEditCurrentArgument;  /* Current LineEdit */   
85     int                               myConstructorId ;       /* Current constructor id = radio button id */
86
87     QButtonGroup* GroupConstructors;
88     QRadioButton* Constructor1;
89     QGroupBox* GroupButtons;
90     QPushButton* buttonOk;
91     QPushButton* buttonApply;
92     QPushButton* buttonClose;
93     QGroupBox* GroupC1;
94     QLabel* TextLabelC1A1;
95     QPushButton* SelectButtonC1A1;
96     QLineEdit* LineEditC1A1;
97     QCheckBox* CheckBox1;
98     QCheckBox* CheckBox2;
99     QCheckBox* CheckBox3;
100
101     /* Second constructor */
102     QRadioButton* Constructor2;
103     QGroupBox* GroupC2;
104     QLabel* TextLabelC2A1;
105     QPushButton* SelectButtonC2A1;
106     QLineEdit* LineEditC2A1;
107     QCheckBox* CheckBoxC2_1;
108
109
110 private slots:
111
112     void ConstructorsClicked(int constructorId);
113     void ClickOnOk();
114     void ClickOnApply() ;
115     void ClickOnClose();
116
117     void LineEditReturnPressed() ;
118     void SetEditCurrentArgument() ;
119     void SelectionIntoArgument() ;
120     void DeactivateActiveDialog() ;
121     void ActivateThisDialog() ;
122     void ActivateUserFaceSelection() ;
123     void ActivateUserWireSelection() ;
124     void ActivateUserEndFaceSelection() ;
125     
126     /* For the second constructor */
127     void ActivateUserWiresOnFaceShellSelection() ;
128
129   
130 protected:
131
132     QGridLayout* GeometryGUI_SuppressHoleLayout;
133     QGridLayout* GroupConstructorsLayout;
134     QHBoxLayout* GroupButtonsLayout;
135     QGridLayout* GroupC1Layout;
136     QHBoxLayout* Layout2;
137
138     QGridLayout* GroupC2Layout;
139     QHBoxLayout* Layout3;
140 };
141
142 #endif // GEOMETRYGUI_SUPPRESSHOLE_H