Salome HOME
NRI : 1_3_0 version.
[modules/geom.git] / src / GEOMGUI / GeometryGUI_EllipseDlg.h
1 //  GEOM GEOMGUI : GUI for Geometry component
2 //
3 //  Copyright (C) 2003  OPEN CASCADE 
4 // 
5 //  This library is free software; you can redistribute it and/or 
6 //  modify it under the terms of the GNU Lesser General Public 
7 //  License as published by the Free Software Foundation; either 
8 //  version 2.1 of the License. 
9 // 
10 //  This library is distributed in the hope that it will be useful, 
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
13 //  Lesser General Public License for more details. 
14 // 
15 //  You should have received a copy of the GNU Lesser General Public 
16 //  License along with this library; if not, write to the Free Software 
17 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
18 // 
19 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
20 //
21 //
22 //
23 //  File   : GeometryGUI_EllipseDlg.h
24 //  Author : Nicolas REJNERI
25 //  Module : GEOM
26 //  $Header$
27
28 #ifndef GEOMETRYGUI_ELLIPSE_H
29 #define GEOMETRYGUI_ELLIPSE_H
30
31 #include "SALOME_Selection.h"
32 #include "GEOM_ShapeTypeFilter.hxx"
33 #include "GEOM_EdgeFilter.hxx"
34 #include "GeometryGUI_SpinBox.h"
35
36 #include <gp_Pnt.hxx>
37 #include <gp_Dir.hxx>
38 #include <BRepBuilderAPI_MakeEdge.hxx>
39
40 #include <qvariant.h>
41 #include <qdialog.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 QPushButton;
51 class QRadioButton;
52 class QSpinBox;
53 class GeometryGUI;
54
55
56 //=================================================================================
57 // class    : GeometryGUI_EllipseDlg
58 // purpose  :
59 //=================================================================================
60 class GeometryGUI_EllipseDlg : public QDialog
61
62     Q_OBJECT
63
64 public:
65     GeometryGUI_EllipseDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
66     ~GeometryGUI_EllipseDlg();
67
68 private :
69
70     void closeEvent( QCloseEvent* e ) ;
71     void enterEvent( QEvent* e );
72     void Init(SALOME_Selection* Sel) ;
73     void MakeEllipseSimulationAndDisplay() ;
74
75     GEOM::GEOM_Gen_var    myGeom ;                /* Current GeomI object */
76     GeometryGUI*          myGeomGUI ;             /* Current GeomGUI object */
77     TopoDS_Shape          mySimulationTopoDs ;    /* Shape used for simulation display */
78     SALOME_Selection*     mySelection ;           /* User shape selection */   
79  
80     gp_Pnt                myPoint ;               /* Central point of ellipse */   
81     bool                  myOkPoint ;             /* true when myPoint is defined */
82
83     gp_Dir                myDir ;                 /* to set normal axis of ellipse */
84     bool                  myOkDir ;               /* true when myPoint is defined */
85     
86     Standard_Real         myMajorRadius ;
87     Standard_Real         myMinorRadius ;
88
89     int                   myConstructorId ;       /* Current constructor id = radio button id */ 
90     QLineEdit*            myEditCurrentArgument;  /* Current LineEdit */
91
92     Handle(GEOM_ShapeTypeFilter) myVertexFilter;  /* filter for selection */
93     Handle(GEOM_EdgeFilter)      myEdgeFilter;    /* filter for selection */
94
95     QButtonGroup* GroupConstructors;
96     QRadioButton* Constructor1;
97     QGroupBox* GroupButtons;
98     QPushButton* buttonApply;
99     QPushButton* buttonCancel;
100     QPushButton* buttonOk;
101     QGroupBox* GroupC1;
102     QLineEdit* LineEditC1A1;
103     QLineEdit* LineEditC1A2;
104     QLabel* TextLabelC1A1;
105     QLabel* TextLabelC1A4;
106     QLabel* TextLabelC1A3;
107     QLabel* TextLabelC1A2;
108     QPushButton* SelectButtonC1A1;
109     QPushButton* SelectButtonC1A2;
110     GeometryGUI_SpinBox* SpinBox_C1A3;
111     GeometryGUI_SpinBox* SpinBox_C1A4;
112
113 private slots:
114
115     void ConstructorsClicked(int constructorId);
116     void ClickOnOk();
117     void ClickOnCancel();
118     void ClickOnApply();
119     void SetEditCurrentArgument() ;
120     void SelectionIntoArgument() ;
121     void LineEditReturnPressed() ;
122     void DeactivateActiveDialog() ;
123     void ActivateThisDialog() ;
124     void ValueChangedInSpinBox(double newValue) ;
125
126 protected:
127     QGridLayout* GeometryGUI_EllipseDlgLayout;
128     QGridLayout* GroupConstructorsLayout;
129     QGridLayout* GroupButtonsLayout;
130     QGridLayout* GroupC1Layout;
131 };
132
133 #endif // GEOMETRYGUI_ELLIPSE_H