1 // GEOM GEOMGUI : GUI for Geometry component
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : GeometryGUI_SuppressHoleDlg.h
25 // Author : Lucien PIGNOLONI
29 #ifndef GEOMETRYGUI_SUPPRESSHOLE_H
30 #define GEOMETRYGUI_SUPPRESSHOLE_H
32 #include "SALOME_Selection.h"
33 #include "GEOM_ShapeTypeFilter.hxx"
38 #include <AIS_InteractiveContext.hxx>
52 //=================================================================================
53 // class : GeometryGUI_SuppressHoleDlg
55 //=================================================================================
56 class GeometryGUI_SuppressHoleDlg : public QDialog
61 GeometryGUI_SuppressHoleDlg( QWidget* parent = 0,
63 SALOME_Selection* Sel = 0,
64 Handle (AIS_InteractiveContext) ic = 0,
68 ~GeometryGUI_SuppressHoleDlg();
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) */
76 void ResetStateOfDialog() ;
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 ) ;
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 */
87 GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */
88 GeometryGUI* myGeomGUI ; /* Current GeomGUI object */
89 SALOME_Selection* mySelection ; /* User shape selection */
91 TopoDS_Shape myShape ; /* Main shape selected */
92 TopoDS_Shape myFace ; /* Face selected */
97 bool myOkSelectFace ; /* true = sub mode GEOM::FACE selection done */
98 bool myOkSelectWire ; /* true = sub mode GEOM::WIRE selection done (first wire) */
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 */
104 QLineEdit* myEditCurrentArgument; /* Current LineEdit */
105 int myConstructorId ; /* Current constructor id = radio button id */
107 QButtonGroup* GroupConstructors;
108 QRadioButton* Constructor1;
109 QGroupBox* GroupButtons;
110 QPushButton* buttonOk;
111 QPushButton* buttonApply;
112 QPushButton* buttonClose;
114 QLabel* TextLabelC1A1;
115 QPushButton* SelectButtonC1A1;
116 QLineEdit* LineEditC1A1;
117 QCheckBox* CheckBox1;
118 QCheckBox* CheckBox2;
119 QCheckBox* CheckBox3;
121 /* Second constructor */
122 QRadioButton* Constructor2;
124 QLabel* TextLabelC2A1;
125 QPushButton* SelectButtonC2A1;
126 QLineEdit* LineEditC2A1;
127 QCheckBox* CheckBoxC2_1;
132 void ConstructorsClicked(int constructorId);
134 void ClickOnApply() ;
137 void LineEditReturnPressed() ;
138 void SetEditCurrentArgument() ;
139 void SelectionIntoArgument() ;
140 void DeactivateActiveDialog() ;
141 void ActivateThisDialog() ;
142 void ActivateUserFaceSelection() ;
143 void ActivateUserWireSelection() ;
144 void ActivateUserEndFaceSelection() ;
146 /* For the second constructor */
147 void ActivateUserWiresOnFaceShellSelection() ;
152 QGridLayout* GeometryGUI_SuppressHoleLayout;
153 QGridLayout* GroupConstructorsLayout;
154 QHBoxLayout* GroupButtonsLayout;
155 QGridLayout* GroupC1Layout;
156 QHBoxLayout* Layout2;
158 QGridLayout* GroupC2Layout;
159 QHBoxLayout* Layout3;
162 #endif // GEOMETRYGUI_SUPPRESSHOLE_H