Salome HOME
7385f1a8ee52b29e615a49817472ae242669ee53
[modules/geom.git] / src / GEOMGUI / GeometryGUI_TorusDlg.h
1 //  File      : GeometryGUI_TorusDlg.h
2 //  Created   :
3 //  Author    : Lucien PIGNOLONI
4 //  Project   : SALOME
5 //  Module    : GeometryGUI
6 //  Copyright : OPEN CASCADE
7 //  $Header$
8
9 #ifndef DIALOGBOX_TORUS_H
10 #define DIALOGBOX_TORUS_H
11
12 #include "SALOME_Selection.h"
13 #include "GEOM_ShapeTypeFilter.hxx"
14 #include "GEOM_EdgeFilter.hxx"
15 #include "GeometryGUI_SpinBox.h"
16
17 #include <TopoDS_Shape.hxx>
18 #include <BRepPrimAPI_MakeTorus.hxx>
19 #include <gp_Pnt.hxx>
20 #include <gp_Dir.hxx>
21
22 #include <qvariant.h>
23 #include <qdialog.h>
24 #include <qvalidator.h>
25
26 class QVBoxLayout; 
27 class QHBoxLayout; 
28 class QGridLayout; 
29 class QButtonGroup;
30 class QGroupBox;
31 class QLabel;
32 class QLineEdit;
33 class QPushButton;
34 class QRadioButton;
35 class QSpinBox ;
36 class GeometryGUI;
37
38
39 //=================================================================================
40 // class    : GeometryGUI_TorusDlg
41 // purpose  :
42 //=================================================================================
43 class GeometryGUI_TorusDlg : public QDialog
44
45     Q_OBJECT
46
47 public:
48     GeometryGUI_TorusDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
49     ~GeometryGUI_TorusDlg();
50
51 private:
52
53     void Init( SALOME_Selection* Sel ) ;
54     void closeEvent( QCloseEvent* e ) ;
55     void enterEvent ( QEvent * ) ;                 /* mouse enter the QWidget */
56     void MakeTorusSimulationAndDisplay() ;
57
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 */
62
63     gp_Pnt                myPoint1 ;               /* Topology used  */
64     gp_Dir                myDir ;
65     bool                  myOkPoint1 ;
66     bool                  myOkDir ;                /* to check when arguments is defined */
67
68     Standard_Real         myRadius1 ;
69     Standard_Real         myRadius2 ;
70     bool                  myOkRadius1 ;
71     bool                  myOkRadius2 ;
72     QDoubleValidator      *myVa ;                  /* Double validator for numeric input myRadius1 */
73     QDoubleValidator      *myVb ;                  /* Double validator for numeric input myRadius2 */
74
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 */
79
80     QButtonGroup* GroupConstructors;
81     QRadioButton* Constructor1;
82     QRadioButton* Constructor2;
83     QGroupBox* GroupC1;
84     QGroupBox* GroupC2;
85     QPushButton* SelectButtonC1A1;
86     QPushButton* SelectButtonC1A2;
87     QLineEdit* LineEditC1A1;
88     QLineEdit* LineEditC1A2;
89     
90     GeometryGUI_SpinBox* SpinBox_C1A3 ;
91     GeometryGUI_SpinBox* SpinBox_C1A4 ;
92      
93     QLabel* TextLabelC1A1;
94     QLabel* TextLabelC1A2;
95     QLabel* TextLabelC1A3;
96     QLabel* TextLabelC1A4;
97     QGroupBox* GroupButtons;
98     QPushButton* buttonApply;
99     QPushButton* buttonOk;
100     QPushButton* buttonCancel;
101
102     QLabel* TextLabel_Radius1 ;
103     QLabel* TextLabel_Radius2 ;
104     GeometryGUI_SpinBox* SpinBox_Radius1 ;
105     GeometryGUI_SpinBox* SpinBox_Radius2 ;
106
107 private slots:
108
109     void ConstructorsClicked(int constructorId);
110     void ClickOnOk();
111     void ClickOnCancel();
112     void ClickOnApply();
113     void SetEditCurrentArgument() ;
114     void SelectionIntoArgument() ;
115     void LineEditReturnPressed() ;
116     void DeactivateActiveDialog() ;
117     void ActivateThisDialog() ;
118     void ValueChangedInSpinBox( double newValue ) ;
119
120 protected:
121     QGridLayout* GeometryGUI_TorusDlgLayout;
122     QGridLayout* GroupButtonsLayout;
123     QGridLayout* GroupConstructorsLayout;
124     QGridLayout* GroupC1Layout;
125     QGridLayout* GroupC2Layout;
126 };
127
128 #endif // DIALOGBOX_TORUS_H