1 // File : GeometryGUI_ConeDlg.h
3 // Author : Lucien PIGNOLONI
5 // Module : GeometryGUI
6 // Copyright : OPEN CASCADE
9 #ifndef DIALOGBOX_CONE_H
10 #define DIALOGBOX_CONE_H
12 #include "SALOME_Selection.h"
13 #include "GEOM_ShapeTypeFilter.hxx"
14 #include "GEOM_EdgeFilter.hxx"
15 #include "GeometryGUI_SpinBox.h"
17 #include <BRepPrimAPI_MakeCone.hxx>
18 #include <BRepPrimAPI_MakeCylinder.hxx>
19 #include <Precision.hxx>
23 #include <qvalidator.h>
37 //=================================================================================
38 // class : GeometryGUI_ConeDlg
40 //=================================================================================
41 class GeometryGUI_ConeDlg : public QDialog
46 GeometryGUI_ConeDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
47 ~GeometryGUI_ConeDlg();
51 void Init( SALOME_Selection* Sel ) ;
52 void closeEvent( QCloseEvent* e ) ;
53 void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
54 void MakeConeSimulationAndDisplay() ;
56 GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */
57 GeometryGUI* myGeomGUI ; /* Current GeomGUI object */
58 SALOME_Selection* mySelection ; /* User shape selection */
59 TopoDS_Shape mySimulationTopoDs ;
61 gp_Pnt myPoint1 ; /* Topology used */
64 bool myOkDir ; /* to check when argument is defined */
66 Standard_Real myRadius1 ;
67 Standard_Real myRadius2 ;
68 Standard_Real myHeight ;
72 QDoubleValidator *myVa ; /* Double validator for numeric input myRadius1 */
73 QDoubleValidator *myVb ; /* Double validator for numeric input myRadius2 */
74 QDoubleValidator *myVc ; /* Double validator for numeric input myHeight */
76 int myConstructorId ; /* Current constructor id = radio button id */
77 QWidget* myEditCurrentArgument; /* Current LineEdit or spin box */
78 Handle(GEOM_ShapeTypeFilter) myVertexFilter ; /* Filter selection */
79 Handle(GEOM_EdgeFilter) myEdgeFilter ; /* Filter selection */
82 QButtonGroup* GroupConstructors;
83 QRadioButton* Constructor1;
84 QRadioButton* Constructor2;
85 QGroupBox* GroupButtons;
86 QPushButton* buttonApply;
87 QPushButton* buttonOk;
88 QPushButton* buttonCancel;
91 QPushButton* SelectButtonC1A1;
92 QLineEdit* LineEditC1A1;
93 QLabel* TextLabelC1A1;
94 QPushButton* SelectButtonC1A2;
95 QLineEdit* LineEditC1A2;
96 QLabel* TextLabelC1A2;
97 QLabel* TextLabelC1A3;
98 GeometryGUI_SpinBox* SpinBox_C1A3 ;
99 QLabel* TextLabelC1A4;
100 GeometryGUI_SpinBox* SpinBox_C1A4 ;
101 QLabel* TextLabelC1A5;
102 GeometryGUI_SpinBox* SpinBox_C1A5 ;
104 QLabel* TextLabel_Radius1 ;
105 QLabel* TextLabel_Radius2 ;
106 QLabel* TextLabel_Height ;
107 GeometryGUI_SpinBox* SpinBox_Radius1 ;
108 GeometryGUI_SpinBox* SpinBox_Radius2 ;
109 GeometryGUI_SpinBox* SpinBox_Height ;
113 void ConstructorsClicked(int constructorId);
115 void ClickOnCancel();
117 void SetEditCurrentArgument() ;
118 void SelectionIntoArgument() ;
119 void LineEditReturnPressed() ;
120 void DeactivateActiveDialog() ;
121 void ActivateThisDialog() ;
122 void ValueChangedInSpinBox( double newValue ) ;
125 QGridLayout* GeometryGUI_ConeDlgLayout;
126 QGridLayout* GroupConstructorsLayout;
127 QGridLayout* GroupButtonsLayout;
128 QGridLayout* GroupC1Layout;
129 QGridLayout* GroupC2Layout;
132 #endif // DIALOGBOX_CONE_H