Salome HOME
cd50279712681969b436496ccccfc468a2068329
[modules/geom.git] / src / GEOMGUI / GeometryGUI_SphereDlg.h
1 //  GEOM GEOMGUI : GUI for Geometry component
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
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. 
10 // 
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. 
15 // 
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 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : GeometryGUI_SphereDlg.h
25 //  Author : Lucien PIGNOLONI
26 //  Module : GEOM
27 //  $Header$
28
29 #ifndef DIALOGBOX_SPHERE_H
30 #define DIALOGBOX_SPHERE_H
31
32 #include "SALOME_Selection.h"
33 #include "GEOM_ShapeTypeFilter.hxx"
34
35 #include <gp_Pnt.hxx>
36 #include <TopoDS_Shape.hxx>
37 #include <BRepPrimAPI_MakeSphere.hxx>
38
39 #include <qvariant.h>
40 #include <qdialog.h>
41 #include <qvalidator.h>
42
43 class QVBoxLayout; 
44 class QHBoxLayout; 
45 class QGridLayout; 
46 class QButtonGroup;
47 class QGroupBox;
48 class QLabel;
49 class QLineEdit;
50 class QSpinBox;
51 class QPushButton;
52 class GeometryGUI_SpinBox;
53 class QRadioButton;
54 class GeometryGUI;
55
56
57 //=================================================================================
58 // class    : GeometryGUI_SphereDlg
59 // purpose  :
60 //=================================================================================
61 class GeometryGUI_SphereDlg : public QDialog
62
63     Q_OBJECT
64
65 public:
66     GeometryGUI_SphereDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
67     ~GeometryGUI_SphereDlg();
68
69 private :
70     
71     GEOM::GEOM_Gen_var          myGeom ;                /* Current Geom object */   
72     GeometryGUI*                   myGeomGUI ;             /* Current GeomGUI object */
73     TopoDS_Shape                   mySimulationTopoDs;     /* Shape used for simulation display */    
74     SALOME_Selection*              mySelection ;           /* User shape selection */    
75     gp_Pnt                         myPoint1 ;              /* Points containing the vector */
76
77     Standard_Real                  myRadius ;
78     bool                           myOkRadius ;
79     QDoubleValidator               *myVa ;                 /* Double validator for numeric input myRadius in LineEditC1A2 */
80     QDoubleValidator               *myVb ;                 /* Double validator for numeric input myRadius in LineEditC2A1 */
81
82     bool                           myOkPoint1 ;            /* Are true when myPoint is defined */
83     QWidget*                       myEditCurrentArgument;  /* Current LineEdit or SpinBox */
84     int                            myConstructorId ;       /* Current constructor id = radio button id */    
85     Handle(GEOM_ShapeTypeFilter)   myVertexFilter;         /* Filter selection */
86
87     void closeEvent( QCloseEvent* e ) ;
88     void enterEvent( QEvent* e);
89     void Init( SALOME_Selection* Sel ) ;
90
91     QGroupBox* GroupButtons;
92     QPushButton* buttonApply;
93     QPushButton* buttonOk;
94     QPushButton* buttonCancel;
95     QButtonGroup* GroupConstructors;
96     QRadioButton* Constructor1;
97     QRadioButton* Constructor2;
98     QGroupBox* GroupConstructor1;
99     QLineEdit* LineEditC1A1;
100     QPushButton* SelectButtonC1A1;
101     QLabel* TextLabelC1A1;
102     QLabel* TextLabelC1A2;
103     // QLineEdit* LineEditC1A2;
104     QGroupBox* GroupConstructor2;
105     // QLineEdit* LineEditC2A1;
106     GeometryGUI_SpinBox*  SpinBox_C1A2 ;
107     GeometryGUI_SpinBox*  SpinBox_C2A1 ;
108     QLabel* TextLabelC2A1;
109
110 private slots:
111
112     void ConstructorsClicked(int constructorId);
113     void ClickOnOk();
114     void ClickOnCancel();
115     void ClickOnApply();
116     void LineEditReturnPressed() ;
117     void SetEditCurrentArgument() ;
118     void SelectionIntoArgument() ;
119     void DeactivateActiveDialog() ;
120     void ActivateThisDialog() ;
121     void ValueChangedInSpinBox( double newValue ) ;
122
123 protected:
124     QGridLayout* GeometryGUI_SphereDlgLayout;
125     QGridLayout* GroupButtonsLayout;
126     QGridLayout* GroupConstructorsLayout;
127     QGridLayout* GroupConstructor1Layout;
128     QGridLayout* GroupConstructor2Layout;
129 };
130
131 #endif // DIALOGBOX_SPHERE_H