]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOMGUI/GeometryGUI_SuppressHoleDlg.h
Salome HOME
NRI : Merge from V1_2.
[modules/geom.git] / src / GEOMGUI / GeometryGUI_SuppressHoleDlg.h
1 //  GEOM GEOMGUI : GUI for Geometry component
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : GeometryGUI_SuppressHoleDlg.h
25 //  Author : Lucien PIGNOLONI
26 //  Module : GEOM
27 //  $Header$
28
29 #ifndef GEOMETRYGUI_SUPPRESSHOLE_H
30 #define GEOMETRYGUI_SUPPRESSHOLE_H
31
32 #include "SALOME_Selection.h"
33 #include "GEOM_ShapeTypeFilter.hxx"
34
35 #include <qvariant.h>
36 #include <qdialog.h>
37
38 #include <AIS_InteractiveContext.hxx>
39
40 class QVBoxLayout; 
41 class QHBoxLayout; 
42 class QGridLayout; 
43 class QButtonGroup;
44 class QCheckBox;
45 class QGroupBox;
46 class QLabel;
47 class QLineEdit;
48 class QPushButton;
49 class QRadioButton;
50 class GeometryGUI;
51
52 //=================================================================================
53 // class    : GeometryGUI_SuppressHoleDlg
54 // purpose  :
55 //=================================================================================
56 class GeometryGUI_SuppressHoleDlg : public QDialog
57
58     Q_OBJECT
59       
60 public:
61     GeometryGUI_SuppressHoleDlg( QWidget* parent = 0,
62                                  const char* name = 0,
63                                  SALOME_Selection* Sel = 0,             
64                                  Handle (AIS_InteractiveContext) ic = 0,  
65                                  bool modal = FALSE,
66                                  WFlags fl = 0 );
67
68     ~GeometryGUI_SuppressHoleDlg();
69
70 private :
71       
72     void Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic ) ;
73     void closeEvent( QCloseEvent* e ) ;
74     void enterEvent ( QEvent * ) ;                            /* Mouse enter the QWidget (to reactivate it) */
75
76     void ResetStateOfDialog() ;
77     void ResetPartial() ;
78
79     /* Return the face selected by user from the main shape and index in a ListOfSub */
80     TopoDS_Shape FaceFromList( const TopoDS_Shape& aShape,
81                                const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfSub ) ;
82
83     Handle (AIS_InteractiveContext)   myIC ;                  /* Interactive context  */ 
84     Standard_Integer                  myLocalContextId ;      /* identify a local context used by this method    */
85     bool                              myUseLocalContext ;     /* true when this method as opened a local context */
86     
87     GEOM::GEOM_Gen_var             myGeom ;                /* Current Geom object */
88     GeometryGUI*                      myGeomGUI ;             /* Current GeomGUI object */
89     SALOME_Selection*                 mySelection ;           /* User shape selection */
90
91     TopoDS_Shape                      myShape ;               /* Main shape selected  */
92     TopoDS_Shape                      myFace ;                /* Face selected        */
93
94     char*                             myShapeIOR ;
95     bool                              myOkShape ;
96
97     bool                              myOkSelectFace ;        /* true = sub mode GEOM::FACE selection done               */
98     bool                              myOkSelectWire ;        /* true = sub mode GEOM::WIRE selection done (first wire)  */  
99
100     GEOM::GEOM_Shape::ListOfSubShapeID_var  myListOfIdFace ;        /* After selection contains index of face into myShape      */
101     GEOM::GEOM_Shape::ListOfSubShapeID_var  myListOfIdWire ;        /* After selection contains index of wire into myFace       */
102     GEOM::GEOM_Shape::ListOfSubShapeID_var  myListOfIdEndFace ;     /* After selection contains index of end face into myShape  */
103   
104     QLineEdit*                        myEditCurrentArgument;  /* Current LineEdit */   
105     int                               myConstructorId ;       /* Current constructor id = radio button id */
106
107     QButtonGroup* GroupConstructors;
108     QRadioButton* Constructor1;
109     QGroupBox* GroupButtons;
110     QPushButton* buttonOk;
111     QPushButton* buttonApply;
112     QPushButton* buttonClose;
113     QGroupBox* GroupC1;
114     QLabel* TextLabelC1A1;
115     QPushButton* SelectButtonC1A1;
116     QLineEdit* LineEditC1A1;
117     QCheckBox* CheckBox1;
118     QCheckBox* CheckBox2;
119     QCheckBox* CheckBox3;
120
121     /* Second constructor */
122     QRadioButton* Constructor2;
123     QGroupBox* GroupC2;
124     QLabel* TextLabelC2A1;
125     QPushButton* SelectButtonC2A1;
126     QLineEdit* LineEditC2A1;
127     QCheckBox* CheckBoxC2_1;
128
129
130 private slots:
131
132     void ConstructorsClicked(int constructorId);
133     void ClickOnOk();
134     void ClickOnApply() ;
135     void ClickOnClose();
136
137     void LineEditReturnPressed() ;
138     void SetEditCurrentArgument() ;
139     void SelectionIntoArgument() ;
140     void DeactivateActiveDialog() ;
141     void ActivateThisDialog() ;
142     void ActivateUserFaceSelection() ;
143     void ActivateUserWireSelection() ;
144     void ActivateUserEndFaceSelection() ;
145     
146     /* For the second constructor */
147     void ActivateUserWiresOnFaceShellSelection() ;
148
149   
150 protected:
151
152     QGridLayout* GeometryGUI_SuppressHoleLayout;
153     QGridLayout* GroupConstructorsLayout;
154     QHBoxLayout* GroupButtonsLayout;
155     QGridLayout* GroupC1Layout;
156     QHBoxLayout* Layout2;
157
158     QGridLayout* GroupC2Layout;
159     QHBoxLayout* Layout3;
160 };
161
162 #endif // GEOMETRYGUI_SUPPRESSHOLE_H