1 // File : GeometryGUI_TorusDlg.h
3 // Author : Lucien PIGNOLONI
5 // Module : GeometryGUI
6 // Copyright : OPEN CASCADE
9 #ifndef DIALOGBOX_TORUS_H
10 #define DIALOGBOX_TORUS_H
12 #include "SALOME_Selection.h"
13 #include "GEOM_ShapeTypeFilter.hxx"
14 #include "GEOM_EdgeFilter.hxx"
15 #include "GeometryGUI_SpinBox.h"
17 #include <TopoDS_Shape.hxx>
18 #include <BRepPrimAPI_MakeTorus.hxx>
24 #include <qvalidator.h>
39 //=================================================================================
40 // class : GeometryGUI_TorusDlg
42 //=================================================================================
43 class GeometryGUI_TorusDlg : public QDialog
48 GeometryGUI_TorusDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
49 ~GeometryGUI_TorusDlg();
53 void Init( SALOME_Selection* Sel ) ;
54 void closeEvent( QCloseEvent* e ) ;
55 void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
56 void MakeTorusSimulationAndDisplay() ;
58 GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */
59 GeometryGUI* myGeomGUI ; /* Current GeomGUI object */
60 TopoDS_Shape mySimulationTopoDs ;
61 SALOME_Selection* mySelection ; /* User shape selection */
63 gp_Pnt myPoint1 ; /* Topology used */
66 bool myOkDir ; /* to check when arguments is defined */
68 Standard_Real myRadius1 ;
69 Standard_Real myRadius2 ;
72 QDoubleValidator *myVa ; /* Double validator for numeric input myRadius1 */
73 QDoubleValidator *myVb ; /* Double validator for numeric input myRadius2 */
75 int myConstructorId ; /* Current constructor id = radio button id */
76 QWidget* myEditCurrentArgument; /* Current LineEdit or spin box */
77 Handle(GEOM_ShapeTypeFilter) myVertexFilter ; /* Filter selection */
78 Handle(GEOM_EdgeFilter) myEdgeFilter ; /* Filter selection */
80 QButtonGroup* GroupConstructors;
81 QRadioButton* Constructor1;
82 QRadioButton* Constructor2;
85 QPushButton* SelectButtonC1A1;
86 QPushButton* SelectButtonC1A2;
87 QLineEdit* LineEditC1A1;
88 QLineEdit* LineEditC1A2;
90 GeometryGUI_SpinBox* SpinBox_C1A3 ;
91 GeometryGUI_SpinBox* SpinBox_C1A4 ;
93 QLabel* TextLabelC1A1;
94 QLabel* TextLabelC1A2;
95 QLabel* TextLabelC1A3;
96 QLabel* TextLabelC1A4;
97 QGroupBox* GroupButtons;
98 QPushButton* buttonApply;
99 QPushButton* buttonOk;
100 QPushButton* buttonCancel;
102 QLabel* TextLabel_Radius1 ;
103 QLabel* TextLabel_Radius2 ;
104 GeometryGUI_SpinBox* SpinBox_Radius1 ;
105 GeometryGUI_SpinBox* SpinBox_Radius2 ;
109 void ConstructorsClicked(int constructorId);
111 void ClickOnCancel();
113 void SetEditCurrentArgument() ;
114 void SelectionIntoArgument() ;
115 void LineEditReturnPressed() ;
116 void DeactivateActiveDialog() ;
117 void ActivateThisDialog() ;
118 void ValueChangedInSpinBox( double newValue ) ;
121 QGridLayout* GeometryGUI_TorusDlgLayout;
122 QGridLayout* GroupButtonsLayout;
123 QGridLayout* GroupConstructorsLayout;
124 QGridLayout* GroupC1Layout;
125 QGridLayout* GroupC2Layout;
128 #endif // DIALOGBOX_TORUS_H