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_PlaneDlg.h
25 // Author : Lucien PIGNOLONI
29 #ifndef DIALOGBOX_PLANE_H
30 #define DIALOGBOX_PLANE_H
32 #include "SALOME_Selection.h"
33 #include "GEOM_ShapeTypeFilter.hxx"
34 #include "GEOM_FaceFilter.hxx"
35 #include "GeometryGUI_SpinBox.h"
37 #include <BRepBuilderAPI_MakeFace.hxx>
56 //=================================================================================
57 // class : GeometryGUI_PlaneDlg
59 //=================================================================================
60 class GeometryGUI_PlaneDlg : public QDialog
65 GeometryGUI_PlaneDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
66 ~GeometryGUI_PlaneDlg();
70 void Init( SALOME_Selection* Sel ) ;
71 void closeEvent( QCloseEvent* e ) ;
72 void enterEvent( QEvent* e);
74 GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */
75 GeometryGUI* myGeomGUI ; /* Current GeomGUI object */
76 TopoDS_Shape mySimulationTopoDs; /* Shape used for simulation display */
77 SALOME_Selection* mySelection ; /* User shape selection */
78 gp_Pnt myPoint1 ; /* Point on the plane */
83 Standard_Real myTrimSize ;
85 bool myOkPoint1 ; /* true when argument is defined */
87 bool myOkCoordinates ;
89 QLineEdit* myEditCurrentArgument; /* Current LineEdit */
90 int myConstructorId ; /* Current constructor id = radio button id */
92 Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* Filters selection */
93 Handle(GEOM_ShapeTypeFilter) myEdgeFilter; /* Filters selection */
94 Handle(GEOM_FaceFilter) myFaceFilter; /* Filters selection */
97 QButtonGroup* GroupConstructors;
98 QRadioButton* Constructor1;
99 QRadioButton* Constructor2;
100 QRadioButton* Constructor3;
102 // Constructor with a point + direction (vector)
103 QGroupBox* GroupPointDirection;
105 QLabel* TextLabelPt1;
106 QPushButton* SelectButtonPt1;
107 QLineEdit* LineEditPt1;
109 QLabel* TextLabelDirection;
110 QPushButton* SelectButtonDirection;
111 QLineEdit* LineEditDirection;
113 QLabel* TextLabelC1Size;
114 GeometryGUI_SpinBox* SpinBox_C1Size ;
116 // Constructor with a point + dx, dy, dz coordinates
117 QGroupBox* GroupPointPlusCoordinates;
119 QLabel* TextLabelPt2;
120 QPushButton* SelectButtonPt2;
121 QLineEdit* LineEditPt2;
123 QLabel* TextLabelCoordinates;
124 QLabel* TextLabel_DX;
125 QLabel* TextLabel_DY;
126 QLabel* TextLabel_DZ;
127 GeometryGUI_SpinBox* SpinBox_DX ;
128 GeometryGUI_SpinBox* SpinBox_DY ;
129 GeometryGUI_SpinBox* SpinBox_DZ ;
131 QLabel* TextLabelC2Size;
132 GeometryGUI_SpinBox* SpinBox_C2Size ;
134 // Constructor with a face
135 QGroupBox* GroupFace;
137 QLabel* TextLabelFace;
138 QPushButton* SelectButtonFace;
139 QLineEdit* LineEditFace;
141 QLabel* TextLabelC3Size;
142 GeometryGUI_SpinBox* SpinBox_C3Size ;
145 QGroupBox* GroupButtons;
146 QPushButton* buttonApply;
147 QPushButton* buttonOk;
148 QPushButton* buttonCancel;
152 void ConstructorsClicked(int constructorId);
154 void ClickOnCancel();
156 void SetEditCurrentArgument() ;
157 void SelectionIntoArgument() ;
158 void LineEditReturnPressed() ;
159 void DeactivateActiveDialog() ;
160 void ActivateThisDialog() ;
161 void MakePlaneSimulationAndDisplay( const gp_Pnt& P,
162 const Standard_Real dx,
163 const Standard_Real dy,
164 const Standard_Real dz,
165 const Standard_Real trimSize ) ;
166 void ValueChangedInSpinBox( double newValue ) ;
170 QGridLayout* GeometryGUI_PlaneDlgLayout;
171 QGridLayout* GroupButtonsLayout;
172 QGridLayout* GroupPointDirectionLayout;
173 QGridLayout* GroupConstructorsLayout;
174 QGridLayout* GroupPointPlusCoordinatesLayout;
175 QGridLayout* GroupFaceLayout;
176 QHBoxLayout* Layout2 ;
179 #endif // DIALOGBOX_PLANE_H