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_ConeDlg.h
25 // Author : Lucien PIGNOLONI
29 #ifndef DIALOGBOX_CONE_H
30 #define DIALOGBOX_CONE_H
32 #include "SALOME_Selection.h"
33 #include "GEOM_ShapeTypeFilter.hxx"
34 #include "GEOM_EdgeFilter.hxx"
35 #include "GeometryGUI_SpinBox.h"
37 #include <BRepPrimAPI_MakeCone.hxx>
38 #include <BRepPrimAPI_MakeCylinder.hxx>
39 #include <Precision.hxx>
43 #include <qvalidator.h>
57 //=================================================================================
58 // class : GeometryGUI_ConeDlg
60 //=================================================================================
61 class GeometryGUI_ConeDlg : public QDialog
66 GeometryGUI_ConeDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
67 ~GeometryGUI_ConeDlg();
71 void Init( SALOME_Selection* Sel ) ;
72 void closeEvent( QCloseEvent* e ) ;
73 void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
74 void MakeConeSimulationAndDisplay() ;
76 GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */
77 GeometryGUI* myGeomGUI ; /* Current GeomGUI object */
78 SALOME_Selection* mySelection ; /* User shape selection */
79 TopoDS_Shape mySimulationTopoDs ;
81 gp_Pnt myPoint1 ; /* Topology used */
84 bool myOkDir ; /* to check when argument is defined */
86 Standard_Real myRadius1 ;
87 Standard_Real myRadius2 ;
88 Standard_Real myHeight ;
92 QDoubleValidator *myVa ; /* Double validator for numeric input myRadius1 */
93 QDoubleValidator *myVb ; /* Double validator for numeric input myRadius2 */
94 QDoubleValidator *myVc ; /* Double validator for numeric input myHeight */
96 int myConstructorId ; /* Current constructor id = radio button id */
97 QWidget* myEditCurrentArgument; /* Current LineEdit or spin box */
98 Handle(GEOM_ShapeTypeFilter) myVertexFilter ; /* Filter selection */
99 Handle(GEOM_EdgeFilter) myEdgeFilter ; /* Filter selection */
102 QButtonGroup* GroupConstructors;
103 QRadioButton* Constructor1;
104 QRadioButton* Constructor2;
105 QGroupBox* GroupButtons;
106 QPushButton* buttonApply;
107 QPushButton* buttonOk;
108 QPushButton* buttonCancel;
111 QPushButton* SelectButtonC1A1;
112 QLineEdit* LineEditC1A1;
113 QLabel* TextLabelC1A1;
114 QPushButton* SelectButtonC1A2;
115 QLineEdit* LineEditC1A2;
116 QLabel* TextLabelC1A2;
117 QLabel* TextLabelC1A3;
118 GeometryGUI_SpinBox* SpinBox_C1A3 ;
119 QLabel* TextLabelC1A4;
120 GeometryGUI_SpinBox* SpinBox_C1A4 ;
121 QLabel* TextLabelC1A5;
122 GeometryGUI_SpinBox* SpinBox_C1A5 ;
124 QLabel* TextLabel_Radius1 ;
125 QLabel* TextLabel_Radius2 ;
126 QLabel* TextLabel_Height ;
127 GeometryGUI_SpinBox* SpinBox_Radius1 ;
128 GeometryGUI_SpinBox* SpinBox_Radius2 ;
129 GeometryGUI_SpinBox* SpinBox_Height ;
133 void ConstructorsClicked(int constructorId);
135 void ClickOnCancel();
137 void SetEditCurrentArgument() ;
138 void SelectionIntoArgument() ;
139 void LineEditReturnPressed() ;
140 void DeactivateActiveDialog() ;
141 void ActivateThisDialog() ;
142 void ValueChangedInSpinBox( double newValue ) ;
145 QGridLayout* GeometryGUI_ConeDlgLayout;
146 QGridLayout* GroupConstructorsLayout;
147 QGridLayout* GroupButtonsLayout;
148 QGridLayout* GroupC1Layout;
149 QGridLayout* GroupC2Layout;
152 #endif // DIALOGBOX_CONE_H