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_CylinderDlg.h
25 // Author : Lucien PIGNOLONI
29 #ifndef DIALOGBOX_CYLINDER_H
30 #define DIALOGBOX_CYLINDER_H
32 #include "SALOME_Selection.h"
34 #include "GEOM_ShapeTypeFilter.hxx"
35 #include "GEOM_EdgeFilter.hxx"
36 #include "GeometryGUI_SpinBox.h"
38 #include <BRepPrimAPI_MakeCylinder.hxx>
39 #include <Precision.hxx>
43 #include <qvalidator.h>
58 //=================================================================================
59 // class : GeometryGUI_CylinderDlg
61 //=================================================================================
62 class GeometryGUI_CylinderDlg : public QDialog
67 GeometryGUI_CylinderDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
68 ~GeometryGUI_CylinderDlg();
72 void Init( SALOME_Selection* Sel ) ;
73 void closeEvent( QCloseEvent* e ) ;
74 void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
75 void MakeCylinderSimulationAndDisplay() ;
77 GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */
78 GeometryGUI* myGeomGUI ; /* Current GeomGUI object */
79 TopoDS_Shape mySimulationTopoDs ;
80 SALOME_Selection* mySelection ; /* User shape selection */
82 gp_Pnt myPoint1 ; /* topology used */
85 Standard_Real myRadius ;
86 Standard_Real myHeight ;
89 QDoubleValidator *myVa ; /* Double validator for numeric input */
90 QDoubleValidator *myVb ; /* Double validator for numeric input */
93 bool myOkDir ; /* to check when arguments is defined */
94 int myConstructorId ; /* Current constructor id = radio button id */
95 QWidget* myEditCurrentArgument; /* Current LineEdit or spin box */
96 Handle(GEOM_ShapeTypeFilter) myVertexFilter ; /* Filter selection */
97 Handle(GEOM_EdgeFilter) myEdgeFilter ; /* Filter selection */
99 QGroupBox* GroupButtons;
100 QPushButton* buttonApply;
101 QPushButton* buttonOk;
102 QPushButton* buttonCancel;
103 QButtonGroup* GroupConstructors;
104 QRadioButton* Constructor1;
105 QRadioButton* Constructor2;
108 QPushButton* SelectButtonC1A1;
109 QLineEdit* LineEditC1A1;
110 QLabel* TextLabelC1A1;
111 QPushButton* SelectButtonC1A2;
112 QLineEdit* LineEditC1A2;
113 QLabel* TextLabelC1A2;
115 QLabel* TextLabelC1A3;
116 GeometryGUI_SpinBox* SpinBox_C1A3 ;
117 QLabel* TextLabelC1A4 ;
118 GeometryGUI_SpinBox* SpinBox_C1A4 ;
120 QLabel* TextLabel_Radius ;
121 GeometryGUI_SpinBox* SpinBox_Radius ;
122 QLabel* TextLabel_Height ;
123 GeometryGUI_SpinBox* SpinBox_Height ;
127 void ConstructorsClicked(int constructorId);
129 void ClickOnCancel();
131 void SetEditCurrentArgument() ;
132 void SelectionIntoArgument() ;
133 void LineEditReturnPressed() ;
134 void DeactivateActiveDialog() ;
135 void ActivateThisDialog() ;
136 void ValueChangedInSpinBox( double newValue ) ;
139 QGridLayout* GeometryGUI_CylinderDlgLayout;
140 QGridLayout* GroupButtonsLayout;
141 QGridLayout* GroupConstructorsLayout;
142 QGridLayout* GroupC1Layout;
143 QGridLayout* GroupC2Layout;
146 #endif // DIALOGBOX_CYLINDER_H