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_TorusDlg.h
25 // Author : Lucien PIGNOLONI
29 #ifndef DIALOGBOX_TORUS_H
30 #define DIALOGBOX_TORUS_H
32 #include "SALOME_Selection.h"
33 #include "GEOM_ShapeTypeFilter.hxx"
34 #include "GEOM_EdgeFilter.hxx"
35 #include "GeometryGUI_SpinBox.h"
37 #include <TopoDS_Shape.hxx>
38 #include <BRepPrimAPI_MakeTorus.hxx>
44 #include <qvalidator.h>
59 //=================================================================================
60 // class : GeometryGUI_TorusDlg
62 //=================================================================================
63 class GeometryGUI_TorusDlg : public QDialog
68 GeometryGUI_TorusDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
69 ~GeometryGUI_TorusDlg();
73 void Init( SALOME_Selection* Sel ) ;
74 void closeEvent( QCloseEvent* e ) ;
75 void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
76 void MakeTorusSimulationAndDisplay() ;
78 GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */
79 GeometryGUI* myGeomGUI ; /* Current GeomGUI object */
80 TopoDS_Shape mySimulationTopoDs ;
81 SALOME_Selection* mySelection ; /* User shape selection */
83 gp_Pnt myPoint1 ; /* Topology used */
86 bool myOkDir ; /* to check when arguments is defined */
88 Standard_Real myRadius1 ;
89 Standard_Real myRadius2 ;
92 QDoubleValidator *myVa ; /* Double validator for numeric input myRadius1 */
93 QDoubleValidator *myVb ; /* Double validator for numeric input myRadius2 */
95 int myConstructorId ; /* Current constructor id = radio button id */
96 QWidget* myEditCurrentArgument; /* Current LineEdit or spin box */
97 Handle(GEOM_ShapeTypeFilter) myVertexFilter ; /* Filter selection */
98 Handle(GEOM_EdgeFilter) myEdgeFilter ; /* Filter selection */
100 QButtonGroup* GroupConstructors;
101 QRadioButton* Constructor1;
102 QRadioButton* Constructor2;
105 QPushButton* SelectButtonC1A1;
106 QPushButton* SelectButtonC1A2;
107 QLineEdit* LineEditC1A1;
108 QLineEdit* LineEditC1A2;
110 GeometryGUI_SpinBox* SpinBox_C1A3 ;
111 GeometryGUI_SpinBox* SpinBox_C1A4 ;
113 QLabel* TextLabelC1A1;
114 QLabel* TextLabelC1A2;
115 QLabel* TextLabelC1A3;
116 QLabel* TextLabelC1A4;
117 QGroupBox* GroupButtons;
118 QPushButton* buttonApply;
119 QPushButton* buttonOk;
120 QPushButton* buttonCancel;
122 QLabel* TextLabel_Radius1 ;
123 QLabel* TextLabel_Radius2 ;
124 GeometryGUI_SpinBox* SpinBox_Radius1 ;
125 GeometryGUI_SpinBox* SpinBox_Radius2 ;
129 void ConstructorsClicked(int constructorId);
131 void ClickOnCancel();
133 void SetEditCurrentArgument() ;
134 void SelectionIntoArgument() ;
135 void LineEditReturnPressed() ;
136 void DeactivateActiveDialog() ;
137 void ActivateThisDialog() ;
138 void ValueChangedInSpinBox( double newValue ) ;
141 QGridLayout* GeometryGUI_TorusDlgLayout;
142 QGridLayout* GroupButtonsLayout;
143 QGridLayout* GroupConstructorsLayout;
144 QGridLayout* GroupC1Layout;
145 QGridLayout* GroupC2Layout;
148 #endif // DIALOGBOX_TORUS_H